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