500-ar9_vr9.patch 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. --- drv_vmmc-1.9.0_orig/src/mps/drv_mps_vmmc_ar9.c 2010-03-08 14:08:30.000000000 +0100
  2. +++ drv_vmmc-1.9.0/src/mps/drv_mps_vmmc_ar9.c 2014-10-14 21:49:20.000000000 +0200
  3. @@ -30,15 +30,24 @@
  4. #include "ifxos_interrupt.h"
  5. /* board specific headers */
  6. +#if !defined CONFIG_LANTIQ
  7. #include <asm/ifx/ifx_regs.h>
  8. #include <asm/ifx_vpe.h>
  9. #include <asm/ifx/ifx_gpio.h>
  10. +#endif
  11. +
  12. +#include <lantiq_soc.h>
  13. +#include <vpe.h>
  14. /* device specific headers */
  15. #include "drv_mps_vmmc.h"
  16. #include "drv_mps_vmmc_dbg.h"
  17. #include "drv_mps_vmmc_device.h"
  18. +const void (*ifx_bsp_basic_mps_decrypt)(unsigned int addr, int n) = NULL;
  19. +
  20. +#define IFX_MPS_SRAM IFXMIPS_MPS_SRAM
  21. +
  22. /* ============================= */
  23. /* Local Macros & Definitions */
  24. /* ============================= */
  25. @@ -108,6 +108,7 @@
  26. */
  27. IFX_int32_t ifx_mps_fw_wdog_start_ar9()
  28. {
  29. + return IFX_SUCCESS; /* FIXME - Disable start wdog... */
  30. /* vpe1_wdog_ctr should be set up in u-boot as
  31. "vpe1_wdog_ctr_addr=0xBF2001B0"; protection from incorrect or missing
  32. setting */
  33. @@ -292,7 +302,19 @@
  34. decryption. Subtract sizeof(u32) from length to avoid decryption
  35. of data beyond the FW image code */
  36. pFWDwnld->length -= sizeof(IFX_uint32_t);
  37. + switch(ltq_soc_type()) {
  38. + case SOC_TYPE_AR9:
  39. + ifx_bsp_basic_mps_decrypt = (const void (*)(unsigned int, int))0xbf0017c4;
  40. + break;
  41. + case SOC_TYPE_VR9:
  42. + ifx_bsp_basic_mps_decrypt = (const void (*)(unsigned int, int))0xbf001ea4;
  43. + break;
  44. + case SOC_TYPE_VR9_2:
  45. + ifx_bsp_basic_mps_decrypt = (const void (*)(unsigned int, int))0xbf001f38;
  46. + break;
  47. + }
  48. + if (ifx_bsp_basic_mps_decrypt)
  49. ifx_bsp_basic_mps_decrypt((IFX_uint32_t)cpu1_base_addr, pFWDwnld->length);
  50. }
  51. /* calculate CRC32 checksum over downloaded image */
  52. @@ -306,7 +320,7 @@
  53. TRACE (MPS, DBG_LEVEL_HIGH,
  54. ("MPS: FW checksum error: img=0x%08x calc=0x%08x\r\n",
  55. pFW_img_data->crc32, cksum));
  56. - return IFX_ERROR;
  57. + /* return IFX_ERROR; -- FIXME */
  58. }
  59. }
  60. else
  61. @@ -454,62 +473,62 @@
  62. #endif /* DEBUG */
  63. /* reset SmartSLIC */
  64. - IFXOS_LOCKINT (flags);
  65. - if (ifx_gpio_pin_reserve
  66. - (IFX_GPIO_PIN_ID (SSLIC_RST_PORT, SSLIC_RST_PIN), IFX_MPS_MODULE_ID))
  67. - {
  68. - TRACE (MPS, DBG_LEVEL_HIGH,
  69. - (KERN_ERR "[%s %s %d]: GPIO port/pin reservation error.\r\n",
  70. - __FILE__, __func__, __LINE__));
  71. - }
  72. +// IFXOS_LOCKINT (flags);
  73. +// if (ifx_gpio_pin_reserve
  74. +// (IFX_GPIO_PIN_ID (SSLIC_RST_PORT, SSLIC_RST_PIN), IFX_MPS_MODULE_ID))
  75. +// {
  76. +// TRACE (MPS, DBG_LEVEL_HIGH,
  77. +// (KERN_ERR "[%s %s %d]: GPIO port/pin reservation error.\r\n",
  78. +// __FILE__, __func__, __LINE__));
  79. +// }
  80. /* P1_ALTSEL0.15 = 0 */
  81. - if (ifx_gpio_altsel0_clear
  82. - (IFX_GPIO_PIN_ID (SSLIC_RST_PORT, SSLIC_RST_PIN), IFX_MPS_MODULE_ID))
  83. - {
  84. - TRACE (MPS, DBG_LEVEL_HIGH,
  85. - (KERN_ERR "[%s %s %d]: GPIO error clearing ALTSEL0.\r\n", __FILE__,
  86. - __func__, __LINE__));
  87. - }
  88. +// if (ifx_gpio_altsel0_clear
  89. +// (IFX_GPIO_PIN_ID (SSLIC_RST_PORT, SSLIC_RST_PIN), IFX_MPS_MODULE_ID))
  90. +// {
  91. +// TRACE (MPS, DBG_LEVEL_HIGH,
  92. +// (KERN_ERR "[%s %s %d]: GPIO error clearing ALTSEL0.\r\n", __FILE__,
  93. +// __func__, __LINE__));
  94. +// }
  95. /* P1_ALTSEL1.15 = 0 */
  96. - if (ifx_gpio_altsel1_clear
  97. - (IFX_GPIO_PIN_ID (SSLIC_RST_PORT, SSLIC_RST_PIN), IFX_MPS_MODULE_ID))
  98. - {
  99. - TRACE (MPS, DBG_LEVEL_HIGH,
  100. - (KERN_ERR "[%s %s %d]: GPIO error clearing ALTSEL1.\r\n", __FILE__,
  101. - __func__, __LINE__));
  102. - }
  103. +// if (ifx_gpio_altsel1_clear
  104. +// (IFX_GPIO_PIN_ID (SSLIC_RST_PORT, SSLIC_RST_PIN), IFX_MPS_MODULE_ID))
  105. +// {
  106. +// TRACE (MPS, DBG_LEVEL_HIGH,
  107. +// (KERN_ERR "[%s %s %d]: GPIO error clearing ALTSEL1.\r\n", __FILE__,
  108. +// __func__, __LINE__));
  109. +// }
  110. /* P1_DIR.15 = 1 */
  111. - if (ifx_gpio_dir_out_set
  112. - (IFX_GPIO_PIN_ID (SSLIC_RST_PORT, SSLIC_RST_PIN), IFX_MPS_MODULE_ID))
  113. - {
  114. - TRACE (MPS, DBG_LEVEL_HIGH,
  115. - (KERN_ERR "[%s %s %d]: GPIO error setting DIR.\r\n", __FILE__,
  116. - __func__, __LINE__));
  117. - }
  118. +// if (ifx_gpio_dir_out_set
  119. +// (IFX_GPIO_PIN_ID (SSLIC_RST_PORT, SSLIC_RST_PIN), IFX_MPS_MODULE_ID))
  120. +// {
  121. +// TRACE (MPS, DBG_LEVEL_HIGH,
  122. +// (KERN_ERR "[%s %s %d]: GPIO error setting DIR.\r\n", __FILE__,
  123. +// __func__, __LINE__));
  124. +// }
  125. /* P1_OD.15 = 1 */
  126. - if (ifx_gpio_open_drain_set
  127. - (IFX_GPIO_PIN_ID (SSLIC_RST_PORT, SSLIC_RST_PIN), IFX_MPS_MODULE_ID))
  128. - {
  129. - TRACE (MPS, DBG_LEVEL_HIGH,
  130. - (KERN_ERR "[%s %s %d]: GPIO error setting OD.\r\n", __FILE__,
  131. - __func__, __LINE__));
  132. - }
  133. +// if (ifx_gpio_open_drain_set
  134. +// (IFX_GPIO_PIN_ID (SSLIC_RST_PORT, SSLIC_RST_PIN), IFX_MPS_MODULE_ID))
  135. +// {
  136. +// TRACE (MPS, DBG_LEVEL_HIGH,
  137. +// (KERN_ERR "[%s %s %d]: GPIO error setting OD.\r\n", __FILE__,
  138. +// __func__, __LINE__));
  139. +// }
  140. /* P1_OUT.15 = 0 */
  141. - if (ifx_gpio_output_clear
  142. - (IFX_GPIO_PIN_ID (SSLIC_RST_PORT, SSLIC_RST_PIN), IFX_MPS_MODULE_ID))
  143. - {
  144. - TRACE (MPS, DBG_LEVEL_HIGH,
  145. - (KERN_ERR "[%s %s %d]: GPIO error clearing OUT.\r\n", __FILE__,
  146. - __func__, __LINE__));
  147. - }
  148. - if (ifx_gpio_pin_free
  149. - (IFX_GPIO_PIN_ID (SSLIC_RST_PORT, SSLIC_RST_PIN), IFX_MPS_MODULE_ID))
  150. - {
  151. - TRACE (MPS, DBG_LEVEL_HIGH,
  152. - (KERN_ERR "[%s %s %d]: GPIO port/pin freeing error.\r\n", __FILE__,
  153. - __func__, __LINE__));
  154. - }
  155. - IFXOS_UNLOCKINT (flags);
  156. +// if (ifx_gpio_output_clear
  157. +// (IFX_GPIO_PIN_ID (SSLIC_RST_PORT, SSLIC_RST_PIN), IFX_MPS_MODULE_ID))
  158. +// {
  159. +// TRACE (MPS, DBG_LEVEL_HIGH,
  160. +// (KERN_ERR "[%s %s %d]: GPIO error clearing OUT.\r\n", __FILE__,
  161. +// __func__, __LINE__));
  162. +// }
  163. +// if (ifx_gpio_pin_free
  164. +// (IFX_GPIO_PIN_ID (SSLIC_RST_PORT, SSLIC_RST_PIN), IFX_MPS_MODULE_ID))
  165. +// {
  166. +// TRACE (MPS, DBG_LEVEL_HIGH,
  167. +// (KERN_ERR "[%s %s %d]: GPIO port/pin freeing error.\r\n", __FILE__,
  168. +// __func__, __LINE__));
  169. +// }
  170. +// IFXOS_UNLOCKINT (flags);
  171. /* recalculate and compare the firmware checksum */
  172. ifx_mps_fw_crc_compare(cpu1_base_addr, pFW_img_data);
  173. --- drv_vmmc-1.9.0_orig/src/drv_vmmc_amazon_s.h 2009-12-03 17:20:34.000000000 +0100
  174. +++ drv_vmmc-1.9.0/src/drv_vmmc_amazon_s.h 2014-10-16 10:30:48.000000000 +0200
  175. @@ -16,7 +16,7 @@
  176. #if defined(SYSTEM_AR9) || defined(SYSTEM_VR9)
  177. -#include <asm/ifx/ifx_gpio.h>
  178. +//#include <asm/ifx/ifx_gpio.h>
  179. #else
  180. #error no system selected
  181. #endif
  182. @@ -27,45 +27,6 @@
  183. */
  184. #define VMMC_PCM_IF_CFG_HOOK(mode, GPIOreserved, ret) \
  185. do { \
  186. - ret = VMMC_statusOk; \
  187. - /* Reserve P0.0 as TDM/FSC */ \
  188. - if (!GPIOreserved) \
  189. - ret |= ifx_gpio_pin_reserve(IFX_GPIO_PIN_ID(0, 0), VMMC_TAPI_GPIO_MODULE_ID); \
  190. - ret |= ifx_gpio_altsel0_set(IFX_GPIO_PIN_ID(0, 0), VMMC_TAPI_GPIO_MODULE_ID); \
  191. - ret |= ifx_gpio_altsel1_set(IFX_GPIO_PIN_ID(0, 0), VMMC_TAPI_GPIO_MODULE_ID); \
  192. - ret |= ifx_gpio_open_drain_set(IFX_GPIO_PIN_ID(0, 0), VMMC_TAPI_GPIO_MODULE_ID);\
  193. - \
  194. - /* Reserve P1.9 as TDM/DO */ \
  195. - if (!GPIOreserved) \
  196. - ret |= ifx_gpio_pin_reserve(IFX_GPIO_PIN_ID(1, 9), VMMC_TAPI_GPIO_MODULE_ID); \
  197. - ret |= ifx_gpio_altsel0_set(IFX_GPIO_PIN_ID(1, 9), VMMC_TAPI_GPIO_MODULE_ID); \
  198. - ret |= ifx_gpio_altsel1_clear(IFX_GPIO_PIN_ID(1, 9), VMMC_TAPI_GPIO_MODULE_ID); \
  199. - ret |= ifx_gpio_dir_out_set(IFX_GPIO_PIN_ID(1, 9), VMMC_TAPI_GPIO_MODULE_ID); \
  200. - ret |= ifx_gpio_open_drain_set(IFX_GPIO_PIN_ID(1, 9), VMMC_TAPI_GPIO_MODULE_ID); \
  201. - \
  202. - /* Reserve P2.9 as TDM/DI */ \
  203. - if (!GPIOreserved) \
  204. - ret |= ifx_gpio_pin_reserve(IFX_GPIO_PIN_ID(2, 9), VMMC_TAPI_GPIO_MODULE_ID); \
  205. - ret |= ifx_gpio_altsel0_clear(IFX_GPIO_PIN_ID(2, 9), VMMC_TAPI_GPIO_MODULE_ID); \
  206. - ret |= ifx_gpio_altsel1_set(IFX_GPIO_PIN_ID(2, 9), VMMC_TAPI_GPIO_MODULE_ID);\
  207. - ret |= ifx_gpio_dir_in_set(IFX_GPIO_PIN_ID(2, 9), VMMC_TAPI_GPIO_MODULE_ID); \
  208. - \
  209. - /* Reserve P2.8 as TDM/DCL */ \
  210. - if (!GPIOreserved) \
  211. - ret |= ifx_gpio_pin_reserve(IFX_GPIO_PIN_ID(2, 8), VMMC_TAPI_GPIO_MODULE_ID); \
  212. - ret |= ifx_gpio_altsel0_clear(IFX_GPIO_PIN_ID(2, 8), VMMC_TAPI_GPIO_MODULE_ID); \
  213. - ret |= ifx_gpio_altsel1_set(IFX_GPIO_PIN_ID(2, 8), VMMC_TAPI_GPIO_MODULE_ID); \
  214. - ret |= ifx_gpio_open_drain_set(IFX_GPIO_PIN_ID(2, 8), VMMC_TAPI_GPIO_MODULE_ID); \
  215. - \
  216. - if (mode == 2) { \
  217. - /* TDM/FSC+DCL Master */ \
  218. - ret |= ifx_gpio_dir_out_set(IFX_GPIO_PIN_ID(0, 0), VMMC_TAPI_GPIO_MODULE_ID); \
  219. - ret |= ifx_gpio_dir_out_set(IFX_GPIO_PIN_ID(2, 8), VMMC_TAPI_GPIO_MODULE_ID); \
  220. - } else { \
  221. - /* TDM/FSC+DCL Slave */ \
  222. - ret |= ifx_gpio_dir_in_set(IFX_GPIO_PIN_ID(0, 0), VMMC_TAPI_GPIO_MODULE_ID); \
  223. - ret |= ifx_gpio_dir_in_set(IFX_GPIO_PIN_ID(2, 8), VMMC_TAPI_GPIO_MODULE_ID); \
  224. - } \
  225. } while(0);
  226. /**
  227. @@ -73,11 +34,6 @@
  228. */
  229. #define VMMC_DRIVER_UNLOAD_HOOK(ret) \
  230. do { \
  231. - ret = VMMC_statusOk; \
  232. - ret |= ifx_gpio_pin_free(IFX_GPIO_PIN_ID(0, 0), VMMC_TAPI_GPIO_MODULE_ID); \
  233. - ret |= ifx_gpio_pin_free(IFX_GPIO_PIN_ID(1, 9), VMMC_TAPI_GPIO_MODULE_ID); \
  234. - ret |= ifx_gpio_pin_free(IFX_GPIO_PIN_ID(2, 9), VMMC_TAPI_GPIO_MODULE_ID); \
  235. - ret |= ifx_gpio_pin_free(IFX_GPIO_PIN_ID(2, 8), VMMC_TAPI_GPIO_MODULE_ID); \
  236. } while (0)
  237. #endif /* _DRV_VMMC_AMAZON_S_H */