xref: /openbmc/u-boot/include/configs/tricorder.h (revision 9baa2bce28901321d6f62399b5ebeb3fcb8e8a57)
1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */
28167af14SThomas Weber /*
38167af14SThomas Weber  * (C) Copyright 2006-2008
48167af14SThomas Weber  * Texas Instruments.
58167af14SThomas Weber  * Richard Woodruff <r-woodruff2@ti.com>
68167af14SThomas Weber  * Syed Mohammed Khasim <x0khasim@ti.com>
78167af14SThomas Weber  *
88167af14SThomas Weber  * (C) Copyright 2012
98167af14SThomas Weber  * Corscience GmbH & Co. KG
108167af14SThomas Weber  * Thomas Weber <weber@corscience.de>
118167af14SThomas Weber  *
128167af14SThomas Weber  * Configuration settings for the Tricorder board.
138167af14SThomas Weber  */
148167af14SThomas Weber 
158167af14SThomas Weber #ifndef __CONFIG_H
168167af14SThomas Weber #define __CONFIG_H
178167af14SThomas Weber 
1894ba26f2STom Rini #define CONFIG_MACH_TYPE		MACH_TYPE_TRICORDER
198167af14SThomas Weber /*
208167af14SThomas Weber  * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
218167af14SThomas Weber  * 64 bytes before this address should be set aside for u-boot.img's
228167af14SThomas Weber  * header. That is 0x800FFFC0--0x80100000 should not be used for any
238167af14SThomas Weber  * other needs.
248167af14SThomas Weber  */
258167af14SThomas Weber 
268167af14SThomas Weber #include <asm/arch/cpu.h>		/* get chip and board defs */
27987ec585SNishanth Menon #include <asm/arch/omap.h>
288167af14SThomas Weber 
298167af14SThomas Weber /* Clock Defines */
308167af14SThomas Weber #define V_OSCK				26000000 /* Clock output from T2 */
318167af14SThomas Weber #define V_SCLK				(V_OSCK >> 1)
328167af14SThomas Weber 
338167af14SThomas Weber #define CONFIG_CMDLINE_TAG		/* enable passing of ATAGs */
348167af14SThomas Weber #define CONFIG_SETUP_MEMORY_TAGS
358167af14SThomas Weber #define CONFIG_INITRD_TAG
368167af14SThomas Weber #define CONFIG_REVISION_TAG
378167af14SThomas Weber 
388167af14SThomas Weber /* Size of malloc() pool */
3936f3aab2SBernhard Walle #define CONFIG_SYS_MALLOC_LEN		(1024*1024)
408167af14SThomas Weber 
418167af14SThomas Weber /* Hardware drivers */
428167af14SThomas Weber 
438167af14SThomas Weber /* NS16550 Configuration */
448167af14SThomas Weber #define CONFIG_SYS_NS16550_SERIAL
458167af14SThomas Weber #define CONFIG_SYS_NS16550_REG_SIZE	(-4)
468167af14SThomas Weber #define CONFIG_SYS_NS16550_CLK		48000000 /* 48MHz (APLL96/2) */
478167af14SThomas Weber 
488167af14SThomas Weber /* select serial console configuration */
498167af14SThomas Weber #define CONFIG_SYS_NS16550_COM3		OMAP34XX_UART3
508167af14SThomas Weber #define CONFIG_SYS_BAUDRATE_TABLE	{4800, 9600, 19200, 38400, 57600,\
518167af14SThomas Weber 					115200}
528167af14SThomas Weber 
538167af14SThomas Weber /* I2C */
546789e84eSHeiko Schocher #define CONFIG_SYS_I2C
556789e84eSHeiko Schocher 
56459f1da8SAndreas Bießmann 
57459f1da8SAndreas Bießmann /* EEPROM */
58459f1da8SAndreas Bießmann #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	2
59459f1da8SAndreas Bießmann #define CONFIG_SYS_EEPROM_BUS_NUM	1
608167af14SThomas Weber 
618167af14SThomas Weber /* TWL4030 */
628167af14SThomas Weber 
638167af14SThomas Weber /* Board NAND Info */
648167af14SThomas Weber #define CONFIG_SYS_NAND_BASE		NAND_BASE	/* physical address */
658167af14SThomas Weber 							/* to access nand at */
668167af14SThomas Weber 							/* CS0 */
678167af14SThomas Weber #define CONFIG_SYS_MAX_NAND_DEVICE	1		/* Max number of NAND */
688167af14SThomas Weber 							/* devices */
6968ec9c85SPrabhakar Kushwaha #define CONFIG_SYS_NAND_MAX_OOBFREE	2
7068ec9c85SPrabhakar Kushwaha #define CONFIG_SYS_NAND_MAX_ECCPOS	56
718167af14SThomas Weber 
728167af14SThomas Weber /* needed for ubi */
738167af14SThomas Weber 
74ec246452SAndreas Bießmann /* Environment information (this is the common part) */
758167af14SThomas Weber 
768167af14SThomas Weber 
7789088058SAndreas Bießmann /* hang() the board on panic() */
7889088058SAndreas Bießmann 
79ec246452SAndreas Bießmann /* environment placement (for NAND), is different for FLASHCARD but does not
80ec246452SAndreas Bießmann  * harm there */
81ec246452SAndreas Bießmann #define CONFIG_ENV_OFFSET		0x120000    /* env start */
82ec246452SAndreas Bießmann #define CONFIG_ENV_OFFSET_REDUND	0x2A0000    /* redundant env start */
83ec246452SAndreas Bießmann #define CONFIG_ENV_SIZE			(16 << 10)  /* use 16KiB for env */
84ec246452SAndreas Bießmann #define CONFIG_ENV_RANGE		(384 << 10) /* allow badblocks in env */
85ec246452SAndreas Bießmann 
860dff13a9SAndreas Bießmann /* the loadaddr is the same as CONFIG_SYS_LOAD_ADDR, unfortunately the defiend
870dff13a9SAndreas Bießmann  * value can not be used here! */
880dff13a9SAndreas Bießmann #define CONFIG_LOADADDR		0x82000000
890dff13a9SAndreas Bießmann 
90ec246452SAndreas Bießmann #define CONFIG_COMMON_ENV_SETTINGS \
918167af14SThomas Weber 	"console=ttyO2,115200n8\0" \
925605979aSThomas Weber 	"mmcdev=0\0" \
9383976f1dSThomas Weber 	"vram=3M\0" \
948167af14SThomas Weber 	"defaultdisplay=lcd\0" \
95ec246452SAndreas Bießmann 	"kernelopts=mtdoops.mtddev=3\0" \
9643ede0bcSTom Rini 	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
9743ede0bcSTom Rini 	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
988167af14SThomas Weber 	"commonargs=" \
998167af14SThomas Weber 		"setenv bootargs console=${console} " \
1005c68f123SAndreas Bießmann 		"${mtdparts} " \
101ec246452SAndreas Bießmann 		"${kernelopts} " \
102ec246452SAndreas Bießmann 		"vt.global_cursor_default=0 " \
1038167af14SThomas Weber 		"vram=${vram} " \
104ec246452SAndreas Bießmann 		"omapdss.def_disp=${defaultdisplay}\0"
105ec246452SAndreas Bießmann 
106ec246452SAndreas Bießmann #define CONFIG_BOOTCOMMAND "run autoboot"
107ec246452SAndreas Bießmann 
108ec246452SAndreas Bießmann /* specific environment settings for different use cases
109ec246452SAndreas Bießmann  * FLASHCARD: used to run a rdimage from sdcard to program the device
110ec246452SAndreas Bießmann  * 'NORMAL': used to boot kernel from sdcard, nand, ...
111ec246452SAndreas Bießmann  *
112ec246452SAndreas Bießmann  * The main aim for the FLASHCARD skin is to have an embedded environment
113ec246452SAndreas Bießmann  * which will not be influenced by any data already on the device.
114ec246452SAndreas Bießmann  */
115ec246452SAndreas Bießmann #ifdef CONFIG_FLASHCARD
116ec246452SAndreas Bießmann /* the rdaddr is 16 MiB before the loadaddr */
117ec246452SAndreas Bießmann #define CONFIG_ENV_RDADDR	"rdaddr=0x81000000\0"
118ec246452SAndreas Bießmann 
119ec246452SAndreas Bießmann #define CONFIG_EXTRA_ENV_SETTINGS \
120ec246452SAndreas Bießmann 	CONFIG_COMMON_ENV_SETTINGS \
121ec246452SAndreas Bießmann 	CONFIG_ENV_RDADDR \
122ec246452SAndreas Bießmann 	"autoboot=" \
123ec246452SAndreas Bießmann 	"run commonargs; " \
124ec246452SAndreas Bießmann 	"setenv bootargs ${bootargs} " \
125ec246452SAndreas Bießmann 		"flashy_updateimg=/dev/mmcblk0p1:corscience_update.img " \
126ec246452SAndreas Bießmann 		"rdinit=/sbin/init; " \
127ec246452SAndreas Bießmann 	"mmc dev ${mmcdev}; mmc rescan; " \
128ec246452SAndreas Bießmann 	"fatload mmc ${mmcdev} ${loadaddr} uImage; " \
129ec246452SAndreas Bießmann 	"fatload mmc ${mmcdev} ${rdaddr} uRamdisk; " \
130ec246452SAndreas Bießmann 	"bootm ${loadaddr} ${rdaddr}\0"
131ec246452SAndreas Bießmann 
132ec246452SAndreas Bießmann #else /* CONFIG_FLASHCARD */
133ec246452SAndreas Bießmann 
134ec246452SAndreas Bießmann #define CONFIG_ENV_OVERWRITE /* allow to overwrite serial and ethaddr */
135ec246452SAndreas Bießmann 
136ec246452SAndreas Bießmann #define CONFIG_EXTRA_ENV_SETTINGS \
137ec246452SAndreas Bießmann 	CONFIG_COMMON_ENV_SETTINGS \
1388167af14SThomas Weber 	"mmcargs=" \
1398167af14SThomas Weber 		"run commonargs; " \
1408167af14SThomas Weber 		"setenv bootargs ${bootargs} " \
1418167af14SThomas Weber 		"root=/dev/mmcblk0p2 " \
142ec246452SAndreas Bießmann 		"rootwait " \
143ec246452SAndreas Bießmann 		"rw\0" \
1448167af14SThomas Weber 	"nandargs=" \
1458167af14SThomas Weber 		"run commonargs; " \
1468167af14SThomas Weber 		"setenv bootargs ${bootargs} " \
147008ec950SBernhard Walle 		"root=ubi0:root " \
1485c68f123SAndreas Bießmann 		"ubi.mtd=7 " \
1498167af14SThomas Weber 		"rootfstype=ubifs " \
150ec246452SAndreas Bießmann 		"ro\0" \
1515605979aSThomas Weber 	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
1528167af14SThomas Weber 	"bootscript=echo Running bootscript from mmc ...; " \
1538167af14SThomas Weber 		"source ${loadaddr}\0" \
1545605979aSThomas Weber 	"loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
1558167af14SThomas Weber 	"mmcboot=echo Booting from mmc ...; " \
1568167af14SThomas Weber 		"run mmcargs; " \
1578167af14SThomas Weber 		"bootm ${loadaddr}\0" \
158deac6d66SAndreas Bießmann 	"loaduimage_ubi=ubi part ubi; " \
159949a7710SJoe Hershberger 		"ubifsmount ubi:root; " \
160008ec950SBernhard Walle 		"ubifsload ${loadaddr} /boot/uImage\0" \
161eadbdf9eSAndreas Bießmann 	"loaduimage_nand=nand read ${loadaddr} kernel 0x500000\0" \
1628167af14SThomas Weber 	"nandboot=echo Booting from nand ...; " \
1638167af14SThomas Weber 		"run nandargs; " \
164eadbdf9eSAndreas Bießmann 		"run loaduimage_nand; " \
1658167af14SThomas Weber 		"bootm ${loadaddr}\0" \
16666968110SAndrew Bradford 	"autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \
1678167af14SThomas Weber 			"if run loadbootscript; then " \
1688167af14SThomas Weber 				"run bootscript; " \
1698167af14SThomas Weber 			"else " \
1708167af14SThomas Weber 				"if run loaduimage; then " \
1718167af14SThomas Weber 					"run mmcboot; " \
1728167af14SThomas Weber 				"else run nandboot; " \
1738167af14SThomas Weber 				"fi; " \
1748167af14SThomas Weber 			"fi; " \
1758167af14SThomas Weber 		"else run nandboot; fi\0"
1768167af14SThomas Weber 
177ec246452SAndreas Bießmann #endif /* CONFIG_FLASHCARD */
1788167af14SThomas Weber 
1798167af14SThomas Weber /* Miscellaneous configurable options */
1808167af14SThomas Weber #define CONFIG_SYS_CBSIZE		512	/* Console I/O Buffer Size */
1818167af14SThomas Weber 
18269df69d1SThomas Weber #define CONFIG_SYS_MEMTEST_START	(OMAP34XX_SDRC_CS0 + 0x00000000)
1838167af14SThomas Weber #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START + \
18469df69d1SThomas Weber 					0x07000000) /* 112 MB */
1858167af14SThomas Weber 
1868167af14SThomas Weber #define CONFIG_SYS_LOAD_ADDR		(OMAP34XX_SDRC_CS0 + 0x02000000)
1878167af14SThomas Weber 
1888167af14SThomas Weber /*
1898167af14SThomas Weber  * OMAP3 has 12 GP timers, they can be driven by the system clock
1908167af14SThomas Weber  * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
1918167af14SThomas Weber  * This rate is divided by a local divisor.
1928167af14SThomas Weber  */
1938167af14SThomas Weber #define CONFIG_SYS_TIMERBASE		(OMAP34XX_GPT2)
1948167af14SThomas Weber #define CONFIG_SYS_PTV			2 /* Divisor: 2^(PTV+1) => 8 */
1958167af14SThomas Weber 
1968167af14SThomas Weber /*  Physical Memory Map  */
1978167af14SThomas Weber #define PHYS_SDRAM_1			OMAP34XX_SDRC_CS0
1988167af14SThomas Weber #define PHYS_SDRAM_2			OMAP34XX_SDRC_CS1
1998167af14SThomas Weber 
2008167af14SThomas Weber /* NAND and environment organization  */
2018167af14SThomas Weber #define CONFIG_SYS_MONITOR_LEN		(256 << 10)	/* Reserve 2 sectors */
2028167af14SThomas Weber 
2038167af14SThomas Weber #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
2048167af14SThomas Weber #define CONFIG_SYS_INIT_RAM_ADDR	0x4020f800
2058167af14SThomas Weber #define CONFIG_SYS_INIT_RAM_SIZE	0x800
2068167af14SThomas Weber #define CONFIG_SYS_INIT_SP_ADDR	(CONFIG_SYS_INIT_RAM_ADDR + \
2078167af14SThomas Weber 						CONFIG_SYS_INIT_RAM_SIZE - \
2088167af14SThomas Weber 						GENERATED_GBL_DATA_SIZE)
2098167af14SThomas Weber 
2108167af14SThomas Weber /* SRAM config */
2118167af14SThomas Weber #define CONFIG_SYS_SRAM_START		0x40200000
2128167af14SThomas Weber #define CONFIG_SYS_SRAM_SIZE		0x10000
2138167af14SThomas Weber 
2148167af14SThomas Weber /* Defines for SPL */
2158167af14SThomas Weber 
2166f2f01b9SScott Wood #define CONFIG_SPL_NAND_BASE
2176f2f01b9SScott Wood #define CONFIG_SPL_NAND_DRIVERS
2186f2f01b9SScott Wood #define CONFIG_SPL_NAND_ECC
219205b4f33SGuillaume GARDET #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME        "u-boot.img"
220e2ccdf89SPaul Kocialkowski #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
2218167af14SThomas Weber 
2228167af14SThomas Weber #define CONFIG_SPL_TEXT_BASE		0x40200000 /*CONFIG_SYS_SRAM_START*/
223fa2f81b0STom Rini #define CONFIG_SPL_MAX_SIZE		(SRAM_SCRATCH_SPACE_ADDR - \
224fa2f81b0STom Rini 					 CONFIG_SPL_TEXT_BASE)
2258167af14SThomas Weber 
2268167af14SThomas Weber #define CONFIG_SPL_BSS_START_ADDR	0x80000000 /*CONFIG_SYS_SDRAM_BASE*/
2278167af14SThomas Weber #define CONFIG_SPL_BSS_MAX_SIZE		0x80000
2288167af14SThomas Weber 
2298167af14SThomas Weber /* NAND boot config */
2308167af14SThomas Weber #define CONFIG_SYS_NAND_5_ADDR_CYCLE
2318167af14SThomas Weber #define CONFIG_SYS_NAND_PAGE_COUNT	64
2328167af14SThomas Weber #define CONFIG_SYS_NAND_PAGE_SIZE	2048
2338167af14SThomas Weber #define CONFIG_SYS_NAND_OOBSIZE		64
2348167af14SThomas Weber #define CONFIG_SYS_NAND_BLOCK_SIZE	(128*1024)
2358167af14SThomas Weber #define CONFIG_SYS_NAND_BAD_BLOCK_POS	NAND_LARGE_BADBLOCK_POS
2361b82491eSAndreas Bießmann #define CONFIG_SYS_NAND_ECCPOS		{2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \
2371b82491eSAndreas Bießmann 					 13, 14, 16, 17, 18, 19, 20, 21, 22, \
2381b82491eSAndreas Bießmann 					 23, 24, 25, 26, 27, 28, 30, 31, 32, \
2391b82491eSAndreas Bießmann 					 33, 34, 35, 36, 37, 38, 39, 40, 41, \
2401b82491eSAndreas Bießmann 					 42, 44, 45, 46, 47, 48, 49, 50, 51, \
2411b82491eSAndreas Bießmann 					 52, 53, 54, 55, 56}
2428167af14SThomas Weber 
2438167af14SThomas Weber #define CONFIG_SYS_NAND_ECCSIZE		512
244616cf60eSAndreas Bießmann #define CONFIG_SYS_NAND_ECCBYTES	13
2453f719069Spekon gupta #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
2468167af14SThomas Weber 
2478167af14SThomas Weber #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_TEXT_BASE
2488167af14SThomas Weber 
2495c68f123SAndreas Bießmann #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x20000
2505c68f123SAndreas Bießmann #define CONFIG_SYS_NAND_U_BOOT_SIZE	0x100000
2518167af14SThomas Weber 
2528167af14SThomas Weber #define CONFIG_SYS_SPL_MALLOC_START	0x80208000
2538167af14SThomas Weber #define CONFIG_SYS_SPL_MALLOC_SIZE	0x100000	/* 1 MB */
2548167af14SThomas Weber 
25569df69d1SThomas Weber #define CONFIG_SYS_MEMTEST_SCRATCH	0x81000000
2568167af14SThomas Weber #endif /* __CONFIG_H */
257