lowlevel_init.S 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * board/mx1ads/lowlevel_init.S
  3. *
  4. * (c) Copyright 2004
  5. * Techware Information Technology, Inc.
  6. * http://www.techware.com.tw/
  7. *
  8. * Ming-Len Wu <minglen_wu@techware.com.tw>
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. */
  25. #include <config.h>
  26. #include <version.h>
  27. #define SDCTL0 0x221000
  28. #define SDCTL1 0x221004
  29. _TEXT_BASE:
  30. .word TEXT_BASE
  31. .globl lowlevel_init
  32. lowlevel_init:
  33. /* memory controller init */
  34. ldr r1, =SDCTL0
  35. /* Set Precharge Command */
  36. ldr r3, =0x92120200
  37. /* ldr r3, =0x92120251
  38. */
  39. str r3, [r1]
  40. /* Issue Precharge All Commad */
  41. ldr r3, =0x8200000
  42. ldr r2, [r3]
  43. /* Set AutoRefresh Command */
  44. ldr r3, =0xA2120200
  45. str r3, [r1]
  46. /* Issue AutoRefresh Command */
  47. ldr r3, =0x8000000
  48. ldr r2, [r3]
  49. ldr r2, [r3]
  50. ldr r2, [r3]
  51. ldr r2, [r3]
  52. ldr r2, [r3]
  53. ldr r2, [r3]
  54. ldr r2, [r3]
  55. ldr r2, [r3]
  56. /* Set Mode Register */
  57. ldr r3, =0xB2120200
  58. str r3, [r1]
  59. /* Issue Mode Register Command */
  60. ldr r3, =0x08111800 /* Mode Register Value */
  61. ldr r2, [r3]
  62. /* Set Normal Mode */
  63. ldr r3, =0x82124200
  64. str r3, [r1]
  65. /* everything is fine now */
  66. mov pc, lr