blob: 6b7104db5fd223c90ffa43c8faa2c27b58ec107c [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#include <configs/ti_omap3_common.h>
Adam Ford49c73032016-01-29 20:12:34 -060016
Tom Rinifa2f81b2016-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 Fordf92dfc82016-02-08 19:06:08 -060022
Adam Ford49c73032016-01-29 20:12:34 -060023#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
Peter Barada86887f82011-12-19 19:54:51 +000024#define CONFIG_SETUP_MEMORY_TAGS
25#define CONFIG_INITRD_TAG
26#define CONFIG_REVISION_TAG
27
Adam Ford49c73032016-01-29 20:12:34 -060028/* Hardware drivers */
Peter Barada86887f82011-12-19 19:54:51 +000029
Adam Ford49c73032016-01-29 20:12:34 -060030/* I2C */
Adam Ford49c73032016-01-29 20:12:34 -060031#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM AT24C64 */
Peter Barada86887f82011-12-19 19:54:51 +000032
Adam Ford49c73032016-01-29 20:12:34 -060033/* Board NAND Info. */
34#ifdef CONFIG_NAND
Adam Ford49c73032016-01-29 20:12:34 -060035#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of */
36 /* NAND devices */
Adam Ford49c73032016-01-29 20:12:34 -060037#define CONFIG_SYS_NAND_5_ADDR_CYCLE
38#define CONFIG_SYS_NAND_PAGE_COUNT 64
39#define CONFIG_SYS_NAND_PAGE_SIZE 2048
40#define CONFIG_SYS_NAND_OOBSIZE 64
41#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
42#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
43#define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \
44 13, 14, 16, 17, 18, 19, 20, 21, 22, \
45 23, 24, 25, 26, 27, 28, 30, 31, 32, \
46 33, 34, 35, 36, 37, 38, 39, 40, 41, \
47 42, 44, 45, 46, 47, 48, 49, 50, 51, \
48 52, 53, 54, 55, 56}
Adam Ford7b77b1f2015-09-02 09:18:20 -050049
Adam Ford49c73032016-01-29 20:12:34 -060050#define CONFIG_SYS_NAND_ECCSIZE 512
51#define CONFIG_SYS_NAND_ECCBYTES 13
52#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
Adam Ford49c73032016-01-29 20:12:34 -060053#define CONFIG_SYS_NAND_MAX_OOBFREE 2
54#define CONFIG_SYS_NAND_MAX_ECCPOS 56
Adam Ford49c73032016-01-29 20:12:34 -060055#endif
Peter Barada86887f82011-12-19 19:54:51 +000056
57/* Environment information */
Peter Barada86887f82011-12-19 19:54:51 +000058
Peter Barada86887f82011-12-19 19:54:51 +000059#define CONFIG_PREBOOT \
Peter Barada86887f82011-12-19 19:54:51 +000060 "setenv preboot;" \
61 "saveenv;"
62
Peter Barada86887f82011-12-19 19:54:51 +000063#define CONFIG_EXTRA_ENV_SETTINGS \
Adam Fordbb5854c2017-01-04 09:26:43 -060064 DEFAULT_LINUX_BOOT_ENV \
Tom Rini43ede0b2017-10-22 17:55:07 -040065 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
66 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
Peter Barada86887f82011-12-19 19:54:51 +000067 "mmcdev=0\0" \
Adam Fordc7d00f62019-04-11 15:24:33 -050068 "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
Adam Ford49c73032016-01-29 20:12:34 -060069 "mmcrootfstype=ext4 rootwait\0" \
Adam Forda094c922016-02-10 01:41:10 -060070 "nandroot=ubi0:rootfs rw ubi.mtd=fs noinitrd\0" \
71 "nandrootfstype=ubifs rootwait\0" \
Andrew Bradford66968112012-10-01 05:06:52 +000072 "autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \
Peter Barada86887f82011-12-19 19:54:51 +000073 "if run loadbootscript; then " \
74 "run bootscript; " \
75 "else " \
76 "run defaultboot;" \
77 "fi; " \
78 "else run defaultboot; fi\0" \
79 "defaultboot=run mmcramboot\0" \
Adam Forde7457822018-06-15 08:12:02 -050080 "consoledevice=ttyS0\0" \
Peter Barada86887f82011-12-19 19:54:51 +000081 "setconsole=setenv console ${consoledevice},${baudrate}n8\0" \
82 "dump_bootargs=echo 'Bootargs: '; echo $bootargs\0" \
83 "rotation=0\0" \
84 "vrfb_arg=if itest ${rotation} -ne 0; then " \
85 "setenv bootargs ${bootargs} omapfb.vrfb=y " \
86 "omapfb.rotate=${rotation}; " \
87 "fi\0" \
Adam Ford49c73032016-01-29 20:12:34 -060088 "optargs=ignore_loglevel early_printk no_console_suspend\0" \
Adam Ford476e16e2017-01-04 11:51:24 -060089 "common_bootargs=run setconsole; setenv bootargs " \
90 "${bootargs} "\
91 "console=${console} " \
92 "${mtdparts} "\
93 "${optargs}; " \
Peter Barada86887f82011-12-19 19:54:51 +000094 "run vrfb_arg\0" \
Adam Fordbb5854c2017-01-04 09:26:43 -060095 "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
Peter Barada86887f82011-12-19 19:54:51 +000096 "bootscript=echo 'Running bootscript from mmc ...'; " \
97 "source ${loadaddr}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -060098 "loadimage=mmc rescan; " \
99 "load mmc ${mmcdev} ${loadaddr} ${bootfile}\0" \
Peter Barada86887f82011-12-19 19:54:51 +0000100 "ramdisksize=64000\0" \
Peter Barada86887f82011-12-19 19:54:51 +0000101 "ramdiskimage=rootfs.ext2.gz.uboot\0" \
Adam Ford49c73032016-01-29 20:12:34 -0600102 "loadramdisk=mmc rescan; " \
Adam Fordbb5854c2017-01-04 09:26:43 -0600103 "load mmc ${mmcdev} ${rdaddr} ${ramdiskimage}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600104 "ramargs=setenv bootargs "\
Peter Barada86887f82011-12-19 19:54:51 +0000105 "root=/dev/ram rw ramdisk_size=${ramdisksize}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600106 "mmcargs=setenv bootargs "\
Adam Fordc7d00f62019-04-11 15:24:33 -0500107 "root=PARTUUID=${uuid} " \
108 "rootfstype=${mmcrootfstype} rw\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600109 "nandargs=setenv bootargs "\
Adam Forda094c922016-02-10 01:41:10 -0600110 "root=${nandroot} " \
111 "rootfstype=${nandrootfstype}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600112 "nfsargs=setenv serverip ${tftpserver}; " \
113 "setenv bootargs root=/dev/nfs " \
Adam Ford760d1af2016-10-15 08:16:27 -0500114 "nfsroot=${nfsrootpath} " \
115 "ip=${ipaddr}:${tftpserver}:${gatewayip}:${netmask}::eth0:off\0" \
116 "nfsrootpath=/opt/nfs-exports/omap\0" \
117 "autoload=no\0" \
Adam Ford46580f22018-09-29 14:10:19 -0500118 "fdtimage=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
Adam Fordbb5854c2017-01-04 09:26:43 -0600119 "loadfdt=mmc rescan; " \
120 "load mmc ${mmcdev} ${fdtaddr} ${fdtimage}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600121 "mmcbootcommon=echo Booting with DT from mmc${mmcdev} ...; " \
Adam Fordc7d00f62019-04-11 15:24:33 -0500122 "run finduuid; "\
Adam Ford49c73032016-01-29 20:12:34 -0600123 "run mmcargs; " \
124 "run common_bootargs; " \
125 "run dump_bootargs; " \
Adam Ford476e16e2017-01-04 11:51:24 -0600126 "run loadimage; " \
127 "run loadfdt;\0 " \
128 "mmcbootz=setenv bootfile zImage; " \
129 "run mmcbootcommon; "\
Adam Ford49c73032016-01-29 20:12:34 -0600130 "bootz ${loadaddr} - ${fdtaddr}\0" \
Adam Ford476e16e2017-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 Barada86887f82011-12-19 19:54:51 +0000135 "run ramargs; " \
136 "run common_bootargs; " \
137 "run dump_bootargs; " \
Adam Ford476e16e2017-01-04 11:51:24 -0600138 "run loadimage; " \
Adam Fordbb5854c2017-01-04 09:26:43 -0600139 "run loadfdt; " \
Adam Ford476e16e2017-01-04 11:51:24 -0600140 "run loadramdisk\0" \
141 "mmcramboot=setenv bootfile uImage; " \
142 "run mmcrambootcommon; " \
Adam Ford62896dc2018-03-26 10:24:12 -0500143 "bootm ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600144 "mmcrambootz=setenv bootfile zImage; " \
145 "run mmcrambootcommon; " \
Adam Ford62896dc2018-03-26 10:24:12 -0500146 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
Adam Ford49c73032016-01-29 20:12:34 -0600147 "tftpboot=echo 'Booting kernel/ramdisk rootfs from tftp...'; " \
148 "run ramargs; " \
149 "run common_bootargs; " \
150 "run dump_bootargs; " \
Adam Ford760d1af2016-10-15 08:16:27 -0500151 "tftpboot ${loadaddr} ${zimage}; " \
Adam Fordbb5854c2017-01-04 09:26:43 -0600152 "tftpboot ${rdaddr} ${ramdiskimage}; " \
153 "bootm ${loadaddr} ${rdaddr}\0" \
Adam Ford760d1af2016-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 Ford476e16e2017-01-04 11:51:24 -0600160 "bootz $loadaddr\0" \
161 "nandbootcommon=echo 'Booting kernel from NAND...';" \
Adam Ford476e16e2017-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 Barada86887f82011-12-19 19:54:51 +0000171
172#define CONFIG_BOOTCOMMAND \
173 "run autoboot"
174
Adam Ford49c73032016-01-29 20:12:34 -0600175/* Miscellaneous configurable options */
Adam Ford7b77b1f2015-09-02 09:18:20 -0500176
Peter Barada86887f82011-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 Ford49c73032016-01-29 20:12:34 -0600182/* FLASH and environment organization */
Peter Barada86887f82011-12-19 19:54:51 +0000183
184/* **** PISMO SUPPORT *** */
Peter Barada86887f82011-12-19 19:54:51 +0000185#if defined(CONFIG_CMD_NAND)
Adam Ford290097f2018-10-14 15:53:17 -0500186#define CONFIG_SYS_FLASH_BASE 0x10000000
Peter Barada86887f82011-12-19 19:54:51 +0000187#endif
188
Adam Ford290097f2018-10-14 15:53:17 -0500189#define CONFIG_SYS_MAX_FLASH_SECT 256
190#define CONFIG_SYS_MAX_FLASH_BANKS 1
191#define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT
192#define CONFIG_SYS_FLASH_SIZE 0x4000000
193
Peter Barada86887f82011-12-19 19:54:51 +0000194/* Monitor at start of flash */
195#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
196
Peter Barada86887f82011-12-19 19:54:51 +0000197#define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
Adam Ford7672d9d2017-09-04 21:08:02 -0500198#define CONFIG_ENV_ADDR 0x260000
Peter Barada86887f82011-12-19 19:54:51 +0000199
Adam Ford49c73032016-01-29 20:12:34 -0600200/* Defines for SPL */
201
Adam Ford49c73032016-01-29 20:12:34 -0600202/* NAND: SPL falcon mode configs */
203#ifdef CONFIG_SPL_OS_BOOT
Adam Ford49c73032016-01-29 20:12:34 -0600204#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
Adam Ford49c73032016-01-29 20:12:34 -0600205#endif
206
Peter Barada86887f82011-12-19 19:54:51 +0000207#endif /* __CONFIG_H */