blob: d46ca337d5f8944d00d055241d630250994b9e1f [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
Derald D. Woods2b6b0892017-12-29 10:37:32 -060024#define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9,\
25 10, 11, 12, 13}
26#define CONFIG_SYS_NAND_ECCSIZE 512
27#define CONFIG_SYS_NAND_ECCBYTES 3
Derald D. Woods2b6b0892017-12-29 10:37:32 -060028/* NAND: SPL falcon mode configs */
Miquel Raynald0935362019-10-03 19:50:03 +020029#endif /* CONFIG_MTD_RAW_NAND */
Jason Kridner0d471612011-07-22 23:42:44 -050030
Derald D. Woods2b6b0892017-12-29 10:37:32 -060031/* Enable Multi Bus support for I2C */
32#define CONFIG_I2C_MULTI_BUS
Dirk Behme2781f802009-01-27 18:19:12 +010033
Derald D. Woods2b6b0892017-12-29 10:37:32 -060034/* DSS Support */
Tom Rix0f2a8042009-06-28 12:52:30 -050035
Derald D. Woods2b6b0892017-12-29 10:37:32 -060036/* TWL4030 LED Support */
Dirk Behme2781f802009-01-27 18:19:12 +010037
Derald D. Woods83b9df22018-02-26 17:52:58 -060038#define MEM_LAYOUT_ENV_SETTINGS \
39 DEFAULT_LINUX_BOOT_ENV
40
41#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
42 "bootcmd_" #devtypel #instance "=" \
43 "setenv mmcdev " #instance "; " \
44 "run mmcboot\0"
45#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
46 #devtypel #instance " "
47
Miquel Raynald0935362019-10-03 19:50:03 +020048#if defined(CONFIG_MTD_RAW_NAND)
Derald D. Woods83b9df22018-02-26 17:52:58 -060049
50#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
51 "bootcmd_" #devtypel #instance "=" \
52 "if test ${mtdids} = '' || test ${mtdparts} = '' ; then " \
53 "echo NAND boot disabled: No mtdids and/or mtdparts; " \
54 "else " \
55 "run nandboot; " \
56 "fi\0"
57#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
58 #devtypel #instance " "
59
Guillaume GARDETff772372016-10-25 18:50:32 +020060#define BOOT_TARGET_DEVICES(func) \
Derald D. Woods83b9df22018-02-26 17:52:58 -060061 func(MMC, mmc, 0) \
62 func(LEGACY_MMC, legacy_mmc, 0) \
Pali Rohárdd54f6c2022-05-31 10:32:36 +020063 func(UBIFS, ubifs, 0, rootfs, rootfs) \
Derald D. Woods83b9df22018-02-26 17:52:58 -060064 func(NAND, nand, 0)
Guillaume GARDETff772372016-10-25 18:50:32 +020065
Miquel Raynald0935362019-10-03 19:50:03 +020066#else /* !CONFIG_MTD_RAW_NAND */
Derald D. Woods83b9df22018-02-26 17:52:58 -060067
68#define BOOT_TARGET_DEVICES(func) \
69 func(MMC, mmc, 0) \
70 func(LEGACY_MMC, legacy_mmc, 0)
71
Miquel Raynald0935362019-10-03 19:50:03 +020072#endif /* CONFIG_MTD_RAW_NAND */
Guillaume GARDETff772372016-10-25 18:50:32 +020073
74#include <config_distro_bootcmd.h>
75
Dirk Behme2781f802009-01-27 18:19:12 +010076#define CONFIG_EXTRA_ENV_SETTINGS \
Derald D. Woods83b9df22018-02-26 17:52:58 -060077 MEM_LAYOUT_ENV_SETTINGS \
78 "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
Nishanth Menonb1b6e7e2013-07-15 07:11:32 -050079 "fdt_high=0xffffffff\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -060080 "console=ttyO2,115200n8\0" \
Nishanth Menon15436692013-07-15 07:11:31 -050081 "bootdir=/boot\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -060082 "bootenv=uEnv.txt\0" \
83 "bootfile=zImage\0" \
Nishanth Menon15436692013-07-15 07:11:31 -050084 "bootpart=0:2\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -060085 "usbtty=cdc_acm\0" \
Koen Kooi5b8018c2011-04-18 17:28:32 -040086 "mpurate=auto\0" \
Peter Meerwalda0638f72012-07-02 03:43:31 +000087 "buddy=none\0" \
Jason Kridner36c9cc52011-09-03 23:37:24 -040088 "camera=none\0" \
Steve Sakomand4512522009-10-10 14:29:37 -040089 "vram=12M\0" \
Jason Kridner6d9bbb62011-07-23 00:01:14 -050090 "dvimode=640x480MR-16@60\0" \
Steve Sakomand4512522009-10-10 14:29:37 -040091 "defaultdisplay=dvi\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -060092 "defaultargs=setenv defargs " \
Steve Sakoman8c8376d2010-02-03 14:39:14 -080093 "mpurate=${mpurate} " \
Koen Kooi3e8c3732011-08-11 00:39:28 -050094 "buddy=${buddy} "\
Jason Kridner36c9cc52011-09-03 23:37:24 -040095 "camera=${camera} "\
Steve Sakomand4512522009-10-10 14:29:37 -040096 "vram=${vram} " \
97 "omapfb.mode=dvi:${dvimode} " \
Derald D. Woods83b9df22018-02-26 17:52:58 -060098 "omapdss.def_disp=${defaultdisplay}\0" \
99 "optargs=\0" \
Nishanth Menonb1b6e7e2013-07-15 07:11:32 -0500100 "findfdt=" \
101 "if test $beaglerev = AxBx; then " \
102 "setenv fdtfile omap3-beagle.dtb; fi; " \
103 "if test $beaglerev = Cx; then " \
104 "setenv fdtfile omap3-beagle.dtb; fi; " \
Robert Nelson7b379f42014-01-17 09:51:28 -0600105 "if test $beaglerev = C4; then " \
106 "setenv fdtfile omap3-beagle.dtb; fi; " \
Nishanth Menonb1b6e7e2013-07-15 07:11:32 -0500107 "if test $beaglerev = xMAB; then " \
Robert Nelson1f302672014-05-02 15:14:39 -0500108 "setenv fdtfile omap3-beagle-xm-ab.dtb; fi; " \
Nishanth Menonb1b6e7e2013-07-15 07:11:32 -0500109 "if test $beaglerev = xMC; then " \
110 "setenv fdtfile omap3-beagle-xm.dtb; fi; " \
111 "if test $fdtfile = undefined; then " \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600112 "echo WARNING: Could not determine device tree to use; fi\0" \
113 "mmcdev=0\0" \
114 "mmcpart=2\0" \
115 "mmcroot=/dev/mmcblk0p2 rw\0" \
116 "mmcrootfstype=ext4 rootwait\0" \
117 "mmcargs=run defaultargs; setenv bootargs console=${console} " \
118 "${mtdparts} " \
119 "${defargs} " \
120 "${optargs} " \
121 "root=${mmcroot} " \
122 "rootfstype=${mmcrootfstype}\0" \
123 "userbutton_xm=gpio input 4;\0" \
124 "userbutton_nonxm=gpio input 7;\0" \
125 "userbutton=if gpio input 173; then " \
126 "run userbutton_xm; " \
127 "else " \
128 "run userbutton_nonxm; " \
129 "fi;\0" \
130 "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
131 "ext4bootenv=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootenv}\0" \
132 "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
133 "env import -t ${loadaddr} ${filesize}\0" \
134 "mmcbootenv=setenv bootpart ${mmcdev}:${mmcpart}; " \
135 "mmc dev ${mmcdev}; " \
136 "if mmc rescan; then " \
137 "if run userbutton; then " \
138 "setenv bootenv uEnv.txt;" \
139 "else " \
140 "setenv bootenv user.txt;" \
141 "fi;" \
142 "run loadbootenv && run importbootenv; " \
143 "run ext4bootenv && run importbootenv; " \
144 "if test -n $uenvcmd; then " \
145 "echo Running uenvcmd ...; " \
146 "run uenvcmd; " \
147 "fi; " \
148 "fi\0" \
Robert Nelson2a2b8da2014-05-02 15:15:03 -0500149 "validatefdt=" \
150 "if test $beaglerev = xMAB; then " \
151 "if test ! -e mmc ${bootpart} ${bootdir}/${fdtfile}; then " \
152 "setenv fdtfile omap3-beagle-xm.dtb; " \
153 "fi; " \
154 "fi; \0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600155 "loadimage=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
156 "loaddtb=run validatefdt; ext4load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
157 "mmcboot=run mmcbootenv; " \
158 "if run loadimage && run loaddtb; then " \
159 "echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} ...; " \
160 "run mmcargs; " \
161 "if test ${bootfile} = uImage; then " \
162 "bootm ${loadaddr} - ${fdtaddr}; " \
163 "fi; " \
164 "if test ${bootfile} = zImage; then " \
165 "bootz ${loadaddr} - ${fdtaddr}; " \
166 "fi; " \
167 "fi\0" \
168 "nandroot=ubi0:rootfs ubi.mtd=rootfs rw\0" \
169 "nandrootfstype=ubifs rootwait\0" \
170 "nandargs=run defaultargs; setenv bootargs console=${console} " \
171 "${mtdparts} " \
172 "${defargs} " \
Jason Kridner6d9bbb62011-07-23 00:01:14 -0500173 "${optargs} " \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600174 "root=${nandroot} " \
175 "rootfstype=${nandrootfstype}\0" \
176 "nandboot=if nand read ${loadaddr} kernel && nand read ${fdtaddr} dtb; then " \
177 "echo Booting uImage from NAND MTD 'kernel' partition ...; " \
178 "run nandargs; " \
179 "bootm ${loadaddr} - ${fdtaddr}; " \
180 "fi\0" \
181 "loadramdisk=ext4load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \
182 "ramdisk=rootfs.ext2.gz.uboot\0" \
183 "ramdisk_size=16384\0" \
184 "ramroot=/dev/ram rw\0" \
185 "ramrootfstype=ext2\0" \
186 "ramargs=run defaultargs; setenv bootargs console=${console} " \
187 "${mtdparts} " \
188 "${defargs} " \
189 "${optargs} " \
190 "root=${ramroot} ramdisk_size=${ramdisk_size} " \
Wolfgang Denk62fb2b42021-09-27 17:42:39 +0200191 "rootfstype=${ramrootfstype}\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600192 "ramboot=run mmcbootenv; " \
193 "if run loadimage && run loaddtb && run loadramdisk; then " \
194 "echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} w/ramdisk ...; " \
195 "run ramargs; " \
196 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}; " \
197 "fi\0" \
Guillaume GARDETff772372016-10-25 18:50:32 +0200198 BOOTENV
Dirk Behme2781f802009-01-27 18:19:12 +0100199
Dirk Behme2781f802009-01-27 18:19:12 +0100200#endif /* __CONFIG_H */