blob: d5e6c4b0dc729bfc9437cd1225583d72ff992606 [file] [log] [blame]
Lokesh Vutla4c682f62013-07-30 11:36:32 +05301/*
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
Lokesh Vutlab82e6e92013-12-10 15:02:12 +053013
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 */
Lokesh Vutla4c682f62013-07-30 11:36:32 +053019
20#include <asm/arch/omap.h>
21
Lokesh Vutlab82e6e92013-12-10 15:02:12 +053022/* 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
Lokesh Vutla4c682f62013-07-30 11:36:32 +053027
Sekhar Nori2ab3c492013-12-10 15:02:15 +053028/* 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
Lokesh Vutlab82e6e92013-12-10 15:02:12 +053035/* SPL defines. */
36#define CONFIG_SPL_TEXT_BASE 0x40300350
Tom Rinia14fb572014-01-20 08:40:07 -050037#define CONFIG_SPL_MAX_SIZE (220 << 10) /* 220KB */
Tom Rinid9f808d2014-04-03 07:52:53 -040038#define CONFIG_SYS_SPL_ARGS_ADDR (CONFIG_SYS_SDRAM_BASE + \
39 (128 << 20))
Lokesh Vutlab82e6e92013-12-10 15:02:12 +053040#define CONFIG_SPL_YMODEM_SUPPORT
Lokesh Vutla4c682f62013-07-30 11:36:32 +053041
Lokesh Vutlaa42eea92013-12-10 15:02:13 +053042/* Enabling L2 Cache */
43#define CONFIG_SYS_L2_PL310
44#define CONFIG_SYS_PL310_BASE 0x48242000
45#define CONFIG_SYS_CACHELINE_SIZE 32
46
Lokesh Vutlab82e6e92013-12-10 15:02:12 +053047/*
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
Lokesh Vutla4c682f62013-07-30 11:36:32 +053054
Lokesh Vutlab82e6e92013-12-10 15:02:12 +053055/* Now bring in the rest of the common code. */
56#include <configs/ti_armv7_common.h>
Lokesh Vutla4c682f62013-07-30 11:36:32 +053057
Lokesh Vutlab82e6e92013-12-10 15:02:12 +053058/* Always 128 KiB env size */
59#define CONFIG_ENV_SIZE (128 << 10)
Lokesh Vutla4c682f62013-07-30 11:36:32 +053060
Lokesh Vutla4c682f62013-07-30 11:36:32 +053061#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
Lokesh Vutla4c682f62013-07-30 11:36:32 +053067/* NS16550 Configuration */
Lokesh Vutla4c682f62013-07-30 11:36:32 +053068#define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */
69
Lokesh Vutla4c682f62013-07-30 11:36:32 +053070#define CONFIG_ENV_IS_NOWHERE
71
Lokesh Vutla4c682f62013-07-30 11:36:32 +053072#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/omap-common/u-boot-spl.lds"
73
Dan Murphyd2652cb2014-01-16 11:23:31 -060074/* 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
Dan Murphy6044db32013-10-11 12:28:18 -050079#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
Sourav Poddar399f8472013-12-21 12:50:08 +053089/* 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
Tom Rini0a7baa72014-01-21 17:15:07 -0500101/* Enhance our eMMC support / experience. */
102#define CONFIG_CMD_GPT
103#define CONFIG_EFI_PARTITION
104#define CONFIG_PARTITION_UUIDS
105#define CONFIG_CMD_PART
106
Lokesh Vutla3985a012013-12-10 15:02:14 +0530107#ifndef CONFIG_SPL_BUILD
108#define CONFIG_EXTRA_ENV_SETTINGS \
Tom Rini96886f22014-03-28 15:03:29 -0400109 DEFAULT_LINUX_BOOT_ENV \
Lokesh Vutla3985a012013-12-10 15:02:14 +0530110 "fdtfile=undefined\0" \
111 "bootpart=0:2\0" \
112 "bootdir=/boot\0" \
113 "bootfile=zImage\0" \
114 "console=ttyO0,115200n8\0" \
Tom Rini0a7baa72014-01-21 17:15:07 -0500115 "partitions=" \
116 "uuid_disk=${uuid_gpt_disk};" \
117 "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
Lokesh Vutla3985a012013-12-10 15:02:14 +0530118 "optargs=\0" \
119 "mmcdev=0\0" \
120 "mmcroot=/dev/mmcblk0p2 rw\0" \
121 "mmcrootfstype=ext4 rootwait\0" \
Dan Murphyd2652cb2014-01-16 11:23:31 -0600122 "usbroot=/dev/sda2 rw\0" \
123 "usbrootfstype=ext4 rootwait\0" \
124 "usbdev=0\0" \
Tom Rini4431a122014-03-28 15:03:31 -0400125 "ramroot=/dev/ram0 rw\0" \
Lokesh Vutla3985a012013-12-10 15:02:14 +0530126 "ramrootfstype=ext2\0" \
127 "mmcargs=setenv bootargs console=${console} " \
128 "${optargs} " \
129 "root=${mmcroot} " \
130 "rootfstype=${mmcrootfstype}\0" \
Dan Murphyd2652cb2014-01-16 11:23:31 -0600131 "usbargs=setenv bootargs console=${console} " \
132 "${optargs} " \
133 "root=${usbroot} " \
134 "rootfstype=${usbrootfstype}\0" \
Lokesh Vutla3985a012013-12-10 15:02:14 +0530135 "bootenv=uEnv.txt\0" \
Dan Murphyd2652cb2014-01-16 11:23:31 -0600136 "loadbootenv=load ${devtype} ${devnum} ${loadaddr} ${bootenv}\0" \
Lokesh Vutla3985a012013-12-10 15:02:14 +0530137 "importbootenv=echo Importing environment from mmc ...; " \
138 "env import -t $loadaddr $filesize\0" \
139 "ramargs=setenv bootargs console=${console} " \
140 "${optargs} " \
141 "root=${ramroot} " \
142 "rootfstype=${ramrootfstype}\0" \
Dan Murphyd2652cb2014-01-16 11:23:31 -0600143 "loadramdisk=load ${devtype} ${devnum} ${rdaddr} ramdisk.gz\0" \
144 "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
145 "loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
Lokesh Vutla3985a012013-12-10 15:02:14 +0530146 "mmcboot=mmc dev ${mmcdev}; " \
Dan Murphyd2652cb2014-01-16 11:23:31 -0600147 "setenv devnum ${mmcdev}; " \
Lokesh Vutla3985a012013-12-10 15:02:14 +0530148 "if mmc rescan; then " \
Dan Murphyd2652cb2014-01-16 11:23:31 -0600149 "echo SD/MMC found on device ${devnum};" \
Lokesh Vutla3985a012013-12-10 15:02:14 +0530150 "if run loadbootenv; then " \
151 "echo Loaded environment from ${bootenv};" \
152 "run importbootenv;" \
153 "fi;" \
154 "if test -n $uenvcmd; then " \
155 "echo Running uenvcmd ...;" \
156 "run uenvcmd;" \
157 "fi;" \
158 "if run loadimage; then " \
159 "run loadfdt; " \
160 "echo Booting from mmc${mmcdev} ...; " \
161 "run mmcargs; " \
162 "bootz ${loadaddr} - ${fdtaddr}; " \
163 "fi;" \
164 "fi;\0" \
Dan Murphyd2652cb2014-01-16 11:23:31 -0600165 "usbboot=" \
166 "setenv devnum ${usbdev}; " \
167 "setenv devtype usb; " \
168 "usb start ${usbdev}; " \
169 "if usb dev ${usbdev}; then " \
170 "if run loadbootenv; then " \
171 "echo Loaded environment from ${bootenv};" \
172 "run importbootenv;" \
173 "fi;" \
174 "if test -n $uenvcmd; then " \
175 "echo Running uenvcmd ...;" \
176 "run uenvcmd;" \
177 "fi;" \
178 "if run loadimage; then " \
179 "run loadfdt; " \
180 "echo Booting from usb ${usbdev}...; " \
181 "run usbargs;" \
182 "bootz ${loadaddr} - ${fdtaddr}; " \
183 "fi;" \
184 "fi\0" \
Lokesh Vutla3985a012013-12-10 15:02:14 +0530185 "findfdt="\
186 "if test $board_name = AM43EPOS; then " \
187 "setenv fdtfile am43x-epos-evm.dtb; fi; " \
188 "if test $board_name = AM43__GP; then " \
189 "setenv fdtfile am437x-gp-evm.dtb; fi; " \
190 "if test $fdtfile = undefined; then " \
191 "echo WARNING: Could not determine device tree; fi; \0"
192
193#define CONFIG_BOOTCOMMAND \
194 "run findfdt; " \
Dan Murphyd2652cb2014-01-16 11:23:31 -0600195 "run mmcboot;" \
196 "run usbboot;"
Lokesh Vutla3985a012013-12-10 15:02:14 +0530197
Mugunthan V N1de98af2014-02-18 07:31:58 -0500198#endif
199
Mugunthan V Nc94f9542014-02-18 07:31:54 -0500200/* CPSW Ethernet */
201#define CONFIG_CMD_NET
202#define CONFIG_CMD_DHCP
203#define CONFIG_CMD_PING
204#define CONFIG_CMD_MII
205#define CONFIG_DRIVER_TI_CPSW
206#define CONFIG_MII
207#define CONFIG_BOOTP_DEFAULT
208#define CONFIG_BOOTP_DNS
209#define CONFIG_BOOTP_DNS2
210#define CONFIG_BOOTP_SEND_HOSTNAME
211#define CONFIG_BOOTP_GATEWAY
212#define CONFIG_BOOTP_SUBNETMASK
213#define CONFIG_NET_RETRY_COUNT 10
214#define CONFIG_NET_MULTI
215#define CONFIG_PHY_GIGE
216#define CONFIG_PHYLIB
Mugunthan V N1de98af2014-02-18 07:31:58 -0500217
218#define CONFIG_SPL_ENV_SUPPORT
219#define CONFIG_SPL_NET_VCI_STRING "AM43xx U-Boot SPL"
220
221#define CONFIG_SPL_ETH_SUPPORT
222#define CONFIG_SPL_NET_SUPPORT
Mugunthan V Nc94f9542014-02-18 07:31:54 -0500223#define CONFIG_SYS_RX_ETH_BUFFER 64
Mugunthan V Nc94f9542014-02-18 07:31:54 -0500224
Lokesh Vutla4c682f62013-07-30 11:36:32 +0530225#endif /* __CONFIG_AM43XX_EVM_H */