blob: 1599b6f0ba10a3e30589e03248f873a65a6d6483 [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. Woods83b9df22018-02-26 17:52:58 -060014#define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */
Tom Rinie10247f2014-04-03 15:17:15 -040015
Derald D. Woods2b6b0892017-12-29 10:37:32 -060016#include <configs/ti_omap3_common.h>
17
Dirk Behme2781f802009-01-27 18:19:12 +010018/*
Derald D. Woods2b6b0892017-12-29 10:37:32 -060019 * We are only ever GP parts and will utilize all of the "downloaded image"
20 * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB).
Dirk Behme2781f802009-01-27 18:19:12 +010021 */
Derald D. Woods2b6b0892017-12-29 10:37:32 -060022#undef CONFIG_SPL_TEXT_BASE
23#define CONFIG_SPL_TEXT_BASE 0x40200000
Vaibhav Hiremath558d23d2010-06-07 15:20:34 -040024
Dirk Behme2781f802009-01-27 18:19:12 +010025#define CONFIG_MISC_INIT_R
Derald D. Woods2b6b0892017-12-29 10:37:32 -060026#define CONFIG_CMDLINE_TAG
27#define CONFIG_SETUP_MEMORY_TAGS
28#define CONFIG_INITRD_TAG
29#define CONFIG_REVISION_TAG
Dirk Behme2781f802009-01-27 18:19:12 +010030
Derald D. Woods2b6b0892017-12-29 10:37:32 -060031/* NAND */
32#if defined(CONFIG_NAND)
33#define CONFIG_SYS_FLASH_BASE NAND_BASE
34#define CONFIG_SYS_MAX_NAND_DEVICE 1
35#define CONFIG_SYS_NAND_5_ADDR_CYCLE
36#define CONFIG_SYS_NAND_PAGE_COUNT 64
37#define CONFIG_SYS_NAND_PAGE_SIZE 2048
38#define CONFIG_SYS_NAND_OOBSIZE 64
39#define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
40#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
41#define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9,\
42 10, 11, 12, 13}
43#define CONFIG_SYS_NAND_ECCSIZE 512
44#define CONFIG_SYS_NAND_ECCBYTES 3
45#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
46#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
Derald D. Woods83b9df22018-02-26 17:52:58 -060047#define CONFIG_SYS_ENV_SECT_SIZE SZ_128K
Derald D. Woods2b6b0892017-12-29 10:37:32 -060048#define CONFIG_ENV_OFFSET 0x260000
49#define CONFIG_ENV_ADDR 0x260000
Dirk Behme2781f802009-01-27 18:19:12 +010050#define CONFIG_ENV_OVERWRITE
Derald D. Woods2b6b0892017-12-29 10:37:32 -060051/* NAND: SPL falcon mode configs */
52#if defined(CONFIG_SPL_OS_BOOT)
Derald D. Woods83b9df22018-02-26 17:52:58 -060053#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x2a0000
Derald D. Woods2b6b0892017-12-29 10:37:32 -060054#endif /* CONFIG_SPL_OS_BOOT */
55#endif /* CONFIG_NAND */
Jason Kridner0d471612011-07-22 23:42:44 -050056
Alexander Holler8f6f15c2011-04-19 09:30:35 -040057/* USB EHCI */
Ilya Yanok7ad75782012-02-06 03:55:33 +000058#define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 147
59
Derald D. Woods2b6b0892017-12-29 10:37:32 -060060/* Enable Multi Bus support for I2C */
61#define CONFIG_I2C_MULTI_BUS
Dirk Behme2781f802009-01-27 18:19:12 +010062
Derald D. Woods2b6b0892017-12-29 10:37:32 -060063/* DSS Support */
64#define CONFIG_VIDEO_OMAP3
Tom Rix0f2a8042009-06-28 12:52:30 -050065
Derald D. Woods2b6b0892017-12-29 10:37:32 -060066/* TWL4030 LED Support */
67#define CONFIG_TWL4030_LED
Dirk Behme2781f802009-01-27 18:19:12 +010068
Derald D. Woods83b9df22018-02-26 17:52:58 -060069/* Environment */
70#define CONFIG_ENV_SIZE SZ_128K
71
72#define CONFIG_PREBOOT "usb start"
73
74#define MEM_LAYOUT_ENV_SETTINGS \
75 DEFAULT_LINUX_BOOT_ENV
76
77#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
78 "bootcmd_" #devtypel #instance "=" \
79 "setenv mmcdev " #instance "; " \
80 "run mmcboot\0"
81#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
82 #devtypel #instance " "
83
84#if defined(CONFIG_NAND)
85
86#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
87 "bootcmd_" #devtypel #instance "=" \
88 "if test ${mtdids} = '' || test ${mtdparts} = '' ; then " \
89 "echo NAND boot disabled: No mtdids and/or mtdparts; " \
90 "else " \
91 "run nandboot; " \
92 "fi\0"
93#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
94 #devtypel #instance " "
95
Guillaume GARDETff772372016-10-25 18:50:32 +020096#define BOOT_TARGET_DEVICES(func) \
Derald D. Woods83b9df22018-02-26 17:52:58 -060097 func(MMC, mmc, 0) \
98 func(LEGACY_MMC, legacy_mmc, 0) \
99 func(UBIFS, ubifs, 0) \
100 func(NAND, nand, 0)
Guillaume GARDETff772372016-10-25 18:50:32 +0200101
Derald D. Woods83b9df22018-02-26 17:52:58 -0600102#else /* !CONFIG_NAND */
103
104#define BOOT_TARGET_DEVICES(func) \
105 func(MMC, mmc, 0) \
106 func(LEGACY_MMC, legacy_mmc, 0)
107
108#endif /* CONFIG_NAND */
Guillaume GARDETff772372016-10-25 18:50:32 +0200109
110#include <config_distro_bootcmd.h>
111
Dirk Behme2781f802009-01-27 18:19:12 +0100112#define CONFIG_EXTRA_ENV_SETTINGS \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600113 MEM_LAYOUT_ENV_SETTINGS \
114 "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
Nishanth Menonb1b6e7e2013-07-15 07:11:32 -0500115 "fdt_high=0xffffffff\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600116 "console=ttyO2,115200n8\0" \
Nishanth Menon15436692013-07-15 07:11:31 -0500117 "bootdir=/boot\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600118 "bootenv=uEnv.txt\0" \
119 "bootfile=zImage\0" \
Nishanth Menon15436692013-07-15 07:11:31 -0500120 "bootpart=0:2\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600121 "bootubivol=rootfs\0" \
122 "bootubipart=rootfs\0" \
123 "usbtty=cdc_acm\0" \
Koen Kooi5b8018c2011-04-18 17:28:32 -0400124 "mpurate=auto\0" \
Peter Meerwalda0638f72012-07-02 03:43:31 +0000125 "buddy=none\0" \
Jason Kridner36c9cc52011-09-03 23:37:24 -0400126 "camera=none\0" \
Steve Sakomand4512522009-10-10 14:29:37 -0400127 "vram=12M\0" \
Jason Kridner6d9bbb62011-07-23 00:01:14 -0500128 "dvimode=640x480MR-16@60\0" \
Steve Sakomand4512522009-10-10 14:29:37 -0400129 "defaultdisplay=dvi\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600130 "defaultargs=setenv defargs " \
Steve Sakoman8c8376d2010-02-03 14:39:14 -0800131 "mpurate=${mpurate} " \
Koen Kooi3e8c3732011-08-11 00:39:28 -0500132 "buddy=${buddy} "\
Jason Kridner36c9cc52011-09-03 23:37:24 -0400133 "camera=${camera} "\
Steve Sakomand4512522009-10-10 14:29:37 -0400134 "vram=${vram} " \
135 "omapfb.mode=dvi:${dvimode} " \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600136 "omapdss.def_disp=${defaultdisplay}\0" \
137 "optargs=\0" \
Nishanth Menonb1b6e7e2013-07-15 07:11:32 -0500138 "findfdt=" \
139 "if test $beaglerev = AxBx; then " \
140 "setenv fdtfile omap3-beagle.dtb; fi; " \
141 "if test $beaglerev = Cx; then " \
142 "setenv fdtfile omap3-beagle.dtb; fi; " \
Robert Nelson7b379f42014-01-17 09:51:28 -0600143 "if test $beaglerev = C4; then " \
144 "setenv fdtfile omap3-beagle.dtb; fi; " \
Nishanth Menonb1b6e7e2013-07-15 07:11:32 -0500145 "if test $beaglerev = xMAB; then " \
Robert Nelson1f302672014-05-02 15:14:39 -0500146 "setenv fdtfile omap3-beagle-xm-ab.dtb; fi; " \
Nishanth Menonb1b6e7e2013-07-15 07:11:32 -0500147 "if test $beaglerev = xMC; then " \
148 "setenv fdtfile omap3-beagle-xm.dtb; fi; " \
149 "if test $fdtfile = undefined; then " \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600150 "echo WARNING: Could not determine device tree to use; fi\0" \
151 "mmcdev=0\0" \
152 "mmcpart=2\0" \
153 "mmcroot=/dev/mmcblk0p2 rw\0" \
154 "mmcrootfstype=ext4 rootwait\0" \
155 "mmcargs=run defaultargs; setenv bootargs console=${console} " \
156 "${mtdparts} " \
157 "${defargs} " \
158 "${optargs} " \
159 "root=${mmcroot} " \
160 "rootfstype=${mmcrootfstype}\0" \
161 "userbutton_xm=gpio input 4;\0" \
162 "userbutton_nonxm=gpio input 7;\0" \
163 "userbutton=if gpio input 173; then " \
164 "run userbutton_xm; " \
165 "else " \
166 "run userbutton_nonxm; " \
167 "fi;\0" \
168 "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
169 "ext4bootenv=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootenv}\0" \
170 "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
171 "env import -t ${loadaddr} ${filesize}\0" \
172 "mmcbootenv=setenv bootpart ${mmcdev}:${mmcpart}; " \
173 "mmc dev ${mmcdev}; " \
174 "if mmc rescan; then " \
175 "if run userbutton; then " \
176 "setenv bootenv uEnv.txt;" \
177 "else " \
178 "setenv bootenv user.txt;" \
179 "fi;" \
180 "run loadbootenv && run importbootenv; " \
181 "run ext4bootenv && run importbootenv; " \
182 "if test -n $uenvcmd; then " \
183 "echo Running uenvcmd ...; " \
184 "run uenvcmd; " \
185 "fi; " \
186 "fi\0" \
Robert Nelson2a2b8da2014-05-02 15:15:03 -0500187 "validatefdt=" \
188 "if test $beaglerev = xMAB; then " \
189 "if test ! -e mmc ${bootpart} ${bootdir}/${fdtfile}; then " \
190 "setenv fdtfile omap3-beagle-xm.dtb; " \
191 "fi; " \
192 "fi; \0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600193 "loadimage=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
194 "loaddtb=run validatefdt; ext4load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
195 "mmcboot=run mmcbootenv; " \
196 "if run loadimage && run loaddtb; then " \
197 "echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} ...; " \
198 "run mmcargs; " \
199 "if test ${bootfile} = uImage; then " \
200 "bootm ${loadaddr} - ${fdtaddr}; " \
201 "fi; " \
202 "if test ${bootfile} = zImage; then " \
203 "bootz ${loadaddr} - ${fdtaddr}; " \
204 "fi; " \
205 "fi\0" \
206 "nandroot=ubi0:rootfs ubi.mtd=rootfs rw\0" \
207 "nandrootfstype=ubifs rootwait\0" \
208 "nandargs=run defaultargs; setenv bootargs console=${console} " \
209 "${mtdparts} " \
210 "${defargs} " \
Jason Kridner6d9bbb62011-07-23 00:01:14 -0500211 "${optargs} " \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600212 "root=${nandroot} " \
213 "rootfstype=${nandrootfstype}\0" \
214 "nandboot=if nand read ${loadaddr} kernel && nand read ${fdtaddr} dtb; then " \
215 "echo Booting uImage from NAND MTD 'kernel' partition ...; " \
216 "run nandargs; " \
217 "bootm ${loadaddr} - ${fdtaddr}; " \
218 "fi\0" \
219 "loadramdisk=ext4load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \
220 "ramdisk=rootfs.ext2.gz.uboot\0" \
221 "ramdisk_size=16384\0" \
222 "ramroot=/dev/ram rw\0" \
223 "ramrootfstype=ext2\0" \
224 "ramargs=run defaultargs; setenv bootargs console=${console} " \
225 "${mtdparts} " \
226 "${defargs} " \
227 "${optargs} " \
228 "root=${ramroot} ramdisk_size=${ramdisk_size} " \
229 "rootfstype=${ramrootfstype}\0" \
230 "ramboot=run mmcbootenv; " \
231 "if run loadimage && run loaddtb && run loadramdisk; then " \
232 "echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} w/ramdisk ...; " \
233 "run ramargs; " \
234 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}; " \
235 "fi\0" \
Guillaume GARDETff772372016-10-25 18:50:32 +0200236 BOOTENV
Dirk Behme2781f802009-01-27 18:19:12 +0100237
Dirk Behme2781f802009-01-27 18:19:12 +0100238#endif /* __CONFIG_H */