1143b518dSKumar Gala /* 2143b518dSKumar Gala * Copyright 2008 Freescale Semiconductor, Inc. 3143b518dSKumar Gala * 4143b518dSKumar Gala * (C) Copyright 2000 5143b518dSKumar Gala * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 6143b518dSKumar Gala * 7*1a459660SWolfgang Denk * SPDX-License-Identifier: GPL-2.0+ 8143b518dSKumar Gala */ 9143b518dSKumar Gala 10143b518dSKumar Gala #include <common.h> 11143b518dSKumar Gala #include <asm/mmu.h> 12143b518dSKumar Gala 13143b518dSKumar Gala struct fsl_e_tlb_entry tlb_table[] = { 14143b518dSKumar Gala /* TLB 0 - for temp stack in cache */ 156d0f6bcfSJean-Christophe PLAGNIOL-VILLARD SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR, CONFIG_SYS_INIT_RAM_ADDR, 16143b518dSKumar Gala MAS3_SX|MAS3_SW|MAS3_SR, 0, 17143b518dSKumar Gala 0, 0, BOOKE_PAGESZ_4K, 0), 18ded58f41SPaul Gortmaker SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024, 19ded58f41SPaul Gortmaker CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024, 20143b518dSKumar Gala MAS3_SX|MAS3_SW|MAS3_SR, 0, 21143b518dSKumar Gala 0, 0, BOOKE_PAGESZ_4K, 0), 22ded58f41SPaul Gortmaker SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024, 23ded58f41SPaul Gortmaker CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024, 24143b518dSKumar Gala MAS3_SX|MAS3_SW|MAS3_SR, 0, 25143b518dSKumar Gala 0, 0, BOOKE_PAGESZ_4K, 0), 26ded58f41SPaul Gortmaker SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024, 27ded58f41SPaul Gortmaker CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024, 28143b518dSKumar Gala MAS3_SX|MAS3_SW|MAS3_SR, 0, 29143b518dSKumar Gala 0, 0, BOOKE_PAGESZ_4K, 0), 30143b518dSKumar Gala 31143b518dSKumar Gala /* 329b3ba24fSPaul Gortmaker * TLB 0: 64M Non-cacheable, guarded 333fd673cfSPaul Gortmaker * 0xfc000000 56M unused 349b3ba24fSPaul Gortmaker * 0xff800000 8M boot FLASH 353fd673cfSPaul Gortmaker * .... or .... 363fd673cfSPaul Gortmaker * 0xfc000000 64M user flash 373fd673cfSPaul Gortmaker * 38143b518dSKumar Gala * Out of reset this entry is only 4K. 39143b518dSKumar Gala */ 403fd673cfSPaul Gortmaker SET_TLB_ENTRY(1, 0xfc000000, 0xfc000000, 41143b518dSKumar Gala MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, 429b3ba24fSPaul Gortmaker 0, 0, BOOKE_PAGESZ_64M, 1), 43143b518dSKumar Gala 44143b518dSKumar Gala /* 45fdc7eb90SPaul Gortmaker * TLB 1: 1G Non-cacheable, guarded 46fdc7eb90SPaul Gortmaker * 0x80000000 512M PCI1 MEM 47fdc7eb90SPaul Gortmaker * 0xa0000000 512M PCIe MEM 48143b518dSKumar Gala */ 49fdc7eb90SPaul Gortmaker SET_TLB_ENTRY(1, CONFIG_SYS_PCI1_MEM_VIRT, CONFIG_SYS_PCI1_MEM_PHYS, 50143b518dSKumar Gala MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, 51fdc7eb90SPaul Gortmaker 0, 1, BOOKE_PAGESZ_1G, 1), 52143b518dSKumar Gala 53143b518dSKumar Gala /* 5438dba0c2SBecky Bruce * TLB 2: 64M Non-cacheable, guarded 55143b518dSKumar Gala * 0xe0000000 1M CCSRBAR 56fdc7eb90SPaul Gortmaker * 0xe2000000 8M PCI1 IO 57fdc7eb90SPaul Gortmaker * 0xe2800000 8M PCIe IO 58143b518dSKumar Gala */ 596d0f6bcfSJean-Christophe PLAGNIOL-VILLARD SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS, 60143b518dSKumar Gala MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, 6138dba0c2SBecky Bruce 0, 2, BOOKE_PAGESZ_64M, 1), 62143b518dSKumar Gala 637e44f2b7SPaul Gortmaker #ifdef CONFIG_SYS_LBC_SDRAM_BASE 64143b518dSKumar Gala /* 6538dba0c2SBecky Bruce * TLB 3: 64M Cacheable, non-guarded 6611d5a629SPaul Gortmaker * 0xf0000000 64M LBC SDRAM First half 67143b518dSKumar Gala */ 686d0f6bcfSJean-Christophe PLAGNIOL-VILLARD SET_TLB_ENTRY(1, CONFIG_SYS_LBC_SDRAM_BASE, CONFIG_SYS_LBC_SDRAM_BASE, 69143b518dSKumar Gala MAS3_SX|MAS3_SW|MAS3_SR, 0, 7038dba0c2SBecky Bruce 0, 3, BOOKE_PAGESZ_64M, 1), 71143b518dSKumar Gala 72143b518dSKumar Gala /* 7338dba0c2SBecky Bruce * TLB 4: 64M Cacheable, non-guarded 7411d5a629SPaul Gortmaker * 0xf4000000 64M LBC SDRAM Second half 7511d5a629SPaul Gortmaker */ 7611d5a629SPaul Gortmaker SET_TLB_ENTRY(1, CONFIG_SYS_LBC_SDRAM_BASE + 0x4000000, 7711d5a629SPaul Gortmaker CONFIG_SYS_LBC_SDRAM_BASE + 0x4000000, 7811d5a629SPaul Gortmaker MAS3_SX|MAS3_SW|MAS3_SR, 0, 7938dba0c2SBecky Bruce 0, 4, BOOKE_PAGESZ_64M, 1), 807e44f2b7SPaul Gortmaker #endif 8111d5a629SPaul Gortmaker 8211d5a629SPaul Gortmaker /* 8338dba0c2SBecky Bruce * TLB 5: 16M Cacheable, non-guarded 84143b518dSKumar Gala * 0xf8000000 1M 7-segment LED display 85143b518dSKumar Gala * 0xf8100000 1M User switches 86143b518dSKumar Gala * 0xf8300000 1M Board revision 87143b518dSKumar Gala * 0xf8b00000 1M EEPROM 88143b518dSKumar Gala */ 896d0f6bcfSJean-Christophe PLAGNIOL-VILLARD SET_TLB_ENTRY(1, CONFIG_SYS_EPLD_BASE, CONFIG_SYS_EPLD_BASE, 90143b518dSKumar Gala MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, 9138dba0c2SBecky Bruce 0, 5, BOOKE_PAGESZ_16M, 1), 929b3ba24fSPaul Gortmaker 93f0aec4eaSPaul Gortmaker #ifndef CONFIG_SYS_ALT_BOOT 949b3ba24fSPaul Gortmaker /* 953fd673cfSPaul Gortmaker * TLB 6: 64M Non-cacheable, guarded 963fd673cfSPaul Gortmaker * 0xec000000 64M 64MB user FLASH 979b3ba24fSPaul Gortmaker */ 989b3ba24fSPaul Gortmaker SET_TLB_ENTRY(1, CONFIG_SYS_ALT_FLASH, CONFIG_SYS_ALT_FLASH, 999b3ba24fSPaul Gortmaker MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, 1003fd673cfSPaul Gortmaker 0, 6, BOOKE_PAGESZ_64M, 1), 101f0aec4eaSPaul Gortmaker #else 102f0aec4eaSPaul Gortmaker /* 103f0aec4eaSPaul Gortmaker * TLB 6: 4M Non-cacheable, guarded 104f0aec4eaSPaul Gortmaker * 0xef800000 4M 1st 1/2 8MB soldered FLASH 105f0aec4eaSPaul Gortmaker */ 106f0aec4eaSPaul Gortmaker SET_TLB_ENTRY(1, CONFIG_SYS_ALT_FLASH, CONFIG_SYS_ALT_FLASH, 107f0aec4eaSPaul Gortmaker MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, 108f0aec4eaSPaul Gortmaker 0, 6, BOOKE_PAGESZ_4M, 1), 109f0aec4eaSPaul Gortmaker 110f0aec4eaSPaul Gortmaker /* 111f0aec4eaSPaul Gortmaker * TLB 7: 4M Non-cacheable, guarded 112f0aec4eaSPaul Gortmaker * 0xefc00000 4M 2nd half 8MB soldered FLASH 113f0aec4eaSPaul Gortmaker */ 114f0aec4eaSPaul Gortmaker SET_TLB_ENTRY(1, CONFIG_SYS_ALT_FLASH + 0x400000, 115f0aec4eaSPaul Gortmaker CONFIG_SYS_ALT_FLASH + 0x400000, 116f0aec4eaSPaul Gortmaker MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, 117f0aec4eaSPaul Gortmaker 0, 7, BOOKE_PAGESZ_4M, 1), 118f0aec4eaSPaul Gortmaker #endif 1199b3ba24fSPaul Gortmaker 120143b518dSKumar Gala }; 121143b518dSKumar Gala 122143b518dSKumar Gala int num_tlb_entries = ARRAY_SIZE(tlb_table); 123