Add emulator support for T4240. Emulator has limited peripherals and interfaces. Difference between emulator and T4240QDS includes: ECC for DDR is disabled due the procedure to load images No board FPGA (QIXIS) NOR flash has 32-bit port for higher loading speed IFC and I2C timing don't really matter, so set them fast No ethernet Signed-off-by: York Sun <yorksun@freescale.com>master
parent
f165bc3528
commit
1cb19fbb31
@ -0,0 +1,122 @@ |
|||||||
|
/*
|
||||||
|
* Copyright 2013 Freescale Semiconductor, Inc. |
||||||
|
* |
||||||
|
* This program is free software; you can redistribute it and/or |
||||||
|
* modify it under the terms of the GNU General Public License as |
||||||
|
* published by the Free Software Foundation; either version 2 of |
||||||
|
* the License, or (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU General Public License |
||||||
|
* along with this program; if not, write to the Free Software |
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
||||||
|
* MA 02111-1307 USA |
||||||
|
*/ |
||||||
|
|
||||||
|
#ifndef __DDR_H__ |
||||||
|
#define __DDR_H__ |
||||||
|
struct board_specific_parameters { |
||||||
|
u32 n_ranks; |
||||||
|
u32 datarate_mhz_high; |
||||||
|
u32 rank_gb; |
||||||
|
u32 clk_adjust; |
||||||
|
u32 wrlvl_start; |
||||||
|
u32 wrlvl_ctl_2; |
||||||
|
u32 wrlvl_ctl_3; |
||||||
|
u32 cpo; |
||||||
|
u32 write_data_delay; |
||||||
|
u32 force_2T; |
||||||
|
}; |
||||||
|
|
||||||
|
/*
|
||||||
|
* These tables contain all valid speeds we want to override with board |
||||||
|
* specific parameters. datarate_mhz_high values need to be in ascending order |
||||||
|
* for each n_ranks group. |
||||||
|
*/ |
||||||
|
|
||||||
|
#ifdef CONFIG_T4240QDS |
||||||
|
static const struct board_specific_parameters udimm0[] = { |
||||||
|
/*
|
||||||
|
* memory controller 0 |
||||||
|
* num| hi| rank| clk| wrlvl | wrlvl | wrlvl | cpo |wrdata|2T |
||||||
|
* ranks| mhz| GB |adjst| start | ctl2 | ctl3 | |delay | |
||||||
|
*/ |
||||||
|
{2, 1350, 4, 4, 8, 0x0809090b, 0x0c0c0d0a, 0xff, 2, 0}, |
||||||
|
{2, 1350, 0, 5, 7, 0x0709090b, 0x0c0c0d09, 0xff, 2, 0}, |
||||||
|
{2, 1666, 4, 4, 8, 0x080a0a0d, 0x0d10100b, 0xff, 2, 0}, |
||||||
|
{2, 1666, 0, 5, 7, 0x080a0a0c, 0x0d0d0e0a, 0xff, 2, 0}, |
||||||
|
{2, 1900, 0, 4, 8, 0x090a0b0e, 0x0f11120c, 0xff, 2, 0}, |
||||||
|
{2, 2140, 0, 4, 8, 0x090a0b0e, 0x0f11120c, 0xff, 2, 0}, |
||||||
|
{1, 1350, 0, 5, 8, 0x0809090b, 0x0c0c0d0a, 0xff, 2, 0}, |
||||||
|
{1, 1700, 0, 5, 8, 0x080a0a0c, 0x0c0d0e0a, 0xff, 2, 0}, |
||||||
|
{1, 1900, 0, 4, 8, 0x080a0a0c, 0x0e0e0f0a, 0xff, 2, 0}, |
||||||
|
{1, 2140, 0, 4, 8, 0x090a0b0c, 0x0e0f100b, 0xff, 2, 0}, |
||||||
|
{} |
||||||
|
}; |
||||||
|
|
||||||
|
static const struct board_specific_parameters rdimm0[] = { |
||||||
|
/*
|
||||||
|
* memory controller 0 |
||||||
|
* num| hi| rank| clk| wrlvl | wrlvl | wrlvl | cpo |wrdata|2T |
||||||
|
* ranks| mhz| GB |adjst| start | ctl2 | ctl3 | |delay | |
||||||
|
*/ |
||||||
|
{4, 1350, 0, 5, 9, 0x08070605, 0x07080805, 0xff, 2, 0}, |
||||||
|
{4, 1666, 0, 5, 8, 0x08070605, 0x07080805, 0xff, 2, 0}, |
||||||
|
{4, 2140, 0, 5, 8, 0x08070605, 0x07081805, 0xff, 2, 0}, |
||||||
|
{2, 1350, 0, 5, 7, 0x0809090b, 0x0c0c0d09, 0xff, 2, 0}, |
||||||
|
{2, 1666, 0, 5, 8, 0x080a0a0c, 0x0c0d0e0a, 0xff, 2, 0}, |
||||||
|
{2, 2140, 0, 5, 8, 0x090a0b0c, 0x0e0f100b, 0xff, 2, 0}, |
||||||
|
{1, 1350, 0, 5, 8, 0x0809090b, 0x0c0c0d0a, 0xff, 2, 0}, |
||||||
|
{1, 1700, 0, 5, 8, 0x080a0a0c, 0x0c0d0e0a, 0xff, 2, 0}, |
||||||
|
{1, 1900, 0, 4, 8, 0x080a0a0c, 0x0e0e0f0a, 0xff, 2, 0}, |
||||||
|
{1, 2140, 0, 4, 8, 0x090a0b0c, 0x0e0f100b, 0xff, 2, 0}, |
||||||
|
{} |
||||||
|
}; |
||||||
|
|
||||||
|
#else /* CONFIG_T4240EMU */ |
||||||
|
static const struct board_specific_parameters udimm0[] = { |
||||||
|
/*
|
||||||
|
* memory controller 0 |
||||||
|
* num| hi| rank| clk| wrlvl | wrlvl | wrlvl | cpo |wrdata|2T |
||||||
|
* ranks| mhz| GB |adjst| start | ctl2 | ctl3 | |delay | |
||||||
|
*/ |
||||||
|
{2, 2140, 0, 4, 8, 0x0, 0x0, 0xff, 2, 0}, |
||||||
|
{1, 2140, 0, 4, 8, 0x0, 0x0, 0xff, 2, 0}, |
||||||
|
{} |
||||||
|
}; |
||||||
|
|
||||||
|
static const struct board_specific_parameters rdimm0[] = { |
||||||
|
/*
|
||||||
|
* memory controller 0 |
||||||
|
* num| hi| rank| clk| wrlvl | wrlvl | wrlvl | cpo |wrdata|2T |
||||||
|
* ranks| mhz| GB |adjst| start | ctl2 | ctl3 | |delay | |
||||||
|
*/ |
||||||
|
{4, 2140, 0, 5, 8, 0x0, 0x0, 0xff, 2, 0}, |
||||||
|
{2, 2140, 0, 5, 8, 0x0, 0x0, 0xff, 2, 0}, |
||||||
|
{1, 2140, 0, 4, 8, 0x0, 0x0, 0xff, 2, 0}, |
||||||
|
{} |
||||||
|
}; |
||||||
|
#endif /* CONFIG_T4240EMU */ |
||||||
|
|
||||||
|
/*
|
||||||
|
* The three slots have slightly different timing. The center values are good |
||||||
|
* for all slots. We use identical speed tables for them. In future use, if |
||||||
|
* DIMMs require separated tables, make more entries as needed. |
||||||
|
*/ |
||||||
|
static const struct board_specific_parameters *udimms[] = { |
||||||
|
udimm0, |
||||||
|
}; |
||||||
|
|
||||||
|
/*
|
||||||
|
* The three slots have slightly different timing. See comments above. |
||||||
|
*/ |
||||||
|
static const struct board_specific_parameters *rdimms[] = { |
||||||
|
rdimm0, |
||||||
|
}; |
||||||
|
|
||||||
|
|
||||||
|
#endif |
@ -0,0 +1,96 @@ |
|||||||
|
/*
|
||||||
|
* Copyright 2013 Freescale Semiconductor, Inc. |
||||||
|
* |
||||||
|
* See file CREDITS for list of people who contributed to this |
||||||
|
* project. |
||||||
|
* |
||||||
|
* This program is free software; you can redistribute it and/or |
||||||
|
* modify it under the terms of the GNU General Public License as |
||||||
|
* published by the Free Software Foundation; either version 2 of |
||||||
|
* the License, or (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU General Public License |
||||||
|
* along with this program; if not, write to the Free Software |
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
||||||
|
* MA 02111-1307 USA |
||||||
|
*/ |
||||||
|
|
||||||
|
#include <common.h> |
||||||
|
#include <command.h> |
||||||
|
#include <i2c.h> |
||||||
|
#include <netdev.h> |
||||||
|
#include <linux/compiler.h> |
||||||
|
#include <asm/mmu.h> |
||||||
|
#include <asm/processor.h> |
||||||
|
#include <asm/cache.h> |
||||||
|
#include <asm/immap_85xx.h> |
||||||
|
#include <asm/fsl_law.h> |
||||||
|
#include <asm/fsl_serdes.h> |
||||||
|
#include <asm/fsl_portals.h> |
||||||
|
#include <asm/fsl_liodn.h> |
||||||
|
|
||||||
|
DECLARE_GLOBAL_DATA_PTR; |
||||||
|
|
||||||
|
int checkboard(void) |
||||||
|
{ |
||||||
|
struct cpu_type *cpu = gd->arch.cpu; |
||||||
|
|
||||||
|
printf("Board: %sEMU\n", cpu->name); |
||||||
|
|
||||||
|
return 0; |
||||||
|
} |
||||||
|
|
||||||
|
int board_early_init_r(void) |
||||||
|
{ |
||||||
|
const unsigned int flashbase = CONFIG_SYS_FLASH_BASE; |
||||||
|
const u8 flash_esel = find_tlb_idx((void *)flashbase, 1); |
||||||
|
|
||||||
|
/*
|
||||||
|
* Remap Boot flash + PROMJET region to caching-inhibited |
||||||
|
* so that flash can be erased properly. |
||||||
|
*/ |
||||||
|
|
||||||
|
/* Flush d-cache and invalidate i-cache of any FLASH data */ |
||||||
|
flush_dcache(); |
||||||
|
invalidate_icache(); |
||||||
|
|
||||||
|
/* invalidate existing TLB entry for flash */ |
||||||
|
disable_tlb(flash_esel); |
||||||
|
|
||||||
|
set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS, |
||||||
|
MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, |
||||||
|
0, flash_esel, BOOKE_PAGESZ_256M, 1); |
||||||
|
|
||||||
|
set_liodns(); |
||||||
|
#ifdef CONFIG_SYS_DPAA_QBMAN |
||||||
|
setup_portals(); |
||||||
|
#endif |
||||||
|
|
||||||
|
return 0; |
||||||
|
} |
||||||
|
|
||||||
|
int misc_init_r(void) |
||||||
|
{ |
||||||
|
return 0; |
||||||
|
} |
||||||
|
|
||||||
|
void ft_board_setup(void *blob, bd_t *bd) |
||||||
|
{ |
||||||
|
phys_addr_t base; |
||||||
|
phys_size_t size; |
||||||
|
|
||||||
|
ft_cpu_setup(blob, bd); |
||||||
|
|
||||||
|
base = getenv_bootm_low(); |
||||||
|
size = getenv_bootm_size(); |
||||||
|
|
||||||
|
fdt_fixup_memory(blob, (u64)base, (u64)size); |
||||||
|
|
||||||
|
fdt_fixup_liodn(blob); |
||||||
|
fdt_fixup_dr_usb(blob, bd); |
||||||
|
} |
@ -0,0 +1,185 @@ |
|||||||
|
/*
|
||||||
|
* Copyright 2013 Freescale Semiconductor, Inc. |
||||||
|
* |
||||||
|
* See file CREDITS for list of people who contributed to this |
||||||
|
* project. |
||||||
|
* |
||||||
|
* This program is free software; you can redistribute it and/or |
||||||
|
* modify it under the terms of the GNU General Public License as |
||||||
|
* published by the Free Software Foundation; either version 2 of |
||||||
|
* the License, or (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU General Public License |
||||||
|
* along with this program; if not, write to the Free Software |
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
||||||
|
* MA 02111-1307 USA |
||||||
|
*/ |
||||||
|
|
||||||
|
/*
|
||||||
|
* T4240 EMU board configuration file |
||||||
|
*/ |
||||||
|
#ifndef __CONFIG_H |
||||||
|
#define __CONFIG_H |
||||||
|
|
||||||
|
#define CONFIG_T4240EMU |
||||||
|
#define CONFIG_PHYS_64BIT |
||||||
|
|
||||||
|
#define CONFIG_SYS_NO_FLASH 1 |
||||||
|
#define CONFIG_SYS_FSL_DDR_EMU 1 |
||||||
|
#define CONFIG_SYS_FSL_NO_QIXIS 1 |
||||||
|
#define CONFIG_SYS_FSL_NO_SERDES 1 |
||||||
|
|
||||||
|
#include "t4qds.h" |
||||||
|
|
||||||
|
#define CONFIG_CMD_CACHE |
||||||
|
#define CONFIG_CMD_CACHE_FLUSH |
||||||
|
|
||||||
|
#define CONFIG_ENV_IS_NOWHERE |
||||||
|
#define CONFIG_ENV_SIZE 0x2000 |
||||||
|
|
||||||
|
#define CONFIG_SYS_CLK_FREQ 100000000 |
||||||
|
#define CONFIG_DDR_CLK_FREQ 133333333 |
||||||
|
#define CONFIG_FSL_TBCLK_EXTRA_DIV 100 |
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* DDR Setup |
||||||
|
*/ |
||||||
|
#define CONFIG_SYS_SPD_BUS_NUM 1 |
||||||
|
#define SPD_EEPROM_ADDRESS1 0x51 |
||||||
|
#define SPD_EEPROM_ADDRESS2 0x52 |
||||||
|
#define SPD_EEPROM_ADDRESS3 0x53 |
||||||
|
#define SPD_EEPROM_ADDRESS4 0x54 |
||||||
|
#define SPD_EEPROM_ADDRESS5 0x55 |
||||||
|
#define SPD_EEPROM_ADDRESS6 0x56 |
||||||
|
#define SPD_EEPROM_ADDRESS SPD_EEPROM_ADDRESS1 /* for p3041/p5010 */ |
||||||
|
#define CONFIG_SYS_SDRAM_SIZE 4096 /* for fixed parameter use */ |
||||||
|
|
||||||
|
/*
|
||||||
|
* IFC Definitions |
||||||
|
*/ |
||||||
|
#define CONFIG_SYS_NOR0_CSPR_EXT (0xf) |
||||||
|
#define CONFIG_SYS_NOR_AMASK IFC_AMASK(128*1024*1024) |
||||||
|
/* NOR Flash Timing Params */ |
||||||
|
#define CONFIG_SYS_NOR0_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS \ |
||||||
|
+ 0x8000000) | \
|
||||||
|
CSPR_PORT_SIZE_32 | \
|
||||||
|
CSPR_MSEL_NOR | \
|
||||||
|
CSPR_V) |
||||||
|
#define CONFIG_SYS_NOR_CSOR CSOR_NOR_ADM_SHIFT(0) |
||||||
|
#define CONFIG_SYS_NOR_FTIM0 (FTIM0_NOR_TACSE(0x1) | \ |
||||||
|
FTIM0_NOR_TEADC(0x1) | \
|
||||||
|
FTIM0_NOR_TEAHC(0x1)) |
||||||
|
#define CONFIG_SYS_NOR_FTIM1 (FTIM1_NOR_TACO(0x1) | \ |
||||||
|
FTIM1_NOR_TRAD_NOR(0x1)) |
||||||
|
#define CONFIG_SYS_NOR_FTIM2 (FTIM2_NOR_TCS(0x0) | \ |
||||||
|
FTIM2_NOR_TCH(0x0) | \
|
||||||
|
FTIM2_NOR_TWP(0x1)) |
||||||
|
#define CONFIG_SYS_NOR_FTIM3 0x04000000 |
||||||
|
#define CONFIG_SYS_IFC_CCR 0x01000000 |
||||||
|
|
||||||
|
#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NOR0_CSPR_EXT |
||||||
|
#define CONFIG_SYS_CSPR0 CONFIG_SYS_NOR0_CSPR |
||||||
|
#define CONFIG_SYS_AMASK0 CONFIG_SYS_NOR_AMASK |
||||||
|
#define CONFIG_SYS_CSOR0 CONFIG_SYS_NOR_CSOR |
||||||
|
#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NOR_FTIM0 |
||||||
|
#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NOR_FTIM1 |
||||||
|
#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NOR_FTIM2 |
||||||
|
#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NOR_FTIM3 |
||||||
|
|
||||||
|
|
||||||
|
/* I2C */ |
||||||
|
#define CONFIG_SYS_FSL_I2C_SPEED 4000000 /* faster speed for emulator */ |
||||||
|
#define CONFIG_SYS_FSL_I2C2_SPEED 4000000 |
||||||
|
|
||||||
|
/* Qman/Bman */ |
||||||
|
#define CONFIG_SYS_DPAA_QBMAN /* Support Q/Bman */ |
||||||
|
#define CONFIG_SYS_BMAN_NUM_PORTALS 50 |
||||||
|
#define CONFIG_SYS_BMAN_MEM_BASE 0xf4000000 |
||||||
|
#define CONFIG_SYS_BMAN_MEM_PHYS 0xff4000000ull |
||||||
|
#define CONFIG_SYS_BMAN_MEM_SIZE 0x02000000 |
||||||
|
#define CONFIG_SYS_QMAN_NUM_PORTALS 50 |
||||||
|
#define CONFIG_SYS_QMAN_MEM_BASE 0xf6000000 |
||||||
|
#define CONFIG_SYS_QMAN_MEM_PHYS 0xff6000000ull |
||||||
|
#define CONFIG_SYS_QMAN_MEM_SIZE 0x02000000 |
||||||
|
|
||||||
|
#define CONFIG_SYS_DPAA_FMAN |
||||||
|
#define CONFIG_SYS_DPAA_PME |
||||||
|
#define CONFIG_SYS_PMAN |
||||||
|
#define CONFIG_SYS_DPAA_DCE |
||||||
|
#define CONFIG_SYS_INTERLAKEN |
||||||
|
|
||||||
|
#define CONFIG_SYS_QE_FMAN_FW_IN_NOR |
||||||
|
#define CONFIG_SYS_QE_FMAN_FW_ADDR 0xEFF40000 |
||||||
|
#define CONFIG_SYS_QE_FMAN_FW_LENGTH 0x10000 |
||||||
|
#define CONFIG_SYS_FDT_PAD (0x3000 + CONFIG_SYS_QE_FMAN_FW_LENGTH) |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define CONFIG_BOOTDELAY 0 |
||||||
|
|
||||||
|
/*
|
||||||
|
* T4240 has 3 DDR controllers. Default to 3-way interleaving. It can be |
||||||
|
* 3way_1KB, 3way_4KB, 3way_8KB. T4160 has 2 DDR controllers. Default to 2-way |
||||||
|
* interleaving. It can be cacheline, page, bank, superbank. |
||||||
|
* See doc/README.fsl-ddr for details. |
||||||
|
*/ |
||||||
|
#ifdef CONFIG_PPC_T4240 |
||||||
|
#define CTRL_INTLV_PREFERED 3way_4KB |
||||||
|
#else |
||||||
|
#define CTRL_INTLV_PREFERED cacheline |
||||||
|
#endif |
||||||
|
|
||||||
|
#define CONFIG_EXTRA_ENV_SETTINGS \ |
||||||
|
"hwconfig=fsl_ddr:" \
|
||||||
|
"ctlr_intlv=" __stringify(CTRL_INTLV_PREFERED) "," \
|
||||||
|
"bank_intlv=auto;" \
|
||||||
|
"netdev=eth0\0" \
|
||||||
|
"uboot=" __stringify(CONFIG_UBOOTPATH) "\0" \
|
||||||
|
"ubootaddr=" __stringify(CONFIG_SYS_TEXT_BASE) "\0" \
|
||||||
|
"consoledev=ttyS0\0" \
|
||||||
|
"ramdiskaddr=2000000\0" \
|
||||||
|
"ramdiskfile=t4240emu/ramdisk.uboot\0" \
|
||||||
|
"fdtaddr=c00000\0" \
|
||||||
|
"fdtfile=t4240emu/t4240emu.dtb\0" \
|
||||||
|
"bdev=sda3\0" \
|
||||||
|
"c=ffe\0" |
||||||
|
|
||||||
|
/*
|
||||||
|
* For emulation this causes u-boot to jump to the start of the proof point |
||||||
|
* app code automatically |
||||||
|
*/ |
||||||
|
#define CONFIG_PROOF_POINTS \ |
||||||
|
"setenv bootargs root=/dev/$bdev rw " \
|
||||||
|
"console=$consoledev,$baudrate $othbootargs;" \
|
||||||
|
"cpu 1 release 0x29000000 - - -;" \
|
||||||
|
"cpu 2 release 0x29000000 - - -;" \
|
||||||
|
"cpu 3 release 0x29000000 - - -;" \
|
||||||
|
"cpu 4 release 0x29000000 - - -;" \
|
||||||
|
"cpu 5 release 0x29000000 - - -;" \
|
||||||
|
"cpu 6 release 0x29000000 - - -;" \
|
||||||
|
"cpu 7 release 0x29000000 - - -;" \
|
||||||
|
"go 0x29000000" |
||||||
|
|
||||||
|
#define CONFIG_HVBOOT \ |
||||||
|
"setenv bootargs config-addr=0x60000000; " \
|
||||||
|
"bootm 0x01000000 - 0x00f00000" |
||||||
|
|
||||||
|
#define CONFIG_LINUX \ |
||||||
|
"errata;" \
|
||||||
|
"setenv othbootargs ignore_loglevel;" \
|
||||||
|
"setenv bootargs root=/dev/ram rw " \
|
||||||
|
"console=$consoledev,$baudrate $othbootargs;" \
|
||||||
|
"setenv ramdiskaddr 0x02000000;" \
|
||||||
|
"setenv fdtaddr 0x00c00000;" \
|
||||||
|
"setenv loadaddr 0x1000000;" \
|
||||||
|
"bootm $loadaddr $ramdiskaddr $fdtaddr" |
||||||
|
|
||||||
|
#define CONFIG_BOOTCOMMAND CONFIG_LINUX |
||||||
|
|
||||||
|
#endif /* __CONFIG_H */ |
Loading…
Reference in new issue