xref: /rk3399_rockchip-uboot/include/configs/tricorder.h (revision 008ec95054c170859e7a2dfdf87ce15e2e6cd017)
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  *
138167af14SThomas Weber  * See file CREDITS for list of people who contributed to this
148167af14SThomas Weber  * project.
158167af14SThomas Weber  *
168167af14SThomas Weber  * This program is free software; you can redistribute it and/or
178167af14SThomas Weber  * modify it under the terms of the GNU General Public License as
188167af14SThomas Weber  * published by the Free Software Foundation; either version 2 of
198167af14SThomas Weber  * the License, or (at your option) any later version.
208167af14SThomas Weber  *
218167af14SThomas Weber  * This program is distributed in the hope that it will be useful,
228167af14SThomas Weber  * but WITHOUT ANY WARRANTY; without even the implied warranty of
238167af14SThomas Weber  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
248167af14SThomas Weber  * GNU General Public License for more details.
258167af14SThomas Weber  *
268167af14SThomas Weber  * You should have received a copy of the GNU General Public License
278167af14SThomas Weber  * along with this program; if not, write to the Free Software
288167af14SThomas Weber  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
298167af14SThomas Weber  * MA 02111-1307 USA
308167af14SThomas Weber  */
318167af14SThomas Weber 
328167af14SThomas Weber #ifndef __CONFIG_H
338167af14SThomas Weber #define __CONFIG_H
348167af14SThomas Weber 
358167af14SThomas Weber /* High Level Configuration Options */
368167af14SThomas Weber #define CONFIG_OMAP			/* in a TI OMAP core */
378167af14SThomas Weber #define CONFIG_OMAP34XX			/* which is a 34XX */
388167af14SThomas Weber 
398167af14SThomas Weber #define CONFIG_MACH_TYPE		MACH_TYPE_TRICORDER
408167af14SThomas Weber /*
418167af14SThomas Weber  * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
428167af14SThomas Weber  * 64 bytes before this address should be set aside for u-boot.img's
438167af14SThomas Weber  * header. That is 0x800FFFC0--0x80100000 should not be used for any
448167af14SThomas Weber  * other needs.
458167af14SThomas Weber  */
468167af14SThomas Weber #define CONFIG_SYS_TEXT_BASE		0x80100000
478167af14SThomas Weber 
488167af14SThomas Weber #define CONFIG_SDRC			/* The chip has SDRC controller */
498167af14SThomas Weber 
508167af14SThomas Weber #include <asm/arch/cpu.h>		/* get chip and board defs */
518167af14SThomas Weber #include <asm/arch/omap3.h>
528167af14SThomas Weber 
538167af14SThomas Weber /* Display CPU and Board information */
548167af14SThomas Weber #define CONFIG_DISPLAY_CPUINFO
558167af14SThomas Weber #define CONFIG_DISPLAY_BOARDINFO
568167af14SThomas Weber 
578167af14SThomas Weber /* Clock Defines */
588167af14SThomas Weber #define V_OSCK				26000000 /* Clock output from T2 */
598167af14SThomas Weber #define V_SCLK				(V_OSCK >> 1)
608167af14SThomas Weber 
618167af14SThomas Weber #undef CONFIG_USE_IRQ			/* no support for IRQs */
628167af14SThomas Weber #define CONFIG_MISC_INIT_R
638167af14SThomas Weber 
648167af14SThomas Weber #define CONFIG_CMDLINE_TAG		/* enable passing of ATAGs */
658167af14SThomas Weber #define CONFIG_SETUP_MEMORY_TAGS
668167af14SThomas Weber #define CONFIG_INITRD_TAG
678167af14SThomas Weber #define CONFIG_REVISION_TAG
688167af14SThomas Weber 
698167af14SThomas Weber #define CONFIG_OF_LIBFDT
708167af14SThomas Weber 
718167af14SThomas Weber /* Size of malloc() pool */
728167af14SThomas Weber #define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB */
738167af14SThomas Weber 						/* Sector */
7436f3aab2SBernhard Walle #define CONFIG_SYS_MALLOC_LEN		(1024*1024)
758167af14SThomas Weber 
768167af14SThomas Weber /* Hardware drivers */
778167af14SThomas Weber 
788167af14SThomas Weber /* NS16550 Configuration */
798167af14SThomas Weber #define CONFIG_SYS_NS16550
808167af14SThomas Weber #define CONFIG_SYS_NS16550_SERIAL
818167af14SThomas Weber #define CONFIG_SYS_NS16550_REG_SIZE	(-4)
828167af14SThomas Weber #define CONFIG_SYS_NS16550_CLK		48000000 /* 48MHz (APLL96/2) */
838167af14SThomas Weber 
848167af14SThomas Weber /* select serial console configuration */
858167af14SThomas Weber #define CONFIG_CONS_INDEX		3
868167af14SThomas Weber #define CONFIG_SYS_NS16550_COM3		OMAP34XX_UART3
878167af14SThomas Weber #define CONFIG_SERIAL3			3
888167af14SThomas Weber #define CONFIG_BAUDRATE			115200
898167af14SThomas Weber #define CONFIG_SYS_BAUDRATE_TABLE	{4800, 9600, 19200, 38400, 57600,\
908167af14SThomas Weber 					115200}
918167af14SThomas Weber 
928167af14SThomas Weber /* MMC */
938167af14SThomas Weber #define CONFIG_GENERIC_MMC
948167af14SThomas Weber #define CONFIG_MMC
958167af14SThomas Weber #define CONFIG_OMAP_HSMMC
968167af14SThomas Weber #define CONFIG_DOS_PARTITION
978167af14SThomas Weber 
988167af14SThomas Weber /* I2C */
998167af14SThomas Weber #define CONFIG_HARD_I2C
1008167af14SThomas Weber #define CONFIG_SYS_I2C_SPEED		100000
1018167af14SThomas Weber #define CONFIG_SYS_I2C_SLAVE		1
1028167af14SThomas Weber #define CONFIG_SYS_I2C_BUS		0
1038167af14SThomas Weber #define CONFIG_SYS_I2C_BUS_SELECT	1
1048167af14SThomas Weber #define CONFIG_DRIVER_OMAP34XX_I2C	1
1058167af14SThomas Weber 
1068167af14SThomas Weber /* TWL4030 */
1078167af14SThomas Weber #define CONFIG_TWL4030_POWER
1088167af14SThomas Weber #define CONFIG_TWL4030_LED
1098167af14SThomas Weber 
1108167af14SThomas Weber /* Board NAND Info */
1118167af14SThomas Weber #define CONFIG_SYS_NO_FLASH		/* no NOR flash */
1128167af14SThomas Weber #define CONFIG_MTD_DEVICE		/* needed for mtdparts commands */
1138167af14SThomas Weber #define MTDIDS_DEFAULT			"nand0=nand"
1148167af14SThomas Weber #define MTDPARTS_DEFAULT		"mtdparts=nand:" \
1158167af14SThomas Weber 						"512k(u-boot-spl)," \
1168167af14SThomas Weber 						"1920k(u-boot)," \
1178167af14SThomas Weber 						"128k(u-boot-env)," \
1188167af14SThomas Weber 						"4m(kernel)," \
1198167af14SThomas Weber 						"-(fs)"
1208167af14SThomas Weber 
1218167af14SThomas Weber #define CONFIG_NAND_OMAP_GPMC
1228167af14SThomas Weber #define CONFIG_SYS_NAND_ADDR		NAND_BASE	/* physical address */
1238167af14SThomas Weber 							/* to access nand */
1248167af14SThomas Weber #define CONFIG_SYS_NAND_BASE		NAND_BASE	/* physical address */
1258167af14SThomas Weber 							/* to access nand at */
1268167af14SThomas Weber 							/* CS0 */
1278167af14SThomas Weber #define GPMC_NAND_ECC_LP_x16_LAYOUT	1
1288167af14SThomas Weber 
1298167af14SThomas Weber #define CONFIG_SYS_MAX_NAND_DEVICE	1		/* Max number of NAND */
1308167af14SThomas Weber 							/* devices */
1318167af14SThomas Weber 
1328167af14SThomas Weber /* commands to include */
1338167af14SThomas Weber #include <config_cmd_default.h>
1348167af14SThomas Weber 
1358167af14SThomas Weber #define CONFIG_CMD_EXT2			/* EXT2 Support */
1368167af14SThomas Weber #define CONFIG_CMD_FAT			/* FAT support */
1378167af14SThomas Weber #define CONFIG_CMD_I2C			/* I2C serial bus support */
1388167af14SThomas Weber #define CONFIG_CMD_MMC			/* MMC support */
1398167af14SThomas Weber #define CONFIG_CMD_MTDPARTS		/* Enable MTD parts commands */
1408167af14SThomas Weber #define CONFIG_CMD_NAND			/* NAND support */
1418167af14SThomas Weber #define CONFIG_CMD_NAND_LOCK_UNLOCK	/* nand (un)lock commands */
14236f3aab2SBernhard Walle #define CONFIG_CMD_UBI			/* UBI commands */
14336f3aab2SBernhard Walle #define CONFIG_CMD_UBIFS		/* UBIFS commands */
14436f3aab2SBernhard Walle #define CONFIG_LZO			/* LZO is needed for UBIFS */
1458167af14SThomas Weber 
1468167af14SThomas Weber #undef CONFIG_CMD_NET
1478167af14SThomas Weber #undef CONFIG_CMD_NFS
1488167af14SThomas Weber #undef CONFIG_CMD_FPGA			/* FPGA configuration Support */
1498167af14SThomas Weber #undef CONFIG_CMD_IMI			/* iminfo */
1508167af14SThomas Weber #undef CONFIG_CMD_JFFS2			/* JFFS2 Support */
1518167af14SThomas Weber 
1528167af14SThomas Weber /* needed for ubi */
1538167af14SThomas Weber #define CONFIG_RBTREE
1548167af14SThomas Weber #define CONFIG_MTD_DEVICE       /* needed for mtdparts commands */
1558167af14SThomas Weber #define CONFIG_MTD_PARTITIONS
1568167af14SThomas Weber 
1578167af14SThomas Weber /* Environment information */
1588167af14SThomas Weber #define CONFIG_ENV_OVERWRITE /* allow to overwrite serial and ethaddr */
1598167af14SThomas Weber 
1608167af14SThomas Weber #define CONFIG_BOOTDELAY		3
1618167af14SThomas Weber 
1628167af14SThomas Weber #define CONFIG_EXTRA_ENV_SETTINGS \
1638167af14SThomas Weber 	"loadaddr=0x82000000\0" \
1648167af14SThomas Weber 	"console=ttyO2,115200n8\0" \
1655605979aSThomas Weber 	"mmcdev=0\0" \
1668167af14SThomas Weber 	"vram=12M\0" \
1678167af14SThomas Weber 	"lcdmode=800x600\0" \
1688167af14SThomas Weber 	"defaultdisplay=lcd\0" \
1698167af14SThomas Weber 	"kernelopts=rw rootwait\0" \
1708167af14SThomas Weber 	"commonargs=" \
1718167af14SThomas Weber 		"setenv bootargs console=${console} " \
1728167af14SThomas Weber 		"vram=${vram} " \
1738167af14SThomas Weber 		"omapfb.mode=lcd:${lcdmode} " \
1748167af14SThomas Weber 		"omapdss.def_disp=${defaultdisplay}\0" \
1758167af14SThomas Weber 	"mmcargs=" \
1768167af14SThomas Weber 		"run commonargs; " \
1778167af14SThomas Weber 		"setenv bootargs ${bootargs} " \
1788167af14SThomas Weber 		"root=/dev/mmcblk0p2 " \
1798167af14SThomas Weber 		"${kernelopts}\0" \
1808167af14SThomas Weber 	"nandargs=" \
1818167af14SThomas Weber 		"run commonargs; " \
1828167af14SThomas Weber 		"setenv bootargs ${bootargs} " \
1838167af14SThomas Weber 		"omapfb.mode=lcd:${lcdmode} " \
1848167af14SThomas Weber 		"omapdss.def_disp=${defaultdisplay} " \
185*008ec950SBernhard Walle 		"root=ubi0:root " \
186*008ec950SBernhard Walle 		"ubi.mtd=4 " \
1878167af14SThomas Weber 		"rootfstype=ubifs " \
1888167af14SThomas Weber 		"${kernelopts}\0" \
1895605979aSThomas Weber 	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
1908167af14SThomas Weber 	"bootscript=echo Running bootscript from mmc ...; " \
1918167af14SThomas Weber 		"source ${loadaddr}\0" \
1925605979aSThomas Weber 	"loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
1938167af14SThomas Weber 	"eraseenv=nand unlock 0x260000 0x20000; nand erase 0x260000 0x20000\0" \
1948167af14SThomas Weber 	"mmcboot=echo Booting from mmc ...; " \
1958167af14SThomas Weber 		"run mmcargs; " \
1968167af14SThomas Weber 		"bootm ${loadaddr}\0" \
197*008ec950SBernhard Walle 	"loaduimage_ubi=mtd default; " \
198*008ec950SBernhard Walle 		"ubi part fs; " \
199*008ec950SBernhard Walle 		"ubifsmount root; " \
200*008ec950SBernhard Walle 		"ubifsload ${loadaddr} /boot/uImage\0" \
2018167af14SThomas Weber 	"nandboot=echo Booting from nand ...; " \
2028167af14SThomas Weber 		"run nandargs; " \
203*008ec950SBernhard Walle 		"run loaduimage_ubi; " \
2048167af14SThomas Weber 		"bootm ${loadaddr}\0" \
2055605979aSThomas Weber 	"autoboot=if mmc rescan ${mmcdev}; then " \
2068167af14SThomas Weber 			"if run loadbootscript; then " \
2078167af14SThomas Weber 				"run bootscript; " \
2088167af14SThomas Weber 			"else " \
2098167af14SThomas Weber 				"if run loaduimage; then " \
2108167af14SThomas Weber 					"run mmcboot; " \
2118167af14SThomas Weber 				"else run nandboot; " \
2128167af14SThomas Weber 				"fi; " \
2138167af14SThomas Weber 			"fi; " \
2148167af14SThomas Weber 		"else run nandboot; fi\0"
2158167af14SThomas Weber 
2168167af14SThomas Weber 
2178167af14SThomas Weber #define CONFIG_BOOTCOMMAND "run autoboot"
2188167af14SThomas Weber 
2198167af14SThomas Weber /* Miscellaneous configurable options */
2208167af14SThomas Weber #define CONFIG_SYS_LONGHELP		/* undef to save memory */
2218167af14SThomas Weber #define CONFIG_SYS_HUSH_PARSER		/* use "hush" command parser */
2228167af14SThomas Weber #define CONFIG_AUTO_COMPLETE
2238167af14SThomas Weber #define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
2248167af14SThomas Weber #define CONFIG_SYS_PROMPT		"OMAP3 Tricorder # "
2258167af14SThomas Weber #define CONFIG_SYS_CBSIZE		512	/* Console I/O Buffer Size */
2268167af14SThomas Weber /* Print Buffer Size */
2278167af14SThomas Weber #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
2288167af14SThomas Weber 					sizeof(CONFIG_SYS_PROMPT) + 16)
2298167af14SThomas Weber #define CONFIG_SYS_MAXARGS		16	/* max number of command args */
2308167af14SThomas Weber 
2318167af14SThomas Weber /* Boot Argument Buffer Size */
2328167af14SThomas Weber #define CONFIG_SYS_BARGSIZE		(CONFIG_SYS_CBSIZE)
2338167af14SThomas Weber 
2348167af14SThomas Weber #define CONFIG_SYS_MEMTEST_START	(OMAP34XX_SDRC_CS0 + 0x07000000)
2358167af14SThomas Weber #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START + \
2368167af14SThomas Weber 					0x01000000) /* 16MB */
2378167af14SThomas Weber 
2388167af14SThomas Weber #define CONFIG_SYS_LOAD_ADDR		(OMAP34XX_SDRC_CS0 + 0x02000000)
2398167af14SThomas Weber 
2408167af14SThomas Weber /*
2418167af14SThomas Weber  * OMAP3 has 12 GP timers, they can be driven by the system clock
2428167af14SThomas Weber  * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
2438167af14SThomas Weber  * This rate is divided by a local divisor.
2448167af14SThomas Weber  */
2458167af14SThomas Weber #define CONFIG_SYS_TIMERBASE		(OMAP34XX_GPT2)
2468167af14SThomas Weber #define CONFIG_SYS_PTV			2 /* Divisor: 2^(PTV+1) => 8 */
2478167af14SThomas Weber #define CONFIG_SYS_HZ			1000
2488167af14SThomas Weber 
2498167af14SThomas Weber /* The stack sizes are set up in start.S using the settings below */
2508167af14SThomas Weber #define CONFIG_STACKSIZE		(128 << 10) /* regular stack 128 KiB */
2518167af14SThomas Weber 
2528167af14SThomas Weber /*  Physical Memory Map  */
2538167af14SThomas Weber #define CONFIG_NR_DRAM_BANKS		2 /* CS1 may or may not be populated */
2548167af14SThomas Weber #define PHYS_SDRAM_1			OMAP34XX_SDRC_CS0
2558167af14SThomas Weber #define PHYS_SDRAM_1_SIZE		(128 << 20)	/* at least 128 MiB */
2568167af14SThomas Weber #define PHYS_SDRAM_2			OMAP34XX_SDRC_CS1
2578167af14SThomas Weber 
2588167af14SThomas Weber /* NAND and environment organization  */
2598167af14SThomas Weber #define PISMO1_NAND_SIZE		GPMC_SIZE_128M
2608167af14SThomas Weber 
2618167af14SThomas Weber #define CONFIG_SYS_MONITOR_LEN		(256 << 10)	/* Reserve 2 sectors */
2628167af14SThomas Weber 
2638167af14SThomas Weber #define CONFIG_ENV_IS_IN_NAND		1
2648167af14SThomas Weber #define CONFIG_ENV_OFFSET		0x260000 /* environment starts here */
2658167af14SThomas Weber 
2668167af14SThomas Weber #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
2678167af14SThomas Weber #define CONFIG_SYS_INIT_RAM_ADDR	0x4020f800
2688167af14SThomas Weber #define CONFIG_SYS_INIT_RAM_SIZE	0x800
2698167af14SThomas Weber #define CONFIG_SYS_INIT_SP_ADDR	(CONFIG_SYS_INIT_RAM_ADDR + \
2708167af14SThomas Weber 						CONFIG_SYS_INIT_RAM_SIZE - \
2718167af14SThomas Weber 						GENERATED_GBL_DATA_SIZE)
2728167af14SThomas Weber 
2738167af14SThomas Weber /* SRAM config */
2748167af14SThomas Weber #define CONFIG_SYS_SRAM_START		0x40200000
2758167af14SThomas Weber #define CONFIG_SYS_SRAM_SIZE		0x10000
2768167af14SThomas Weber 
2778167af14SThomas Weber /* Defines for SPL */
2788167af14SThomas Weber #define CONFIG_SPL
2798167af14SThomas Weber #define CONFIG_SPL_NAND_SIMPLE
2808167af14SThomas Weber 
2818167af14SThomas Weber #define CONFIG_SPL_LIBCOMMON_SUPPORT
2828167af14SThomas Weber #define CONFIG_SPL_LIBDISK_SUPPORT
2838167af14SThomas Weber #define CONFIG_SPL_I2C_SUPPORT
2848167af14SThomas Weber #define CONFIG_SPL_LIBGENERIC_SUPPORT
2858167af14SThomas Weber #define CONFIG_SPL_SERIAL_SUPPORT
2868167af14SThomas Weber #define CONFIG_SPL_POWER_SUPPORT
2878167af14SThomas Weber #define CONFIG_SPL_NAND_SUPPORT
2888167af14SThomas Weber #define CONFIG_SPL_MMC_SUPPORT
2898167af14SThomas Weber #define CONFIG_SPL_FAT_SUPPORT
2908167af14SThomas Weber #define CONFIG_SPL_LDSCRIPT		"$(CPUDIR)/omap-common/u-boot-spl.lds"
2918167af14SThomas Weber #define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME        "u-boot.img"
2928167af14SThomas Weber #define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION    1
2938167af14SThomas Weber #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
2948167af14SThomas Weber 
2958167af14SThomas Weber #define CONFIG_SPL_TEXT_BASE		0x40200000 /*CONFIG_SYS_SRAM_START*/
2968167af14SThomas Weber #define CONFIG_SPL_MAX_SIZE		0xB400  /* 45 K */
2978167af14SThomas Weber #define CONFIG_SPL_STACK		LOW_LEVEL_SRAM_STACK
2988167af14SThomas Weber 
2998167af14SThomas Weber #define CONFIG_SPL_BSS_START_ADDR	0x80000000 /*CONFIG_SYS_SDRAM_BASE*/
3008167af14SThomas Weber #define CONFIG_SPL_BSS_MAX_SIZE		0x80000
3018167af14SThomas Weber 
3028167af14SThomas Weber /* NAND boot config */
3038167af14SThomas Weber #define CONFIG_SYS_NAND_5_ADDR_CYCLE
3048167af14SThomas Weber #define CONFIG_SYS_NAND_PAGE_COUNT	64
3058167af14SThomas Weber #define CONFIG_SYS_NAND_PAGE_SIZE	2048
3068167af14SThomas Weber #define CONFIG_SYS_NAND_OOBSIZE		64
3078167af14SThomas Weber #define CONFIG_SYS_NAND_BLOCK_SIZE	(128*1024)
3088167af14SThomas Weber #define CONFIG_SYS_NAND_BAD_BLOCK_POS	NAND_LARGE_BADBLOCK_POS
3098167af14SThomas Weber #define CONFIG_SYS_NAND_ECCPOS		{2, 3, 4, 5, 6, 7, 8, 9,\
3108167af14SThomas Weber 						10, 11, 12, 13}
3118167af14SThomas Weber 
3128167af14SThomas Weber #define CONFIG_SYS_NAND_ECCSIZE		512
3138167af14SThomas Weber #define CONFIG_SYS_NAND_ECCBYTES	3
3148167af14SThomas Weber 
3158167af14SThomas Weber #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_TEXT_BASE
3168167af14SThomas Weber 
3178167af14SThomas Weber #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x80000
3188167af14SThomas Weber #define CONFIG_SYS_NAND_U_BOOT_SIZE	0x200000
3198167af14SThomas Weber 
3208167af14SThomas Weber #define CONFIG_SYS_SPL_MALLOC_START	0x80208000
3218167af14SThomas Weber #define CONFIG_SYS_SPL_MALLOC_SIZE	0x100000	/* 1 MB */
3228167af14SThomas Weber 
3238167af14SThomas Weber #endif /* __CONFIG_H */
324