blob: d3839eb1229301482f859041a24cb12fc1b3bb1c [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
Adam Ford49c73032016-01-29 20:12:34 -060017/* Board NAND Info. */
Miquel Raynal88718be2019-10-03 19:50:03 +020018#ifdef CONFIG_MTD_RAW_NAND
Adam Ford49c73032016-01-29 20:12:34 -060019#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of */
20 /* NAND devices */
Adam Ford49c73032016-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 Ford7b77b1f2015-09-02 09:18:20 -050027
Adam Ford49c73032016-01-29 20:12:34 -060028#define CONFIG_SYS_NAND_ECCSIZE 512
29#define CONFIG_SYS_NAND_ECCBYTES 13
Adam Ford49c73032016-01-29 20:12:34 -060030#define CONFIG_SYS_NAND_MAX_OOBFREE 2
31#define CONFIG_SYS_NAND_MAX_ECCPOS 56
Adam Ford49c73032016-01-29 20:12:34 -060032#endif
Peter Barada86887f82011-12-19 19:54:51 +000033
34/* Environment information */
Peter Barada86887f82011-12-19 19:54:51 +000035
Peter Barada86887f82011-12-19 19:54:51 +000036#define CONFIG_EXTRA_ENV_SETTINGS \
Adam Fordbb5854c2017-01-04 09:26:43 -060037 DEFAULT_LINUX_BOOT_ENV \
Tom Rini43ede0b2017-10-22 17:55:07 -040038 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
39 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
Peter Barada86887f82011-12-19 19:54:51 +000040 "mmcdev=0\0" \
Adam Fordc7d00f62019-04-11 15:24:33 -050041 "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
Adam Ford49c73032016-01-29 20:12:34 -060042 "mmcrootfstype=ext4 rootwait\0" \
Adam Forda094c922016-02-10 01:41:10 -060043 "nandroot=ubi0:rootfs rw ubi.mtd=fs noinitrd\0" \
44 "nandrootfstype=ubifs rootwait\0" \
Andrew Bradford66968112012-10-01 05:06:52 +000045 "autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \
Peter Barada86887f82011-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 Forde7457822018-06-15 08:12:02 -050053 "consoledevice=ttyS0\0" \
Peter Barada86887f82011-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 Ford49c73032016-01-29 20:12:34 -060061 "optargs=ignore_loglevel early_printk no_console_suspend\0" \
Adam Ford476e16e2017-01-04 11:51:24 -060062 "common_bootargs=run setconsole; setenv bootargs " \
63 "${bootargs} "\
64 "console=${console} " \
65 "${mtdparts} "\
66 "${optargs}; " \
Peter Barada86887f82011-12-19 19:54:51 +000067 "run vrfb_arg\0" \
Adam Fordbb5854c2017-01-04 09:26:43 -060068 "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
Peter Barada86887f82011-12-19 19:54:51 +000069 "bootscript=echo 'Running bootscript from mmc ...'; " \
70 "source ${loadaddr}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -060071 "loadimage=mmc rescan; " \
72 "load mmc ${mmcdev} ${loadaddr} ${bootfile}\0" \
Peter Barada86887f82011-12-19 19:54:51 +000073 "ramdisksize=64000\0" \
Peter Barada86887f82011-12-19 19:54:51 +000074 "ramdiskimage=rootfs.ext2.gz.uboot\0" \
Adam Ford49c73032016-01-29 20:12:34 -060075 "loadramdisk=mmc rescan; " \
Adam Fordbb5854c2017-01-04 09:26:43 -060076 "load mmc ${mmcdev} ${rdaddr} ${ramdiskimage}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -060077 "ramargs=setenv bootargs "\
Peter Barada86887f82011-12-19 19:54:51 +000078 "root=/dev/ram rw ramdisk_size=${ramdisksize}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -060079 "mmcargs=setenv bootargs "\
Adam Fordc7d00f62019-04-11 15:24:33 -050080 "root=PARTUUID=${uuid} " \
81 "rootfstype=${mmcrootfstype} rw\0" \
Adam Ford476e16e2017-01-04 11:51:24 -060082 "nandargs=setenv bootargs "\
Adam Forda094c922016-02-10 01:41:10 -060083 "root=${nandroot} " \
84 "rootfstype=${nandrootfstype}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -060085 "nfsargs=setenv serverip ${tftpserver}; " \
86 "setenv bootargs root=/dev/nfs " \
Adam Ford760d1af2016-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 Ford46580f22018-09-29 14:10:19 -050091 "fdtimage=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
Adam Fordbb5854c2017-01-04 09:26:43 -060092 "loadfdt=mmc rescan; " \
93 "load mmc ${mmcdev} ${fdtaddr} ${fdtimage}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -060094 "mmcbootcommon=echo Booting with DT from mmc${mmcdev} ...; " \
Adam Fordc7d00f62019-04-11 15:24:33 -050095 "run finduuid; "\
Adam Ford49c73032016-01-29 20:12:34 -060096 "run mmcargs; " \
97 "run common_bootargs; " \
98 "run dump_bootargs; " \
Adam Ford476e16e2017-01-04 11:51:24 -060099 "run loadimage; " \
100 "run loadfdt;\0 " \
101 "mmcbootz=setenv bootfile zImage; " \
102 "run mmcbootcommon; "\
Adam Ford49c73032016-01-29 20:12:34 -0600103 "bootz ${loadaddr} - ${fdtaddr}\0" \
Adam Ford476e16e2017-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 Barada86887f82011-12-19 19:54:51 +0000108 "run ramargs; " \
109 "run common_bootargs; " \
110 "run dump_bootargs; " \
Adam Ford476e16e2017-01-04 11:51:24 -0600111 "run loadimage; " \
Adam Fordbb5854c2017-01-04 09:26:43 -0600112 "run loadfdt; " \
Adam Ford476e16e2017-01-04 11:51:24 -0600113 "run loadramdisk\0" \
114 "mmcramboot=setenv bootfile uImage; " \
115 "run mmcrambootcommon; " \
Adam Ford62896dc2018-03-26 10:24:12 -0500116 "bootm ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
Adam Ford476e16e2017-01-04 11:51:24 -0600117 "mmcrambootz=setenv bootfile zImage; " \
118 "run mmcrambootcommon; " \
Adam Ford62896dc2018-03-26 10:24:12 -0500119 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
Adam Ford49c73032016-01-29 20:12:34 -0600120 "tftpboot=echo 'Booting kernel/ramdisk rootfs from tftp...'; " \
121 "run ramargs; " \
122 "run common_bootargs; " \
123 "run dump_bootargs; " \
Adam Ford760d1af2016-10-15 08:16:27 -0500124 "tftpboot ${loadaddr} ${zimage}; " \
Adam Fordbb5854c2017-01-04 09:26:43 -0600125 "tftpboot ${rdaddr} ${ramdiskimage}; " \
126 "bootm ${loadaddr} ${rdaddr}\0" \
Adam Ford760d1af2016-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 Ford476e16e2017-01-04 11:51:24 -0600133 "bootz $loadaddr\0" \
134 "nandbootcommon=echo 'Booting kernel from NAND...';" \
Adam Ford476e16e2017-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 Barada86887f82011-12-19 19:54:51 +0000144
Adam Ford49c73032016-01-29 20:12:34 -0600145/* Miscellaneous configurable options */
Adam Ford7b77b1f2015-09-02 09:18:20 -0500146
Peter Barada86887f82011-12-19 19:54:51 +0000147/* memtest works on */
Peter Barada86887f82011-12-19 19:54:51 +0000148
Adam Ford49c73032016-01-29 20:12:34 -0600149/* FLASH and environment organization */
Peter Barada86887f82011-12-19 19:54:51 +0000150
151/* **** PISMO SUPPORT *** */
Peter Barada86887f82011-12-19 19:54:51 +0000152#if defined(CONFIG_CMD_NAND)
Adam Ford290097f2018-10-14 15:53:17 -0500153#define CONFIG_SYS_FLASH_BASE 0x10000000
Peter Barada86887f82011-12-19 19:54:51 +0000154#endif
155
Adam Ford290097f2018-10-14 15:53:17 -0500156#define CONFIG_SYS_MAX_FLASH_SECT 256
Adam Ford290097f2018-10-14 15:53:17 -0500157#define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT
158#define CONFIG_SYS_FLASH_SIZE 0x4000000
159
Peter Barada86887f82011-12-19 19:54:51 +0000160#define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
Peter Barada86887f82011-12-19 19:54:51 +0000161
Adam Ford49c73032016-01-29 20:12:34 -0600162/* Defines for SPL */
163
Adam Ford49c73032016-01-29 20:12:34 -0600164/* NAND: SPL falcon mode configs */
165#ifdef CONFIG_SPL_OS_BOOT
Adam Ford49c73032016-01-29 20:12:34 -0600166#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
Adam Ford49c73032016-01-29 20:12:34 -0600167#endif
168
Peter Barada86887f82011-12-19 19:54:51 +0000169#endif /* __CONFIG_H */