blob: 4719184b5e955e561f83205e2f999d18d9c2be84 [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
Adam Ford5326c292016-01-29 20:12:34 -060017/* Board NAND Info. */
Miquel Raynald0935362019-10-03 19:50:03 +020018#ifdef CONFIG_MTD_RAW_NAND
Adam Ford5326c292016-01-29 20:12:34 -060019#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of */
20 /* NAND devices */
Adam Ford5326c292016-01-29 20:12:34 -060021#define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \
22 13, 14, 16, 17, 18, 19, 20, 21, 22, \
23 23, 24, 25, 26, 27, 28, 30, 31, 32, \
24 33, 34, 35, 36, 37, 38, 39, 40, 41, \
25 42, 44, 45, 46, 47, 48, 49, 50, 51, \
26 52, 53, 54, 55, 56}
Adam Ford04c848a2015-09-02 09:18:20 -050027
Adam Ford5326c292016-01-29 20:12:34 -060028#define CONFIG_SYS_NAND_ECCSIZE 512
29#define CONFIG_SYS_NAND_ECCBYTES 13
Adam Ford5326c292016-01-29 20:12:34 -060030#define CONFIG_SYS_NAND_MAX_OOBFREE 2
31#define CONFIG_SYS_NAND_MAX_ECCPOS 56
Adam Ford5326c292016-01-29 20:12:34 -060032#endif
Peter Baradae5b77e62011-12-19 19:54:51 +000033
34/* Environment information */
Peter Baradae5b77e62011-12-19 19:54:51 +000035
Peter Baradae5b77e62011-12-19 19:54:51 +000036#define CONFIG_EXTRA_ENV_SETTINGS \
Adam Ford34f28ee2017-01-04 09:26:43 -060037 DEFAULT_LINUX_BOOT_ENV \
Tom Rini5ad8e112017-10-22 17:55:07 -040038 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
39 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
Peter Baradae5b77e62011-12-19 19:54:51 +000040 "mmcdev=0\0" \
Adam Ford3ccdb962019-04-11 15:24:33 -050041 "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
Adam Ford5326c292016-01-29 20:12:34 -060042 "mmcrootfstype=ext4 rootwait\0" \
Adam Ford193e9a12016-02-10 01:41:10 -060043 "nandroot=ubi0:rootfs rw ubi.mtd=fs noinitrd\0" \
44 "nandrootfstype=ubifs rootwait\0" \
Andrew Bradforde1c7c8a2012-10-01 05:06:52 +000045 "autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \
Peter Baradae5b77e62011-12-19 19:54:51 +000046 "if run loadbootscript; then " \
47 "run bootscript; " \
48 "else " \
49 "run defaultboot;" \
50 "fi; " \
51 "else run defaultboot; fi\0" \
52 "defaultboot=run mmcramboot\0" \
Adam Fordb36bb902018-06-15 08:12:02 -050053 "consoledevice=ttyS0\0" \
Peter Baradae5b77e62011-12-19 19:54:51 +000054 "setconsole=setenv console ${consoledevice},${baudrate}n8\0" \
55 "dump_bootargs=echo 'Bootargs: '; echo $bootargs\0" \
56 "rotation=0\0" \
57 "vrfb_arg=if itest ${rotation} -ne 0; then " \
58 "setenv bootargs ${bootargs} omapfb.vrfb=y " \
59 "omapfb.rotate=${rotation}; " \
60 "fi\0" \
Adam Ford5326c292016-01-29 20:12:34 -060061 "optargs=ignore_loglevel early_printk no_console_suspend\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -060062 "common_bootargs=run setconsole; setenv bootargs " \
63 "${bootargs} "\
64 "console=${console} " \
65 "${mtdparts} "\
66 "${optargs}; " \
Peter Baradae5b77e62011-12-19 19:54:51 +000067 "run vrfb_arg\0" \
Adam Ford34f28ee2017-01-04 09:26:43 -060068 "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
Peter Baradae5b77e62011-12-19 19:54:51 +000069 "bootscript=echo 'Running bootscript from mmc ...'; " \
70 "source ${loadaddr}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -060071 "loadimage=mmc rescan; " \
72 "load mmc ${mmcdev} ${loadaddr} ${bootfile}\0" \
Peter Baradae5b77e62011-12-19 19:54:51 +000073 "ramdisksize=64000\0" \
Peter Baradae5b77e62011-12-19 19:54:51 +000074 "ramdiskimage=rootfs.ext2.gz.uboot\0" \
Adam Ford5326c292016-01-29 20:12:34 -060075 "loadramdisk=mmc rescan; " \
Adam Ford34f28ee2017-01-04 09:26:43 -060076 "load mmc ${mmcdev} ${rdaddr} ${ramdiskimage}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -060077 "ramargs=setenv bootargs "\
Peter Baradae5b77e62011-12-19 19:54:51 +000078 "root=/dev/ram rw ramdisk_size=${ramdisksize}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -060079 "mmcargs=setenv bootargs "\
Adam Ford3ccdb962019-04-11 15:24:33 -050080 "root=PARTUUID=${uuid} " \
81 "rootfstype=${mmcrootfstype} rw\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -060082 "nandargs=setenv bootargs "\
Adam Ford193e9a12016-02-10 01:41:10 -060083 "root=${nandroot} " \
84 "rootfstype=${nandrootfstype}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -060085 "nfsargs=setenv serverip ${tftpserver}; " \
86 "setenv bootargs root=/dev/nfs " \
Adam Ford97073d02016-10-15 08:16:27 -050087 "nfsroot=${nfsrootpath} " \
88 "ip=${ipaddr}:${tftpserver}:${gatewayip}:${netmask}::eth0:off\0" \
89 "nfsrootpath=/opt/nfs-exports/omap\0" \
90 "autoload=no\0" \
Adam Ford81b19d72018-09-29 14:10:19 -050091 "fdtimage=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
Adam Ford34f28ee2017-01-04 09:26:43 -060092 "loadfdt=mmc rescan; " \
93 "load mmc ${mmcdev} ${fdtaddr} ${fdtimage}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -060094 "mmcbootcommon=echo Booting with DT from mmc${mmcdev} ...; " \
Adam Ford3ccdb962019-04-11 15:24:33 -050095 "run finduuid; "\
Adam Ford5326c292016-01-29 20:12:34 -060096 "run mmcargs; " \
97 "run common_bootargs; " \
98 "run dump_bootargs; " \
Adam Ford4760c8f2017-01-04 11:51:24 -060099 "run loadimage; " \
100 "run loadfdt;\0 " \
101 "mmcbootz=setenv bootfile zImage; " \
102 "run mmcbootcommon; "\
Adam Ford5326c292016-01-29 20:12:34 -0600103 "bootz ${loadaddr} - ${fdtaddr}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600104 "mmcboot=setenv bootfile uImage; "\
105 "run mmcbootcommon; "\
106 "bootm ${loadaddr} - ${fdtaddr}\0" \
107 "mmcrambootcommon=echo 'Booting kernel from MMC w/ramdisk...'; " \
Peter Baradae5b77e62011-12-19 19:54:51 +0000108 "run ramargs; " \
109 "run common_bootargs; " \
110 "run dump_bootargs; " \
Adam Ford4760c8f2017-01-04 11:51:24 -0600111 "run loadimage; " \
Adam Ford34f28ee2017-01-04 09:26:43 -0600112 "run loadfdt; " \
Adam Ford4760c8f2017-01-04 11:51:24 -0600113 "run loadramdisk\0" \
114 "mmcramboot=setenv bootfile uImage; " \
115 "run mmcrambootcommon; " \
Adam Ford8717e922018-03-26 10:24:12 -0500116 "bootm ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600117 "mmcrambootz=setenv bootfile zImage; " \
118 "run mmcrambootcommon; " \
Adam Ford8717e922018-03-26 10:24:12 -0500119 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
Adam Ford5326c292016-01-29 20:12:34 -0600120 "tftpboot=echo 'Booting kernel/ramdisk rootfs from tftp...'; " \
Peter Baradae5b77e62011-12-19 19:54:51 +0000121 "run ramargs; " \
122 "run common_bootargs; " \
123 "run dump_bootargs; " \
Adam Ford97073d02016-10-15 08:16:27 -0500124 "tftpboot ${loadaddr} ${zimage}; " \
Adam Ford34f28ee2017-01-04 09:26:43 -0600125 "tftpboot ${rdaddr} ${ramdiskimage}; " \
126 "bootm ${loadaddr} ${rdaddr}\0" \
Adam Ford97073d02016-10-15 08:16:27 -0500127 "tftpbootz=echo 'Booting kernel NFS rootfs...'; " \
128 "dhcp;" \
129 "run nfsargs;" \
130 "run common_bootargs;" \
131 "run dump_bootargs;" \
132 "tftpboot $loadaddr zImage;" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600133 "bootz $loadaddr\0" \
134 "nandbootcommon=echo 'Booting kernel from NAND...';" \
Adam Ford4760c8f2017-01-04 11:51:24 -0600135 "run nandargs;" \
136 "run common_bootargs;" \
137 "run dump_bootargs;" \
138 "nand read ${loadaddr} kernel;" \
139 "nand read ${fdtaddr} spl-os;\0" \
140 "nandbootz=run nandbootcommon; "\
141 "bootz ${loadaddr} - ${fdtaddr}\0"\
142 "nandboot=run nandbootcommon; "\
143 "bootm ${loadaddr} - ${fdtaddr}\0"\
Peter Baradae5b77e62011-12-19 19:54:51 +0000144
Adam Ford5326c292016-01-29 20:12:34 -0600145/* Miscellaneous configurable options */
Adam Ford04c848a2015-09-02 09:18:20 -0500146
Peter Baradae5b77e62011-12-19 19:54:51 +0000147/* memtest works on */
Peter Baradae5b77e62011-12-19 19:54:51 +0000148
Adam Ford5326c292016-01-29 20:12:34 -0600149/* FLASH and environment organization */
Peter Baradae5b77e62011-12-19 19:54:51 +0000150
151/* **** PISMO SUPPORT *** */
Peter Baradae5b77e62011-12-19 19:54:51 +0000152#if defined(CONFIG_CMD_NAND)
Adam Ford726ab5d2018-10-14 15:53:17 -0500153#define CONFIG_SYS_FLASH_BASE 0x10000000
Peter Baradae5b77e62011-12-19 19:54:51 +0000154#endif
155
Adam Ford726ab5d2018-10-14 15:53:17 -0500156#define CONFIG_SYS_MAX_FLASH_SECT 256
Adam Ford726ab5d2018-10-14 15:53:17 -0500157#define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT
158#define CONFIG_SYS_FLASH_SIZE 0x4000000
159
Peter Baradae5b77e62011-12-19 19:54:51 +0000160/* Monitor at start of flash */
161#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
162
Peter Baradae5b77e62011-12-19 19:54:51 +0000163#define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
Peter Baradae5b77e62011-12-19 19:54:51 +0000164
Adam Ford5326c292016-01-29 20:12:34 -0600165/* Defines for SPL */
166
Adam Ford5326c292016-01-29 20:12:34 -0600167/* NAND: SPL falcon mode configs */
168#ifdef CONFIG_SPL_OS_BOOT
Adam Ford5326c292016-01-29 20:12:34 -0600169#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
Adam Ford5326c292016-01-29 20:12:34 -0600170#endif
171
Peter Baradae5b77e62011-12-19 19:54:51 +0000172#endif /* __CONFIG_H */