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