PageRenderTime 44ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/bootloader/u-boot-2009.08/patches/0318-ENGR00151310-mx53-smd-force-warm-reset-as-cold-reset.patch

https://github.com/red-root/PortingARMLinux
Patch | 78 lines | 70 code | 8 blank | 0 comment | 0 complexity | 0d898547f174130508de6e6f8b68af72 MD5 | raw file
Possible License(s): AGPL-1.0
  1. From 6667da86ca1582222416defdcbf8e6d41bc03d28 Mon Sep 17 00:00:00 2001
  2. From: Lily Zhang <r58066@freescale.com>
  3. Date: Thu, 21 Jul 2011 18:08:07 +0800
  4. Subject: [PATCH 318/678] ENGR00151310 mx53 smd: force warm reset as cold
  5. reset
  6. This patch is used to support watchdog timeout in SMD RevA, RevB
  7. board.
  8. 1. Revert "ENGR00143469 mx53 smd: pull down GPIO_9 to reset the
  9. board".
  10. 2. Force warm reset as cold reset.
  11. Signed-off-by: Lily Zhang <r58066@freescale.com>
  12. ---
  13. board/freescale/mx53_smd/mx53_smd.c | 9 +++++++++
  14. cpu/arm_cortexa8/mx53/interrupts.c | 15 ---------------
  15. 2 files changed, 9 insertions(+), 15 deletions(-)
  16. diff --git a/board/freescale/mx53_smd/mx53_smd.c b/board/freescale/mx53_smd/mx53_smd.c
  17. index aff0364..b698fd3 100644
  18. --- a/board/freescale/mx53_smd/mx53_smd.c
  19. +++ b/board/freescale/mx53_smd/mx53_smd.c
  20. @@ -799,6 +799,7 @@ void setup_splash_image(void)
  21. int board_init(void)
  22. {
  23. + unsigned int val;
  24. #ifdef CONFIG_MFG
  25. /* MFG firmware need reset usb to avoid host crash firstly */
  26. #define USBCMD 0x140
  27. @@ -806,6 +807,14 @@ int board_init(void)
  28. val &= ~0x1; /*RS bit*/
  29. writel(val, OTG_BASE_ADDR + USBCMD);
  30. #endif
  31. +
  32. + /* Workaround: To make watchdog timeout work in mx53
  33. + * SMD, force warm reset as cold reset
  34. + */
  35. + val = readl(SRC_BASE_ADDR);
  36. + val &= 0xFFFFFFFE;
  37. + writel(val, SRC_BASE_ADDR);
  38. +
  39. setup_boot_device();
  40. setup_soc_rev();
  41. diff --git a/cpu/arm_cortexa8/mx53/interrupts.c b/cpu/arm_cortexa8/mx53/interrupts.c
  42. index a39e7ff..0cc24db 100644
  43. --- a/cpu/arm_cortexa8/mx53/interrupts.c
  44. +++ b/cpu/arm_cortexa8/mx53/interrupts.c
  45. @@ -36,25 +36,10 @@ int interrupt_init(void)
  46. void reset_cpu(ulong addr)
  47. {
  48. -#if defined(CONFIG_MX53_SMD)
  49. - unsigned int reg;
  50. -#endif
  51. -
  52. /* de-select SS0 of instance: eCSPI1 */
  53. mxc_request_iomux(MX53_PIN_EIM_EB2, IOMUX_CONFIG_ALT1);
  54. /* de-select SS1 of instance: eCSPI1 */
  55. mxc_request_iomux(MX53_PIN_EIM_D19, IOMUX_CONFIG_ALT1);
  56. -#if defined(CONFIG_MX53_SMD)
  57. - /* GPIO_1_9 */
  58. - reg = readl(GPIO1_BASE_ADDR + 0x4);
  59. - reg |= (0x1 << 9);
  60. - writel(reg, GPIO1_BASE_ADDR + 0x4);
  61. -
  62. - reg = readl(GPIO1_BASE_ADDR);
  63. - reg &= ~0x200;
  64. - writel(reg, GPIO1_BASE_ADDR);
  65. -#else
  66. __REG16(WDOG1_BASE_ADDR) = 4;
  67. -#endif
  68. }
  69. --
  70. 1.7.7.4