add chaos_calmer branch
[15.05/openwrt.git] / package / kernel / lantiq / ltq-vdsl-mei / patches / 100-compat.patch
1 Index: drv_mei_cpe-1.2.0/src/drv_mei_cpe_common.c
2 ===================================================================
3 --- drv_mei_cpe-1.2.0.orig/src/drv_mei_cpe_common.c     2011-10-26 00:49:51.000000000 +0200
4 +++ drv_mei_cpe-1.2.0/src/drv_mei_cpe_common.c  2013-09-01 21:04:12.197022086 +0200
5 @@ -20,7 +20,6 @@
6  /* get at first the driver configuration */
7  #include "drv_mei_cpe_config.h"
8  
9 -#include "ifx_types.h"
10  #include "drv_mei_cpe_os.h"
11  #include "drv_mei_cpe_dbg.h"
12  
13 Index: drv_mei_cpe-1.2.0/configure.in
14 ===================================================================
15 --- drv_mei_cpe-1.2.0.orig/configure.in 2012-01-20 17:41:07.000000000 +0100
16 +++ drv_mei_cpe-1.2.0/configure.in      2013-09-01 21:04:12.197022086 +0200
17 @@ -140,7 +140,7 @@
18  AC_ARG_ENABLE(kernelbuild,
19     AC_HELP_STRING([--enable-kernelbuild=x],[Set the target kernel build path]),
20      [
21 -        if test -e $enableval/include/linux/autoconf.h; then
22 +        if test -e $enableval/include/generated/autoconf.h; then
23              AC_SUBST([KERNEL_BUILD_PATH],[$enableval])
24          else
25              AC_MSG_ERROR([The kernel build directory is not valid or not configured!])
26 Index: drv_mei_cpe-1.2.0/configure
27 ===================================================================
28 --- drv_mei_cpe-1.2.0.orig/configure    2012-01-20 17:50:02.000000000 +0100
29 +++ drv_mei_cpe-1.2.0/configure 2013-09-01 21:04:14.361022179 +0200
30 @@ -617,6 +617,7 @@
31  am__fastdepCC_FALSE
32  am__fastdepCC_TRUE
33  CCDEPMODE
34 +am__nodep
35  AMDEPBACKSLASH
36  AMDEP_FALSE
37  AMDEP_TRUE
38 @@ -2367,11 +2368,11 @@
39  
40  # We need awk for the "check" target.  The system "awk" is bad on
41  # some platforms.
42 -# Always define AMTAR for backward compatibility.
43 +# Always define AMTAR for backward compatibility.  Yes, it's still used
44 +# in the wild :-(  We should find a proper way to deprecate it ...
45 +AMTAR='$${TAR-tar}'
46  
47 -AMTAR=${AMTAR-"${am_missing_run}tar"}
48 -
49 -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
50 +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
51  
52  
53  
54 @@ -3219,6 +3220,7 @@
55  if test "x$enable_dependency_tracking" != xno; then
56    am_depcomp="$ac_aux_dir/depcomp"
57    AMDEPBACKSLASH='\'
58 +  am__nodep='_no'
59  fi
60   if test "x$enable_dependency_tracking" != xno; then
61    AMDEP_TRUE=
62 @@ -3243,6 +3245,7 @@
63    # instance it was reported that on HP-UX the gcc test will end up
64    # making a dummy file named `D' -- because `-MD' means `put the output
65    # in D'.
66 +  rm -rf conftest.dir
67    mkdir conftest.dir
68    # Copy depcomp to subdir because otherwise we won't find it if we're
69    # using a relative directory.
70 @@ -3302,7 +3305,7 @@
71         break
72        fi
73        ;;
74 -    msvisualcpp | msvcmsys)
75 +    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
76        # This compiler won't grok `-c -o', but also, the minuso test has
77        # not run yet.  These depmodes are late enough in the game, and
78        # so weak that their functioning should not be impacted.
79 @@ -3656,7 +3659,7 @@
80  # Check whether --enable-kernelbuild was given.
81  if test "${enable_kernelbuild+set}" = set; then :
82    enableval=$enable_kernelbuild;
83 -        if test -e $enableval/include/linux/autoconf.h; then
84 +        if test -e $enableval/include/generated/autoconf.h; then
85              KERNEL_BUILD_PATH=$enableval
86  
87          else
88 Index: drv_mei_cpe-1.2.0/src/drv_mei_cpe_linux.h
89 ===================================================================
90 --- drv_mei_cpe-1.2.0.orig/src/drv_mei_cpe_linux.h      2011-07-25 20:41:02.000000000 +0200
91 +++ drv_mei_cpe-1.2.0/src/drv_mei_cpe_linux.h   2013-09-01 21:04:12.197022086 +0200
92 @@ -34,8 +34,6 @@
93  #include <linux/sched.h>
94  #include <linux/interrupt.h>
95  
96 -#include <asm/ifx/irq.h>
97 -
98  #if (MEI_DRV_IFXOS_ENABLE == 0)
99  
100  #include <linux/version.h>
101 @@ -44,8 +42,6 @@
102  #include <linux/poll.h>
103  #include <linux/types.h>
104  
105 -#include <asm/ifx/ifx_types.h>
106 -
107  #endif /* #if (MEI_DRV_IFXOS_ENABLE == 0)*/
108  
109  /* ============================================================================
110 Index: drv_mei_cpe-1.2.0/src/drv_mei_cpe_mei_vr9.h
111 ===================================================================
112 --- drv_mei_cpe-1.2.0.orig/src/drv_mei_cpe_mei_vr9.h    2011-07-25 20:41:02.000000000 +0200
113 +++ drv_mei_cpe-1.2.0/src/drv_mei_cpe_mei_vr9.h 2013-09-01 21:04:12.197022086 +0200
114 @@ -40,12 +40,6 @@
115  #endif
116  #endif
117  
118 -#ifdef LINUX
119 -   #include <asm/ifx/ifx_pmu.h>
120 -#else
121 -   #error "Please check PMU driver path!"
122 -#endif
123 -
124  /* ============================================================================
125     Module      :  RCU register address and bits
126     ========================================================================= */
127 Index: drv_mei_cpe-1.2.0/src/drv_mei_cpe_api_atm_ptm_intern.c
128 ===================================================================
129 --- drv_mei_cpe-1.2.0.orig/src/drv_mei_cpe_api_atm_ptm_intern.c 2011-07-25 20:41:02.000000000 +0200
130 +++ drv_mei_cpe-1.2.0/src/drv_mei_cpe_api_atm_ptm_intern.c      2013-09-01 21:04:12.197022086 +0200
131 @@ -25,11 +25,7 @@
132  #include "ifx_types.h"
133  #include "drv_mei_cpe_os.h"
134  
135 -#ifdef LINUX
136 -   #include <asm/ifx/ifx_atm.h>
137 -#else
138 -   #error "ATM/PTM internal interface is only supported for Linux!"
139 -#endif
140 +#include <lantiq_atm.h>
141  
142  /** get interface and configuration */
143  #include "drv_mei_cpe_interface.h"
144 Index: drv_mei_cpe-1.2.0/src/drv_mei_cpe_linux.c
145 ===================================================================
146 --- drv_mei_cpe-1.2.0.orig/src/drv_mei_cpe_linux.c      2011-07-25 20:41:02.000000000 +0200
147 +++ drv_mei_cpe-1.2.0/src/drv_mei_cpe_linux.c   2013-09-01 21:04:12.197022086 +0200
148 @@ -32,11 +32,9 @@
149  #include <linux/module.h>
150  #include <linux/version.h>
151  
152 -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,17))
153 -#include <linux/utsrelease.h>
154 -#endif
155 -#include <linux/init.h>
156 +#include <generated/utsrelease.h>
157  
158 +#include <linux/device.h>
159  #include <linux/ioport.h>
160  #include <linux/irq.h>
161  #include <asm/io.h>
162 @@ -67,6 +65,9 @@
163  
164  #include "drv_mei_cpe_msg_process.h"
165  
166 +#undef MEI_SUPPORT_PROCFS_CONFIG
167 +#undef CONFIG_PROC_FS
168 +
169  #if (MEI_SUPPORT_PROCFS_CONFIG == 1)
170  #include "drv_mei_cpe_linux_proc_config.h"
171  #endif /* MEI_SUPPORT_PROCFS_CONFIG */
172 @@ -87,6 +88,8 @@
173  #include "drv_mei_cpe_device_cntrl.h"
174  #endif
175  
176 +#define INT_NUM_IM4_IRL30 (INT_NUM_IM4_IRL0 + 30)
177 +
178  /* ===================================
179     extern function declarations
180     =================================== */
181 @@ -122,7 +125,7 @@
182                       size_t length,
183                       loff_t * ppos);
184  
185 -static int MEI_Ioctl( struct inode *inode, struct file *filp,
186 +static long MEI_Ioctl(struct file *filp,
187                          unsigned int nCmd, unsigned long nArgument);
188  
189  static unsigned int MEI_Poll (struct file *filp, poll_table *table);
190 @@ -137,7 +140,7 @@
191  
192  static void MEI_IfxFreeIrq(unsigned int usedIrq, void *pUsedDevId);
193  
194 -static irqreturn_t MEI_InterruptLinux(int irq, void *dev_id, struct pt_regs *regs);
195 +static irqreturn_t MEI_InterruptLinux(int irq, void *dev_id);
196  #endif
197  
198  #if CONFIG_PROC_FS
199 @@ -194,7 +197,9 @@
200  /* =================================== */
201  /* Local variables (LINUX)             */
202  /* =================================== */
203 -static IFX_uint8_t major_number = 0;
204 +#define MEI_MAJOR       105
205 +
206 +static IFX_uint8_t major_number = MEI_MAJOR;
207  #ifdef MODULE
208  #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
209  MODULE_PARM(major_number, "b");
210 @@ -242,7 +247,7 @@
211          MEI_Write,
212      poll:
213          MEI_Poll,
214 -    ioctl:
215 +    unlocked_ioctl:
216          MEI_Ioctl,
217      open:
218          MEI_OpenOS,
219 @@ -457,7 +462,7 @@
220     0 and positive values - success,
221     negative value - ioctl failed
222  */
223 -static int MEI_Ioctl( struct inode *inode, struct file *filp,
224 +static long MEI_Ioctl(struct file *filp,
225                              unsigned int nCmd, unsigned long nArgument)
226  {
227     int ret = 0, retSize = sizeof(IOCTL_MEI_ioctl_t);
228 @@ -1242,7 +1247,7 @@
229  \remark
230     None.
231  */
232 -static irqreturn_t MEI_InterruptLinux(int irq, void *dev_id, struct pt_regs *regs)
233 +static irqreturn_t MEI_InterruptLinux(int irq, void *dev_id)
234  {
235     IFX_int32_t    meiIntCnt = 0;
236     MEIX_CNTRL_T *pMeiXCntrlList = (MEIX_CNTRL_T*)dev_id;
237 @@ -1691,6 +1696,7 @@
238  static int __init MEI_module_init (void)
239  {
240     int result;
241 +   static struct class *dsl_class;
242  
243     printk(KERN_INFO "%s" MEI_DRV_CRLF, &MEI_WHATVERSION[4]);
244     printk(KERN_INFO "(c) Copyright 2009, Infineon Technologies AG" MEI_DRV_CRLF);
245 @@ -1730,6 +1736,8 @@
246        return (result);
247     }
248  
249 +   dsl_class = class_create(THIS_MODULE, "ifx_mei");
250 +   device_create(dsl_class, NULL, MKDEV(MEI_MAJOR, 0), NULL, "ifx_mei");
251     return 0;
252  }
253  
254 Index: drv_mei_cpe-1.2.0/src/drv_mei_cpe_mei_access_vr9.c
255 ===================================================================
256 --- drv_mei_cpe-1.2.0.orig/src/drv_mei_cpe_mei_access_vr9.c     2011-07-25 20:41:02.000000000 +0200
257 +++ drv_mei_cpe-1.2.0/src/drv_mei_cpe_mei_access_vr9.c  2013-09-01 21:04:12.197022086 +0200
258 @@ -37,6 +37,7 @@
259  
260  #include "cmv_message_format.h"
261  
262 +#include <lantiq_soc.h>
263  
264  /* ============================================================================
265     Local macro definition
266 @@ -1527,32 +1528,35 @@
267     return IFX_ERROR;
268  }
269  
270 +#define PMU_DFE         BIT(9)
271 +
272  IFX_int32_t MEI_BasicChipInit(IFX_void_t)
273  {
274     /* Power up MEI */
275 -   DSL_DFE_PMU_SETUP(IFX_PMU_ENABLE);
276 -
277 -   if (ifx_pmu_pg_dsl_dfe_enable() != 0)
278 +//   DSL_DFE_PMU_SETUP(IFX_PMU_ENABLE);
279 +ltq_pmu_enable(PMU_DFE);
280 +  /* if (ifx_pmu_pg_dsl_dfe_enable() != 0)
281     {
282        PRN_ERR_USR_NL( MEI_MEI_ACCESS, MEI_DRV_PRN_LEVEL_ERR,
283              ("MEI: ERROR - DSL DFE PG enable failed!" MEI_DRV_CRLF));
284        return IFX_ERROR;
285 -   }
286 +   }*/
287  
288     return IFX_SUCCESS;
289  }
290  
291  IFX_int32_t MEI_BasicChipExit(IFX_void_t)
292  {
293 -   if (ifx_pmu_pg_dsl_dfe_disable() != 0)
294 +/*   if (ifx_pmu_pg_dsl_dfe_disable() != 0)
295     {
296        PRN_ERR_USR_NL( MEI_MEI_ACCESS, MEI_DRV_PRN_LEVEL_ERR,
297              ("MEI: ERROR - DSL DFE PG disable failed!" MEI_DRV_CRLF));
298        return IFX_ERROR;
299     }
300 -
301 +*/
302     /* Power down MEI */
303 -   DSL_DFE_PMU_SETUP(IFX_PMU_DISABLE);
304 +//   DSL_DFE_PMU_SETUP(IFX_PMU_DISABLE);
305 +ltq_pmu_disable(PMU_DFE);
306  
307     return IFX_SUCCESS;
308  }
309 Index: drv_mei_cpe-1.2.0/src/Makefile.am
310 ===================================================================
311 --- drv_mei_cpe-1.2.0.orig/src/Makefile.am      2013-09-01 21:05:24.581025175 +0200
312 +++ drv_mei_cpe-1.2.0/src/Makefile.am   2013-09-01 21:05:30.765025452 +0200
313 @@ -97,8 +97,6 @@
314         drv_mei_cpe_dbg_driver.h\
315         drv_mei_cpe_linux.c\
316         drv_mei_cpe_linux.h\
317 -       drv_mei_cpe_linux_proc_config.c\
318 -       drv_mei_cpe_linux_proc_config.h\
319         drv_mei_cpe_vxworks.c\
320         drv_mei_cpe_vxworks.h\
321         drv_mei_cpe_vxworks_bsp.c\