blob: 735c9ef08ab3b9a6de2d9270bd96417a491de4f3 [file] [log] [blame]
Peter Baradae5b77e62011-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 Denkbd8ec7e2013-10-07 13:07:26 +02008 * SPDX-License-Identifier: GPL-2.0+
Peter Baradae5b77e62011-12-19 19:54:51 +00009 */
10
11#ifndef __CONFIG_H
12#define __CONFIG_H
13
Adam Ford5326c292016-01-29 20:12:34 -060014/* High Level Configuration Options */
Peter Baradae5b77e62011-12-19 19:54:51 +000015
Adam Ford04c848a2015-09-02 09:18:20 -050016#define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */
Peter Baradae5b77e62011-12-19 19:54:51 +000017
Adam Ford5326c292016-01-29 20:12:34 -060018#include <configs/ti_omap3_common.h>
19
Adam Ford55bdf922017-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
26#undef OMAP_HSMMC_USE_GPIO
27
28/* select serial console configuration for SPL */
29#undef CONFIG_CONS_INDEX
30#define CONFIG_CONS_INDEX 1
31#define CONFIG_SYS_NS16550_COM1 OMAP34XX_UART1
32#endif
33
34
Tom Rinicfff4aa2016-08-26 13:30:43 -040035/*
36 * We are only ever GP parts and will utilize all of the "downloaded image"
37 * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB) in
38 * order to allow for BCH8 to fit in.
39 */
Adam Fordd92313a2016-02-08 19:06:08 -060040#undef CONFIG_SPL_TEXT_BASE
Adam Ford55bdf922017-04-17 08:09:45 -050041#define CONFIG_SPL_FRAMEWORK
Tom Rinicfff4aa2016-08-26 13:30:43 -040042#define CONFIG_SPL_TEXT_BASE 0x40200000
Adam Fordd92313a2016-02-08 19:06:08 -060043
Peter Baradae5b77e62011-12-19 19:54:51 +000044#define CONFIG_MISC_INIT_R /* misc_init_r dumps the die id */
Adam Ford5326c292016-01-29 20:12:34 -060045#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
Peter Baradae5b77e62011-12-19 19:54:51 +000046#define CONFIG_SETUP_MEMORY_TAGS
47#define CONFIG_INITRD_TAG
48#define CONFIG_REVISION_TAG
49
Adam Ford5326c292016-01-29 20:12:34 -060050/* Hardware drivers */
Peter Baradae5b77e62011-12-19 19:54:51 +000051
Adam Ford5326c292016-01-29 20:12:34 -060052#define CONFIG_USB_OMAP3
53
Peter Baradae5b77e62011-12-19 19:54:51 +000054/* commands to include */
Adam Ford5326c292016-01-29 20:12:34 -060055#define CONFIG_CMD_NAND
Adam Ford5326c292016-01-29 20:12:34 -060056#define CONFIG_CMD_MTDPARTS
Peter Baradae5b77e62011-12-19 19:54:51 +000057#define CONFIG_CMD_NAND_LOCK_UNLOCK /* nand (un)lock commands */
Peter Baradae5b77e62011-12-19 19:54:51 +000058
Adam Ford5326c292016-01-29 20:12:34 -060059/* I2C */
Heiko Schocherf53f2b82013-10-22 11:03:18 +020060#define CONFIG_SYS_I2C_OMAP34XX
Adam Ford5326c292016-01-29 20:12:34 -060061#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM AT24C64 */
Peter Baradae5b77e62011-12-19 19:54:51 +000062
Adam Fordd76b69c2016-01-31 13:34:39 -060063/* USB */
Adam Fordd76b69c2016-01-31 13:34:39 -060064#define CONFIG_USB_MUSB_OMAP2PLUS
65#define CONFIG_USB_MUSB_PIO_ONLY
Adam Fordd76b69c2016-01-31 13:34:39 -060066#define CONFIG_USB_ETHER
67#define CONFIG_USB_ETHER_RNDIS
Adam Fordd76b69c2016-01-31 13:34:39 -060068#define CONFIG_USB_FUNCTION_FASTBOOT
69#define CONFIG_CMD_FASTBOOT
70#define CONFIG_ANDROID_BOOT_IMAGE
71#define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR
72#define CONFIG_FASTBOOT_BUF_SIZE 0x07000000
Adam Fordd76b69c2016-01-31 13:34:39 -060073
Adam Ford5326c292016-01-29 20:12:34 -060074/* TWL4030 */
75#define CONFIG_TWL4030_PWM
Adam Fordd76b69c2016-01-31 13:34:39 -060076#define CONFIG_TWL4030_USB
Adam Ford04c848a2015-09-02 09:18:20 -050077
Adam Ford5326c292016-01-29 20:12:34 -060078/* Board NAND Info. */
79#ifdef CONFIG_NAND
Peter Baradae5b77e62011-12-19 19:54:51 +000080#define CONFIG_NAND_OMAP_GPMC
Adam Ford04c848a2015-09-02 09:18:20 -050081
Adam Ford5326c292016-01-29 20:12:34 -060082#define CONFIG_CMD_UBIFS /* Read-only UBI volume operations */
83#define CONFIG_RBTREE /* required by CONFIG_CMD_UBI */
84#define CONFIG_LZO /* required by CONFIG_CMD_UBIFS */
Peter Baradae5b77e62011-12-19 19:54:51 +000085
Adam Ford5326c292016-01-29 20:12:34 -060086#define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
87 /* to access nand */
88#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of */
89 /* NAND devices */
Stefano Babic0cd41182015-07-26 15:18:15 +020090#define CONFIG_SYS_NAND_BUSWIDTH_16BIT
Adam Ford5326c292016-01-29 20:12:34 -060091#define CONFIG_SYS_NAND_5_ADDR_CYCLE
92#define CONFIG_SYS_NAND_PAGE_COUNT 64
93#define CONFIG_SYS_NAND_PAGE_SIZE 2048
94#define CONFIG_SYS_NAND_OOBSIZE 64
95#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
96#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
97#define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \
98 13, 14, 16, 17, 18, 19, 20, 21, 22, \
99 23, 24, 25, 26, 27, 28, 30, 31, 32, \
100 33, 34, 35, 36, 37, 38, 39, 40, 41, \
101 42, 44, 45, 46, 47, 48, 49, 50, 51, \
102 52, 53, 54, 55, 56}
Adam Ford04c848a2015-09-02 09:18:20 -0500103
Adam Ford5326c292016-01-29 20:12:34 -0600104#define CONFIG_SYS_NAND_ECCSIZE 512
105#define CONFIG_SYS_NAND_ECCBYTES 13
106#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
107#define CONFIG_BCH
108#define CONFIG_SYS_NAND_MAX_OOBFREE 2
109#define CONFIG_SYS_NAND_MAX_ECCPOS 56
110#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
111#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
112#define CONFIG_MTD_PARTITIONS /* required for UBI partition support */
113#define MTDIDS_DEFAULT "nand0=omap2-nand.0"
Adam Fordea66e172016-11-12 22:02:37 -0600114#define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:"\
115 "512k(MLO),"\
116 "1792k(u-boot),"\
117 "128k(spl-os)," \
118 "128k(u-boot-env),"\
119 "6m(kernel),-(fs)"
Adam Ford5326c292016-01-29 20:12:34 -0600120#endif
Peter Baradae5b77e62011-12-19 19:54:51 +0000121
122/* Environment information */
Peter Baradae5b77e62011-12-19 19:54:51 +0000123
Peter Baradae5b77e62011-12-19 19:54:51 +0000124#define CONFIG_PREBOOT \
Peter Baradae5b77e62011-12-19 19:54:51 +0000125 "setenv preboot;" \
Adam Ford5326c292016-01-29 20:12:34 -0600126 "nand unlock;" \
Peter Baradae5b77e62011-12-19 19:54:51 +0000127 "saveenv;"
128
Peter Baradae5b77e62011-12-19 19:54:51 +0000129#define CONFIG_EXTRA_ENV_SETTINGS \
Adam Ford34f28ee2017-01-04 09:26:43 -0600130 DEFAULT_LINUX_BOOT_ENV \
Peter Baradae5b77e62011-12-19 19:54:51 +0000131 "mtdids=" MTDIDS_DEFAULT "\0" \
132 "mtdparts=" MTDPARTS_DEFAULT "\0" \
133 "mmcdev=0\0" \
Adam Ford5326c292016-01-29 20:12:34 -0600134 "mmcroot=/dev/mmcblk0p2 rw\0" \
135 "mmcrootfstype=ext4 rootwait\0" \
Adam Ford193e9a12016-02-10 01:41:10 -0600136 "nandroot=ubi0:rootfs rw ubi.mtd=fs noinitrd\0" \
137 "nandrootfstype=ubifs rootwait\0" \
Andrew Bradforde1c7c8a2012-10-01 05:06:52 +0000138 "autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \
Peter Baradae5b77e62011-12-19 19:54:51 +0000139 "if run loadbootscript; then " \
140 "run bootscript; " \
141 "else " \
142 "run defaultboot;" \
143 "fi; " \
144 "else run defaultboot; fi\0" \
145 "defaultboot=run mmcramboot\0" \
146 "consoledevice=ttyO0\0" \
Peter Baradae5b77e62011-12-19 19:54:51 +0000147 "setconsole=setenv console ${consoledevice},${baudrate}n8\0" \
148 "dump_bootargs=echo 'Bootargs: '; echo $bootargs\0" \
149 "rotation=0\0" \
150 "vrfb_arg=if itest ${rotation} -ne 0; then " \
151 "setenv bootargs ${bootargs} omapfb.vrfb=y " \
152 "omapfb.rotate=${rotation}; " \
153 "fi\0" \
Adam Ford5326c292016-01-29 20:12:34 -0600154 "optargs=ignore_loglevel early_printk no_console_suspend\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600155 "common_bootargs=run setconsole; setenv bootargs " \
156 "${bootargs} "\
157 "console=${console} " \
158 "${mtdparts} "\
159 "${optargs}; " \
Peter Baradae5b77e62011-12-19 19:54:51 +0000160 "run vrfb_arg\0" \
Adam Ford34f28ee2017-01-04 09:26:43 -0600161 "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
Peter Baradae5b77e62011-12-19 19:54:51 +0000162 "bootscript=echo 'Running bootscript from mmc ...'; " \
163 "source ${loadaddr}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600164 "loadimage=mmc rescan; " \
165 "load mmc ${mmcdev} ${loadaddr} ${bootfile}\0" \
Peter Baradae5b77e62011-12-19 19:54:51 +0000166 "ramdisksize=64000\0" \
Peter Baradae5b77e62011-12-19 19:54:51 +0000167 "ramdiskimage=rootfs.ext2.gz.uboot\0" \
Adam Ford5326c292016-01-29 20:12:34 -0600168 "loadramdisk=mmc rescan; " \
Adam Ford34f28ee2017-01-04 09:26:43 -0600169 "load mmc ${mmcdev} ${rdaddr} ${ramdiskimage}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600170 "ramargs=setenv bootargs "\
Peter Baradae5b77e62011-12-19 19:54:51 +0000171 "root=/dev/ram rw ramdisk_size=${ramdisksize}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600172 "mmcargs=setenv bootargs "\
173 "root=${mmcroot} rootfstype=${mmcrootfstype}\0" \
174 "nandargs=setenv bootargs "\
Adam Ford193e9a12016-02-10 01:41:10 -0600175 "root=${nandroot} " \
176 "rootfstype=${nandrootfstype}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600177 "nfsargs=setenv serverip ${tftpserver}; " \
178 "setenv bootargs root=/dev/nfs " \
Adam Ford97073d02016-10-15 08:16:27 -0500179 "nfsroot=${nfsrootpath} " \
180 "ip=${ipaddr}:${tftpserver}:${gatewayip}:${netmask}::eth0:off\0" \
181 "nfsrootpath=/opt/nfs-exports/omap\0" \
182 "autoload=no\0" \
Adam Ford34f28ee2017-01-04 09:26:43 -0600183 "loadfdt=mmc rescan; " \
184 "load mmc ${mmcdev} ${fdtaddr} ${fdtimage}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600185 "mmcbootcommon=echo Booting with DT from mmc${mmcdev} ...; " \
Adam Ford5326c292016-01-29 20:12:34 -0600186 "run mmcargs; " \
187 "run common_bootargs; " \
188 "run dump_bootargs; " \
Adam Ford4760c8f2017-01-04 11:51:24 -0600189 "run loadimage; " \
190 "run loadfdt;\0 " \
191 "mmcbootz=setenv bootfile zImage; " \
192 "run mmcbootcommon; "\
Adam Ford5326c292016-01-29 20:12:34 -0600193 "bootz ${loadaddr} - ${fdtaddr}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600194 "mmcboot=setenv bootfile uImage; "\
195 "run mmcbootcommon; "\
196 "bootm ${loadaddr} - ${fdtaddr}\0" \
197 "mmcrambootcommon=echo 'Booting kernel from MMC w/ramdisk...'; " \
Peter Baradae5b77e62011-12-19 19:54:51 +0000198 "run ramargs; " \
199 "run common_bootargs; " \
200 "run dump_bootargs; " \
Adam Ford4760c8f2017-01-04 11:51:24 -0600201 "run loadimage; " \
Adam Ford34f28ee2017-01-04 09:26:43 -0600202 "run loadfdt; " \
Adam Ford4760c8f2017-01-04 11:51:24 -0600203 "run loadramdisk\0" \
204 "mmcramboot=setenv bootfile uImage; " \
205 "run mmcrambootcommon; " \
206 "bootm ${loadaddr} ${rdaddr} ${fdtimage}\0" \
207 "mmcrambootz=setenv bootfile zImage; " \
208 "run mmcrambootcommon; " \
209 "bootz ${loadaddr} ${rdaddr} ${fdtimage}\0" \
Adam Ford5326c292016-01-29 20:12:34 -0600210 "tftpboot=echo 'Booting kernel/ramdisk rootfs from tftp...'; " \
Peter Baradae5b77e62011-12-19 19:54:51 +0000211 "run ramargs; " \
212 "run common_bootargs; " \
213 "run dump_bootargs; " \
Adam Ford97073d02016-10-15 08:16:27 -0500214 "tftpboot ${loadaddr} ${zimage}; " \
Adam Ford34f28ee2017-01-04 09:26:43 -0600215 "tftpboot ${rdaddr} ${ramdiskimage}; " \
216 "bootm ${loadaddr} ${rdaddr}\0" \
Adam Ford97073d02016-10-15 08:16:27 -0500217 "tftpbootz=echo 'Booting kernel NFS rootfs...'; " \
218 "dhcp;" \
219 "run nfsargs;" \
220 "run common_bootargs;" \
221 "run dump_bootargs;" \
222 "tftpboot $loadaddr zImage;" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600223 "bootz $loadaddr\0" \
224 "nandbootcommon=echo 'Booting kernel from NAND...';" \
225 "nand unlock;" \
226 "run nandargs;" \
227 "run common_bootargs;" \
228 "run dump_bootargs;" \
229 "nand read ${loadaddr} kernel;" \
230 "nand read ${fdtaddr} spl-os;\0" \
231 "nandbootz=run nandbootcommon; "\
232 "bootz ${loadaddr} - ${fdtaddr}\0"\
233 "nandboot=run nandbootcommon; "\
234 "bootm ${loadaddr} - ${fdtaddr}\0"\
Peter Baradae5b77e62011-12-19 19:54:51 +0000235
236#define CONFIG_BOOTCOMMAND \
237 "run autoboot"
238
Adam Ford5326c292016-01-29 20:12:34 -0600239/* Miscellaneous configurable options */
Adam Ford04c848a2015-09-02 09:18:20 -0500240
Peter Baradae5b77e62011-12-19 19:54:51 +0000241/* memtest works on */
242#define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0)
243#define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + \
244 0x01F00000) /* 31MB */
245
Adam Ford5326c292016-01-29 20:12:34 -0600246/* FLASH and environment organization */
Peter Baradae5b77e62011-12-19 19:54:51 +0000247
248/* **** PISMO SUPPORT *** */
Peter Baradae5b77e62011-12-19 19:54:51 +0000249#if defined(CONFIG_CMD_NAND)
pekon gupta0a9ec452014-07-18 17:59:41 +0530250#define CONFIG_SYS_FLASH_BASE NAND_BASE
Peter Baradae5b77e62011-12-19 19:54:51 +0000251#endif
252
253/* Monitor at start of flash */
254#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
255
Adam Ford5326c292016-01-29 20:12:34 -0600256#define CONFIG_ENV_IS_IN_NAND 1
257#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
Peter Baradae5b77e62011-12-19 19:54:51 +0000258#define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */
259
Peter Baradae5b77e62011-12-19 19:54:51 +0000260#define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
Adam Ford5326c292016-01-29 20:12:34 -0600261#define CONFIG_ENV_OFFSET SMNAND_ENV_OFFSET
262#define CONFIG_ENV_ADDR SMNAND_ENV_OFFSET
Peter Baradae5b77e62011-12-19 19:54:51 +0000263
Adam Ford5326c292016-01-29 20:12:34 -0600264/* SMSC922x Ethernet */
Peter Baradae5b77e62011-12-19 19:54:51 +0000265#if defined(CONFIG_CMD_NET)
Peter Baradae5b77e62011-12-19 19:54:51 +0000266#define CONFIG_SMC911X
Adam Ford5a175cc2016-01-31 17:13:33 -0600267#define CONFIG_SMC911X_32_BIT
Peter Baradae5b77e62011-12-19 19:54:51 +0000268#define CONFIG_SMC911X_BASE 0x08000000
Peter Baradae5b77e62011-12-19 19:54:51 +0000269#endif /* (CONFIG_CMD_NET) */
270
Adam Ford5326c292016-01-29 20:12:34 -0600271/* Defines for SPL */
272
273#define CONFIG_SPL_OMAP3_ID_NAND
274
275/* NAND: SPL falcon mode configs */
276#ifdef CONFIG_SPL_OS_BOOT
277#define CONFIG_CMD_SPL_NAND_OFS 0x240000
278#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
279#define CONFIG_CMD_SPL_WRITE_SIZE 0x2000
280#endif
281
Peter Baradae5b77e62011-12-19 19:54:51 +0000282#endif /* __CONFIG_H */