blob: 4d811e096cc90642b4793fa2d2e42ab2a946e4c9 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Peter Barada86887f82011-12-19 19:54:51 +00002/*
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.
Peter Barada86887f82011-12-19 19:54:51 +00008 */
9
10#ifndef __CONFIG_H
11#define __CONFIG_H
12
Adam Ford49c73032016-01-29 20:12:34 -060013/* High Level Configuration Options */
Peter Barada86887f82011-12-19 19:54:51 +000014
Adam Ford7b77b1f2015-09-02 09:18:20 -050015#define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */
Adam Ford49c73032016-01-29 20:12:34 -060016
Adam Ford7b77b1f2015-09-02 09:18:20 -050017#include <configs/ti_omap3_common.h>
Adam Ford49c73032016-01-29 20:12:34 -060018
Adam Ford15fde732017-04-17 08:09:45 -050019#ifdef CONFIG_SPL_BUILD
Adam Ford15fde732017-04-17 08:09:45 -050020/* select serial console configuration for SPL */
Adam Ford15fde732017-04-17 08:09:45 -050021#define CONFIG_SYS_NS16550_COM1 OMAP34XX_UART1
22#endif
23
24
Tom Rinifa2f81b2016-08-26 13:30:43 -040025/*
26 * We are only ever GP parts and will utilize all of the "downloaded image"
27 * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB) in
28 * order to allow for BCH8 to fit in.
29 */
Adam Fordf92dfc82016-02-08 19:06:08 -060030#undef CONFIG_SPL_TEXT_BASE
Tom Rinifa2f81b2016-08-26 13:30:43 -040031#define CONFIG_SPL_TEXT_BASE 0x40200000
Adam Fordf92dfc82016-02-08 19:06:08 -060032
Peter Barada86887f82011-12-19 19:54:51 +000033#define CONFIG_MISC_INIT_R /* misc_init_r dumps the die id */
Adam Ford49c73032016-01-29 20:12:34 -060034#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
Peter Barada86887f82011-12-19 19:54:51 +000035#define CONFIG_SETUP_MEMORY_TAGS
36#define CONFIG_INITRD_TAG
37#define CONFIG_REVISION_TAG
38
Adam Ford49c73032016-01-29 20:12:34 -060039/* Hardware drivers */
Peter Barada86887f82011-12-19 19:54:51 +000040
Adam Ford49c73032016-01-29 20:12:34 -060041/* I2C */
Adam Ford49c73032016-01-29 20:12:34 -060042#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM AT24C64 */
Peter Barada86887f82011-12-19 19:54:51 +000043
Adam Ford49c73032016-01-29 20:12:34 -060044/* Board NAND Info. */
45#ifdef CONFIG_NAND
Adam Ford49c73032016-01-29 20:12:34 -060046#define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
47 /* to access nand */
48#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of */
49 /* NAND devices */
Adam Ford49c73032016-01-29 20:12:34 -060050#define CONFIG_SYS_NAND_5_ADDR_CYCLE
51#define CONFIG_SYS_NAND_PAGE_COUNT 64
52#define CONFIG_SYS_NAND_PAGE_SIZE 2048
53#define CONFIG_SYS_NAND_OOBSIZE 64
54#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
55#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
56#define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \
57 13, 14, 16, 17, 18, 19, 20, 21, 22, \
58 23, 24, 25, 26, 27, 28, 30, 31, 32, \
59 33, 34, 35, 36, 37, 38, 39, 40, 41, \
60 42, 44, 45, 46, 47, 48, 49, 50, 51, \
61 52, 53, 54, 55, 56}
Adam Ford7b77b1f2015-09-02 09:18:20 -050062
Adam Ford49c73032016-01-29 20:12:34 -060063#define CONFIG_SYS_NAND_ECCSIZE 512
64#define CONFIG_SYS_NAND_ECCBYTES 13
65#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
Adam Ford49c73032016-01-29 20:12:34 -060066#define CONFIG_SYS_NAND_MAX_OOBFREE 2
67#define CONFIG_SYS_NAND_MAX_ECCPOS 56
Adam Ford49c73032016-01-29 20:12:34 -060068#endif
Peter Barada86887f82011-12-19 19:54:51 +000069
70/* Environment information */
Peter Barada86887f82011-12-19 19:54:51 +000071
Peter Barada86887f82011-12-19 19:54:51 +000072#define CONFIG_PREBOOT \
Peter Barada86887f82011-12-19 19:54:51 +000073 "setenv preboot;" \
74 "saveenv;"
75
Peter Barada86887f82011-12-19 19:54:51 +000076#define CONFIG_EXTRA_ENV_SETTINGS \
Adam Fordbb5854c2017-01-04 09:26:43 -060077 DEFAULT_LINUX_BOOT_ENV \
Tom Rini43ede0b2017-10-22 17:55:07 -040078 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
79 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
Peter Barada86887f82011-12-19 19:54:51 +000080 "mmcdev=0\0" \
Adam Ford49c73032016-01-29 20:12:34 -060081 "mmcroot=/dev/mmcblk0p2 rw\0" \
82 "mmcrootfstype=ext4 rootwait\0" \
Adam Forda094c922016-02-10 01:41:10 -060083 "nandroot=ubi0:rootfs rw ubi.mtd=fs noinitrd\0" \
84 "nandrootfstype=ubifs rootwait\0" \
Andrew Bradford66968112012-10-01 05:06:52 +000085 "autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \
Peter Barada86887f82011-12-19 19:54:51 +000086 "if run loadbootscript; then " \
87 "run bootscript; " \
88 "else " \
89 "run defaultboot;" \
90 "fi; " \
91 "else run defaultboot; fi\0" \
92 "defaultboot=run mmcramboot\0" \
Adam Forde7457822018-06-15 08:12:02 -050093 "consoledevice=ttyS0\0" \
Peter Barada86887f82011-12-19 19:54:51 +000094 "setconsole=setenv console ${consoledevice},${baudrate}n8\0" \
95 "dump_bootargs=echo 'Bootargs: '; echo $bootargs\0" \
96 "rotation=0\0" \
97 "vrfb_arg=if itest ${rotation} -ne 0; then " \
98 "setenv bootargs ${bootargs} omapfb.vrfb=y " \
99 "omapfb.rotate=${rotation}; " \
100 "fi\0" \
Adam Ford49c73032016-01-29 20:12:34 -0600101 "optargs=ignore_loglevel early_printk no_console_suspend\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600102 "common_bootargs=run setconsole; setenv bootargs " \
103 "${bootargs} "\
104 "console=${console} " \
105 "${mtdparts} "\
106 "${optargs}; " \
Peter Barada86887f82011-12-19 19:54:51 +0000107 "run vrfb_arg\0" \
Adam Fordbb5854c2017-01-04 09:26:43 -0600108 "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
Peter Barada86887f82011-12-19 19:54:51 +0000109 "bootscript=echo 'Running bootscript from mmc ...'; " \
110 "source ${loadaddr}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600111 "loadimage=mmc rescan; " \
112 "load mmc ${mmcdev} ${loadaddr} ${bootfile}\0" \
Peter Barada86887f82011-12-19 19:54:51 +0000113 "ramdisksize=64000\0" \
Peter Barada86887f82011-12-19 19:54:51 +0000114 "ramdiskimage=rootfs.ext2.gz.uboot\0" \
Adam Ford49c73032016-01-29 20:12:34 -0600115 "loadramdisk=mmc rescan; " \
Adam Fordbb5854c2017-01-04 09:26:43 -0600116 "load mmc ${mmcdev} ${rdaddr} ${ramdiskimage}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600117 "ramargs=setenv bootargs "\
Peter Barada86887f82011-12-19 19:54:51 +0000118 "root=/dev/ram rw ramdisk_size=${ramdisksize}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600119 "mmcargs=setenv bootargs "\
120 "root=${mmcroot} rootfstype=${mmcrootfstype}\0" \
121 "nandargs=setenv bootargs "\
Adam Forda094c922016-02-10 01:41:10 -0600122 "root=${nandroot} " \
123 "rootfstype=${nandrootfstype}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600124 "nfsargs=setenv serverip ${tftpserver}; " \
125 "setenv bootargs root=/dev/nfs " \
Adam Ford760d1af2016-10-15 08:16:27 -0500126 "nfsroot=${nfsrootpath} " \
127 "ip=${ipaddr}:${tftpserver}:${gatewayip}:${netmask}::eth0:off\0" \
128 "nfsrootpath=/opt/nfs-exports/omap\0" \
129 "autoload=no\0" \
Adam Fordbb5854c2017-01-04 09:26:43 -0600130 "loadfdt=mmc rescan; " \
131 "load mmc ${mmcdev} ${fdtaddr} ${fdtimage}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600132 "mmcbootcommon=echo Booting with DT from mmc${mmcdev} ...; " \
Adam Ford49c73032016-01-29 20:12:34 -0600133 "run mmcargs; " \
134 "run common_bootargs; " \
135 "run dump_bootargs; " \
Adam Ford476e16e2017-01-04 11:51:24 -0600136 "run loadimage; " \
137 "run loadfdt;\0 " \
138 "mmcbootz=setenv bootfile zImage; " \
139 "run mmcbootcommon; "\
Adam Ford49c73032016-01-29 20:12:34 -0600140 "bootz ${loadaddr} - ${fdtaddr}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600141 "mmcboot=setenv bootfile uImage; "\
142 "run mmcbootcommon; "\
143 "bootm ${loadaddr} - ${fdtaddr}\0" \
144 "mmcrambootcommon=echo 'Booting kernel from MMC w/ramdisk...'; " \
Peter Barada86887f82011-12-19 19:54:51 +0000145 "run ramargs; " \
146 "run common_bootargs; " \
147 "run dump_bootargs; " \
Adam Ford476e16e2017-01-04 11:51:24 -0600148 "run loadimage; " \
Adam Fordbb5854c2017-01-04 09:26:43 -0600149 "run loadfdt; " \
Adam Ford476e16e2017-01-04 11:51:24 -0600150 "run loadramdisk\0" \
151 "mmcramboot=setenv bootfile uImage; " \
152 "run mmcrambootcommon; " \
Adam Ford62896dc2018-03-26 10:24:12 -0500153 "bootm ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600154 "mmcrambootz=setenv bootfile zImage; " \
155 "run mmcrambootcommon; " \
Adam Ford62896dc2018-03-26 10:24:12 -0500156 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
Adam Ford49c73032016-01-29 20:12:34 -0600157 "tftpboot=echo 'Booting kernel/ramdisk rootfs from tftp...'; " \
158 "run ramargs; " \
159 "run common_bootargs; " \
160 "run dump_bootargs; " \
Adam Ford760d1af2016-10-15 08:16:27 -0500161 "tftpboot ${loadaddr} ${zimage}; " \
Adam Fordbb5854c2017-01-04 09:26:43 -0600162 "tftpboot ${rdaddr} ${ramdiskimage}; " \
163 "bootm ${loadaddr} ${rdaddr}\0" \
Adam Ford760d1af2016-10-15 08:16:27 -0500164 "tftpbootz=echo 'Booting kernel NFS rootfs...'; " \
165 "dhcp;" \
166 "run nfsargs;" \
167 "run common_bootargs;" \
168 "run dump_bootargs;" \
169 "tftpboot $loadaddr zImage;" \
Adam Ford476e16e2017-01-04 11:51:24 -0600170 "bootz $loadaddr\0" \
171 "nandbootcommon=echo 'Booting kernel from NAND...';" \
Adam Ford476e16e2017-01-04 11:51:24 -0600172 "run nandargs;" \
173 "run common_bootargs;" \
174 "run dump_bootargs;" \
175 "nand read ${loadaddr} kernel;" \
176 "nand read ${fdtaddr} spl-os;\0" \
177 "nandbootz=run nandbootcommon; "\
178 "bootz ${loadaddr} - ${fdtaddr}\0"\
179 "nandboot=run nandbootcommon; "\
180 "bootm ${loadaddr} - ${fdtaddr}\0"\
Peter Barada86887f82011-12-19 19:54:51 +0000181
182#define CONFIG_BOOTCOMMAND \
183 "run autoboot"
184
Adam Ford49c73032016-01-29 20:12:34 -0600185/* Miscellaneous configurable options */
Adam Ford7b77b1f2015-09-02 09:18:20 -0500186
Peter Barada86887f82011-12-19 19:54:51 +0000187/* memtest works on */
188#define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0)
189#define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + \
190 0x01F00000) /* 31MB */
191
Adam Ford49c73032016-01-29 20:12:34 -0600192/* FLASH and environment organization */
Peter Barada86887f82011-12-19 19:54:51 +0000193
194/* **** PISMO SUPPORT *** */
Peter Barada86887f82011-12-19 19:54:51 +0000195#if defined(CONFIG_CMD_NAND)
pekon gupta222a3112014-07-18 17:59:41 +0530196#define CONFIG_SYS_FLASH_BASE NAND_BASE
Peter Barada86887f82011-12-19 19:54:51 +0000197#endif
198
199/* Monitor at start of flash */
200#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
201
Adam Ford49c73032016-01-29 20:12:34 -0600202#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
Peter Barada86887f82011-12-19 19:54:51 +0000203
Peter Barada86887f82011-12-19 19:54:51 +0000204#define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
Adam Ford7672d9d2017-09-04 21:08:02 -0500205#define CONFIG_ENV_OFFSET 0x260000
206#define CONFIG_ENV_ADDR 0x260000
Peter Barada86887f82011-12-19 19:54:51 +0000207
Adam Ford49c73032016-01-29 20:12:34 -0600208/* Defines for SPL */
209
Adam Ford49c73032016-01-29 20:12:34 -0600210/* NAND: SPL falcon mode configs */
211#ifdef CONFIG_SPL_OS_BOOT
Adam Ford49c73032016-01-29 20:12:34 -0600212#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
Adam Ford49c73032016-01-29 20:12:34 -0600213#endif
214
Peter Barada86887f82011-12-19 19:54:51 +0000215#endif /* __CONFIG_H */