sdram.S 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Ecovec24 sdram self/auto-refresh setup code
  3. *
  4. * Copyright (C) 2009 Magnus Damm
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. */
  10. #include <linux/sys.h>
  11. #include <linux/errno.h>
  12. #include <linux/linkage.h>
  13. #include <asm/asm-offsets.h>
  14. #include <asm/suspend.h>
  15. #include <asm/romimage-macros.h>
  16. /* code to enter and leave self-refresh. must be self-contained.
  17. * this code will be copied to on-chip memory and executed from there.
  18. */
  19. .balign 4
  20. ENTRY(ecovec24_sdram_enter_start)
  21. /* DBSC: put memory in self-refresh mode */
  22. ED 0xFD000010, 0x00000000 /* DBEN */
  23. ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
  24. ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
  25. ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
  26. ED 0xFD000040, 0x00000001 /* DBRFPDN0 */
  27. rts
  28. nop
  29. ENTRY(ecovec24_sdram_enter_end)
  30. .balign 4
  31. ENTRY(ecovec24_sdram_leave_start)
  32. /* DBSC: put memory in auto-refresh mode */
  33. ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
  34. WAIT 1
  35. ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
  36. ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
  37. ED 0xFD000010, 0x00000001 /* DBEN */
  38. ED 0xFD000040, 0x00010000 /* DBRFPDN0 */
  39. rts
  40. nop
  41. ENTRY(ecovec24_sdram_leave_end)