xref: /openbmc/u-boot/include/configs/cm_t335.h (revision 9baa2bce28901321d6f62399b5ebeb3fcb8e8a57)
1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */
254e7445dSIlya Ledvich /*
354e7445dSIlya Ledvich  * Config file for Compulab CM-T335 board
454e7445dSIlya Ledvich  *
554e7445dSIlya Ledvich  * Copyright (C) 2013, Compulab Ltd - http://compulab.co.il/
654e7445dSIlya Ledvich  *
754e7445dSIlya Ledvich  * Author: Ilya Ledvich <ilya@compulab.co.il>
854e7445dSIlya Ledvich  */
954e7445dSIlya Ledvich 
1054e7445dSIlya Ledvich #ifndef __CONFIG_CM_T335_H
1154e7445dSIlya Ledvich #define __CONFIG_CM_T335_H
1254e7445dSIlya Ledvich 
1354e7445dSIlya Ledvich #define CONFIG_CM_T335
1454e7445dSIlya Ledvich 
1554e7445dSIlya Ledvich #include <configs/ti_am335x_common.h>
1654e7445dSIlya Ledvich 
1754e7445dSIlya Ledvich #undef CONFIG_MAX_RAM_BANK_SIZE
1854e7445dSIlya Ledvich #define CONFIG_MAX_RAM_BANK_SIZE	(512 << 20)	/* 512MB */
1954e7445dSIlya Ledvich 
2054e7445dSIlya Ledvich #define CONFIG_MACH_TYPE		MACH_TYPE_CM_T335
2154e7445dSIlya Ledvich 
2254e7445dSIlya Ledvich /* Clock Defines */
2354e7445dSIlya Ledvich #define V_OSCK				25000000  /* Clock output from T2 */
2454e7445dSIlya Ledvich #define V_SCLK				(V_OSCK)
2554e7445dSIlya Ledvich 
2654e7445dSIlya Ledvich #define CONFIG_ENV_SIZE			(16 << 10)	/* 16 KiB */
2754e7445dSIlya Ledvich 
2854e7445dSIlya Ledvich #ifndef CONFIG_SPL_BUILD
2954e7445dSIlya Ledvich #define MMCARGS \
3054e7445dSIlya Ledvich 	"mmcdev=0\0" \
3154e7445dSIlya Ledvich 	"mmcroot=/dev/mmcblk0p2 rw rootwait\0" \
3254e7445dSIlya Ledvich 	"mmcrootfstype=ext4\0" \
3354e7445dSIlya Ledvich 	"mmcargs=setenv bootargs console=${console} " \
3454e7445dSIlya Ledvich 		"root=${mmcroot} " \
3554e7445dSIlya Ledvich 		"rootfstype=${mmcrootfstype}\0" \
3654e7445dSIlya Ledvich 	"mmcboot=echo Booting from mmc ...; " \
3754e7445dSIlya Ledvich 		"run mmcargs; " \
3854e7445dSIlya Ledvich 		"bootm ${loadaddr}\0"
3954e7445dSIlya Ledvich 
4054e7445dSIlya Ledvich #define NANDARGS \
4143ede0bcSTom Rini 	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
4243ede0bcSTom Rini 	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
4354e7445dSIlya Ledvich 	"nandroot=ubi0:rootfs rw\0" \
4454e7445dSIlya Ledvich 	"nandrootfstype=ubifs\0" \
4554e7445dSIlya Ledvich 	"nandargs=setenv bootargs console=${console} " \
4654e7445dSIlya Ledvich 		"root=${nandroot} " \
4754e7445dSIlya Ledvich 		"rootfstype=${nandrootfstype} " \
4854e7445dSIlya Ledvich 		"ubi.mtd=${rootfs_name}\0" \
4954e7445dSIlya Ledvich 	"nandboot=echo Booting from nand ...; " \
5054e7445dSIlya Ledvich 		"run nandargs; " \
5154e7445dSIlya Ledvich 		"nboot ${loadaddr} nand0 900000; " \
5254e7445dSIlya Ledvich 		"bootm ${loadaddr}\0"
5354e7445dSIlya Ledvich 
5454e7445dSIlya Ledvich #define CONFIG_EXTRA_ENV_SETTINGS \
5554e7445dSIlya Ledvich 	"loadaddr=82000000\0" \
5654e7445dSIlya Ledvich 	"console=ttyO0,115200n8\0" \
5754e7445dSIlya Ledvich 	"rootfs_name=rootfs\0" \
5854e7445dSIlya Ledvich 	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
5954e7445dSIlya Ledvich 	"bootscript=echo Running bootscript from mmc ...; " \
6054e7445dSIlya Ledvich 		"source ${loadaddr}\0" \
6154e7445dSIlya Ledvich 	"loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
6254e7445dSIlya Ledvich 	MMCARGS \
6354e7445dSIlya Ledvich 	NANDARGS
6454e7445dSIlya Ledvich 
6554e7445dSIlya Ledvich #define CONFIG_BOOTCOMMAND \
6654e7445dSIlya Ledvich 	"mmc dev ${mmcdev}; if mmc rescan; then " \
6754e7445dSIlya Ledvich 		"if run loadbootscript; then " \
6854e7445dSIlya Ledvich 			"run bootscript; " \
6954e7445dSIlya Ledvich 		"else " \
7054e7445dSIlya Ledvich 			"if run loaduimage; then " \
7154e7445dSIlya Ledvich 				"run mmcboot; " \
7254e7445dSIlya Ledvich 			"else run nandboot; " \
7354e7445dSIlya Ledvich 			"fi; " \
7454e7445dSIlya Ledvich 		"fi; " \
7554e7445dSIlya Ledvich 	"else run nandboot; fi"
7654e7445dSIlya Ledvich #endif /* CONFIG_SPL_BUILD */
7754e7445dSIlya Ledvich 
7854e7445dSIlya Ledvich #define CONFIG_TIMESTAMP
7954e7445dSIlya Ledvich #define CONFIG_SYS_AUTOLOAD		"no"
8054e7445dSIlya Ledvich 
8154e7445dSIlya Ledvich /* Serial console configuration */
8254e7445dSIlya Ledvich 
8354e7445dSIlya Ledvich /* NS16550 Configuration */
8454e7445dSIlya Ledvich #define CONFIG_SYS_NS16550_COM1		0x44e09000	/* UART0 */
8554e7445dSIlya Ledvich #define CONFIG_SYS_NS16550_COM2		0x48022000	/* UART1 */
8654e7445dSIlya Ledvich 
8754e7445dSIlya Ledvich /* I2C Configuration */
8854e7445dSIlya Ledvich #define CONFIG_SYS_I2C_EEPROM_ADDR	0x50	/* Main EEPROM */
8954e7445dSIlya Ledvich #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	1
9052658fdaSNikita Kiryanov #define CONFIG_SYS_I2C_EEPROM_BUS	0
9154e7445dSIlya Ledvich 
9254e7445dSIlya Ledvich /* SPL */
9354e7445dSIlya Ledvich 
9454e7445dSIlya Ledvich /* Network. */
9554e7445dSIlya Ledvich #define CONFIG_PHY_ATHEROS
9654e7445dSIlya Ledvich 
9754e7445dSIlya Ledvich /* NAND support */
9854e7445dSIlya Ledvich #define CONFIG_SYS_NAND_5_ADDR_CYCLE
9954e7445dSIlya Ledvich #define CONFIG_SYS_NAND_PAGE_COUNT	(CONFIG_SYS_NAND_BLOCK_SIZE / \
10054e7445dSIlya Ledvich 					 CONFIG_SYS_NAND_PAGE_SIZE)
10154e7445dSIlya Ledvich #define CONFIG_SYS_NAND_PAGE_SIZE	2048
10254e7445dSIlya Ledvich #define CONFIG_SYS_NAND_OOBSIZE		64
10354e7445dSIlya Ledvich #define CONFIG_SYS_NAND_BLOCK_SIZE	(128 * 1024)
10454e7445dSIlya Ledvich #define CONFIG_SYS_NAND_BAD_BLOCK_POS	NAND_LARGE_BADBLOCK_POS
10554e7445dSIlya Ledvich #define CONFIG_SYS_NAND_ECCPOS		{ 2, 3, 4, 5, 6, 7, 8, 9, \
10654e7445dSIlya Ledvich 					 10, 11, 12, 13, 14, 15, 16, 17, \
10754e7445dSIlya Ledvich 					 18, 19, 20, 21, 22, 23, 24, 25, \
10854e7445dSIlya Ledvich 					 26, 27, 28, 29, 30, 31, 32, 33, \
10954e7445dSIlya Ledvich 					 34, 35, 36, 37, 38, 39, 40, 41, \
11054e7445dSIlya Ledvich 					 42, 43, 44, 45, 46, 47, 48, 49, \
11154e7445dSIlya Ledvich 					 50, 51, 52, 53, 54, 55, 56, 57, }
11254e7445dSIlya Ledvich 
11354e7445dSIlya Ledvich #define CONFIG_SYS_NAND_ECCSIZE		512
11454e7445dSIlya Ledvich #define CONFIG_SYS_NAND_ECCBYTES	14
11554e7445dSIlya Ledvich 
11654e7445dSIlya Ledvich #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_TEXT_BASE
11754e7445dSIlya Ledvich 
11854e7445dSIlya Ledvich #undef CONFIG_SYS_NAND_U_BOOT_OFFS
11954e7445dSIlya Ledvich #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x200000
12054e7445dSIlya Ledvich 
12154e7445dSIlya Ledvich #define CONFIG_ENV_OFFSET		0x300000 /* environment starts here */
12254e7445dSIlya Ledvich #define CONFIG_SYS_ENV_SECT_SIZE	(128 << 10)	/* 128 KiB */
12354e7445dSIlya Ledvich #define CONFIG_SYS_NAND_ONFI_DETECTION
124434f2cfcSpekon gupta #ifdef CONFIG_SPL_OS_BOOT
125434f2cfcSpekon gupta #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS	0x500000
126434f2cfcSpekon gupta #endif
12754e7445dSIlya Ledvich 
12854e7445dSIlya Ledvich /* GPIO pin + bank to pin ID mapping */
12954e7445dSIlya Ledvich #define GPIO_PIN(_bank, _pin)		((_bank << 5) + _pin)
13054e7445dSIlya Ledvich 
131e8ac22beSIlya Ledvich /* Status LED */
132e8ac22beSIlya Ledvich /* Status LED polarity is inversed, so init it in the "off" state */
133e8ac22beSIlya Ledvich 
1340e656b82SNikita Kiryanov /* EEPROM */
1350e656b82SNikita Kiryanov #define CONFIG_ENV_EEPROM_IS_ON_I2C
1360e656b82SNikita Kiryanov #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN		1
1370e656b82SNikita Kiryanov #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	4
1380e656b82SNikita Kiryanov #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	5
1390e656b82SNikita Kiryanov #define CONFIG_SYS_EEPROM_SIZE			256
1400e656b82SNikita Kiryanov 
141ef62df80SIlya Ledvich #ifndef CONFIG_SPL_BUILD
142ef62df80SIlya Ledvich /*
143ef62df80SIlya Ledvich  * Enable PCA9555 at I2C0-0x26.
144ef62df80SIlya Ledvich  * First select the I2C0 bus with "i2c dev 0", then use "pca953x" command.
145ef62df80SIlya Ledvich  */
146ef62df80SIlya Ledvich #define CONFIG_PCA953X
147ef62df80SIlya Ledvich #define CONFIG_SYS_I2C_PCA953X_ADDR	0x26
148ef62df80SIlya Ledvich #define CONFIG_SYS_I2C_PCA953X_WIDTH	{ {0x26, 16} }
149ef62df80SIlya Ledvich #endif /* CONFIG_SPL_BUILD */
150ef62df80SIlya Ledvich 
15154e7445dSIlya Ledvich #endif	/* __CONFIG_CM_T335_H */
15254e7445dSIlya Ledvich 
153