blob: 85b83521e7e8de744aad37793987cf3e1ca834b6 [file] [log] [blame]
Dirk Behme2781f802009-01-27 18:19:12 +01001/*
2 * (C) Copyright 2006-2008
3 * Texas Instruments.
4 * Richard Woodruff <r-woodruff2@ti.com>
5 * Syed Mohammed Khasim <x0khasim@ti.com>
6 *
7 * Configuration settings for the TI OMAP3530 Beagle board.
8 *
Wolfgang Denkbd8ec7e2013-10-07 13:07:26 +02009 * SPDX-License-Identifier: GPL-2.0+
Dirk Behme2781f802009-01-27 18:19:12 +010010 */
11
12#ifndef __CONFIG_H
13#define __CONFIG_H
Dirk Behme2781f802009-01-27 18:19:12 +010014
Derald D. Woods83b9df22018-02-26 17:52:58 -060015#define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */
Tom Rinie10247f2014-04-03 15:17:15 -040016
Derald D. Woods2b6b0892017-12-29 10:37:32 -060017#include <configs/ti_omap3_common.h>
18
Dirk Behme2781f802009-01-27 18:19:12 +010019/*
Derald D. Woods2b6b0892017-12-29 10:37:32 -060020 * We are only ever GP parts and will utilize all of the "downloaded image"
21 * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB).
Dirk Behme2781f802009-01-27 18:19:12 +010022 */
Derald D. Woods2b6b0892017-12-29 10:37:32 -060023#undef CONFIG_SPL_TEXT_BASE
24#define CONFIG_SPL_TEXT_BASE 0x40200000
Vaibhav Hiremath558d23d2010-06-07 15:20:34 -040025
Dirk Behme2781f802009-01-27 18:19:12 +010026#define CONFIG_MISC_INIT_R
Derald D. Woods2b6b0892017-12-29 10:37:32 -060027#define CONFIG_CMDLINE_TAG
28#define CONFIG_SETUP_MEMORY_TAGS
29#define CONFIG_INITRD_TAG
30#define CONFIG_REVISION_TAG
Dirk Behme2781f802009-01-27 18:19:12 +010031
Derald D. Woods2b6b0892017-12-29 10:37:32 -060032/* NAND */
33#if defined(CONFIG_NAND)
34#define CONFIG_SYS_FLASH_BASE NAND_BASE
35#define CONFIG_SYS_MAX_NAND_DEVICE 1
36#define CONFIG_SYS_NAND_5_ADDR_CYCLE
37#define CONFIG_SYS_NAND_PAGE_COUNT 64
38#define CONFIG_SYS_NAND_PAGE_SIZE 2048
39#define CONFIG_SYS_NAND_OOBSIZE 64
40#define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
41#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
42#define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9,\
43 10, 11, 12, 13}
44#define CONFIG_SYS_NAND_ECCSIZE 512
45#define CONFIG_SYS_NAND_ECCBYTES 3
46#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
47#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
Derald D. Woods83b9df22018-02-26 17:52:58 -060048#define CONFIG_SYS_ENV_SECT_SIZE SZ_128K
Derald D. Woods2b6b0892017-12-29 10:37:32 -060049#define CONFIG_ENV_OFFSET 0x260000
50#define CONFIG_ENV_ADDR 0x260000
Dirk Behme2781f802009-01-27 18:19:12 +010051#define CONFIG_ENV_OVERWRITE
Derald D. Woods2b6b0892017-12-29 10:37:32 -060052#define CONFIG_MTD_PARTITIONS /* required for UBI partition support */
53/* NAND: SPL falcon mode configs */
54#if defined(CONFIG_SPL_OS_BOOT)
Derald D. Woods83b9df22018-02-26 17:52:58 -060055#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x2a0000
Derald D. Woods2b6b0892017-12-29 10:37:32 -060056#endif /* CONFIG_SPL_OS_BOOT */
57#endif /* CONFIG_NAND */
Jason Kridner0d471612011-07-22 23:42:44 -050058
Alexander Holler8f6f15c2011-04-19 09:30:35 -040059/* USB EHCI */
Ilya Yanok7ad75782012-02-06 03:55:33 +000060#define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 147
61
Derald D. Woods2b6b0892017-12-29 10:37:32 -060062/* Enable Multi Bus support for I2C */
63#define CONFIG_I2C_MULTI_BUS
Dirk Behme2781f802009-01-27 18:19:12 +010064
Derald D. Woods2b6b0892017-12-29 10:37:32 -060065/* DSS Support */
66#define CONFIG_VIDEO_OMAP3
Tom Rix0f2a8042009-06-28 12:52:30 -050067
Derald D. Woods2b6b0892017-12-29 10:37:32 -060068/* TWL4030 LED Support */
69#define CONFIG_TWL4030_LED
Dirk Behme2781f802009-01-27 18:19:12 +010070
Derald D. Woods83b9df22018-02-26 17:52:58 -060071/* Environment */
72#define CONFIG_ENV_SIZE SZ_128K
73
74#define CONFIG_PREBOOT "usb start"
75
76#define MEM_LAYOUT_ENV_SETTINGS \
77 DEFAULT_LINUX_BOOT_ENV
78
79#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
80 "bootcmd_" #devtypel #instance "=" \
81 "setenv mmcdev " #instance "; " \
82 "run mmcboot\0"
83#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
84 #devtypel #instance " "
85
86#if defined(CONFIG_NAND)
87
88#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
89 "bootcmd_" #devtypel #instance "=" \
90 "if test ${mtdids} = '' || test ${mtdparts} = '' ; then " \
91 "echo NAND boot disabled: No mtdids and/or mtdparts; " \
92 "else " \
93 "run nandboot; " \
94 "fi\0"
95#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
96 #devtypel #instance " "
97
Guillaume GARDETff772372016-10-25 18:50:32 +020098#define BOOT_TARGET_DEVICES(func) \
Derald D. Woods83b9df22018-02-26 17:52:58 -060099 func(MMC, mmc, 0) \
100 func(LEGACY_MMC, legacy_mmc, 0) \
101 func(UBIFS, ubifs, 0) \
102 func(NAND, nand, 0)
Guillaume GARDETff772372016-10-25 18:50:32 +0200103
Derald D. Woods83b9df22018-02-26 17:52:58 -0600104#else /* !CONFIG_NAND */
105
106#define BOOT_TARGET_DEVICES(func) \
107 func(MMC, mmc, 0) \
108 func(LEGACY_MMC, legacy_mmc, 0)
109
110#endif /* CONFIG_NAND */
Guillaume GARDETff772372016-10-25 18:50:32 +0200111
112#include <config_distro_bootcmd.h>
113
Dirk Behme2781f802009-01-27 18:19:12 +0100114#define CONFIG_EXTRA_ENV_SETTINGS \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600115 MEM_LAYOUT_ENV_SETTINGS \
116 "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
Nishanth Menonb1b6e7e2013-07-15 07:11:32 -0500117 "fdt_high=0xffffffff\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600118 "console=ttyO2,115200n8\0" \
Nishanth Menon15436692013-07-15 07:11:31 -0500119 "bootdir=/boot\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600120 "bootenv=uEnv.txt\0" \
121 "bootfile=zImage\0" \
Nishanth Menon15436692013-07-15 07:11:31 -0500122 "bootpart=0:2\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600123 "bootubivol=rootfs\0" \
124 "bootubipart=rootfs\0" \
125 "usbtty=cdc_acm\0" \
Koen Kooi5b8018c2011-04-18 17:28:32 -0400126 "mpurate=auto\0" \
Peter Meerwalda0638f72012-07-02 03:43:31 +0000127 "buddy=none\0" \
Jason Kridner36c9cc52011-09-03 23:37:24 -0400128 "camera=none\0" \
Steve Sakomand4512522009-10-10 14:29:37 -0400129 "vram=12M\0" \
Jason Kridner6d9bbb62011-07-23 00:01:14 -0500130 "dvimode=640x480MR-16@60\0" \
Steve Sakomand4512522009-10-10 14:29:37 -0400131 "defaultdisplay=dvi\0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600132 "defaultargs=setenv defargs " \
Steve Sakoman8c8376d2010-02-03 14:39:14 -0800133 "mpurate=${mpurate} " \
Koen Kooi3e8c3732011-08-11 00:39:28 -0500134 "buddy=${buddy} "\
Jason Kridner36c9cc52011-09-03 23:37:24 -0400135 "camera=${camera} "\
Steve Sakomand4512522009-10-10 14:29:37 -0400136 "vram=${vram} " \
137 "omapfb.mode=dvi:${dvimode} " \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600138 "omapdss.def_disp=${defaultdisplay}\0" \
139 "optargs=\0" \
Nishanth Menonb1b6e7e2013-07-15 07:11:32 -0500140 "findfdt=" \
141 "if test $beaglerev = AxBx; then " \
142 "setenv fdtfile omap3-beagle.dtb; fi; " \
143 "if test $beaglerev = Cx; then " \
144 "setenv fdtfile omap3-beagle.dtb; fi; " \
Robert Nelson7b379f42014-01-17 09:51:28 -0600145 "if test $beaglerev = C4; then " \
146 "setenv fdtfile omap3-beagle.dtb; fi; " \
Nishanth Menonb1b6e7e2013-07-15 07:11:32 -0500147 "if test $beaglerev = xMAB; then " \
Robert Nelson1f302672014-05-02 15:14:39 -0500148 "setenv fdtfile omap3-beagle-xm-ab.dtb; fi; " \
Nishanth Menonb1b6e7e2013-07-15 07:11:32 -0500149 "if test $beaglerev = xMC; then " \
150 "setenv fdtfile omap3-beagle-xm.dtb; fi; " \
151 "if test $fdtfile = undefined; then " \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600152 "echo WARNING: Could not determine device tree to use; fi\0" \
153 "mmcdev=0\0" \
154 "mmcpart=2\0" \
155 "mmcroot=/dev/mmcblk0p2 rw\0" \
156 "mmcrootfstype=ext4 rootwait\0" \
157 "mmcargs=run defaultargs; setenv bootargs console=${console} " \
158 "${mtdparts} " \
159 "${defargs} " \
160 "${optargs} " \
161 "root=${mmcroot} " \
162 "rootfstype=${mmcrootfstype}\0" \
163 "userbutton_xm=gpio input 4;\0" \
164 "userbutton_nonxm=gpio input 7;\0" \
165 "userbutton=if gpio input 173; then " \
166 "run userbutton_xm; " \
167 "else " \
168 "run userbutton_nonxm; " \
169 "fi;\0" \
170 "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
171 "ext4bootenv=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootenv}\0" \
172 "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
173 "env import -t ${loadaddr} ${filesize}\0" \
174 "mmcbootenv=setenv bootpart ${mmcdev}:${mmcpart}; " \
175 "mmc dev ${mmcdev}; " \
176 "if mmc rescan; then " \
177 "if run userbutton; then " \
178 "setenv bootenv uEnv.txt;" \
179 "else " \
180 "setenv bootenv user.txt;" \
181 "fi;" \
182 "run loadbootenv && run importbootenv; " \
183 "run ext4bootenv && run importbootenv; " \
184 "if test -n $uenvcmd; then " \
185 "echo Running uenvcmd ...; " \
186 "run uenvcmd; " \
187 "fi; " \
188 "fi\0" \
Robert Nelson2a2b8da2014-05-02 15:15:03 -0500189 "validatefdt=" \
190 "if test $beaglerev = xMAB; then " \
191 "if test ! -e mmc ${bootpart} ${bootdir}/${fdtfile}; then " \
192 "setenv fdtfile omap3-beagle-xm.dtb; " \
193 "fi; " \
194 "fi; \0" \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600195 "loadimage=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
196 "loaddtb=run validatefdt; ext4load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
197 "mmcboot=run mmcbootenv; " \
198 "if run loadimage && run loaddtb; then " \
199 "echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} ...; " \
200 "run mmcargs; " \
201 "if test ${bootfile} = uImage; then " \
202 "bootm ${loadaddr} - ${fdtaddr}; " \
203 "fi; " \
204 "if test ${bootfile} = zImage; then " \
205 "bootz ${loadaddr} - ${fdtaddr}; " \
206 "fi; " \
207 "fi\0" \
208 "nandroot=ubi0:rootfs ubi.mtd=rootfs rw\0" \
209 "nandrootfstype=ubifs rootwait\0" \
210 "nandargs=run defaultargs; setenv bootargs console=${console} " \
211 "${mtdparts} " \
212 "${defargs} " \
Jason Kridner6d9bbb62011-07-23 00:01:14 -0500213 "${optargs} " \
Derald D. Woods83b9df22018-02-26 17:52:58 -0600214 "root=${nandroot} " \
215 "rootfstype=${nandrootfstype}\0" \
216 "nandboot=if nand read ${loadaddr} kernel && nand read ${fdtaddr} dtb; then " \
217 "echo Booting uImage from NAND MTD 'kernel' partition ...; " \
218 "run nandargs; " \
219 "bootm ${loadaddr} - ${fdtaddr}; " \
220 "fi\0" \
221 "loadramdisk=ext4load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \
222 "ramdisk=rootfs.ext2.gz.uboot\0" \
223 "ramdisk_size=16384\0" \
224 "ramroot=/dev/ram rw\0" \
225 "ramrootfstype=ext2\0" \
226 "ramargs=run defaultargs; setenv bootargs console=${console} " \
227 "${mtdparts} " \
228 "${defargs} " \
229 "${optargs} " \
230 "root=${ramroot} ramdisk_size=${ramdisk_size} " \
231 "rootfstype=${ramrootfstype}\0" \
232 "ramboot=run mmcbootenv; " \
233 "if run loadimage && run loaddtb && run loadramdisk; then " \
234 "echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} w/ramdisk ...; " \
235 "run ramargs; " \
236 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}; " \
237 "fi\0" \
Guillaume GARDETff772372016-10-25 18:50:32 +0200238 BOOTENV
Dirk Behme2781f802009-01-27 18:19:12 +0100239
Dirk Behme2781f802009-01-27 18:19:12 +0100240#endif /* __CONFIG_H */