init.S 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /*
  2. * Copyright (C) 2003 Embedded Edge, LLC
  3. * Dan Malek <dan@embeddededge.com>
  4. * Copied from ADS85xx.
  5. * Updates for Silicon Tx GP3 8560. We only support 32-bit flash
  6. * and DDR with SPD EEPROM configuration.
  7. *
  8. * Copyright (C) 2002,2003, Motorola Inc.
  9. * Xianghua Xiao <X.Xiao@motorola.com>
  10. *
  11. * See file CREDITS for list of people who contributed to this
  12. * project.
  13. *
  14. * This program is free software; you can redistribute it and/or
  15. * modify it under the terms of the GNU General Public License as
  16. * published by the Free Software Foundation; either version 2 of
  17. * the License, or (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, write to the Free Software
  26. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  27. * MA 02111-1307 USA
  28. */
  29. #include <ppc_asm.tmpl>
  30. #include <ppc_defs.h>
  31. #include <asm/cache.h>
  32. #include <asm/mmu.h>
  33. #include <config.h>
  34. #include <mpc85xx.h>
  35. #define entry_start \
  36. mflr r1 ; \
  37. bl 0f ;
  38. #define entry_end \
  39. 0: mflr r0 ; \
  40. mtlr r1 ; \
  41. blr ;
  42. /* TLB1 entries configuration: */
  43. .section .bootpg, "ax"
  44. .globl tlb1_entry
  45. tlb1_entry:
  46. entry_start
  47. /* If RAMBOOT, we are testing and the BDI has set up
  48. * much of the MMU already.
  49. * TLB 4,5 SDRAM
  50. * TLB 15 is default CCSRBAR.
  51. */
  52. .long 0x09 /* the following data table uses a few of 16 TLB entries */
  53. .long TLB1_MAS0(1,1,0)
  54. .long TLB1_MAS1(1,1,0,0,BOOKE_PAGESZ_1M)
  55. .long TLB1_MAS2(((CFG_CCSRBAR>>12) & 0xfffff),0,0,0,0,1,0,1,0)
  56. .long TLB1_MAS3(((CFG_CCSRBAR>>12) & 0xfffff),0,0,0,0,0,1,0,1,0,1)
  57. .long TLB1_MAS0(1,2,0)
  58. .long TLB1_MAS1(1,1,0,0,BOOKE_PAGESZ_16M)
  59. .long TLB1_MAS2(((CFG_FLASH_BASE>>12) & 0xfffff),0,0,0,0,1,0,1,0)
  60. .long TLB1_MAS3(((CFG_FLASH_BASE>>12) & 0xfffff),0,0,0,0,0,1,0,1,0,1)
  61. .long TLB1_MAS0(1,3,0)
  62. .long TLB1_MAS1(1,1,0,0,BOOKE_PAGESZ_1M)
  63. .long TLB1_MAS2(((CFG_LBC_LCLDEVS_BASE>>12) & 0xfffff),0,0,0,0,1,0,1,0)
  64. .long TLB1_MAS3(((CFG_LBC_LCLDEVS_BASE>>12) & 0xfffff),0,0,0,0,0,1,0,1,0,1)
  65. .long TLB1_MAS0(1,4,0)
  66. .long TLB1_MAS1(0,0,0,0,BOOKE_PAGESZ_1M)
  67. .long TLB1_MAS2(0,0,0,0,0,0,0,0,0)
  68. .long TLB1_MAS3(0,0,0,0,0,0,1,0,1,0,1)
  69. .long TLB1_MAS0(1,5,0)
  70. .long TLB1_MAS1(0,0,0,0,BOOKE_PAGESZ_1M)
  71. .long TLB1_MAS2(0,0,0,0,0,0,0,0,0)
  72. .long TLB1_MAS3(0,0,0,0,0,0,1,0,1,0,1)
  73. .long TLB1_MAS0(1,6,0)
  74. .long TLB1_MAS1(1,1,0,0,BOOKE_PAGESZ_64M)
  75. #if defined(CONFIG_RAM_AS_FLASH)
  76. .long TLB1_MAS2(((CFG_LBC_SDRAM_BASE>>12) & 0xfffff),0,0,0,0,1,0,1,0)
  77. #else
  78. .long TLB1_MAS2(((CFG_LBC_SDRAM_BASE>>12) & 0xfffff),0,0,0,0,0,0,0,0)
  79. #endif
  80. .long TLB1_MAS3(((CFG_LBC_SDRAM_BASE>>12) & 0xfffff),0,0,0,0,0,1,0,1,0,1)
  81. .long TLB1_MAS0(1,7,0)
  82. .long TLB1_MAS1(1,1,0,0,BOOKE_PAGESZ_16K)
  83. #ifdef CONFIG_L2_INIT_RAM
  84. .long TLB1_MAS2(((CFG_INIT_RAM_ADDR>>12) & 0xfffff),0,0,0,1,0,0,0,0)
  85. #else
  86. .long TLB1_MAS2(((CFG_INIT_RAM_ADDR>>12) & 0xfffff),0,0,0,0,0,0,0,0)
  87. #endif
  88. .long TLB1_MAS3(((CFG_INIT_RAM_ADDR>>12) & 0xfffff),0,0,0,0,0,1,0,1,0,1)
  89. .long TLB1_MAS0(1,8,0)
  90. .long TLB1_MAS1(1,1,0,0,BOOKE_PAGESZ_256M)
  91. .long TLB1_MAS2(((CFG_PCI_MEM_BASE>>12) & 0xfffff),0,0,0,0,1,0,1,0)
  92. .long TLB1_MAS3(((CFG_PCI_MEM_BASE>>12) & 0xfffff),0,0,0,0,0,1,0,1,0,1)
  93. #if (CFG_CCSRBAR_DEFAULT != CFG_CCSRBAR)
  94. .long TLB1_MAS0(1,15,0)
  95. .long TLB1_MAS1(1,1,0,0,BOOKE_PAGESZ_1M)
  96. .long TLB1_MAS2(((CFG_CCSRBAR_DEFAULT>>12) & 0xfffff),0,0,0,0,1,0,1,0)
  97. .long TLB1_MAS3(((CFG_CCSRBAR_DEFAULT>>12) & 0xfffff),0,0,0,0,0,1,0,1,0,1)
  98. #else
  99. .long TLB1_MAS0(1,15,0)
  100. .long TLB1_MAS1(0,0,0,0,BOOKE_PAGESZ_1M)
  101. .long TLB1_MAS2(0,0,0,0,0,0,0,0,0)
  102. .long TLB1_MAS3(0,0,0,0,0,0,1,0,1,0,1)
  103. #endif
  104. entry_end
  105. /* LAW(Local Access Window) configuration:
  106. * 0000_0000-8000_0000: Up to 2G DDR
  107. * f000_0000-f3ff_ffff: PCI(256M)
  108. * f400_0000-f7ff_ffff: RapidIO(128M)
  109. * f800_0000-ffff_ffff: localbus(128M)
  110. * f800_0000-fbff_ffff: LBC SDRAM(64M)
  111. * fc00_0000-fcff_ffff: LBC BCSR (1M, Chip select 1)
  112. * fdf0_0000-fdff_ffff: CCSRBAR(1M)
  113. * ff00_0000-ffff_ffff: Flash(16M)
  114. * We don't need a local window for CCSRBAR and flash because they
  115. * reside in their default mapped spaces.
  116. */
  117. #define LAWBAR0 0
  118. #define LAWAR0 ((LAWAR_TRGT_IF_DDR | (LAWAR_SIZE & LAWAR_SIZE_2G)) & ~LAWAR_EN)
  119. #define LAWBAR1 ((CFG_PCI_MEM_BASE>>12) & 0xfffff)
  120. #define LAWAR1 (LAWAR_EN | LAWAR_TRGT_IF_PCIX | (LAWAR_SIZE & LAWAR_SIZE_256M))
  121. #if !defined(CONFIG_RAM_AS_FLASH)
  122. #define LAWBAR2 ((CFG_LBC_SDRAM_BASE>>12) & 0xfffff)
  123. #define LAWAR2 (LAWAR_EN | LAWAR_TRGT_IF_LBC | (LAWAR_SIZE & LAWAR_SIZE_128M))
  124. #else
  125. #define LAWBAR2 0
  126. #define LAWAR2 ((LAWAR_TRGT_IF_LBC | (LAWAR_SIZE & LAWAR_SIZE_128M)) & ~LAWAR_EN)
  127. #endif
  128. .section .bootpg, "ax"
  129. .globl law_entry
  130. law_entry:
  131. entry_start
  132. .long 0x03
  133. .long LAWBAR0,LAWAR0,LAWBAR1,LAWAR1,LAWBAR2,LAWAR2
  134. entry_end