2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2008-07-25 18:31:05 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2008 Freescale Semiconductor, Inc.
|
|
|
|
*
|
|
|
|
* (C) Copyright 2000
|
|
|
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <asm/mmu.h>
|
|
|
|
|
|
|
|
struct fsl_e_tlb_entry tlb_table[] = {
|
|
|
|
/* TLB 0 - for temp stack in cache */
|
2008-10-16 13:01:15 +00:00
|
|
|
SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR, CONFIG_SYS_INIT_RAM_ADDR,
|
2008-07-25 18:31:05 +00:00
|
|
|
MAS3_SX|MAS3_SW|MAS3_SR, 0,
|
|
|
|
0, 0, BOOKE_PAGESZ_4K, 0),
|
2008-10-16 13:01:15 +00:00
|
|
|
SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024,
|
2008-07-25 18:31:05 +00:00
|
|
|
MAS3_SX|MAS3_SW|MAS3_SR, 0,
|
|
|
|
0, 0, BOOKE_PAGESZ_4K, 0),
|
2008-10-16 13:01:15 +00:00
|
|
|
SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024,
|
2008-07-25 18:31:05 +00:00
|
|
|
MAS3_SX|MAS3_SW|MAS3_SR, 0,
|
|
|
|
0, 0, BOOKE_PAGESZ_4K, 0),
|
2008-10-16 13:01:15 +00:00
|
|
|
SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024,
|
2008-07-25 18:31:05 +00:00
|
|
|
MAS3_SX|MAS3_SW|MAS3_SR, 0,
|
|
|
|
0, 0, BOOKE_PAGESZ_4K, 0),
|
|
|
|
|
2008-12-02 20:19:33 +00:00
|
|
|
SET_TLB_ENTRY(0, PIXIS_BASE, PIXIS_BASE_PHYS,
|
2008-07-25 18:31:05 +00:00
|
|
|
MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
|
|
|
|
0, 0, BOOKE_PAGESZ_4K, 0),
|
|
|
|
|
|
|
|
/* TLB 1 */
|
|
|
|
/* *I*G* - CCSRBAR */
|
2008-10-16 13:01:15 +00:00
|
|
|
SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
|
2008-07-25 18:31:05 +00:00
|
|
|
MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
|
|
|
|
0, 0, BOOKE_PAGESZ_1M, 1),
|
|
|
|
|
|
|
|
/* W**G* - Flash/promjet, localbus */
|
|
|
|
/* This will be changed to *I*G* after relocation to RAM. */
|
2008-12-02 20:19:34 +00:00
|
|
|
SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE_PHYS,
|
2008-09-22 19:11:11 +00:00
|
|
|
MAS3_SX|MAS3_SR, MAS2_W|MAS2_G,
|
2008-07-25 18:31:05 +00:00
|
|
|
0, 1, BOOKE_PAGESZ_256M, 1),
|
|
|
|
|
|
|
|
/* *I*G* - PCI */
|
2008-12-02 22:08:39 +00:00
|
|
|
SET_TLB_ENTRY(1, CONFIG_SYS_PCI1_MEM_VIRT, CONFIG_SYS_PCI1_MEM_PHYS,
|
2008-07-25 18:31:05 +00:00
|
|
|
MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
|
|
|
|
0, 2, BOOKE_PAGESZ_1G, 1),
|
|
|
|
|
|
|
|
/* *I*G* - PCI I/O */
|
2008-12-02 22:08:40 +00:00
|
|
|
SET_TLB_ENTRY(1, CONFIG_SYS_PCI1_IO_VIRT, CONFIG_SYS_PCI1_IO_PHYS,
|
2008-07-25 18:31:05 +00:00
|
|
|
MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
|
|
|
|
0, 3, BOOKE_PAGESZ_256K, 1),
|
2008-10-31 10:07:04 +00:00
|
|
|
|
|
|
|
/* *I*G - NAND */
|
|
|
|
SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE, CONFIG_SYS_NAND_BASE_PHYS,
|
|
|
|
MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
|
|
|
|
0, 4, BOOKE_PAGESZ_1M, 1),
|
NAND boot: MPC8536DS support
MPC8536E can support booting from NAND flash which uses the
image u-boot-nand.bin. This image contains two parts: a 4K
NAND loader and a main U-Boot image. The former is appended
to the latter to produce u-boot-nand.bin. The 4K NAND loader
includes the corresponding nand_spl directory, along with the
code twisted by CONFIG_NAND_SPL. The main U-Boot image just
like a general U-Boot image except the parts that included by
CONFIG_SYS_RAMBOOT.
When power on, eLBC will automatically load from bank 0 the
4K NAND loader into the FCM buffer RAM where CPU can execute
the boot code directly. In the first stage, the NAND loader
copies itself to RAM or L2SRAM to free up the FCM buffer RAM,
then loads the main image from NAND flash to RAM or L2SRAM
and boot from it.
This patch implements the NAND loader to load the main image
into L2SRAM, so the main image can configure the RAM by using
SPD EEPROM. In the first stage, the NAND loader copies itself
to the second to last 4K address space, and uses the last 4K
address space as the initial RAM for stack.
Obviously, the size of L2SRAM shouldn't be less than the size
of the image used. If so, the workaround is to generate another
image that includes the code to configure the RAM by SPD and
load it to L2SRAM first, then relocate the main image to RAM
to boot up.
Signed-off-by: Mingkai Hu <Mingkai.hu@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2009-09-23 07:20:37 +00:00
|
|
|
|
|
|
|
#if defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_SYS_INIT_L2_ADDR)
|
|
|
|
/* *I*G - L2SRAM */
|
|
|
|
SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR, CONFIG_SYS_INIT_L2_ADDR_PHYS,
|
|
|
|
MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
|
|
|
|
0, 5, BOOKE_PAGESZ_256K, 1),
|
|
|
|
SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR + 0x40000,
|
|
|
|
CONFIG_SYS_INIT_L2_ADDR_PHYS + 0x40000,
|
|
|
|
MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
|
|
|
|
0, 6, BOOKE_PAGESZ_256K, 1),
|
|
|
|
#endif
|
2008-07-25 18:31:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
int num_tlb_entries = ARRAY_SIZE(tlb_table);
|