at91sam9_alt_reset.S 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * reset AT91SAM9G20 as per errata
  3. *
  4. * (C) BitBox Ltd 2010
  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. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version.
  14. */
  15. #include <linux/linkage.h>
  16. #include <asm/system.h>
  17. #include <mach/hardware.h>
  18. #include <mach/at91sam9_sdramc.h>
  19. #include <mach/at91_rstc.h>
  20. .arm
  21. .globl at91sam9_alt_reset
  22. at91sam9_alt_reset: mrc p15, 0, r0, c1, c0, 0
  23. orr r0, r0, #CR_I
  24. mcr p15, 0, r0, c1, c0, 0 @ enable I-cache
  25. ldr r0, .at91_va_base_sdramc @ preload constants
  26. ldr r1, .at91_va_base_rstc_cr
  27. mov r2, #1
  28. mov r3, #AT91_SDRAMC_LPCB_POWER_DOWN
  29. ldr r4, =AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST
  30. .balign 32 @ align to cache line
  31. str r2, [r0, #AT91_SDRAMC_TR] @ disable SDRAM access
  32. str r3, [r0, #AT91_SDRAMC_LPR] @ power down SDRAM
  33. str r4, [r1] @ reset processor
  34. b .
  35. .at91_va_base_sdramc:
  36. .word AT91_VA_BASE_SYS + AT91_SDRAMC0
  37. .at91_va_base_rstc_cr:
  38. .word AT91_VA_BASE_SYS + AT91_RSTC_CR