Add CONFIG_USE_PREBOOT to boards that use CONFIG_PREBOOT
[platform/kernel/u-boot.git] / include / configs / omap3_logic.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * (C) Copyright 2011 Logic Product Development <www.logicpd.com>
4  *      Peter Barada <peter.barada@logicpd.com>
5  *
6  * Configuration settings for the Logic OMAP35x/DM37x SOM LV/Torpedo
7  * reference boards.
8  */
9
10 #ifndef __CONFIG_H
11 #define __CONFIG_H
12
13 /* High Level Configuration Options */
14
15 #include <configs/ti_omap3_common.h>
16
17 /*
18  * We are only ever GP parts and will utilize all of the "downloaded image"
19  * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB) in
20  * order to allow for BCH8 to fit in.
21  */
22
23 #define CONFIG_CMDLINE_TAG              /* enable passing of ATAGs */
24 #define CONFIG_SETUP_MEMORY_TAGS
25 #define CONFIG_INITRD_TAG
26 #define CONFIG_REVISION_TAG
27
28 /* Hardware drivers */
29
30 /* I2C */
31 #define CONFIG_SYS_I2C_EEPROM_ADDR      0x50    /* EEPROM AT24C64      */
32
33 #ifdef CONFIG_USB_EHCI_OMAP
34 #define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO        4
35 #endif
36
37 /* Board NAND Info. */
38 #ifdef CONFIG_NAND
39 #define CONFIG_SYS_MAX_NAND_DEVICE      1         /* Max number of */
40                                                   /* NAND devices */
41 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
42 #define CONFIG_SYS_NAND_PAGE_COUNT      64
43 #define CONFIG_SYS_NAND_PAGE_SIZE       2048
44 #define CONFIG_SYS_NAND_OOBSIZE         64
45 #define CONFIG_SYS_NAND_BLOCK_SIZE      (128 * 1024)
46 #define CONFIG_SYS_NAND_BAD_BLOCK_POS   NAND_LARGE_BADBLOCK_POS
47 #define CONFIG_SYS_NAND_ECCPOS          {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \
48                                          13, 14, 16, 17, 18, 19, 20, 21, 22, \
49                                          23, 24, 25, 26, 27, 28, 30, 31, 32, \
50                                          33, 34, 35, 36, 37, 38, 39, 40, 41, \
51                                          42, 44, 45, 46, 47, 48, 49, 50, 51, \
52                                          52, 53, 54, 55, 56}
53
54 #define CONFIG_SYS_NAND_ECCSIZE         512
55 #define CONFIG_SYS_NAND_ECCBYTES        13
56 #define CONFIG_NAND_OMAP_ECCSCHEME      OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
57 #define CONFIG_SYS_NAND_MAX_OOBFREE     2
58 #define CONFIG_SYS_NAND_MAX_ECCPOS      56
59 #endif
60
61 /* Environment information */
62
63 #define CONFIG_USE_PREBOOT
64 #define CONFIG_PREBOOT \
65         "setenv preboot;"                                               \
66         "saveenv;"
67
68 #define CONFIG_EXTRA_ENV_SETTINGS \
69         DEFAULT_LINUX_BOOT_ENV \
70         "mtdids=" CONFIG_MTDIDS_DEFAULT "\0"    \
71         "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
72         "mmcdev=0\0" \
73         "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
74         "mmcrootfstype=ext4 rootwait\0" \
75         "nandroot=ubi0:rootfs rw ubi.mtd=fs noinitrd\0" \
76         "nandrootfstype=ubifs rootwait\0" \
77         "autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \
78                         "if run loadbootscript; then " \
79                                 "run bootscript; " \
80                         "else " \
81                                 "run defaultboot;" \
82                         "fi; " \
83                 "else run defaultboot; fi\0" \
84         "defaultboot=run mmcramboot\0" \
85         "consoledevice=ttyS0\0" \
86         "setconsole=setenv console ${consoledevice},${baudrate}n8\0" \
87         "dump_bootargs=echo 'Bootargs: '; echo $bootargs\0" \
88         "rotation=0\0" \
89         "vrfb_arg=if itest ${rotation} -ne 0; then " \
90                 "setenv bootargs ${bootargs} omapfb.vrfb=y " \
91                 "omapfb.rotate=${rotation}; " \
92                 "fi\0" \
93         "optargs=ignore_loglevel early_printk no_console_suspend\0" \
94         "common_bootargs=run setconsole; setenv bootargs " \
95                 "${bootargs} "\
96                 "console=${console} " \
97                 "${mtdparts} "\
98                 "${optargs}; " \
99                 "run vrfb_arg\0" \
100         "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
101         "bootscript=echo 'Running bootscript from mmc ...'; " \
102                 "source ${loadaddr}\0" \
103         "loadimage=mmc rescan; " \
104                 "load mmc ${mmcdev} ${loadaddr} ${bootfile}\0" \
105         "ramdisksize=64000\0" \
106         "ramdiskimage=rootfs.ext2.gz.uboot\0" \
107         "loadramdisk=mmc rescan; " \
108                 "load mmc ${mmcdev} ${rdaddr} ${ramdiskimage}\0" \
109         "ramargs=setenv bootargs "\
110                 "root=/dev/ram rw ramdisk_size=${ramdisksize}\0" \
111         "mmcargs=setenv bootargs "\
112                 "root=PARTUUID=${uuid} " \
113                 "rootfstype=${mmcrootfstype} rw\0" \
114         "nandargs=setenv bootargs "\
115                 "root=${nandroot} " \
116                 "rootfstype=${nandrootfstype}\0" \
117         "nfsargs=setenv serverip ${tftpserver}; " \
118                 "setenv bootargs root=/dev/nfs " \
119                 "nfsroot=${nfsrootpath} " \
120                 "ip=${ipaddr}:${tftpserver}:${gatewayip}:${netmask}::eth0:off\0" \
121         "nfsrootpath=/opt/nfs-exports/omap\0" \
122         "autoload=no\0" \
123         "fdtimage=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
124         "loadfdt=mmc rescan; " \
125                 "load mmc ${mmcdev} ${fdtaddr} ${fdtimage}\0" \
126         "mmcbootcommon=echo Booting with DT from mmc${mmcdev} ...; " \
127                 "run finduuid; "\
128                 "run mmcargs; " \
129                 "run common_bootargs; " \
130                 "run dump_bootargs; " \
131                 "run loadimage; " \
132                 "run loadfdt;\0 " \
133         "mmcbootz=setenv bootfile zImage; " \
134                 "run mmcbootcommon; "\
135                 "bootz ${loadaddr} - ${fdtaddr}\0" \
136         "mmcboot=setenv bootfile uImage; "\
137                 "run mmcbootcommon; "\
138                 "bootm ${loadaddr} - ${fdtaddr}\0" \
139         "mmcrambootcommon=echo 'Booting kernel from MMC w/ramdisk...'; " \
140                 "run ramargs; " \
141                 "run common_bootargs; " \
142                 "run dump_bootargs; " \
143                 "run loadimage; " \
144                 "run loadfdt; " \
145                 "run loadramdisk\0" \
146         "mmcramboot=setenv bootfile uImage; " \
147                 "run mmcrambootcommon; " \
148                 "bootm ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
149         "mmcrambootz=setenv bootfile zImage; " \
150                 "run mmcrambootcommon; " \
151                 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
152         "tftpboot=echo 'Booting kernel/ramdisk rootfs from tftp...'; " \
153                 "run ramargs; " \
154                 "run common_bootargs; " \
155                 "run dump_bootargs; " \
156                 "tftpboot ${loadaddr} ${zimage}; " \
157                 "tftpboot ${rdaddr} ${ramdiskimage}; " \
158                 "bootm ${loadaddr} ${rdaddr}\0" \
159         "tftpbootz=echo 'Booting kernel NFS rootfs...'; " \
160                 "dhcp;" \
161                 "run nfsargs;" \
162                 "run common_bootargs;" \
163                 "run dump_bootargs;" \
164                 "tftpboot $loadaddr zImage;" \
165                 "bootz $loadaddr\0" \
166         "nandbootcommon=echo 'Booting kernel from NAND...';" \
167                 "run nandargs;" \
168                 "run common_bootargs;" \
169                 "run dump_bootargs;" \
170                 "nand read ${loadaddr} kernel;" \
171                 "nand read ${fdtaddr} spl-os;\0" \
172         "nandbootz=run nandbootcommon; "\
173                 "bootz ${loadaddr} - ${fdtaddr}\0"\
174         "nandboot=run nandbootcommon; "\
175                 "bootm ${loadaddr} - ${fdtaddr}\0"\
176
177 #define CONFIG_BOOTCOMMAND \
178         "run autoboot"
179
180 /* Miscellaneous configurable options */
181
182 /* memtest works on */
183 #define CONFIG_SYS_MEMTEST_START        (OMAP34XX_SDRC_CS0)
184 #define CONFIG_SYS_MEMTEST_END          (OMAP34XX_SDRC_CS0 + \
185                                         0x01F00000) /* 31MB */
186
187 /* FLASH and environment organization */
188
189 /* **** PISMO SUPPORT *** */
190 #if defined(CONFIG_CMD_NAND)
191 #define CONFIG_SYS_FLASH_BASE           0x10000000
192 #endif
193
194 #define CONFIG_SYS_MAX_FLASH_SECT       256
195 #define CONFIG_SYS_MAX_FLASH_BANKS      1
196 #define CONFIG_SYS_FLASH_CFI_WIDTH      FLASH_CFI_16BIT
197 #define CONFIG_SYS_FLASH_SIZE           0x4000000
198
199 /* Monitor at start of flash */
200 #define CONFIG_SYS_MONITOR_BASE         CONFIG_SYS_FLASH_BASE
201
202 #define CONFIG_SYS_ENV_SECT_SIZE        (128 << 10)     /* 128 KiB */
203 #define CONFIG_ENV_ADDR                 0x260000
204
205 /* Defines for SPL */
206
207 /* NAND: SPL falcon mode configs */
208 #ifdef CONFIG_SPL_OS_BOOT
209 #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
210 #endif
211
212 #endif /* __CONFIG_H */