Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 1 | /* |
| 2 | * am335x_evm.h |
| 3 | * |
| 4 | * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License as |
| 8 | * published by the Free Software Foundation version 2. |
| 9 | * |
| 10 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any |
| 11 | * kind, whether express or implied; without even the implied warranty |
| 12 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | */ |
| 15 | |
| 16 | #ifndef __CONFIG_BALTOS_H |
| 17 | #define __CONFIG_BALTOS_H |
| 18 | |
Yegor Yefremov | 51c4ccb | 2015-07-06 17:28:36 +0200 | [diff] [blame] | 19 | #include <linux/sizes.h> |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 20 | #include <configs/ti_am335x_common.h> |
| 21 | |
Tom Rini | d997f7c | 2017-01-25 20:42:36 -0500 | [diff] [blame] | 22 | #define CONFIG_MACH_TYPE MACH_TYPE_AM335XEVM |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 23 | |
| 24 | /* Clock Defines */ |
| 25 | #define V_OSCK 24000000 /* Clock output from T2 */ |
| 26 | #define V_SCLK (V_OSCK) |
| 27 | |
| 28 | /* Custom script for NOR */ |
| 29 | #define CONFIG_SYS_LDSCRIPT "board/vscom/baltos/u-boot.lds" |
| 30 | |
| 31 | /* Always 128 KiB env size */ |
| 32 | #define CONFIG_ENV_SIZE (128 << 10) |
| 33 | |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 34 | /* FIT support */ |
Yegor Yefremov | 51c4ccb | 2015-07-06 17:28:36 +0200 | [diff] [blame] | 35 | #define CONFIG_SYS_BOOTM_LEN SZ_64M |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 36 | |
| 37 | /* UBI Support */ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 38 | #define CONFIG_MTD_PARTITIONS |
| 39 | #define CONFIG_MTD_DEVICE |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 40 | |
| 41 | /* I2C configuration */ |
| 42 | #undef CONFIG_SYS_OMAP24_I2C_SPEED |
Yegor Yefremov | 429b079 | 2015-07-06 17:28:35 +0200 | [diff] [blame] | 43 | #define CONFIG_SYS_OMAP24_I2C_SPEED 1000 |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 44 | |
| 45 | #ifdef CONFIG_NAND |
Yegor Yefremov | 51c4ccb | 2015-07-06 17:28:36 +0200 | [diff] [blame] | 46 | #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x00080000 |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 47 | #ifdef CONFIG_SPL_OS_BOOT |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 48 | #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00200000 /* kernel offset */ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 49 | #endif |
| 50 | #define NANDARGS \ |
Tom Rini | 5ad8e11 | 2017-10-22 17:55:07 -0400 | [diff] [blame^] | 51 | "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \ |
| 52 | "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 53 | "nandargs=setenv bootargs console=${console} " \ |
| 54 | "${optargs} " \ |
| 55 | "${mtdparts} " \ |
| 56 | "root=${nandroot} " \ |
| 57 | "rootfstype=${nandrootfstype}\0" \ |
| 58 | "nandroot=ubi0:rootfs rw ubi.mtd=5\0" \ |
| 59 | "nandrootfstype=ubifs rootwait=1\0" \ |
| 60 | "nandboot=echo Booting from nand ...; " \ |
| 61 | "run nandargs; " \ |
| 62 | "setenv loadaddr 0x84000000; " \ |
| 63 | "ubi part UBI; " \ |
| 64 | "ubifsmount ubi0:kernel; " \ |
| 65 | "ubifsload $loadaddr kernel-fit.itb;" \ |
| 66 | "ubifsumount; " \ |
Yegor Yefremov | 51c4ccb | 2015-07-06 17:28:36 +0200 | [diff] [blame] | 67 | "bootm ${loadaddr}#conf${board_name}; " \ |
| 68 | "if test $? -ne 0; then echo Using default FIT config; " \ |
| 69 | "bootm ${loadaddr}; fi;\0" |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 70 | #else |
| 71 | #define NANDARGS "" |
| 72 | #endif |
| 73 | |
| 74 | #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG |
| 75 | |
| 76 | #ifndef CONFIG_SPL_BUILD |
| 77 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 78 | DEFAULT_LINUX_BOOT_ENV \ |
| 79 | "boot_fdt=try\0" \ |
| 80 | "bootpart=0:2\0" \ |
| 81 | "bootdir=/boot\0" \ |
| 82 | "bootfile=zImage\0" \ |
| 83 | "fdtfile=undefined\0" \ |
| 84 | "console=ttyO0,115200n8\0" \ |
| 85 | "partitions=" \ |
| 86 | "uuid_disk=${uuid_gpt_disk};" \ |
| 87 | "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \ |
| 88 | "optargs=\0" \ |
| 89 | "mmcdev=0\0" \ |
| 90 | "mmcroot=/dev/mmcblk0p2 ro\0" \ |
Yegor Yefremov | 2f5697e | 2016-12-01 12:52:18 +0100 | [diff] [blame] | 91 | "usbroot=/dev/sda2 ro\0" \ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 92 | "mmcrootfstype=ext4 rootwait\0" \ |
Yegor Yefremov | 2f5697e | 2016-12-01 12:52:18 +0100 | [diff] [blame] | 93 | "usbrootfstype=ext4 rootwait\0" \ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 94 | "rootpath=/export/rootfs\0" \ |
| 95 | "nfsopts=nolock\0" \ |
| 96 | "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \ |
| 97 | "::off\0" \ |
| 98 | "ramroot=/dev/ram0 rw\0" \ |
| 99 | "ramrootfstype=ext2\0" \ |
| 100 | "mmcargs=setenv bootargs console=${console} " \ |
| 101 | "${optargs} " \ |
| 102 | "${mtdparts} " \ |
| 103 | "root=${mmcroot} " \ |
| 104 | "rootfstype=${mmcrootfstype}\0" \ |
Yegor Yefremov | 2f5697e | 2016-12-01 12:52:18 +0100 | [diff] [blame] | 105 | "usbargs=setenv bootargs console=${console} " \ |
| 106 | "${optargs} " \ |
| 107 | "${mtdparts} " \ |
| 108 | "root=${usbroot} " \ |
| 109 | "rootfstype=${usbrootfstype}\0" \ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 110 | "spiroot=/dev/mtdblock4 rw\0" \ |
| 111 | "spirootfstype=jffs2\0" \ |
| 112 | "spisrcaddr=0xe0000\0" \ |
| 113 | "spiimgsize=0x362000\0" \ |
| 114 | "spibusno=0\0" \ |
| 115 | "spiargs=setenv bootargs console=${console} " \ |
| 116 | "${optargs} " \ |
| 117 | "root=${spiroot} " \ |
| 118 | "rootfstype=${spirootfstype}\0" \ |
| 119 | "netargs=setenv bootargs console=${console} " \ |
| 120 | "${optargs} " \ |
| 121 | "root=/dev/nfs " \ |
| 122 | "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \ |
| 123 | "ip=dhcp\0" \ |
| 124 | "bootenv=uEnv.txt\0" \ |
| 125 | "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \ |
Yegor Yefremov | 2f5697e | 2016-12-01 12:52:18 +0100 | [diff] [blame] | 126 | "usbloadbootenv=load usb 0:1 ${loadaddr} ${bootenv}\0" \ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 127 | "importbootenv=echo Importing environment from mmc ...; " \ |
| 128 | "env import -t $loadaddr $filesize\0" \ |
Yegor Yefremov | 2f5697e | 2016-12-01 12:52:18 +0100 | [diff] [blame] | 129 | "usbimportbootenv=echo Importing environment from USB ...; " \ |
| 130 | "env import -t $loadaddr $filesize\0" \ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 131 | "ramargs=setenv bootargs console=${console} " \ |
| 132 | "${optargs} " \ |
| 133 | "root=${ramroot} " \ |
| 134 | "rootfstype=${ramrootfstype}\0" \ |
| 135 | "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \ |
| 136 | "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ |
Yegor Yefremov | 2f5697e | 2016-12-01 12:52:18 +0100 | [diff] [blame] | 137 | "usbloadimage=load usb 0:1 ${loadaddr} kernel-fit.itb\0" \ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 138 | "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ |
Yegor Yefremov | 2f5697e | 2016-12-01 12:52:18 +0100 | [diff] [blame] | 139 | "usbloados=run usbargs; " \ |
| 140 | "bootm ${loadaddr}#conf${board_name}; " \ |
| 141 | "if test $? -ne 0; then " \ |
| 142 | "echo Using default FIT configuration; " \ |
| 143 | "bootm ${loadaddr}; " \ |
| 144 | "fi;\0" \ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 145 | "mmcloados=run mmcargs; " \ |
| 146 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
| 147 | "if run loadfdt; then " \ |
| 148 | "bootz ${loadaddr} - ${fdtaddr}; " \ |
| 149 | "else " \ |
| 150 | "if test ${boot_fdt} = try; then " \ |
| 151 | "bootz; " \ |
| 152 | "else " \ |
| 153 | "echo WARN: Cannot load the DT; " \ |
| 154 | "fi; " \ |
| 155 | "fi; " \ |
| 156 | "else " \ |
| 157 | "bootz; " \ |
| 158 | "fi;\0" \ |
Yegor Yefremov | 2f5697e | 2016-12-01 12:52:18 +0100 | [diff] [blame] | 159 | "usbboot=usb reset; " \ |
| 160 | "if usb storage; then " \ |
| 161 | "echo USB drive found;" \ |
| 162 | "if run usbloadbootenv; then " \ |
| 163 | "echo Loaded environment from ${bootenv};" \ |
| 164 | "run usbimportbootenv;" \ |
| 165 | "fi;" \ |
| 166 | "if test -n $uenvcmd; then " \ |
| 167 | "echo Running uenvcmd ...;" \ |
| 168 | "run uenvcmd;" \ |
| 169 | "fi;" \ |
| 170 | "if run usbloadimage; then " \ |
| 171 | "run usbloados;" \ |
| 172 | "fi;" \ |
| 173 | "fi;\0" \ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 174 | "mmcboot=mmc dev ${mmcdev}; " \ |
| 175 | "if mmc rescan; then " \ |
| 176 | "echo SD/MMC found on device ${mmcdev};" \ |
| 177 | "if run loadbootenv; then " \ |
| 178 | "echo Loaded environment from ${bootenv};" \ |
| 179 | "run importbootenv;" \ |
| 180 | "fi;" \ |
| 181 | "if test -n $uenvcmd; then " \ |
| 182 | "echo Running uenvcmd ...;" \ |
| 183 | "run uenvcmd;" \ |
| 184 | "fi;" \ |
| 185 | "if run loadimage; then " \ |
| 186 | "run mmcloados;" \ |
| 187 | "fi;" \ |
| 188 | "fi;\0" \ |
| 189 | "spiboot=echo Booting from spi ...; " \ |
| 190 | "run spiargs; " \ |
| 191 | "sf probe ${spibusno}:0; " \ |
| 192 | "sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \ |
| 193 | "bootz ${loadaddr}\0" \ |
| 194 | "netboot=echo Booting from network ...; " \ |
| 195 | "setenv autoload no; " \ |
| 196 | "dhcp; " \ |
| 197 | "tftp ${loadaddr} ${bootfile}; " \ |
| 198 | "tftp ${fdtaddr} ${fdtfile}; " \ |
| 199 | "run netargs; " \ |
| 200 | "bootz ${loadaddr} - ${fdtaddr}\0" \ |
| 201 | "ramboot=echo Booting from ramdisk ...; " \ |
| 202 | "run ramargs; " \ |
| 203 | "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \ |
| 204 | "findfdt=setenv fdtfile am335x-baltos.dtb\0" \ |
| 205 | NANDARGS |
| 206 | /*DFUARGS*/ |
| 207 | #endif |
| 208 | |
| 209 | #define CONFIG_BOOTCOMMAND \ |
| 210 | "run findfdt; " \ |
Yegor Yefremov | 2f5697e | 2016-12-01 12:52:18 +0100 | [diff] [blame] | 211 | "run usbboot;" \ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 212 | "run mmcboot;" \ |
| 213 | "setenv mmcdev 1; " \ |
| 214 | "setenv bootpart 1:2; " \ |
| 215 | "run mmcboot;" \ |
| 216 | "run nandboot;" |
| 217 | |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 218 | /* NS16550 Configuration */ |
| 219 | #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */ |
| 220 | #define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */ |
| 221 | #define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */ |
| 222 | #define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */ |
| 223 | #define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */ |
| 224 | #define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 225 | |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 226 | #define CONFIG_ENV_EEPROM_IS_ON_I2C |
| 227 | #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* Main EEPROM */ |
| 228 | #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 229 | |
| 230 | /* PMIC support */ |
| 231 | #define CONFIG_POWER_TPS65910 |
| 232 | |
| 233 | /* SPL */ |
| 234 | #ifndef CONFIG_NOR_BOOT |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 235 | /* Bootcount using the RTC block */ |
| 236 | #define CONFIG_BOOTCOUNT_LIMIT |
| 237 | #define CONFIG_BOOTCOUNT_AM33XX |
| 238 | |
| 239 | /* USB gadget RNDIS */ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 240 | |
| 241 | /* General network SPL, both CPSW and USB gadget RNDIS */ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 242 | #define CONFIG_SPL_NET_VCI_STRING "AM335x U-Boot SPL"*/ |
| 243 | |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 244 | #ifdef CONFIG_NAND |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 245 | #define CONFIG_SYS_NAND_5_ADDR_CYCLE |
| 246 | #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \ |
| 247 | CONFIG_SYS_NAND_PAGE_SIZE) |
| 248 | #define CONFIG_SYS_NAND_PAGE_SIZE 2048 |
| 249 | #define CONFIG_SYS_NAND_OOBSIZE 64 |
| 250 | #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024) |
| 251 | #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS |
| 252 | #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \ |
| 253 | 10, 11, 12, 13, 14, 15, 16, 17, \ |
| 254 | 18, 19, 20, 21, 22, 23, 24, 25, \ |
| 255 | 26, 27, 28, 29, 30, 31, 32, 33, \ |
| 256 | 34, 35, 36, 37, 38, 39, 40, 41, \ |
| 257 | 42, 43, 44, 45, 46, 47, 48, 49, \ |
| 258 | 50, 51, 52, 53, 54, 55, 56, 57, } |
| 259 | |
| 260 | #define CONFIG_SYS_NAND_ECCSIZE 512 |
| 261 | #define CONFIG_SYS_NAND_ECCBYTES 14 |
| 262 | #define CONFIG_SYS_NAND_ONFI_DETECTION |
| 263 | #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW |
| 264 | #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE |
| 265 | #endif |
| 266 | #endif |
| 267 | |
| 268 | /* |
| 269 | * USB configuration. We enable MUSB support, both for host and for |
| 270 | * gadget. We set USB0 as peripheral and USB1 as host, based on the |
| 271 | * board schematic and physical port wired to each. Then for host we |
| 272 | * add mass storage support and for gadget we add both RNDIS ethernet |
| 273 | * and DFU. |
| 274 | */ |
| 275 | #define CONFIG_USB_MUSB_DSPS |
Paul Kocialkowski | f34dfcb | 2015-08-04 17:04:06 +0200 | [diff] [blame] | 276 | #define CONFIG_USB_MUSB_PIO_ONLY |
| 277 | #define CONFIG_USB_MUSB_DISABLE_BULK_COMBINE_SPLIT |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 278 | #define CONFIG_AM335X_USB0 |
Yegor Yefremov | d7bd6cb | 2015-07-09 13:34:24 +0200 | [diff] [blame] | 279 | #define CONFIG_AM335X_USB0_MODE MUSB_HOST |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 280 | #define CONFIG_AM335X_USB1 |
Yegor Yefremov | d7bd6cb | 2015-07-09 13:34:24 +0200 | [diff] [blame] | 281 | #define CONFIG_AM335X_USB1_MODE MUSB_OTG |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 282 | |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 283 | #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT) |
| 284 | /* disable host part of MUSB in SPL */ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 285 | /* disable EFI partitions and partition UUID support */ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 286 | /* |
| 287 | * Disable CPSW SPL support so we fit within the 101KiB limit. |
| 288 | */ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 289 | #endif |
| 290 | |
| 291 | /* Network. */ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 292 | #define CONFIG_PHY_ADDR 0 |
| 293 | #define CONFIG_PHY_SMSC |
| 294 | #define CONFIG_MII |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 295 | #define CONFIG_PHY_ATHEROS |
| 296 | |
| 297 | /* NAND support */ |
| 298 | #ifdef CONFIG_NAND |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 299 | #define GPMC_NAND_ECC_LP_x8_LAYOUT 1 |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 300 | #endif |
| 301 | |
| 302 | #endif /* ! __CONFIG_BALTOS_H */ |