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 | |
Lokesh Vutla | 369cbe1 | 2013-12-10 15:02:12 +0530 | [diff] [blame] | 35 | /* SPL defines. */ |
| 36 | #define CONFIG_SPL_TEXT_BASE 0x40300350 |
Tom Rini | b1cde7e | 2014-01-20 08:40:07 -0500 | [diff] [blame] | 37 | #define CONFIG_SPL_MAX_SIZE (220 << 10) /* 220KB */ |
Lokesh Vutla | 369cbe1 | 2013-12-10 15:02:12 +0530 | [diff] [blame] | 38 | #define CONFIG_SPL_YMODEM_SUPPORT |
Lokesh Vutla | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 39 | |
Lokesh Vutla | 573b020 | 2013-12-10 15:02:13 +0530 | [diff] [blame] | 40 | /* Enabling L2 Cache */ |
| 41 | #define CONFIG_SYS_L2_PL310 |
| 42 | #define CONFIG_SYS_PL310_BASE 0x48242000 |
| 43 | #define CONFIG_SYS_CACHELINE_SIZE 32 |
| 44 | |
Lokesh Vutla | 369cbe1 | 2013-12-10 15:02:12 +0530 | [diff] [blame] | 45 | /* |
| 46 | * Since SPL did pll and ddr initialization for us, |
| 47 | * we don't need to do it twice. |
| 48 | */ |
| 49 | #if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_NOR_BOOT) |
| 50 | #define CONFIG_SKIP_LOWLEVEL_INIT |
| 51 | #endif |
Lokesh Vutla | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 52 | |
Lokesh Vutla | 369cbe1 | 2013-12-10 15:02:12 +0530 | [diff] [blame] | 53 | /* Now bring in the rest of the common code. */ |
| 54 | #include <configs/ti_armv7_common.h> |
Lokesh Vutla | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 55 | |
Lokesh Vutla | 369cbe1 | 2013-12-10 15:02:12 +0530 | [diff] [blame] | 56 | /* Always 128 KiB env size */ |
| 57 | #define CONFIG_ENV_SIZE (128 << 10) |
Lokesh Vutla | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 58 | |
Lokesh Vutla | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 59 | #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG |
| 60 | |
| 61 | /* Clock Defines */ |
| 62 | #define V_OSCK 24000000 /* Clock output from T2 */ |
| 63 | #define V_SCLK (V_OSCK) |
| 64 | |
Lokesh Vutla | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 65 | /* NS16550 Configuration */ |
Lokesh Vutla | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 66 | #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */ |
| 67 | |
Lokesh Vutla | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 68 | #define CONFIG_ENV_IS_NOWHERE |
| 69 | |
Lokesh Vutla | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 70 | #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/omap-common/u-boot-spl.lds" |
| 71 | |
Dan Murphy | 2b36fe5 | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 72 | /* SPL USB Support */ |
| 73 | #define CONFIG_SPL_USB_SUPPORT |
| 74 | #define CONFIG_SPL_USB_HOST_SUPPORT |
| 75 | #define CONFIG_SYS_USB_FAT_BOOT_PARTITION 1 |
| 76 | |
Dan Murphy | 3d799c7 | 2013-10-11 12:28:18 -0500 | [diff] [blame] | 77 | #define CONFIG_CMD_USB |
| 78 | #define CONFIG_USB_HOST |
| 79 | #define CONFIG_USB_XHCI |
| 80 | #define CONFIG_USB_XHCI_OMAP |
| 81 | #define CONFIG_USB_STORAGE |
| 82 | #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 2 |
| 83 | |
| 84 | #define CONFIG_OMAP_USB_PHY |
| 85 | #define CONFIG_AM437X_USB2PHY2_HOST |
| 86 | |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 87 | #ifndef CONFIG_SPL_BUILD |
| 88 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 89 | "loadaddr=0x80200000\0" \ |
| 90 | "fdtaddr=0x80F80000\0" \ |
| 91 | "fdt_high=0xffffffff\0" \ |
| 92 | "rdaddr=0x81000000\0" \ |
| 93 | "fdtfile=undefined\0" \ |
| 94 | "bootpart=0:2\0" \ |
| 95 | "bootdir=/boot\0" \ |
| 96 | "bootfile=zImage\0" \ |
| 97 | "console=ttyO0,115200n8\0" \ |
| 98 | "optargs=\0" \ |
| 99 | "mmcdev=0\0" \ |
| 100 | "mmcroot=/dev/mmcblk0p2 rw\0" \ |
| 101 | "mmcrootfstype=ext4 rootwait\0" \ |
Dan Murphy | 2b36fe5 | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 102 | "usbroot=/dev/sda2 rw\0" \ |
| 103 | "usbrootfstype=ext4 rootwait\0" \ |
| 104 | "usbdev=0\0" \ |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 105 | "ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64M\0" \ |
| 106 | "ramrootfstype=ext2\0" \ |
| 107 | "mmcargs=setenv bootargs console=${console} " \ |
| 108 | "${optargs} " \ |
| 109 | "root=${mmcroot} " \ |
| 110 | "rootfstype=${mmcrootfstype}\0" \ |
Dan Murphy | 2b36fe5 | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 111 | "usbargs=setenv bootargs console=${console} " \ |
| 112 | "${optargs} " \ |
| 113 | "root=${usbroot} " \ |
| 114 | "rootfstype=${usbrootfstype}\0" \ |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 115 | "bootenv=uEnv.txt\0" \ |
Dan Murphy | 2b36fe5 | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 116 | "loadbootenv=load ${devtype} ${devnum} ${loadaddr} ${bootenv}\0" \ |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 117 | "importbootenv=echo Importing environment from mmc ...; " \ |
| 118 | "env import -t $loadaddr $filesize\0" \ |
| 119 | "ramargs=setenv bootargs console=${console} " \ |
| 120 | "${optargs} " \ |
| 121 | "root=${ramroot} " \ |
| 122 | "rootfstype=${ramrootfstype}\0" \ |
Dan Murphy | 2b36fe5 | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 123 | "loadramdisk=load ${devtype} ${devnum} ${rdaddr} ramdisk.gz\0" \ |
| 124 | "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ |
| 125 | "loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 126 | "mmcboot=mmc dev ${mmcdev}; " \ |
Dan Murphy | 2b36fe5 | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 127 | "setenv devnum ${mmcdev}; " \ |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 128 | "if mmc rescan; then " \ |
Dan Murphy | 2b36fe5 | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 129 | "echo SD/MMC found on device ${devnum};" \ |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 130 | "if run loadbootenv; then " \ |
| 131 | "echo Loaded environment from ${bootenv};" \ |
| 132 | "run importbootenv;" \ |
| 133 | "fi;" \ |
| 134 | "if test -n $uenvcmd; then " \ |
| 135 | "echo Running uenvcmd ...;" \ |
| 136 | "run uenvcmd;" \ |
| 137 | "fi;" \ |
| 138 | "if run loadimage; then " \ |
| 139 | "run loadfdt; " \ |
| 140 | "echo Booting from mmc${mmcdev} ...; " \ |
| 141 | "run mmcargs; " \ |
| 142 | "bootz ${loadaddr} - ${fdtaddr}; " \ |
| 143 | "fi;" \ |
| 144 | "fi;\0" \ |
Dan Murphy | 2b36fe5 | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 145 | "usbboot=" \ |
| 146 | "setenv devnum ${usbdev}; " \ |
| 147 | "setenv devtype usb; " \ |
| 148 | "usb start ${usbdev}; " \ |
| 149 | "if usb dev ${usbdev}; then " \ |
| 150 | "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 usb ${usbdev}...; " \ |
| 161 | "run usbargs;" \ |
| 162 | "bootz ${loadaddr} - ${fdtaddr}; " \ |
| 163 | "fi;" \ |
| 164 | "fi\0" \ |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 165 | "findfdt="\ |
| 166 | "if test $board_name = AM43EPOS; then " \ |
| 167 | "setenv fdtfile am43x-epos-evm.dtb; fi; " \ |
| 168 | "if test $board_name = AM43__GP; then " \ |
| 169 | "setenv fdtfile am437x-gp-evm.dtb; fi; " \ |
| 170 | "if test $fdtfile = undefined; then " \ |
| 171 | "echo WARNING: Could not determine device tree; fi; \0" |
| 172 | |
| 173 | #define CONFIG_BOOTCOMMAND \ |
| 174 | "run findfdt; " \ |
Dan Murphy | 2b36fe5 | 2014-01-16 11:23:31 -0600 | [diff] [blame] | 175 | "run mmcboot;" \ |
| 176 | "run usbboot;" |
Lokesh Vutla | 1564dba | 2013-12-10 15:02:14 +0530 | [diff] [blame] | 177 | |
| 178 | #endif |
Lokesh Vutla | 8d0afcd | 2013-07-30 11:36:32 +0530 | [diff] [blame] | 179 | #endif /* __CONFIG_AM43XX_EVM_H */ |