1 /*
2  * Configuration settings for CompuLab CL-SOM-AM57x board
3  *
4  * (C) Copyright 2016 CompuLab, Ltd. http://compulab.co.il/
5  *
6  * Author: Dmitry Lifshitz <lifshitz@compulab.co.il>
7  *
8  * SPDX-License-Identifier:	GPL-2.0+
9  */
10 
11 #ifndef __CONFIG_CL_SOM_AM57X_H
12 #define __CONFIG_CL_SOM_AM57X_H
13 
14 #define CONFIG_NR_DRAM_BANKS		2
15 
16 #define CONSOLEDEV			"ttyO2"
17 #define CONFIG_SYS_NS16550_COM3		UART3_BASE	/* UART3 */
18 
19 #define CONFIG_SYS_OMAP_ABE_SYSCK
20 
21 #include <configs/ti_omap5_common.h>
22 
23 /* misc */
24 #define CONFIG_MISC_INIT_R
25 #define CONFIG_REVISION_TAG
26 
27 /* PMIC I2C bus number */
28 #define CONFIG_SYS_SPD_BUS_NUM 3
29 
30 /* SPI Flash support */
31 #define CONFIG_TI_SPI_MMAP
32 #define CONFIG_SF_DEFAULT_SPEED		48000000
33 #define CONFIG_DEFAULT_SPI_MODE		SPI_MODE_3
34 
35 /* SPI SPL defines */
36 /* Offsets: 0K - SPL1, 64K - SPL2, 128K - SPL3, 192K - SPL4, 256K - U-Boot */
37 #define CONFIG_SYS_SPI_U_BOOT_OFFS	(256 * 1024)
38 #define CONFIG_SPL_SPI_SUPPORT
39 #define CONFIG_SPL_SPI_FLASH_SUPPORT
40 #define CONFIG_SPL_SPI_LOAD
41 
42 /* SD/MMC RAW/FS boot */
43 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
44 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
45 
46 /* Environment */
47 #define CONFIG_ENV_SIZE			(16 << 10) /* 16 KiB env size */
48 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
49 
50 #define CONFIG_ENV_SECT_SIZE		(64 * 1024)
51 #define CONFIG_ENV_OFFSET		(768 * 1024)
52 #define CONFIG_ENV_SPI_MAX_HZ		48000000
53 
54 /* EEPROM */
55 #define CONFIG_SYS_I2C_EEPROM_ADDR      0x50
56 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN  1
57 #define CONFIG_SYS_I2C_EEPROM_BUS       3
58 
59 #define CONFIG_ENV_EEPROM_IS_ON_I2C
60 #define CONFIG_SYS_EEPROM_SIZE		256
61 
62 #ifndef CONFIG_SPL_BUILD
63 /* SATA */
64 #define CONFIG_SCSI_AHCI_PLAT
65 #define CONFIG_SYS_SCSI_MAX_SCSI_ID	1
66 #define CONFIG_SYS_SCSI_MAX_LUN		1
67 #define CONFIG_SYS_SCSI_MAX_DEVICE	(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
68 						CONFIG_SYS_SCSI_MAX_LUN)
69 /* PCA9555 GPIO expander support */
70 #define CONFIG_PCA953X
71 #define CONFIG_SYS_I2C_PCA953X_ADDR     0x20
72 #define CONFIG_SYS_I2C_PCA953X_WIDTH    { {0x20, 16} }
73 
74 #endif /* !CONFIG_SPL_BUILD */
75 
76 /* USB xHCI HOST */
77 #define CONFIG_USB_XHCI_OMAP
78 
79 #define CONFIG_OMAP_USB3PHY1_HOST
80 
81 /* USB Networking options */
82 
83 /* CPSW Ethernet */
84 #define CONFIG_DRIVER_TI_CPSW
85 #define CONFIG_MII
86 #define CONFIG_BOOTP_DEFAULT
87 #define CONFIG_BOOTP_SEND_HOSTNAME
88 #define CONFIG_PHY_ATHEROS
89 #define CONFIG_SYS_RX_ETH_BUFFER	64
90 #define PHY_ANEG_TIMEOUT		8000
91 
92 #define CONFIG_BOOTP_DNS2
93 #define CONFIG_NET_RETRY_COUNT		10
94 
95 /* Default environment */
96 #undef CONFIG_EXTRA_ENV_SETTINGS
97 #define CONFIG_EXTRA_ENV_SETTINGS \
98 	DEFAULT_LINUX_BOOT_ENV \
99 	"autoload=no\0" \
100 	"baudrate=115200\0" \
101 	"console=ttyO2,115200n8\0" \
102 	"bootdelay=3\0" \
103 	"fdtfile=am57xx-sbc-am57x.dtb\0" \
104 	"kernel=zImage-cl-som-am57x\0" \
105 	"bootscr=bootscr.img\0" \
106 	"displaytype=hdmi\0" \
107 	"bootkernel=bootz ${loadaddr} - ${fdtaddr}\0" \
108 	"mmcloadfdt=load mmc ${mmcdev} ${fdtaddr} ${fdtfile}\0" \
109 	"mmcloadkernel=load mmc ${mmcdev} ${loadaddr} ${kernel}\0" \
110 	"emmcloadfdt=load mmc ${mmcdev} ${fdtaddr} ${fdtfile}\0" \
111 	"emmcloadkernel=load mmc ${mmcdev} ${loadaddr} ${kernel}\0" \
112 	"load_mmc=mmc dev ${mmcdev} && mmc rescan && " \
113 		"run mmcloadkernel && run mmcloadfdt\0" \
114 	"mmcroot=/dev/mmcblk1p2\0" \
115 	"mmcrootfstype=ext4 rw rootwait\0" \
116 	"mmcargs=setenv bootargs console=${console} root=${mmcroot} " \
117 		"rootfstype=${mmcrootfstype}\0" \
118 	"mmcbootscript=setenv mmcdev 0; mmc dev ${mmcdev} && mmc rescan && " \
119 		"load mmc ${mmcdev} ${loadaddr} ${bootscr} && " \
120 		"echo Running bootscript from MMC/SD Card ... && " \
121 		"source ${loadaddr}\0" \
122 	"mmcboot=setenv mmcdev 0 && run load_mmc && " \
123 		"run mmcargs && echo Booting from MMC/SD Card ... && " \
124 		"run bootkernel\0" \
125 	"emmcroot=/dev/mmcblk0p2\0" \
126 	"emmcrootfstype=ext4 rw rootwait\0" \
127 	"emmcargs=setenv bootargs console=${console} " \
128 		"root=${emmcroot} " \
129 		"rootfstype=${emmcrootfstype}\0" \
130 	"emmcbootscript=setenv mmcdev 1; mmc dev ${mmcdev} && mmc rescan && " \
131 		"load mmc ${mmcdev} ${loadaddr} ${bootscr} && " \
132 		"echo Running bootscript from eMMC ... && " \
133 		"source ${loadaddr}\0" \
134 	"emmcboot=setenv mmcdev 1 && run load_mmc && " \
135 		"run emmcargs && echo Booting from eMMC ... && " \
136 		"run bootkernel\0" \
137 	"sataroot=/dev/sda2\0" \
138 	"satarootfstype=ext4 rw rootwait\0" \
139 	"load_sata=load scsi 0 ${loadaddr} ${kernel} && " \
140 		"load scsi 0 ${fdtaddr} ${fdtfile}\0" \
141 	"sataargs=setenv bootargs console=${console} " \
142 		"root=${sataroot} " \
143 		"rootfstype=${satarootfstype}\0" \
144 	"satabootscript=load scsi 0 ${loadaddr} ${bootscr} && " \
145 		"echo Running bootscript from SATA ... && " \
146 		"source ${loadaddr}\0" \
147 	"sataboot=run load_sata && run sataargs && " \
148 		"echo Booting from SATA ... && " \
149 		"run bootkernel\0"
150 
151 #undef CONFIG_BOOTCOMMAND
152 #define CONFIG_BOOTCOMMAND \
153 	"run mmcbootscript || run mmcboot || " \
154 	"run satabootscript || run sataboot || " \
155 	"run emmcbootscript || run emmcboot"
156 
157 
158 #endif /* __CONFIG_CL_SOM_AM57X_H */
159