lowlevel_init.S 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * Memory Setup stuff - taken from ???
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. #include <config.h>
  23. #include <version.h>
  24. /* some parameters for the board */
  25. SYSCON1: .long 0x80000100
  26. SYSCON2: .long 0x80001100
  27. SYSCON3: .long 0x80002200
  28. MEMCFG1: .long 0x80000180
  29. MEMCFG2: .long 0x800001C0
  30. SDCONF: .long 0x80002300
  31. SDRFPR: .long 0x80002340
  32. syscon1_val: .long 0x00040100
  33. syscon2_val: .long 0x00000102
  34. syscon3_val: .long 0x0000020E
  35. memcfg1_val: .long 0x1f101710
  36. memcfg2_mask: .long 0x0000ffff @ only set lower 16 bits
  37. memcfg2_val: .long 0x00001f13 @ upper 16 bits are reserved for CS7 + CS6
  38. sdrfpr_val: .long 0x00000240
  39. sdconf_val: .long 0x00000522
  40. /* setting up the memory */
  41. .globl lowlevel_init
  42. lowlevel_init:
  43. /*
  44. * SYSCON1-3
  45. */
  46. ldr r0, SYSCON1
  47. ldr r1, syscon1_val
  48. str r1, [r0]
  49. ldr r0, SYSCON2
  50. ldr r1, syscon2_val
  51. str r1, [r0]
  52. ldr r0, SYSCON3
  53. ldr r1, syscon3_val
  54. str r1, [r0]
  55. /*
  56. * MEMCFG1
  57. */
  58. ldr r0, MEMCFG1
  59. ldr r1, memcfg1_val
  60. str r1, [r0]
  61. /*
  62. * MEMCFG2
  63. */
  64. ldr r0, MEMCFG2
  65. ldr r2, [r0]
  66. ldr r1, memcfg2_mask
  67. bic r2, r2, r1
  68. ldr r1, memcfg2_val
  69. orr r2, r2, r1
  70. str r2, [r0]
  71. /*
  72. * SDRFPR,SDCONF
  73. */
  74. ldr r0, SDCONF
  75. ldr r1, sdconf_val
  76. str r1, [r0]
  77. ldr r0, SDRFPR
  78. ldr r1, sdrfpr_val
  79. str r1, [r0]
  80. /* everything is fine now */
  81. mov pc, lr