xref: /openbmc/u-boot/include/configs/ipam390.h (revision 8ccf98b1cfd2811e3121c719e294bdd8ebab1c45)
1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */
203efcb05SHeiko Schocher /*
303efcb05SHeiko Schocher  * (C) Heiko Schocher, DENX Software Engineering, hs@denx.de.
403efcb05SHeiko Schocher  * Based on:
503efcb05SHeiko Schocher  * U-Boot:include/configs/da850evm.h
603efcb05SHeiko Schocher  *
703efcb05SHeiko Schocher  * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
803efcb05SHeiko Schocher  *
903efcb05SHeiko Schocher  * Based on davinci_dvevm.h. Original Copyrights follow:
1003efcb05SHeiko Schocher  *
1103efcb05SHeiko Schocher  * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
1203efcb05SHeiko Schocher  */
1303efcb05SHeiko Schocher 
1403efcb05SHeiko Schocher #ifndef __CONFIG_H
1503efcb05SHeiko Schocher #define __CONFIG_H
1603efcb05SHeiko Schocher 
1703efcb05SHeiko Schocher /*
1803efcb05SHeiko Schocher  * Board
1903efcb05SHeiko Schocher  */
2003efcb05SHeiko Schocher 
2103efcb05SHeiko Schocher /*
2203efcb05SHeiko Schocher  * SoC Configuration
2303efcb05SHeiko Schocher  */
2403efcb05SHeiko Schocher #define CONFIG_SYS_EXCEPTION_VECTORS_HIGH
2503efcb05SHeiko Schocher #define CONFIG_SYS_CLK_FREQ		clk_get(DAVINCI_ARM_CLKID)
2603efcb05SHeiko Schocher #define CONFIG_SYS_OSCIN_FREQ		24000000
2703efcb05SHeiko Schocher #define CONFIG_SYS_TIMERBASE		DAVINCI_TIMER0_BASE
2803efcb05SHeiko Schocher #define CONFIG_SYS_HZ_CLOCK		clk_get(DAVINCI_AUXCLK_CLKID)
2903efcb05SHeiko Schocher 
3003efcb05SHeiko Schocher /*
3103efcb05SHeiko Schocher  * Memory Info
3203efcb05SHeiko Schocher  */
3303efcb05SHeiko Schocher #define CONFIG_SYS_MALLOC_LEN	(0x10000 + 1*1024*1024) /* malloc() len */
3403efcb05SHeiko Schocher #define PHYS_SDRAM_1		DAVINCI_DDR_EMIF_DATA_BASE /* DDR Start */
3503efcb05SHeiko Schocher #define PHYS_SDRAM_1_SIZE	(128 << 20) /* SDRAM size 128MB */
3603efcb05SHeiko Schocher #define CONFIG_MAX_RAM_BANK_SIZE (512 << 20) /* max size from SPRS586*/
3703efcb05SHeiko Schocher 
3803efcb05SHeiko Schocher /* memtest start addr */
3903efcb05SHeiko Schocher #define CONFIG_SYS_MEMTEST_START	(PHYS_SDRAM_1 + 0x2000000)
4003efcb05SHeiko Schocher 
4103efcb05SHeiko Schocher /* memtest will be run on 16MB */
4203efcb05SHeiko Schocher #define CONFIG_SYS_MEMTEST_END	(CONFIG_SYS_MEMTEST_START + 16 * 1024 * 1024)
4303efcb05SHeiko Schocher 
4403efcb05SHeiko Schocher #define CONFIG_SYS_DA850_SYSCFG_SUSPSRC (	\
4503efcb05SHeiko Schocher 	DAVINCI_SYSCFG_SUSPSRC_TIMER0 |		\
4603efcb05SHeiko Schocher 	DAVINCI_SYSCFG_SUSPSRC_UART2 |		\
4703efcb05SHeiko Schocher 	DAVINCI_SYSCFG_SUSPSRC_UART0 |		\
4803efcb05SHeiko Schocher 	DAVINCI_SYSCFG_SUSPSRC_EMAC)
4903efcb05SHeiko Schocher 
5003efcb05SHeiko Schocher /*
5103efcb05SHeiko Schocher  * PLL configuration
5203efcb05SHeiko Schocher  */
5303efcb05SHeiko Schocher 
5403efcb05SHeiko Schocher #define CONFIG_SYS_DA850_PLL0_PLLM     24
5503efcb05SHeiko Schocher #define CONFIG_SYS_DA850_PLL1_PLLM     24
5603efcb05SHeiko Schocher 
5703efcb05SHeiko Schocher /*
5803efcb05SHeiko Schocher  * DDR2 memory configuration
5903efcb05SHeiko Schocher  */
6003efcb05SHeiko Schocher #define CONFIG_SYS_DA850_DDR2_DDRPHYCR (DV_DDR_PHY_PWRDNEN | \
6103efcb05SHeiko Schocher 					DV_DDR_PHY_EXT_STRBEN | \
6203efcb05SHeiko Schocher 					(0x2 << DV_DDR_PHY_RD_LATENCY_SHIFT))
6303efcb05SHeiko Schocher #define CONFIG_SYS_DA850_DDR2_SDRCR	0x00000498
6403efcb05SHeiko Schocher 
6503efcb05SHeiko Schocher #define CONFIG_SYS_DA850_DDR2_SDBCR2	0x00000004
6603efcb05SHeiko Schocher #define CONFIG_SYS_DA850_DDR2_PBBPR	0x00000020
6703efcb05SHeiko Schocher 
6803efcb05SHeiko Schocher #define CONFIG_SYS_DA850_DDR2_SDTIMR (		\
6903efcb05SHeiko Schocher 	(13 << DV_DDR_SDTMR1_RFC_SHIFT) |	\
7003efcb05SHeiko Schocher 	(2 << DV_DDR_SDTMR1_RP_SHIFT) |		\
7103efcb05SHeiko Schocher 	(2 << DV_DDR_SDTMR1_RCD_SHIFT) |	\
7203efcb05SHeiko Schocher 	(2 << DV_DDR_SDTMR1_WR_SHIFT) |		\
7303efcb05SHeiko Schocher 	(5 << DV_DDR_SDTMR1_RAS_SHIFT) |	\
7403efcb05SHeiko Schocher 	(8 << DV_DDR_SDTMR1_RC_SHIFT) |		\
7503efcb05SHeiko Schocher 	(1 << DV_DDR_SDTMR1_RRD_SHIFT) |	\
7603efcb05SHeiko Schocher 	(1 << DV_DDR_SDTMR1_WTR_SHIFT))
7703efcb05SHeiko Schocher 
7803efcb05SHeiko Schocher #define CONFIG_SYS_DA850_DDR2_SDTIMR2 (		\
7903efcb05SHeiko Schocher 	(8 << DV_DDR_SDTMR2_RASMAX_SHIFT) |	\
8003efcb05SHeiko Schocher 	(2 << DV_DDR_SDTMR2_XP_SHIFT) |		\
8103efcb05SHeiko Schocher 	(0 << DV_DDR_SDTMR2_ODT_SHIFT) |	\
8203efcb05SHeiko Schocher 	(14 << DV_DDR_SDTMR2_XSNR_SHIFT) |	\
8303efcb05SHeiko Schocher 	(0xc7 << DV_DDR_SDTMR2_XSRD_SHIFT) |	\
8403efcb05SHeiko Schocher 	(1 << DV_DDR_SDTMR2_RTP_SHIFT) |	\
8503efcb05SHeiko Schocher 	(2 << DV_DDR_SDTMR2_CKE_SHIFT))
8603efcb05SHeiko Schocher 
8703efcb05SHeiko Schocher #define CONFIG_SYS_DA850_DDR2_SDBCR (		\
8803efcb05SHeiko Schocher 	(1 << DV_DDR_SDCR_DDR2EN_SHIFT) |	\
8903efcb05SHeiko Schocher 	(1 << DV_DDR_SDCR_DDRDRIVE0_SHIFT) |	\
9003efcb05SHeiko Schocher 	(1 << DV_DDR_SDCR_DDREN_SHIFT) |	\
9103efcb05SHeiko Schocher 	(1 << DV_DDR_SDCR_SDRAMEN_SHIFT) |	\
9203efcb05SHeiko Schocher 	(1 << DV_DDR_SDCR_BUS_WIDTH_SHIFT) |	\
9303efcb05SHeiko Schocher 	(2 << DV_DDR_SDCR_CL_SHIFT) |	\
9403efcb05SHeiko Schocher 	(3 << DV_DDR_SDCR_IBANK_SHIFT) |	\
9503efcb05SHeiko Schocher 	(2 << DV_DDR_SDCR_PAGESIZE_SHIFT))
9603efcb05SHeiko Schocher 
97660a2e65SHeiko Schocher #define CONFIG_SYS_DA850_CS3CFG	(DAVINCI_ABCR_WSETUP(1)	| \
9803efcb05SHeiko Schocher 				DAVINCI_ABCR_WSTROBE(2)	| \
99660a2e65SHeiko Schocher 				DAVINCI_ABCR_WHOLD(0)	| \
10003efcb05SHeiko Schocher 				DAVINCI_ABCR_RSETUP(1)	| \
101660a2e65SHeiko Schocher 				DAVINCI_ABCR_RSTROBE(2)	| \
102660a2e65SHeiko Schocher 				DAVINCI_ABCR_RHOLD(1)	| \
103660a2e65SHeiko Schocher 				DAVINCI_ABCR_TA(0)	| \
10403efcb05SHeiko Schocher 				DAVINCI_ABCR_ASIZE_8BIT)
10503efcb05SHeiko Schocher 
10603efcb05SHeiko Schocher /*
10703efcb05SHeiko Schocher  * Serial Driver info
10803efcb05SHeiko Schocher  */
10903efcb05SHeiko Schocher #define CONFIG_SYS_NS16550_SERIAL
11003efcb05SHeiko Schocher #define CONFIG_SYS_NS16550_REG_SIZE	-4	/* NS16550 register size */
11103efcb05SHeiko Schocher #define CONFIG_SYS_NS16550_COM1	DAVINCI_UART0_BASE /* Base address of UART0 */
11203efcb05SHeiko Schocher #define CONFIG_SYS_NS16550_CLK	clk_get(DAVINCI_UART2_CLKID)
11303efcb05SHeiko Schocher 
11403efcb05SHeiko Schocher /*
11503efcb05SHeiko Schocher  * Flash & Environment
11603efcb05SHeiko Schocher  */
11703efcb05SHeiko Schocher #define CONFIG_ENV_OFFSET		0x0 /* Block 0--not used by bootcode */
11803efcb05SHeiko Schocher #define CONFIG_ENV_SIZE			(128 << 10)
11903efcb05SHeiko Schocher #define	CONFIG_SYS_NAND_USE_FLASH_BBT
12003efcb05SHeiko Schocher #define CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST
12103efcb05SHeiko Schocher #define	CONFIG_SYS_NAND_PAGE_2K
12203efcb05SHeiko Schocher #define CONFIG_SYS_NAND_CS		3
12303efcb05SHeiko Schocher #define CONFIG_SYS_NAND_BASE		DAVINCI_ASYNC_EMIF_DATA_CE3_BASE
12403efcb05SHeiko Schocher #define CONFIG_SYS_NAND_MASK_CLE		0x10
12503efcb05SHeiko Schocher #define CONFIG_SYS_NAND_MASK_ALE		0x8
12603efcb05SHeiko Schocher #undef CONFIG_SYS_NAND_HW_ECC
12703efcb05SHeiko Schocher #define CONFIG_SYS_MAX_NAND_DEVICE	1 /* Max number of NAND devices */
12803efcb05SHeiko Schocher #define CONFIG_SYS_NAND_HW_ECC_OOBFIRST
129660a2e65SHeiko Schocher #define CONFIG_NAND_6BYTES_OOB_FREE_10BYTES_ECC
13003efcb05SHeiko Schocher #define CONFIG_SYS_NAND_5_ADDR_CYCLE
13103efcb05SHeiko Schocher #define CONFIG_SYS_NAND_PAGE_SIZE	(2 << 10)
13203efcb05SHeiko Schocher #define CONFIG_SYS_NAND_BLOCK_SIZE	(128 << 10)
13303efcb05SHeiko Schocher #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x40000
13403efcb05SHeiko Schocher #define CONFIG_SYS_NAND_U_BOOT_SIZE	0x120000
13503efcb05SHeiko Schocher #define CONFIG_SYS_NAND_U_BOOT_DST	0xc1080000
13603efcb05SHeiko Schocher #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_NAND_U_BOOT_DST
13703efcb05SHeiko Schocher #define CONFIG_SYS_NAND_U_BOOT_RELOC_SP	(CONFIG_SYS_NAND_U_BOOT_DST - \
13803efcb05SHeiko Schocher 					CONFIG_SYS_NAND_U_BOOT_SIZE - \
13903efcb05SHeiko Schocher 					CONFIG_SYS_MALLOC_LEN -       \
14003efcb05SHeiko Schocher 					GENERATED_GBL_DATA_SIZE)
14103efcb05SHeiko Schocher #define CONFIG_SYS_NAND_ECCPOS		{				\
142660a2e65SHeiko Schocher 			6,   7,  8,  9, 10,	11, 12, 13, 14, 15,	\
143660a2e65SHeiko Schocher 			22, 23, 24, 25, 26,	27, 28, 29, 30, 31,	\
144660a2e65SHeiko Schocher 			38, 39, 40, 41, 42,	43, 44, 45, 46, 47,	\
145660a2e65SHeiko Schocher 			54, 55, 56, 57, 58,	59, 60, 61, 62, 63}
14603efcb05SHeiko Schocher #define CONFIG_SYS_NAND_PAGE_COUNT	64
14703efcb05SHeiko Schocher #define CONFIG_SYS_NAND_BAD_BLOCK_POS	0
14803efcb05SHeiko Schocher #define CONFIG_SYS_NAND_ECCSIZE		512
14903efcb05SHeiko Schocher #define CONFIG_SYS_NAND_ECCBYTES	10
15003efcb05SHeiko Schocher #define CONFIG_SYS_NAND_OOBSIZE		64
15103efcb05SHeiko Schocher #define CONFIG_SPL_NAND_BASE
15203efcb05SHeiko Schocher #define CONFIG_SPL_NAND_DRIVERS
15303efcb05SHeiko Schocher #define CONFIG_SPL_NAND_ECC
15403efcb05SHeiko Schocher #define CONFIG_SPL_NAND_LOAD
15503efcb05SHeiko Schocher 
15603efcb05SHeiko Schocher /*
15703efcb05SHeiko Schocher  * Network & Ethernet Configuration
15803efcb05SHeiko Schocher  */
15903efcb05SHeiko Schocher #ifdef CONFIG_DRIVER_TI_EMAC
16003efcb05SHeiko Schocher #define CONFIG_DRIVER_TI_EMAC_USE_RMII
16103efcb05SHeiko Schocher #define CONFIG_BOOTP_DEFAULT
16203efcb05SHeiko Schocher #define CONFIG_BOOTP_DNS2
16303efcb05SHeiko Schocher #define CONFIG_BOOTP_SEND_HOSTNAME
16403efcb05SHeiko Schocher #define CONFIG_NET_RETRY_COUNT	10
16503efcb05SHeiko Schocher #endif
16603efcb05SHeiko Schocher 
16703efcb05SHeiko Schocher /*
16803efcb05SHeiko Schocher  * U-Boot general configuration
16903efcb05SHeiko Schocher  */
17003efcb05SHeiko Schocher #define CONFIG_BOOTFILE		"uImage" /* Boot file name */
17103efcb05SHeiko Schocher #define CONFIG_SYS_CBSIZE	1024 /* Console I/O Buffer Size	*/
17203efcb05SHeiko Schocher #define CONFIG_SYS_BARGSIZE	CONFIG_SYS_CBSIZE /* Boot Args Buffer Size */
17303efcb05SHeiko Schocher #define CONFIG_SYS_LOAD_ADDR	(PHYS_SDRAM_1 + 0x700000)
17403efcb05SHeiko Schocher #define CONFIG_MX_CYCLIC
17503efcb05SHeiko Schocher 
17603efcb05SHeiko Schocher /*
17703efcb05SHeiko Schocher  * Linux Information
17803efcb05SHeiko Schocher  */
17903efcb05SHeiko Schocher #define LINUX_BOOT_PARAM_ADDR	(PHYS_SDRAM_1 + 0x100)
18003efcb05SHeiko Schocher #define CONFIG_HWCONFIG		/* enable hwconfig */
18103efcb05SHeiko Schocher #define CONFIG_CMDLINE_TAG
18203efcb05SHeiko Schocher #define CONFIG_REVISION_TAG
18303efcb05SHeiko Schocher #define CONFIG_SETUP_MEMORY_TAGS
18403efcb05SHeiko Schocher #define CONFIG_EXTRA_ENV_SETTINGS \
185660a2e65SHeiko Schocher 	"defbootargs=setenv bootargs mem=128M console=ttyS0,115200n8 " \
186660a2e65SHeiko Schocher 		"root=/dev/mtdblock5 rw noinitrd " \
187660a2e65SHeiko Schocher 		"rootfstype=jffs2 noinitrd\0" \
18803efcb05SHeiko Schocher 	"hwconfig=dsp:wake=yes\0" \
189660a2e65SHeiko Schocher 	"bootcmd=nboot kernel;run defbootargs addmtd;bootm 0xc0700000\0" \
190660a2e65SHeiko Schocher 	"bootfile=uImage\0" \
19103efcb05SHeiko Schocher 	"addmtd=setenv bootargs ${bootargs} ${mtdparts}\0"	\
192660a2e65SHeiko Schocher 	"mtddevname=uboot-env\0" \
193660a2e65SHeiko Schocher 	"mtddevnum=0\0" \
19443ede0bcSTom Rini 	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0"				\
19543ede0bcSTom Rini 	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"			\
196660a2e65SHeiko Schocher 	"u-boot=/tftpboot/ipam390/u-boot.ais\0"			\
197660a2e65SHeiko Schocher 	"upd_uboot=tftp c0000000 ${u-boot};nand erase.part u-boot;" \
198660a2e65SHeiko Schocher 		"nand write c0000000 20000 ${filesize}\0"	\
19903efcb05SHeiko Schocher 	"setbootparms=nand read c0100000 200000 400000;"	\
200660a2e65SHeiko Schocher 		"run defbootargs addmtd;"			\
20103efcb05SHeiko Schocher 		"spl export atags c0100000;"			\
20203efcb05SHeiko Schocher 		"nand erase.part bootparms;"			\
20303efcb05SHeiko Schocher 		"nand write c0000100 180000 20000\0"		\
20403efcb05SHeiko Schocher 	"\0"
20503efcb05SHeiko Schocher 
20603efcb05SHeiko Schocher #ifdef CONFIG_CMD_BDI
20703efcb05SHeiko Schocher #define CONFIG_CLOCKS
20803efcb05SHeiko Schocher #endif
20903efcb05SHeiko Schocher 
21003efcb05SHeiko Schocher /* defines for SPL */
21103efcb05SHeiko Schocher #define CONFIG_SYS_SPL_MALLOC_START	(CONFIG_SYS_TEXT_BASE - \
21203efcb05SHeiko Schocher 						CONFIG_SYS_MALLOC_LEN)
21303efcb05SHeiko Schocher #define CONFIG_SYS_SPL_MALLOC_SIZE	CONFIG_SYS_MALLOC_LEN
21403efcb05SHeiko Schocher #define CONFIG_SPL_STACK	0x8001ff00
21503efcb05SHeiko Schocher #define CONFIG_SPL_TEXT_BASE	0x80000000
21603efcb05SHeiko Schocher #define CONFIG_SPL_MAX_SIZE	0x20000
21703efcb05SHeiko Schocher #define CONFIG_SPL_MAX_FOOTPRINT	32768
21803efcb05SHeiko Schocher 
21903efcb05SHeiko Schocher /* additions for new relocation code, must added to all boards */
22003efcb05SHeiko Schocher #define CONFIG_SYS_SDRAM_BASE		0xc0000000
22103efcb05SHeiko Schocher 
22203efcb05SHeiko Schocher #define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_SDRAM_BASE + 0x1000 - \
22303efcb05SHeiko Schocher 					GENERATED_GBL_DATA_SIZE)
22403efcb05SHeiko Schocher 
22503efcb05SHeiko Schocher /* add FALCON boot mode */
22603efcb05SHeiko Schocher #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS	0x00200000
22703efcb05SHeiko Schocher #define CONFIG_SYS_SPL_ARGS_ADDR	LINUX_BOOT_PARAM_ADDR
22803efcb05SHeiko Schocher 
22903efcb05SHeiko Schocher /* GPIO support */
23003efcb05SHeiko Schocher #define CONFIG_IPAM390_GPIO_BOOTMODE	((16 * 7) + 14)
23103efcb05SHeiko Schocher 
23203efcb05SHeiko Schocher #define CONFIG_SHOW_BOOT_PROGRESS
23303efcb05SHeiko Schocher #define CONFIG_IPAM390_GPIO_LED_RED	((16 * 7) + 11)
23403efcb05SHeiko Schocher #define CONFIG_IPAM390_GPIO_LED_GREEN	((16 * 7) + 12)
23503efcb05SHeiko Schocher 
23689f5eaa1SSimon Glass #include <asm/arch/hardware.h>
23789f5eaa1SSimon Glass 
23803efcb05SHeiko Schocher #endif /* __CONFIG_H */
239