lantiq: Tune the XWAY subtarget cflags
[openwrt.git] / package / platform / 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  2012-11-28 15:14:10.421633418 +0100
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      2012-11-28 15:14:10.421633418 +0100
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 2012-11-28 15:14:56.637634577 +0100
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   2012-11-28 15:14:10.429633419 +0100
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 2012-11-28 15:14:10.429633419 +0100
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      2012-11-28 15:14:10.429633419 +0100
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   2012-11-28 15:24:56.269649609 +0100
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 @@ -87,6 +85,8 @@
163  #include "drv_mei_cpe_device_cntrl.h"
164  #endif
165  
166 +#define INT_NUM_IM4_IRL30 (INT_NUM_IM4_IRL0 + 30)
167 +
168  /* ===================================
169     extern function declarations
170     =================================== */
171 @@ -122,7 +122,7 @@
172                       size_t length,
173                       loff_t * ppos);
174  
175 -static int MEI_Ioctl( struct inode *inode, struct file *filp,
176 +static long MEI_Ioctl(struct file *filp,
177                          unsigned int nCmd, unsigned long nArgument);
178  
179  static unsigned int MEI_Poll (struct file *filp, poll_table *table);
180 @@ -137,7 +137,7 @@
181  
182  static void MEI_IfxFreeIrq(unsigned int usedIrq, void *pUsedDevId);
183  
184 -static irqreturn_t MEI_InterruptLinux(int irq, void *dev_id, struct pt_regs *regs);
185 +static irqreturn_t MEI_InterruptLinux(int irq, void *dev_id);
186  #endif
187  
188  #if CONFIG_PROC_FS
189 @@ -194,7 +194,9 @@
190  /* =================================== */
191  /* Local variables (LINUX)             */
192  /* =================================== */
193 -static IFX_uint8_t major_number = 0;
194 +#define MEI_MAJOR       105
195 +
196 +static IFX_uint8_t major_number = MEI_MAJOR;
197  #ifdef MODULE
198  #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
199  MODULE_PARM(major_number, "b");
200 @@ -242,7 +244,7 @@
201          MEI_Write,
202      poll:
203          MEI_Poll,
204 -    ioctl:
205 +    unlocked_ioctl:
206          MEI_Ioctl,
207      open:
208          MEI_OpenOS,
209 @@ -457,7 +459,7 @@
210     0 and positive values - success,
211     negative value - ioctl failed
212  */
213 -static int MEI_Ioctl( struct inode *inode, struct file *filp,
214 +static long MEI_Ioctl(struct file *filp,
215                              unsigned int nCmd, unsigned long nArgument)
216  {
217     int ret = 0, retSize = sizeof(IOCTL_MEI_ioctl_t);
218 @@ -1242,7 +1246,7 @@
219  \remark
220     None.
221  */
222 -static irqreturn_t MEI_InterruptLinux(int irq, void *dev_id, struct pt_regs *regs)
223 +static irqreturn_t MEI_InterruptLinux(int irq, void *dev_id)
224  {
225     IFX_int32_t    meiIntCnt = 0;
226     MEIX_CNTRL_T *pMeiXCntrlList = (MEIX_CNTRL_T*)dev_id;
227 @@ -1691,6 +1695,7 @@
228  static int __init MEI_module_init (void)
229  {
230     int result;
231 +   static struct class *dsl_class;
232  
233     printk(KERN_INFO "%s" MEI_DRV_CRLF, &MEI_WHATVERSION[4]);
234     printk(KERN_INFO "(c) Copyright 2009, Infineon Technologies AG" MEI_DRV_CRLF);
235 @@ -1730,6 +1735,8 @@
236        return (result);
237     }
238  
239 +   dsl_class = class_create(THIS_MODULE, "ifx_mei");
240 +   device_create(dsl_class, NULL, MKDEV(MEI_MAJOR, 0), NULL, "ifx_mei");
241     return 0;
242  }
243  
244 Index: drv_mei_cpe-1.2.0/src/drv_mei_cpe_mei_access_vr9.c
245 ===================================================================
246 --- drv_mei_cpe-1.2.0.orig/src/drv_mei_cpe_mei_access_vr9.c     2011-07-25 20:41:02.000000000 +0200
247 +++ drv_mei_cpe-1.2.0/src/drv_mei_cpe_mei_access_vr9.c  2012-11-28 15:14:10.433633419 +0100
248 @@ -37,6 +37,7 @@
249  
250  #include "cmv_message_format.h"
251  
252 +#include <lantiq_soc.h>
253  
254  /* ============================================================================
255     Local macro definition
256 @@ -1527,32 +1528,35 @@
257     return IFX_ERROR;
258  }
259  
260 +#define PMU_DFE         BIT(9)
261 +
262  IFX_int32_t MEI_BasicChipInit(IFX_void_t)
263  {
264     /* Power up MEI */
265 -   DSL_DFE_PMU_SETUP(IFX_PMU_ENABLE);
266 -
267 -   if (ifx_pmu_pg_dsl_dfe_enable() != 0)
268 +//   DSL_DFE_PMU_SETUP(IFX_PMU_ENABLE);
269 +ltq_pmu_enable(PMU_DFE);
270 +  /* if (ifx_pmu_pg_dsl_dfe_enable() != 0)
271     {
272        PRN_ERR_USR_NL( MEI_MEI_ACCESS, MEI_DRV_PRN_LEVEL_ERR,
273              ("MEI: ERROR - DSL DFE PG enable failed!" MEI_DRV_CRLF));
274        return IFX_ERROR;
275 -   }
276 +   }*/
277  
278     return IFX_SUCCESS;
279  }
280  
281  IFX_int32_t MEI_BasicChipExit(IFX_void_t)
282  {
283 -   if (ifx_pmu_pg_dsl_dfe_disable() != 0)
284 +/*   if (ifx_pmu_pg_dsl_dfe_disable() != 0)
285     {
286        PRN_ERR_USR_NL( MEI_MEI_ACCESS, MEI_DRV_PRN_LEVEL_ERR,
287              ("MEI: ERROR - DSL DFE PG disable failed!" MEI_DRV_CRLF));
288        return IFX_ERROR;
289     }
290 -
291 +*/
292     /* Power down MEI */
293 -   DSL_DFE_PMU_SETUP(IFX_PMU_DISABLE);
294 +//   DSL_DFE_PMU_SETUP(IFX_PMU_DISABLE);
295 +ltq_pmu_disable(PMU_DFE);
296  
297     return IFX_SUCCESS;
298  }