reset.S 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Processor reset using WDT for TI TMS320DM644x SoC.
  3. *
  4. * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
  5. *
  6. * -----------------------------------------------------
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. .globl reset_cpu
  24. reset_cpu:
  25. ldr r0, WDT_TGCR
  26. mov r1, $0x08
  27. str r1, [r0]
  28. ldr r1, [r0]
  29. orr r1, r1, $0x03
  30. str r1, [r0]
  31. mov r1, $0
  32. ldr r0, WDT_TIM12
  33. str r1, [r0]
  34. ldr r0, WDT_TIM34
  35. str r1, [r0]
  36. ldr r0, WDT_PRD12
  37. str r1, [r0]
  38. ldr r0, WDT_PRD34
  39. str r1, [r0]
  40. ldr r0, WDT_TCR
  41. ldr r1, [r0]
  42. orr r1, r1, $0x40
  43. str r1, [r0]
  44. ldr r0, WDT_WDTCR
  45. ldr r1, [r0]
  46. orr r1, r1, $0x4000
  47. str r1, [r0]
  48. ldr r1, WDTCR_VAL1
  49. str r1, [r0]
  50. ldr r1, WDTCR_VAL2
  51. str r1, [r0]
  52. nop
  53. nop
  54. nop
  55. nop
  56. reset_cpu_loop:
  57. b reset_cpu_loop
  58. WDT_TGCR:
  59. .word 0x01c21c24
  60. WDT_TIM12:
  61. .word 0x01c21c10
  62. WDT_TIM34:
  63. .word 0x01c21c14
  64. WDT_PRD12:
  65. .word 0x01c21c18
  66. WDT_PRD34:
  67. .word 0x01c21c1c
  68. WDT_TCR:
  69. .word 0x01c21c20
  70. WDT_WDTCR:
  71. .word 0x01c21c28
  72. WDTCR_VAL1:
  73. .word 0xa5c64000
  74. WDTCR_VAL2:
  75. .word 0xda7e4000