blob: ad3dbbcac52f918b3c692c4845575b77b70f5336 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Dirk Behme2781f802009-01-27 18:19:12 +01002/*
3 * (C) Copyright 2006-2008
4 * Texas Instruments.
5 * Richard Woodruff <r-woodruff2@ti.com>
6 * Syed Mohammed Khasim <x0khasim@ti.com>
7 *
8 * Configuration settings for the TI OMAP3530 Beagle board.
Dirk Behme2781f802009-01-27 18:19:12 +01009 */
10
11#ifndef __CONFIG_H
12#define __CONFIG_H
Dirk Behme2781f802009-01-27 18:19:12 +010013
Derald D. Woods2b6b0892017-12-29 10:37:32 -060014#include <configs/ti_omap3_common.h>
15
Dirk Behme2781f802009-01-27 18:19:12 +010016/*
Derald D. Woods2b6b0892017-12-29 10:37:32 -060017 * We are only ever GP parts and will utilize all of the "downloaded image"
18 * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB).
Dirk Behme2781f802009-01-27 18:19:12 +010019 */
Vaibhav Hiremath558d23d2010-06-07 15:20:34 -040020
Derald D. Woods2b6b0892017-12-29 10:37:32 -060021/* NAND */
Miquel Raynald0935362019-10-03 19:50:03 +020022#if defined(CONFIG_MTD_RAW_NAND)
Derald D. Woods2b6b0892017-12-29 10:37:32 -060023#define CONFIG_SYS_FLASH_BASE NAND_BASE
24#define CONFIG_SYS_MAX_NAND_DEVICE 1
Derald D. Woods2b6b0892017-12-29 10:37:32 -060025#define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9,\
26 10, 11, 12, 13}
27#define CONFIG_SYS_NAND_ECCSIZE 512
28#define CONFIG_SYS_NAND_ECCBYTES 3
Derald D. Woods2b6b0892017-12-29 10:37:32 -060029/* NAND: SPL falcon mode configs */
Miquel Raynald0935362019-10-03 19:50:03 +020030#endif /* CONFIG_MTD_RAW_NAND */
Jason Kridner0d471612011-07-22 23:42:44 -050031
Derald D. Woods2b6b0892017-12-29 10:37:32 -060032/* Enable Multi Bus support for I2C */
33#define CONFIG_I2C_MULTI_BUS
Dirk Behme2781f802009-01-27 18:19:12 +010034
Derald D. Woods2b6b0892017-12-29 10:37:32 -060035/* DSS Support */
Tom Rix0f2a8042009-06-28 12:52:30 -050036
Derald D. Woods2b6b0892017-12-29 10:37:32 -060037/* TWL4030 LED Support */
Dirk Behme2781f802009-01-27 18:19:12 +010038
Derald D. Woods83b9df22018-02-26 17:52:58 -060039#define MEM_LAYOUT_ENV_SETTINGS \
40 DEFAULT_LINUX_BOOT_ENV
41
42#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
43 "bootcmd_" #devtypel #instance "=" \
44 "setenv mmcdev " #instance "; " \
45 "run mmcboot\0"
46#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
47 #devtypel #instance " "
48
Miquel Raynald0935362019-10-03 19:50:03 +020049#if defined(CONFIG_MTD_RAW_NAND)
Derald D. Woods83b9df22018-02-26 17:52:58 -060050
51#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
52 "bootcmd_" #devtypel #instance "=" \
53 "if test ${mtdids} = '' || test ${mtdparts} = '' ; then " \
54 "echo NAND boot disabled: No mtdids and/or mtdparts; " \
55 "else " \
56 "run nandboot; " \
57 "fi\0"
58#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
59 #devtypel #instance " "
60
Guillaume GARDETff772372016-10-25 18:50:32 +020061#define BOOT_TARGET_DEVICES(func) \
Derald D. Woods83b9df22018-02-26 17:52:58 -060062 func(MMC, mmc, 0) \
63 func(LEGACY_MMC, legacy_mmc, 0) \
Pali Rohárdd54f6c2022-05-31 10:32:36 +020064 func(UBIFS, ubifs, 0, rootfs, rootfs) \
Derald D. Woods83b9df22018-02-26 17:52:58 -060065 func(NAND, nand, 0)
Guillaume GARDETff772372016-10-25 18:50:32 +020066
Miquel Raynald0935362019-10-03 19:50:03 +020067#else /* !CONFIG_MTD_RAW_NAND */
Derald D. Woods83b9df22018-02-26 17:52:58 -060068
69#define BOOT_TARGET_DEVICES(func) \
70 func(MMC, mmc, 0) \
71 func(LEGACY_MMC, legacy_mmc, 0)
72
Miquel Raynald0935362019-10-03 19:50:03 +020073#endif /* CONFIG_MTD_RAW_NAND */
Guillaume GARDETff772372016-10-25 18:50:32 +020074
75#include <config_distro_bootcmd.h>
76
Dirk Behme2781f802009-01-27 18:19:12 +010077#define CONFIG_EXTRA_ENV_SETTINGS \
Derald D. Woods83b9df22018-02-26 17:52:58 -060078 MEM_LAYOUT_ENV_SETTINGS \
79 "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
Nishanth Menonb1b6e7e2013-07-15 07:11:32 -050080 "fdt_high=0xffffffff\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -060081 "console=ttyO2,115200n8\0" \
Nishanth Menon15436692013-07-15 07:11:31 -050082 "bootdir=/boot\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -060083 "bootenv=uEnv.txt\0" \
84 "bootfile=zImage\0" \
Nishanth Menon15436692013-07-15 07:11:31 -050085 "bootpart=0:2\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -060086 "usbtty=cdc_acm\0" \
Koen Kooi5b8018c2011-04-18 17:28:32 -040087 "mpurate=auto\0" \
Peter Meerwalda0638f72012-07-02 03:43:31 +000088 "buddy=none\0" \
Jason Kridner36c9cc52011-09-03 23:37:24 -040089 "camera=none\0" \
Steve Sakomand4512522009-10-10 14:29:37 -040090 "vram=12M\0" \
Jason Kridner6d9bbb62011-07-23 00:01:14 -050091 "dvimode=640x480MR-16@60\0" \
Steve Sakomand4512522009-10-10 14:29:37 -040092 "defaultdisplay=dvi\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -060093 "defaultargs=setenv defargs " \
Steve Sakoman8c8376d2010-02-03 14:39:14 -080094 "mpurate=${mpurate} " \
Koen Kooi3e8c3732011-08-11 00:39:28 -050095 "buddy=${buddy} "\
Jason Kridner36c9cc52011-09-03 23:37:24 -040096 "camera=${camera} "\
Steve Sakomand4512522009-10-10 14:29:37 -040097 "vram=${vram} " \
98 "omapfb.mode=dvi:${dvimode} " \
Derald D. Woods83b9df22018-02-26 17:52:58 -060099 "omapdss.def_disp=${defaultdisplay}\0" \
100 "optargs=\0" \
Nishanth Menonb1b6e7e2013-07-15 07:11:32 -0500101 "findfdt=" \
102 "if test $beaglerev = AxBx; then " \
103 "setenv fdtfile omap3-beagle.dtb; fi; " \
104 "if test $beaglerev = Cx; then " \
105 "setenv fdtfile omap3-beagle.dtb; fi; " \
Robert Nelson7b379f42014-01-17 09:51:28 -0600106 "if test $beaglerev = C4; then " \
107 "setenv fdtfile omap3-beagle.dtb; fi; " \
Nishanth Menonb1b6e7e2013-07-15 07:11:32 -0500108 "if test $beaglerev = xMAB; then " \
Robert Nelson1f302672014-05-02 15:14:39 -0500109 "setenv fdtfile omap3-beagle-xm-ab.dtb; fi; " \
Nishanth Menonb1b6e7e2013-07-15 07:11:32 -0500110 "if test $beaglerev = xMC; then " \
111 "setenv fdtfile omap3-beagle-xm.dtb; fi; " \
112 "if test $fdtfile = undefined; then " \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600113 "echo WARNING: Could not determine device tree to use; fi\0" \
114 "mmcdev=0\0" \
115 "mmcpart=2\0" \
116 "mmcroot=/dev/mmcblk0p2 rw\0" \
117 "mmcrootfstype=ext4 rootwait\0" \
118 "mmcargs=run defaultargs; setenv bootargs console=${console} " \
119 "${mtdparts} " \
120 "${defargs} " \
121 "${optargs} " \
122 "root=${mmcroot} " \
123 "rootfstype=${mmcrootfstype}\0" \
124 "userbutton_xm=gpio input 4;\0" \
125 "userbutton_nonxm=gpio input 7;\0" \
126 "userbutton=if gpio input 173; then " \
127 "run userbutton_xm; " \
128 "else " \
129 "run userbutton_nonxm; " \
130 "fi;\0" \
131 "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
132 "ext4bootenv=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootenv}\0" \
133 "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
134 "env import -t ${loadaddr} ${filesize}\0" \
135 "mmcbootenv=setenv bootpart ${mmcdev}:${mmcpart}; " \
136 "mmc dev ${mmcdev}; " \
137 "if mmc rescan; then " \
138 "if run userbutton; then " \
139 "setenv bootenv uEnv.txt;" \
140 "else " \
141 "setenv bootenv user.txt;" \
142 "fi;" \
143 "run loadbootenv && run importbootenv; " \
144 "run ext4bootenv && run importbootenv; " \
145 "if test -n $uenvcmd; then " \
146 "echo Running uenvcmd ...; " \
147 "run uenvcmd; " \
148 "fi; " \
149 "fi\0" \
Robert Nelson2a2b8da2014-05-02 15:15:03 -0500150 "validatefdt=" \
151 "if test $beaglerev = xMAB; then " \
152 "if test ! -e mmc ${bootpart} ${bootdir}/${fdtfile}; then " \
153 "setenv fdtfile omap3-beagle-xm.dtb; " \
154 "fi; " \
155 "fi; \0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600156 "loadimage=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
157 "loaddtb=run validatefdt; ext4load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
158 "mmcboot=run mmcbootenv; " \
159 "if run loadimage && run loaddtb; then " \
160 "echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} ...; " \
161 "run mmcargs; " \
162 "if test ${bootfile} = uImage; then " \
163 "bootm ${loadaddr} - ${fdtaddr}; " \
164 "fi; " \
165 "if test ${bootfile} = zImage; then " \
166 "bootz ${loadaddr} - ${fdtaddr}; " \
167 "fi; " \
168 "fi\0" \
169 "nandroot=ubi0:rootfs ubi.mtd=rootfs rw\0" \
170 "nandrootfstype=ubifs rootwait\0" \
171 "nandargs=run defaultargs; setenv bootargs console=${console} " \
172 "${mtdparts} " \
173 "${defargs} " \
Jason Kridner6d9bbb62011-07-23 00:01:14 -0500174 "${optargs} " \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600175 "root=${nandroot} " \
176 "rootfstype=${nandrootfstype}\0" \
177 "nandboot=if nand read ${loadaddr} kernel && nand read ${fdtaddr} dtb; then " \
178 "echo Booting uImage from NAND MTD 'kernel' partition ...; " \
179 "run nandargs; " \
180 "bootm ${loadaddr} - ${fdtaddr}; " \
181 "fi\0" \
182 "loadramdisk=ext4load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \
183 "ramdisk=rootfs.ext2.gz.uboot\0" \
184 "ramdisk_size=16384\0" \
185 "ramroot=/dev/ram rw\0" \
186 "ramrootfstype=ext2\0" \
187 "ramargs=run defaultargs; setenv bootargs console=${console} " \
188 "${mtdparts} " \
189 "${defargs} " \
190 "${optargs} " \
191 "root=${ramroot} ramdisk_size=${ramdisk_size} " \
Wolfgang Denk62fb2b42021-09-27 17:42:39 +0200192 "rootfstype=${ramrootfstype}\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600193 "ramboot=run mmcbootenv; " \
194 "if run loadimage && run loaddtb && run loadramdisk; then " \
195 "echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} w/ramdisk ...; " \
196 "run ramargs; " \
197 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}; " \
198 "fi\0" \
Guillaume GARDETff772372016-10-25 18:50:32 +0200199 BOOTENV
Dirk Behme2781f802009-01-27 18:19:12 +0100200
Dirk Behme2781f802009-01-27 18:19:12 +0100201#endif /* __CONFIG_H */