tlb.c 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
  51. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  52. 0, 1, BOOKE_PAGESZ_1M, 1),
  53. /* *I*G* - NAND flash */
  54. SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE, CONFIG_SYS_NAND_BASE,
  55. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  56. 0, 2, BOOKE_PAGESZ_1M, 1),
  57. #if CONFIG_PCI1
  58. /* *I*G* - PCI MEM */
  59. SET_TLB_ENTRY(1, CONFIG_SYS_PCI1_MEM_PHYS, CONFIG_SYS_PCI1_MEM_PHYS,
  60. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  61. 0, 3, BOOKE_PAGESZ_1G, 1),
  62. #endif
  63. #if CONFIG_PCI2
  64. /* *I*G* - PCI MEM */
  65. SET_TLB_ENTRY(1, CONFIG_SYS_PCI2_MEM_PHYS, CONFIG_SYS_PCI2_MEM_PHYS,
  66. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  67. 0, 4, BOOKE_PAGESZ_256M, 1),
  68. #endif
  69. #if defined(CONFIG_PCI1) || defined(CONFIG_PCI2)
  70. /* *I*G* - PCI IO */
  71. SET_TLB_ENTRY(1, CONFIG_SYS_PCI1_IO_PHYS, CONFIG_SYS_PCI1_IO_PHYS,
  72. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  73. 0, 5, BOOKE_PAGESZ_16M, 1),
  74. #endif
  75. };
  76. int num_tlb_entries = ARRAY_SIZE(tlb_table);