blob: b881d8c03fd777a15ae160643d7f578ff738e6f5 [file] [log] [blame]
Yegor Yefremovfa8b71b2015-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 Yefremov51c4ccb2015-07-06 17:28:36 +020019#include <linux/sizes.h>
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +020020#include <configs/ti_am335x_common.h>
21
Yegor Yefremovfa8b71b2015-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 Yefremovfa8b71b2015-05-29 19:27:29 +020026/* FIT support */
Yegor Yefremov51c4ccb2015-07-06 17:28:36 +020027#define CONFIG_SYS_BOOTM_LEN SZ_64M
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +020028
Miquel Raynald0935362019-10-03 19:50:03 +020029#ifdef CONFIG_MTD_RAW_NAND
Yegor Yefremov319293a2018-11-22 09:19:32 +010030
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +020031#define NANDARGS \
Tom Rini5ad8e112017-10-22 17:55:07 -040032 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
33 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +020034 "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 Yefremov51c4ccb2015-07-06 17:28:36 +020048 "bootm ${loadaddr}#conf${board_name}; " \
49 "if test $? -ne 0; then echo Using default FIT config; " \
50 "bootm ${loadaddr}; fi;\0"
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +020051#else
52#define NANDARGS ""
53#endif
54
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +020055#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 Yefremov2f5697e2016-12-01 12:52:18 +010070 "usbroot=/dev/sda2 ro\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +020071 "mmcrootfstype=ext4 rootwait\0" \
Yegor Yefremov2f5697e2016-12-01 12:52:18 +010072 "usbrootfstype=ext4 rootwait\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +020073 "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 Yefremov2f5697e2016-12-01 12:52:18 +010084 "usbargs=setenv bootargs console=${console} " \
85 "${optargs} " \
86 "${mtdparts} " \
87 "root=${usbroot} " \
88 "rootfstype=${usbrootfstype}\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +020089 "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 Yefremov2f5697e2016-12-01 12:52:18 +0100105 "usbloadbootenv=load usb 0:1 ${loadaddr} ${bootenv}\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200106 "importbootenv=echo Importing environment from mmc ...; " \
107 "env import -t $loadaddr $filesize\0" \
Yegor Yefremov2f5697e2016-12-01 12:52:18 +0100108 "usbimportbootenv=echo Importing environment from USB ...; " \
109 "env import -t $loadaddr $filesize\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200110 "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 Yefremov2f5697e2016-12-01 12:52:18 +0100116 "usbloadimage=load usb 0:1 ${loadaddr} kernel-fit.itb\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200117 "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
Yegor Yefremov2f5697e2016-12-01 12:52:18 +0100118 "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 Yefremovfa8b71b2015-05-29 19:27:29 +0200124 "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 Yefremov2f5697e2016-12-01 12:52:18 +0100138 "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 Yefremovfa8b71b2015-05-29 19:27:29 +0200153 "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 Yefremovfa8b71b2015-05-29 19:27:29 +0200188/* 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 Yefremovfa8b71b2015-05-29 19:27:29 +0200195
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200196/* PMIC support */
197#define CONFIG_POWER_TPS65910
198
199/* SPL */
200#ifndef CONFIG_NOR_BOOT
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200201
Miquel Raynald0935362019-10-03 19:50:03 +0200202#ifdef CONFIG_MTD_RAW_NAND
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200203#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 Yefremovfa8b71b2015-05-29 19:27:29 +0200213#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
214#endif
215#endif
216
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200217/* NAND support */
Miquel Raynald0935362019-10-03 19:50:03 +0200218#ifdef CONFIG_MTD_RAW_NAND
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200219#define GPMC_NAND_ECC_LP_x8_LAYOUT 1
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200220#endif
221
222#endif /* ! __CONFIG_BALTOS_H */