blob: ca5229cd2fe3fe5e1217888e4555fa378bdd9eb9 [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 */
Peter Barada86887f82011-12-19 19:54:51 +000031
Adam Ford97605d32019-08-22 15:32:42 -050032#ifdef CONFIG_SPL_BUILD
33#undef CONFIG_USB_EHCI_OMAP
34#endif
Adam Ford25e4ff42019-06-30 17:30:49 -050035#ifdef CONFIG_USB_EHCI_OMAP
36#define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 4
37#endif
38
Adam Ford49c73032016-01-29 20:12:34 -060039/* Board NAND Info. */
Miquel Raynal88718be2019-10-03 19:50:03 +020040#ifdef CONFIG_MTD_RAW_NAND
Adam Ford49c73032016-01-29 20:12:34 -060041#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of */
42 /* NAND devices */
Adam Ford49c73032016-01-29 20:12:34 -060043#define CONFIG_SYS_NAND_5_ADDR_CYCLE
44#define CONFIG_SYS_NAND_PAGE_COUNT 64
45#define CONFIG_SYS_NAND_PAGE_SIZE 2048
46#define CONFIG_SYS_NAND_OOBSIZE 64
47#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
48#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
49#define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \
50 13, 14, 16, 17, 18, 19, 20, 21, 22, \
51 23, 24, 25, 26, 27, 28, 30, 31, 32, \
52 33, 34, 35, 36, 37, 38, 39, 40, 41, \
53 42, 44, 45, 46, 47, 48, 49, 50, 51, \
54 52, 53, 54, 55, 56}
Adam Ford7b77b1f2015-09-02 09:18:20 -050055
Adam Ford49c73032016-01-29 20:12:34 -060056#define CONFIG_SYS_NAND_ECCSIZE 512
57#define CONFIG_SYS_NAND_ECCBYTES 13
58#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
Adam Ford49c73032016-01-29 20:12:34 -060059#define CONFIG_SYS_NAND_MAX_OOBFREE 2
60#define CONFIG_SYS_NAND_MAX_ECCPOS 56
Adam Ford49c73032016-01-29 20:12:34 -060061#endif
Peter Barada86887f82011-12-19 19:54:51 +000062
63/* Environment information */
Peter Barada86887f82011-12-19 19:54:51 +000064
Peter Barada86887f82011-12-19 19:54:51 +000065#define CONFIG_EXTRA_ENV_SETTINGS \
Adam Fordbb5854c2017-01-04 09:26:43 -060066 DEFAULT_LINUX_BOOT_ENV \
Tom Rini43ede0b2017-10-22 17:55:07 -040067 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
68 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
Peter Barada86887f82011-12-19 19:54:51 +000069 "mmcdev=0\0" \
Adam Fordc7d00f62019-04-11 15:24:33 -050070 "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
Adam Ford49c73032016-01-29 20:12:34 -060071 "mmcrootfstype=ext4 rootwait\0" \
Adam Forda094c922016-02-10 01:41:10 -060072 "nandroot=ubi0:rootfs rw ubi.mtd=fs noinitrd\0" \
73 "nandrootfstype=ubifs rootwait\0" \
Andrew Bradford66968112012-10-01 05:06:52 +000074 "autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \
Peter Barada86887f82011-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 Forde7457822018-06-15 08:12:02 -050082 "consoledevice=ttyS0\0" \
Peter Barada86887f82011-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 Ford49c73032016-01-29 20:12:34 -060090 "optargs=ignore_loglevel early_printk no_console_suspend\0" \
Adam Ford476e16e2017-01-04 11:51:24 -060091 "common_bootargs=run setconsole; setenv bootargs " \
92 "${bootargs} "\
93 "console=${console} " \
94 "${mtdparts} "\
95 "${optargs}; " \
Peter Barada86887f82011-12-19 19:54:51 +000096 "run vrfb_arg\0" \
Adam Fordbb5854c2017-01-04 09:26:43 -060097 "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
Peter Barada86887f82011-12-19 19:54:51 +000098 "bootscript=echo 'Running bootscript from mmc ...'; " \
99 "source ${loadaddr}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600100 "loadimage=mmc rescan; " \
101 "load mmc ${mmcdev} ${loadaddr} ${bootfile}\0" \
Peter Barada86887f82011-12-19 19:54:51 +0000102 "ramdisksize=64000\0" \
Peter Barada86887f82011-12-19 19:54:51 +0000103 "ramdiskimage=rootfs.ext2.gz.uboot\0" \
Adam Ford49c73032016-01-29 20:12:34 -0600104 "loadramdisk=mmc rescan; " \
Adam Fordbb5854c2017-01-04 09:26:43 -0600105 "load mmc ${mmcdev} ${rdaddr} ${ramdiskimage}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600106 "ramargs=setenv bootargs "\
Peter Barada86887f82011-12-19 19:54:51 +0000107 "root=/dev/ram rw ramdisk_size=${ramdisksize}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600108 "mmcargs=setenv bootargs "\
Adam Fordc7d00f62019-04-11 15:24:33 -0500109 "root=PARTUUID=${uuid} " \
110 "rootfstype=${mmcrootfstype} rw\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600111 "nandargs=setenv bootargs "\
Adam Forda094c922016-02-10 01:41:10 -0600112 "root=${nandroot} " \
113 "rootfstype=${nandrootfstype}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600114 "nfsargs=setenv serverip ${tftpserver}; " \
115 "setenv bootargs root=/dev/nfs " \
Adam Ford760d1af2016-10-15 08:16:27 -0500116 "nfsroot=${nfsrootpath} " \
117 "ip=${ipaddr}:${tftpserver}:${gatewayip}:${netmask}::eth0:off\0" \
118 "nfsrootpath=/opt/nfs-exports/omap\0" \
119 "autoload=no\0" \
Adam Ford46580f22018-09-29 14:10:19 -0500120 "fdtimage=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
Adam Fordbb5854c2017-01-04 09:26:43 -0600121 "loadfdt=mmc rescan; " \
122 "load mmc ${mmcdev} ${fdtaddr} ${fdtimage}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600123 "mmcbootcommon=echo Booting with DT from mmc${mmcdev} ...; " \
Adam Fordc7d00f62019-04-11 15:24:33 -0500124 "run finduuid; "\
Adam Ford49c73032016-01-29 20:12:34 -0600125 "run mmcargs; " \
126 "run common_bootargs; " \
127 "run dump_bootargs; " \
Adam Ford476e16e2017-01-04 11:51:24 -0600128 "run loadimage; " \
129 "run loadfdt;\0 " \
130 "mmcbootz=setenv bootfile zImage; " \
131 "run mmcbootcommon; "\
Adam Ford49c73032016-01-29 20:12:34 -0600132 "bootz ${loadaddr} - ${fdtaddr}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600133 "mmcboot=setenv bootfile uImage; "\
134 "run mmcbootcommon; "\
135 "bootm ${loadaddr} - ${fdtaddr}\0" \
136 "mmcrambootcommon=echo 'Booting kernel from MMC w/ramdisk...'; " \
Peter Barada86887f82011-12-19 19:54:51 +0000137 "run ramargs; " \
138 "run common_bootargs; " \
139 "run dump_bootargs; " \
Adam Ford476e16e2017-01-04 11:51:24 -0600140 "run loadimage; " \
Adam Fordbb5854c2017-01-04 09:26:43 -0600141 "run loadfdt; " \
Adam Ford476e16e2017-01-04 11:51:24 -0600142 "run loadramdisk\0" \
143 "mmcramboot=setenv bootfile uImage; " \
144 "run mmcrambootcommon; " \
Adam Ford62896dc2018-03-26 10:24:12 -0500145 "bootm ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600146 "mmcrambootz=setenv bootfile zImage; " \
147 "run mmcrambootcommon; " \
Adam Ford62896dc2018-03-26 10:24:12 -0500148 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
Adam Ford49c73032016-01-29 20:12:34 -0600149 "tftpboot=echo 'Booting kernel/ramdisk rootfs from tftp...'; " \
150 "run ramargs; " \
151 "run common_bootargs; " \
152 "run dump_bootargs; " \
Adam Ford760d1af2016-10-15 08:16:27 -0500153 "tftpboot ${loadaddr} ${zimage}; " \
Adam Fordbb5854c2017-01-04 09:26:43 -0600154 "tftpboot ${rdaddr} ${ramdiskimage}; " \
155 "bootm ${loadaddr} ${rdaddr}\0" \
Adam Ford760d1af2016-10-15 08:16:27 -0500156 "tftpbootz=echo 'Booting kernel NFS rootfs...'; " \
157 "dhcp;" \
158 "run nfsargs;" \
159 "run common_bootargs;" \
160 "run dump_bootargs;" \
161 "tftpboot $loadaddr zImage;" \
Adam Ford476e16e2017-01-04 11:51:24 -0600162 "bootz $loadaddr\0" \
163 "nandbootcommon=echo 'Booting kernel from NAND...';" \
Adam Ford476e16e2017-01-04 11:51:24 -0600164 "run nandargs;" \
165 "run common_bootargs;" \
166 "run dump_bootargs;" \
167 "nand read ${loadaddr} kernel;" \
168 "nand read ${fdtaddr} spl-os;\0" \
169 "nandbootz=run nandbootcommon; "\
170 "bootz ${loadaddr} - ${fdtaddr}\0"\
171 "nandboot=run nandbootcommon; "\
172 "bootm ${loadaddr} - ${fdtaddr}\0"\
Peter Barada86887f82011-12-19 19:54:51 +0000173
174#define CONFIG_BOOTCOMMAND \
175 "run autoboot"
176
Adam Ford49c73032016-01-29 20:12:34 -0600177/* Miscellaneous configurable options */
Adam Ford7b77b1f2015-09-02 09:18:20 -0500178
Peter Barada86887f82011-12-19 19:54:51 +0000179/* memtest works on */
Peter Barada86887f82011-12-19 19:54:51 +0000180
Adam Ford49c73032016-01-29 20:12:34 -0600181/* FLASH and environment organization */
Peter Barada86887f82011-12-19 19:54:51 +0000182
183/* **** PISMO SUPPORT *** */
Peter Barada86887f82011-12-19 19:54:51 +0000184#if defined(CONFIG_CMD_NAND)
Adam Ford290097f2018-10-14 15:53:17 -0500185#define CONFIG_SYS_FLASH_BASE 0x10000000
Peter Barada86887f82011-12-19 19:54:51 +0000186#endif
187
Adam Ford290097f2018-10-14 15:53:17 -0500188#define CONFIG_SYS_MAX_FLASH_SECT 256
189#define CONFIG_SYS_MAX_FLASH_BANKS 1
190#define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT
191#define CONFIG_SYS_FLASH_SIZE 0x4000000
192
Peter Barada86887f82011-12-19 19:54:51 +0000193/* Monitor at start of flash */
194#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
195
Peter Barada86887f82011-12-19 19:54:51 +0000196#define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
Peter Barada86887f82011-12-19 19:54:51 +0000197
Adam Ford49c73032016-01-29 20:12:34 -0600198/* Defines for SPL */
199
Adam Ford49c73032016-01-29 20:12:34 -0600200/* NAND: SPL falcon mode configs */
201#ifdef CONFIG_SPL_OS_BOOT
Adam Ford49c73032016-01-29 20:12:34 -0600202#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
Adam Ford49c73032016-01-29 20:12:34 -0600203#endif
204
Peter Barada86887f82011-12-19 19:54:51 +0000205#endif /* __CONFIG_H */