Lokesh Vutla | 4c682f6 | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 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 |
Lokesh Vutla | b82e6e9 | 2013-12-10 15:02:12 +0530 | [diff] [blame] | 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 */ |
Lokesh Vutla | 4c682f6 | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 19 | |
| 20 | #include <asm/arch/omap.h> |
| 21 | |
Lokesh Vutla | b82e6e9 | 2013-12-10 15:02:12 +0530 | [diff] [blame] | 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 |
Lokesh Vutla | 4c682f6 | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 27 | |
Sekhar Nori | 2ab3c49 | 2013-12-10 15:02:15 +0530 | [diff] [blame] | 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 | |
Lokesh Vutla | b82e6e9 | 2013-12-10 15:02:12 +0530 | [diff] [blame] | 35 | /* SPL defines. */ |
| 36 | #define CONFIG_SPL_TEXT_BASE 0x40300350 |
Tom Rini | a14fb57 | 2014-01-20 08:40:07 -0500 | [diff] [blame] | 37 | #define CONFIG_SPL_MAX_SIZE (220 << 10) /* 220KB */ |
Tom Rini | d9f808d | 2014-04-03 07:52:53 -0400 | [diff] [blame] | 38 | #define CONFIG_SYS_SPL_ARGS_ADDR (CONFIG_SYS_SDRAM_BASE + \ |
| 39 | (128 << 20)) |
Lokesh Vutla | b82e6e9 | 2013-12-10 15:02:12 +0530 | [diff] [blame] | 40 | #define CONFIG_SPL_YMODEM_SUPPORT |
Lokesh Vutla | 4c682f6 | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 41 | |
Lokesh Vutla | a42eea9 | 2013-12-10 15:02:13 +0530 | [diff] [blame] | 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 | |
Lokesh Vutla | b82e6e9 | 2013-12-10 15:02:12 +0530 | [diff] [blame] | 47 | /* |
| 48 | * Since SPL did pll and ddr initialization for us, |
| 49 | * we don't need to do it twice. |
| 50 | */ |
Sourav Poddar | 5248bba | 2014-05-19 16:53:37 -0400 | [diff] [blame^] | 51 | #if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_QSPI_BOOT) |
Lokesh Vutla | b82e6e9 | 2013-12-10 15:02:12 +0530 | [diff] [blame] | 52 | #define CONFIG_SKIP_LOWLEVEL_INIT |
| 53 | #endif |
Lokesh Vutla | 4c682f6 | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 54 | |
Lokesh Vutla | b82e6e9 | 2013-12-10 15:02:12 +0530 | [diff] [blame] | 55 | /* Now bring in the rest of the common code. */ |
| 56 | #include <configs/ti_armv7_common.h> |
Lokesh Vutla | 4c682f6 | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 57 | |
Sourav Poddar | 5248bba | 2014-05-19 16:53:37 -0400 | [diff] [blame^] | 58 | /* Always 64 KiB env size */ |
| 59 | #define CONFIG_ENV_SIZE (64 << 10) |
Lokesh Vutla | 4c682f6 | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 60 | |
Lokesh Vutla | 4c682f6 | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 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 | |
Lokesh Vutla | 4c682f6 | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 67 | /* NS16550 Configuration */ |
Lokesh Vutla | 4c682f6 | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 68 | #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */ |
| 69 | |
Lokesh Vutla | 4c682f6 | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 70 | #define CONFIG_ENV_IS_NOWHERE |
| 71 | |
Lokesh Vutla | 4c682f6 | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 72 | #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/omap-common/u-boot-spl.lds" |
| 73 | |
Dan Murphy | d2652cb | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 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 | |
Dan Murphy | 6044db3 | 2013-10-11 12:28:18 -0500 | [diff] [blame] | 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 | |
Sourav Poddar | 5248bba | 2014-05-19 16:53:37 -0400 | [diff] [blame^] | 89 | #ifdef CONFIG_QSPI_BOOT |
| 90 | #define CONFIG_SYS_TEXT_BASE 0x30000000 |
| 91 | #undef CONFIG_ENV_IS_NOWHERE |
| 92 | #define CONFIG_ENV_IS_IN_SPI_FLASH |
| 93 | #define CONFIG_SYS_REDUNDAND_ENVIRONMENT |
| 94 | #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED |
| 95 | #define CONFIG_ENV_SECT_SIZE (64 << 10) /* 64 KB sectors */ |
| 96 | #define CONFIG_ENV_OFFSET 0x110000 |
| 97 | #define CONFIG_ENV_OFFSET_REDUND 0x120000 |
| 98 | #ifdef MTDIDS_DEFAULT |
| 99 | #undef MTDIDS_DEFAULT |
| 100 | #endif |
| 101 | #ifdef MTDPARTS_DEFAULT |
| 102 | #undef MTDPARTS_DEFAULT |
| 103 | #endif |
| 104 | #define MTDPARTS_DEFAULT "mtdparts=qspi.0:512k(QSPI.u-boot)," \ |
| 105 | "512k(QSPI.u-boot.backup)," \ |
| 106 | "512k(QSPI.u-boot-spl-os)," \ |
| 107 | "64k(QSPI.u-boot-env)," \ |
| 108 | "64k(QSPI.u-boot-env.backup)," \ |
| 109 | "8m(QSPI.kernel)," \ |
| 110 | "-(QSPI.file-system)" |
| 111 | #endif |
| 112 | |
Sourav Poddar | 399f847 | 2013-12-21 12:50:08 +0530 | [diff] [blame] | 113 | /* SPI */ |
| 114 | #undef CONFIG_OMAP3_SPI |
| 115 | #define CONFIG_TI_QSPI |
| 116 | #define CONFIG_SPI_FLASH |
| 117 | #define CONFIG_SPI_FLASH_MACRONIX |
| 118 | #define CONFIG_CMD_SF |
| 119 | #define CONFIG_CMD_SPI |
| 120 | #define CONFIG_TI_SPI_MMAP |
Sourav Poddar | 5248bba | 2014-05-19 16:53:37 -0400 | [diff] [blame^] | 121 | #define CONFIG_SPI_FLASH_BAR |
Sourav Poddar | 399f847 | 2013-12-21 12:50:08 +0530 | [diff] [blame] | 122 | #define CONFIG_QSPI_SEL_GPIO 48 |
| 123 | #define CONFIG_SF_DEFAULT_SPEED 48000000 |
| 124 | #define CONFIG_DEFAULT_SPI_MODE SPI_MODE_3 |
| 125 | |
Tom Rini | 0a7baa7 | 2014-01-21 17:15:07 -0500 | [diff] [blame] | 126 | /* Enhance our eMMC support / experience. */ |
| 127 | #define CONFIG_CMD_GPT |
| 128 | #define CONFIG_EFI_PARTITION |
| 129 | #define CONFIG_PARTITION_UUIDS |
| 130 | #define CONFIG_CMD_PART |
| 131 | |
Lokesh Vutla | 3985a01 | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 132 | #ifndef CONFIG_SPL_BUILD |
| 133 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
Tom Rini | 96886f2 | 2014-03-28 15:03:29 -0400 | [diff] [blame] | 134 | DEFAULT_LINUX_BOOT_ENV \ |
Lokesh Vutla | 3985a01 | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 135 | "fdtfile=undefined\0" \ |
| 136 | "bootpart=0:2\0" \ |
| 137 | "bootdir=/boot\0" \ |
| 138 | "bootfile=zImage\0" \ |
| 139 | "console=ttyO0,115200n8\0" \ |
Tom Rini | 0a7baa7 | 2014-01-21 17:15:07 -0500 | [diff] [blame] | 140 | "partitions=" \ |
| 141 | "uuid_disk=${uuid_gpt_disk};" \ |
| 142 | "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \ |
Lokesh Vutla | 3985a01 | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 143 | "optargs=\0" \ |
| 144 | "mmcdev=0\0" \ |
| 145 | "mmcroot=/dev/mmcblk0p2 rw\0" \ |
| 146 | "mmcrootfstype=ext4 rootwait\0" \ |
Dan Murphy | d2652cb | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 147 | "usbroot=/dev/sda2 rw\0" \ |
| 148 | "usbrootfstype=ext4 rootwait\0" \ |
| 149 | "usbdev=0\0" \ |
Tom Rini | 4431a12 | 2014-03-28 15:03:31 -0400 | [diff] [blame] | 150 | "ramroot=/dev/ram0 rw\0" \ |
Lokesh Vutla | 3985a01 | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 151 | "ramrootfstype=ext2\0" \ |
| 152 | "mmcargs=setenv bootargs console=${console} " \ |
| 153 | "${optargs} " \ |
| 154 | "root=${mmcroot} " \ |
| 155 | "rootfstype=${mmcrootfstype}\0" \ |
Dan Murphy | d2652cb | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 156 | "usbargs=setenv bootargs console=${console} " \ |
| 157 | "${optargs} " \ |
| 158 | "root=${usbroot} " \ |
| 159 | "rootfstype=${usbrootfstype}\0" \ |
Lokesh Vutla | 3985a01 | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 160 | "bootenv=uEnv.txt\0" \ |
Dan Murphy | d2652cb | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 161 | "loadbootenv=load ${devtype} ${devnum} ${loadaddr} ${bootenv}\0" \ |
Lokesh Vutla | 3985a01 | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 162 | "importbootenv=echo Importing environment from mmc ...; " \ |
| 163 | "env import -t $loadaddr $filesize\0" \ |
| 164 | "ramargs=setenv bootargs console=${console} " \ |
| 165 | "${optargs} " \ |
| 166 | "root=${ramroot} " \ |
| 167 | "rootfstype=${ramrootfstype}\0" \ |
Dan Murphy | d2652cb | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 168 | "loadramdisk=load ${devtype} ${devnum} ${rdaddr} ramdisk.gz\0" \ |
| 169 | "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ |
| 170 | "loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ |
Lokesh Vutla | 3985a01 | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 171 | "mmcboot=mmc dev ${mmcdev}; " \ |
Dan Murphy | d2652cb | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 172 | "setenv devnum ${mmcdev}; " \ |
Lokesh Vutla | 3985a01 | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 173 | "if mmc rescan; then " \ |
Dan Murphy | d2652cb | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 174 | "echo SD/MMC found on device ${devnum};" \ |
Lokesh Vutla | 3985a01 | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 175 | "if run loadbootenv; then " \ |
| 176 | "echo Loaded environment from ${bootenv};" \ |
| 177 | "run importbootenv;" \ |
| 178 | "fi;" \ |
| 179 | "if test -n $uenvcmd; then " \ |
| 180 | "echo Running uenvcmd ...;" \ |
| 181 | "run uenvcmd;" \ |
| 182 | "fi;" \ |
| 183 | "if run loadimage; then " \ |
| 184 | "run loadfdt; " \ |
| 185 | "echo Booting from mmc${mmcdev} ...; " \ |
| 186 | "run mmcargs; " \ |
| 187 | "bootz ${loadaddr} - ${fdtaddr}; " \ |
| 188 | "fi;" \ |
| 189 | "fi;\0" \ |
Dan Murphy | d2652cb | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 190 | "usbboot=" \ |
| 191 | "setenv devnum ${usbdev}; " \ |
| 192 | "setenv devtype usb; " \ |
| 193 | "usb start ${usbdev}; " \ |
| 194 | "if usb dev ${usbdev}; then " \ |
| 195 | "if run loadbootenv; then " \ |
| 196 | "echo Loaded environment from ${bootenv};" \ |
| 197 | "run importbootenv;" \ |
| 198 | "fi;" \ |
| 199 | "if test -n $uenvcmd; then " \ |
| 200 | "echo Running uenvcmd ...;" \ |
| 201 | "run uenvcmd;" \ |
| 202 | "fi;" \ |
| 203 | "if run loadimage; then " \ |
| 204 | "run loadfdt; " \ |
| 205 | "echo Booting from usb ${usbdev}...; " \ |
| 206 | "run usbargs;" \ |
| 207 | "bootz ${loadaddr} - ${fdtaddr}; " \ |
| 208 | "fi;" \ |
| 209 | "fi\0" \ |
Lokesh Vutla | 3985a01 | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 210 | "findfdt="\ |
| 211 | "if test $board_name = AM43EPOS; then " \ |
| 212 | "setenv fdtfile am43x-epos-evm.dtb; fi; " \ |
| 213 | "if test $board_name = AM43__GP; then " \ |
| 214 | "setenv fdtfile am437x-gp-evm.dtb; fi; " \ |
| 215 | "if test $fdtfile = undefined; then " \ |
| 216 | "echo WARNING: Could not determine device tree; fi; \0" |
| 217 | |
| 218 | #define CONFIG_BOOTCOMMAND \ |
| 219 | "run findfdt; " \ |
Dan Murphy | d2652cb | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 220 | "run mmcboot;" \ |
| 221 | "run usbboot;" |
Lokesh Vutla | 3985a01 | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 222 | |
Mugunthan V N | 1de98af | 2014-02-18 07:31:58 -0500 | [diff] [blame] | 223 | #endif |
| 224 | |
Mugunthan V N | c94f954 | 2014-02-18 07:31:54 -0500 | [diff] [blame] | 225 | /* CPSW Ethernet */ |
| 226 | #define CONFIG_CMD_NET |
| 227 | #define CONFIG_CMD_DHCP |
| 228 | #define CONFIG_CMD_PING |
| 229 | #define CONFIG_CMD_MII |
| 230 | #define CONFIG_DRIVER_TI_CPSW |
| 231 | #define CONFIG_MII |
| 232 | #define CONFIG_BOOTP_DEFAULT |
| 233 | #define CONFIG_BOOTP_DNS |
| 234 | #define CONFIG_BOOTP_DNS2 |
| 235 | #define CONFIG_BOOTP_SEND_HOSTNAME |
| 236 | #define CONFIG_BOOTP_GATEWAY |
| 237 | #define CONFIG_BOOTP_SUBNETMASK |
| 238 | #define CONFIG_NET_RETRY_COUNT 10 |
| 239 | #define CONFIG_NET_MULTI |
| 240 | #define CONFIG_PHY_GIGE |
| 241 | #define CONFIG_PHYLIB |
Mugunthan V N | 1de98af | 2014-02-18 07:31:58 -0500 | [diff] [blame] | 242 | |
| 243 | #define CONFIG_SPL_ENV_SUPPORT |
| 244 | #define CONFIG_SPL_NET_VCI_STRING "AM43xx U-Boot SPL" |
| 245 | |
| 246 | #define CONFIG_SPL_ETH_SUPPORT |
| 247 | #define CONFIG_SPL_NET_SUPPORT |
Mugunthan V N | c94f954 | 2014-02-18 07:31:54 -0500 | [diff] [blame] | 248 | #define CONFIG_SYS_RX_ETH_BUFFER 64 |
Mugunthan V N | c94f954 | 2014-02-18 07:31:54 -0500 | [diff] [blame] | 249 | |
Lokesh Vutla | 4c682f6 | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 250 | #endif /* __CONFIG_AM43XX_EVM_H */ |