diff options
author | Mathias Kresin <dev@kresin.me> | 2020-03-04 00:39:59 +0100 |
---|---|---|
committer | Mathias Kresin <dev@kresin.me> | 2020-03-16 22:28:16 +0100 |
commit | a6698551e5bc4b2f049b3303a664ae67d6a0494e (patch) | |
tree | a04f7e740d17959b80465e24d5a83f2e3e79d85a /package/kernel/lantiq | |
parent | a3539c82cb38366151019438ea841e8ae47cb1c2 (diff) | |
download | upstream-a6698551e5bc4b2f049b3303a664ae67d6a0494e.tar.gz upstream-a6698551e5bc4b2f049b3303a664ae67d6a0494e.tar.bz2 upstream-a6698551e5bc4b2f049b3303a664ae67d6a0494e.zip |
ltq-adsl: fix compilation with Linux 5.0+
Upstream commit e4b92b108c6cd6 ("timekeeping: remove obsolete time
accessors") removed do_gettimeofday(). In Linux 4.19 this was only a
wrapper around ktime_get_real_ts64(). Use ktime_get_real_ts64() now that
the wrapper is gone to fix compilation against Linux 5.4.
Move the ifxmips_mei_interface header to the include directory, it can't
be found otherwise during compilation. The reason for the changed
behaviour is not yet clear, however having header files in an include
directory is more straight forward.
To use the of_device_id struct, the mod_devicetable header need to be
included. Instead of including this header, include the of_platform
header, which includes the mod_devicetable on its own.
Signed-off-by: Mathias Kresin <dev@kresin.me>
Diffstat (limited to 'package/kernel/lantiq')
3 files changed, 42 insertions, 20 deletions
diff --git a/package/kernel/lantiq/ltq-adsl/patches/100-dsl_compat.patch b/package/kernel/lantiq/ltq-adsl/patches/100-dsl_compat.patch index 431ccb6ebc..1e860010e9 100644 --- a/package/kernel/lantiq/ltq-adsl/patches/100-dsl_compat.patch +++ b/package/kernel/lantiq/ltq-adsl/patches/100-dsl_compat.patch @@ -82,7 +82,28 @@ if ( (_IOC_TYPE(nCommand) == DSL_IOC_MAGIC_CPE_API) || (_IOC_TYPE(nCommand) == DSL_IOC_MAGIC_CPE_API_G997) || (_IOC_TYPE(nCommand) == DSL_IOC_MAGIC_CPE_API_PM) || -@@ -1058,6 +1065,7 @@ static void DSL_DRV_DebugInit(void) +@@ -828,12 +835,19 @@ DSL_int32_t DSL_DRV_ThreadShutdown( + + DSL_uint32_t DSL_DRV_SysTimeGet(DSL_uint32_t nOffset) + { +- struct timeval tv; + DSL_uint32_t nTime = 0; ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)) ++ struct timeval tv; + + memset(&tv, 0, sizeof(tv)); + do_gettimeofday(&tv); + nTime = (DSL_uint32_t)tv.tv_sec; ++#else ++ struct timespec64 now; ++ ++ ktime_get_real_ts64(&now); ++ nTime = (DSL_uint32_t)now.tv_sec; ++#endif + + if ( (nOffset == 0) || (nOffset > nTime) ) + { +@@ -1058,6 +1072,7 @@ static void DSL_DRV_DebugInit(void) /* Entry point of driver */ int __init DSL_ModuleInit(void) { @@ -90,7 +111,7 @@ DSL_int_t i; printk(DSL_DRV_CRLF DSL_DRV_CRLF "Infineon CPE API Driver version: %s" DSL_DRV_CRLF, -@@ -1104,7 +1112,8 @@ int __init DSL_ModuleInit(void) +@@ -1104,7 +1119,8 @@ int __init DSL_ModuleInit(void) } DSL_DRV_DevNodeInit(); @@ -137,7 +158,7 @@ #ifdef INCLUDE_DSL_CPE_API_IFXOS_SUPPORT /** IFXOS includes*/ --- /dev/null -+++ b/src/ifxmips_mei_interface.h ++++ b/src/include/ifxmips_mei_interface.h @@ -0,0 +1,702 @@ +/****************************************************************************** + diff --git a/package/kernel/lantiq/ltq-adsl/patches/120-platform.patch b/package/kernel/lantiq/ltq-adsl/patches/120-platform.patch index 20c1ccf471..e1dc254ec0 100644 --- a/package/kernel/lantiq/ltq-adsl/patches/120-platform.patch +++ b/package/kernel/lantiq/ltq-adsl/patches/120-platform.patch @@ -1,14 +1,15 @@ --- a/src/common/drv_dsl_cpe_os_linux.c +++ b/src/common/drv_dsl_cpe_os_linux.c -@@ -12,6 +12,7 @@ +@@ -11,7 +11,7 @@ + #ifdef __LINUX__ #define DSL_INTERN - #include <linux/device.h> -+#include <linux/platform_device.h> +-#include <linux/device.h> ++#include <linux/of_platform.h> #include "drv_dsl_cpe_api.h" #include "drv_dsl_cpe_api_ioctl.h" -@@ -1063,7 +1064,7 @@ static void DSL_DRV_DebugInit(void) +@@ -1070,7 +1070,7 @@ static void DSL_DRV_DebugInit(void) #endif /* Entry point of driver */ @@ -17,7 +18,7 @@ { struct class *dsl_class; DSL_int_t i; -@@ -1117,7 +1118,7 @@ int __init DSL_ModuleInit(void) +@@ -1124,7 +1124,7 @@ int __init DSL_ModuleInit(void) return 0; } @@ -26,7 +27,7 @@ { printk("Module will be unloaded"DSL_DRV_CRLF); -@@ -1132,7 +1133,7 @@ void __exit DSL_ModuleCleanup(void) +@@ -1139,7 +1139,7 @@ void __exit DSL_ModuleCleanup(void) (DSL_uint8_t**)&g_BndFpgaBase); #endif /* defined(INCLUDE_DSL_CPE_API_VINAX) && defined(INCLUDE_DSL_BONDING)*/ @@ -35,7 +36,7 @@ } #ifndef _lint -@@ -1148,8 +1149,30 @@ module_param(debug_level, byte, 0); +@@ -1155,8 +1155,30 @@ module_param(debug_level, byte, 0); MODULE_PARM_DESC(debug_level, "set to get more (1) or fewer (4) debug outputs"); #endif /* #ifndef DSL_DEBUG_DISABLE*/ diff --git a/package/kernel/lantiq/ltq-adsl/patches/130-linux3.8.patch b/package/kernel/lantiq/ltq-adsl/patches/130-linux3.8.patch index 3e2d8dcc2a..93c2f67796 100644 --- a/package/kernel/lantiq/ltq-adsl/patches/130-linux3.8.patch +++ b/package/kernel/lantiq/ltq-adsl/patches/130-linux3.8.patch @@ -5,10 +5,10 @@ #define DSL_INTERN +#include <linux/kthread.h> - #include <linux/device.h> - #include <linux/platform_device.h> + #include <linux/of_platform.h> -@@ -40,7 +41,7 @@ static DSL_ssize_t DSL_DRV_Write(DSL_DRV + #include "drv_dsl_cpe_api.h" +@@ -39,7 +40,7 @@ static DSL_ssize_t DSL_DRV_Write(DSL_DRV static DSL_int_t DSL_DRV_Ioctls(DSL_DRV_inode_t * pINode, DSL_DRV_file_t * pFile, DSL_uint_t nCommand, unsigned long nArg); #else @@ -17,7 +17,7 @@ DSL_uint_t nCommand, unsigned long nArg); #endif static int DSL_DRV_Open(DSL_DRV_inode_t * ino, DSL_DRV_file_t * fil); -@@ -184,7 +185,7 @@ static DSL_int_t DSL_DRV_Ioctls(DSL_DRV_ +@@ -183,7 +184,7 @@ static DSL_int_t DSL_DRV_Ioctls(DSL_DRV_ DSL_uint_t nCommand, unsigned long nArg) #else @@ -26,7 +26,7 @@ DSL_DRV_file_t * pFile, DSL_uint_t nCommand, unsigned long nArg) -@@ -521,9 +522,9 @@ DSL_void_t* DSL_IoctlMemCpyTo( +@@ -520,9 +521,9 @@ DSL_void_t* DSL_IoctlMemCpyTo( - IFX_SUCCESS on success - IFX_ERROR on error */ @@ -38,7 +38,7 @@ DSL_int32_t retVal = -1; #ifndef _lint -@@ -546,30 +547,6 @@ DSL_DRV_STATIC DSL_int32_t DSL_DRV_Kerne +@@ -545,30 +546,6 @@ DSL_DRV_STATIC DSL_int32_t DSL_DRV_Kerne (DSL_NULL, "ENTER - Kernel Thread Startup <%s>" DSL_DRV_CRLF, pThrCntrl->thrParams.pName)); @@ -69,7 +69,7 @@ /*DSL_DRV_ThreadPriorityModify(pThrCntrl->nPriority);*/ pThrCntrl->thrParams.bRunning = 1; -@@ -639,9 +616,7 @@ DSL_int32_t DSL_DRV_ThreadInit( +@@ -638,9 +615,7 @@ DSL_int32_t DSL_DRV_ThreadInit( init_completion(&pThrCntrl->thrCompletion); /* start kernel thread via the wrapper function */ @@ -80,7 +80,7 @@ pThrCntrl->bValid = DSL_TRUE; -@@ -1064,12 +1039,12 @@ static void DSL_DRV_DebugInit(void) +@@ -1070,12 +1045,12 @@ static void DSL_DRV_DebugInit(void) #endif /* Entry point of driver */ @@ -95,7 +95,7 @@ &(dsl_cpe_api_version[4])); DSL_DRV_MemSet( ifxDevices, 0, sizeof(DSL_devCtx_t) * DSL_DRV_MAX_DEVICE_NUMBER ); -@@ -1118,7 +1093,7 @@ static int __devinit ltq_adsl_probe(stru +@@ -1124,7 +1099,7 @@ static int __devinit ltq_adsl_probe(stru return 0; } @@ -104,7 +104,7 @@ { printk("Module will be unloaded"DSL_DRV_CRLF); -@@ -1163,7 +1138,7 @@ MODULE_DEVICE_TABLE(of, ltq_adsl_match); +@@ -1169,7 +1144,7 @@ MODULE_DEVICE_TABLE(of, ltq_adsl_match); static struct platform_driver ltq_adsl_driver = { .probe = ltq_adsl_probe, |