blob: 8473b0bf5a40eea0abdab800d932685faa68847f [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 */
Sourav Poddar5248bba2014-05-19 16:53:37 -040051#if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_QSPI_BOOT)
Lokesh Vutlab82e6e92013-12-10 15:02:12 +053052#define CONFIG_SKIP_LOWLEVEL_INIT
53#endif
Lokesh Vutla4c682f62013-07-30 11:36:32 +053054
Tom Rini9fec9ae2014-05-21 12:57:22 -040055/*
56 * When building U-Boot such that there is no previous loader
57 * we need to call board_early_init_f. This is taken care of in
58 * s_init when we have SPL used.
59 */
60#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && !defined(CONFIG_SPL)
61#define CONFIG_BOARD_EARLY_INIT_F
62#endif
63
Lokesh Vutlab82e6e92013-12-10 15:02:12 +053064/* Now bring in the rest of the common code. */
65#include <configs/ti_armv7_common.h>
Lokesh Vutla4c682f62013-07-30 11:36:32 +053066
Sourav Poddar5248bba2014-05-19 16:53:37 -040067/* Always 64 KiB env size */
68#define CONFIG_ENV_SIZE (64 << 10)
Lokesh Vutla4c682f62013-07-30 11:36:32 +053069
Lokesh Vutla4c682f62013-07-30 11:36:32 +053070#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
71
72/* Clock Defines */
73#define V_OSCK 24000000 /* Clock output from T2 */
74#define V_SCLK (V_OSCK)
75
Lokesh Vutla4c682f62013-07-30 11:36:32 +053076/* NS16550 Configuration */
Lokesh Vutla4c682f62013-07-30 11:36:32 +053077#define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */
78
Lokesh Vutla4c682f62013-07-30 11:36:32 +053079#define CONFIG_ENV_IS_NOWHERE
80
Lokesh Vutla4c682f62013-07-30 11:36:32 +053081#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/omap-common/u-boot-spl.lds"
82
Dan Murphyd2652cb2014-01-16 11:23:31 -060083/* SPL USB Support */
84#define CONFIG_SPL_USB_SUPPORT
85#define CONFIG_SPL_USB_HOST_SUPPORT
86#define CONFIG_SYS_USB_FAT_BOOT_PARTITION 1
87
Dan Murphy6044db32013-10-11 12:28:18 -050088#define CONFIG_CMD_USB
89#define CONFIG_USB_HOST
90#define CONFIG_USB_XHCI
91#define CONFIG_USB_XHCI_OMAP
92#define CONFIG_USB_STORAGE
93#define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 2
94
95#define CONFIG_OMAP_USB_PHY
96#define CONFIG_AM437X_USB2PHY2_HOST
97
Sourav Poddar5248bba2014-05-19 16:53:37 -040098#ifdef CONFIG_QSPI_BOOT
99#define CONFIG_SYS_TEXT_BASE 0x30000000
100#undef CONFIG_ENV_IS_NOWHERE
101#define CONFIG_ENV_IS_IN_SPI_FLASH
102#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
103#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
104#define CONFIG_ENV_SECT_SIZE (64 << 10) /* 64 KB sectors */
105#define CONFIG_ENV_OFFSET 0x110000
106#define CONFIG_ENV_OFFSET_REDUND 0x120000
107#ifdef MTDIDS_DEFAULT
108#undef MTDIDS_DEFAULT
109#endif
110#ifdef MTDPARTS_DEFAULT
111#undef MTDPARTS_DEFAULT
112#endif
113#define MTDPARTS_DEFAULT "mtdparts=qspi.0:512k(QSPI.u-boot)," \
114 "512k(QSPI.u-boot.backup)," \
115 "512k(QSPI.u-boot-spl-os)," \
116 "64k(QSPI.u-boot-env)," \
117 "64k(QSPI.u-boot-env.backup)," \
118 "8m(QSPI.kernel)," \
119 "-(QSPI.file-system)"
120#endif
121
Sourav Poddar399f8472013-12-21 12:50:08 +0530122/* SPI */
123#undef CONFIG_OMAP3_SPI
124#define CONFIG_TI_QSPI
125#define CONFIG_SPI_FLASH
126#define CONFIG_SPI_FLASH_MACRONIX
127#define CONFIG_CMD_SF
128#define CONFIG_CMD_SPI
129#define CONFIG_TI_SPI_MMAP
Sourav Poddar5248bba2014-05-19 16:53:37 -0400130#define CONFIG_SPI_FLASH_BAR
Sourav Poddar399f8472013-12-21 12:50:08 +0530131#define CONFIG_QSPI_SEL_GPIO 48
132#define CONFIG_SF_DEFAULT_SPEED 48000000
133#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_3
134
Tom Rini0a7baa72014-01-21 17:15:07 -0500135/* Enhance our eMMC support / experience. */
136#define CONFIG_CMD_GPT
137#define CONFIG_EFI_PARTITION
138#define CONFIG_PARTITION_UUIDS
139#define CONFIG_CMD_PART
140
Lokesh Vutla3985a012013-12-10 15:02:14 +0530141#ifndef CONFIG_SPL_BUILD
142#define CONFIG_EXTRA_ENV_SETTINGS \
Tom Rini96886f22014-03-28 15:03:29 -0400143 DEFAULT_LINUX_BOOT_ENV \
Lokesh Vutla3985a012013-12-10 15:02:14 +0530144 "fdtfile=undefined\0" \
145 "bootpart=0:2\0" \
146 "bootdir=/boot\0" \
147 "bootfile=zImage\0" \
148 "console=ttyO0,115200n8\0" \
Tom Rini0a7baa72014-01-21 17:15:07 -0500149 "partitions=" \
150 "uuid_disk=${uuid_gpt_disk};" \
151 "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
Lokesh Vutla3985a012013-12-10 15:02:14 +0530152 "optargs=\0" \
153 "mmcdev=0\0" \
154 "mmcroot=/dev/mmcblk0p2 rw\0" \
155 "mmcrootfstype=ext4 rootwait\0" \
Dan Murphyd2652cb2014-01-16 11:23:31 -0600156 "usbroot=/dev/sda2 rw\0" \
157 "usbrootfstype=ext4 rootwait\0" \
158 "usbdev=0\0" \
Tom Rini4431a122014-03-28 15:03:31 -0400159 "ramroot=/dev/ram0 rw\0" \
Lokesh Vutla3985a012013-12-10 15:02:14 +0530160 "ramrootfstype=ext2\0" \
161 "mmcargs=setenv bootargs console=${console} " \
162 "${optargs} " \
163 "root=${mmcroot} " \
164 "rootfstype=${mmcrootfstype}\0" \
Dan Murphyd2652cb2014-01-16 11:23:31 -0600165 "usbargs=setenv bootargs console=${console} " \
166 "${optargs} " \
167 "root=${usbroot} " \
168 "rootfstype=${usbrootfstype}\0" \
Lokesh Vutla3985a012013-12-10 15:02:14 +0530169 "bootenv=uEnv.txt\0" \
Dan Murphyd2652cb2014-01-16 11:23:31 -0600170 "loadbootenv=load ${devtype} ${devnum} ${loadaddr} ${bootenv}\0" \
Lokesh Vutla3985a012013-12-10 15:02:14 +0530171 "importbootenv=echo Importing environment from mmc ...; " \
172 "env import -t $loadaddr $filesize\0" \
173 "ramargs=setenv bootargs console=${console} " \
174 "${optargs} " \
175 "root=${ramroot} " \
176 "rootfstype=${ramrootfstype}\0" \
Dan Murphyd2652cb2014-01-16 11:23:31 -0600177 "loadramdisk=load ${devtype} ${devnum} ${rdaddr} ramdisk.gz\0" \
178 "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
179 "loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
Lokesh Vutla3985a012013-12-10 15:02:14 +0530180 "mmcboot=mmc dev ${mmcdev}; " \
Dan Murphyd2652cb2014-01-16 11:23:31 -0600181 "setenv devnum ${mmcdev}; " \
Lokesh Vutla3985a012013-12-10 15:02:14 +0530182 "if mmc rescan; then " \
Dan Murphyd2652cb2014-01-16 11:23:31 -0600183 "echo SD/MMC found on device ${devnum};" \
Lokesh Vutla3985a012013-12-10 15:02:14 +0530184 "if run loadbootenv; then " \
185 "echo Loaded environment from ${bootenv};" \
186 "run importbootenv;" \
187 "fi;" \
188 "if test -n $uenvcmd; then " \
189 "echo Running uenvcmd ...;" \
190 "run uenvcmd;" \
191 "fi;" \
192 "if run loadimage; then " \
193 "run loadfdt; " \
194 "echo Booting from mmc${mmcdev} ...; " \
195 "run mmcargs; " \
196 "bootz ${loadaddr} - ${fdtaddr}; " \
197 "fi;" \
198 "fi;\0" \
Dan Murphyd2652cb2014-01-16 11:23:31 -0600199 "usbboot=" \
200 "setenv devnum ${usbdev}; " \
201 "setenv devtype usb; " \
202 "usb start ${usbdev}; " \
203 "if usb dev ${usbdev}; then " \
204 "if run loadbootenv; then " \
205 "echo Loaded environment from ${bootenv};" \
206 "run importbootenv;" \
207 "fi;" \
208 "if test -n $uenvcmd; then " \
209 "echo Running uenvcmd ...;" \
210 "run uenvcmd;" \
211 "fi;" \
212 "if run loadimage; then " \
213 "run loadfdt; " \
214 "echo Booting from usb ${usbdev}...; " \
215 "run usbargs;" \
216 "bootz ${loadaddr} - ${fdtaddr}; " \
217 "fi;" \
218 "fi\0" \
Lokesh Vutla3985a012013-12-10 15:02:14 +0530219 "findfdt="\
220 "if test $board_name = AM43EPOS; then " \
221 "setenv fdtfile am43x-epos-evm.dtb; fi; " \
222 "if test $board_name = AM43__GP; then " \
223 "setenv fdtfile am437x-gp-evm.dtb; fi; " \
224 "if test $fdtfile = undefined; then " \
225 "echo WARNING: Could not determine device tree; fi; \0"
226
227#define CONFIG_BOOTCOMMAND \
228 "run findfdt; " \
Dan Murphyd2652cb2014-01-16 11:23:31 -0600229 "run mmcboot;" \
230 "run usbboot;"
Lokesh Vutla3985a012013-12-10 15:02:14 +0530231
Mugunthan V N1de98af2014-02-18 07:31:58 -0500232#endif
233
Mugunthan V Nc94f9542014-02-18 07:31:54 -0500234/* CPSW Ethernet */
235#define CONFIG_CMD_NET
236#define CONFIG_CMD_DHCP
237#define CONFIG_CMD_PING
238#define CONFIG_CMD_MII
239#define CONFIG_DRIVER_TI_CPSW
240#define CONFIG_MII
241#define CONFIG_BOOTP_DEFAULT
242#define CONFIG_BOOTP_DNS
243#define CONFIG_BOOTP_DNS2
244#define CONFIG_BOOTP_SEND_HOSTNAME
245#define CONFIG_BOOTP_GATEWAY
246#define CONFIG_BOOTP_SUBNETMASK
247#define CONFIG_NET_RETRY_COUNT 10
248#define CONFIG_NET_MULTI
249#define CONFIG_PHY_GIGE
250#define CONFIG_PHYLIB
Mugunthan V N1de98af2014-02-18 07:31:58 -0500251
252#define CONFIG_SPL_ENV_SUPPORT
253#define CONFIG_SPL_NET_VCI_STRING "AM43xx U-Boot SPL"
254
255#define CONFIG_SPL_ETH_SUPPORT
256#define CONFIG_SPL_NET_SUPPORT
Mugunthan V Nc94f9542014-02-18 07:31:54 -0500257#define CONFIG_SYS_RX_ETH_BUFFER 64
Mugunthan V Nc94f9542014-02-18 07:31:54 -0500258
Lokesh Vutla4c682f62013-07-30 11:36:32 +0530259#endif /* __CONFIG_AM43XX_EVM_H */