blob: 25906e404b1cc096fd23bdd6a4cd430d71ab94a4 [file] [log] [blame]
Yegor Yefremov6ce89322015-05-29 19:27:29 +02001/*
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 Yefremov5f9c58e2015-07-06 17:28:36 +020019#include <linux/sizes.h>
Yegor Yefremov6ce89322015-05-29 19:27:29 +020020#include <configs/ti_am335x_common.h>
21
Yegor Yefremov6ce89322015-05-29 19:27:29 +020022/* Clock Defines */
23#define V_OSCK 24000000 /* Clock output from T2 */
24#define V_SCLK (V_OSCK)
25
Yegor Yefremov6ce89322015-05-29 19:27:29 +020026/* FIT support */
Yegor Yefremov5f9c58e2015-07-06 17:28:36 +020027#define CONFIG_SYS_BOOTM_LEN SZ_64M
Yegor Yefremov6ce89322015-05-29 19:27:29 +020028
Miquel Raynal88718be2019-10-03 19:50:03 +020029#ifdef CONFIG_MTD_RAW_NAND
Yegor Yefremov1abff552018-11-22 09:19:32 +010030
Yegor Yefremov6ce89322015-05-29 19:27:29 +020031#define NANDARGS \
Yegor Yefremov6ce89322015-05-29 19:27:29 +020032 "nandargs=setenv bootargs console=${console} " \
33 "${optargs} " \
34 "${mtdparts} " \
35 "root=${nandroot} " \
36 "rootfstype=${nandrootfstype}\0" \
37 "nandroot=ubi0:rootfs rw ubi.mtd=5\0" \
Michael Trimarchi98303ce2022-05-22 15:22:08 +020038 "nandrootfstype=ubifs rootwait\0" \
Yegor Yefremov6ce89322015-05-29 19:27:29 +020039 "nandboot=echo Booting from nand ...; " \
40 "run nandargs; " \
41 "setenv loadaddr 0x84000000; " \
42 "ubi part UBI; " \
43 "ubifsmount ubi0:kernel; " \
44 "ubifsload $loadaddr kernel-fit.itb;" \
45 "ubifsumount; " \
Yegor Yefremov5f9c58e2015-07-06 17:28:36 +020046 "bootm ${loadaddr}#conf${board_name}; " \
47 "if test $? -ne 0; then echo Using default FIT config; " \
48 "bootm ${loadaddr}; fi;\0"
Yegor Yefremov6ce89322015-05-29 19:27:29 +020049#else
50#define NANDARGS ""
51#endif
52
Yegor Yefremov6ce89322015-05-29 19:27:29 +020053#define CONFIG_EXTRA_ENV_SETTINGS \
54 DEFAULT_LINUX_BOOT_ENV \
55 "boot_fdt=try\0" \
56 "bootpart=0:2\0" \
57 "bootdir=/boot\0" \
58 "bootfile=zImage\0" \
59 "fdtfile=undefined\0" \
60 "console=ttyO0,115200n8\0" \
61 "partitions=" \
62 "uuid_disk=${uuid_gpt_disk};" \
63 "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
64 "optargs=\0" \
65 "mmcdev=0\0" \
66 "mmcroot=/dev/mmcblk0p2 ro\0" \
Yegor Yefremov88679a22016-12-01 12:52:18 +010067 "usbroot=/dev/sda2 ro\0" \
Yegor Yefremov6ce89322015-05-29 19:27:29 +020068 "mmcrootfstype=ext4 rootwait\0" \
Yegor Yefremov88679a22016-12-01 12:52:18 +010069 "usbrootfstype=ext4 rootwait\0" \
Yegor Yefremov6ce89322015-05-29 19:27:29 +020070 "rootpath=/export/rootfs\0" \
71 "nfsopts=nolock\0" \
72 "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
73 "::off\0" \
74 "ramroot=/dev/ram0 rw\0" \
75 "ramrootfstype=ext2\0" \
76 "mmcargs=setenv bootargs console=${console} " \
77 "${optargs} " \
78 "${mtdparts} " \
79 "root=${mmcroot} " \
80 "rootfstype=${mmcrootfstype}\0" \
Yegor Yefremov88679a22016-12-01 12:52:18 +010081 "usbargs=setenv bootargs console=${console} " \
82 "${optargs} " \
83 "${mtdparts} " \
84 "root=${usbroot} " \
85 "rootfstype=${usbrootfstype}\0" \
Yegor Yefremov6ce89322015-05-29 19:27:29 +020086 "spiroot=/dev/mtdblock4 rw\0" \
87 "spirootfstype=jffs2\0" \
88 "spisrcaddr=0xe0000\0" \
89 "spiimgsize=0x362000\0" \
90 "spibusno=0\0" \
91 "spiargs=setenv bootargs console=${console} " \
92 "${optargs} " \
93 "root=${spiroot} " \
94 "rootfstype=${spirootfstype}\0" \
95 "netargs=setenv bootargs console=${console} " \
96 "${optargs} " \
97 "root=/dev/nfs " \
98 "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
99 "ip=dhcp\0" \
100 "bootenv=uEnv.txt\0" \
101 "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
Yegor Yefremov88679a22016-12-01 12:52:18 +0100102 "usbloadbootenv=load usb 0:1 ${loadaddr} ${bootenv}\0" \
Yegor Yefremov6ce89322015-05-29 19:27:29 +0200103 "importbootenv=echo Importing environment from mmc ...; " \
104 "env import -t $loadaddr $filesize\0" \
Yegor Yefremov88679a22016-12-01 12:52:18 +0100105 "usbimportbootenv=echo Importing environment from USB ...; " \
106 "env import -t $loadaddr $filesize\0" \
Yegor Yefremov6ce89322015-05-29 19:27:29 +0200107 "ramargs=setenv bootargs console=${console} " \
108 "${optargs} " \
109 "root=${ramroot} " \
110 "rootfstype=${ramrootfstype}\0" \
111 "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
112 "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
Yegor Yefremov88679a22016-12-01 12:52:18 +0100113 "usbloadimage=load usb 0:1 ${loadaddr} kernel-fit.itb\0" \
Yegor Yefremov6ce89322015-05-29 19:27:29 +0200114 "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
Yegor Yefremov88679a22016-12-01 12:52:18 +0100115 "usbloados=run usbargs; " \
116 "bootm ${loadaddr}#conf${board_name}; " \
117 "if test $? -ne 0; then " \
118 "echo Using default FIT configuration; " \
119 "bootm ${loadaddr}; " \
120 "fi;\0" \
Yegor Yefremov6ce89322015-05-29 19:27:29 +0200121 "mmcloados=run mmcargs; " \
122 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
123 "if run loadfdt; then " \
124 "bootz ${loadaddr} - ${fdtaddr}; " \
125 "else " \
126 "if test ${boot_fdt} = try; then " \
127 "bootz; " \
128 "else " \
129 "echo WARN: Cannot load the DT; " \
130 "fi; " \
131 "fi; " \
132 "else " \
133 "bootz; " \
134 "fi;\0" \
Yegor Yefremov88679a22016-12-01 12:52:18 +0100135 "usbboot=usb reset; " \
136 "if usb storage; then " \
137 "echo USB drive found;" \
138 "if run usbloadbootenv; then " \
139 "echo Loaded environment from ${bootenv};" \
140 "run usbimportbootenv;" \
141 "fi;" \
142 "if test -n $uenvcmd; then " \
143 "echo Running uenvcmd ...;" \
144 "run uenvcmd;" \
145 "fi;" \
146 "if run usbloadimage; then " \
147 "run usbloados;" \
148 "fi;" \
149 "fi;\0" \
Yegor Yefremov6ce89322015-05-29 19:27:29 +0200150 "mmcboot=mmc dev ${mmcdev}; " \
151 "if mmc rescan; then " \
152 "echo SD/MMC found on device ${mmcdev};" \
153 "if run loadbootenv; then " \
154 "echo Loaded environment from ${bootenv};" \
155 "run importbootenv;" \
156 "fi;" \
157 "if test -n $uenvcmd; then " \
158 "echo Running uenvcmd ...;" \
159 "run uenvcmd;" \
160 "fi;" \
161 "if run loadimage; then " \
162 "run mmcloados;" \
163 "fi;" \
164 "fi;\0" \
165 "spiboot=echo Booting from spi ...; " \
166 "run spiargs; " \
167 "sf probe ${spibusno}:0; " \
168 "sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \
169 "bootz ${loadaddr}\0" \
170 "netboot=echo Booting from network ...; " \
171 "setenv autoload no; " \
172 "dhcp; " \
173 "tftp ${loadaddr} ${bootfile}; " \
174 "tftp ${fdtaddr} ${fdtfile}; " \
175 "run netargs; " \
176 "bootz ${loadaddr} - ${fdtaddr}\0" \
177 "ramboot=echo Booting from ramdisk ...; " \
178 "run ramargs; " \
179 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
180 "findfdt=setenv fdtfile am335x-baltos.dtb\0" \
181 NANDARGS
182 /*DFUARGS*/
Yegor Yefremov6ce89322015-05-29 19:27:29 +0200183
Yegor Yefremov6ce89322015-05-29 19:27:29 +0200184/* NS16550 Configuration */
185#define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */
186#define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
187#define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
188#define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
189#define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
190#define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
Yegor Yefremov6ce89322015-05-29 19:27:29 +0200191
Yegor Yefremov6ce89322015-05-29 19:27:29 +0200192/* PMIC support */
193#define CONFIG_POWER_TPS65910
194
195/* SPL */
196#ifndef CONFIG_NOR_BOOT
Yegor Yefremov6ce89322015-05-29 19:27:29 +0200197
Miquel Raynal88718be2019-10-03 19:50:03 +0200198#ifdef CONFIG_MTD_RAW_NAND
Yegor Yefremov6ce89322015-05-29 19:27:29 +0200199#define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
200 10, 11, 12, 13, 14, 15, 16, 17, \
201 18, 19, 20, 21, 22, 23, 24, 25, \
202 26, 27, 28, 29, 30, 31, 32, 33, \
203 34, 35, 36, 37, 38, 39, 40, 41, \
204 42, 43, 44, 45, 46, 47, 48, 49, \
205 50, 51, 52, 53, 54, 55, 56, 57, }
206
207#define CONFIG_SYS_NAND_ECCSIZE 512
208#define CONFIG_SYS_NAND_ECCBYTES 14
Yegor Yefremov6ce89322015-05-29 19:27:29 +0200209#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
210#endif
211#endif
212
Yegor Yefremov6ce89322015-05-29 19:27:29 +0200213/* NAND support */
Miquel Raynal88718be2019-10-03 19:50:03 +0200214#ifdef CONFIG_MTD_RAW_NAND
Yegor Yefremov6ce89322015-05-29 19:27:29 +0200215#define GPMC_NAND_ECC_LP_x8_LAYOUT 1
Yegor Yefremov6ce89322015-05-29 19:27:29 +0200216#endif
217
218#endif /* ! __CONFIG_BALTOS_H */