blob: f0c8c990fafc304873f5d7bddffbc2322ca75e30 [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#define CONFIG_CMDLINE_TAG
22#define CONFIG_SETUP_MEMORY_TAGS
23#define CONFIG_INITRD_TAG
24#define CONFIG_REVISION_TAG
Dirk Behme2781f802009-01-27 18:19:12 +010025
Derald D. Woods2b6b0892017-12-29 10:37:32 -060026/* NAND */
27#if defined(CONFIG_NAND)
28#define CONFIG_SYS_FLASH_BASE NAND_BASE
29#define CONFIG_SYS_MAX_NAND_DEVICE 1
30#define CONFIG_SYS_NAND_5_ADDR_CYCLE
31#define CONFIG_SYS_NAND_PAGE_COUNT 64
32#define CONFIG_SYS_NAND_PAGE_SIZE 2048
33#define CONFIG_SYS_NAND_OOBSIZE 64
34#define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
35#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
36#define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9,\
37 10, 11, 12, 13}
38#define CONFIG_SYS_NAND_ECCSIZE 512
39#define CONFIG_SYS_NAND_ECCBYTES 3
40#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
41#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
Derald D. Woods83b9df22018-02-26 17:52:58 -060042#define CONFIG_SYS_ENV_SECT_SIZE SZ_128K
Derald D. Woods2b6b0892017-12-29 10:37:32 -060043#define CONFIG_ENV_OFFSET 0x260000
44#define CONFIG_ENV_ADDR 0x260000
Dirk Behme2781f802009-01-27 18:19:12 +010045#define CONFIG_ENV_OVERWRITE
Derald D. Woods2b6b0892017-12-29 10:37:32 -060046/* NAND: SPL falcon mode configs */
47#if defined(CONFIG_SPL_OS_BOOT)
Derald D. Woods83b9df22018-02-26 17:52:58 -060048#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x2a0000
Derald D. Woods2b6b0892017-12-29 10:37:32 -060049#endif /* CONFIG_SPL_OS_BOOT */
50#endif /* CONFIG_NAND */
Jason Kridner0d471612011-07-22 23:42:44 -050051
Alexander Holler8f6f15c2011-04-19 09:30:35 -040052/* USB EHCI */
Ilya Yanok7ad75782012-02-06 03:55:33 +000053#define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 147
54
Derald D. Woods2b6b0892017-12-29 10:37:32 -060055/* Enable Multi Bus support for I2C */
56#define CONFIG_I2C_MULTI_BUS
Dirk Behme2781f802009-01-27 18:19:12 +010057
Derald D. Woods2b6b0892017-12-29 10:37:32 -060058/* DSS Support */
Tom Rix0f2a8042009-06-28 12:52:30 -050059
Derald D. Woods2b6b0892017-12-29 10:37:32 -060060/* TWL4030 LED Support */
Dirk Behme2781f802009-01-27 18:19:12 +010061
Derald D. Woods83b9df22018-02-26 17:52:58 -060062/* Environment */
63#define CONFIG_ENV_SIZE SZ_128K
64
65#define CONFIG_PREBOOT "usb start"
66
67#define MEM_LAYOUT_ENV_SETTINGS \
68 DEFAULT_LINUX_BOOT_ENV
69
70#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
71 "bootcmd_" #devtypel #instance "=" \
72 "setenv mmcdev " #instance "; " \
73 "run mmcboot\0"
74#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
75 #devtypel #instance " "
76
77#if defined(CONFIG_NAND)
78
79#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
80 "bootcmd_" #devtypel #instance "=" \
81 "if test ${mtdids} = '' || test ${mtdparts} = '' ; then " \
82 "echo NAND boot disabled: No mtdids and/or mtdparts; " \
83 "else " \
84 "run nandboot; " \
85 "fi\0"
86#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
87 #devtypel #instance " "
88
Guillaume GARDETff772372016-10-25 18:50:32 +020089#define BOOT_TARGET_DEVICES(func) \
Derald D. Woods83b9df22018-02-26 17:52:58 -060090 func(MMC, mmc, 0) \
91 func(LEGACY_MMC, legacy_mmc, 0) \
92 func(UBIFS, ubifs, 0) \
93 func(NAND, nand, 0)
Guillaume GARDETff772372016-10-25 18:50:32 +020094
Derald D. Woods83b9df22018-02-26 17:52:58 -060095#else /* !CONFIG_NAND */
96
97#define BOOT_TARGET_DEVICES(func) \
98 func(MMC, mmc, 0) \
99 func(LEGACY_MMC, legacy_mmc, 0)
100
101#endif /* CONFIG_NAND */
Guillaume GARDETff772372016-10-25 18:50:32 +0200102
103#include <config_distro_bootcmd.h>
104
Dirk Behme2781f802009-01-27 18:19:12 +0100105#define CONFIG_EXTRA_ENV_SETTINGS \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600106 MEM_LAYOUT_ENV_SETTINGS \
107 "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
Nishanth Menonb1b6e7e2013-07-15 07:11:32 -0500108 "fdt_high=0xffffffff\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600109 "console=ttyO2,115200n8\0" \
Nishanth Menon15436692013-07-15 07:11:31 -0500110 "bootdir=/boot\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600111 "bootenv=uEnv.txt\0" \
112 "bootfile=zImage\0" \
Nishanth Menon15436692013-07-15 07:11:31 -0500113 "bootpart=0:2\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600114 "bootubivol=rootfs\0" \
115 "bootubipart=rootfs\0" \
116 "usbtty=cdc_acm\0" \
Koen Kooi5b8018c2011-04-18 17:28:32 -0400117 "mpurate=auto\0" \
Peter Meerwalda0638f72012-07-02 03:43:31 +0000118 "buddy=none\0" \
Jason Kridner36c9cc52011-09-03 23:37:24 -0400119 "camera=none\0" \
Steve Sakomand4512522009-10-10 14:29:37 -0400120 "vram=12M\0" \
Jason Kridner6d9bbb62011-07-23 00:01:14 -0500121 "dvimode=640x480MR-16@60\0" \
Steve Sakomand4512522009-10-10 14:29:37 -0400122 "defaultdisplay=dvi\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600123 "defaultargs=setenv defargs " \
Steve Sakoman8c8376d2010-02-03 14:39:14 -0800124 "mpurate=${mpurate} " \
Koen Kooi3e8c3732011-08-11 00:39:28 -0500125 "buddy=${buddy} "\
Jason Kridner36c9cc52011-09-03 23:37:24 -0400126 "camera=${camera} "\
Steve Sakomand4512522009-10-10 14:29:37 -0400127 "vram=${vram} " \
128 "omapfb.mode=dvi:${dvimode} " \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600129 "omapdss.def_disp=${defaultdisplay}\0" \
130 "optargs=\0" \
Nishanth Menonb1b6e7e2013-07-15 07:11:32 -0500131 "findfdt=" \
132 "if test $beaglerev = AxBx; then " \
133 "setenv fdtfile omap3-beagle.dtb; fi; " \
134 "if test $beaglerev = Cx; then " \
135 "setenv fdtfile omap3-beagle.dtb; fi; " \
Robert Nelson7b379f42014-01-17 09:51:28 -0600136 "if test $beaglerev = C4; then " \
137 "setenv fdtfile omap3-beagle.dtb; fi; " \
Nishanth Menonb1b6e7e2013-07-15 07:11:32 -0500138 "if test $beaglerev = xMAB; then " \
Robert Nelson1f302672014-05-02 15:14:39 -0500139 "setenv fdtfile omap3-beagle-xm-ab.dtb; fi; " \
Nishanth Menonb1b6e7e2013-07-15 07:11:32 -0500140 "if test $beaglerev = xMC; then " \
141 "setenv fdtfile omap3-beagle-xm.dtb; fi; " \
142 "if test $fdtfile = undefined; then " \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600143 "echo WARNING: Could not determine device tree to use; fi\0" \
144 "mmcdev=0\0" \
145 "mmcpart=2\0" \
146 "mmcroot=/dev/mmcblk0p2 rw\0" \
147 "mmcrootfstype=ext4 rootwait\0" \
148 "mmcargs=run defaultargs; setenv bootargs console=${console} " \
149 "${mtdparts} " \
150 "${defargs} " \
151 "${optargs} " \
152 "root=${mmcroot} " \
153 "rootfstype=${mmcrootfstype}\0" \
154 "userbutton_xm=gpio input 4;\0" \
155 "userbutton_nonxm=gpio input 7;\0" \
156 "userbutton=if gpio input 173; then " \
157 "run userbutton_xm; " \
158 "else " \
159 "run userbutton_nonxm; " \
160 "fi;\0" \
161 "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
162 "ext4bootenv=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootenv}\0" \
163 "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
164 "env import -t ${loadaddr} ${filesize}\0" \
165 "mmcbootenv=setenv bootpart ${mmcdev}:${mmcpart}; " \
166 "mmc dev ${mmcdev}; " \
167 "if mmc rescan; then " \
168 "if run userbutton; then " \
169 "setenv bootenv uEnv.txt;" \
170 "else " \
171 "setenv bootenv user.txt;" \
172 "fi;" \
173 "run loadbootenv && run importbootenv; " \
174 "run ext4bootenv && run importbootenv; " \
175 "if test -n $uenvcmd; then " \
176 "echo Running uenvcmd ...; " \
177 "run uenvcmd; " \
178 "fi; " \
179 "fi\0" \
Robert Nelson2a2b8da2014-05-02 15:15:03 -0500180 "validatefdt=" \
181 "if test $beaglerev = xMAB; then " \
182 "if test ! -e mmc ${bootpart} ${bootdir}/${fdtfile}; then " \
183 "setenv fdtfile omap3-beagle-xm.dtb; " \
184 "fi; " \
185 "fi; \0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600186 "loadimage=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
187 "loaddtb=run validatefdt; ext4load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
188 "mmcboot=run mmcbootenv; " \
189 "if run loadimage && run loaddtb; then " \
190 "echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} ...; " \
191 "run mmcargs; " \
192 "if test ${bootfile} = uImage; then " \
193 "bootm ${loadaddr} - ${fdtaddr}; " \
194 "fi; " \
195 "if test ${bootfile} = zImage; then " \
196 "bootz ${loadaddr} - ${fdtaddr}; " \
197 "fi; " \
198 "fi\0" \
199 "nandroot=ubi0:rootfs ubi.mtd=rootfs rw\0" \
200 "nandrootfstype=ubifs rootwait\0" \
201 "nandargs=run defaultargs; setenv bootargs console=${console} " \
202 "${mtdparts} " \
203 "${defargs} " \
Jason Kridner6d9bbb62011-07-23 00:01:14 -0500204 "${optargs} " \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600205 "root=${nandroot} " \
206 "rootfstype=${nandrootfstype}\0" \
207 "nandboot=if nand read ${loadaddr} kernel && nand read ${fdtaddr} dtb; then " \
208 "echo Booting uImage from NAND MTD 'kernel' partition ...; " \
209 "run nandargs; " \
210 "bootm ${loadaddr} - ${fdtaddr}; " \
211 "fi\0" \
212 "loadramdisk=ext4load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \
213 "ramdisk=rootfs.ext2.gz.uboot\0" \
214 "ramdisk_size=16384\0" \
215 "ramroot=/dev/ram rw\0" \
216 "ramrootfstype=ext2\0" \
217 "ramargs=run defaultargs; setenv bootargs console=${console} " \
218 "${mtdparts} " \
219 "${defargs} " \
220 "${optargs} " \
221 "root=${ramroot} ramdisk_size=${ramdisk_size} " \
222 "rootfstype=${ramrootfstype}\0" \
223 "ramboot=run mmcbootenv; " \
224 "if run loadimage && run loaddtb && run loadramdisk; then " \
225 "echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} w/ramdisk ...; " \
226 "run ramargs; " \
227 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}; " \
228 "fi\0" \
Guillaume GARDETff772372016-10-25 18:50:32 +0200229 BOOTENV
Dirk Behme2781f802009-01-27 18:19:12 +0100230
Dirk Behme2781f802009-01-27 18:19:12 +0100231#endif /* __CONFIG_H */