blob: 8644e168302414bd64483be7a486fcd59af60cec [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Peter Baradae5b77e62011-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 Baradae5b77e62011-12-19 19:54:51 +00008 */
9
10#ifndef __CONFIG_H
11#define __CONFIG_H
12
Adam Ford5326c292016-01-29 20:12:34 -060013/* High Level Configuration Options */
Peter Baradae5b77e62011-12-19 19:54:51 +000014
Adam Ford5326c292016-01-29 20:12:34 -060015#include <configs/ti_omap3_common.h>
16
Tom Rinicfff4aa2016-08-26 13:30:43 -040017/*
18 * We are only ever GP parts and will utilize all of the "downloaded image"
19 * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB) in
20 * order to allow for BCH8 to fit in.
21 */
Adam Fordd92313a2016-02-08 19:06:08 -060022#undef CONFIG_SPL_TEXT_BASE
Tom Rinicfff4aa2016-08-26 13:30:43 -040023#define CONFIG_SPL_TEXT_BASE 0x40200000
Adam Fordd92313a2016-02-08 19:06:08 -060024
Adam Ford5326c292016-01-29 20:12:34 -060025#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
Peter Baradae5b77e62011-12-19 19:54:51 +000026#define CONFIG_SETUP_MEMORY_TAGS
27#define CONFIG_INITRD_TAG
28#define CONFIG_REVISION_TAG
29
Adam Ford5326c292016-01-29 20:12:34 -060030/* Hardware drivers */
Peter Baradae5b77e62011-12-19 19:54:51 +000031
Adam Ford5326c292016-01-29 20:12:34 -060032/* I2C */
Adam Ford5326c292016-01-29 20:12:34 -060033#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM AT24C64 */
Peter Baradae5b77e62011-12-19 19:54:51 +000034
Adam Ford5326c292016-01-29 20:12:34 -060035/* Board NAND Info. */
36#ifdef CONFIG_NAND
Adam Ford5326c292016-01-29 20:12:34 -060037#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of */
38 /* NAND devices */
Adam Ford5326c292016-01-29 20:12:34 -060039#define CONFIG_SYS_NAND_5_ADDR_CYCLE
40#define CONFIG_SYS_NAND_PAGE_COUNT 64
41#define CONFIG_SYS_NAND_PAGE_SIZE 2048
42#define CONFIG_SYS_NAND_OOBSIZE 64
43#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
44#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
45#define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \
46 13, 14, 16, 17, 18, 19, 20, 21, 22, \
47 23, 24, 25, 26, 27, 28, 30, 31, 32, \
48 33, 34, 35, 36, 37, 38, 39, 40, 41, \
49 42, 44, 45, 46, 47, 48, 49, 50, 51, \
50 52, 53, 54, 55, 56}
Adam Ford04c848a2015-09-02 09:18:20 -050051
Adam Ford5326c292016-01-29 20:12:34 -060052#define CONFIG_SYS_NAND_ECCSIZE 512
53#define CONFIG_SYS_NAND_ECCBYTES 13
54#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
Adam Ford5326c292016-01-29 20:12:34 -060055#define CONFIG_SYS_NAND_MAX_OOBFREE 2
56#define CONFIG_SYS_NAND_MAX_ECCPOS 56
Adam Ford5326c292016-01-29 20:12:34 -060057#endif
Peter Baradae5b77e62011-12-19 19:54:51 +000058
59/* Environment information */
Peter Baradae5b77e62011-12-19 19:54:51 +000060
Peter Baradae5b77e62011-12-19 19:54:51 +000061#define CONFIG_PREBOOT \
Peter Baradae5b77e62011-12-19 19:54:51 +000062 "setenv preboot;" \
63 "saveenv;"
64
Peter Baradae5b77e62011-12-19 19:54:51 +000065#define CONFIG_EXTRA_ENV_SETTINGS \
Adam Ford34f28ee2017-01-04 09:26:43 -060066 DEFAULT_LINUX_BOOT_ENV \
Tom Rini5ad8e112017-10-22 17:55:07 -040067 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
68 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
Peter Baradae5b77e62011-12-19 19:54:51 +000069 "mmcdev=0\0" \
Adam Ford5326c292016-01-29 20:12:34 -060070 "mmcroot=/dev/mmcblk0p2 rw\0" \
71 "mmcrootfstype=ext4 rootwait\0" \
Adam Ford193e9a12016-02-10 01:41:10 -060072 "nandroot=ubi0:rootfs rw ubi.mtd=fs noinitrd\0" \
73 "nandrootfstype=ubifs rootwait\0" \
Andrew Bradforde1c7c8a2012-10-01 05:06:52 +000074 "autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \
Peter Baradae5b77e62011-12-19 19:54:51 +000075 "if run loadbootscript; then " \
76 "run bootscript; " \
77 "else " \
78 "run defaultboot;" \
79 "fi; " \
80 "else run defaultboot; fi\0" \
81 "defaultboot=run mmcramboot\0" \
Adam Fordb36bb902018-06-15 08:12:02 -050082 "consoledevice=ttyS0\0" \
Peter Baradae5b77e62011-12-19 19:54:51 +000083 "setconsole=setenv console ${consoledevice},${baudrate}n8\0" \
84 "dump_bootargs=echo 'Bootargs: '; echo $bootargs\0" \
85 "rotation=0\0" \
86 "vrfb_arg=if itest ${rotation} -ne 0; then " \
87 "setenv bootargs ${bootargs} omapfb.vrfb=y " \
88 "omapfb.rotate=${rotation}; " \
89 "fi\0" \
Adam Ford5326c292016-01-29 20:12:34 -060090 "optargs=ignore_loglevel early_printk no_console_suspend\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -060091 "common_bootargs=run setconsole; setenv bootargs " \
92 "${bootargs} "\
93 "console=${console} " \
94 "${mtdparts} "\
95 "${optargs}; " \
Peter Baradae5b77e62011-12-19 19:54:51 +000096 "run vrfb_arg\0" \
Adam Ford34f28ee2017-01-04 09:26:43 -060097 "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
Peter Baradae5b77e62011-12-19 19:54:51 +000098 "bootscript=echo 'Running bootscript from mmc ...'; " \
99 "source ${loadaddr}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600100 "loadimage=mmc rescan; " \
101 "load mmc ${mmcdev} ${loadaddr} ${bootfile}\0" \
Peter Baradae5b77e62011-12-19 19:54:51 +0000102 "ramdisksize=64000\0" \
Peter Baradae5b77e62011-12-19 19:54:51 +0000103 "ramdiskimage=rootfs.ext2.gz.uboot\0" \
Adam Ford5326c292016-01-29 20:12:34 -0600104 "loadramdisk=mmc rescan; " \
Adam Ford34f28ee2017-01-04 09:26:43 -0600105 "load mmc ${mmcdev} ${rdaddr} ${ramdiskimage}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600106 "ramargs=setenv bootargs "\
Peter Baradae5b77e62011-12-19 19:54:51 +0000107 "root=/dev/ram rw ramdisk_size=${ramdisksize}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600108 "mmcargs=setenv bootargs "\
109 "root=${mmcroot} rootfstype=${mmcrootfstype}\0" \
110 "nandargs=setenv bootargs "\
Adam Ford193e9a12016-02-10 01:41:10 -0600111 "root=${nandroot} " \
112 "rootfstype=${nandrootfstype}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600113 "nfsargs=setenv serverip ${tftpserver}; " \
114 "setenv bootargs root=/dev/nfs " \
Adam Ford97073d02016-10-15 08:16:27 -0500115 "nfsroot=${nfsrootpath} " \
116 "ip=${ipaddr}:${tftpserver}:${gatewayip}:${netmask}::eth0:off\0" \
117 "nfsrootpath=/opt/nfs-exports/omap\0" \
118 "autoload=no\0" \
Adam Ford81b19d72018-09-29 14:10:19 -0500119 "fdtimage=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
Adam Ford34f28ee2017-01-04 09:26:43 -0600120 "loadfdt=mmc rescan; " \
121 "load mmc ${mmcdev} ${fdtaddr} ${fdtimage}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600122 "mmcbootcommon=echo Booting with DT from mmc${mmcdev} ...; " \
Adam Ford5326c292016-01-29 20:12:34 -0600123 "run mmcargs; " \
124 "run common_bootargs; " \
125 "run dump_bootargs; " \
Adam Ford4760c8f2017-01-04 11:51:24 -0600126 "run loadimage; " \
127 "run loadfdt;\0 " \
128 "mmcbootz=setenv bootfile zImage; " \
129 "run mmcbootcommon; "\
Adam Ford5326c292016-01-29 20:12:34 -0600130 "bootz ${loadaddr} - ${fdtaddr}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600131 "mmcboot=setenv bootfile uImage; "\
132 "run mmcbootcommon; "\
133 "bootm ${loadaddr} - ${fdtaddr}\0" \
134 "mmcrambootcommon=echo 'Booting kernel from MMC w/ramdisk...'; " \
Peter Baradae5b77e62011-12-19 19:54:51 +0000135 "run ramargs; " \
136 "run common_bootargs; " \
137 "run dump_bootargs; " \
Adam Ford4760c8f2017-01-04 11:51:24 -0600138 "run loadimage; " \
Adam Ford34f28ee2017-01-04 09:26:43 -0600139 "run loadfdt; " \
Adam Ford4760c8f2017-01-04 11:51:24 -0600140 "run loadramdisk\0" \
141 "mmcramboot=setenv bootfile uImage; " \
142 "run mmcrambootcommon; " \
Adam Ford8717e922018-03-26 10:24:12 -0500143 "bootm ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600144 "mmcrambootz=setenv bootfile zImage; " \
145 "run mmcrambootcommon; " \
Adam Ford8717e922018-03-26 10:24:12 -0500146 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
Adam Ford5326c292016-01-29 20:12:34 -0600147 "tftpboot=echo 'Booting kernel/ramdisk rootfs from tftp...'; " \
Peter Baradae5b77e62011-12-19 19:54:51 +0000148 "run ramargs; " \
149 "run common_bootargs; " \
150 "run dump_bootargs; " \
Adam Ford97073d02016-10-15 08:16:27 -0500151 "tftpboot ${loadaddr} ${zimage}; " \
Adam Ford34f28ee2017-01-04 09:26:43 -0600152 "tftpboot ${rdaddr} ${ramdiskimage}; " \
153 "bootm ${loadaddr} ${rdaddr}\0" \
Adam Ford97073d02016-10-15 08:16:27 -0500154 "tftpbootz=echo 'Booting kernel NFS rootfs...'; " \
155 "dhcp;" \
156 "run nfsargs;" \
157 "run common_bootargs;" \
158 "run dump_bootargs;" \
159 "tftpboot $loadaddr zImage;" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600160 "bootz $loadaddr\0" \
161 "nandbootcommon=echo 'Booting kernel from NAND...';" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600162 "run nandargs;" \
163 "run common_bootargs;" \
164 "run dump_bootargs;" \
165 "nand read ${loadaddr} kernel;" \
166 "nand read ${fdtaddr} spl-os;\0" \
167 "nandbootz=run nandbootcommon; "\
168 "bootz ${loadaddr} - ${fdtaddr}\0"\
169 "nandboot=run nandbootcommon; "\
170 "bootm ${loadaddr} - ${fdtaddr}\0"\
Peter Baradae5b77e62011-12-19 19:54:51 +0000171
172#define CONFIG_BOOTCOMMAND \
173 "run autoboot"
174
Adam Ford5326c292016-01-29 20:12:34 -0600175/* Miscellaneous configurable options */
Adam Ford04c848a2015-09-02 09:18:20 -0500176
Peter Baradae5b77e62011-12-19 19:54:51 +0000177/* memtest works on */
178#define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0)
179#define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + \
180 0x01F00000) /* 31MB */
181
Adam Ford5326c292016-01-29 20:12:34 -0600182/* FLASH and environment organization */
Peter Baradae5b77e62011-12-19 19:54:51 +0000183
184/* **** PISMO SUPPORT *** */
Peter Baradae5b77e62011-12-19 19:54:51 +0000185#if defined(CONFIG_CMD_NAND)
pekon gupta0a9ec452014-07-18 17:59:41 +0530186#define CONFIG_SYS_FLASH_BASE NAND_BASE
Peter Baradae5b77e62011-12-19 19:54:51 +0000187#endif
188
189/* Monitor at start of flash */
190#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
191
Adam Ford5326c292016-01-29 20:12:34 -0600192#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
Peter Baradae5b77e62011-12-19 19:54:51 +0000193
Peter Baradae5b77e62011-12-19 19:54:51 +0000194#define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
Adam Ford6b1c1652017-09-04 21:08:02 -0500195#define CONFIG_ENV_OFFSET 0x260000
196#define CONFIG_ENV_ADDR 0x260000
Peter Baradae5b77e62011-12-19 19:54:51 +0000197
Adam Ford5326c292016-01-29 20:12:34 -0600198/* Defines for SPL */
199
Adam Ford5326c292016-01-29 20:12:34 -0600200/* NAND: SPL falcon mode configs */
201#ifdef CONFIG_SPL_OS_BOOT
Adam Ford5326c292016-01-29 20:12:34 -0600202#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
Adam Ford5326c292016-01-29 20:12:34 -0600203#endif
204
Peter Baradae5b77e62011-12-19 19:54:51 +0000205#endif /* __CONFIG_H */