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 | |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 22 | /* Clock Defines */ |
| 23 | #define V_OSCK 24000000 /* Clock output from T2 */ |
| 24 | #define V_SCLK (V_OSCK) |
| 25 | |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 26 | /* FIT support */ |
Yegor Yefremov | 51c4ccb | 2015-07-06 17:28:36 +0200 | [diff] [blame] | 27 | #define CONFIG_SYS_BOOTM_LEN SZ_64M |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 28 | |
Miquel Raynal | d093536 | 2019-10-03 19:50:03 +0200 | [diff] [blame] | 29 | #ifdef CONFIG_MTD_RAW_NAND |
Yegor Yefremov | 319293a | 2018-11-22 09:19:32 +0100 | [diff] [blame] | 30 | |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 31 | #define NANDARGS \ |
Tom Rini | 5ad8e11 | 2017-10-22 17:55:07 -0400 | [diff] [blame] | 32 | "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \ |
| 33 | "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 34 | "nandargs=setenv bootargs console=${console} " \ |
| 35 | "${optargs} " \ |
| 36 | "${mtdparts} " \ |
| 37 | "root=${nandroot} " \ |
| 38 | "rootfstype=${nandrootfstype}\0" \ |
| 39 | "nandroot=ubi0:rootfs rw ubi.mtd=5\0" \ |
| 40 | "nandrootfstype=ubifs rootwait=1\0" \ |
| 41 | "nandboot=echo Booting from nand ...; " \ |
| 42 | "run nandargs; " \ |
| 43 | "setenv loadaddr 0x84000000; " \ |
| 44 | "ubi part UBI; " \ |
| 45 | "ubifsmount ubi0:kernel; " \ |
| 46 | "ubifsload $loadaddr kernel-fit.itb;" \ |
| 47 | "ubifsumount; " \ |
Yegor Yefremov | 51c4ccb | 2015-07-06 17:28:36 +0200 | [diff] [blame] | 48 | "bootm ${loadaddr}#conf${board_name}; " \ |
| 49 | "if test $? -ne 0; then echo Using default FIT config; " \ |
| 50 | "bootm ${loadaddr}; fi;\0" |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 51 | #else |
| 52 | #define NANDARGS "" |
| 53 | #endif |
| 54 | |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 55 | #ifndef CONFIG_SPL_BUILD |
| 56 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 57 | DEFAULT_LINUX_BOOT_ENV \ |
| 58 | "boot_fdt=try\0" \ |
| 59 | "bootpart=0:2\0" \ |
| 60 | "bootdir=/boot\0" \ |
| 61 | "bootfile=zImage\0" \ |
| 62 | "fdtfile=undefined\0" \ |
| 63 | "console=ttyO0,115200n8\0" \ |
| 64 | "partitions=" \ |
| 65 | "uuid_disk=${uuid_gpt_disk};" \ |
| 66 | "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \ |
| 67 | "optargs=\0" \ |
| 68 | "mmcdev=0\0" \ |
| 69 | "mmcroot=/dev/mmcblk0p2 ro\0" \ |
Yegor Yefremov | 2f5697e | 2016-12-01 12:52:18 +0100 | [diff] [blame] | 70 | "usbroot=/dev/sda2 ro\0" \ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 71 | "mmcrootfstype=ext4 rootwait\0" \ |
Yegor Yefremov | 2f5697e | 2016-12-01 12:52:18 +0100 | [diff] [blame] | 72 | "usbrootfstype=ext4 rootwait\0" \ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 73 | "rootpath=/export/rootfs\0" \ |
| 74 | "nfsopts=nolock\0" \ |
| 75 | "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \ |
| 76 | "::off\0" \ |
| 77 | "ramroot=/dev/ram0 rw\0" \ |
| 78 | "ramrootfstype=ext2\0" \ |
| 79 | "mmcargs=setenv bootargs console=${console} " \ |
| 80 | "${optargs} " \ |
| 81 | "${mtdparts} " \ |
| 82 | "root=${mmcroot} " \ |
| 83 | "rootfstype=${mmcrootfstype}\0" \ |
Yegor Yefremov | 2f5697e | 2016-12-01 12:52:18 +0100 | [diff] [blame] | 84 | "usbargs=setenv bootargs console=${console} " \ |
| 85 | "${optargs} " \ |
| 86 | "${mtdparts} " \ |
| 87 | "root=${usbroot} " \ |
| 88 | "rootfstype=${usbrootfstype}\0" \ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 89 | "spiroot=/dev/mtdblock4 rw\0" \ |
| 90 | "spirootfstype=jffs2\0" \ |
| 91 | "spisrcaddr=0xe0000\0" \ |
| 92 | "spiimgsize=0x362000\0" \ |
| 93 | "spibusno=0\0" \ |
| 94 | "spiargs=setenv bootargs console=${console} " \ |
| 95 | "${optargs} " \ |
| 96 | "root=${spiroot} " \ |
| 97 | "rootfstype=${spirootfstype}\0" \ |
| 98 | "netargs=setenv bootargs console=${console} " \ |
| 99 | "${optargs} " \ |
| 100 | "root=/dev/nfs " \ |
| 101 | "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \ |
| 102 | "ip=dhcp\0" \ |
| 103 | "bootenv=uEnv.txt\0" \ |
| 104 | "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \ |
Yegor Yefremov | 2f5697e | 2016-12-01 12:52:18 +0100 | [diff] [blame] | 105 | "usbloadbootenv=load usb 0:1 ${loadaddr} ${bootenv}\0" \ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 106 | "importbootenv=echo Importing environment from mmc ...; " \ |
| 107 | "env import -t $loadaddr $filesize\0" \ |
Yegor Yefremov | 2f5697e | 2016-12-01 12:52:18 +0100 | [diff] [blame] | 108 | "usbimportbootenv=echo Importing environment from USB ...; " \ |
| 109 | "env import -t $loadaddr $filesize\0" \ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 110 | "ramargs=setenv bootargs console=${console} " \ |
| 111 | "${optargs} " \ |
| 112 | "root=${ramroot} " \ |
| 113 | "rootfstype=${ramrootfstype}\0" \ |
| 114 | "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \ |
| 115 | "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ |
Yegor Yefremov | 2f5697e | 2016-12-01 12:52:18 +0100 | [diff] [blame] | 116 | "usbloadimage=load usb 0:1 ${loadaddr} kernel-fit.itb\0" \ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 117 | "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ |
Yegor Yefremov | 2f5697e | 2016-12-01 12:52:18 +0100 | [diff] [blame] | 118 | "usbloados=run usbargs; " \ |
| 119 | "bootm ${loadaddr}#conf${board_name}; " \ |
| 120 | "if test $? -ne 0; then " \ |
| 121 | "echo Using default FIT configuration; " \ |
| 122 | "bootm ${loadaddr}; " \ |
| 123 | "fi;\0" \ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 124 | "mmcloados=run mmcargs; " \ |
| 125 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
| 126 | "if run loadfdt; then " \ |
| 127 | "bootz ${loadaddr} - ${fdtaddr}; " \ |
| 128 | "else " \ |
| 129 | "if test ${boot_fdt} = try; then " \ |
| 130 | "bootz; " \ |
| 131 | "else " \ |
| 132 | "echo WARN: Cannot load the DT; " \ |
| 133 | "fi; " \ |
| 134 | "fi; " \ |
| 135 | "else " \ |
| 136 | "bootz; " \ |
| 137 | "fi;\0" \ |
Yegor Yefremov | 2f5697e | 2016-12-01 12:52:18 +0100 | [diff] [blame] | 138 | "usbboot=usb reset; " \ |
| 139 | "if usb storage; then " \ |
| 140 | "echo USB drive found;" \ |
| 141 | "if run usbloadbootenv; then " \ |
| 142 | "echo Loaded environment from ${bootenv};" \ |
| 143 | "run usbimportbootenv;" \ |
| 144 | "fi;" \ |
| 145 | "if test -n $uenvcmd; then " \ |
| 146 | "echo Running uenvcmd ...;" \ |
| 147 | "run uenvcmd;" \ |
| 148 | "fi;" \ |
| 149 | "if run usbloadimage; then " \ |
| 150 | "run usbloados;" \ |
| 151 | "fi;" \ |
| 152 | "fi;\0" \ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 153 | "mmcboot=mmc dev ${mmcdev}; " \ |
| 154 | "if mmc rescan; then " \ |
| 155 | "echo SD/MMC found on device ${mmcdev};" \ |
| 156 | "if run loadbootenv; then " \ |
| 157 | "echo Loaded environment from ${bootenv};" \ |
| 158 | "run importbootenv;" \ |
| 159 | "fi;" \ |
| 160 | "if test -n $uenvcmd; then " \ |
| 161 | "echo Running uenvcmd ...;" \ |
| 162 | "run uenvcmd;" \ |
| 163 | "fi;" \ |
| 164 | "if run loadimage; then " \ |
| 165 | "run mmcloados;" \ |
| 166 | "fi;" \ |
| 167 | "fi;\0" \ |
| 168 | "spiboot=echo Booting from spi ...; " \ |
| 169 | "run spiargs; " \ |
| 170 | "sf probe ${spibusno}:0; " \ |
| 171 | "sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \ |
| 172 | "bootz ${loadaddr}\0" \ |
| 173 | "netboot=echo Booting from network ...; " \ |
| 174 | "setenv autoload no; " \ |
| 175 | "dhcp; " \ |
| 176 | "tftp ${loadaddr} ${bootfile}; " \ |
| 177 | "tftp ${fdtaddr} ${fdtfile}; " \ |
| 178 | "run netargs; " \ |
| 179 | "bootz ${loadaddr} - ${fdtaddr}\0" \ |
| 180 | "ramboot=echo Booting from ramdisk ...; " \ |
| 181 | "run ramargs; " \ |
| 182 | "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \ |
| 183 | "findfdt=setenv fdtfile am335x-baltos.dtb\0" \ |
| 184 | NANDARGS |
| 185 | /*DFUARGS*/ |
| 186 | #endif |
| 187 | |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 188 | /* NS16550 Configuration */ |
| 189 | #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */ |
| 190 | #define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */ |
| 191 | #define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */ |
| 192 | #define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */ |
| 193 | #define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */ |
| 194 | #define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */ |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 195 | |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 196 | /* PMIC support */ |
| 197 | #define CONFIG_POWER_TPS65910 |
| 198 | |
| 199 | /* SPL */ |
| 200 | #ifndef CONFIG_NOR_BOOT |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 201 | |
Miquel Raynal | d093536 | 2019-10-03 19:50:03 +0200 | [diff] [blame] | 202 | #ifdef CONFIG_MTD_RAW_NAND |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 203 | #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \ |
| 204 | 10, 11, 12, 13, 14, 15, 16, 17, \ |
| 205 | 18, 19, 20, 21, 22, 23, 24, 25, \ |
| 206 | 26, 27, 28, 29, 30, 31, 32, 33, \ |
| 207 | 34, 35, 36, 37, 38, 39, 40, 41, \ |
| 208 | 42, 43, 44, 45, 46, 47, 48, 49, \ |
| 209 | 50, 51, 52, 53, 54, 55, 56, 57, } |
| 210 | |
| 211 | #define CONFIG_SYS_NAND_ECCSIZE 512 |
| 212 | #define CONFIG_SYS_NAND_ECCBYTES 14 |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 213 | #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE |
| 214 | #endif |
| 215 | #endif |
| 216 | |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 217 | /* NAND support */ |
Miquel Raynal | d093536 | 2019-10-03 19:50:03 +0200 | [diff] [blame] | 218 | #ifdef CONFIG_MTD_RAW_NAND |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 219 | #define GPMC_NAND_ECC_LP_x8_LAYOUT 1 |
Yegor Yefremov | fa8b71b | 2015-05-29 19:27:29 +0200 | [diff] [blame] | 220 | #endif |
| 221 | |
| 222 | #endif /* ! __CONFIG_BALTOS_H */ |