blob: 706175c93e82c0a6da46004de9fb9b797e37e5dd [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
Tom Rinicfff4aa2016-08-26 13:30:43 -040020/*
21 * We are only ever GP parts and will utilize all of the "downloaded image"
22 * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB) in
23 * order to allow for BCH8 to fit in.
24 */
Adam Fordd92313a2016-02-08 19:06:08 -060025#undef CONFIG_SPL_TEXT_BASE
Tom Rinicfff4aa2016-08-26 13:30:43 -040026#define CONFIG_SPL_TEXT_BASE 0x40200000
Adam Fordd92313a2016-02-08 19:06:08 -060027
Peter Baradae5b77e62011-12-19 19:54:51 +000028#define CONFIG_MISC_INIT_R /* misc_init_r dumps the die id */
Adam Ford5326c292016-01-29 20:12:34 -060029#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
Peter Baradae5b77e62011-12-19 19:54:51 +000030#define CONFIG_SETUP_MEMORY_TAGS
31#define CONFIG_INITRD_TAG
32#define CONFIG_REVISION_TAG
33
Adam Ford5326c292016-01-29 20:12:34 -060034/* Hardware drivers */
Peter Baradae5b77e62011-12-19 19:54:51 +000035
Adam Fordcc276de2016-01-22 04:40:58 -060036/* GPIO banks */
37#define CONFIG_OMAP3_GPIO_6 /* GPIO160..191 is in GPIO bank 6 */
38
Adam Ford5326c292016-01-29 20:12:34 -060039#define CONFIG_USB_OMAP3
40
41/* select serial console configuration */
Adam Ford04c848a2015-09-02 09:18:20 -050042#undef CONFIG_CONS_INDEX
Peter Baradae5b77e62011-12-19 19:54:51 +000043#define CONFIG_CONS_INDEX 1
44#define CONFIG_SYS_NS16550_COM1 OMAP34XX_UART1
45#define CONFIG_SERIAL1 1 /* UART1 on OMAP Logic boards */
46
Peter Baradae5b77e62011-12-19 19:54:51 +000047/* commands to include */
Adam Ford5326c292016-01-29 20:12:34 -060048#define CONFIG_CMD_NAND
Adam Ford5326c292016-01-29 20:12:34 -060049#define CONFIG_CMD_MTDPARTS
Peter Baradae5b77e62011-12-19 19:54:51 +000050#define CONFIG_CMD_NAND_LOCK_UNLOCK /* nand (un)lock commands */
Peter Baradae5b77e62011-12-19 19:54:51 +000051
Adam Ford5326c292016-01-29 20:12:34 -060052/* I2C */
Heiko Schocherf53f2b82013-10-22 11:03:18 +020053#define CONFIG_SYS_I2C_OMAP34XX
Adam Ford5326c292016-01-29 20:12:34 -060054#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM AT24C64 */
55#define EXPANSION_EEPROM_I2C_BUS 2 /* I2C Bus for AT24C64 */
56#define CONFIG_OMAP3_LOGIC_USE_NEW_PRODUCT_ID
Peter Baradae5b77e62011-12-19 19:54:51 +000057
Adam Fordd76b69c2016-01-31 13:34:39 -060058/* USB */
Adam Fordd76b69c2016-01-31 13:34:39 -060059#define CONFIG_USB_MUSB_OMAP2PLUS
60#define CONFIG_USB_MUSB_PIO_ONLY
Adam Fordd76b69c2016-01-31 13:34:39 -060061#define CONFIG_USB_ETHER
62#define CONFIG_USB_ETHER_RNDIS
Adam Fordd76b69c2016-01-31 13:34:39 -060063#define CONFIG_USB_FUNCTION_FASTBOOT
64#define CONFIG_CMD_FASTBOOT
65#define CONFIG_ANDROID_BOOT_IMAGE
66#define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR
67#define CONFIG_FASTBOOT_BUF_SIZE 0x07000000
Adam Fordd76b69c2016-01-31 13:34:39 -060068
Adam Ford5326c292016-01-29 20:12:34 -060069/* TWL4030 */
70#define CONFIG_TWL4030_PWM
Adam Fordd76b69c2016-01-31 13:34:39 -060071#define CONFIG_TWL4030_USB
Adam Ford04c848a2015-09-02 09:18:20 -050072
Adam Ford5326c292016-01-29 20:12:34 -060073/* Board NAND Info. */
74#ifdef CONFIG_NAND
Peter Baradae5b77e62011-12-19 19:54:51 +000075#define CONFIG_NAND_OMAP_GPMC
Adam Ford04c848a2015-09-02 09:18:20 -050076
Adam Ford5326c292016-01-29 20:12:34 -060077#define CONFIG_CMD_UBIFS /* Read-only UBI volume operations */
78#define CONFIG_RBTREE /* required by CONFIG_CMD_UBI */
79#define CONFIG_LZO /* required by CONFIG_CMD_UBIFS */
Peter Baradae5b77e62011-12-19 19:54:51 +000080
Adam Ford5326c292016-01-29 20:12:34 -060081#define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
82 /* to access nand */
83#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of */
84 /* NAND devices */
Stefano Babic0cd41182015-07-26 15:18:15 +020085#define CONFIG_SYS_NAND_BUSWIDTH_16BIT
Adam Ford5326c292016-01-29 20:12:34 -060086#define CONFIG_SYS_NAND_5_ADDR_CYCLE
87#define CONFIG_SYS_NAND_PAGE_COUNT 64
88#define CONFIG_SYS_NAND_PAGE_SIZE 2048
89#define CONFIG_SYS_NAND_OOBSIZE 64
90#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
91#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
92#define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \
93 13, 14, 16, 17, 18, 19, 20, 21, 22, \
94 23, 24, 25, 26, 27, 28, 30, 31, 32, \
95 33, 34, 35, 36, 37, 38, 39, 40, 41, \
96 42, 44, 45, 46, 47, 48, 49, 50, 51, \
97 52, 53, 54, 55, 56}
Adam Ford04c848a2015-09-02 09:18:20 -050098
Adam Ford5326c292016-01-29 20:12:34 -060099#define CONFIG_SYS_NAND_ECCSIZE 512
100#define CONFIG_SYS_NAND_ECCBYTES 13
101#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
102#define CONFIG_BCH
103#define CONFIG_SYS_NAND_MAX_OOBFREE 2
104#define CONFIG_SYS_NAND_MAX_ECCPOS 56
105#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
106#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
107#define CONFIG_MTD_PARTITIONS /* required for UBI partition support */
108#define MTDIDS_DEFAULT "nand0=omap2-nand.0"
Adam Fordea66e172016-11-12 22:02:37 -0600109#define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:"\
110 "512k(MLO),"\
111 "1792k(u-boot),"\
112 "128k(spl-os)," \
113 "128k(u-boot-env),"\
114 "6m(kernel),-(fs)"
Adam Ford5326c292016-01-29 20:12:34 -0600115#endif
Peter Baradae5b77e62011-12-19 19:54:51 +0000116
117/* Environment information */
Peter Baradae5b77e62011-12-19 19:54:51 +0000118
Peter Baradae5b77e62011-12-19 19:54:51 +0000119#define CONFIG_PREBOOT \
Peter Baradae5b77e62011-12-19 19:54:51 +0000120 "setenv preboot;" \
Adam Ford5326c292016-01-29 20:12:34 -0600121 "nand unlock;" \
Peter Baradae5b77e62011-12-19 19:54:51 +0000122 "saveenv;"
123
Peter Baradae5b77e62011-12-19 19:54:51 +0000124#define CONFIG_EXTRA_ENV_SETTINGS \
Adam Ford34f28ee2017-01-04 09:26:43 -0600125 DEFAULT_LINUX_BOOT_ENV \
Peter Baradae5b77e62011-12-19 19:54:51 +0000126 "mtdids=" MTDIDS_DEFAULT "\0" \
127 "mtdparts=" MTDPARTS_DEFAULT "\0" \
128 "mmcdev=0\0" \
Adam Ford5326c292016-01-29 20:12:34 -0600129 "mmcroot=/dev/mmcblk0p2 rw\0" \
130 "mmcrootfstype=ext4 rootwait\0" \
Adam Ford193e9a12016-02-10 01:41:10 -0600131 "nandroot=ubi0:rootfs rw ubi.mtd=fs noinitrd\0" \
132 "nandrootfstype=ubifs rootwait\0" \
Andrew Bradforde1c7c8a2012-10-01 05:06:52 +0000133 "autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \
Peter Baradae5b77e62011-12-19 19:54:51 +0000134 "if run loadbootscript; then " \
135 "run bootscript; " \
136 "else " \
137 "run defaultboot;" \
138 "fi; " \
139 "else run defaultboot; fi\0" \
140 "defaultboot=run mmcramboot\0" \
141 "consoledevice=ttyO0\0" \
Peter Baradae5b77e62011-12-19 19:54:51 +0000142 "setconsole=setenv console ${consoledevice},${baudrate}n8\0" \
143 "dump_bootargs=echo 'Bootargs: '; echo $bootargs\0" \
144 "rotation=0\0" \
145 "vrfb_arg=if itest ${rotation} -ne 0; then " \
146 "setenv bootargs ${bootargs} omapfb.vrfb=y " \
147 "omapfb.rotate=${rotation}; " \
148 "fi\0" \
Adam Ford5326c292016-01-29 20:12:34 -0600149 "optargs=ignore_loglevel early_printk no_console_suspend\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600150 "common_bootargs=run setconsole; setenv bootargs " \
151 "${bootargs} "\
152 "console=${console} " \
153 "${mtdparts} "\
154 "${optargs}; " \
Peter Baradae5b77e62011-12-19 19:54:51 +0000155 "run vrfb_arg\0" \
Adam Ford34f28ee2017-01-04 09:26:43 -0600156 "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
Peter Baradae5b77e62011-12-19 19:54:51 +0000157 "bootscript=echo 'Running bootscript from mmc ...'; " \
158 "source ${loadaddr}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600159 "loadimage=mmc rescan; " \
160 "load mmc ${mmcdev} ${loadaddr} ${bootfile}\0" \
Peter Baradae5b77e62011-12-19 19:54:51 +0000161 "ramdisksize=64000\0" \
Peter Baradae5b77e62011-12-19 19:54:51 +0000162 "ramdiskimage=rootfs.ext2.gz.uboot\0" \
Adam Ford5326c292016-01-29 20:12:34 -0600163 "loadramdisk=mmc rescan; " \
Adam Ford34f28ee2017-01-04 09:26:43 -0600164 "load mmc ${mmcdev} ${rdaddr} ${ramdiskimage}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600165 "ramargs=setenv bootargs "\
Peter Baradae5b77e62011-12-19 19:54:51 +0000166 "root=/dev/ram rw ramdisk_size=${ramdisksize}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600167 "mmcargs=setenv bootargs "\
168 "root=${mmcroot} rootfstype=${mmcrootfstype}\0" \
169 "nandargs=setenv bootargs "\
Adam Ford193e9a12016-02-10 01:41:10 -0600170 "root=${nandroot} " \
171 "rootfstype=${nandrootfstype}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600172 "nfsargs=setenv serverip ${tftpserver}; " \
173 "setenv bootargs root=/dev/nfs " \
Adam Ford97073d02016-10-15 08:16:27 -0500174 "nfsroot=${nfsrootpath} " \
175 "ip=${ipaddr}:${tftpserver}:${gatewayip}:${netmask}::eth0:off\0" \
176 "nfsrootpath=/opt/nfs-exports/omap\0" \
177 "autoload=no\0" \
Adam Ford34f28ee2017-01-04 09:26:43 -0600178 "loadfdt=mmc rescan; " \
179 "load mmc ${mmcdev} ${fdtaddr} ${fdtimage}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600180 "mmcbootcommon=echo Booting with DT from mmc${mmcdev} ...; " \
Adam Ford5326c292016-01-29 20:12:34 -0600181 "run mmcargs; " \
182 "run common_bootargs; " \
183 "run dump_bootargs; " \
Adam Ford4760c8f2017-01-04 11:51:24 -0600184 "run loadimage; " \
185 "run loadfdt;\0 " \
186 "mmcbootz=setenv bootfile zImage; " \
187 "run mmcbootcommon; "\
Adam Ford5326c292016-01-29 20:12:34 -0600188 "bootz ${loadaddr} - ${fdtaddr}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600189 "mmcboot=setenv bootfile uImage; "\
190 "run mmcbootcommon; "\
191 "bootm ${loadaddr} - ${fdtaddr}\0" \
192 "mmcrambootcommon=echo 'Booting kernel from MMC w/ramdisk...'; " \
Peter Baradae5b77e62011-12-19 19:54:51 +0000193 "run ramargs; " \
194 "run common_bootargs; " \
195 "run dump_bootargs; " \
Adam Ford4760c8f2017-01-04 11:51:24 -0600196 "run loadimage; " \
Adam Ford34f28ee2017-01-04 09:26:43 -0600197 "run loadfdt; " \
Adam Ford4760c8f2017-01-04 11:51:24 -0600198 "run loadramdisk\0" \
199 "mmcramboot=setenv bootfile uImage; " \
200 "run mmcrambootcommon; " \
201 "bootm ${loadaddr} ${rdaddr} ${fdtimage}\0" \
202 "mmcrambootz=setenv bootfile zImage; " \
203 "run mmcrambootcommon; " \
204 "bootz ${loadaddr} ${rdaddr} ${fdtimage}\0" \
Adam Ford5326c292016-01-29 20:12:34 -0600205 "tftpboot=echo 'Booting kernel/ramdisk rootfs from tftp...'; " \
Peter Baradae5b77e62011-12-19 19:54:51 +0000206 "run ramargs; " \
207 "run common_bootargs; " \
208 "run dump_bootargs; " \
Adam Ford97073d02016-10-15 08:16:27 -0500209 "tftpboot ${loadaddr} ${zimage}; " \
Adam Ford34f28ee2017-01-04 09:26:43 -0600210 "tftpboot ${rdaddr} ${ramdiskimage}; " \
211 "bootm ${loadaddr} ${rdaddr}\0" \
Adam Ford97073d02016-10-15 08:16:27 -0500212 "tftpbootz=echo 'Booting kernel NFS rootfs...'; " \
213 "dhcp;" \
214 "run nfsargs;" \
215 "run common_bootargs;" \
216 "run dump_bootargs;" \
217 "tftpboot $loadaddr zImage;" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600218 "bootz $loadaddr\0" \
219 "nandbootcommon=echo 'Booting kernel from NAND...';" \
220 "nand unlock;" \
221 "run nandargs;" \
222 "run common_bootargs;" \
223 "run dump_bootargs;" \
224 "nand read ${loadaddr} kernel;" \
225 "nand read ${fdtaddr} spl-os;\0" \
226 "nandbootz=run nandbootcommon; "\
227 "bootz ${loadaddr} - ${fdtaddr}\0"\
228 "nandboot=run nandbootcommon; "\
229 "bootm ${loadaddr} - ${fdtaddr}\0"\
Peter Baradae5b77e62011-12-19 19:54:51 +0000230
231#define CONFIG_BOOTCOMMAND \
232 "run autoboot"
233
Adam Ford5326c292016-01-29 20:12:34 -0600234/* Miscellaneous configurable options */
Adam Ford04c848a2015-09-02 09:18:20 -0500235
Peter Baradae5b77e62011-12-19 19:54:51 +0000236/* memtest works on */
237#define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0)
238#define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + \
239 0x01F00000) /* 31MB */
240
Adam Ford5326c292016-01-29 20:12:34 -0600241/* FLASH and environment organization */
Peter Baradae5b77e62011-12-19 19:54:51 +0000242
243/* **** PISMO SUPPORT *** */
Peter Baradae5b77e62011-12-19 19:54:51 +0000244#if defined(CONFIG_CMD_NAND)
pekon gupta0a9ec452014-07-18 17:59:41 +0530245#define CONFIG_SYS_FLASH_BASE NAND_BASE
Peter Baradae5b77e62011-12-19 19:54:51 +0000246#endif
247
248/* Monitor at start of flash */
249#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
250
Adam Ford5326c292016-01-29 20:12:34 -0600251#define CONFIG_ENV_IS_IN_NAND 1
252#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
Peter Baradae5b77e62011-12-19 19:54:51 +0000253#define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */
254
Peter Baradae5b77e62011-12-19 19:54:51 +0000255#define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
Adam Ford5326c292016-01-29 20:12:34 -0600256#define CONFIG_ENV_OFFSET SMNAND_ENV_OFFSET
257#define CONFIG_ENV_ADDR SMNAND_ENV_OFFSET
Peter Baradae5b77e62011-12-19 19:54:51 +0000258
Adam Ford5326c292016-01-29 20:12:34 -0600259/* SMSC922x Ethernet */
Peter Baradae5b77e62011-12-19 19:54:51 +0000260#if defined(CONFIG_CMD_NET)
Peter Baradae5b77e62011-12-19 19:54:51 +0000261#define CONFIG_SMC911X
Adam Ford5a175cc2016-01-31 17:13:33 -0600262#define CONFIG_SMC911X_32_BIT
Peter Baradae5b77e62011-12-19 19:54:51 +0000263#define CONFIG_SMC911X_BASE 0x08000000
Peter Baradae5b77e62011-12-19 19:54:51 +0000264#endif /* (CONFIG_CMD_NET) */
265
Adam Ford5326c292016-01-29 20:12:34 -0600266/* Defines for SPL */
267
268#define CONFIG_SPL_OMAP3_ID_NAND
269
270/* NAND: SPL falcon mode configs */
271#ifdef CONFIG_SPL_OS_BOOT
272#define CONFIG_CMD_SPL_NAND_OFS 0x240000
273#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
274#define CONFIG_CMD_SPL_WRITE_SIZE 0x2000
275#endif
276
Peter Baradae5b77e62011-12-19 19:54:51 +0000277#endif /* __CONFIG_H */