at91sam9g45_reset.S 922 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * reset AT91SAM9G45 as per errata
  3. *
  4. * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcosoft.com>
  5. *
  6. * unless the SDRAM is cleanly shutdown before we hit the
  7. * reset register it can be left driving the data bus and
  8. * killing the chance of a subsequent boot from NAND
  9. *
  10. * GPLv2 Only
  11. */
  12. #include <linux/linkage.h>
  13. #include <mach/hardware.h>
  14. #include <mach/at91_ramc.h>
  15. #include <mach/at91_rstc.h>
  16. .arm
  17. .globl at91sam9g45_restart
  18. at91sam9g45_restart:
  19. ldr r5, =at91_ramc_base @ preload constants
  20. ldr r0, [r5]
  21. ldr r4, =at91_rstc_base
  22. ldr r1, [r4]
  23. mov r2, #1
  24. mov r3, #AT91_DDRSDRC_LPCB_POWER_DOWN
  25. ldr r4, =AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST
  26. .balign 32 @ align to cache line
  27. str r2, [r0, #AT91_DDRSDRC_RTR] @ disable DDR0 access
  28. str r3, [r0, #AT91_DDRSDRC_LPR] @ power down DDR0
  29. str r4, [r1, #AT91_RSTC_CR] @ reset processor
  30. b .