xref: /rk3399_rockchip-uboot/include/configs/tricorder.h (revision 577968e5669858e1d5bcb651ab28d60d20166252)
18167af14SThomas Weber /*
28167af14SThomas Weber  * (C) Copyright 2006-2008
38167af14SThomas Weber  * Texas Instruments.
48167af14SThomas Weber  * Richard Woodruff <r-woodruff2@ti.com>
58167af14SThomas Weber  * Syed Mohammed Khasim <x0khasim@ti.com>
68167af14SThomas Weber  *
78167af14SThomas Weber  * (C) Copyright 2012
88167af14SThomas Weber  * Corscience GmbH & Co. KG
98167af14SThomas Weber  * Thomas Weber <weber@corscience.de>
108167af14SThomas Weber  *
118167af14SThomas Weber  * Configuration settings for the Tricorder board.
128167af14SThomas Weber  *
131a459660SWolfgang Denk  * SPDX-License-Identifier:	GPL-2.0+
148167af14SThomas Weber  */
158167af14SThomas Weber 
168167af14SThomas Weber #ifndef __CONFIG_H
178167af14SThomas Weber #define __CONFIG_H
188167af14SThomas Weber 
19*94ba26f2STom Rini #define CONFIG_MACH_TYPE		MACH_TYPE_TRICORDER
208167af14SThomas Weber /*
218167af14SThomas Weber  * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
228167af14SThomas Weber  * 64 bytes before this address should be set aside for u-boot.img's
238167af14SThomas Weber  * header. That is 0x800FFFC0--0x80100000 should not be used for any
248167af14SThomas Weber  * other needs.
258167af14SThomas Weber  */
268167af14SThomas Weber #define CONFIG_SYS_TEXT_BASE		0x80100000
278167af14SThomas Weber 
288167af14SThomas Weber #define CONFIG_SDRC			/* The chip has SDRC controller */
298167af14SThomas Weber 
308167af14SThomas Weber #include <asm/arch/cpu.h>		/* get chip and board defs */
31987ec585SNishanth Menon #include <asm/arch/omap.h>
328167af14SThomas Weber 
338167af14SThomas Weber /* Clock Defines */
348167af14SThomas Weber #define V_OSCK				26000000 /* Clock output from T2 */
358167af14SThomas Weber #define V_SCLK				(V_OSCK >> 1)
368167af14SThomas Weber 
378167af14SThomas Weber #define CONFIG_MISC_INIT_R
388167af14SThomas Weber 
398167af14SThomas Weber #define CONFIG_CMDLINE_TAG		/* enable passing of ATAGs */
408167af14SThomas Weber #define CONFIG_SETUP_MEMORY_TAGS
418167af14SThomas Weber #define CONFIG_INITRD_TAG
428167af14SThomas Weber #define CONFIG_REVISION_TAG
438167af14SThomas Weber 
448167af14SThomas Weber /* Size of malloc() pool */
4536f3aab2SBernhard Walle #define CONFIG_SYS_MALLOC_LEN		(1024*1024)
468167af14SThomas Weber 
478167af14SThomas Weber /* Hardware drivers */
488167af14SThomas Weber 
498167af14SThomas Weber /* NS16550 Configuration */
508167af14SThomas Weber #define CONFIG_SYS_NS16550_SERIAL
518167af14SThomas Weber #define CONFIG_SYS_NS16550_REG_SIZE	(-4)
528167af14SThomas Weber #define CONFIG_SYS_NS16550_CLK		48000000 /* 48MHz (APLL96/2) */
538167af14SThomas Weber 
548167af14SThomas Weber /* select serial console configuration */
558167af14SThomas Weber #define CONFIG_CONS_INDEX		3
568167af14SThomas Weber #define CONFIG_SYS_NS16550_COM3		OMAP34XX_UART3
578167af14SThomas Weber #define CONFIG_SERIAL3			3
588167af14SThomas Weber #define CONFIG_SYS_BAUDRATE_TABLE	{4800, 9600, 19200, 38400, 57600,\
598167af14SThomas Weber 					115200}
608167af14SThomas Weber 
618167af14SThomas Weber /* I2C */
626789e84eSHeiko Schocher #define CONFIG_SYS_I2C
636789e84eSHeiko Schocher #define CONFIG_SYS_OMAP24_I2C_SPEED	100000
646789e84eSHeiko Schocher #define CONFIG_SYS_OMAP24_I2C_SLAVE	1
656789e84eSHeiko Schocher 
66459f1da8SAndreas Bießmann 
67459f1da8SAndreas Bießmann /* EEPROM */
68459f1da8SAndreas Bießmann #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	2
69459f1da8SAndreas Bießmann #define CONFIG_SYS_EEPROM_BUS_NUM	1
708167af14SThomas Weber 
718167af14SThomas Weber /* TWL4030 */
728167af14SThomas Weber #define CONFIG_TWL4030_LED
738167af14SThomas Weber 
748167af14SThomas Weber /* Board NAND Info */
758167af14SThomas Weber 
768167af14SThomas Weber #define CONFIG_SYS_NAND_ADDR		NAND_BASE	/* physical address */
778167af14SThomas Weber 							/* to access nand */
788167af14SThomas Weber #define CONFIG_SYS_NAND_BASE		NAND_BASE	/* physical address */
798167af14SThomas Weber 							/* to access nand at */
808167af14SThomas Weber 							/* CS0 */
818167af14SThomas Weber #define CONFIG_SYS_MAX_NAND_DEVICE	1		/* Max number of NAND */
828167af14SThomas Weber 							/* devices */
8368ec9c85SPrabhakar Kushwaha #define CONFIG_SYS_NAND_MAX_OOBFREE	2
8468ec9c85SPrabhakar Kushwaha #define CONFIG_SYS_NAND_MAX_ECCPOS	56
858167af14SThomas Weber 
868167af14SThomas Weber /* needed for ubi */
878167af14SThomas Weber 
88ec246452SAndreas Bießmann /* Environment information (this is the common part) */
898167af14SThomas Weber 
908167af14SThomas Weber 
9189088058SAndreas Bießmann /* hang() the board on panic() */
9289088058SAndreas Bießmann 
93ec246452SAndreas Bießmann /* environment placement (for NAND), is different for FLASHCARD but does not
94ec246452SAndreas Bießmann  * harm there */
95ec246452SAndreas Bießmann #define CONFIG_ENV_OFFSET		0x120000    /* env start */
96ec246452SAndreas Bießmann #define CONFIG_ENV_OFFSET_REDUND	0x2A0000    /* redundant env start */
97ec246452SAndreas Bießmann #define CONFIG_ENV_SIZE			(16 << 10)  /* use 16KiB for env */
98ec246452SAndreas Bießmann #define CONFIG_ENV_RANGE		(384 << 10) /* allow badblocks in env */
99ec246452SAndreas Bießmann 
1000dff13a9SAndreas Bießmann /* the loadaddr is the same as CONFIG_SYS_LOAD_ADDR, unfortunately the defiend
1010dff13a9SAndreas Bießmann  * value can not be used here! */
1020dff13a9SAndreas Bießmann #define CONFIG_LOADADDR		0x82000000
1030dff13a9SAndreas Bießmann 
104ec246452SAndreas Bießmann #define CONFIG_COMMON_ENV_SETTINGS \
1058167af14SThomas Weber 	"console=ttyO2,115200n8\0" \
1065605979aSThomas Weber 	"mmcdev=0\0" \
10783976f1dSThomas Weber 	"vram=3M\0" \
1088167af14SThomas Weber 	"defaultdisplay=lcd\0" \
109ec246452SAndreas Bießmann 	"kernelopts=mtdoops.mtddev=3\0" \
110deac6d66SAndreas Bießmann 	"mtdparts=" MTDPARTS_DEFAULT "\0" \
111deac6d66SAndreas Bießmann 	"mtdids=" MTDIDS_DEFAULT "\0" \
1128167af14SThomas Weber 	"commonargs=" \
1138167af14SThomas Weber 		"setenv bootargs console=${console} " \
1145c68f123SAndreas Bießmann 		"${mtdparts} " \
115ec246452SAndreas Bießmann 		"${kernelopts} " \
116ec246452SAndreas Bießmann 		"vt.global_cursor_default=0 " \
1178167af14SThomas Weber 		"vram=${vram} " \
118ec246452SAndreas Bießmann 		"omapdss.def_disp=${defaultdisplay}\0"
119ec246452SAndreas Bießmann 
120ec246452SAndreas Bießmann #define CONFIG_BOOTCOMMAND "run autoboot"
121ec246452SAndreas Bießmann 
122ec246452SAndreas Bießmann /* specific environment settings for different use cases
123ec246452SAndreas Bießmann  * FLASHCARD: used to run a rdimage from sdcard to program the device
124ec246452SAndreas Bießmann  * 'NORMAL': used to boot kernel from sdcard, nand, ...
125ec246452SAndreas Bießmann  *
126ec246452SAndreas Bießmann  * The main aim for the FLASHCARD skin is to have an embedded environment
127ec246452SAndreas Bießmann  * which will not be influenced by any data already on the device.
128ec246452SAndreas Bießmann  */
129ec246452SAndreas Bießmann #ifdef CONFIG_FLASHCARD
130ec246452SAndreas Bießmann /* the rdaddr is 16 MiB before the loadaddr */
131ec246452SAndreas Bießmann #define CONFIG_ENV_RDADDR	"rdaddr=0x81000000\0"
132ec246452SAndreas Bießmann 
133ec246452SAndreas Bießmann #define CONFIG_EXTRA_ENV_SETTINGS \
134ec246452SAndreas Bießmann 	CONFIG_COMMON_ENV_SETTINGS \
135ec246452SAndreas Bießmann 	CONFIG_ENV_RDADDR \
136ec246452SAndreas Bießmann 	"autoboot=" \
137ec246452SAndreas Bießmann 	"run commonargs; " \
138ec246452SAndreas Bießmann 	"setenv bootargs ${bootargs} " \
139ec246452SAndreas Bießmann 		"flashy_updateimg=/dev/mmcblk0p1:corscience_update.img " \
140ec246452SAndreas Bießmann 		"rdinit=/sbin/init; " \
141ec246452SAndreas Bießmann 	"mmc dev ${mmcdev}; mmc rescan; " \
142ec246452SAndreas Bießmann 	"fatload mmc ${mmcdev} ${loadaddr} uImage; " \
143ec246452SAndreas Bießmann 	"fatload mmc ${mmcdev} ${rdaddr} uRamdisk; " \
144ec246452SAndreas Bießmann 	"bootm ${loadaddr} ${rdaddr}\0"
145ec246452SAndreas Bießmann 
146ec246452SAndreas Bießmann #else /* CONFIG_FLASHCARD */
147ec246452SAndreas Bießmann 
148ec246452SAndreas Bießmann #define CONFIG_ENV_OVERWRITE /* allow to overwrite serial and ethaddr */
149ec246452SAndreas Bießmann 
150ec246452SAndreas Bießmann #define CONFIG_EXTRA_ENV_SETTINGS \
151ec246452SAndreas Bießmann 	CONFIG_COMMON_ENV_SETTINGS \
1528167af14SThomas Weber 	"mmcargs=" \
1538167af14SThomas Weber 		"run commonargs; " \
1548167af14SThomas Weber 		"setenv bootargs ${bootargs} " \
1558167af14SThomas Weber 		"root=/dev/mmcblk0p2 " \
156ec246452SAndreas Bießmann 		"rootwait " \
157ec246452SAndreas Bießmann 		"rw\0" \
1588167af14SThomas Weber 	"nandargs=" \
1598167af14SThomas Weber 		"run commonargs; " \
1608167af14SThomas Weber 		"setenv bootargs ${bootargs} " \
161008ec950SBernhard Walle 		"root=ubi0:root " \
1625c68f123SAndreas Bießmann 		"ubi.mtd=7 " \
1638167af14SThomas Weber 		"rootfstype=ubifs " \
164ec246452SAndreas Bießmann 		"ro\0" \
1655605979aSThomas Weber 	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
1668167af14SThomas Weber 	"bootscript=echo Running bootscript from mmc ...; " \
1678167af14SThomas Weber 		"source ${loadaddr}\0" \
1685605979aSThomas Weber 	"loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
1698167af14SThomas Weber 	"mmcboot=echo Booting from mmc ...; " \
1708167af14SThomas Weber 		"run mmcargs; " \
1718167af14SThomas Weber 		"bootm ${loadaddr}\0" \
172deac6d66SAndreas Bießmann 	"loaduimage_ubi=ubi part ubi; " \
173949a7710SJoe Hershberger 		"ubifsmount ubi:root; " \
174008ec950SBernhard Walle 		"ubifsload ${loadaddr} /boot/uImage\0" \
175eadbdf9eSAndreas Bießmann 	"loaduimage_nand=nand read ${loadaddr} kernel 0x500000\0" \
1768167af14SThomas Weber 	"nandboot=echo Booting from nand ...; " \
1778167af14SThomas Weber 		"run nandargs; " \
178eadbdf9eSAndreas Bießmann 		"run loaduimage_nand; " \
1798167af14SThomas Weber 		"bootm ${loadaddr}\0" \
18066968110SAndrew Bradford 	"autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \
1818167af14SThomas Weber 			"if run loadbootscript; then " \
1828167af14SThomas Weber 				"run bootscript; " \
1838167af14SThomas Weber 			"else " \
1848167af14SThomas Weber 				"if run loaduimage; then " \
1858167af14SThomas Weber 					"run mmcboot; " \
1868167af14SThomas Weber 				"else run nandboot; " \
1878167af14SThomas Weber 				"fi; " \
1888167af14SThomas Weber 			"fi; " \
1898167af14SThomas Weber 		"else run nandboot; fi\0"
1908167af14SThomas Weber 
191ec246452SAndreas Bießmann #endif /* CONFIG_FLASHCARD */
1928167af14SThomas Weber 
1938167af14SThomas Weber /* Miscellaneous configurable options */
1948167af14SThomas Weber #define CONFIG_SYS_LONGHELP		/* undef to save memory */
195ec246452SAndreas Bießmann #define CONFIG_CMDLINE_EDITING		/* enable cmdline history */
1968167af14SThomas Weber #define CONFIG_AUTO_COMPLETE
1978167af14SThomas Weber #define CONFIG_SYS_CBSIZE		512	/* Console I/O Buffer Size */
1988167af14SThomas Weber 
19969df69d1SThomas Weber #define CONFIG_SYS_MEMTEST_START	(OMAP34XX_SDRC_CS0 + 0x00000000)
2008167af14SThomas Weber #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START + \
20169df69d1SThomas Weber 					0x07000000) /* 112 MB */
2028167af14SThomas Weber 
2038167af14SThomas Weber #define CONFIG_SYS_LOAD_ADDR		(OMAP34XX_SDRC_CS0 + 0x02000000)
2048167af14SThomas Weber 
2058167af14SThomas Weber /*
2068167af14SThomas Weber  * OMAP3 has 12 GP timers, they can be driven by the system clock
2078167af14SThomas Weber  * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
2088167af14SThomas Weber  * This rate is divided by a local divisor.
2098167af14SThomas Weber  */
2108167af14SThomas Weber #define CONFIG_SYS_TIMERBASE		(OMAP34XX_GPT2)
2118167af14SThomas Weber #define CONFIG_SYS_PTV			2 /* Divisor: 2^(PTV+1) => 8 */
2128167af14SThomas Weber 
2138167af14SThomas Weber /*  Physical Memory Map  */
2148167af14SThomas Weber #define CONFIG_NR_DRAM_BANKS		2 /* CS1 may or may not be populated */
2158167af14SThomas Weber #define PHYS_SDRAM_1			OMAP34XX_SDRC_CS0
2168167af14SThomas Weber #define PHYS_SDRAM_2			OMAP34XX_SDRC_CS1
2178167af14SThomas Weber 
2188167af14SThomas Weber /* NAND and environment organization  */
2198167af14SThomas Weber #define CONFIG_SYS_MONITOR_LEN		(256 << 10)	/* Reserve 2 sectors */
2208167af14SThomas Weber 
2218167af14SThomas Weber #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
2228167af14SThomas Weber #define CONFIG_SYS_INIT_RAM_ADDR	0x4020f800
2238167af14SThomas Weber #define CONFIG_SYS_INIT_RAM_SIZE	0x800
2248167af14SThomas Weber #define CONFIG_SYS_INIT_SP_ADDR	(CONFIG_SYS_INIT_RAM_ADDR + \
2258167af14SThomas Weber 						CONFIG_SYS_INIT_RAM_SIZE - \
2268167af14SThomas Weber 						GENERATED_GBL_DATA_SIZE)
2278167af14SThomas Weber 
2288167af14SThomas Weber /* SRAM config */
2298167af14SThomas Weber #define CONFIG_SYS_SRAM_START		0x40200000
2308167af14SThomas Weber #define CONFIG_SYS_SRAM_SIZE		0x10000
2318167af14SThomas Weber 
2328167af14SThomas Weber /* Defines for SPL */
23347f7bcaeSTom Rini #define CONFIG_SPL_FRAMEWORK
2348167af14SThomas Weber 
2356f2f01b9SScott Wood #define CONFIG_SPL_NAND_BASE
2366f2f01b9SScott Wood #define CONFIG_SPL_NAND_DRIVERS
2376f2f01b9SScott Wood #define CONFIG_SPL_NAND_ECC
238205b4f33SGuillaume GARDET #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME        "u-boot.img"
239e2ccdf89SPaul Kocialkowski #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
2408167af14SThomas Weber 
2418167af14SThomas Weber #define CONFIG_SPL_TEXT_BASE		0x40200000 /*CONFIG_SYS_SRAM_START*/
242fa2f81b0STom Rini #define CONFIG_SPL_MAX_SIZE		(SRAM_SCRATCH_SPACE_ADDR - \
243fa2f81b0STom Rini 					 CONFIG_SPL_TEXT_BASE)
2448167af14SThomas Weber 
2458167af14SThomas Weber #define CONFIG_SPL_BSS_START_ADDR	0x80000000 /*CONFIG_SYS_SDRAM_BASE*/
2468167af14SThomas Weber #define CONFIG_SPL_BSS_MAX_SIZE		0x80000
2478167af14SThomas Weber 
2488167af14SThomas Weber /* NAND boot config */
2498167af14SThomas Weber #define CONFIG_SYS_NAND_5_ADDR_CYCLE
2508167af14SThomas Weber #define CONFIG_SYS_NAND_PAGE_COUNT	64
2518167af14SThomas Weber #define CONFIG_SYS_NAND_PAGE_SIZE	2048
2528167af14SThomas Weber #define CONFIG_SYS_NAND_OOBSIZE		64
2538167af14SThomas Weber #define CONFIG_SYS_NAND_BLOCK_SIZE	(128*1024)
2548167af14SThomas Weber #define CONFIG_SYS_NAND_BAD_BLOCK_POS	NAND_LARGE_BADBLOCK_POS
2551b82491eSAndreas Bießmann #define CONFIG_SYS_NAND_ECCPOS		{2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \
2561b82491eSAndreas Bießmann 					 13, 14, 16, 17, 18, 19, 20, 21, 22, \
2571b82491eSAndreas Bießmann 					 23, 24, 25, 26, 27, 28, 30, 31, 32, \
2581b82491eSAndreas Bießmann 					 33, 34, 35, 36, 37, 38, 39, 40, 41, \
2591b82491eSAndreas Bießmann 					 42, 44, 45, 46, 47, 48, 49, 50, 51, \
2601b82491eSAndreas Bießmann 					 52, 53, 54, 55, 56}
2618167af14SThomas Weber 
2628167af14SThomas Weber #define CONFIG_SYS_NAND_ECCSIZE		512
263616cf60eSAndreas Bießmann #define CONFIG_SYS_NAND_ECCBYTES	13
2643f719069Spekon gupta #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
2658167af14SThomas Weber 
2668167af14SThomas Weber #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_TEXT_BASE
2678167af14SThomas Weber 
2685c68f123SAndreas Bießmann #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x20000
2695c68f123SAndreas Bießmann #define CONFIG_SYS_NAND_U_BOOT_SIZE	0x100000
2708167af14SThomas Weber 
2718167af14SThomas Weber #define CONFIG_SYS_SPL_MALLOC_START	0x80208000
2728167af14SThomas Weber #define CONFIG_SYS_SPL_MALLOC_SIZE	0x100000	/* 1 MB */
2738167af14SThomas Weber 
27469df69d1SThomas Weber #define CONFIG_SYS_ALT_MEMTEST
27569df69d1SThomas Weber #define CONFIG_SYS_MEMTEST_SCRATCH	0x81000000
2768167af14SThomas Weber #endif /* __CONFIG_H */
277