xref: /openbmc/u-boot/include/configs/cl-som-imx7.h (revision 66c433ed4342e5761ee9b048c85fe47d31130b2e)
1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */
26963204cSIlya Ledvich /*
36963204cSIlya Ledvich  * Copyright (C) 2015 CompuLab, Ltd.
46963204cSIlya Ledvich  *
56963204cSIlya Ledvich  * Configuration settings for the CompuLab CL-SOM-iMX7 System-on-Module.
66963204cSIlya Ledvich  */
76963204cSIlya Ledvich 
86963204cSIlya Ledvich #ifndef __CL_SOM_IMX7_CONFIG_H
96963204cSIlya Ledvich #define __CL_SOM_IMX7_CONFIG_H
106963204cSIlya Ledvich 
116963204cSIlya Ledvich #include "mx7_common.h"
126963204cSIlya Ledvich 
136963204cSIlya Ledvich #define CONFIG_MXC_UART_BASE            UART1_IPS_BASE_ADDR
146963204cSIlya Ledvich 
156963204cSIlya Ledvich /* Size of malloc() pool */
166963204cSIlya Ledvich #define CONFIG_SYS_MALLOC_LEN		(32 * SZ_1M)
176963204cSIlya Ledvich 
186963204cSIlya Ledvich #define CONFIG_BOARD_LATE_INIT
196963204cSIlya Ledvich 
206963204cSIlya Ledvich /* Uncomment to enable secure boot support */
216963204cSIlya Ledvich /* #define CONFIG_SECURE_BOOT */
226963204cSIlya Ledvich #define CONFIG_CSF_SIZE			0x4000
236963204cSIlya Ledvich 
246963204cSIlya Ledvich /* Network */
256963204cSIlya Ledvich #define CONFIG_FEC_MXC
266963204cSIlya Ledvich #define CONFIG_FEC_XCV_TYPE             RGMII
276963204cSIlya Ledvich #define CONFIG_ETHPRIME                 "FEC"
286963204cSIlya Ledvich #define CONFIG_FEC_MXC_PHYADDR          0
296963204cSIlya Ledvich 
306963204cSIlya Ledvich #define CONFIG_PHYLIB
316963204cSIlya Ledvich #define CONFIG_PHY_ATHEROS
326963204cSIlya Ledvich /* ENET1 */
336963204cSIlya Ledvich #define IMX_FEC_BASE			ENET_IPS_BASE_ADDR
346963204cSIlya Ledvich 
356963204cSIlya Ledvich /* PMIC */
366963204cSIlya Ledvich #define CONFIG_POWER
376963204cSIlya Ledvich #define CONFIG_POWER_I2C
386963204cSIlya Ledvich #define CONFIG_POWER_PFUZE3000
396963204cSIlya Ledvich #define CONFIG_POWER_PFUZE3000_I2C_ADDR	0x08
406963204cSIlya Ledvich 
416963204cSIlya Ledvich #undef CONFIG_BOOTM_NETBSD
426963204cSIlya Ledvich #undef CONFIG_BOOTM_PLAN9
436963204cSIlya Ledvich #undef CONFIG_BOOTM_RTEMS
446963204cSIlya Ledvich 
456963204cSIlya Ledvich /* I2C configs */
466963204cSIlya Ledvich #define CONFIG_SYS_I2C
476963204cSIlya Ledvich #define CONFIG_SYS_I2C_MXC
486963204cSIlya Ledvich #define CONFIG_SYS_I2C_MXC_I2C2		/* Enable I2C bus 2 */
496963204cSIlya Ledvich #define CONFIG_SYS_I2C_SPEED		100000
506963204cSIlya Ledvich #define SYS_I2C_BUS_SOM			0
516963204cSIlya Ledvich 
526963204cSIlya Ledvich #define CONFIG_SYS_I2C_EEPROM_ADDR	0x50
536963204cSIlya Ledvich #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	1
546963204cSIlya Ledvich #define CONFIG_SYS_I2C_EEPROM_BUS	SYS_I2C_BUS_SOM
556963204cSIlya Ledvich 
566963204cSIlya Ledvich #define CONFIG_PCA953X
576963204cSIlya Ledvich #define CONFIG_CMD_PCA953X
586963204cSIlya Ledvich #define CONFIG_SYS_I2C_PCA953X_ADDR	0x20
596963204cSIlya Ledvich #define CONFIG_SYS_I2C_PCA953X_WIDTH	{ {0x20, 16} }
606963204cSIlya Ledvich 
616963204cSIlya Ledvich #undef CONFIG_SYS_AUTOLOAD
626963204cSIlya Ledvich #undef CONFIG_EXTRA_ENV_SETTINGS
636963204cSIlya Ledvich #undef CONFIG_BOOTCOMMAND
646963204cSIlya Ledvich 
656963204cSIlya Ledvich #define CONFIG_SYS_AUTOLOAD		"no"
666963204cSIlya Ledvich 
676963204cSIlya Ledvich #define CONFIG_EXTRA_ENV_SETTINGS \
686963204cSIlya Ledvich 	"autoload=off\0" \
696963204cSIlya Ledvich 	"script=boot.scr\0" \
706963204cSIlya Ledvich 	"loadscript=load ${storagetype} ${storagedev} ${loadaddr} ${script};\0" \
716963204cSIlya Ledvich 	"loadkernel=load ${storagetype} ${storagedev} ${loadaddr} ${kernel};\0" \
726963204cSIlya Ledvich 	"loadfdt=load ${storagetype} ${storagedev} ${fdtaddr} ${fdtfile};\0" \
736963204cSIlya Ledvich 	"bootscript=echo Running bootscript from ${storagetype} ...; source ${loadaddr};\0" \
746963204cSIlya Ledvich 	"storagebootcmd=echo Booting from ${storagetype} ...; run ${storagetype}args; run doboot;\0" \
756963204cSIlya Ledvich 	"kernel=zImage\0" \
766963204cSIlya Ledvich 	"console=ttymxc0\0" \
776963204cSIlya Ledvich 	"fdt_high=0xffffffff\0" \
786963204cSIlya Ledvich 	"initrd_high=0xffffffff\0" \
796963204cSIlya Ledvich 	"fdtfile=imx7d-sbc-imx7.dtb\0" \
806963204cSIlya Ledvich 	"fdtaddr=0x83000000\0" \
816963204cSIlya Ledvich 	"mmcdev_def="__stringify(CONFIG_SYS_MMC_DEV)"\0" \
826963204cSIlya Ledvich 	"usbdev_def="__stringify(CONFIG_SYS_USB_DEV)"\0" \
836963204cSIlya Ledvich 	"mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
846963204cSIlya Ledvich 	"usbpart=" __stringify(CONFIG_SYS_USB_IMG_LOAD_PART) "\0" \
856963204cSIlya Ledvich 	"doboot=bootz ${loadaddr} - ${fdtaddr}\0" \
866963204cSIlya Ledvich 	"mmc_config=mmc dev ${mmcdev}; mmc rescan\0" \
876963204cSIlya Ledvich 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
886963204cSIlya Ledvich 		"root=/dev/mmcblk${mmcblk}p2 rootwait rw\0" \
896963204cSIlya Ledvich 	"mmcbootscript=" \
906963204cSIlya Ledvich 		"if run mmc_config; then " \
916963204cSIlya Ledvich 			"setenv storagetype mmc;" \
926963204cSIlya Ledvich 			"setenv storagedev ${mmcdev}:${mmcpart};" \
936963204cSIlya Ledvich 			"if run loadscript; then " \
946963204cSIlya Ledvich 				"run bootscript; " \
956963204cSIlya Ledvich 			"fi; " \
966963204cSIlya Ledvich 		"fi;\0" \
976963204cSIlya Ledvich 	"mmcboot=" \
986963204cSIlya Ledvich 		"if run mmc_config; then " \
996963204cSIlya Ledvich 			"setenv storagetype mmc;" \
1006963204cSIlya Ledvich 			"setenv storagedev ${mmcdev}:${mmcpart};" \
1016963204cSIlya Ledvich 			"if run loadkernel; then " \
1026963204cSIlya Ledvich 				"if run loadfdt; then " \
1036963204cSIlya Ledvich 					"run storagebootcmd;" \
1046963204cSIlya Ledvich 				"fi; " \
1056963204cSIlya Ledvich 			"fi; " \
1066963204cSIlya Ledvich 		"fi;\0" \
1076963204cSIlya Ledvich 	"sdbootscript=setenv mmcdev ${mmcdev_def}; setenv mmcblk 0; " \
1086963204cSIlya Ledvich 		"run mmcbootscript\0" \
1096963204cSIlya Ledvich 	"usbbootscript=setenv usbdev ${usbdev_def}; " \
1106963204cSIlya Ledvich 		"setenv storagetype usb;" \
1116963204cSIlya Ledvich 		"setenv storagedev ${usbdev}:${usbpart};" \
1126963204cSIlya Ledvich 		"if run loadscript; then " \
1136963204cSIlya Ledvich 			"run bootscript; " \
1146963204cSIlya Ledvich 		"fi; " \
1156963204cSIlya Ledvich 	"sdboot=setenv mmcdev ${mmcdev_def}; setenv mmcblk 0; run mmcboot\0" \
1166963204cSIlya Ledvich 	"emmcbootscript=setenv mmcdev 1; setenv mmcblk 2; run mmcbootscript\0" \
1176963204cSIlya Ledvich 	"emmcboot=setenv mmcdev 1; setenv mmcblk 2; run mmcboot\0" \
1186963204cSIlya Ledvich 
1196963204cSIlya Ledvich #define CONFIG_BOOTCOMMAND \
1206963204cSIlya Ledvich 	"echo SD boot attempt ...; run sdbootscript; run sdboot; " \
1216963204cSIlya Ledvich 	"echo eMMC boot attempt ...; run emmcbootscript; run emmcboot; " \
1226963204cSIlya Ledvich 	"echo USB boot attempt ...; run usbbootscript; "
1236963204cSIlya Ledvich 
1246963204cSIlya Ledvich #define CONFIG_SYS_MEMTEST_START	0x80000000
1256963204cSIlya Ledvich #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START + 0x20000000)
1266963204cSIlya Ledvich 
1276963204cSIlya Ledvich #define CONFIG_SYS_LOAD_ADDR		CONFIG_LOADADDR
1286963204cSIlya Ledvich #define CONFIG_SYS_HZ			1000
1296963204cSIlya Ledvich 
1306963204cSIlya Ledvich /* Physical Memory Map */
1316963204cSIlya Ledvich #define PHYS_SDRAM			MMDC0_ARB_BASE_ADDR
1326963204cSIlya Ledvich 
1336963204cSIlya Ledvich #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM
1346963204cSIlya Ledvich #define CONFIG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR
1356963204cSIlya Ledvich #define CONFIG_SYS_INIT_RAM_SIZE	IRAM_SIZE
1366963204cSIlya Ledvich 
1376963204cSIlya Ledvich #define CONFIG_SYS_INIT_SP_OFFSET \
1386963204cSIlya Ledvich 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
1396963204cSIlya Ledvich #define CONFIG_SYS_INIT_SP_ADDR \
1406963204cSIlya Ledvich 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
1416963204cSIlya Ledvich 
1426963204cSIlya Ledvich /* SPI Flash support */
1436963204cSIlya Ledvich 
1446963204cSIlya Ledvich /* FLASH and environment organization */
1456963204cSIlya Ledvich #define CONFIG_ENV_SIZE			SZ_8K
1466963204cSIlya Ledvich #define CONFIG_ENV_OFFSET		(768 * 1024)
1476963204cSIlya Ledvich #define CONFIG_ENV_SECT_SIZE		(64 * 1024)
1486963204cSIlya Ledvich 
1496963204cSIlya Ledvich /* MMC Config*/
1506963204cSIlya Ledvich #define CONFIG_FSL_USDHC
1516963204cSIlya Ledvich #ifdef CONFIG_FSL_USDHC
1526963204cSIlya Ledvich #define CONFIG_SYS_FSL_ESDHC_ADDR       USDHC1_BASE_ADDR
1536963204cSIlya Ledvich 
1546963204cSIlya Ledvich #define CONFIG_SYS_FSL_USDHC_NUM	2
1556963204cSIlya Ledvich #define CONFIG_MMCROOT			"/dev/mmcblk0p2" /* USDHC1 */
1566963204cSIlya Ledvich #define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */
1576963204cSIlya Ledvich #endif
1586963204cSIlya Ledvich 
1596963204cSIlya Ledvich /* USB Configs */
1606963204cSIlya Ledvich #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
1616963204cSIlya Ledvich #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
1626963204cSIlya Ledvich #define CONFIG_MXC_USB_FLAGS   0
1636963204cSIlya Ledvich #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
1646963204cSIlya Ledvich 
1656963204cSIlya Ledvich /* Uncomment to enable iMX thermal driver support */
1666963204cSIlya Ledvich /*#define CONFIG_IMX_THERMAL*/
1676963204cSIlya Ledvich 
1686963204cSIlya Ledvich /* SPL */
1696963204cSIlya Ledvich #include "imx7_spl.h"
1706963204cSIlya Ledvich #ifdef CONFIG_SPL_BUILD
1716963204cSIlya Ledvich #define CONFIG_SYS_SPI_U_BOOT_OFFS	(64 * 1024)
1726963204cSIlya Ledvich #endif /* CONFIG_SPL_BUILD */
1736963204cSIlya Ledvich 
1746963204cSIlya Ledvich #endif	/* __CONFIG_H */
175