Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2006-2008 |
| 4 | * Texas Instruments. |
| 5 | * Richard Woodruff <r-woodruff2@ti.com> |
| 6 | * Syed Mohammed Khasim <x0khasim@ti.com> |
| 7 | * |
| 8 | * Configuration settings for the TI OMAP3530 Beagle board. |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #ifndef __CONFIG_H |
| 12 | #define __CONFIG_H |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 13 | |
Derald D. Woods | d233ccb | 2018-02-26 17:52:58 -0600 | [diff] [blame] | 14 | #define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */ |
Tom Rini | df4dbb5 | 2014-04-03 15:17:15 -0400 | [diff] [blame] | 15 | |
Tom Rini | df4dbb5 | 2014-04-03 15:17:15 -0400 | [diff] [blame] | 16 | #include <configs/ti_omap3_common.h> |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 17 | |
Derald D. Woods | 4b37928 | 2017-12-29 10:37:32 -0600 | [diff] [blame] | 18 | /* |
| 19 | * We are only ever GP parts and will utilize all of the "downloaded image" |
| 20 | * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB). |
| 21 | */ |
| 22 | #undef CONFIG_SPL_TEXT_BASE |
| 23 | #define CONFIG_SPL_TEXT_BASE 0x40200000 |
| 24 | |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 25 | #define CONFIG_MISC_INIT_R |
Derald D. Woods | 4b37928 | 2017-12-29 10:37:32 -0600 | [diff] [blame] | 26 | #define CONFIG_CMDLINE_TAG |
| 27 | #define CONFIG_SETUP_MEMORY_TAGS |
| 28 | #define CONFIG_INITRD_TAG |
| 29 | #define CONFIG_REVISION_TAG |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 30 | |
Derald D. Woods | 4b37928 | 2017-12-29 10:37:32 -0600 | [diff] [blame] | 31 | /* NAND */ |
| 32 | #if defined(CONFIG_NAND) |
| 33 | #define CONFIG_SYS_FLASH_BASE NAND_BASE |
| 34 | #define CONFIG_SYS_MAX_NAND_DEVICE 1 |
| 35 | #define CONFIG_SYS_NAND_5_ADDR_CYCLE |
| 36 | #define CONFIG_SYS_NAND_PAGE_COUNT 64 |
| 37 | #define CONFIG_SYS_NAND_PAGE_SIZE 2048 |
| 38 | #define CONFIG_SYS_NAND_OOBSIZE 64 |
| 39 | #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024) |
| 40 | #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS |
| 41 | #define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9,\ |
| 42 | 10, 11, 12, 13} |
| 43 | #define CONFIG_SYS_NAND_ECCSIZE 512 |
| 44 | #define CONFIG_SYS_NAND_ECCBYTES 3 |
| 45 | #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW_DETECTION_SW |
| 46 | #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000 |
Derald D. Woods | d233ccb | 2018-02-26 17:52:58 -0600 | [diff] [blame] | 47 | #define CONFIG_SYS_ENV_SECT_SIZE SZ_128K |
Derald D. Woods | 4b37928 | 2017-12-29 10:37:32 -0600 | [diff] [blame] | 48 | #define CONFIG_ENV_OFFSET 0x260000 |
| 49 | #define CONFIG_ENV_ADDR 0x260000 |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 50 | #define CONFIG_ENV_OVERWRITE |
Derald D. Woods | 4b37928 | 2017-12-29 10:37:32 -0600 | [diff] [blame] | 51 | #define CONFIG_MTD_PARTITIONS /* required for UBI partition support */ |
| 52 | /* NAND: SPL falcon mode configs */ |
| 53 | #if defined(CONFIG_SPL_OS_BOOT) |
Derald D. Woods | d233ccb | 2018-02-26 17:52:58 -0600 | [diff] [blame] | 54 | #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x2a0000 |
Derald D. Woods | 4b37928 | 2017-12-29 10:37:32 -0600 | [diff] [blame] | 55 | #endif /* CONFIG_SPL_OS_BOOT */ |
| 56 | #endif /* CONFIG_NAND */ |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 57 | |
Alexander Holler | d90859a | 2011-04-19 09:30:35 -0400 | [diff] [blame] | 58 | /* USB EHCI */ |
Ilya Yanok | 29321c0 | 2012-02-06 03:55:33 +0000 | [diff] [blame] | 59 | #define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 147 |
| 60 | |
Derald D. Woods | 4b37928 | 2017-12-29 10:37:32 -0600 | [diff] [blame] | 61 | /* Enable Multi Bus support for I2C */ |
| 62 | #define CONFIG_I2C_MULTI_BUS |
Tom Rini | df4dbb5 | 2014-04-03 15:17:15 -0400 | [diff] [blame] | 63 | |
Derald D. Woods | 4b37928 | 2017-12-29 10:37:32 -0600 | [diff] [blame] | 64 | /* DSS Support */ |
| 65 | #define CONFIG_VIDEO_OMAP3 |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 66 | |
Derald D. Woods | 4b37928 | 2017-12-29 10:37:32 -0600 | [diff] [blame] | 67 | /* TWL4030 LED Support */ |
| 68 | #define CONFIG_TWL4030_LED |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 69 | |
Derald D. Woods | d233ccb | 2018-02-26 17:52:58 -0600 | [diff] [blame] | 70 | /* Environment */ |
| 71 | #define CONFIG_ENV_SIZE SZ_128K |
Guillaume GARDET | c721fd6 | 2016-10-25 18:50:32 +0200 | [diff] [blame] | 72 | |
Derald D. Woods | d233ccb | 2018-02-26 17:52:58 -0600 | [diff] [blame] | 73 | #define CONFIG_PREBOOT "usb start" |
| 74 | |
| 75 | #define MEM_LAYOUT_ENV_SETTINGS \ |
| 76 | DEFAULT_LINUX_BOOT_ENV |
| 77 | |
| 78 | #define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \ |
| 79 | "bootcmd_" #devtypel #instance "=" \ |
| 80 | "setenv mmcdev " #instance "; " \ |
| 81 | "run mmcboot\0" |
| 82 | #define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \ |
| 83 | #devtypel #instance " " |
| 84 | |
| 85 | #if defined(CONFIG_NAND) |
| 86 | |
| 87 | #define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \ |
| 88 | "bootcmd_" #devtypel #instance "=" \ |
| 89 | "if test ${mtdids} = '' || test ${mtdparts} = '' ; then " \ |
| 90 | "echo NAND boot disabled: No mtdids and/or mtdparts; " \ |
| 91 | "else " \ |
| 92 | "run nandboot; " \ |
| 93 | "fi\0" |
| 94 | #define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \ |
| 95 | #devtypel #instance " " |
| 96 | |
| 97 | #define BOOT_TARGET_DEVICES(func) \ |
| 98 | func(MMC, mmc, 0) \ |
| 99 | func(LEGACY_MMC, legacy_mmc, 0) \ |
| 100 | func(UBIFS, ubifs, 0) \ |
| 101 | func(NAND, nand, 0) |
| 102 | |
| 103 | #else /* !CONFIG_NAND */ |
| 104 | |
| 105 | #define BOOT_TARGET_DEVICES(func) \ |
| 106 | func(MMC, mmc, 0) \ |
| 107 | func(LEGACY_MMC, legacy_mmc, 0) |
| 108 | |
| 109 | #endif /* CONFIG_NAND */ |
Guillaume GARDET | c721fd6 | 2016-10-25 18:50:32 +0200 | [diff] [blame] | 110 | |
| 111 | #include <config_distro_bootcmd.h> |
| 112 | |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 113 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
Derald D. Woods | d233ccb | 2018-02-26 17:52:58 -0600 | [diff] [blame] | 114 | MEM_LAYOUT_ENV_SETTINGS \ |
| 115 | "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ |
Nishanth Menon | 2ade496 | 2013-07-15 07:11:32 -0500 | [diff] [blame] | 116 | "fdt_high=0xffffffff\0" \ |
Koen Kooi | 27b8c8f | 2011-11-27 03:51:06 +0000 | [diff] [blame] | 117 | "console=ttyO2,115200n8\0" \ |
Derald D. Woods | d233ccb | 2018-02-26 17:52:58 -0600 | [diff] [blame] | 118 | "bootdir=/boot\0" \ |
| 119 | "bootenv=uEnv.txt\0" \ |
| 120 | "bootfile=zImage\0" \ |
| 121 | "bootpart=0:2\0" \ |
| 122 | "bootubivol=rootfs\0" \ |
| 123 | "bootubipart=rootfs\0" \ |
| 124 | "usbtty=cdc_acm\0" \ |
Koen Kooi | f6e593b | 2011-04-18 17:28:32 -0400 | [diff] [blame] | 125 | "mpurate=auto\0" \ |
Peter Meerwald | 847b83d | 2012-07-02 03:43:31 +0000 | [diff] [blame] | 126 | "buddy=none\0" \ |
Jason Kridner | c522eac | 2011-09-03 23:37:24 -0400 | [diff] [blame] | 127 | "camera=none\0" \ |
Steve Sakoman | 13d2cb9 | 2009-10-10 14:29:37 -0400 | [diff] [blame] | 128 | "vram=12M\0" \ |
Jason Kridner | f4b36ea | 2011-07-23 00:01:14 -0500 | [diff] [blame] | 129 | "dvimode=640x480MR-16@60\0" \ |
Steve Sakoman | 13d2cb9 | 2009-10-10 14:29:37 -0400 | [diff] [blame] | 130 | "defaultdisplay=dvi\0" \ |
Derald D. Woods | d233ccb | 2018-02-26 17:52:58 -0600 | [diff] [blame] | 131 | "defaultargs=setenv defargs " \ |
Steve Sakoman | 5af3246 | 2010-02-03 14:39:14 -0800 | [diff] [blame] | 132 | "mpurate=${mpurate} " \ |
Koen Kooi | b166031 | 2011-08-11 00:39:28 -0500 | [diff] [blame] | 133 | "buddy=${buddy} "\ |
Jason Kridner | c522eac | 2011-09-03 23:37:24 -0400 | [diff] [blame] | 134 | "camera=${camera} "\ |
Steve Sakoman | 13d2cb9 | 2009-10-10 14:29:37 -0400 | [diff] [blame] | 135 | "vram=${vram} " \ |
| 136 | "omapfb.mode=dvi:${dvimode} " \ |
Derald D. Woods | d233ccb | 2018-02-26 17:52:58 -0600 | [diff] [blame] | 137 | "omapdss.def_disp=${defaultdisplay}\0" \ |
| 138 | "optargs=\0" \ |
Nishanth Menon | 2ade496 | 2013-07-15 07:11:32 -0500 | [diff] [blame] | 139 | "findfdt=" \ |
| 140 | "if test $beaglerev = AxBx; then " \ |
| 141 | "setenv fdtfile omap3-beagle.dtb; fi; " \ |
| 142 | "if test $beaglerev = Cx; then " \ |
| 143 | "setenv fdtfile omap3-beagle.dtb; fi; " \ |
Robert Nelson | 5c9038b | 2014-01-17 09:51:28 -0600 | [diff] [blame] | 144 | "if test $beaglerev = C4; then " \ |
| 145 | "setenv fdtfile omap3-beagle.dtb; fi; " \ |
Nishanth Menon | 2ade496 | 2013-07-15 07:11:32 -0500 | [diff] [blame] | 146 | "if test $beaglerev = xMAB; then " \ |
Robert Nelson | 3d47ffb | 2014-05-02 15:14:39 -0500 | [diff] [blame] | 147 | "setenv fdtfile omap3-beagle-xm-ab.dtb; fi; " \ |
Nishanth Menon | 2ade496 | 2013-07-15 07:11:32 -0500 | [diff] [blame] | 148 | "if test $beaglerev = xMC; then " \ |
| 149 | "setenv fdtfile omap3-beagle-xm.dtb; fi; " \ |
| 150 | "if test $fdtfile = undefined; then " \ |
Derald D. Woods | d233ccb | 2018-02-26 17:52:58 -0600 | [diff] [blame] | 151 | "echo WARNING: Could not determine device tree to use; fi\0" \ |
| 152 | "mmcdev=0\0" \ |
| 153 | "mmcpart=2\0" \ |
| 154 | "mmcroot=/dev/mmcblk0p2 rw\0" \ |
| 155 | "mmcrootfstype=ext4 rootwait\0" \ |
| 156 | "mmcargs=run defaultargs; setenv bootargs console=${console} " \ |
| 157 | "${mtdparts} " \ |
| 158 | "${defargs} " \ |
| 159 | "${optargs} " \ |
| 160 | "root=${mmcroot} " \ |
| 161 | "rootfstype=${mmcrootfstype}\0" \ |
| 162 | "userbutton_xm=gpio input 4;\0" \ |
| 163 | "userbutton_nonxm=gpio input 7;\0" \ |
| 164 | "userbutton=if gpio input 173; then " \ |
| 165 | "run userbutton_xm; " \ |
| 166 | "else " \ |
| 167 | "run userbutton_nonxm; " \ |
| 168 | "fi;\0" \ |
| 169 | "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \ |
| 170 | "ext4bootenv=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootenv}\0" \ |
| 171 | "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \ |
| 172 | "env import -t ${loadaddr} ${filesize}\0" \ |
| 173 | "mmcbootenv=setenv bootpart ${mmcdev}:${mmcpart}; " \ |
| 174 | "mmc dev ${mmcdev}; " \ |
| 175 | "if mmc rescan; then " \ |
| 176 | "if run userbutton; then " \ |
| 177 | "setenv bootenv uEnv.txt;" \ |
| 178 | "else " \ |
| 179 | "setenv bootenv user.txt;" \ |
| 180 | "fi;" \ |
| 181 | "run loadbootenv && run importbootenv; " \ |
| 182 | "run ext4bootenv && run importbootenv; " \ |
| 183 | "if test -n $uenvcmd; then " \ |
| 184 | "echo Running uenvcmd ...; " \ |
| 185 | "run uenvcmd; " \ |
| 186 | "fi; " \ |
| 187 | "fi\0" \ |
Robert Nelson | 4fa2427 | 2014-05-02 15:15:03 -0500 | [diff] [blame] | 188 | "validatefdt=" \ |
| 189 | "if test $beaglerev = xMAB; then " \ |
| 190 | "if test ! -e mmc ${bootpart} ${bootdir}/${fdtfile}; then " \ |
| 191 | "setenv fdtfile omap3-beagle-xm.dtb; " \ |
| 192 | "fi; " \ |
| 193 | "fi; \0" \ |
Derald D. Woods | d233ccb | 2018-02-26 17:52:58 -0600 | [diff] [blame] | 194 | "loadimage=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ |
| 195 | "loaddtb=run validatefdt; ext4load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ |
| 196 | "mmcboot=run mmcbootenv; " \ |
| 197 | "if run loadimage && run loaddtb; then " \ |
| 198 | "echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} ...; " \ |
| 199 | "run mmcargs; " \ |
| 200 | "if test ${bootfile} = uImage; then " \ |
| 201 | "bootm ${loadaddr} - ${fdtaddr}; " \ |
| 202 | "fi; " \ |
| 203 | "if test ${bootfile} = zImage; then " \ |
| 204 | "bootz ${loadaddr} - ${fdtaddr}; " \ |
| 205 | "fi; " \ |
| 206 | "fi\0" \ |
| 207 | "nandroot=ubi0:rootfs ubi.mtd=rootfs rw\0" \ |
| 208 | "nandrootfstype=ubifs rootwait\0" \ |
| 209 | "nandargs=run defaultargs; setenv bootargs console=${console} " \ |
| 210 | "${mtdparts} " \ |
| 211 | "${defargs} " \ |
Jason Kridner | f4b36ea | 2011-07-23 00:01:14 -0500 | [diff] [blame] | 212 | "${optargs} " \ |
Derald D. Woods | d233ccb | 2018-02-26 17:52:58 -0600 | [diff] [blame] | 213 | "root=${nandroot} " \ |
| 214 | "rootfstype=${nandrootfstype}\0" \ |
| 215 | "nandboot=if nand read ${loadaddr} kernel && nand read ${fdtaddr} dtb; then " \ |
| 216 | "echo Booting uImage from NAND MTD 'kernel' partition ...; " \ |
| 217 | "run nandargs; " \ |
| 218 | "bootm ${loadaddr} - ${fdtaddr}; " \ |
| 219 | "fi\0" \ |
| 220 | "loadramdisk=ext4load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \ |
| 221 | "ramdisk=rootfs.ext2.gz.uboot\0" \ |
| 222 | "ramdisk_size=16384\0" \ |
| 223 | "ramroot=/dev/ram rw\0" \ |
| 224 | "ramrootfstype=ext2\0" \ |
| 225 | "ramargs=run defaultargs; setenv bootargs console=${console} " \ |
| 226 | "${mtdparts} " \ |
| 227 | "${defargs} " \ |
| 228 | "${optargs} " \ |
| 229 | "root=${ramroot} ramdisk_size=${ramdisk_size} " \ |
| 230 | "rootfstype=${ramrootfstype}\0" \ |
| 231 | "ramboot=run mmcbootenv; " \ |
| 232 | "if run loadimage && run loaddtb && run loadramdisk; then " \ |
| 233 | "echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} w/ramdisk ...; " \ |
| 234 | "run ramargs; " \ |
| 235 | "bootz ${loadaddr} ${rdaddr} ${fdtaddr}; " \ |
| 236 | "fi\0" \ |
Guillaume GARDET | c721fd6 | 2016-10-25 18:50:32 +0200 | [diff] [blame] | 237 | BOOTENV |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 238 | |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 239 | #endif /* __CONFIG_H */ |