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