Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Kumar Gala | 9b1b769 | 2008-01-17 01:12:22 -0600 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2008 Freescale Semiconductor, Inc. |
| 4 | * |
| 5 | * (C) Copyright 2000 |
| 6 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
Kumar Gala | 9b1b769 | 2008-01-17 01:12:22 -0600 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #include <common.h> |
| 10 | #include <asm/mmu.h> |
| 11 | |
| 12 | struct fsl_e_tlb_entry tlb_table[] = { |
| 13 | /* TLB 0 - for temp stack in cache */ |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 14 | SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR, CONFIG_SYS_INIT_RAM_ADDR, |
Kumar Gala | 9b1b769 | 2008-01-17 01:12:22 -0600 | [diff] [blame] | 15 | MAS3_SX|MAS3_SW|MAS3_SR, 0, |
| 16 | 0, 0, BOOKE_PAGESZ_4K, 0), |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 17 | SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024, |
Kumar Gala | 9b1b769 | 2008-01-17 01:12:22 -0600 | [diff] [blame] | 18 | MAS3_SX|MAS3_SW|MAS3_SR, 0, |
| 19 | 0, 0, BOOKE_PAGESZ_4K, 0), |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 20 | SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024, |
Kumar Gala | 9b1b769 | 2008-01-17 01:12:22 -0600 | [diff] [blame] | 21 | MAS3_SX|MAS3_SW|MAS3_SR, 0, |
| 22 | 0, 0, BOOKE_PAGESZ_4K, 0), |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 23 | SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024, |
Kumar Gala | 9b1b769 | 2008-01-17 01:12:22 -0600 | [diff] [blame] | 24 | MAS3_SX|MAS3_SW|MAS3_SR, 0, |
| 25 | 0, 0, BOOKE_PAGESZ_4K, 0), |
| 26 | |
| 27 | /* TLB 1 Initializations */ |
| 28 | /* |
| 29 | * TLBe 0: 16M Non-cacheable, guarded |
| 30 | * 0xff000000 16M FLASH (upper half) |
| 31 | * Out of reset this entry is only 4K. |
| 32 | */ |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 33 | SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE + 0x1000000, CONFIG_SYS_FLASH_BASE + 0x1000000, |
Kumar Gala | 9b1b769 | 2008-01-17 01:12:22 -0600 | [diff] [blame] | 34 | MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, |
| 35 | 0, 0, BOOKE_PAGESZ_16M, 1), |
| 36 | |
| 37 | /* |
| 38 | * TLBe 1: 16M Non-cacheable, guarded |
| 39 | * 0xfe000000 16M FLASH (lower half) |
| 40 | */ |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 41 | SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE, |
Kumar Gala | 9b1b769 | 2008-01-17 01:12:22 -0600 | [diff] [blame] | 42 | MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, |
| 43 | 0, 1, BOOKE_PAGESZ_16M, 1), |
| 44 | |
| 45 | /* |
| 46 | * TLBe 2: 1G Non-cacheable, guarded |
| 47 | * 0x80000000 512M PCI1 MEM |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 48 | * 0xa0000000 512M PCIe MEM |
Kumar Gala | 9b1b769 | 2008-01-17 01:12:22 -0600 | [diff] [blame] | 49 | */ |
Kumar Gala | ef43b6e | 2008-12-02 16:08:39 -0600 | [diff] [blame] | 50 | SET_TLB_ENTRY(1, CONFIG_SYS_PCI1_MEM_VIRT, CONFIG_SYS_PCI1_MEM_PHYS, |
Kumar Gala | 9b1b769 | 2008-01-17 01:12:22 -0600 | [diff] [blame] | 51 | MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, |
| 52 | 0, 2, BOOKE_PAGESZ_1G, 1), |
| 53 | |
| 54 | /* |
| 55 | * TLBe 3: 64M Non-cacheable, guarded |
| 56 | * 0xe000_0000 1M CCSRBAR |
| 57 | * 0xe200_0000 8M PCI1 IO |
| 58 | * 0xe280_0000 8M PCIe IO |
| 59 | */ |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 60 | SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS, |
Kumar Gala | 9b1b769 | 2008-01-17 01:12:22 -0600 | [diff] [blame] | 61 | MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, |
| 62 | 0, 3, BOOKE_PAGESZ_64M, 1), |
| 63 | |
| 64 | /* |
| 65 | * TLBe 4: 64M Cacheable, non-guarded |
| 66 | * 0xf000_0000 64M LBC SDRAM |
| 67 | */ |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 68 | SET_TLB_ENTRY(1, CONFIG_SYS_LBC_SDRAM_BASE, CONFIG_SYS_LBC_SDRAM_BASE, |
York Sun | 05204d0 | 2017-12-05 10:57:54 -0800 | [diff] [blame] | 69 | MAS3_SX|MAS3_SW|MAS3_SR, MAS2_M, |
Kumar Gala | 9b1b769 | 2008-01-17 01:12:22 -0600 | [diff] [blame] | 70 | 0, 4, BOOKE_PAGESZ_64M, 1), |
| 71 | |
| 72 | /* |
| 73 | * TLBe 5: 256K Non-cacheable, guarded |
| 74 | * 0xf8000000 32K BCSR |
| 75 | * 0xf8008000 32K PIB (CS4) |
| 76 | * 0xf8010000 32K PIB (CS5) |
| 77 | */ |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 78 | SET_TLB_ENTRY(1, CONFIG_SYS_BCSR_BASE, CONFIG_SYS_BCSR_BASE, |
Kumar Gala | 9b1b769 | 2008-01-17 01:12:22 -0600 | [diff] [blame] | 79 | MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, |
| 80 | 0, 5, BOOKE_PAGESZ_256K, 1), |
| 81 | }; |
| 82 | |
| 83 | int num_tlb_entries = ARRAY_SIZE(tlb_table); |