diff options
author | Ella Feng <ella.feng@nxp.com> | 2020-04-21 21:56:28 +0800 |
---|---|---|
committer | Ella Feng <ella.feng@nxp.com> | 2020-04-23 21:58:39 +0800 |
commit | 855447f2e9119e8a2dfadd77dae18ad16662827c (patch) | |
tree | e5c60c77d23ac5340ca1f15e8ef9a8f7b80b1760 /drivers/mxc | |
parent | 0ca28690adbcddf31930a6b09d2a267862c71d98 (diff) |
MGS-5616-1 [#ccc] Update some Linux APIs for 5.5 kernel
Replace ioremap_nocache() with ioremap, and use updated timespec struct instead of 32bit one.
Date: 21 Apr, 2020
Signed-off-by: Ella Feng <ella.feng@nxp.com>
Diffstat (limited to 'drivers/mxc')
3 files changed, 22 insertions, 2 deletions
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_reserved_mem.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_reserved_mem.c index bbba6cca7517..3742300cbafe 100644 --- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_reserved_mem.c +++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_reserved_mem.c @@ -394,12 +394,14 @@ reserved_mem_map_kernel( return gcvSTATUS_INVALID_ARGUMENT; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0) + vaddr = ioremap(res->start + Offset, Bytes); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0) vaddr = memremap(res->start + Offset, Bytes, MEMREMAP_WC); #elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0) vaddr = memremap(res->start + Offset, Bytes, MEMREMAP_WT); #else - vaddr = ioremap(res->start + Offset, Bytes); + vaddr = ioremap_nocache(res->start + Offset, Bytes); #endif if (!vaddr) diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c index 12392e9fa1e6..fa255dc9bb0c 100644 --- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c +++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c @@ -1962,7 +1962,11 @@ gckGALDEVICE_Construct( gcmkONERROR(gcvSTATUS_OUT_OF_RESOURCES); } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0) device->registerBases[i] = (gctPOINTER)ioremap( +#else + device->registerBases[i] = (gctPOINTER)ioremap_nocache( +#endif physical, device->requestedRegisterMemSizes[i]); if (device->registerBases[i] == gcvNULL) diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c index b2ab1b1250d9..bf58c2751699 100644 --- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c +++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c @@ -2271,7 +2271,11 @@ gckOS_MapPhysical( { /* Map memory as cached memory. */ request_mem_region(physical, Bytes, "MapRegion"); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0) logical = (gctPOINTER) ioremap(physical, Bytes); +#else + logical = (gctPOINTER) ioremap_nocache(physical, Bytes); +#endif if (logical == gcvNULL) { @@ -5190,9 +5194,15 @@ gckOS_GetProfileTick( OUT gctUINT64_PTR Tick ) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0) struct timespec64 time; ktime_get_ts64(&time); +#else + struct timespec time; + + ktime_get_ts(&time); +#endif *Tick = time.tv_nsec + time.tv_sec * 1000000000ULL; @@ -5204,7 +5214,11 @@ gckOS_QueryProfileTickRate( OUT gctUINT64_PTR TickRate ) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0) struct timespec64 res; +#else + struct timespec res; +#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) res.tv_sec = 0; |