200-kernel-37.patch 6.0 KB

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