Lokesh Vutla | 8d0afcd | 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 | 369cbe1 | 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 | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 19 | |
| 20 | #include <asm/arch/omap.h> |
| 21 | |
Lokesh Vutla | 369cbe1 | 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 | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 27 | |
Sekhar Nori | 9f1a8cd | 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 | |
Tom Rini | 83bad10 | 2014-06-05 11:15:30 -0400 | [diff] [blame] | 35 | /* Power */ |
| 36 | #define CONFIG_POWER_TPS65218 |
| 37 | |
Lokesh Vutla | 369cbe1 | 2013-12-10 15:02:12 +0530 | [diff] [blame] | 38 | /* SPL defines. */ |
| 39 | #define CONFIG_SPL_TEXT_BASE 0x40300350 |
Tom Rini | b1cde7e | 2014-01-20 08:40:07 -0500 | [diff] [blame] | 40 | #define CONFIG_SPL_MAX_SIZE (220 << 10) /* 220KB */ |
Tom Rini | d3289aa | 2014-04-03 07:52:53 -0400 | [diff] [blame] | 41 | #define CONFIG_SYS_SPL_ARGS_ADDR (CONFIG_SYS_SDRAM_BASE + \ |
| 42 | (128 << 20)) |
Tom Rini | 83bad10 | 2014-06-05 11:15:30 -0400 | [diff] [blame] | 43 | #define CONFIG_SPL_POWER_SUPPORT |
Lokesh Vutla | 369cbe1 | 2013-12-10 15:02:12 +0530 | [diff] [blame] | 44 | #define CONFIG_SPL_YMODEM_SUPPORT |
Lokesh Vutla | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 45 | |
Lokesh Vutla | 573b020 | 2013-12-10 15:02:13 +0530 | [diff] [blame] | 46 | /* Enabling L2 Cache */ |
| 47 | #define CONFIG_SYS_L2_PL310 |
| 48 | #define CONFIG_SYS_PL310_BASE 0x48242000 |
| 49 | #define CONFIG_SYS_CACHELINE_SIZE 32 |
| 50 | |
Lokesh Vutla | 369cbe1 | 2013-12-10 15:02:12 +0530 | [diff] [blame] | 51 | /* |
| 52 | * Since SPL did pll and ddr initialization for us, |
| 53 | * we don't need to do it twice. |
| 54 | */ |
Sourav Poddar | 7a5f71b | 2014-05-19 16:53:37 -0400 | [diff] [blame] | 55 | #if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_QSPI_BOOT) |
Lokesh Vutla | 369cbe1 | 2013-12-10 15:02:12 +0530 | [diff] [blame] | 56 | #define CONFIG_SKIP_LOWLEVEL_INIT |
| 57 | #endif |
Lokesh Vutla | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 58 | |
Tom Rini | 196311d | 2014-05-21 12:57:22 -0400 | [diff] [blame] | 59 | /* |
| 60 | * When building U-Boot such that there is no previous loader |
| 61 | * we need to call board_early_init_f. This is taken care of in |
| 62 | * s_init when we have SPL used. |
| 63 | */ |
| 64 | #if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && !defined(CONFIG_SPL) |
| 65 | #define CONFIG_BOARD_EARLY_INIT_F |
| 66 | #endif |
| 67 | |
Lokesh Vutla | 369cbe1 | 2013-12-10 15:02:12 +0530 | [diff] [blame] | 68 | /* Now bring in the rest of the common code. */ |
| 69 | #include <configs/ti_armv7_common.h> |
Lokesh Vutla | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 70 | |
Sourav Poddar | 7a5f71b | 2014-05-19 16:53:37 -0400 | [diff] [blame] | 71 | /* Always 64 KiB env size */ |
| 72 | #define CONFIG_ENV_SIZE (64 << 10) |
Lokesh Vutla | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 73 | |
Lokesh Vutla | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 74 | #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG |
| 75 | |
| 76 | /* Clock Defines */ |
| 77 | #define V_OSCK 24000000 /* Clock output from T2 */ |
| 78 | #define V_SCLK (V_OSCK) |
| 79 | |
Lokesh Vutla | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 80 | /* NS16550 Configuration */ |
Lokesh Vutla | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 81 | #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */ |
| 82 | |
Lokesh Vutla | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 83 | #define CONFIG_ENV_IS_NOWHERE |
| 84 | |
Lokesh Vutla | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 85 | #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/omap-common/u-boot-spl.lds" |
| 86 | |
Dan Murphy | 2b36fe5 | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 87 | /* SPL USB Support */ |
| 88 | #define CONFIG_SPL_USB_SUPPORT |
| 89 | #define CONFIG_SPL_USB_HOST_SUPPORT |
| 90 | #define CONFIG_SYS_USB_FAT_BOOT_PARTITION 1 |
| 91 | |
Dan Murphy | 3d799c7 | 2013-10-11 12:28:18 -0500 | [diff] [blame] | 92 | #define CONFIG_CMD_USB |
| 93 | #define CONFIG_USB_HOST |
| 94 | #define CONFIG_USB_XHCI |
| 95 | #define CONFIG_USB_XHCI_OMAP |
| 96 | #define CONFIG_USB_STORAGE |
| 97 | #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 2 |
| 98 | |
| 99 | #define CONFIG_OMAP_USB_PHY |
| 100 | #define CONFIG_AM437X_USB2PHY2_HOST |
| 101 | |
Sourav Poddar | 7a5f71b | 2014-05-19 16:53:37 -0400 | [diff] [blame] | 102 | #ifdef CONFIG_QSPI_BOOT |
| 103 | #define CONFIG_SYS_TEXT_BASE 0x30000000 |
| 104 | #undef CONFIG_ENV_IS_NOWHERE |
| 105 | #define CONFIG_ENV_IS_IN_SPI_FLASH |
| 106 | #define CONFIG_SYS_REDUNDAND_ENVIRONMENT |
| 107 | #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED |
| 108 | #define CONFIG_ENV_SECT_SIZE (64 << 10) /* 64 KB sectors */ |
| 109 | #define CONFIG_ENV_OFFSET 0x110000 |
| 110 | #define CONFIG_ENV_OFFSET_REDUND 0x120000 |
| 111 | #ifdef MTDIDS_DEFAULT |
| 112 | #undef MTDIDS_DEFAULT |
| 113 | #endif |
| 114 | #ifdef MTDPARTS_DEFAULT |
| 115 | #undef MTDPARTS_DEFAULT |
| 116 | #endif |
| 117 | #define MTDPARTS_DEFAULT "mtdparts=qspi.0:512k(QSPI.u-boot)," \ |
| 118 | "512k(QSPI.u-boot.backup)," \ |
| 119 | "512k(QSPI.u-boot-spl-os)," \ |
| 120 | "64k(QSPI.u-boot-env)," \ |
| 121 | "64k(QSPI.u-boot-env.backup)," \ |
| 122 | "8m(QSPI.kernel)," \ |
| 123 | "-(QSPI.file-system)" |
| 124 | #endif |
| 125 | |
Sourav Poddar | ea4c7a8 | 2013-12-21 12:50:08 +0530 | [diff] [blame] | 126 | /* SPI */ |
| 127 | #undef CONFIG_OMAP3_SPI |
| 128 | #define CONFIG_TI_QSPI |
| 129 | #define CONFIG_SPI_FLASH |
| 130 | #define CONFIG_SPI_FLASH_MACRONIX |
| 131 | #define CONFIG_CMD_SF |
| 132 | #define CONFIG_CMD_SPI |
| 133 | #define CONFIG_TI_SPI_MMAP |
Sourav Poddar | 7a5f71b | 2014-05-19 16:53:37 -0400 | [diff] [blame] | 134 | #define CONFIG_SPI_FLASH_BAR |
Sourav Poddar | ea4c7a8 | 2013-12-21 12:50:08 +0530 | [diff] [blame] | 135 | #define CONFIG_QSPI_SEL_GPIO 48 |
| 136 | #define CONFIG_SF_DEFAULT_SPEED 48000000 |
| 137 | #define CONFIG_DEFAULT_SPI_MODE SPI_MODE_3 |
| 138 | |
Tom Rini | 0f1b044 | 2014-01-21 17:15:07 -0500 | [diff] [blame] | 139 | /* Enhance our eMMC support / experience. */ |
| 140 | #define CONFIG_CMD_GPT |
| 141 | #define CONFIG_EFI_PARTITION |
| 142 | #define CONFIG_PARTITION_UUIDS |
| 143 | #define CONFIG_CMD_PART |
| 144 | |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 145 | #ifndef CONFIG_SPL_BUILD |
| 146 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
Tom Rini | fb3ad9b | 2014-03-28 15:03:29 -0400 | [diff] [blame] | 147 | DEFAULT_LINUX_BOOT_ENV \ |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 148 | "fdtfile=undefined\0" \ |
| 149 | "bootpart=0:2\0" \ |
| 150 | "bootdir=/boot\0" \ |
| 151 | "bootfile=zImage\0" \ |
| 152 | "console=ttyO0,115200n8\0" \ |
Tom Rini | 0f1b044 | 2014-01-21 17:15:07 -0500 | [diff] [blame] | 153 | "partitions=" \ |
| 154 | "uuid_disk=${uuid_gpt_disk};" \ |
| 155 | "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \ |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 156 | "optargs=\0" \ |
| 157 | "mmcdev=0\0" \ |
| 158 | "mmcroot=/dev/mmcblk0p2 rw\0" \ |
| 159 | "mmcrootfstype=ext4 rootwait\0" \ |
Dan Murphy | 2b36fe5 | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 160 | "usbroot=/dev/sda2 rw\0" \ |
| 161 | "usbrootfstype=ext4 rootwait\0" \ |
| 162 | "usbdev=0\0" \ |
Tom Rini | bea0fd5 | 2014-03-28 15:03:31 -0400 | [diff] [blame] | 163 | "ramroot=/dev/ram0 rw\0" \ |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 164 | "ramrootfstype=ext2\0" \ |
| 165 | "mmcargs=setenv bootargs console=${console} " \ |
| 166 | "${optargs} " \ |
| 167 | "root=${mmcroot} " \ |
| 168 | "rootfstype=${mmcrootfstype}\0" \ |
Dan Murphy | 2b36fe5 | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 169 | "usbargs=setenv bootargs console=${console} " \ |
| 170 | "${optargs} " \ |
| 171 | "root=${usbroot} " \ |
| 172 | "rootfstype=${usbrootfstype}\0" \ |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 173 | "bootenv=uEnv.txt\0" \ |
Dan Murphy | 2b36fe5 | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 174 | "loadbootenv=load ${devtype} ${devnum} ${loadaddr} ${bootenv}\0" \ |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 175 | "importbootenv=echo Importing environment from mmc ...; " \ |
| 176 | "env import -t $loadaddr $filesize\0" \ |
| 177 | "ramargs=setenv bootargs console=${console} " \ |
| 178 | "${optargs} " \ |
| 179 | "root=${ramroot} " \ |
| 180 | "rootfstype=${ramrootfstype}\0" \ |
Dan Murphy | 2b36fe5 | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 181 | "loadramdisk=load ${devtype} ${devnum} ${rdaddr} ramdisk.gz\0" \ |
| 182 | "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ |
| 183 | "loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 184 | "mmcboot=mmc dev ${mmcdev}; " \ |
Dan Murphy | 2b36fe5 | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 185 | "setenv devnum ${mmcdev}; " \ |
Lokesh Vutla | fa03834 | 2014-06-02 10:45:38 +0530 | [diff] [blame] | 186 | "setenv devtype mmc; " \ |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 187 | "if mmc rescan; then " \ |
Dan Murphy | 2b36fe5 | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 188 | "echo SD/MMC found on device ${devnum};" \ |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 189 | "if run loadbootenv; then " \ |
| 190 | "echo Loaded environment from ${bootenv};" \ |
| 191 | "run importbootenv;" \ |
| 192 | "fi;" \ |
| 193 | "if test -n $uenvcmd; then " \ |
| 194 | "echo Running uenvcmd ...;" \ |
| 195 | "run uenvcmd;" \ |
| 196 | "fi;" \ |
| 197 | "if run loadimage; then " \ |
| 198 | "run loadfdt; " \ |
| 199 | "echo Booting from mmc${mmcdev} ...; " \ |
| 200 | "run mmcargs; " \ |
| 201 | "bootz ${loadaddr} - ${fdtaddr}; " \ |
| 202 | "fi;" \ |
| 203 | "fi;\0" \ |
Dan Murphy | 2b36fe5 | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 204 | "usbboot=" \ |
| 205 | "setenv devnum ${usbdev}; " \ |
| 206 | "setenv devtype usb; " \ |
| 207 | "usb start ${usbdev}; " \ |
| 208 | "if usb dev ${usbdev}; then " \ |
| 209 | "if run loadbootenv; then " \ |
| 210 | "echo Loaded environment from ${bootenv};" \ |
| 211 | "run importbootenv;" \ |
| 212 | "fi;" \ |
| 213 | "if test -n $uenvcmd; then " \ |
| 214 | "echo Running uenvcmd ...;" \ |
| 215 | "run uenvcmd;" \ |
| 216 | "fi;" \ |
| 217 | "if run loadimage; then " \ |
| 218 | "run loadfdt; " \ |
| 219 | "echo Booting from usb ${usbdev}...; " \ |
| 220 | "run usbargs;" \ |
| 221 | "bootz ${loadaddr} - ${fdtaddr}; " \ |
| 222 | "fi;" \ |
| 223 | "fi\0" \ |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 224 | "findfdt="\ |
| 225 | "if test $board_name = AM43EPOS; then " \ |
| 226 | "setenv fdtfile am43x-epos-evm.dtb; fi; " \ |
| 227 | "if test $board_name = AM43__GP; then " \ |
| 228 | "setenv fdtfile am437x-gp-evm.dtb; fi; " \ |
Felipe Balbi | 9cb9f33 | 2014-06-10 15:01:20 -0500 | [diff] [blame] | 229 | "if test $board_name = AM43__SK; then " \ |
| 230 | "setenv fdtfile am437x-sk-evm.dtb; fi; " \ |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 231 | "if test $fdtfile = undefined; then " \ |
| 232 | "echo WARNING: Could not determine device tree; fi; \0" |
| 233 | |
| 234 | #define CONFIG_BOOTCOMMAND \ |
| 235 | "run findfdt; " \ |
Dan Murphy | 2b36fe5 | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 236 | "run mmcboot;" \ |
| 237 | "run usbboot;" |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 238 | |
Mugunthan V N | 3a3939b | 2014-02-18 07:31:58 -0500 | [diff] [blame] | 239 | #endif |
| 240 | |
Mugunthan V N | 4cdd7fd | 2014-02-18 07:31:54 -0500 | [diff] [blame] | 241 | /* CPSW Ethernet */ |
| 242 | #define CONFIG_CMD_NET |
| 243 | #define CONFIG_CMD_DHCP |
| 244 | #define CONFIG_CMD_PING |
| 245 | #define CONFIG_CMD_MII |
| 246 | #define CONFIG_DRIVER_TI_CPSW |
| 247 | #define CONFIG_MII |
| 248 | #define CONFIG_BOOTP_DEFAULT |
| 249 | #define CONFIG_BOOTP_DNS |
| 250 | #define CONFIG_BOOTP_DNS2 |
| 251 | #define CONFIG_BOOTP_SEND_HOSTNAME |
| 252 | #define CONFIG_BOOTP_GATEWAY |
| 253 | #define CONFIG_BOOTP_SUBNETMASK |
| 254 | #define CONFIG_NET_RETRY_COUNT 10 |
| 255 | #define CONFIG_NET_MULTI |
| 256 | #define CONFIG_PHY_GIGE |
| 257 | #define CONFIG_PHYLIB |
Mugunthan V N | 4cdd7fd | 2014-02-18 07:31:54 -0500 | [diff] [blame] | 258 | |
Mugunthan V N | 3a3939b | 2014-02-18 07:31:58 -0500 | [diff] [blame] | 259 | #define CONFIG_SPL_ENV_SUPPORT |
| 260 | #define CONFIG_SPL_NET_VCI_STRING "AM43xx U-Boot SPL" |
| 261 | |
| 262 | #define CONFIG_SPL_ETH_SUPPORT |
| 263 | #define CONFIG_SPL_NET_SUPPORT |
| 264 | #define CONFIG_SYS_RX_ETH_BUFFER 64 |
| 265 | |
Lokesh Vutla | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 266 | #endif /* __CONFIG_AM43XX_EVM_H */ |