xref: /rk3399_rockchip-uboot/include/configs/p1_twr.h (revision 577968e5669858e1d5bcb651ab28d60d20166252)
149f5befaSXie Xiaobo /*
249f5befaSXie Xiaobo  * Copyright 2013 Freescale Semiconductor, Inc.
349f5befaSXie Xiaobo  *
43aab0cd8SYork Sun  * SPDX-License-Identifier:	GPL-2.0+
549f5befaSXie Xiaobo  */
649f5befaSXie Xiaobo 
749f5befaSXie Xiaobo /*
849f5befaSXie Xiaobo  * QorIQ P1 Tower boards configuration file
949f5befaSXie Xiaobo  */
1049f5befaSXie Xiaobo #ifndef __CONFIG_H
1149f5befaSXie Xiaobo #define __CONFIG_H
1249f5befaSXie Xiaobo 
1349f5befaSXie Xiaobo #if defined(CONFIG_TWR_P1025)
1449f5befaSXie Xiaobo #define CONFIG_BOARDNAME "TWR-P1025"
1549f5befaSXie Xiaobo #define CONFIG_PHY_ATHEROS
1649f5befaSXie Xiaobo #define CONFIG_QE
1749f5befaSXie Xiaobo #define CONFIG_SYS_LBC_LBCR	0x00080000	/* Conversion of LBC addr */
1849f5befaSXie Xiaobo #define CONFIG_SYS_LBC_LCRR	0x80000002	/* LB clock ratio reg */
1949f5befaSXie Xiaobo #endif
2049f5befaSXie Xiaobo 
2149f5befaSXie Xiaobo #ifdef CONFIG_SDCARD
2249f5befaSXie Xiaobo #define CONFIG_RAMBOOT_SDCARD
2349f5befaSXie Xiaobo #define CONFIG_SYS_RAMBOOT
2449f5befaSXie Xiaobo #define CONFIG_SYS_EXTRA_ENV_RELOC
2549f5befaSXie Xiaobo #define CONFIG_SYS_TEXT_BASE		0x11000000
26e222b1f3SPrabhakar Kushwaha #define CONFIG_RESET_VECTOR_ADDRESS	0x110bfffc
2749f5befaSXie Xiaobo #endif
2849f5befaSXie Xiaobo 
2949f5befaSXie Xiaobo #ifndef CONFIG_SYS_TEXT_BASE
30e222b1f3SPrabhakar Kushwaha #define CONFIG_SYS_TEXT_BASE		0xeff40000
3149f5befaSXie Xiaobo #endif
3249f5befaSXie Xiaobo 
3349f5befaSXie Xiaobo #ifndef CONFIG_RESET_VECTOR_ADDRESS
3449f5befaSXie Xiaobo #define CONFIG_RESET_VECTOR_ADDRESS	0xeffffffc
3549f5befaSXie Xiaobo #endif
3649f5befaSXie Xiaobo 
3749f5befaSXie Xiaobo #ifndef CONFIG_SYS_MONITOR_BASE
3849f5befaSXie Xiaobo #define CONFIG_SYS_MONITOR_BASE	CONFIG_SYS_TEXT_BASE	/* start of monitor */
3949f5befaSXie Xiaobo #endif
4049f5befaSXie Xiaobo 
4149f5befaSXie Xiaobo #define CONFIG_MP
4249f5befaSXie Xiaobo 
43b38eaec5SRobert P. J. Day #define CONFIG_PCIE1	/* PCIE controller 1 (slot 1) */
44b38eaec5SRobert P. J. Day #define CONFIG_PCIE2	/* PCIE controller 2 (slot 2) */
4549f5befaSXie Xiaobo #define CONFIG_FSL_PCI_INIT	/* Use common FSL init code */
4649f5befaSXie Xiaobo #define CONFIG_PCI_INDIRECT_BRIDGE	/* indirect PCI bridge support */
4749f5befaSXie Xiaobo #define CONFIG_FSL_PCIE_RESET	/* need PCIe reset errata */
4849f5befaSXie Xiaobo #define CONFIG_SYS_PCI_64BIT	/* enable 64-bit PCI resources */
4949f5befaSXie Xiaobo 
5049f5befaSXie Xiaobo #define CONFIG_TSEC_ENET	/* tsec ethernet support */
5149f5befaSXie Xiaobo #define CONFIG_ENV_OVERWRITE
5249f5befaSXie Xiaobo 
5349f5befaSXie Xiaobo #define CONFIG_SATA_SIL3114
5449f5befaSXie Xiaobo #define CONFIG_SYS_SATA_MAX_DEVICE	2
5549f5befaSXie Xiaobo #define CONFIG_LIBATA
5649f5befaSXie Xiaobo #define CONFIG_LBA48
5749f5befaSXie Xiaobo 
5849f5befaSXie Xiaobo #ifndef __ASSEMBLY__
5949f5befaSXie Xiaobo extern unsigned long get_board_sys_clk(unsigned long dummy);
6049f5befaSXie Xiaobo #endif
6149f5befaSXie Xiaobo #define CONFIG_SYS_CLK_FREQ	get_board_sys_clk(0) /*sysclk for TWR-P1025 */
6249f5befaSXie Xiaobo 
6349f5befaSXie Xiaobo #define CONFIG_DDR_CLK_FREQ	66666666
6449f5befaSXie Xiaobo 
6549f5befaSXie Xiaobo #define CONFIG_HWCONFIG
6649f5befaSXie Xiaobo /*
6749f5befaSXie Xiaobo  * These can be toggled for performance analysis, otherwise use default.
6849f5befaSXie Xiaobo  */
6949f5befaSXie Xiaobo #define CONFIG_L2_CACHE
7049f5befaSXie Xiaobo #define CONFIG_BTB
7149f5befaSXie Xiaobo 
7249f5befaSXie Xiaobo #define CONFIG_SYS_MEMTEST_START	0x00200000	/* memtest works on */
7349f5befaSXie Xiaobo #define CONFIG_SYS_MEMTEST_END		0x1fffffff
7449f5befaSXie Xiaobo 
7549f5befaSXie Xiaobo #define CONFIG_SYS_CCSRBAR		0xffe00000
7649f5befaSXie Xiaobo #define CONFIG_SYS_CCSRBAR_PHYS_LOW	CONFIG_SYS_CCSRBAR
7749f5befaSXie Xiaobo 
7849f5befaSXie Xiaobo /* DDR Setup */
7949f5befaSXie Xiaobo 
8049f5befaSXie Xiaobo #define CONFIG_SYS_SDRAM_SIZE_LAW	LAW_SIZE_512M
8149f5befaSXie Xiaobo #define CONFIG_CHIP_SELECTS_PER_CTRL	1
8249f5befaSXie Xiaobo 
8349f5befaSXie Xiaobo #define CONFIG_SYS_SDRAM_SIZE		(1u << (CONFIG_SYS_SDRAM_SIZE_LAW - 19))
8449f5befaSXie Xiaobo #define CONFIG_SYS_DDR_SDRAM_BASE	0x00000000
8549f5befaSXie Xiaobo #define CONFIG_SYS_SDRAM_BASE		CONFIG_SYS_DDR_SDRAM_BASE
8649f5befaSXie Xiaobo 
8749f5befaSXie Xiaobo #define CONFIG_DIMM_SLOTS_PER_CTLR	1
8849f5befaSXie Xiaobo 
8949f5befaSXie Xiaobo /* Default settings for DDR3 */
9049f5befaSXie Xiaobo #define CONFIG_SYS_DDR_CS0_BNDS		0x0000001f
9149f5befaSXie Xiaobo #define CONFIG_SYS_DDR_CS0_CONFIG	0x80014202
9249f5befaSXie Xiaobo #define CONFIG_SYS_DDR_CS0_CONFIG_2	0x00000000
9349f5befaSXie Xiaobo #define CONFIG_SYS_DDR_CS1_BNDS		0x00000000
9449f5befaSXie Xiaobo #define CONFIG_SYS_DDR_CS1_CONFIG	0x00000000
9549f5befaSXie Xiaobo #define CONFIG_SYS_DDR_CS1_CONFIG_2	0x00000000
9649f5befaSXie Xiaobo 
9749f5befaSXie Xiaobo #define CONFIG_SYS_DDR_DATA_INIT	0xdeadbeef
9849f5befaSXie Xiaobo #define CONFIG_SYS_DDR_INIT_ADDR	0x00000000
9949f5befaSXie Xiaobo #define CONFIG_SYS_DDR_INIT_EXT_ADDR	0x00000000
10049f5befaSXie Xiaobo #define CONFIG_SYS_DDR_MODE_CONTROL	0x00000000
10149f5befaSXie Xiaobo 
10249f5befaSXie Xiaobo #define CONFIG_SYS_DDR_ZQ_CONTROL	0x89080600
10349f5befaSXie Xiaobo #define CONFIG_SYS_DDR_WRLVL_CONTROL	0x8655a608
10449f5befaSXie Xiaobo #define CONFIG_SYS_DDR_SR_CNTR		0x00000000
10549f5befaSXie Xiaobo #define CONFIG_SYS_DDR_RCW_1		0x00000000
10649f5befaSXie Xiaobo #define CONFIG_SYS_DDR_RCW_2		0x00000000
10749f5befaSXie Xiaobo #define CONFIG_SYS_DDR_CONTROL		0xc70c0000	/* Type = DDR3	*/
10849f5befaSXie Xiaobo #define CONFIG_SYS_DDR_CONTROL_2	0x04401050
10949f5befaSXie Xiaobo #define CONFIG_SYS_DDR_TIMING_4		0x00220001
11049f5befaSXie Xiaobo #define CONFIG_SYS_DDR_TIMING_5		0x03402400
11149f5befaSXie Xiaobo 
11249f5befaSXie Xiaobo #define CONFIG_SYS_DDR_TIMING_3		0x00020000
11349f5befaSXie Xiaobo #define CONFIG_SYS_DDR_TIMING_0		0x00220004
11449f5befaSXie Xiaobo #define CONFIG_SYS_DDR_TIMING_1		0x5c5b6544
11549f5befaSXie Xiaobo #define CONFIG_SYS_DDR_TIMING_2		0x0fa880de
11649f5befaSXie Xiaobo #define CONFIG_SYS_DDR_CLK_CTRL		0x03000000
11749f5befaSXie Xiaobo #define CONFIG_SYS_DDR_MODE_1		0x80461320
11849f5befaSXie Xiaobo #define CONFIG_SYS_DDR_MODE_2		0x00008000
11949f5befaSXie Xiaobo #define CONFIG_SYS_DDR_INTERVAL		0x09480000
12049f5befaSXie Xiaobo 
12149f5befaSXie Xiaobo /*
12249f5befaSXie Xiaobo  * Memory map
12349f5befaSXie Xiaobo  *
12449f5befaSXie Xiaobo  * 0x0000_0000 0x1fff_ffff	DDR		Up to 512MB cacheable
12549f5befaSXie Xiaobo  * 0x8000_0000 0xdfff_ffff	PCI Express Mem	1.5G non-cacheable(PCIe * 3)
12649f5befaSXie Xiaobo  * 0xffc0_0000 0xffc3_ffff	PCI IO range	256k non-cacheable
12749f5befaSXie Xiaobo  *
12849f5befaSXie Xiaobo  * Localbus
12949f5befaSXie Xiaobo  * 0xe000_0000 0xe002_0000	SSD1289		128K non-cacheable
13049f5befaSXie Xiaobo  * 0xec00_0000 0xefff_ffff	FLASH		Up to 64M non-cacheable
13149f5befaSXie Xiaobo  *
13249f5befaSXie Xiaobo  * 0xff90_0000 0xff97_ffff	L2 SRAM		Up to 512K cacheable
13349f5befaSXie Xiaobo  * 0xffd0_0000 0xffd0_3fff	init ram	16K Cacheable
13449f5befaSXie Xiaobo  * 0xffe0_0000 0xffef_ffff	CCSR		1M non-cacheable
13549f5befaSXie Xiaobo  */
13649f5befaSXie Xiaobo 
13749f5befaSXie Xiaobo /*
13849f5befaSXie Xiaobo  * Local Bus Definitions
13949f5befaSXie Xiaobo  */
14049f5befaSXie Xiaobo #define CONFIG_SYS_MAX_FLASH_SECT	512	/* 64M */
14149f5befaSXie Xiaobo #define CONFIG_SYS_FLASH_BASE		0xec000000
14249f5befaSXie Xiaobo 
14349f5befaSXie Xiaobo #define CONFIG_SYS_FLASH_BASE_PHYS	CONFIG_SYS_FLASH_BASE
14449f5befaSXie Xiaobo 
14549f5befaSXie Xiaobo #define CONFIG_FLASH_BR_PRELIM (BR_PHYS_ADDR((CONFIG_SYS_FLASH_BASE_PHYS)) \
14649f5befaSXie Xiaobo 	| BR_PS_16 | BR_V)
14749f5befaSXie Xiaobo 
14849f5befaSXie Xiaobo #define CONFIG_FLASH_OR_PRELIM	0xfc0000b1
14949f5befaSXie Xiaobo 
15049f5befaSXie Xiaobo #define CONFIG_SYS_SSD_BASE	0xe0000000
15149f5befaSXie Xiaobo #define CONFIG_SYS_SSD_BASE_PHYS	CONFIG_SYS_SSD_BASE
15249f5befaSXie Xiaobo #define CONFIG_SSD_BR_PRELIM	(BR_PHYS_ADDR(CONFIG_SYS_SSD_BASE_PHYS) | \
15349f5befaSXie Xiaobo 					BR_PS_16 | BR_V)
15449f5befaSXie Xiaobo #define CONFIG_SSD_OR_PRELIM	(OR_AM_64KB | OR_GPCM_CSNT | OR_GPCM_XACS | \
15549f5befaSXie Xiaobo 				 OR_GPCM_ACS_DIV2 | OR_GPCM_SCY | \
15649f5befaSXie Xiaobo 				 OR_GPCM_TRLX | OR_GPCM_EHTR | OR_GPCM_EAD)
15749f5befaSXie Xiaobo 
15849f5befaSXie Xiaobo #define CONFIG_SYS_BR2_PRELIM CONFIG_SSD_BR_PRELIM
15949f5befaSXie Xiaobo #define CONFIG_SYS_OR2_PRELIM CONFIG_SSD_OR_PRELIM
16049f5befaSXie Xiaobo 
16149f5befaSXie Xiaobo #define CONFIG_SYS_FLASH_BANKS_LIST	{CONFIG_SYS_FLASH_BASE_PHYS}
16249f5befaSXie Xiaobo #define CONFIG_SYS_FLASH_QUIET_TEST
16349f5befaSXie Xiaobo #define CONFIG_FLASH_SHOW_PROGRESS	45	/* count down from 45/5: 9..1 */
16449f5befaSXie Xiaobo 
16549f5befaSXie Xiaobo #define CONFIG_SYS_MAX_FLASH_BANKS	1	/* number of banks */
16649f5befaSXie Xiaobo 
16749f5befaSXie Xiaobo #undef CONFIG_SYS_FLASH_CHECKSUM
16849f5befaSXie Xiaobo #define CONFIG_SYS_FLASH_ERASE_TOUT	60000	/* Flash Erase Timeout (ms) */
16949f5befaSXie Xiaobo #define CONFIG_SYS_FLASH_WRITE_TOUT	500	/* Flash Write Timeout (ms) */
17049f5befaSXie Xiaobo 
17149f5befaSXie Xiaobo #define CONFIG_FLASH_CFI_DRIVER
17249f5befaSXie Xiaobo #define CONFIG_SYS_FLASH_CFI
17349f5befaSXie Xiaobo #define CONFIG_SYS_FLASH_EMPTY_INFO
17449f5befaSXie Xiaobo #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
17549f5befaSXie Xiaobo 
17649f5befaSXie Xiaobo #define CONFIG_BOARD_EARLY_INIT_R	/* call board_early_init_r function */
17749f5befaSXie Xiaobo 
17849f5befaSXie Xiaobo #define CONFIG_SYS_INIT_RAM_LOCK
17949f5befaSXie Xiaobo #define CONFIG_SYS_INIT_RAM_ADDR	0xffd00000
18049f5befaSXie Xiaobo /* Initial L1 address */
18149f5befaSXie Xiaobo #define CONFIG_SYS_INIT_RAM_ADDR_PHYS	CONFIG_SYS_INIT_RAM_ADDR
18249f5befaSXie Xiaobo #define CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH 0
18349f5befaSXie Xiaobo #define CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW CONFIG_SYS_INIT_RAM_ADDR_PHYS
18449f5befaSXie Xiaobo /* Size of used area in RAM */
18549f5befaSXie Xiaobo #define CONFIG_SYS_INIT_RAM_SIZE	0x00004000
18649f5befaSXie Xiaobo 
18749f5befaSXie Xiaobo #define CONFIG_SYS_GBL_DATA_OFFSET	(CONFIG_SYS_INIT_RAM_SIZE - \
18849f5befaSXie Xiaobo 					GENERATED_GBL_DATA_SIZE)
18949f5befaSXie Xiaobo #define CONFIG_SYS_INIT_SP_OFFSET	CONFIG_SYS_GBL_DATA_OFFSET
19049f5befaSXie Xiaobo 
1919307cbabSPrabhakar Kushwaha #define CONFIG_SYS_MONITOR_LEN	(768 * 1024)
19249f5befaSXie Xiaobo #define CONFIG_SYS_MALLOC_LEN	(1024 * 1024)/* Reserved for malloc */
19349f5befaSXie Xiaobo 
19449f5befaSXie Xiaobo #define CONFIG_SYS_BR0_PRELIM	CONFIG_FLASH_BR_PRELIM	/* NOR Base Address */
19549f5befaSXie Xiaobo #define CONFIG_SYS_OR0_PRELIM	CONFIG_FLASH_OR_PRELIM	/* NOR Options */
19649f5befaSXie Xiaobo 
19749f5befaSXie Xiaobo /* Serial Port
19849f5befaSXie Xiaobo  * open - index 2
19949f5befaSXie Xiaobo  * shorted - index 1
20049f5befaSXie Xiaobo  */
20149f5befaSXie Xiaobo #define CONFIG_CONS_INDEX		1
20249f5befaSXie Xiaobo #undef CONFIG_SERIAL_SOFTWARE_FIFO
20349f5befaSXie Xiaobo #define CONFIG_SYS_NS16550_SERIAL
20449f5befaSXie Xiaobo #define CONFIG_SYS_NS16550_REG_SIZE	1
20549f5befaSXie Xiaobo #define CONFIG_SYS_NS16550_CLK		get_bus_freq(0)
20649f5befaSXie Xiaobo 
20749f5befaSXie Xiaobo #define CONFIG_SYS_BAUDRATE_TABLE	\
20849f5befaSXie Xiaobo 	{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
20949f5befaSXie Xiaobo 
21049f5befaSXie Xiaobo #define CONFIG_SYS_NS16550_COM1	(CONFIG_SYS_CCSRBAR+0x4500)
21149f5befaSXie Xiaobo #define CONFIG_SYS_NS16550_COM2	(CONFIG_SYS_CCSRBAR+0x4600)
21249f5befaSXie Xiaobo 
21349f5befaSXie Xiaobo /* I2C */
21449f5befaSXie Xiaobo #define CONFIG_SYS_I2C
21549f5befaSXie Xiaobo #define CONFIG_SYS_I2C_FSL			/* Use FSL common I2C driver */
21649f5befaSXie Xiaobo #define CONFIG_SYS_FSL_I2C_SPEED	400000	/* I2C spd and slave address */
21749f5befaSXie Xiaobo #define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
21849f5befaSXie Xiaobo #define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
21949f5befaSXie Xiaobo #define CONFIG_SYS_I2C_EEPROM_ADDR	0x52
22049f5befaSXie Xiaobo 
22149f5befaSXie Xiaobo /*
22249f5befaSXie Xiaobo  * I2C2 EEPROM
22349f5befaSXie Xiaobo  */
22449f5befaSXie Xiaobo #define CONFIG_SYS_FSL_I2C2_SPEED	400000	/* I2C spd and slave address */
22549f5befaSXie Xiaobo #define CONFIG_SYS_FSL_I2C2_SLAVE	0x7F
22649f5befaSXie Xiaobo #define CONFIG_SYS_FSL_I2C2_OFFSET	0x3100
22749f5befaSXie Xiaobo 
22849f5befaSXie Xiaobo #define CONFIG_SYS_I2C_PCA9555_ADDR	0x23
22949f5befaSXie Xiaobo 
23049f5befaSXie Xiaobo /* enable read and write access to EEPROM */
23149f5befaSXie Xiaobo #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
23249f5befaSXie Xiaobo #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
23349f5befaSXie Xiaobo #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5
23449f5befaSXie Xiaobo 
23549f5befaSXie Xiaobo /*
23649f5befaSXie Xiaobo  * eSPI - Enhanced SPI
23749f5befaSXie Xiaobo  */
23849f5befaSXie Xiaobo #define CONFIG_HARD_SPI
23949f5befaSXie Xiaobo 
24049f5befaSXie Xiaobo #if defined(CONFIG_PCI)
24149f5befaSXie Xiaobo /*
24249f5befaSXie Xiaobo  * General PCI
24349f5befaSXie Xiaobo  * Memory space is mapped 1-1, but I/O space must start from 0.
24449f5befaSXie Xiaobo  */
24549f5befaSXie Xiaobo 
24649f5befaSXie Xiaobo /* controller 2, direct to uli, tgtid 2, Base address 9000 */
24749f5befaSXie Xiaobo #define CONFIG_SYS_PCIE2_NAME		"TWR-ELEV PCIe SLOT"
24849f5befaSXie Xiaobo #define CONFIG_SYS_PCIE2_MEM_VIRT	0xa0000000
24949f5befaSXie Xiaobo #define CONFIG_SYS_PCIE2_MEM_BUS	0xa0000000
25049f5befaSXie Xiaobo #define CONFIG_SYS_PCIE2_MEM_PHYS	0xa0000000
25149f5befaSXie Xiaobo #define CONFIG_SYS_PCIE2_MEM_SIZE	0x20000000	/* 512M */
25249f5befaSXie Xiaobo #define CONFIG_SYS_PCIE2_IO_VIRT	0xffc10000
25349f5befaSXie Xiaobo #define CONFIG_SYS_PCIE2_IO_BUS		0x00000000
25449f5befaSXie Xiaobo #define CONFIG_SYS_PCIE2_IO_PHYS	0xffc10000
25549f5befaSXie Xiaobo #define CONFIG_SYS_PCIE2_IO_SIZE	0x00010000	/* 64k */
25649f5befaSXie Xiaobo 
25749f5befaSXie Xiaobo /* controller 1, tgtid 1, Base address a000 */
25849f5befaSXie Xiaobo #define CONFIG_SYS_PCIE1_NAME		"mini PCIe SLOT"
25949f5befaSXie Xiaobo #define CONFIG_SYS_PCIE1_MEM_VIRT	0x80000000
26049f5befaSXie Xiaobo #define CONFIG_SYS_PCIE1_MEM_BUS	0x80000000
26149f5befaSXie Xiaobo #define CONFIG_SYS_PCIE1_MEM_PHYS	0x80000000
26249f5befaSXie Xiaobo #define CONFIG_SYS_PCIE1_MEM_SIZE	0x20000000	/* 512M */
26349f5befaSXie Xiaobo #define CONFIG_SYS_PCIE1_IO_VIRT	0xffc00000
26449f5befaSXie Xiaobo #define CONFIG_SYS_PCIE1_IO_BUS		0x00000000
26549f5befaSXie Xiaobo #define CONFIG_SYS_PCIE1_IO_PHYS	0xffc00000
26649f5befaSXie Xiaobo #define CONFIG_SYS_PCIE1_IO_SIZE	0x00010000	/* 64k */
26749f5befaSXie Xiaobo 
26849f5befaSXie Xiaobo #define CONFIG_PCI_SCAN_SHOW	/* show pci devices on startup */
26949f5befaSXie Xiaobo #endif /* CONFIG_PCI */
27049f5befaSXie Xiaobo 
27149f5befaSXie Xiaobo #if defined(CONFIG_TSEC_ENET)
27249f5befaSXie Xiaobo 
27349f5befaSXie Xiaobo #define CONFIG_MII		/* MII PHY management */
27449f5befaSXie Xiaobo #define CONFIG_TSEC1
27549f5befaSXie Xiaobo #define CONFIG_TSEC1_NAME	"eTSEC1"
27649f5befaSXie Xiaobo #undef CONFIG_TSEC2
27749f5befaSXie Xiaobo #undef CONFIG_TSEC2_NAME
27849f5befaSXie Xiaobo #define CONFIG_TSEC3
27949f5befaSXie Xiaobo #define CONFIG_TSEC3_NAME	"eTSEC3"
28049f5befaSXie Xiaobo 
28149f5befaSXie Xiaobo #define TSEC1_PHY_ADDR	2
28249f5befaSXie Xiaobo #define TSEC2_PHY_ADDR	0
28349f5befaSXie Xiaobo #define TSEC3_PHY_ADDR	1
28449f5befaSXie Xiaobo 
28549f5befaSXie Xiaobo #define TSEC1_FLAGS	(TSEC_GIGABIT | TSEC_REDUCED)
28649f5befaSXie Xiaobo #define TSEC2_FLAGS	(TSEC_GIGABIT | TSEC_REDUCED)
28749f5befaSXie Xiaobo #define TSEC3_FLAGS	(TSEC_GIGABIT | TSEC_REDUCED)
28849f5befaSXie Xiaobo 
28949f5befaSXie Xiaobo #define TSEC1_PHYIDX	0
29049f5befaSXie Xiaobo #define TSEC2_PHYIDX	0
29149f5befaSXie Xiaobo #define TSEC3_PHYIDX	0
29249f5befaSXie Xiaobo 
29349f5befaSXie Xiaobo #define CONFIG_ETHPRIME	"eTSEC1"
29449f5befaSXie Xiaobo 
29549f5befaSXie Xiaobo #define CONFIG_HAS_ETH0
29649f5befaSXie Xiaobo #define CONFIG_HAS_ETH1
29749f5befaSXie Xiaobo #undef CONFIG_HAS_ETH2
29849f5befaSXie Xiaobo #endif /* CONFIG_TSEC_ENET */
29949f5befaSXie Xiaobo 
30049f5befaSXie Xiaobo #ifdef CONFIG_QE
30149f5befaSXie Xiaobo /* QE microcode/firmware address */
30249f5befaSXie Xiaobo #define CONFIG_SYS_QE_FMAN_FW_IN_NOR
303dcf1d774SZhao Qiang #define CONFIG_SYS_QE_FW_ADDR	0xefec0000
30449f5befaSXie Xiaobo #define CONFIG_SYS_QE_FMAN_FW_LENGTH	0x10000
30549f5befaSXie Xiaobo #endif /* CONFIG_QE */
30649f5befaSXie Xiaobo 
30749f5befaSXie Xiaobo #ifdef CONFIG_TWR_P1025
30849f5befaSXie Xiaobo /*
30949f5befaSXie Xiaobo  * QE UEC ethernet configuration
31049f5befaSXie Xiaobo  */
31149f5befaSXie Xiaobo #define CONFIG_MIIM_ADDRESS	(CONFIG_SYS_CCSRBAR + 0x82120)
31249f5befaSXie Xiaobo 
31349f5befaSXie Xiaobo #undef CONFIG_UEC_ETH
31449f5befaSXie Xiaobo #define CONFIG_PHY_MODE_NEED_CHANGE
31549f5befaSXie Xiaobo 
31649f5befaSXie Xiaobo #define CONFIG_UEC_ETH1	/* ETH1 */
31749f5befaSXie Xiaobo #define CONFIG_HAS_ETH0
31849f5befaSXie Xiaobo 
31949f5befaSXie Xiaobo #ifdef CONFIG_UEC_ETH1
32049f5befaSXie Xiaobo #define CONFIG_SYS_UEC1_UCC_NUM	0	/* UCC1 */
32149f5befaSXie Xiaobo #define CONFIG_SYS_UEC1_RX_CLK	QE_CLK12 /* CLK12 for MII */
32249f5befaSXie Xiaobo #define CONFIG_SYS_UEC1_TX_CLK	QE_CLK9 /* CLK9 for MII */
32349f5befaSXie Xiaobo #define CONFIG_SYS_UEC1_ETH_TYPE	FAST_ETH
32449f5befaSXie Xiaobo #define CONFIG_SYS_UEC1_PHY_ADDR	0x18	/* 0x18 for MII */
32549f5befaSXie Xiaobo #define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_MII
32649f5befaSXie Xiaobo #define CONFIG_SYS_UEC1_INTERFACE_SPEED	100
32749f5befaSXie Xiaobo #endif /* CONFIG_UEC_ETH1 */
32849f5befaSXie Xiaobo 
32949f5befaSXie Xiaobo #define CONFIG_UEC_ETH5	/* ETH5 */
33049f5befaSXie Xiaobo #define CONFIG_HAS_ETH1
33149f5befaSXie Xiaobo 
33249f5befaSXie Xiaobo #ifdef CONFIG_UEC_ETH5
33349f5befaSXie Xiaobo #define CONFIG_SYS_UEC5_UCC_NUM	4	/* UCC5 */
33449f5befaSXie Xiaobo #define CONFIG_SYS_UEC5_RX_CLK	QE_CLK_NONE
33549f5befaSXie Xiaobo #define CONFIG_SYS_UEC5_TX_CLK	QE_CLK13 /* CLK 13 for RMII */
33649f5befaSXie Xiaobo #define CONFIG_SYS_UEC5_ETH_TYPE	FAST_ETH
33749f5befaSXie Xiaobo #define CONFIG_SYS_UEC5_PHY_ADDR	0x19	/* 0x19 for RMII */
33849f5befaSXie Xiaobo #define CONFIG_SYS_UEC5_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
33949f5befaSXie Xiaobo #define CONFIG_SYS_UEC5_INTERFACE_SPEED	100
34049f5befaSXie Xiaobo #endif /* CONFIG_UEC_ETH5 */
34149f5befaSXie Xiaobo #endif /* CONFIG_TWR-P1025 */
34249f5befaSXie Xiaobo 
34349f5befaSXie Xiaobo /*
34494b383e7SYangbo Lu  * Dynamic MTD Partition support with mtdparts
34594b383e7SYangbo Lu  */
34694b383e7SYangbo Lu #define CONFIG_FLASH_CFI_MTD
34794b383e7SYangbo Lu #define MTDIDS_DEFAULT "nor0=ec000000.nor"
34894b383e7SYangbo Lu #define MTDPARTS_DEFAULT "mtdparts=ec000000.nor:256k(vsc7385-firmware)," \
34994b383e7SYangbo Lu 			"256k(dtb),5632k(kernel),57856k(fs)," \
35094b383e7SYangbo Lu 			"256k(qe-ucode-firmware),1280k(u-boot)"
35194b383e7SYangbo Lu 
35294b383e7SYangbo Lu /*
35349f5befaSXie Xiaobo  * Environment
35449f5befaSXie Xiaobo  */
35549f5befaSXie Xiaobo #ifdef CONFIG_SYS_RAMBOOT
35649f5befaSXie Xiaobo #ifdef CONFIG_RAMBOOT_SDCARD
35749f5befaSXie Xiaobo #define CONFIG_ENV_SIZE		0x2000
35849f5befaSXie Xiaobo #define CONFIG_SYS_MMC_ENV_DEV	0
35949f5befaSXie Xiaobo #else
36049f5befaSXie Xiaobo #define CONFIG_ENV_ADDR		(CONFIG_SYS_MONITOR_BASE - 0x1000)
36149f5befaSXie Xiaobo #define CONFIG_ENV_SIZE		0x2000
36249f5befaSXie Xiaobo #endif
36349f5befaSXie Xiaobo #else
36449f5befaSXie Xiaobo #define CONFIG_ENV_ADDR	(CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SECT_SIZE)
36549f5befaSXie Xiaobo #define CONFIG_ENV_SIZE		0x2000
36649f5befaSXie Xiaobo #define CONFIG_ENV_SECT_SIZE	0x20000 /* 128K (one sector) */
36749f5befaSXie Xiaobo #endif
36849f5befaSXie Xiaobo 
36949f5befaSXie Xiaobo #define CONFIG_LOADS_ECHO		/* echo on for serial download */
37049f5befaSXie Xiaobo #define CONFIG_SYS_LOADS_BAUD_CHANGE	/* allow baudrate change */
37149f5befaSXie Xiaobo 
37249f5befaSXie Xiaobo /*
37349f5befaSXie Xiaobo  * USB
37449f5befaSXie Xiaobo  */
37549f5befaSXie Xiaobo #define CONFIG_HAS_FSL_DR_USB
37649f5befaSXie Xiaobo 
37749f5befaSXie Xiaobo #if defined(CONFIG_HAS_FSL_DR_USB)
378*8850c5d5STom Rini #ifdef CONFIG_USB_EHCI_HCD
37949f5befaSXie Xiaobo #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
38049f5befaSXie Xiaobo #define CONFIG_USB_EHCI_FSL
38149f5befaSXie Xiaobo #endif
38249f5befaSXie Xiaobo #endif
38349f5befaSXie Xiaobo 
38449f5befaSXie Xiaobo #ifdef CONFIG_MMC
38549f5befaSXie Xiaobo #define CONFIG_FSL_ESDHC
38649f5befaSXie Xiaobo #define CONFIG_SYS_FSL_ESDHC_ADDR	CONFIG_SYS_MPC85xx_ESDHC_ADDR
38749f5befaSXie Xiaobo #endif
38849f5befaSXie Xiaobo 
38949f5befaSXie Xiaobo #undef CONFIG_WATCHDOG	/* watchdog disabled */
39049f5befaSXie Xiaobo 
39149f5befaSXie Xiaobo /*
39249f5befaSXie Xiaobo  * Miscellaneous configurable options
39349f5befaSXie Xiaobo  */
39449f5befaSXie Xiaobo #define CONFIG_SYS_LONGHELP			/* undef to save memory */
39549f5befaSXie Xiaobo #define CONFIG_CMDLINE_EDITING			/* Command-line editing */
39649f5befaSXie Xiaobo #define CONFIG_SYS_LOAD_ADDR	0x2000000	/* default load address */
39749f5befaSXie Xiaobo 
39849f5befaSXie Xiaobo /*
39949f5befaSXie Xiaobo  * For booting Linux, the board info and command line data
40049f5befaSXie Xiaobo  * have to be in the first 64 MB of memory, since this is
40149f5befaSXie Xiaobo  * the maximum mapped by the Linux kernel during initialization.
40249f5befaSXie Xiaobo  */
40349f5befaSXie Xiaobo #define CONFIG_SYS_BOOTMAPSZ	(64 << 20)	/* Initial Memory for Linux*/
40449f5befaSXie Xiaobo #define CONFIG_SYS_BOOTM_LEN	(64 << 20)	/* Increase max gunzip size */
40549f5befaSXie Xiaobo 
40649f5befaSXie Xiaobo /*
40749f5befaSXie Xiaobo  * Environment Configuration
40849f5befaSXie Xiaobo  */
40949f5befaSXie Xiaobo #define CONFIG_HOSTNAME		unknown
41049f5befaSXie Xiaobo #define CONFIG_ROOTPATH		"/opt/nfsroot"
41149f5befaSXie Xiaobo #define CONFIG_BOOTFILE		"uImage"
41249f5befaSXie Xiaobo #define CONFIG_UBOOTPATH	u-boot.bin /* U-Boot image on TFTP server */
41349f5befaSXie Xiaobo 
41449f5befaSXie Xiaobo /* default location for tftp and bootm */
41549f5befaSXie Xiaobo #define CONFIG_LOADADDR	1000000
41649f5befaSXie Xiaobo 
41749f5befaSXie Xiaobo #define	CONFIG_EXTRA_ENV_SETTINGS	\
41849f5befaSXie Xiaobo "netdev=eth0\0"	\
41949f5befaSXie Xiaobo "uboot=" __stringify(CONFIG_UBOOTPATH) "\0"	\
42049f5befaSXie Xiaobo "loadaddr=1000000\0"	\
42149f5befaSXie Xiaobo "bootfile=uImage\0"	\
42249f5befaSXie Xiaobo "dtbfile=twr-p1025twr.dtb\0"	\
42349f5befaSXie Xiaobo "ramdiskfile=rootfs.ext2.gz.uboot\0"	\
42449f5befaSXie Xiaobo "qefirmwarefile=fsl_qe_ucode_1021_10_A.bin\0"	\
42549f5befaSXie Xiaobo "tftpflash=tftpboot $loadaddr $uboot; "	\
42649f5befaSXie Xiaobo 	"protect off " __stringify(CONFIG_SYS_TEXT_BASE) " +$filesize; " \
42749f5befaSXie Xiaobo 	"erase " __stringify(CONFIG_SYS_TEXT_BASE) " +$filesize; "	\
42849f5befaSXie Xiaobo 	"cp.b $loadaddr " __stringify(CONFIG_SYS_TEXT_BASE) " $filesize; " \
42949f5befaSXie Xiaobo 	"protect on " __stringify(CONFIG_SYS_TEXT_BASE) " +$filesize; "	\
43049f5befaSXie Xiaobo 	"cmp.b $loadaddr " __stringify(CONFIG_SYS_TEXT_BASE) " $filesize\0" \
43149f5befaSXie Xiaobo "kernelflash=tftpboot $loadaddr $bootfile; "	\
43249f5befaSXie Xiaobo 	"protect off 0xefa80000 +$filesize; "	\
43349f5befaSXie Xiaobo 	"erase 0xefa80000 +$filesize; "	\
43449f5befaSXie Xiaobo 	"cp.b $loadaddr 0xefa80000 $filesize; "	\
43549f5befaSXie Xiaobo 	"protect on 0xefa80000 +$filesize; "	\
43649f5befaSXie Xiaobo 	"cmp.b $loadaddr 0xefa80000 $filesize\0"	\
43749f5befaSXie Xiaobo "dtbflash=tftpboot $loadaddr $dtbfile; "	\
43849f5befaSXie Xiaobo 	"protect off 0xefe80000 +$filesize; "	\
43949f5befaSXie Xiaobo 	"erase 0xefe80000 +$filesize; "	\
44049f5befaSXie Xiaobo 	"cp.b $loadaddr 0xefe80000 $filesize; "	\
44149f5befaSXie Xiaobo 	"protect on 0xefe80000 +$filesize; "	\
44249f5befaSXie Xiaobo 	"cmp.b $loadaddr 0xefe80000 $filesize\0"	\
44349f5befaSXie Xiaobo "ramdiskflash=tftpboot $loadaddr $ramdiskfile; "	\
44449f5befaSXie Xiaobo 	"protect off 0xeeb80000 +$filesize; "	\
44549f5befaSXie Xiaobo 	"erase 0xeeb80000 +$filesize; "	\
44649f5befaSXie Xiaobo 	"cp.b $loadaddr 0xeeb80000 $filesize; "	\
44749f5befaSXie Xiaobo 	"protect on 0xeeb80000 +$filesize; "	\
44849f5befaSXie Xiaobo 	"cmp.b $loadaddr 0xeeb80000 $filesize\0"	\
44949f5befaSXie Xiaobo "qefirmwareflash=tftpboot $loadaddr $qefirmwarefile; "	\
45049f5befaSXie Xiaobo 	"protect off 0xefec0000 +$filesize; "	\
45149f5befaSXie Xiaobo 	"erase 0xefec0000 +$filesize; "	\
45249f5befaSXie Xiaobo 	"cp.b $loadaddr 0xefec0000 $filesize; "	\
45349f5befaSXie Xiaobo 	"protect on 0xefec0000 +$filesize; "	\
45449f5befaSXie Xiaobo 	"cmp.b $loadaddr 0xefec0000 $filesize\0"	\
45549f5befaSXie Xiaobo "consoledev=ttyS0\0"	\
45649f5befaSXie Xiaobo "ramdiskaddr=2000000\0"	\
45749f5befaSXie Xiaobo "ramdiskfile=rootfs.ext2.gz.uboot\0"	\
458b24a4f62SScott Wood "fdtaddr=1e00000\0"	\
45949f5befaSXie Xiaobo "bdev=sda1\0"	\
46049f5befaSXie Xiaobo "norbootaddr=ef080000\0"	\
46149f5befaSXie Xiaobo "norfdtaddr=ef040000\0"	\
46249f5befaSXie Xiaobo "ramdisk_size=120000\0" \
46349f5befaSXie Xiaobo "usbboot=setenv bootargs root=/dev/sda1 rw rootdelay=5 " \
46449f5befaSXie Xiaobo "console=$consoledev,$baudrate $othbootargs ; bootm 0xefa80000 - 0xefe80000"
46549f5befaSXie Xiaobo 
46649f5befaSXie Xiaobo #define CONFIG_NFSBOOTCOMMAND	\
46749f5befaSXie Xiaobo "setenv bootargs root=/dev/nfs rw "	\
46849f5befaSXie Xiaobo "nfsroot=$serverip:$rootpath "	\
46949f5befaSXie Xiaobo "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
47049f5befaSXie Xiaobo "console=$consoledev,$baudrate $othbootargs;" \
47149f5befaSXie Xiaobo "tftp $loadaddr $bootfile&&"	\
47249f5befaSXie Xiaobo "tftp $fdtaddr $fdtfile&&"	\
47349f5befaSXie Xiaobo "bootm $loadaddr - $fdtaddr"
47449f5befaSXie Xiaobo 
47549f5befaSXie Xiaobo #define CONFIG_HDBOOT	\
47649f5befaSXie Xiaobo "setenv bootargs root=/dev/$bdev rw rootdelay=30 "	\
47749f5befaSXie Xiaobo "console=$consoledev,$baudrate $othbootargs;" \
47849f5befaSXie Xiaobo "usb start;"	\
47949f5befaSXie Xiaobo "ext2load usb 0:1 $loadaddr /boot/$bootfile;"	\
48049f5befaSXie Xiaobo "ext2load usb 0:1 $fdtaddr /boot/$fdtfile;"	\
48149f5befaSXie Xiaobo "bootm $loadaddr - $fdtaddr"
48249f5befaSXie Xiaobo 
48349f5befaSXie Xiaobo #define CONFIG_USB_FAT_BOOT	\
48449f5befaSXie Xiaobo "setenv bootargs root=/dev/ram rw "	\
48549f5befaSXie Xiaobo "console=$consoledev,$baudrate $othbootargs " \
48649f5befaSXie Xiaobo "ramdisk_size=$ramdisk_size;"	\
48749f5befaSXie Xiaobo "usb start;"	\
48849f5befaSXie Xiaobo "fatload usb 0:2 $loadaddr $bootfile;"	\
48949f5befaSXie Xiaobo "fatload usb 0:2 $fdtaddr $fdtfile;"	\
49049f5befaSXie Xiaobo "fatload usb 0:2 $ramdiskaddr $ramdiskfile;"	\
49149f5befaSXie Xiaobo "bootm $loadaddr $ramdiskaddr $fdtaddr"
49249f5befaSXie Xiaobo 
49349f5befaSXie Xiaobo #define CONFIG_USB_EXT2_BOOT	\
49449f5befaSXie Xiaobo "setenv bootargs root=/dev/ram rw "	\
49549f5befaSXie Xiaobo "console=$consoledev,$baudrate $othbootargs " \
49649f5befaSXie Xiaobo "ramdisk_size=$ramdisk_size;"	\
49749f5befaSXie Xiaobo "usb start;"	\
49849f5befaSXie Xiaobo "ext2load usb 0:4 $loadaddr $bootfile;"	\
49949f5befaSXie Xiaobo "ext2load usb 0:4 $fdtaddr $fdtfile;" \
50049f5befaSXie Xiaobo "ext2load usb 0:4 $ramdiskaddr $ramdiskfile;" \
50149f5befaSXie Xiaobo "bootm $loadaddr $ramdiskaddr $fdtaddr"
50249f5befaSXie Xiaobo 
50349f5befaSXie Xiaobo #define CONFIG_NORBOOT	\
50449f5befaSXie Xiaobo "setenv bootargs root=/dev/mtdblock3 rw "	\
50549f5befaSXie Xiaobo "console=$consoledev,$baudrate rootfstype=jffs2 $othbootargs;"	\
50649f5befaSXie Xiaobo "bootm $norbootaddr - $norfdtaddr"
50749f5befaSXie Xiaobo 
50849f5befaSXie Xiaobo #define CONFIG_RAMBOOTCOMMAND_TFTP	\
50949f5befaSXie Xiaobo "setenv bootargs root=/dev/ram rw "	\
51049f5befaSXie Xiaobo "console=$consoledev,$baudrate $othbootargs " \
51149f5befaSXie Xiaobo "ramdisk_size=$ramdisk_size;"	\
51249f5befaSXie Xiaobo "tftp $ramdiskaddr $ramdiskfile;"	\
51349f5befaSXie Xiaobo "tftp $loadaddr $bootfile;"	\
51449f5befaSXie Xiaobo "tftp $fdtaddr $fdtfile;"	\
51549f5befaSXie Xiaobo "bootm $loadaddr $ramdiskaddr $fdtaddr"
51649f5befaSXie Xiaobo 
51749f5befaSXie Xiaobo #define CONFIG_RAMBOOTCOMMAND	\
51849f5befaSXie Xiaobo "setenv bootargs root=/dev/ram rw "	\
51949f5befaSXie Xiaobo "console=$consoledev,$baudrate $othbootargs " \
52049f5befaSXie Xiaobo "ramdisk_size=$ramdisk_size;"	\
52149f5befaSXie Xiaobo "bootm 0xefa80000 0xeeb80000 0xefe80000"
52249f5befaSXie Xiaobo 
52349f5befaSXie Xiaobo #define CONFIG_BOOTCOMMAND	CONFIG_RAMBOOTCOMMAND
52449f5befaSXie Xiaobo 
52549f5befaSXie Xiaobo #endif /* __CONFIG_H */
526