blob: e7946389eff32791bf369bf7a8e01bbd2fa07ddb [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 Yefremovfa8b71b2015-05-29 19:27:29 +020027
Miquel Raynald0935362019-10-03 19:50:03 +020028#ifdef CONFIG_MTD_RAW_NAND
Yegor Yefremov319293a2018-11-22 09:19:32 +010029
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +020030#define NANDARGS \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +020031 "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 Trimarchi034d8ff2022-05-22 15:22:08 +020037 "nandrootfstype=ubifs rootwait\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +020038 "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 Yefremov51c4ccb2015-07-06 17:28:36 +020045 "bootm ${loadaddr}#conf${board_name}; " \
46 "if test $? -ne 0; then echo Using default FIT config; " \
47 "bootm ${loadaddr}; fi;\0"
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +020048#else
49#define NANDARGS ""
50#endif
51
Tom Rinic9edebe2022-12-04 10:03:50 -050052#define CFG_EXTRA_ENV_SETTINGS \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +020053 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 Yefremov2f5697e2016-12-01 12:52:18 +010066 "usbroot=/dev/sda2 ro\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +020067 "mmcrootfstype=ext4 rootwait\0" \
Yegor Yefremov2f5697e2016-12-01 12:52:18 +010068 "usbrootfstype=ext4 rootwait\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +020069 "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 Yefremov2f5697e2016-12-01 12:52:18 +010080 "usbargs=setenv bootargs console=${console} " \
81 "${optargs} " \
82 "${mtdparts} " \
83 "root=${usbroot} " \
84 "rootfstype=${usbrootfstype}\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +020085 "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 Yefremov2f5697e2016-12-01 12:52:18 +0100101 "usbloadbootenv=load usb 0:1 ${loadaddr} ${bootenv}\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200102 "importbootenv=echo Importing environment from mmc ...; " \
103 "env import -t $loadaddr $filesize\0" \
Yegor Yefremov2f5697e2016-12-01 12:52:18 +0100104 "usbimportbootenv=echo Importing environment from USB ...; " \
105 "env import -t $loadaddr $filesize\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200106 "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 Yefremov2f5697e2016-12-01 12:52:18 +0100112 "usbloadimage=load usb 0:1 ${loadaddr} kernel-fit.itb\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200113 "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
Yegor Yefremov2f5697e2016-12-01 12:52:18 +0100114 "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 Yefremovfa8b71b2015-05-29 19:27:29 +0200120 "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 Yefremov2f5697e2016-12-01 12:52:18 +0100134 "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 Yefremovfa8b71b2015-05-29 19:27:29 +0200149 "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 Yefremovfa8b71b2015-05-29 19:27:29 +0200182
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200183/* NS16550 Configuration */
Tom Rinidf6a2152022-11-16 13:10:28 -0500184#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 Yefremovfa8b71b2015-05-29 19:27:29 +0200190
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200191/* SPL */
192#ifndef CONFIG_NOR_BOOT
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200193
Miquel Raynald0935362019-10-03 19:50:03 +0200194#ifdef CONFIG_MTD_RAW_NAND
Tom Rinib4213492022-11-12 17:36:51 -0500195#define CFG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200196 10, 11, 12, 13, 14, 15, 16, 17, \
197 18, 19, 20, 21, 22, 23, 24, 25, \
198 26, 27, 28, 29, 30, 31, 32, 33, \
199 34, 35, 36, 37, 38, 39, 40, 41, \
200 42, 43, 44, 45, 46, 47, 48, 49, \
201 50, 51, 52, 53, 54, 55, 56, 57, }
202
Tom Rinib4213492022-11-12 17:36:51 -0500203#define CFG_SYS_NAND_ECCSIZE 512
204#define CFG_SYS_NAND_ECCBYTES 14
205#define CFG_SYS_NAND_U_BOOT_START CONFIG_TEXT_BASE
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200206#endif
207#endif
208
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200209/* NAND support */
Miquel Raynald0935362019-10-03 19:50:03 +0200210#ifdef CONFIG_MTD_RAW_NAND
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200211#define GPMC_NAND_ECC_LP_x8_LAYOUT 1
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200212#endif
213
214#endif /* ! __CONFIG_BALTOS_H */