Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2011 Logic Product Development <www.logicpd.com> |
| 3 | * Peter Barada <peter.barada@logicpd.com> |
| 4 | * |
| 5 | * Configuration settings for the Logic OMAP35x/DM37x SOM LV/Torpedo |
| 6 | * reference boards. |
| 7 | * |
Wolfgang Denk | 3765b3e | 2013-10-07 13:07:26 +0200 | [diff] [blame] | 8 | * SPDX-License-Identifier: GPL-2.0+ |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #ifndef __CONFIG_H |
| 12 | #define __CONFIG_H |
| 13 | |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 14 | /* High Level Configuration Options */ |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 15 | |
Adam Ford | 7b77b1f | 2015-09-02 09:18:20 -0500 | [diff] [blame] | 16 | #define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */ |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 17 | |
Adam Ford | 7b77b1f | 2015-09-02 09:18:20 -0500 | [diff] [blame] | 18 | #include <configs/ti_omap3_common.h> |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 19 | |
Adam Ford | 15fde73 | 2017-04-17 08:09:45 -0500 | [diff] [blame] | 20 | #ifdef CONFIG_SPL_BUILD |
Adam Ford | 15fde73 | 2017-04-17 08:09:45 -0500 | [diff] [blame] | 21 | /* select serial console configuration for SPL */ |
Adam Ford | 15fde73 | 2017-04-17 08:09:45 -0500 | [diff] [blame] | 22 | #define CONFIG_SYS_NS16550_COM1 OMAP34XX_UART1 |
| 23 | #endif |
| 24 | |
| 25 | |
Tom Rini | fa2f81b | 2016-08-26 13:30:43 -0400 | [diff] [blame] | 26 | /* |
| 27 | * We are only ever GP parts and will utilize all of the "downloaded image" |
| 28 | * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB) in |
| 29 | * order to allow for BCH8 to fit in. |
| 30 | */ |
Adam Ford | f92dfc8 | 2016-02-08 19:06:08 -0600 | [diff] [blame] | 31 | #undef CONFIG_SPL_TEXT_BASE |
Tom Rini | fa2f81b | 2016-08-26 13:30:43 -0400 | [diff] [blame] | 32 | #define CONFIG_SPL_TEXT_BASE 0x40200000 |
Adam Ford | f92dfc8 | 2016-02-08 19:06:08 -0600 | [diff] [blame] | 33 | |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 34 | #define CONFIG_MISC_INIT_R /* misc_init_r dumps the die id */ |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 35 | #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 36 | #define CONFIG_SETUP_MEMORY_TAGS |
| 37 | #define CONFIG_INITRD_TAG |
| 38 | #define CONFIG_REVISION_TAG |
| 39 | |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 40 | /* Hardware drivers */ |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 41 | |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 42 | /* I2C */ |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 43 | #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM AT24C64 */ |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 44 | |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 45 | /* Board NAND Info. */ |
| 46 | #ifdef CONFIG_NAND |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 47 | #define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */ |
| 48 | /* to access nand */ |
| 49 | #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of */ |
| 50 | /* NAND devices */ |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 51 | #define CONFIG_SYS_NAND_5_ADDR_CYCLE |
| 52 | #define CONFIG_SYS_NAND_PAGE_COUNT 64 |
| 53 | #define CONFIG_SYS_NAND_PAGE_SIZE 2048 |
| 54 | #define CONFIG_SYS_NAND_OOBSIZE 64 |
| 55 | #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024) |
| 56 | #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS |
| 57 | #define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \ |
| 58 | 13, 14, 16, 17, 18, 19, 20, 21, 22, \ |
| 59 | 23, 24, 25, 26, 27, 28, 30, 31, 32, \ |
| 60 | 33, 34, 35, 36, 37, 38, 39, 40, 41, \ |
| 61 | 42, 44, 45, 46, 47, 48, 49, 50, 51, \ |
| 62 | 52, 53, 54, 55, 56} |
Adam Ford | 7b77b1f | 2015-09-02 09:18:20 -0500 | [diff] [blame] | 63 | |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 64 | #define CONFIG_SYS_NAND_ECCSIZE 512 |
| 65 | #define CONFIG_SYS_NAND_ECCBYTES 13 |
| 66 | #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW_DETECTION_SW |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 67 | #define CONFIG_SYS_NAND_MAX_OOBFREE 2 |
| 68 | #define CONFIG_SYS_NAND_MAX_ECCPOS 56 |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 69 | #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ |
| 70 | #define CONFIG_MTD_PARTITIONS /* required for UBI partition support */ |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 71 | #endif |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 72 | |
| 73 | /* Environment information */ |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 74 | |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 75 | #define CONFIG_PREBOOT \ |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 76 | "setenv preboot;" \ |
| 77 | "saveenv;" |
| 78 | |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 79 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
Adam Ford | bb5854c | 2017-01-04 09:26:43 -0600 | [diff] [blame] | 80 | DEFAULT_LINUX_BOOT_ENV \ |
Tom Rini | 43ede0b | 2017-10-22 17:55:07 -0400 | [diff] [blame] | 81 | "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \ |
| 82 | "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \ |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 83 | "mmcdev=0\0" \ |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 84 | "mmcroot=/dev/mmcblk0p2 rw\0" \ |
| 85 | "mmcrootfstype=ext4 rootwait\0" \ |
Adam Ford | a094c92 | 2016-02-10 01:41:10 -0600 | [diff] [blame] | 86 | "nandroot=ubi0:rootfs rw ubi.mtd=fs noinitrd\0" \ |
| 87 | "nandrootfstype=ubifs rootwait\0" \ |
Andrew Bradford | 6696811 | 2012-10-01 05:06:52 +0000 | [diff] [blame] | 88 | "autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \ |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 89 | "if run loadbootscript; then " \ |
| 90 | "run bootscript; " \ |
| 91 | "else " \ |
| 92 | "run defaultboot;" \ |
| 93 | "fi; " \ |
| 94 | "else run defaultboot; fi\0" \ |
| 95 | "defaultboot=run mmcramboot\0" \ |
| 96 | "consoledevice=ttyO0\0" \ |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 97 | "setconsole=setenv console ${consoledevice},${baudrate}n8\0" \ |
| 98 | "dump_bootargs=echo 'Bootargs: '; echo $bootargs\0" \ |
| 99 | "rotation=0\0" \ |
| 100 | "vrfb_arg=if itest ${rotation} -ne 0; then " \ |
| 101 | "setenv bootargs ${bootargs} omapfb.vrfb=y " \ |
| 102 | "omapfb.rotate=${rotation}; " \ |
| 103 | "fi\0" \ |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 104 | "optargs=ignore_loglevel early_printk no_console_suspend\0" \ |
Adam Ford | 476e16e | 2017-01-04 11:51:24 -0600 | [diff] [blame] | 105 | "common_bootargs=run setconsole; setenv bootargs " \ |
| 106 | "${bootargs} "\ |
| 107 | "console=${console} " \ |
| 108 | "${mtdparts} "\ |
| 109 | "${optargs}; " \ |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 110 | "run vrfb_arg\0" \ |
Adam Ford | bb5854c | 2017-01-04 09:26:43 -0600 | [diff] [blame] | 111 | "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \ |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 112 | "bootscript=echo 'Running bootscript from mmc ...'; " \ |
| 113 | "source ${loadaddr}\0" \ |
Adam Ford | 476e16e | 2017-01-04 11:51:24 -0600 | [diff] [blame] | 114 | "loadimage=mmc rescan; " \ |
| 115 | "load mmc ${mmcdev} ${loadaddr} ${bootfile}\0" \ |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 116 | "ramdisksize=64000\0" \ |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 117 | "ramdiskimage=rootfs.ext2.gz.uboot\0" \ |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 118 | "loadramdisk=mmc rescan; " \ |
Adam Ford | bb5854c | 2017-01-04 09:26:43 -0600 | [diff] [blame] | 119 | "load mmc ${mmcdev} ${rdaddr} ${ramdiskimage}\0" \ |
Adam Ford | 476e16e | 2017-01-04 11:51:24 -0600 | [diff] [blame] | 120 | "ramargs=setenv bootargs "\ |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 121 | "root=/dev/ram rw ramdisk_size=${ramdisksize}\0" \ |
Adam Ford | 476e16e | 2017-01-04 11:51:24 -0600 | [diff] [blame] | 122 | "mmcargs=setenv bootargs "\ |
| 123 | "root=${mmcroot} rootfstype=${mmcrootfstype}\0" \ |
| 124 | "nandargs=setenv bootargs "\ |
Adam Ford | a094c92 | 2016-02-10 01:41:10 -0600 | [diff] [blame] | 125 | "root=${nandroot} " \ |
| 126 | "rootfstype=${nandrootfstype}\0" \ |
Adam Ford | 476e16e | 2017-01-04 11:51:24 -0600 | [diff] [blame] | 127 | "nfsargs=setenv serverip ${tftpserver}; " \ |
| 128 | "setenv bootargs root=/dev/nfs " \ |
Adam Ford | 760d1af | 2016-10-15 08:16:27 -0500 | [diff] [blame] | 129 | "nfsroot=${nfsrootpath} " \ |
| 130 | "ip=${ipaddr}:${tftpserver}:${gatewayip}:${netmask}::eth0:off\0" \ |
| 131 | "nfsrootpath=/opt/nfs-exports/omap\0" \ |
| 132 | "autoload=no\0" \ |
Adam Ford | bb5854c | 2017-01-04 09:26:43 -0600 | [diff] [blame] | 133 | "loadfdt=mmc rescan; " \ |
| 134 | "load mmc ${mmcdev} ${fdtaddr} ${fdtimage}\0" \ |
Adam Ford | 476e16e | 2017-01-04 11:51:24 -0600 | [diff] [blame] | 135 | "mmcbootcommon=echo Booting with DT from mmc${mmcdev} ...; " \ |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 136 | "run mmcargs; " \ |
| 137 | "run common_bootargs; " \ |
| 138 | "run dump_bootargs; " \ |
Adam Ford | 476e16e | 2017-01-04 11:51:24 -0600 | [diff] [blame] | 139 | "run loadimage; " \ |
| 140 | "run loadfdt;\0 " \ |
| 141 | "mmcbootz=setenv bootfile zImage; " \ |
| 142 | "run mmcbootcommon; "\ |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 143 | "bootz ${loadaddr} - ${fdtaddr}\0" \ |
Adam Ford | 476e16e | 2017-01-04 11:51:24 -0600 | [diff] [blame] | 144 | "mmcboot=setenv bootfile uImage; "\ |
| 145 | "run mmcbootcommon; "\ |
| 146 | "bootm ${loadaddr} - ${fdtaddr}\0" \ |
| 147 | "mmcrambootcommon=echo 'Booting kernel from MMC w/ramdisk...'; " \ |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 148 | "run ramargs; " \ |
| 149 | "run common_bootargs; " \ |
| 150 | "run dump_bootargs; " \ |
Adam Ford | 476e16e | 2017-01-04 11:51:24 -0600 | [diff] [blame] | 151 | "run loadimage; " \ |
Adam Ford | bb5854c | 2017-01-04 09:26:43 -0600 | [diff] [blame] | 152 | "run loadfdt; " \ |
Adam Ford | 476e16e | 2017-01-04 11:51:24 -0600 | [diff] [blame] | 153 | "run loadramdisk\0" \ |
| 154 | "mmcramboot=setenv bootfile uImage; " \ |
| 155 | "run mmcrambootcommon; " \ |
Adam Ford | 62896dc | 2018-03-26 10:24:12 -0500 | [diff] [blame] | 156 | "bootm ${loadaddr} ${rdaddr} ${fdtaddr}\0" \ |
Adam Ford | 476e16e | 2017-01-04 11:51:24 -0600 | [diff] [blame] | 157 | "mmcrambootz=setenv bootfile zImage; " \ |
| 158 | "run mmcrambootcommon; " \ |
Adam Ford | 62896dc | 2018-03-26 10:24:12 -0500 | [diff] [blame] | 159 | "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \ |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 160 | "tftpboot=echo 'Booting kernel/ramdisk rootfs from tftp...'; " \ |
| 161 | "run ramargs; " \ |
| 162 | "run common_bootargs; " \ |
| 163 | "run dump_bootargs; " \ |
Adam Ford | 760d1af | 2016-10-15 08:16:27 -0500 | [diff] [blame] | 164 | "tftpboot ${loadaddr} ${zimage}; " \ |
Adam Ford | bb5854c | 2017-01-04 09:26:43 -0600 | [diff] [blame] | 165 | "tftpboot ${rdaddr} ${ramdiskimage}; " \ |
| 166 | "bootm ${loadaddr} ${rdaddr}\0" \ |
Adam Ford | 760d1af | 2016-10-15 08:16:27 -0500 | [diff] [blame] | 167 | "tftpbootz=echo 'Booting kernel NFS rootfs...'; " \ |
| 168 | "dhcp;" \ |
| 169 | "run nfsargs;" \ |
| 170 | "run common_bootargs;" \ |
| 171 | "run dump_bootargs;" \ |
| 172 | "tftpboot $loadaddr zImage;" \ |
Adam Ford | 476e16e | 2017-01-04 11:51:24 -0600 | [diff] [blame] | 173 | "bootz $loadaddr\0" \ |
| 174 | "nandbootcommon=echo 'Booting kernel from NAND...';" \ |
Adam Ford | 476e16e | 2017-01-04 11:51:24 -0600 | [diff] [blame] | 175 | "run nandargs;" \ |
| 176 | "run common_bootargs;" \ |
| 177 | "run dump_bootargs;" \ |
| 178 | "nand read ${loadaddr} kernel;" \ |
| 179 | "nand read ${fdtaddr} spl-os;\0" \ |
| 180 | "nandbootz=run nandbootcommon; "\ |
| 181 | "bootz ${loadaddr} - ${fdtaddr}\0"\ |
| 182 | "nandboot=run nandbootcommon; "\ |
| 183 | "bootm ${loadaddr} - ${fdtaddr}\0"\ |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 184 | |
| 185 | #define CONFIG_BOOTCOMMAND \ |
| 186 | "run autoboot" |
| 187 | |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 188 | /* Miscellaneous configurable options */ |
Adam Ford | 7b77b1f | 2015-09-02 09:18:20 -0500 | [diff] [blame] | 189 | |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 190 | /* memtest works on */ |
| 191 | #define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0) |
| 192 | #define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + \ |
| 193 | 0x01F00000) /* 31MB */ |
| 194 | |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 195 | /* FLASH and environment organization */ |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 196 | |
| 197 | /* **** PISMO SUPPORT *** */ |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 198 | #if defined(CONFIG_CMD_NAND) |
pekon gupta | 222a311 | 2014-07-18 17:59:41 +0530 | [diff] [blame] | 199 | #define CONFIG_SYS_FLASH_BASE NAND_BASE |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 200 | #endif |
| 201 | |
| 202 | /* Monitor at start of flash */ |
| 203 | #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE |
| 204 | |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 205 | #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */ |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 206 | |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 207 | #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */ |
Adam Ford | 7672d9d | 2017-09-04 21:08:02 -0500 | [diff] [blame] | 208 | #define CONFIG_ENV_OFFSET 0x260000 |
| 209 | #define CONFIG_ENV_ADDR 0x260000 |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 210 | |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 211 | /* Defines for SPL */ |
| 212 | |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 213 | /* NAND: SPL falcon mode configs */ |
| 214 | #ifdef CONFIG_SPL_OS_BOOT |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 215 | #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000 |
Adam Ford | 49c7303 | 2016-01-29 20:12:34 -0600 | [diff] [blame] | 216 | #endif |
| 217 | |
Peter Barada | 86887f8 | 2011-12-19 19:54:51 +0000 | [diff] [blame] | 218 | #endif /* __CONFIG_H */ |