lowlevel_init.S 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Initialization stuff - taken from hermit
  3. * (C) Copyright 2005 Rowel Atienza <rowel@diwalabs.com>
  4. * Armadillo board HT1070
  5. *
  6. * See file CREDITS for list of people who contributed to this
  7. * project.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of
  12. * the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  22. * MA 02111-1307 USA
  23. */
  24. #include <config.h>
  25. #include <version.h>
  26. /* some parameters for the board */
  27. /* setting up the memory */
  28. #define SRAM_START 0x60000000
  29. #define SRAM_SIZE 0x0000c000
  30. .globl lowlevel_init
  31. lowlevel_init:
  32. mov r0, #0x70 /* 32-bit code + data, MMU mandatory */
  33. mcr p15, 0, r0, c1, c0, 0 /* MMU init */
  34. mov r0, #0
  35. mcr p15, 0, r0, c7, c7, 0 /* flush v3/v4 cache */
  36. mcr p15, 0, r0, c8, c7, 0 /* flush v4 TLB */
  37. mov r0, #0x80000000 /* I/O base */
  38. mov r1, #0x6 /* CLKCTL_73 in SYSCON3 */
  39. add r2, r0, #0x2200 /* address of SYSCON3 in r2 */
  40. str r1, [r2] /* set clock speed to 73.728 MHz */
  41. mov r1, #0x81 /* 64KHz DRAM refresh period */
  42. str r1, [r0, #0x200] /* set DRFPR */
  43. mov r1, #0x500 /* permanent enable, 16bits wide */
  44. add r1, r1, #0x42 /* 128Mbit, CAS lat = 2 SDRAM */
  45. add r2, r0, #0x2300 /* load address in r2 */
  46. str r1, [r2]
  47. mov r1, #0x100 /* SDRAM refresh rate */
  48. add r2, r0, #0x2340 /* load address in r2 */
  49. str r1, [r2]
  50. mov sp, #SRAM_START /* init stack pointer */
  51. add sp, sp, #SRAM_SIZE
  52. /* everything is fine now */
  53. mov pc, lr