4e56ffce7aa0d584a6d1f73a1255012f84fc01a6
[karo-tx-uboot.git] / include / configs / am43xx_evm.h
1 /*
2  * am43xx_evm.h
3  *
4  * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
5  *
6  * SPDX-License-Identifier:     GPL-2.0+
7  */
8
9 #ifndef __CONFIG_AM43XX_EVM_H
10 #define __CONFIG_AM43XX_EVM_H
11
12 #define CONFIG_AM43XX
13
14 #define CONFIG_BOARD_LATE_INIT
15 #define CONFIG_ARCH_CPU_INIT
16 #define CONFIG_SYS_CACHELINE_SIZE       32
17 #define CONFIG_MAX_RAM_BANK_SIZE        (1024 << 20)    /* 1GB */
18 #define CONFIG_SYS_TIMERBASE            0x48040000      /* Use Timer2 */
19
20 #include <asm/arch/omap.h>
21
22 /* NS16550 Configuration */
23 #define CONFIG_SYS_NS16550
24 #define CONFIG_SYS_NS16550_SERIAL
25 #define CONFIG_SYS_NS16550_REG_SIZE     (-4)
26 #define CONFIG_SYS_NS16550_CLK          48000000
27
28 /* I2C Configuration */
29 #define CONFIG_CMD_EEPROM
30 #define CONFIG_ENV_EEPROM_IS_ON_I2C
31 #define CONFIG_SYS_I2C_EEPROM_ADDR      0x50    /* Main EEPROM */
32 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN  2
33 #define CONFIG_SYS_I2C_MULTI_EEPROMS
34
35 /* SPL defines. */
36 #define CONFIG_SPL_TEXT_BASE            0x40300350
37 #define CONFIG_SPL_MAX_SIZE             (220 << 10)     /* 220KB */
38 #define CONFIG_SYS_SPL_ARGS_ADDR        (CONFIG_SYS_SDRAM_BASE + \
39                                          (128 << 20))
40 #define CONFIG_SPL_YMODEM_SUPPORT
41
42 /* Enabling L2 Cache */
43 #define CONFIG_SYS_L2_PL310
44 #define CONFIG_SYS_PL310_BASE   0x48242000
45 #define CONFIG_SYS_CACHELINE_SIZE       32
46
47 /*
48  * Since SPL did pll and ddr initialization for us,
49  * we don't need to do it twice.
50  */
51 #if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_NOR_BOOT)
52 #define CONFIG_SKIP_LOWLEVEL_INIT
53 #endif
54
55 /* Now bring in the rest of the common code. */
56 #include <configs/ti_armv7_common.h>
57
58 /* Always 128 KiB env size */
59 #define CONFIG_ENV_SIZE                 (128 << 10)
60
61 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
62
63 /* Clock Defines */
64 #define V_OSCK                          24000000  /* Clock output from T2 */
65 #define V_SCLK                          (V_OSCK)
66
67 /* NS16550 Configuration */
68 #define CONFIG_SYS_NS16550_COM1         0x44e09000      /* Base EVM has UART0 */
69
70 #define CONFIG_ENV_IS_NOWHERE
71
72 #define CONFIG_SPL_LDSCRIPT             "$(CPUDIR)/omap-common/u-boot-spl.lds"
73
74 /* SPL USB Support */
75 #define CONFIG_SPL_USB_SUPPORT
76 #define CONFIG_SPL_USB_HOST_SUPPORT
77 #define CONFIG_SYS_USB_FAT_BOOT_PARTITION               1
78
79 #define CONFIG_CMD_USB
80 #define CONFIG_USB_HOST
81 #define CONFIG_USB_XHCI
82 #define CONFIG_USB_XHCI_OMAP
83 #define CONFIG_USB_STORAGE
84 #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 2
85
86 #define CONFIG_OMAP_USB_PHY
87 #define CONFIG_AM437X_USB2PHY2_HOST
88
89 /* SPI */
90 #undef CONFIG_OMAP3_SPI
91 #define CONFIG_TI_QSPI
92 #define CONFIG_SPI_FLASH
93 #define CONFIG_SPI_FLASH_MACRONIX
94 #define CONFIG_CMD_SF
95 #define CONFIG_CMD_SPI
96 #define CONFIG_TI_SPI_MMAP
97 #define CONFIG_QSPI_SEL_GPIO                   48
98 #define CONFIG_SF_DEFAULT_SPEED                48000000
99 #define CONFIG_DEFAULT_SPI_MODE                SPI_MODE_3
100
101 /* SPI SPL */
102 #define CONFIG_SPL_SPI_SUPPORT
103 #define CONFIG_SPL_SPI_LOAD
104 #define CONFIG_SPL_SPI_FLASH_SUPPORT
105 #define CONFIG_SPL_SPI_BUS             0
106 #define CONFIG_SPL_SPI_CS              0
107 #define CONFIG_SYS_SPI_U_BOOT_OFFS     0x20000
108
109 /* Enhance our eMMC support / experience. */
110 #define CONFIG_CMD_GPT
111 #define CONFIG_EFI_PARTITION
112 #define CONFIG_PARTITION_UUIDS
113 #define CONFIG_CMD_PART
114
115 #ifndef CONFIG_SPL_BUILD
116 #define CONFIG_EXTRA_ENV_SETTINGS \
117         DEFAULT_LINUX_BOOT_ENV \
118         "fdtfile=undefined\0" \
119         "bootpart=0:2\0" \
120         "bootdir=/boot\0" \
121         "bootfile=zImage\0" \
122         "console=ttyO0,115200n8\0" \
123         "partitions=" \
124                 "uuid_disk=${uuid_gpt_disk};" \
125                 "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
126         "optargs=\0" \
127         "mmcdev=0\0" \
128         "mmcroot=/dev/mmcblk0p2 rw\0" \
129         "mmcrootfstype=ext4 rootwait\0" \
130         "usbroot=/dev/sda2 rw\0" \
131         "usbrootfstype=ext4 rootwait\0" \
132         "usbdev=0\0" \
133         "ramroot=/dev/ram0 rw\0" \
134         "ramrootfstype=ext2\0" \
135         "mmcargs=setenv bootargs console=${console} " \
136                 "${optargs} " \
137                 "root=${mmcroot} " \
138                 "rootfstype=${mmcrootfstype}\0" \
139         "usbargs=setenv bootargs console=${console} " \
140                 "${optargs} " \
141                 "root=${usbroot} " \
142                 "rootfstype=${usbrootfstype}\0" \
143         "bootenv=uEnv.txt\0" \
144         "loadbootenv=load ${devtype} ${devnum} ${loadaddr} ${bootenv}\0" \
145         "importbootenv=echo Importing environment from mmc ...; " \
146                 "env import -t $loadaddr $filesize\0" \
147         "ramargs=setenv bootargs console=${console} " \
148                 "${optargs} " \
149                 "root=${ramroot} " \
150                 "rootfstype=${ramrootfstype}\0" \
151         "loadramdisk=load ${devtype} ${devnum} ${rdaddr} ramdisk.gz\0" \
152         "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
153         "loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
154         "mmcboot=mmc dev ${mmcdev}; " \
155                 "setenv devnum ${mmcdev}; " \
156                 "if mmc rescan; then " \
157                         "echo SD/MMC found on device ${devnum};" \
158                         "if run loadbootenv; then " \
159                                 "echo Loaded environment from ${bootenv};" \
160                                 "run importbootenv;" \
161                         "fi;" \
162                         "if test -n $uenvcmd; then " \
163                                 "echo Running uenvcmd ...;" \
164                                 "run uenvcmd;" \
165                         "fi;" \
166                         "if run loadimage; then " \
167                                 "run loadfdt; " \
168                                 "echo Booting from mmc${mmcdev} ...; " \
169                                 "run mmcargs; " \
170                                 "bootz ${loadaddr} - ${fdtaddr}; " \
171                         "fi;" \
172                 "fi;\0" \
173         "usbboot=" \
174                 "setenv devnum ${usbdev}; " \
175                 "setenv devtype usb; " \
176                 "usb start ${usbdev}; " \
177                 "if usb dev ${usbdev}; then " \
178                         "if run loadbootenv; then " \
179                                 "echo Loaded environment from ${bootenv};" \
180                                 "run importbootenv;" \
181                         "fi;" \
182                         "if test -n $uenvcmd; then " \
183                                 "echo Running uenvcmd ...;" \
184                                 "run uenvcmd;" \
185                         "fi;" \
186                         "if run loadimage; then " \
187                                 "run loadfdt; " \
188                                 "echo Booting from usb ${usbdev}...; " \
189                                 "run usbargs;" \
190                                 "bootz ${loadaddr} - ${fdtaddr}; " \
191                         "fi;" \
192                 "fi\0" \
193         "findfdt="\
194                 "if test $board_name = AM43EPOS; then " \
195                         "setenv fdtfile am43x-epos-evm.dtb; fi; " \
196                 "if test $board_name = AM43__GP; then " \
197                         "setenv fdtfile am437x-gp-evm.dtb; fi; " \
198                 "if test $fdtfile = undefined; then " \
199                         "echo WARNING: Could not determine device tree; fi; \0"
200
201 #define CONFIG_BOOTCOMMAND \
202         "run findfdt; " \
203         "run mmcboot;" \
204         "run usbboot;"
205
206 #endif
207
208 /* CPSW Ethernet */
209 #define CONFIG_CMD_NET
210 #define CONFIG_CMD_DHCP
211 #define CONFIG_CMD_PING
212 #define CONFIG_CMD_MII
213 #define CONFIG_DRIVER_TI_CPSW
214 #define CONFIG_MII
215 #define CONFIG_BOOTP_DEFAULT
216 #define CONFIG_BOOTP_DNS
217 #define CONFIG_BOOTP_DNS2
218 #define CONFIG_BOOTP_SEND_HOSTNAME
219 #define CONFIG_BOOTP_GATEWAY
220 #define CONFIG_BOOTP_SUBNETMASK
221 #define CONFIG_NET_RETRY_COUNT          10
222 #define CONFIG_NET_MULTI
223 #define CONFIG_PHY_GIGE
224 #define CONFIG_PHYLIB
225
226 #define CONFIG_SPL_ENV_SUPPORT
227 #define CONFIG_SPL_NET_VCI_STRING       "AM43xx U-Boot SPL"
228
229 #define CONFIG_SPL_ETH_SUPPORT
230 #define CONFIG_SPL_NET_SUPPORT
231 #define CONFIG_SYS_RX_ETH_BUFFER        64
232
233 #endif  /* __CONFIG_AM43XX_EVM_H */