blob: f8978037f2ba9ba8cf7b74891958c4227bcea3a2 [file] [log] [blame]
Peter Barada86887f82011-12-19 19:54:51 +00001/*
2 * (C) Copyright 2011 Logic Product Development <www.logicpd.com>
3 * Peter Barada <peter.barada@logicpd.com>
4 *
5 * Configuration settings for the Logic OMAP35x/DM37x SOM LV/Torpedo
6 * reference boards.
7 *
Wolfgang Denk3765b3e2013-10-07 13:07:26 +02008 * SPDX-License-Identifier: GPL-2.0+
Peter Barada86887f82011-12-19 19:54:51 +00009 */
10
11#ifndef __CONFIG_H
12#define __CONFIG_H
13
Adam Ford49c73032016-01-29 20:12:34 -060014/* High Level Configuration Options */
Peter Barada86887f82011-12-19 19:54:51 +000015
Adam Ford7b77b1f2015-09-02 09:18:20 -050016#define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */
Adam Ford49c73032016-01-29 20:12:34 -060017
Adam Ford7b77b1f2015-09-02 09:18:20 -050018#include <configs/ti_omap3_common.h>
Adam Ford49c73032016-01-29 20:12:34 -060019
Adam Ford15fde732017-04-17 08:09:45 -050020#ifdef CONFIG_SPL_BUILD
21/*
22 * Disable MMC DM for SPL build and can be re-enabled after adding
23 * DM support in SPL
24 */
25#undef CONFIG_DM_MMC
Tom Rini4125bbc2017-05-15 20:17:56 -040026#undef CONFIG_DM_MMC_OPS
Adam Ford15fde732017-04-17 08:09:45 -050027#undef OMAP_HSMMC_USE_GPIO
28
29/* select serial console configuration for SPL */
30#undef CONFIG_CONS_INDEX
31#define CONFIG_CONS_INDEX 1
32#define CONFIG_SYS_NS16550_COM1 OMAP34XX_UART1
33#endif
34
35
Tom Rinifa2f81b2016-08-26 13:30:43 -040036/*
37 * We are only ever GP parts and will utilize all of the "downloaded image"
38 * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB) in
39 * order to allow for BCH8 to fit in.
40 */
Adam Fordf92dfc82016-02-08 19:06:08 -060041#undef CONFIG_SPL_TEXT_BASE
Adam Ford15fde732017-04-17 08:09:45 -050042#define CONFIG_SPL_FRAMEWORK
Tom Rinifa2f81b2016-08-26 13:30:43 -040043#define CONFIG_SPL_TEXT_BASE 0x40200000
Adam Fordf92dfc82016-02-08 19:06:08 -060044
Peter Barada86887f82011-12-19 19:54:51 +000045#define CONFIG_MISC_INIT_R /* misc_init_r dumps the die id */
Adam Ford49c73032016-01-29 20:12:34 -060046#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
Peter Barada86887f82011-12-19 19:54:51 +000047#define CONFIG_SETUP_MEMORY_TAGS
48#define CONFIG_INITRD_TAG
49#define CONFIG_REVISION_TAG
50
Adam Ford49c73032016-01-29 20:12:34 -060051/* Hardware drivers */
Peter Barada86887f82011-12-19 19:54:51 +000052
Adam Ford49c73032016-01-29 20:12:34 -060053#define CONFIG_USB_OMAP3
54
Peter Barada86887f82011-12-19 19:54:51 +000055/* commands to include */
Adam Ford49c73032016-01-29 20:12:34 -060056#define CONFIG_CMD_NAND
Adam Ford49c73032016-01-29 20:12:34 -060057#define CONFIG_CMD_MTDPARTS
Peter Barada86887f82011-12-19 19:54:51 +000058#define CONFIG_CMD_NAND_LOCK_UNLOCK /* nand (un)lock commands */
Peter Barada86887f82011-12-19 19:54:51 +000059
Adam Ford49c73032016-01-29 20:12:34 -060060/* I2C */
Heiko Schocher6789e842013-10-22 11:03:18 +020061#define CONFIG_SYS_I2C_OMAP34XX
Adam Ford49c73032016-01-29 20:12:34 -060062#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM AT24C64 */
Peter Barada86887f82011-12-19 19:54:51 +000063
Adam Ford588e41d2016-01-31 13:34:39 -060064/* USB */
Adam Ford588e41d2016-01-31 13:34:39 -060065#define CONFIG_USB_MUSB_OMAP2PLUS
66#define CONFIG_USB_MUSB_PIO_ONLY
Adam Ford588e41d2016-01-31 13:34:39 -060067#define CONFIG_USB_ETHER
68#define CONFIG_USB_ETHER_RNDIS
Adam Ford588e41d2016-01-31 13:34:39 -060069#define CONFIG_USB_FUNCTION_FASTBOOT
70#define CONFIG_CMD_FASTBOOT
71#define CONFIG_ANDROID_BOOT_IMAGE
72#define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR
73#define CONFIG_FASTBOOT_BUF_SIZE 0x07000000
Adam Ford588e41d2016-01-31 13:34:39 -060074
Adam Ford49c73032016-01-29 20:12:34 -060075/* TWL4030 */
76#define CONFIG_TWL4030_PWM
Adam Ford588e41d2016-01-31 13:34:39 -060077#define CONFIG_TWL4030_USB
Adam Ford7b77b1f2015-09-02 09:18:20 -050078
Adam Ford49c73032016-01-29 20:12:34 -060079/* Board NAND Info. */
80#ifdef CONFIG_NAND
Peter Barada86887f82011-12-19 19:54:51 +000081#define CONFIG_NAND_OMAP_GPMC
Adam Ford7b77b1f2015-09-02 09:18:20 -050082
Adam Ford49c73032016-01-29 20:12:34 -060083#define CONFIG_CMD_UBIFS /* Read-only UBI volume operations */
84#define CONFIG_RBTREE /* required by CONFIG_CMD_UBI */
85#define CONFIG_LZO /* required by CONFIG_CMD_UBIFS */
Peter Barada86887f82011-12-19 19:54:51 +000086
Adam Ford49c73032016-01-29 20:12:34 -060087#define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
88 /* to access nand */
89#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of */
90 /* NAND devices */
Stefano Babic55f1b392015-07-26 15:18:15 +020091#define CONFIG_SYS_NAND_BUSWIDTH_16BIT
Adam Ford49c73032016-01-29 20:12:34 -060092#define CONFIG_SYS_NAND_5_ADDR_CYCLE
93#define CONFIG_SYS_NAND_PAGE_COUNT 64
94#define CONFIG_SYS_NAND_PAGE_SIZE 2048
95#define CONFIG_SYS_NAND_OOBSIZE 64
96#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
97#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
98#define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \
99 13, 14, 16, 17, 18, 19, 20, 21, 22, \
100 23, 24, 25, 26, 27, 28, 30, 31, 32, \
101 33, 34, 35, 36, 37, 38, 39, 40, 41, \
102 42, 44, 45, 46, 47, 48, 49, 50, 51, \
103 52, 53, 54, 55, 56}
Adam Ford7b77b1f2015-09-02 09:18:20 -0500104
Adam Ford49c73032016-01-29 20:12:34 -0600105#define CONFIG_SYS_NAND_ECCSIZE 512
106#define CONFIG_SYS_NAND_ECCBYTES 13
107#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
108#define CONFIG_BCH
109#define CONFIG_SYS_NAND_MAX_OOBFREE 2
110#define CONFIG_SYS_NAND_MAX_ECCPOS 56
111#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
112#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
113#define CONFIG_MTD_PARTITIONS /* required for UBI partition support */
114#define MTDIDS_DEFAULT "nand0=omap2-nand.0"
Adam Ford12262342016-11-12 22:02:37 -0600115#define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:"\
116 "512k(MLO),"\
117 "1792k(u-boot),"\
118 "128k(spl-os)," \
119 "128k(u-boot-env),"\
120 "6m(kernel),-(fs)"
Adam Ford49c73032016-01-29 20:12:34 -0600121#endif
Peter Barada86887f82011-12-19 19:54:51 +0000122
123/* Environment information */
Peter Barada86887f82011-12-19 19:54:51 +0000124
Peter Barada86887f82011-12-19 19:54:51 +0000125#define CONFIG_PREBOOT \
Peter Barada86887f82011-12-19 19:54:51 +0000126 "setenv preboot;" \
Adam Ford49c73032016-01-29 20:12:34 -0600127 "nand unlock;" \
Peter Barada86887f82011-12-19 19:54:51 +0000128 "saveenv;"
129
Peter Barada86887f82011-12-19 19:54:51 +0000130#define CONFIG_EXTRA_ENV_SETTINGS \
Adam Fordbb5854c2017-01-04 09:26:43 -0600131 DEFAULT_LINUX_BOOT_ENV \
Peter Barada86887f82011-12-19 19:54:51 +0000132 "mtdids=" MTDIDS_DEFAULT "\0" \
133 "mtdparts=" MTDPARTS_DEFAULT "\0" \
134 "mmcdev=0\0" \
Adam Ford49c73032016-01-29 20:12:34 -0600135 "mmcroot=/dev/mmcblk0p2 rw\0" \
136 "mmcrootfstype=ext4 rootwait\0" \
Adam Forda094c922016-02-10 01:41:10 -0600137 "nandroot=ubi0:rootfs rw ubi.mtd=fs noinitrd\0" \
138 "nandrootfstype=ubifs rootwait\0" \
Andrew Bradford66968112012-10-01 05:06:52 +0000139 "autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \
Peter Barada86887f82011-12-19 19:54:51 +0000140 "if run loadbootscript; then " \
141 "run bootscript; " \
142 "else " \
143 "run defaultboot;" \
144 "fi; " \
145 "else run defaultboot; fi\0" \
146 "defaultboot=run mmcramboot\0" \
147 "consoledevice=ttyO0\0" \
Peter Barada86887f82011-12-19 19:54:51 +0000148 "setconsole=setenv console ${consoledevice},${baudrate}n8\0" \
149 "dump_bootargs=echo 'Bootargs: '; echo $bootargs\0" \
150 "rotation=0\0" \
151 "vrfb_arg=if itest ${rotation} -ne 0; then " \
152 "setenv bootargs ${bootargs} omapfb.vrfb=y " \
153 "omapfb.rotate=${rotation}; " \
154 "fi\0" \
Adam Ford49c73032016-01-29 20:12:34 -0600155 "optargs=ignore_loglevel early_printk no_console_suspend\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600156 "common_bootargs=run setconsole; setenv bootargs " \
157 "${bootargs} "\
158 "console=${console} " \
159 "${mtdparts} "\
160 "${optargs}; " \
Peter Barada86887f82011-12-19 19:54:51 +0000161 "run vrfb_arg\0" \
Adam Fordbb5854c2017-01-04 09:26:43 -0600162 "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
Peter Barada86887f82011-12-19 19:54:51 +0000163 "bootscript=echo 'Running bootscript from mmc ...'; " \
164 "source ${loadaddr}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600165 "loadimage=mmc rescan; " \
166 "load mmc ${mmcdev} ${loadaddr} ${bootfile}\0" \
Peter Barada86887f82011-12-19 19:54:51 +0000167 "ramdisksize=64000\0" \
Peter Barada86887f82011-12-19 19:54:51 +0000168 "ramdiskimage=rootfs.ext2.gz.uboot\0" \
Adam Ford49c73032016-01-29 20:12:34 -0600169 "loadramdisk=mmc rescan; " \
Adam Fordbb5854c2017-01-04 09:26:43 -0600170 "load mmc ${mmcdev} ${rdaddr} ${ramdiskimage}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600171 "ramargs=setenv bootargs "\
Peter Barada86887f82011-12-19 19:54:51 +0000172 "root=/dev/ram rw ramdisk_size=${ramdisksize}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600173 "mmcargs=setenv bootargs "\
174 "root=${mmcroot} rootfstype=${mmcrootfstype}\0" \
175 "nandargs=setenv bootargs "\
Adam Forda094c922016-02-10 01:41:10 -0600176 "root=${nandroot} " \
177 "rootfstype=${nandrootfstype}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600178 "nfsargs=setenv serverip ${tftpserver}; " \
179 "setenv bootargs root=/dev/nfs " \
Adam Ford760d1af2016-10-15 08:16:27 -0500180 "nfsroot=${nfsrootpath} " \
181 "ip=${ipaddr}:${tftpserver}:${gatewayip}:${netmask}::eth0:off\0" \
182 "nfsrootpath=/opt/nfs-exports/omap\0" \
183 "autoload=no\0" \
Adam Fordbb5854c2017-01-04 09:26:43 -0600184 "loadfdt=mmc rescan; " \
185 "load mmc ${mmcdev} ${fdtaddr} ${fdtimage}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600186 "mmcbootcommon=echo Booting with DT from mmc${mmcdev} ...; " \
Adam Ford49c73032016-01-29 20:12:34 -0600187 "run mmcargs; " \
188 "run common_bootargs; " \
189 "run dump_bootargs; " \
Adam Ford476e16e2017-01-04 11:51:24 -0600190 "run loadimage; " \
191 "run loadfdt;\0 " \
192 "mmcbootz=setenv bootfile zImage; " \
193 "run mmcbootcommon; "\
Adam Ford49c73032016-01-29 20:12:34 -0600194 "bootz ${loadaddr} - ${fdtaddr}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600195 "mmcboot=setenv bootfile uImage; "\
196 "run mmcbootcommon; "\
197 "bootm ${loadaddr} - ${fdtaddr}\0" \
198 "mmcrambootcommon=echo 'Booting kernel from MMC w/ramdisk...'; " \
Peter Barada86887f82011-12-19 19:54:51 +0000199 "run ramargs; " \
200 "run common_bootargs; " \
201 "run dump_bootargs; " \
Adam Ford476e16e2017-01-04 11:51:24 -0600202 "run loadimage; " \
Adam Fordbb5854c2017-01-04 09:26:43 -0600203 "run loadfdt; " \
Adam Ford476e16e2017-01-04 11:51:24 -0600204 "run loadramdisk\0" \
205 "mmcramboot=setenv bootfile uImage; " \
206 "run mmcrambootcommon; " \
207 "bootm ${loadaddr} ${rdaddr} ${fdtimage}\0" \
208 "mmcrambootz=setenv bootfile zImage; " \
209 "run mmcrambootcommon; " \
210 "bootz ${loadaddr} ${rdaddr} ${fdtimage}\0" \
Adam Ford49c73032016-01-29 20:12:34 -0600211 "tftpboot=echo 'Booting kernel/ramdisk rootfs from tftp...'; " \
212 "run ramargs; " \
213 "run common_bootargs; " \
214 "run dump_bootargs; " \
Adam Ford760d1af2016-10-15 08:16:27 -0500215 "tftpboot ${loadaddr} ${zimage}; " \
Adam Fordbb5854c2017-01-04 09:26:43 -0600216 "tftpboot ${rdaddr} ${ramdiskimage}; " \
217 "bootm ${loadaddr} ${rdaddr}\0" \
Adam Ford760d1af2016-10-15 08:16:27 -0500218 "tftpbootz=echo 'Booting kernel NFS rootfs...'; " \
219 "dhcp;" \
220 "run nfsargs;" \
221 "run common_bootargs;" \
222 "run dump_bootargs;" \
223 "tftpboot $loadaddr zImage;" \
Adam Ford476e16e2017-01-04 11:51:24 -0600224 "bootz $loadaddr\0" \
225 "nandbootcommon=echo 'Booting kernel from NAND...';" \
226 "nand unlock;" \
227 "run nandargs;" \
228 "run common_bootargs;" \
229 "run dump_bootargs;" \
230 "nand read ${loadaddr} kernel;" \
231 "nand read ${fdtaddr} spl-os;\0" \
232 "nandbootz=run nandbootcommon; "\
233 "bootz ${loadaddr} - ${fdtaddr}\0"\
234 "nandboot=run nandbootcommon; "\
235 "bootm ${loadaddr} - ${fdtaddr}\0"\
Peter Barada86887f82011-12-19 19:54:51 +0000236
237#define CONFIG_BOOTCOMMAND \
238 "run autoboot"
239
Adam Ford49c73032016-01-29 20:12:34 -0600240/* Miscellaneous configurable options */
Adam Ford7b77b1f2015-09-02 09:18:20 -0500241
Peter Barada86887f82011-12-19 19:54:51 +0000242/* memtest works on */
243#define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0)
244#define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + \
245 0x01F00000) /* 31MB */
246
Adam Ford49c73032016-01-29 20:12:34 -0600247/* FLASH and environment organization */
Peter Barada86887f82011-12-19 19:54:51 +0000248
249/* **** PISMO SUPPORT *** */
Peter Barada86887f82011-12-19 19:54:51 +0000250#if defined(CONFIG_CMD_NAND)
pekon gupta222a3112014-07-18 17:59:41 +0530251#define CONFIG_SYS_FLASH_BASE NAND_BASE
Peter Barada86887f82011-12-19 19:54:51 +0000252#endif
253
254/* Monitor at start of flash */
255#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
256
Adam Ford49c73032016-01-29 20:12:34 -0600257#define CONFIG_ENV_IS_IN_NAND 1
258#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
Peter Barada86887f82011-12-19 19:54:51 +0000259#define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */
260
Peter Barada86887f82011-12-19 19:54:51 +0000261#define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
Adam Ford49c73032016-01-29 20:12:34 -0600262#define CONFIG_ENV_OFFSET SMNAND_ENV_OFFSET
263#define CONFIG_ENV_ADDR SMNAND_ENV_OFFSET
Peter Barada86887f82011-12-19 19:54:51 +0000264
Adam Ford49c73032016-01-29 20:12:34 -0600265/* SMSC922x Ethernet */
Peter Barada86887f82011-12-19 19:54:51 +0000266#if defined(CONFIG_CMD_NET)
Peter Barada86887f82011-12-19 19:54:51 +0000267#define CONFIG_SMC911X
Adam Ford1e1acc72016-01-31 17:13:33 -0600268#define CONFIG_SMC911X_32_BIT
Peter Barada86887f82011-12-19 19:54:51 +0000269#define CONFIG_SMC911X_BASE 0x08000000
Peter Barada86887f82011-12-19 19:54:51 +0000270#endif /* (CONFIG_CMD_NET) */
271
Adam Ford49c73032016-01-29 20:12:34 -0600272/* Defines for SPL */
273
274#define CONFIG_SPL_OMAP3_ID_NAND
275
276/* NAND: SPL falcon mode configs */
277#ifdef CONFIG_SPL_OS_BOOT
278#define CONFIG_CMD_SPL_NAND_OFS 0x240000
279#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
280#define CONFIG_CMD_SPL_WRITE_SIZE 0x2000
281#endif
282
Peter Barada86887f82011-12-19 19:54:51 +0000283#endif /* __CONFIG_H */