blob: e8c60838b72b01bcf80b51154911a76cf676131f [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#define CONFIG_CMDLINE_TAG
22#define CONFIG_SETUP_MEMORY_TAGS
23#define CONFIG_INITRD_TAG
24#define CONFIG_REVISION_TAG
Dirk Behmef904cdb2009-01-27 18:19:12 +010025
Derald D. Woods4b379282017-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. Woodsd233ccb2018-02-26 17:52:58 -060042#define CONFIG_SYS_ENV_SECT_SIZE SZ_128K
Derald D. Woods4b379282017-12-29 10:37:32 -060043#define CONFIG_ENV_ADDR 0x260000
Dirk Behmef904cdb2009-01-27 18:19:12 +010044#define CONFIG_ENV_OVERWRITE
Derald D. Woods4b379282017-12-29 10:37:32 -060045/* NAND: SPL falcon mode configs */
46#if defined(CONFIG_SPL_OS_BOOT)
Derald D. Woodsd233ccb2018-02-26 17:52:58 -060047#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x2a0000
Derald D. Woods4b379282017-12-29 10:37:32 -060048#endif /* CONFIG_SPL_OS_BOOT */
49#endif /* CONFIG_NAND */
Dirk Behmef904cdb2009-01-27 18:19:12 +010050
Alexander Hollerd90859a2011-04-19 09:30:35 -040051/* USB EHCI */
Ilya Yanok29321c02012-02-06 03:55:33 +000052#define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 147
53
Derald D. Woods4b379282017-12-29 10:37:32 -060054/* Enable Multi Bus support for I2C */
55#define CONFIG_I2C_MULTI_BUS
Tom Rinidf4dbb52014-04-03 15:17:15 -040056
Derald D. Woods4b379282017-12-29 10:37:32 -060057/* DSS Support */
Dirk Behmef904cdb2009-01-27 18:19:12 +010058
Derald D. Woods4b379282017-12-29 10:37:32 -060059/* TWL4030 LED Support */
Dirk Behmef904cdb2009-01-27 18:19:12 +010060
Derald D. Woodsd233ccb2018-02-26 17:52:58 -060061#define MEM_LAYOUT_ENV_SETTINGS \
62 DEFAULT_LINUX_BOOT_ENV
63
64#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
65 "bootcmd_" #devtypel #instance "=" \
66 "setenv mmcdev " #instance "; " \
67 "run mmcboot\0"
68#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
69 #devtypel #instance " "
70
71#if defined(CONFIG_NAND)
72
73#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
74 "bootcmd_" #devtypel #instance "=" \
75 "if test ${mtdids} = '' || test ${mtdparts} = '' ; then " \
76 "echo NAND boot disabled: No mtdids and/or mtdparts; " \
77 "else " \
78 "run nandboot; " \
79 "fi\0"
80#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
81 #devtypel #instance " "
82
83#define BOOT_TARGET_DEVICES(func) \
84 func(MMC, mmc, 0) \
85 func(LEGACY_MMC, legacy_mmc, 0) \
86 func(UBIFS, ubifs, 0) \
87 func(NAND, nand, 0)
88
89#else /* !CONFIG_NAND */
90
91#define BOOT_TARGET_DEVICES(func) \
92 func(MMC, mmc, 0) \
93 func(LEGACY_MMC, legacy_mmc, 0)
94
95#endif /* CONFIG_NAND */
Guillaume GARDETc721fd62016-10-25 18:50:32 +020096
97#include <config_distro_bootcmd.h>
98
Dirk Behmef904cdb2009-01-27 18:19:12 +010099#define CONFIG_EXTRA_ENV_SETTINGS \
Derald D. Woodsd233ccb2018-02-26 17:52:58 -0600100 MEM_LAYOUT_ENV_SETTINGS \
101 "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
Nishanth Menon2ade4962013-07-15 07:11:32 -0500102 "fdt_high=0xffffffff\0" \
Koen Kooi27b8c8f2011-11-27 03:51:06 +0000103 "console=ttyO2,115200n8\0" \
Derald D. Woodsd233ccb2018-02-26 17:52:58 -0600104 "bootdir=/boot\0" \
105 "bootenv=uEnv.txt\0" \
106 "bootfile=zImage\0" \
107 "bootpart=0:2\0" \
108 "bootubivol=rootfs\0" \
109 "bootubipart=rootfs\0" \
110 "usbtty=cdc_acm\0" \
Koen Kooif6e593b2011-04-18 17:28:32 -0400111 "mpurate=auto\0" \
Peter Meerwald847b83d2012-07-02 03:43:31 +0000112 "buddy=none\0" \
Jason Kridnerc522eac2011-09-03 23:37:24 -0400113 "camera=none\0" \
Steve Sakoman13d2cb92009-10-10 14:29:37 -0400114 "vram=12M\0" \
Jason Kridnerf4b36ea2011-07-23 00:01:14 -0500115 "dvimode=640x480MR-16@60\0" \
Steve Sakoman13d2cb92009-10-10 14:29:37 -0400116 "defaultdisplay=dvi\0" \
Derald D. Woodsd233ccb2018-02-26 17:52:58 -0600117 "defaultargs=setenv defargs " \
Steve Sakoman5af32462010-02-03 14:39:14 -0800118 "mpurate=${mpurate} " \
Koen Kooib1660312011-08-11 00:39:28 -0500119 "buddy=${buddy} "\
Jason Kridnerc522eac2011-09-03 23:37:24 -0400120 "camera=${camera} "\
Steve Sakoman13d2cb92009-10-10 14:29:37 -0400121 "vram=${vram} " \
122 "omapfb.mode=dvi:${dvimode} " \
Derald D. Woodsd233ccb2018-02-26 17:52:58 -0600123 "omapdss.def_disp=${defaultdisplay}\0" \
124 "optargs=\0" \
Nishanth Menon2ade4962013-07-15 07:11:32 -0500125 "findfdt=" \
126 "if test $beaglerev = AxBx; then " \
127 "setenv fdtfile omap3-beagle.dtb; fi; " \
128 "if test $beaglerev = Cx; then " \
129 "setenv fdtfile omap3-beagle.dtb; fi; " \
Robert Nelson5c9038b2014-01-17 09:51:28 -0600130 "if test $beaglerev = C4; then " \
131 "setenv fdtfile omap3-beagle.dtb; fi; " \
Nishanth Menon2ade4962013-07-15 07:11:32 -0500132 "if test $beaglerev = xMAB; then " \
Robert Nelson3d47ffb2014-05-02 15:14:39 -0500133 "setenv fdtfile omap3-beagle-xm-ab.dtb; fi; " \
Nishanth Menon2ade4962013-07-15 07:11:32 -0500134 "if test $beaglerev = xMC; then " \
135 "setenv fdtfile omap3-beagle-xm.dtb; fi; " \
136 "if test $fdtfile = undefined; then " \
Derald D. Woodsd233ccb2018-02-26 17:52:58 -0600137 "echo WARNING: Could not determine device tree to use; fi\0" \
138 "mmcdev=0\0" \
139 "mmcpart=2\0" \
140 "mmcroot=/dev/mmcblk0p2 rw\0" \
141 "mmcrootfstype=ext4 rootwait\0" \
142 "mmcargs=run defaultargs; setenv bootargs console=${console} " \
143 "${mtdparts} " \
144 "${defargs} " \
145 "${optargs} " \
146 "root=${mmcroot} " \
147 "rootfstype=${mmcrootfstype}\0" \
148 "userbutton_xm=gpio input 4;\0" \
149 "userbutton_nonxm=gpio input 7;\0" \
150 "userbutton=if gpio input 173; then " \
151 "run userbutton_xm; " \
152 "else " \
153 "run userbutton_nonxm; " \
154 "fi;\0" \
155 "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
156 "ext4bootenv=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootenv}\0" \
157 "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
158 "env import -t ${loadaddr} ${filesize}\0" \
159 "mmcbootenv=setenv bootpart ${mmcdev}:${mmcpart}; " \
160 "mmc dev ${mmcdev}; " \
161 "if mmc rescan; then " \
162 "if run userbutton; then " \
163 "setenv bootenv uEnv.txt;" \
164 "else " \
165 "setenv bootenv user.txt;" \
166 "fi;" \
167 "run loadbootenv && run importbootenv; " \
168 "run ext4bootenv && run importbootenv; " \
169 "if test -n $uenvcmd; then " \
170 "echo Running uenvcmd ...; " \
171 "run uenvcmd; " \
172 "fi; " \
173 "fi\0" \
Robert Nelson4fa24272014-05-02 15:15:03 -0500174 "validatefdt=" \
175 "if test $beaglerev = xMAB; then " \
176 "if test ! -e mmc ${bootpart} ${bootdir}/${fdtfile}; then " \
177 "setenv fdtfile omap3-beagle-xm.dtb; " \
178 "fi; " \
179 "fi; \0" \
Derald D. Woodsd233ccb2018-02-26 17:52:58 -0600180 "loadimage=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
181 "loaddtb=run validatefdt; ext4load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
182 "mmcboot=run mmcbootenv; " \
183 "if run loadimage && run loaddtb; then " \
184 "echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} ...; " \
185 "run mmcargs; " \
186 "if test ${bootfile} = uImage; then " \
187 "bootm ${loadaddr} - ${fdtaddr}; " \
188 "fi; " \
189 "if test ${bootfile} = zImage; then " \
190 "bootz ${loadaddr} - ${fdtaddr}; " \
191 "fi; " \
192 "fi\0" \
193 "nandroot=ubi0:rootfs ubi.mtd=rootfs rw\0" \
194 "nandrootfstype=ubifs rootwait\0" \
195 "nandargs=run defaultargs; setenv bootargs console=${console} " \
196 "${mtdparts} " \
197 "${defargs} " \
Jason Kridnerf4b36ea2011-07-23 00:01:14 -0500198 "${optargs} " \
Derald D. Woodsd233ccb2018-02-26 17:52:58 -0600199 "root=${nandroot} " \
200 "rootfstype=${nandrootfstype}\0" \
201 "nandboot=if nand read ${loadaddr} kernel && nand read ${fdtaddr} dtb; then " \
202 "echo Booting uImage from NAND MTD 'kernel' partition ...; " \
203 "run nandargs; " \
204 "bootm ${loadaddr} - ${fdtaddr}; " \
205 "fi\0" \
206 "loadramdisk=ext4load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \
207 "ramdisk=rootfs.ext2.gz.uboot\0" \
208 "ramdisk_size=16384\0" \
209 "ramroot=/dev/ram rw\0" \
210 "ramrootfstype=ext2\0" \
211 "ramargs=run defaultargs; setenv bootargs console=${console} " \
212 "${mtdparts} " \
213 "${defargs} " \
214 "${optargs} " \
215 "root=${ramroot} ramdisk_size=${ramdisk_size} " \
216 "rootfstype=${ramrootfstype}\0" \
217 "ramboot=run mmcbootenv; " \
218 "if run loadimage && run loaddtb && run loadramdisk; then " \
219 "echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} w/ramdisk ...; " \
220 "run ramargs; " \
221 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}; " \
222 "fi\0" \
Guillaume GARDETc721fd62016-10-25 18:50:32 +0200223 BOOTENV
Dirk Behmef904cdb2009-01-27 18:19:12 +0100224
Dirk Behmef904cdb2009-01-27 18:19:12 +0100225#endif /* __CONFIG_H */