summaryrefslogtreecommitdiffstats
path: root/package/ltq-vmmc/patches/200-kernel-37.patch
blob: f5e2b36b749ae3f7924dd56b8c8dedf4e9baa933 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
--- a/src/drv_vmmc_init.c
+++ b/src/drv_vmmc_init.c
@@ -784,7 +784,7 @@
       dwld.fwDwld.length = IoInit.pram_size;
 
      /* download firmware */
-      ret = ifx_mps_ioctl((IFX_void_t *) command, IFX_NULL, FIO_MPS_DOWNLOAD,
+      ret = ifx_mps_ioctl((IFX_void_t *) command, FIO_MPS_DOWNLOAD,
                           (IFX_uint32_t) &dwld.fwDwld);
    }
 
@@ -1594,7 +1594,7 @@
 #ifdef VMMC_DRIVER_UNLOAD_HOOK
    if (VDevices[0].nDevState & DS_GPIO_RESERVED)
    {
-      IFX_int32_t ret;
+      IFX_int32_t ret = 0;
       VMMC_DRIVER_UNLOAD_HOOK(ret);
       if (!VMMC_SUCCESS(ret))
       {
--- a/src/mps/drv_mps_vmmc_linux.c
+++ b/src/mps/drv_mps_vmmc_linux.c
@@ -110,7 +110,7 @@
 #ifndef __KERNEL__
 IFX_int32_t ifx_mps_open (struct inode *inode, struct file *file_p);
 IFX_int32_t ifx_mps_close (struct inode *inode, struct file *file_p);
-IFX_int32_t ifx_mps_ioctl (struct inode *inode, struct file *file_p,
+long ifx_mps_ioctl (struct file *file_p,
                            IFX_uint32_t nCmd, IFX_ulong_t arg);
 IFX_int32_t ifx_mps_read_mailbox (mps_devices type, mps_message * rw);
 IFX_int32_t ifx_mps_write_mailbox (mps_devices type, mps_message * rw);
@@ -171,7 +171,7 @@
 static struct file_operations ifx_mps_fops = {
  owner:THIS_MODULE,
  poll:ifx_mps_poll,
- ioctl:ifx_mps_ioctl,
+ unlocked_ioctl:ifx_mps_ioctl,
  open:ifx_mps_open,
  release:ifx_mps_close
 };
@@ -614,7 +614,7 @@
  * \return  -ENOIOCTLCMD Invalid command
  * \ingroup API
  */
-IFX_int32_t ifx_mps_ioctl (struct inode * inode, struct file * file_p,
+long ifx_mps_ioctl (struct file *file_p,
                            IFX_uint32_t nCmd, IFX_ulong_t arg)
 {
    IFX_int32_t retvalue = -EINVAL;
@@ -629,17 +629,18 @@
       'mps_devices' enum type, which in fact is [0..8]; So, if inode value is
       [0..NUM_VOICE_CHANNEL+1], then we make sure that we are calling from
       kernel space. */
-   if (((IFX_int32_t) inode >= 0) &&
-       ((IFX_int32_t) inode < NUM_VOICE_CHANNEL + 1))
+   if (((IFX_int32_t) file_p >= 0) &&
+       ((IFX_int32_t) file_p < NUM_VOICE_CHANNEL + 1))
    {
       from_kernel = 1;
 
       /* Get corresponding mailbox device structure */
       if ((pMBDev =
-           ifx_mps_get_device ((mps_devices) ((IFX_int32_t) inode))) == 0)
+           ifx_mps_get_device ((mps_devices) ((IFX_int32_t) file_p))) == 0)
       {
          return (-EINVAL);
       }
+      file_p = NULL;
    }
    else
    {
--- a/src/drv_vmmc_ioctl.c
+++ b/src/drv_vmmc_ioctl.c
@@ -427,18 +427,18 @@
          /* MPS driver will do the USR2KERN so just pass on the pointer. */
          dwnld_struct.data = (IFX_void_t *)IoInit.pPRAMfw;
 
-         ret = ifx_mps_ioctl((IFX_void_t *)command, IFX_NULL,
+         ret = ifx_mps_ioctl((IFX_void_t *)command,
                              FIO_MPS_DOWNLOAD, (IFX_uint32_t) &dwnld_struct);
          break;
       }
       case FIO_DEV_RESET:
       {
-         ret = ifx_mps_ioctl((IFX_void_t *)command, IFX_NULL, FIO_MPS_RESET, 0);
+         ret = ifx_mps_ioctl((IFX_void_t *)command, FIO_MPS_RESET, 0);
          break;
       }
       case FIO_DEV_RESTART:
       {
-         ret = ifx_mps_ioctl((IFX_void_t *)command, IFX_NULL, FIO_MPS_RESTART, 0);
+         ret = ifx_mps_ioctl((IFX_void_t *)command, FIO_MPS_RESTART, 0);
          break;
       }
       case FIO_LASTERR:
--- a/src/mps/drv_mps_vmmc.h
+++ b/src/mps/drv_mps_vmmc.h
@@ -279,7 +279,7 @@
 #include <linux/fs.h>
 IFX_int32_t ifx_mps_open (struct inode *inode, struct file *file_p);
 IFX_int32_t ifx_mps_close (struct inode *inode, struct file *filp);
-IFX_int32_t ifx_mps_ioctl (struct inode *inode, struct file *file_p,
+long ifx_mps_ioctl (struct file *filp,
                            IFX_uint32_t nCmd, unsigned long arg);
 IFX_int32_t ifx_mps_register_data_callback (mps_devices type, IFX_uint32_t dir,
                                             IFX_void_t (*callback) (mps_devices
--- a/src/drv_vmmc_linux.c
+++ b/src/drv_vmmc_linux.c
@@ -32,7 +32,11 @@
 #ifdef LINUX_2_6
 #include <linux/version.h>
 #ifndef UTS_RELEASE
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
+#include <linux/utsrelease.h>
+#else
 #include <generated/utsrelease.h>
+#endif
 #endif /* UTC_RELEASE */
 #undef CONFIG_DEVFS_FS
 #endif /* LINUX_2_6 */
--- a/src/mps/drv_mps_vmmc_common.c
+++ b/src/mps/drv_mps_vmmc_common.c
@@ -22,7 +22,11 @@
 #undef USE_PLAIN_VOICE_FIRMWARE
 #undef PRINT_ON_ERR_INTERRUPT
 #undef FAIL_ON_ERR_INTERRUPT
-#include <generated/autoconf.h>
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
+#include <linux/utsrelease.h>
+#else
+#include <generated/utsrelease.h>
+#endif
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 
@@ -47,8 +51,19 @@
 #  define ifx_gptu_timer_free       lq_free_timer
 
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39))
 #  define bsp_mask_and_ack_irq      ltq_mask_and_ack_irq
 #else
+extern void ltq_mask_and_ack_irq(struct irq_data *d);
+static void inline bsp_mask_and_ack_irq(int x)
+{
+	struct irq_data d;
+	d.irq = x;
+	ltq_mask_and_ack_irq(&d);
+}
+#endif
+
+#else
 #  include <asm/ifx/ifx_regs.h>
 #  include <asm/ifx/ifx_gptu.h>
 #endif
@@ -107,7 +122,9 @@
 extern mps_mbx_dev *ifx_mps_get_device (mps_devices type);
 
 #ifdef LINUX_2_6
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39))
 extern IFX_void_t bsp_mask_and_ack_irq (IFX_uint32_t irq_nr);
+#endif
 
 #else /* */
 extern IFX_void_t mask_and_ack_danube_irq (IFX_uint32_t irq_nr);
--- a/src/mps/drv_mps_vmmc_danube.c
+++ b/src/mps/drv_mps_vmmc_danube.c
@@ -16,11 +16,16 @@
 /* ============================= */
 /* Includes                      */
 /* ============================= */
+#include "linux/version.h"
 #include "drv_config.h"
 
 #ifdef SYSTEM_DANUBE            /* defined in drv_mps_vmmc_config.h */
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)) 
+#include <linux/autoconf.h>
+#else
 #include <generated/autoconf.h>
+#endif
 
 /* lib_ifxos headers */
 #include "ifx_types.h"
@@ -39,6 +44,7 @@
 #  include <linux/dma-mapping.h>
 
 
+#define LQ_RCU_BASE_ADDR	(KSEG1 + LTQ_RCU_BASE_ADDR)
 # define LQ_RCU_RST		((u32 *)(LQ_RCU_BASE_ADDR + 0x0010))
 #define IFX_RCU_RST_REQ_CPU1             (1 << 3)
 #  define IFX_RCU_RST_REQ        LQ_RCU_RST