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