blob: ab742798b92b0069a4a036ffd5154d8ad6064503 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Dirk Behmef904cdb2009-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 Behmef904cdb2009-01-27 18:19:12 +01009 */
10
11#ifndef __CONFIG_H
12#define __CONFIG_H
Dirk Behmef904cdb2009-01-27 18:19:12 +010013
Tom Rinidf4dbb52014-04-03 15:17:15 -040014#include <configs/ti_omap3_common.h>
Dirk Behmef904cdb2009-01-27 18:19:12 +010015
Derald D. Woods4b379282017-12-29 10:37:32 -060016/*
17 * 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).
19 */
Derald D. Woods4b379282017-12-29 10:37:32 -060020
Derald D. Woods4b379282017-12-29 10:37:32 -060021/* NAND */
Miquel Raynal88718be2019-10-03 19:50:03 +020022#if defined(CONFIG_MTD_RAW_NAND)
Derald D. Woods4b379282017-12-29 10:37:32 -060023#define CONFIG_SYS_FLASH_BASE NAND_BASE
24#define CONFIG_SYS_MAX_NAND_DEVICE 1
Derald D. Woods4b379282017-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. Woodsd233ccb2018-02-26 17:52:58 -060029#define CONFIG_SYS_ENV_SECT_SIZE SZ_128K
Derald D. Woods4b379282017-12-29 10:37:32 -060030/* NAND: SPL falcon mode configs */
Miquel Raynal88718be2019-10-03 19:50:03 +020031#endif /* CONFIG_MTD_RAW_NAND */
Dirk Behmef904cdb2009-01-27 18:19:12 +010032
Derald D. Woods4b379282017-12-29 10:37:32 -060033/* Enable Multi Bus support for I2C */
34#define CONFIG_I2C_MULTI_BUS
Tom Rinidf4dbb52014-04-03 15:17:15 -040035
Derald D. Woods4b379282017-12-29 10:37:32 -060036/* DSS Support */
Dirk Behmef904cdb2009-01-27 18:19:12 +010037
Derald D. Woods4b379282017-12-29 10:37:32 -060038/* TWL4030 LED Support */
Dirk Behmef904cdb2009-01-27 18:19:12 +010039
Derald D. Woodsd233ccb2018-02-26 17:52:58 -060040#define MEM_LAYOUT_ENV_SETTINGS \
41 DEFAULT_LINUX_BOOT_ENV
42
43#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
44 "bootcmd_" #devtypel #instance "=" \
45 "setenv mmcdev " #instance "; " \
46 "run mmcboot\0"
47#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
48 #devtypel #instance " "
49
Miquel Raynal88718be2019-10-03 19:50:03 +020050#if defined(CONFIG_MTD_RAW_NAND)
Derald D. Woodsd233ccb2018-02-26 17:52:58 -060051
52#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
53 "bootcmd_" #devtypel #instance "=" \
54 "if test ${mtdids} = '' || test ${mtdparts} = '' ; then " \
55 "echo NAND boot disabled: No mtdids and/or mtdparts; " \
56 "else " \
57 "run nandboot; " \
58 "fi\0"
59#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
60 #devtypel #instance " "
61
62#define BOOT_TARGET_DEVICES(func) \
63 func(MMC, mmc, 0) \
64 func(LEGACY_MMC, legacy_mmc, 0) \
65 func(UBIFS, ubifs, 0) \
66 func(NAND, nand, 0)
67
Miquel Raynal88718be2019-10-03 19:50:03 +020068#else /* !CONFIG_MTD_RAW_NAND */
Derald D. Woodsd233ccb2018-02-26 17:52:58 -060069
70#define BOOT_TARGET_DEVICES(func) \
71 func(MMC, mmc, 0) \
72 func(LEGACY_MMC, legacy_mmc, 0)
73
Miquel Raynal88718be2019-10-03 19:50:03 +020074#endif /* CONFIG_MTD_RAW_NAND */
Guillaume GARDETc721fd62016-10-25 18:50:32 +020075
76#include <config_distro_bootcmd.h>
77
Dirk Behmef904cdb2009-01-27 18:19:12 +010078#define CONFIG_EXTRA_ENV_SETTINGS \
Derald D. Woodsd233ccb2018-02-26 17:52:58 -060079 MEM_LAYOUT_ENV_SETTINGS \
80 "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
Nishanth Menon2ade4962013-07-15 07:11:32 -050081 "fdt_high=0xffffffff\0" \
Koen Kooi27b8c8f2011-11-27 03:51:06 +000082 "console=ttyO2,115200n8\0" \
Derald D. Woodsd233ccb2018-02-26 17:52:58 -060083 "bootdir=/boot\0" \
84 "bootenv=uEnv.txt\0" \
85 "bootfile=zImage\0" \
86 "bootpart=0:2\0" \
87 "bootubivol=rootfs\0" \
88 "bootubipart=rootfs\0" \
89 "usbtty=cdc_acm\0" \
Koen Kooif6e593b2011-04-18 17:28:32 -040090 "mpurate=auto\0" \
Peter Meerwald847b83d2012-07-02 03:43:31 +000091 "buddy=none\0" \
Jason Kridnerc522eac2011-09-03 23:37:24 -040092 "camera=none\0" \
Steve Sakoman13d2cb92009-10-10 14:29:37 -040093 "vram=12M\0" \
Jason Kridnerf4b36ea2011-07-23 00:01:14 -050094 "dvimode=640x480MR-16@60\0" \
Steve Sakoman13d2cb92009-10-10 14:29:37 -040095 "defaultdisplay=dvi\0" \
Derald D. Woodsd233ccb2018-02-26 17:52:58 -060096 "defaultargs=setenv defargs " \
Steve Sakoman5af32462010-02-03 14:39:14 -080097 "mpurate=${mpurate} " \
Koen Kooib1660312011-08-11 00:39:28 -050098 "buddy=${buddy} "\
Jason Kridnerc522eac2011-09-03 23:37:24 -040099 "camera=${camera} "\
Steve Sakoman13d2cb92009-10-10 14:29:37 -0400100 "vram=${vram} " \
101 "omapfb.mode=dvi:${dvimode} " \
Derald D. Woodsd233ccb2018-02-26 17:52:58 -0600102 "omapdss.def_disp=${defaultdisplay}\0" \
103 "optargs=\0" \
Nishanth Menon2ade4962013-07-15 07:11:32 -0500104 "findfdt=" \
105 "if test $beaglerev = AxBx; then " \
106 "setenv fdtfile omap3-beagle.dtb; fi; " \
107 "if test $beaglerev = Cx; then " \
108 "setenv fdtfile omap3-beagle.dtb; fi; " \
Robert Nelson5c9038b2014-01-17 09:51:28 -0600109 "if test $beaglerev = C4; then " \
110 "setenv fdtfile omap3-beagle.dtb; fi; " \
Nishanth Menon2ade4962013-07-15 07:11:32 -0500111 "if test $beaglerev = xMAB; then " \
Robert Nelson3d47ffb2014-05-02 15:14:39 -0500112 "setenv fdtfile omap3-beagle-xm-ab.dtb; fi; " \
Nishanth Menon2ade4962013-07-15 07:11:32 -0500113 "if test $beaglerev = xMC; then " \
114 "setenv fdtfile omap3-beagle-xm.dtb; fi; " \
115 "if test $fdtfile = undefined; then " \
Derald D. Woodsd233ccb2018-02-26 17:52:58 -0600116 "echo WARNING: Could not determine device tree to use; fi\0" \
117 "mmcdev=0\0" \
118 "mmcpart=2\0" \
119 "mmcroot=/dev/mmcblk0p2 rw\0" \
120 "mmcrootfstype=ext4 rootwait\0" \
121 "mmcargs=run defaultargs; setenv bootargs console=${console} " \
122 "${mtdparts} " \
123 "${defargs} " \
124 "${optargs} " \
125 "root=${mmcroot} " \
126 "rootfstype=${mmcrootfstype}\0" \
127 "userbutton_xm=gpio input 4;\0" \
128 "userbutton_nonxm=gpio input 7;\0" \
129 "userbutton=if gpio input 173; then " \
130 "run userbutton_xm; " \
131 "else " \
132 "run userbutton_nonxm; " \
133 "fi;\0" \
134 "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
135 "ext4bootenv=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootenv}\0" \
136 "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
137 "env import -t ${loadaddr} ${filesize}\0" \
138 "mmcbootenv=setenv bootpart ${mmcdev}:${mmcpart}; " \
139 "mmc dev ${mmcdev}; " \
140 "if mmc rescan; then " \
141 "if run userbutton; then " \
142 "setenv bootenv uEnv.txt;" \
143 "else " \
144 "setenv bootenv user.txt;" \
145 "fi;" \
146 "run loadbootenv && run importbootenv; " \
147 "run ext4bootenv && run importbootenv; " \
148 "if test -n $uenvcmd; then " \
149 "echo Running uenvcmd ...; " \
150 "run uenvcmd; " \
151 "fi; " \
152 "fi\0" \
Robert Nelson4fa24272014-05-02 15:15:03 -0500153 "validatefdt=" \
154 "if test $beaglerev = xMAB; then " \
155 "if test ! -e mmc ${bootpart} ${bootdir}/${fdtfile}; then " \
156 "setenv fdtfile omap3-beagle-xm.dtb; " \
157 "fi; " \
158 "fi; \0" \
Derald D. Woodsd233ccb2018-02-26 17:52:58 -0600159 "loadimage=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
160 "loaddtb=run validatefdt; ext4load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
161 "mmcboot=run mmcbootenv; " \
162 "if run loadimage && run loaddtb; then " \
163 "echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} ...; " \
164 "run mmcargs; " \
165 "if test ${bootfile} = uImage; then " \
166 "bootm ${loadaddr} - ${fdtaddr}; " \
167 "fi; " \
168 "if test ${bootfile} = zImage; then " \
169 "bootz ${loadaddr} - ${fdtaddr}; " \
170 "fi; " \
171 "fi\0" \
172 "nandroot=ubi0:rootfs ubi.mtd=rootfs rw\0" \
173 "nandrootfstype=ubifs rootwait\0" \
174 "nandargs=run defaultargs; setenv bootargs console=${console} " \
175 "${mtdparts} " \
176 "${defargs} " \
Jason Kridnerf4b36ea2011-07-23 00:01:14 -0500177 "${optargs} " \
Derald D. Woodsd233ccb2018-02-26 17:52:58 -0600178 "root=${nandroot} " \
179 "rootfstype=${nandrootfstype}\0" \
180 "nandboot=if nand read ${loadaddr} kernel && nand read ${fdtaddr} dtb; then " \
181 "echo Booting uImage from NAND MTD 'kernel' partition ...; " \
182 "run nandargs; " \
183 "bootm ${loadaddr} - ${fdtaddr}; " \
184 "fi\0" \
185 "loadramdisk=ext4load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \
186 "ramdisk=rootfs.ext2.gz.uboot\0" \
187 "ramdisk_size=16384\0" \
188 "ramroot=/dev/ram rw\0" \
189 "ramrootfstype=ext2\0" \
190 "ramargs=run defaultargs; setenv bootargs console=${console} " \
191 "${mtdparts} " \
192 "${defargs} " \
193 "${optargs} " \
194 "root=${ramroot} ramdisk_size=${ramdisk_size} " \
Wolfgang Denk0cf207e2021-09-27 17:42:39 +0200195 "rootfstype=${ramrootfstype}\0" \
Derald D. Woodsd233ccb2018-02-26 17:52:58 -0600196 "ramboot=run mmcbootenv; " \
197 "if run loadimage && run loaddtb && run loadramdisk; then " \
198 "echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} w/ramdisk ...; " \
199 "run ramargs; " \
200 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}; " \
201 "fi\0" \
Guillaume GARDETc721fd62016-10-25 18:50:32 +0200202 BOOTENV
Dirk Behmef904cdb2009-01-27 18:19:12 +0100203
Dirk Behmef904cdb2009-01-27 18:19:12 +0100204#endif /* __CONFIG_H */