tlb.c 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * (C) Copyright 2000
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #include <common.h>
  24. #include <asm/mmu.h>
  25. struct fsl_e_tlb_entry tlb_table[] = {
  26. /* TLB 0 - for temp stack in cache */
  27. SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR, CONFIG_SYS_INIT_RAM_ADDR,
  28. MAS3_SX|MAS3_SW|MAS3_SR, 0,
  29. 0, 0, BOOKE_PAGESZ_4K, 0),
  30. SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024,
  31. CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024,
  32. MAS3_SX|MAS3_SW|MAS3_SR, 0,
  33. 0, 0, BOOKE_PAGESZ_4K, 0),
  34. SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024,
  35. CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024,
  36. MAS3_SX|MAS3_SW|MAS3_SR, 0,
  37. 0, 0, BOOKE_PAGESZ_4K, 0),
  38. SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024,
  39. CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024,
  40. MAS3_SX|MAS3_SW|MAS3_SR, 0,
  41. 0, 0, BOOKE_PAGESZ_4K, 0),
  42. /*
  43. * TLB 0: 256M Non-cacheable, guarded
  44. * 0xf0000000 256M LBC (FLASH included)
  45. * Out of reset this entry is only 4K.
  46. */
  47. SET_TLB_ENTRY(1, CONFIG_SYS_LBC_OPTION_BASE,
  48. CONFIG_SYS_LBC_OPTION_BASE_PHYS,
  49. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  50. 0, 0, BOOKE_PAGESZ_256M, 1),
  51. /*
  52. * TLB 1: 1M Non-cacheable, guarded
  53. * 0xe000_0000 1M CCSRBAR
  54. */
  55. SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
  56. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  57. 0, 1, BOOKE_PAGESZ_1M, 1),
  58. #ifdef CONFIG_SYS_SRIO1_MEM_PHYS
  59. /*
  60. * TLB 2: 256M Non-cacheable, guarded
  61. */
  62. SET_TLB_ENTRY(1, CONFIG_SYS_SRIO1_MEM_VIRT, CONFIG_SYS_SRIO1_MEM_PHYS,
  63. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  64. 0, 2, BOOKE_PAGESZ_256M, 1),
  65. /*
  66. * TLB 3: 256M Non-cacheable, guarded
  67. */
  68. SET_TLB_ENTRY(1, CONFIG_SYS_SRIO1_MEM_VIRT + 0x10000000,
  69. CONFIG_SYS_SRIO1_MEM_PHYS + 0x10000000,
  70. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  71. 0, 3, BOOKE_PAGESZ_256M, 1),
  72. #endif
  73. };
  74. int num_tlb_entries = ARRAY_SIZE(tlb_table);