tlb.c 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * Copyright 2008 Extreme Engineering Solutions, Inc.
  3. * Copyright 2008 Freescale Semiconductor, Inc.
  4. *
  5. * (C) Copyright 2000
  6. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  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 <common.h>
  27. #include <asm/mmu.h>
  28. struct fsl_e_tlb_entry tlb_table[] = {
  29. /* TLB 0 - for temp stack in cache */
  30. SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR, CONFIG_SYS_INIT_RAM_ADDR,
  31. MAS3_SX|MAS3_SW|MAS3_SR, 0,
  32. 0, 0, BOOKE_PAGESZ_4K, 0),
  33. SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024,
  34. CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024,
  35. MAS3_SX|MAS3_SW|MAS3_SR, 0,
  36. 0, 0, BOOKE_PAGESZ_4K, 0),
  37. SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024,
  38. CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024,
  39. MAS3_SX|MAS3_SW|MAS3_SR, 0,
  40. 0, 0, BOOKE_PAGESZ_4K, 0),
  41. SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024,
  42. CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024,
  43. MAS3_SX|MAS3_SW|MAS3_SR, 0,
  44. 0, 0, BOOKE_PAGESZ_4K, 0),
  45. /* W**G* - NOR flashes */
  46. /* This will be changed to *I*G* after relocation to RAM. */
  47. SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE2, CONFIG_SYS_FLASH_BASE2,
  48. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_W|MAS2_G,
  49. 0, 0, BOOKE_PAGESZ_256M, 1),
  50. /* *I*G* - CCSRBAR */
  51. SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
  52. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  53. 0, 1, BOOKE_PAGESZ_1M, 1),
  54. /* *I*G* - NAND flash */
  55. SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE, CONFIG_SYS_NAND_BASE,
  56. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  57. 0, 2, BOOKE_PAGESZ_1M, 1),
  58. #ifdef CONFIG_PCIE1
  59. /* *I*G* - PCIe */
  60. SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_MEM_PHYS, CONFIG_SYS_PCIE1_MEM_PHYS,
  61. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  62. 0, 3, BOOKE_PAGESZ_1G, 1),
  63. #endif
  64. #ifdef CONFIG_PCIE2
  65. /* *I*G* - PCIe */
  66. SET_TLB_ENTRY(1, CONFIG_SYS_PCIE2_MEM_PHYS, CONFIG_SYS_PCIE2_MEM_PHYS,
  67. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  68. 0, 4, BOOKE_PAGESZ_256M, 1),
  69. #endif
  70. #ifdef CONFIG_PCIE3
  71. /* *I*G* - PCIe */
  72. SET_TLB_ENTRY(1, CONFIG_SYS_PCIE3_MEM_PHYS, CONFIG_SYS_PCIE3_MEM_PHYS,
  73. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  74. 0, 5, BOOKE_PAGESZ_256M, 1),
  75. #endif
  76. #if defined(CONFIG_PCIE1) || defined(CONFIG_PCIE2) || defined(CONFIG_PCIE3)
  77. /* *I*G* - PCIe */
  78. SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_IO_PHYS, CONFIG_SYS_PCIE1_IO_PHYS,
  79. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  80. 0, 6, BOOKE_PAGESZ_64M, 1),
  81. #endif
  82. };
  83. int num_tlb_entries = ARRAY_SIZE(tlb_table);