init.S 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /*
  2. * Copyright (C) 2002,2003, Motorola Inc.
  3. * Xianghua Xiao <X.Xiao@motorola.com>
  4. *
  5. * (C) Copyright 2004 Wind River Systems Inc <www.windriver.com>.
  6. * Added support for Wind River SBC8560 board
  7. *
  8. * See file CREDITS for list of people who contributed to this
  9. * project.
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License as
  13. * published by the Free Software Foundation; either version 2 of
  14. * the License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  24. * MA 02111-1307 USA
  25. */
  26. #include <ppc_asm.tmpl>
  27. #include <ppc_defs.h>
  28. #include <asm/cache.h>
  29. #include <asm/mmu.h>
  30. #include <config.h>
  31. #include <mpc85xx.h>
  32. #define entry_start \
  33. mflr r1 ; \
  34. bl 0f ;
  35. #define entry_end \
  36. 0: mflr r0 ; \
  37. mtlr r1 ; \
  38. blr ;
  39. /* LAW(Local Access Window) configuration:
  40. * 0000_0000-0800_0000: DDR(512M) -or- larger
  41. * c000_0000-cfff_ffff: PCI(256M)
  42. * d000_0000-dfff_ffff: RapidIO(256M)
  43. * e000_0000-ffff_ffff: localbus(512M)
  44. * e000_0000-e3ff_ffff: LBC 64M, 32-bit flash on CS6
  45. * e400_0000-e7ff_ffff: LBC 64M, 32-bit flash on CS1
  46. * e800_0000-efff_ffff: LBC 128M, nothing here
  47. * f000_0000-f3ff_ffff: LBC 64M, SDRAM on CS3
  48. * f400_0000-f7ff_ffff: LBC 64M, SDRAM on CS4
  49. * f800_0000-fdff_ffff: LBC 64M, nothing here
  50. * fc00_0000-fcff_ffff: LBC 16M, CSR,RTC,UART,etc on CS5
  51. * fd00_0000-fdff_ffff: LBC 16M, nothing here
  52. * fe00_0000-feff_ffff: LBC 16M, nothing here
  53. * ff00_0000-ff6f_ffff: LBC 7M, nothing here
  54. * ff70_0000-ff7f_ffff: CCSRBAR 1M
  55. * ff80_0000-ffff_ffff: LBC 8M, 8-bit flash on CS0
  56. * Note: CCSRBAR and L2-as-SRAM don't need configure Local Access
  57. * Window.
  58. * Note: If flash is 8M at default position(last 8M),no LAW needed.
  59. */
  60. #if !defined(CONFIG_SPD_EEPROM)
  61. #define LAWBAR0 ((CFG_DDR_SDRAM_BASE>>12) & 0xfffff)
  62. #define LAWAR0 (LAWAR_EN | LAWAR_TRGT_IF_DDR | (LAWAR_SIZE & LAWAR_SIZE_512M))
  63. #else
  64. #define LAWBAR0 0
  65. #define LAWAR0 ((LAWAR_TRGT_IF_DDR | (LAWAR_SIZE & LAWAR_SIZE_512M)) & ~LAWAR_EN)
  66. #endif
  67. #define LAWBAR1 ((CFG_PCI_MEM_BASE>>12) & 0xfffff)
  68. #define LAWAR1 (LAWAR_EN | LAWAR_TRGT_IF_PCIX | (LAWAR_SIZE & LAWAR_SIZE_256M))
  69. #define LAWBAR2 ((0xe0000000>>12) & 0xfffff)
  70. #define LAWAR2 (LAWAR_EN | LAWAR_TRGT_IF_LBC | (LAWAR_SIZE & LAWAR_SIZE_512M))
  71. .section .bootpg, "ax"
  72. .globl law_entry
  73. law_entry:
  74. entry_start
  75. .long 0x03
  76. .long LAWBAR0,LAWAR0,LAWBAR1,LAWAR1,LAWBAR2,LAWAR2
  77. entry_end
  78. /* TLB1 entries configuration: */
  79. .section .bootpg, "ax"
  80. .globl tlb1_entry
  81. tlb1_entry:
  82. entry_start
  83. .long 0x08 /* the following data table uses a few of 16 TLB entries */
  84. /* TLB for CCSRBAR (IMMR) */
  85. .long TLB1_MAS0(1,1,0)
  86. .long TLB1_MAS1(1,1,0,0,BOOKE_PAGESZ_1M)
  87. .long TLB1_MAS2(((CFG_CCSRBAR>>12) & 0xfffff),0,0,0,0,1,0,1,0)
  88. .long TLB1_MAS3(((CFG_CCSRBAR>>12) & 0xfffff),0,0,0,0,0,1,0,1,0,1)
  89. /* TLB for Local Bus stuff, just map the whole 512M */
  90. /* note that the LBC SDRAM is cache-inhibit and guarded, like everything else */
  91. .long TLB1_MAS0(1,2,0)
  92. .long TLB1_MAS1(1,1,0,0,BOOKE_PAGESZ_256M)
  93. .long TLB1_MAS2(((0xe0000000>>12) & 0xfffff),0,0,0,0,1,0,1,0)
  94. .long TLB1_MAS3(((0xe0000000>>12) & 0xfffff),0,0,0,0,0,1,0,1,0,1)
  95. .long TLB1_MAS0(1,3,0)
  96. .long TLB1_MAS1(1,1,0,0,BOOKE_PAGESZ_256M)
  97. .long TLB1_MAS2(((0xf0000000>>12)&0xfffff),0,0,0,0,1,0,1,0)
  98. .long TLB1_MAS3(((0xf0000000>>12)&0xfffff),0,0,0,0,0,1,0,1,0,1)
  99. #if !defined(CONFIG_SPD_EEPROM)
  100. .long TLB1_MAS0(1,4,0)
  101. .long TLB1_MAS1(1,1,0,0,BOOKE_PAGESZ_256M)
  102. .long TLB1_MAS2(((CFG_DDR_SDRAM_BASE>>12) & 0xfffff),0,0,0,0,0,0,0,0)
  103. .long TLB1_MAS3(((CFG_DDR_SDRAM_BASE>>12) & 0xfffff),0,0,0,0,0,1,0,1,0,1)
  104. .long TLB1_MAS0(1,5,0)
  105. .long TLB1_MAS1(1,1,0,0,BOOKE_PAGESZ_256M)
  106. .long TLB1_MAS2((((CFG_DDR_SDRAM_BASE+0x10000000)>>12) & 0xfffff),0,0,0,0,0,0,0,0)
  107. .long TLB1_MAS3((((CFG_DDR_SDRAM_BASE+0x10000000)>>12) & 0xfffff),0,0,0,0,0,1,0,1,0,1)
  108. #else
  109. .long TLB1_MAS0(1,4,0)
  110. .long TLB1_MAS1(0,0,0,0,BOOKE_PAGESZ_1M)
  111. .long TLB1_MAS2(0,0,0,0,0,0,0,0,0)
  112. .long TLB1_MAS3(0,0,0,0,0,0,1,0,1,0,1)
  113. .long TLB1_MAS0(1,5,0)
  114. .long TLB1_MAS1(0,0,0,0,BOOKE_PAGESZ_1M)
  115. .long TLB1_MAS2(0,0,0,0,0,0,0,0,0)
  116. .long TLB1_MAS3(0,0,0,0,0,0,1,0,1,0,1)
  117. #endif
  118. .long TLB1_MAS0(1,6,0)
  119. .long TLB1_MAS1(1,1,0,0,BOOKE_PAGESZ_16K)
  120. #ifdef CONFIG_L2_INIT_RAM
  121. .long TLB1_MAS2(((CFG_INIT_RAM_ADDR>>12) & 0xfffff),0,0,0,1,0,0,0,0)
  122. #else
  123. .long TLB1_MAS2(((CFG_INIT_RAM_ADDR>>12) & 0xfffff),0,0,0,0,0,0,0,0)
  124. #endif
  125. .long TLB1_MAS3(((CFG_INIT_RAM_ADDR>>12) & 0xfffff),0,0,0,0,0,1,0,1,0,1)
  126. .long TLB1_MAS0(1,7,0)
  127. .long TLB1_MAS1(1,1,0,0,BOOKE_PAGESZ_256M)
  128. .long TLB1_MAS2(((CFG_PCI_MEM_BASE>>12) & 0xfffff),0,0,0,0,1,0,1,0)
  129. .long TLB1_MAS3(((CFG_PCI_MEM_BASE>>12) & 0xfffff),0,0,0,0,0,1,0,1,0,1)
  130. #if (CFG_CCSRBAR_DEFAULT != CFG_CCSRBAR)
  131. .long TLB1_MAS0(1,15,0)
  132. .long TLB1_MAS1(1,1,0,0,BOOKE_PAGESZ_1M)
  133. .long TLB1_MAS2(((CFG_CCSRBAR_DEFAULT>>12) & 0xfffff),0,0,0,0,1,0,1,0)
  134. .long TLB1_MAS3(((CFG_CCSRBAR_DEFAULT>>12) & 0xfffff),0,0,0,0,0,1,0,1,0,1)
  135. #else
  136. .long TLB1_MAS0(1,15,0)
  137. .long TLB1_MAS1(0,0,0,0,BOOKE_PAGESZ_1M)
  138. .long TLB1_MAS2(0,0,0,0,0,0,0,0,0)
  139. .long TLB1_MAS3(0,0,0,0,0,0,1,0,1,0,1)
  140. #endif
  141. entry_end