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