blob: 7ffc4f767128e98fa55a0987f42ddbd3f6ccc10f [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
Adam Ford15fde732017-04-17 08:09:45 -050021/* select serial console configuration for SPL */
22#undef CONFIG_CONS_INDEX
23#define CONFIG_CONS_INDEX 1
24#define CONFIG_SYS_NS16550_COM1 OMAP34XX_UART1
25#endif
26
27
Tom Rinifa2f81b2016-08-26 13:30:43 -040028/*
29 * We are only ever GP parts and will utilize all of the "downloaded image"
30 * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB) in
31 * order to allow for BCH8 to fit in.
32 */
Adam Fordf92dfc82016-02-08 19:06:08 -060033#undef CONFIG_SPL_TEXT_BASE
Tom Rinifa2f81b2016-08-26 13:30:43 -040034#define CONFIG_SPL_TEXT_BASE 0x40200000
Adam Fordf92dfc82016-02-08 19:06:08 -060035
Peter Barada86887f82011-12-19 19:54:51 +000036#define CONFIG_MISC_INIT_R /* misc_init_r dumps the die id */
Adam Ford49c73032016-01-29 20:12:34 -060037#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
Peter Barada86887f82011-12-19 19:54:51 +000038#define CONFIG_SETUP_MEMORY_TAGS
39#define CONFIG_INITRD_TAG
40#define CONFIG_REVISION_TAG
41
Adam Ford49c73032016-01-29 20:12:34 -060042/* Hardware drivers */
Peter Barada86887f82011-12-19 19:54:51 +000043
Adam Ford49c73032016-01-29 20:12:34 -060044/* I2C */
Adam Ford49c73032016-01-29 20:12:34 -060045#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM AT24C64 */
Peter Barada86887f82011-12-19 19:54:51 +000046
Adam Ford49c73032016-01-29 20:12:34 -060047/* Board NAND Info. */
48#ifdef CONFIG_NAND
Adam Ford49c73032016-01-29 20:12:34 -060049#define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
50 /* to access nand */
51#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of */
52 /* NAND devices */
Adam Ford49c73032016-01-29 20:12:34 -060053#define CONFIG_SYS_NAND_5_ADDR_CYCLE
54#define CONFIG_SYS_NAND_PAGE_COUNT 64
55#define CONFIG_SYS_NAND_PAGE_SIZE 2048
56#define CONFIG_SYS_NAND_OOBSIZE 64
57#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
58#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
59#define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \
60 13, 14, 16, 17, 18, 19, 20, 21, 22, \
61 23, 24, 25, 26, 27, 28, 30, 31, 32, \
62 33, 34, 35, 36, 37, 38, 39, 40, 41, \
63 42, 44, 45, 46, 47, 48, 49, 50, 51, \
64 52, 53, 54, 55, 56}
Adam Ford7b77b1f2015-09-02 09:18:20 -050065
Adam Ford49c73032016-01-29 20:12:34 -060066#define CONFIG_SYS_NAND_ECCSIZE 512
67#define CONFIG_SYS_NAND_ECCBYTES 13
68#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
Adam Ford49c73032016-01-29 20:12:34 -060069#define CONFIG_SYS_NAND_MAX_OOBFREE 2
70#define CONFIG_SYS_NAND_MAX_ECCPOS 56
Adam Ford49c73032016-01-29 20:12:34 -060071#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
72#define CONFIG_MTD_PARTITIONS /* required for UBI partition support */
Adam Ford49c73032016-01-29 20:12:34 -060073#endif
Peter Barada86887f82011-12-19 19:54:51 +000074
75/* Environment information */
Peter Barada86887f82011-12-19 19:54:51 +000076
Peter Barada86887f82011-12-19 19:54:51 +000077#define CONFIG_PREBOOT \
Peter Barada86887f82011-12-19 19:54:51 +000078 "setenv preboot;" \
79 "saveenv;"
80
Peter Barada86887f82011-12-19 19:54:51 +000081#define CONFIG_EXTRA_ENV_SETTINGS \
Adam Fordbb5854c2017-01-04 09:26:43 -060082 DEFAULT_LINUX_BOOT_ENV \
Tom Rini43ede0b2017-10-22 17:55:07 -040083 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
84 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
Peter Barada86887f82011-12-19 19:54:51 +000085 "mmcdev=0\0" \
Adam Ford49c73032016-01-29 20:12:34 -060086 "mmcroot=/dev/mmcblk0p2 rw\0" \
87 "mmcrootfstype=ext4 rootwait\0" \
Adam Forda094c922016-02-10 01:41:10 -060088 "nandroot=ubi0:rootfs rw ubi.mtd=fs noinitrd\0" \
89 "nandrootfstype=ubifs rootwait\0" \
Andrew Bradford66968112012-10-01 05:06:52 +000090 "autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \
Peter Barada86887f82011-12-19 19:54:51 +000091 "if run loadbootscript; then " \
92 "run bootscript; " \
93 "else " \
94 "run defaultboot;" \
95 "fi; " \
96 "else run defaultboot; fi\0" \
97 "defaultboot=run mmcramboot\0" \
98 "consoledevice=ttyO0\0" \
Peter Barada86887f82011-12-19 19:54:51 +000099 "setconsole=setenv console ${consoledevice},${baudrate}n8\0" \
100 "dump_bootargs=echo 'Bootargs: '; echo $bootargs\0" \
101 "rotation=0\0" \
102 "vrfb_arg=if itest ${rotation} -ne 0; then " \
103 "setenv bootargs ${bootargs} omapfb.vrfb=y " \
104 "omapfb.rotate=${rotation}; " \
105 "fi\0" \
Adam Ford49c73032016-01-29 20:12:34 -0600106 "optargs=ignore_loglevel early_printk no_console_suspend\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600107 "common_bootargs=run setconsole; setenv bootargs " \
108 "${bootargs} "\
109 "console=${console} " \
110 "${mtdparts} "\
111 "${optargs}; " \
Peter Barada86887f82011-12-19 19:54:51 +0000112 "run vrfb_arg\0" \
Adam Fordbb5854c2017-01-04 09:26:43 -0600113 "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
Peter Barada86887f82011-12-19 19:54:51 +0000114 "bootscript=echo 'Running bootscript from mmc ...'; " \
115 "source ${loadaddr}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600116 "loadimage=mmc rescan; " \
117 "load mmc ${mmcdev} ${loadaddr} ${bootfile}\0" \
Peter Barada86887f82011-12-19 19:54:51 +0000118 "ramdisksize=64000\0" \
Peter Barada86887f82011-12-19 19:54:51 +0000119 "ramdiskimage=rootfs.ext2.gz.uboot\0" \
Adam Ford49c73032016-01-29 20:12:34 -0600120 "loadramdisk=mmc rescan; " \
Adam Fordbb5854c2017-01-04 09:26:43 -0600121 "load mmc ${mmcdev} ${rdaddr} ${ramdiskimage}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600122 "ramargs=setenv bootargs "\
Peter Barada86887f82011-12-19 19:54:51 +0000123 "root=/dev/ram rw ramdisk_size=${ramdisksize}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600124 "mmcargs=setenv bootargs "\
125 "root=${mmcroot} rootfstype=${mmcrootfstype}\0" \
126 "nandargs=setenv bootargs "\
Adam Forda094c922016-02-10 01:41:10 -0600127 "root=${nandroot} " \
128 "rootfstype=${nandrootfstype}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600129 "nfsargs=setenv serverip ${tftpserver}; " \
130 "setenv bootargs root=/dev/nfs " \
Adam Ford760d1af2016-10-15 08:16:27 -0500131 "nfsroot=${nfsrootpath} " \
132 "ip=${ipaddr}:${tftpserver}:${gatewayip}:${netmask}::eth0:off\0" \
133 "nfsrootpath=/opt/nfs-exports/omap\0" \
134 "autoload=no\0" \
Adam Fordbb5854c2017-01-04 09:26:43 -0600135 "loadfdt=mmc rescan; " \
136 "load mmc ${mmcdev} ${fdtaddr} ${fdtimage}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600137 "mmcbootcommon=echo Booting with DT from mmc${mmcdev} ...; " \
Adam Ford49c73032016-01-29 20:12:34 -0600138 "run mmcargs; " \
139 "run common_bootargs; " \
140 "run dump_bootargs; " \
Adam Ford476e16e2017-01-04 11:51:24 -0600141 "run loadimage; " \
142 "run loadfdt;\0 " \
143 "mmcbootz=setenv bootfile zImage; " \
144 "run mmcbootcommon; "\
Adam Ford49c73032016-01-29 20:12:34 -0600145 "bootz ${loadaddr} - ${fdtaddr}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600146 "mmcboot=setenv bootfile uImage; "\
147 "run mmcbootcommon; "\
148 "bootm ${loadaddr} - ${fdtaddr}\0" \
149 "mmcrambootcommon=echo 'Booting kernel from MMC w/ramdisk...'; " \
Peter Barada86887f82011-12-19 19:54:51 +0000150 "run ramargs; " \
151 "run common_bootargs; " \
152 "run dump_bootargs; " \
Adam Ford476e16e2017-01-04 11:51:24 -0600153 "run loadimage; " \
Adam Fordbb5854c2017-01-04 09:26:43 -0600154 "run loadfdt; " \
Adam Ford476e16e2017-01-04 11:51:24 -0600155 "run loadramdisk\0" \
156 "mmcramboot=setenv bootfile uImage; " \
157 "run mmcrambootcommon; " \
158 "bootm ${loadaddr} ${rdaddr} ${fdtimage}\0" \
159 "mmcrambootz=setenv bootfile zImage; " \
160 "run mmcrambootcommon; " \
161 "bootz ${loadaddr} ${rdaddr} ${fdtimage}\0" \
Adam Ford49c73032016-01-29 20:12:34 -0600162 "tftpboot=echo 'Booting kernel/ramdisk rootfs from tftp...'; " \
163 "run ramargs; " \
164 "run common_bootargs; " \
165 "run dump_bootargs; " \
Adam Ford760d1af2016-10-15 08:16:27 -0500166 "tftpboot ${loadaddr} ${zimage}; " \
Adam Fordbb5854c2017-01-04 09:26:43 -0600167 "tftpboot ${rdaddr} ${ramdiskimage}; " \
168 "bootm ${loadaddr} ${rdaddr}\0" \
Adam Ford760d1af2016-10-15 08:16:27 -0500169 "tftpbootz=echo 'Booting kernel NFS rootfs...'; " \
170 "dhcp;" \
171 "run nfsargs;" \
172 "run common_bootargs;" \
173 "run dump_bootargs;" \
174 "tftpboot $loadaddr zImage;" \
Adam Ford476e16e2017-01-04 11:51:24 -0600175 "bootz $loadaddr\0" \
176 "nandbootcommon=echo 'Booting kernel from NAND...';" \
Adam Ford476e16e2017-01-04 11:51:24 -0600177 "run nandargs;" \
178 "run common_bootargs;" \
179 "run dump_bootargs;" \
180 "nand read ${loadaddr} kernel;" \
181 "nand read ${fdtaddr} spl-os;\0" \
182 "nandbootz=run nandbootcommon; "\
183 "bootz ${loadaddr} - ${fdtaddr}\0"\
184 "nandboot=run nandbootcommon; "\
185 "bootm ${loadaddr} - ${fdtaddr}\0"\
Peter Barada86887f82011-12-19 19:54:51 +0000186
187#define CONFIG_BOOTCOMMAND \
188 "run autoboot"
189
Adam Ford49c73032016-01-29 20:12:34 -0600190/* Miscellaneous configurable options */
Adam Ford7b77b1f2015-09-02 09:18:20 -0500191
Peter Barada86887f82011-12-19 19:54:51 +0000192/* memtest works on */
193#define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0)
194#define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + \
195 0x01F00000) /* 31MB */
196
Adam Ford49c73032016-01-29 20:12:34 -0600197/* FLASH and environment organization */
Peter Barada86887f82011-12-19 19:54:51 +0000198
199/* **** PISMO SUPPORT *** */
Peter Barada86887f82011-12-19 19:54:51 +0000200#if defined(CONFIG_CMD_NAND)
pekon gupta222a3112014-07-18 17:59:41 +0530201#define CONFIG_SYS_FLASH_BASE NAND_BASE
Peter Barada86887f82011-12-19 19:54:51 +0000202#endif
203
204/* Monitor at start of flash */
205#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
206
Adam Ford49c73032016-01-29 20:12:34 -0600207#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
Peter Barada86887f82011-12-19 19:54:51 +0000208
Peter Barada86887f82011-12-19 19:54:51 +0000209#define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
Adam Ford7672d9d2017-09-04 21:08:02 -0500210#define CONFIG_ENV_OFFSET 0x260000
211#define CONFIG_ENV_ADDR 0x260000
Peter Barada86887f82011-12-19 19:54:51 +0000212
Adam Ford49c73032016-01-29 20:12:34 -0600213/* Defines for SPL */
214
Adam Ford49c73032016-01-29 20:12:34 -0600215/* NAND: SPL falcon mode configs */
216#ifdef CONFIG_SPL_OS_BOOT
Adam Ford49c73032016-01-29 20:12:34 -0600217#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
Adam Ford49c73032016-01-29 20:12:34 -0600218#endif
219
Peter Barada86887f82011-12-19 19:54:51 +0000220#endif /* __CONFIG_H */