Merge tag 'xilinx-for-v2022.07-rc4' of https://source.denx.de/u-boot/custodians/u...
[platform/kernel/u-boot.git] / include / configs / omap3_beagle.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
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.
9  */
10
11 #ifndef __CONFIG_H
12 #define __CONFIG_H
13
14 #include <configs/ti_omap3_common.h>
15
16 /*
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  */
20
21 /* NAND */
22 #if defined(CONFIG_MTD_RAW_NAND)
23 #define CONFIG_SYS_FLASH_BASE           NAND_BASE
24 #define CONFIG_SYS_MAX_NAND_DEVICE      1
25 #define CONFIG_SYS_NAND_ECCPOS          {2, 3, 4, 5, 6, 7, 8, 9,\
26                                          10, 11, 12, 13}
27 #define CONFIG_SYS_NAND_ECCSIZE         512
28 #define CONFIG_SYS_NAND_ECCBYTES        3
29 #define CONFIG_SYS_ENV_SECT_SIZE        SZ_128K
30 /* NAND: SPL falcon mode configs */
31 #if defined(CONFIG_SPL_OS_BOOT)
32 #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x2a0000
33 #endif /* CONFIG_SPL_OS_BOOT */
34 #endif /* CONFIG_MTD_RAW_NAND */
35
36 /* Enable Multi Bus support for I2C */
37 #define CONFIG_I2C_MULTI_BUS
38
39 /* DSS Support */
40
41 /* TWL4030 LED Support */
42
43 #define MEM_LAYOUT_ENV_SETTINGS \
44         DEFAULT_LINUX_BOOT_ENV
45
46 #define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
47         "bootcmd_" #devtypel #instance "=" \
48         "setenv mmcdev " #instance "; " \
49         "run mmcboot\0"
50 #define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
51         #devtypel #instance " "
52
53 #if defined(CONFIG_MTD_RAW_NAND)
54
55 #define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
56         "bootcmd_" #devtypel #instance "=" \
57         "if test ${mtdids} = '' || test ${mtdparts} = '' ; then " \
58                 "echo NAND boot disabled: No mtdids and/or mtdparts; " \
59         "else " \
60                 "run nandboot; " \
61         "fi\0"
62 #define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
63         #devtypel #instance " "
64
65 #define BOOT_TARGET_DEVICES(func) \
66         func(MMC, mmc, 0) \
67         func(LEGACY_MMC, legacy_mmc, 0) \
68         func(UBIFS, ubifs, 0) \
69         func(NAND, nand, 0)
70
71 #else /* !CONFIG_MTD_RAW_NAND */
72
73 #define BOOT_TARGET_DEVICES(func) \
74         func(MMC, mmc, 0) \
75         func(LEGACY_MMC, legacy_mmc, 0)
76
77 #endif /* CONFIG_MTD_RAW_NAND */
78
79 #include <config_distro_bootcmd.h>
80
81 #define CONFIG_EXTRA_ENV_SETTINGS \
82         MEM_LAYOUT_ENV_SETTINGS \
83         "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
84         "fdt_high=0xffffffff\0" \
85         "console=ttyO2,115200n8\0" \
86         "bootdir=/boot\0" \
87         "bootenv=uEnv.txt\0" \
88         "bootfile=zImage\0" \
89         "bootpart=0:2\0" \
90         "bootubivol=rootfs\0" \
91         "bootubipart=rootfs\0" \
92         "usbtty=cdc_acm\0" \
93         "mpurate=auto\0" \
94         "buddy=none\0" \
95         "camera=none\0" \
96         "vram=12M\0" \
97         "dvimode=640x480MR-16@60\0" \
98         "defaultdisplay=dvi\0" \
99         "defaultargs=setenv defargs " \
100                 "mpurate=${mpurate} " \
101                 "buddy=${buddy} "\
102                 "camera=${camera} "\
103                 "vram=${vram} " \
104                 "omapfb.mode=dvi:${dvimode} " \
105                 "omapdss.def_disp=${defaultdisplay}\0" \
106         "optargs=\0" \
107         "findfdt=" \
108                 "if test $beaglerev = AxBx; then " \
109                         "setenv fdtfile omap3-beagle.dtb; fi; " \
110                 "if test $beaglerev = Cx; then " \
111                         "setenv fdtfile omap3-beagle.dtb; fi; " \
112                 "if test $beaglerev = C4; then " \
113                         "setenv fdtfile omap3-beagle.dtb; fi; " \
114                 "if test $beaglerev = xMAB; then " \
115                         "setenv fdtfile omap3-beagle-xm-ab.dtb; fi; " \
116                 "if test $beaglerev = xMC; then " \
117                         "setenv fdtfile omap3-beagle-xm.dtb; fi; " \
118                 "if test $fdtfile = undefined; then " \
119                         "echo WARNING: Could not determine device tree to use; fi\0" \
120         "mmcdev=0\0" \
121         "mmcpart=2\0" \
122         "mmcroot=/dev/mmcblk0p2 rw\0" \
123         "mmcrootfstype=ext4 rootwait\0" \
124         "mmcargs=run defaultargs; setenv bootargs console=${console} " \
125                 "${mtdparts} " \
126                 "${defargs} " \
127                 "${optargs} " \
128                 "root=${mmcroot} " \
129                 "rootfstype=${mmcrootfstype}\0" \
130         "userbutton_xm=gpio input 4;\0" \
131         "userbutton_nonxm=gpio input 7;\0" \
132         "userbutton=if gpio input 173; then " \
133                         "run userbutton_xm; " \
134                 "else " \
135                         "run userbutton_nonxm; " \
136                 "fi;\0" \
137         "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
138         "ext4bootenv=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootenv}\0" \
139         "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
140                 "env import -t ${loadaddr} ${filesize}\0" \
141         "mmcbootenv=setenv bootpart ${mmcdev}:${mmcpart}; " \
142                 "mmc dev ${mmcdev}; " \
143                 "if mmc rescan; then " \
144                         "if run userbutton; then " \
145                                 "setenv bootenv uEnv.txt;" \
146                         "else " \
147                                 "setenv bootenv user.txt;" \
148                         "fi;" \
149                         "run loadbootenv && run importbootenv; " \
150                         "run ext4bootenv && run importbootenv; " \
151                         "if test -n $uenvcmd; then " \
152                                 "echo Running uenvcmd ...; " \
153                                 "run uenvcmd; " \
154                         "fi; " \
155                 "fi\0" \
156         "validatefdt=" \
157                 "if test $beaglerev = xMAB; then " \
158                         "if test ! -e mmc ${bootpart} ${bootdir}/${fdtfile}; then " \
159                                 "setenv fdtfile omap3-beagle-xm.dtb; " \
160                         "fi; " \
161                 "fi; \0" \
162         "loadimage=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
163         "loaddtb=run validatefdt; ext4load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
164         "mmcboot=run mmcbootenv; " \
165                 "if run loadimage && run loaddtb; then " \
166                         "echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} ...; " \
167                         "run mmcargs; " \
168                         "if test ${bootfile} = uImage; then " \
169                                 "bootm ${loadaddr} - ${fdtaddr}; " \
170                         "fi; " \
171                         "if test ${bootfile} = zImage; then " \
172                                 "bootz ${loadaddr} - ${fdtaddr}; " \
173                         "fi; " \
174                 "fi\0" \
175         "nandroot=ubi0:rootfs ubi.mtd=rootfs rw\0" \
176         "nandrootfstype=ubifs rootwait\0" \
177         "nandargs=run defaultargs; setenv bootargs console=${console} " \
178                 "${mtdparts} " \
179                 "${defargs} " \
180                 "${optargs} " \
181                 "root=${nandroot} " \
182                 "rootfstype=${nandrootfstype}\0" \
183         "nandboot=if nand read ${loadaddr} kernel && nand read ${fdtaddr} dtb; then " \
184                         "echo Booting uImage from NAND MTD 'kernel' partition ...; " \
185                         "run nandargs; " \
186                         "bootm ${loadaddr} - ${fdtaddr}; " \
187                 "fi\0" \
188         "loadramdisk=ext4load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \
189         "ramdisk=rootfs.ext2.gz.uboot\0" \
190         "ramdisk_size=16384\0" \
191         "ramroot=/dev/ram rw\0" \
192         "ramrootfstype=ext2\0" \
193         "ramargs=run defaultargs; setenv bootargs console=${console} " \
194                 "${mtdparts} " \
195                 "${defargs} " \
196                 "${optargs} " \
197                 "root=${ramroot} ramdisk_size=${ramdisk_size} " \
198                 "rootfstype=${ramrootfstype}\0" \
199         "ramboot=run mmcbootenv; " \
200                 "if run loadimage && run loaddtb && run loadramdisk; then " \
201                         "echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} w/ramdisk ...; " \
202                         "run ramargs; " \
203                         "bootz ${loadaddr} ${rdaddr} ${fdtaddr}; " \
204                 "fi\0" \
205         BOOTENV
206
207 #endif /* __CONFIG_H */