diff --git a/v2017.07-rc2/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch b/v2017.07-rc2/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..194b626 --- /dev/null +++ b/v2017.07-rc2/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,669 @@ +From 98a93a9035efadfdfb768284852bfb853910b597 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Mon, 19 Jun 2017 21:58:12 -0500 +Subject: [PATCH] am335x_evm: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + board/ti/am335x/board.c | 31 +++++- + board/ti/am335x/board.h | 20 ++++ + board/ti/am335x/mux.c | 9 +- + configs/am335x_boneblack_defconfig | 4 +- + configs/am335x_evm_defconfig | 27 ++--- + include/configs/am335x_evm.h | 61 +++++++--- + include/configs/ti_armv7_common.h | 220 +++++++++++++++++++++++++++++++++++++ + include/environment/ti/mmc.h | 56 ++++++++-- + 8 files changed, 386 insertions(+), 42 deletions(-) + +diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c +index 0a16529b5f..e8a376e977 100644 +--- a/board/ti/am335x/board.c ++++ b/board/ti/am335x/board.c +@@ -612,6 +612,24 @@ static struct clk_synth cdce913_data = { + */ + int board_init(void) + { ++ u32 sys_reboot; ++ ++ sys_reboot = readl(PRM_RSTST); ++ if (sys_reboot & (1 << 9)) ++ puts("Reset Source: IcePick reset has occurred.\n"); ++ ++ if (sys_reboot & (1 << 5)) ++ puts("Reset Source: Global external warm reset has occurred.\n"); ++ ++ if (sys_reboot & (1 << 4)) ++ puts("Reset Source: watchdog reset has occurred.\n"); ++ ++ if (sys_reboot & (1 << 1)) ++ puts("Reset Source: Global warm SW reset has occurred.\n"); ++ ++ if (sys_reboot & (1 << 0)) ++ puts("Reset Source: Power-on reset has occurred.\n"); ++ + #if defined(CONFIG_HW_WATCHDOG) + hw_watchdog_init(); + #endif +@@ -708,6 +726,8 @@ int board_late_init(void) + char *name = NULL; + + if (board_is_bone_lt()) { ++ puts("Board: BeagleBone Black\n"); ++ name = "A335BNLT"; + /* BeagleBoard.org BeagleBone Black Wireless: */ + if (!strncmp(board_ti_get_rev(), "BWA", 3)) { + name = "BBBW"; +@@ -720,6 +740,10 @@ int board_late_init(void) + if (!strncmp(board_ti_get_rev(), "BLA", 3)) { + name = "BBBL"; + } ++ if (!strncmp(board_ti_get_rev(), "SE", 2)) { ++ puts("Model: SanCloud BeagleBone Enhanced\n"); ++ name = "SBBE"; ++ } + } + + if (board_is_bbg1()) +@@ -859,18 +883,21 @@ int board_eth_init(bd_t *bis) + (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD)) + + #ifdef CONFIG_DRIVER_TI_CPSW +- if (board_is_bone() || board_is_bone_lt() || ++ if (board_is_bone() || (board_is_bone_lt() && !board_is_bone_lt_enhanced() && !board_is_m10a()) || + board_is_idk()) { ++ puts("eth0: MII MODE\n"); + writel(MII_MODE_ENABLE, &cdev->miisel); + cpsw_slaves[0].phy_if = cpsw_slaves[1].phy_if = + PHY_INTERFACE_MODE_MII; + } else if (board_is_icev2()) { ++ puts("eth0: icev2: RGMII MODE\n"); + writel(RMII_MODE_ENABLE | RMII_CHIPCKL_ENABLE, &cdev->miisel); + cpsw_slaves[0].phy_if = PHY_INTERFACE_MODE_RMII; + cpsw_slaves[1].phy_if = PHY_INTERFACE_MODE_RMII; + cpsw_slaves[0].phy_addr = 1; + cpsw_slaves[1].phy_addr = 3; + } else { ++ puts("eth0: RGMII MODE\n"); + writel((RGMII_MODE_ENABLE | RGMII_INT_DELAY), &cdev->miisel); + cpsw_slaves[0].phy_if = cpsw_slaves[1].phy_if = + PHY_INTERFACE_MODE_RGMII; +@@ -895,7 +922,7 @@ int board_eth_init(bd_t *bis) + #define AR8051_DEBUG_RGMII_CLK_DLY_REG 0x5 + #define AR8051_RGMII_TX_CLK_DLY 0x100 + +- if (board_is_evm_sk() || board_is_gp_evm()) { ++ if (board_is_evm_sk() || board_is_gp_evm() || board_is_bone_lt_enhanced() || board_is_m10a()) { + const char *devname; + devname = miiphy_get_current_dev(); + +diff --git a/board/ti/am335x/board.h b/board/ti/am335x/board.h +index e13fcff02a..93d7c04d08 100644 +--- a/board/ti/am335x/board.h ++++ b/board/ti/am335x/board.h +@@ -34,11 +34,31 @@ static inline int board_is_bone_lt(void) + return board_ti_is("A335BNLT"); + } + ++static inline int board_is_bbbw(void) ++{ ++ return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BW", 2); ++} ++ ++static inline int board_is_blue(void) ++{ ++ return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BLA", 3); ++} ++ + static inline int board_is_bbg1(void) + { + return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BBG1", 4); + } + ++static inline int board_is_bone_lt_enhanced(void) ++{ ++ return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "SE", 2); ++} ++ ++static inline int board_is_m10a(void) ++{ ++ return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "M10A", 4); ++} ++ + static inline int board_is_beaglebonex(void) + { + return board_is_bone() || board_is_bone_lt() || board_is_bbg1(); +diff --git a/board/ti/am335x/mux.c b/board/ti/am335x/mux.c +index ad85b3a19a..6d65e99a1a 100644 +--- a/board/ti/am335x/mux.c ++++ b/board/ti/am335x/mux.c +@@ -381,7 +381,14 @@ void enable_board_pin_mux(void) + configure_module_pin_mux(mmc0_pin_mux_sk_evm); + } else if (board_is_bone_lt()) { + /* Beaglebone LT pinmux */ +- configure_module_pin_mux(mii1_pin_mux); ++ if(board_is_bone_lt_enhanced() || board_is_m10a()) { ++ /* SanCloud Beaglebone LT Enhanced pinmux */ ++ configure_module_pin_mux(rgmii1_pin_mux); ++ } ++ else { ++ /* Beaglebone LT pinmux */ ++ configure_module_pin_mux(mii1_pin_mux); ++ } + configure_module_pin_mux(mmc0_pin_mux); + #if defined(CONFIG_NAND) && defined(CONFIG_EMMC_BOOT) + configure_module_pin_mux(nand_pin_mux); +diff --git a/configs/am335x_boneblack_defconfig b/configs/am335x_boneblack_defconfig +index 7bfdfa8341..9eb413748b 100644 +--- a/configs/am335x_boneblack_defconfig ++++ b/configs/am335x_boneblack_defconfig +@@ -5,7 +5,6 @@ CONFIG_AM33XX=y + # CONFIG_SPL_NAND_SUPPORT is not set + CONFIG_SPL_STACK_R_ADDR=0x82000000 + CONFIG_DISTRO_DEFAULTS=y +-CONFIG_SYS_EXTRA_OPTIONS="EMMC_BOOT" + CONFIG_SYS_CONSOLE_INFO_QUIET=y + CONFIG_VERSION_VARIABLE=y + CONFIG_ARCH_MISC_INIT=y +@@ -19,6 +18,7 @@ CONFIG_AUTOBOOT_DELAY_STR="d" + CONFIG_AUTOBOOT_STOP_STR=" " + # CONFIG_CMD_IMLS is not set + # CONFIG_CMD_FLASH is not set ++CONFIG_CMD_USB_MASS_STORAGE=y + # CONFIG_CMD_SETEXPR is not set + CONFIG_DFU_TFTP=y + CONFIG_DFU_MMC=y +@@ -37,3 +37,5 @@ CONFIG_G_DNL_MANUFACTURER="Texas Instruments" + CONFIG_G_DNL_VENDOR_NUM=0x0451 + CONFIG_G_DNL_PRODUCT_NUM=0xd022 + CONFIG_OF_LIBFDT=y ++CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_PHY_MSCC=y +diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig +index ff1e43f226..9eb413748b 100644 +--- a/configs/am335x_evm_defconfig ++++ b/configs/am335x_evm_defconfig +@@ -2,47 +2,40 @@ CONFIG_ARM=y + CONFIG_ARCH_OMAP2PLUS=y + CONFIG_TI_COMMON_CMD_OPTIONS=y + CONFIG_AM33XX=y ++# CONFIG_SPL_NAND_SUPPORT is not set + CONFIG_SPL_STACK_R_ADDR=0x82000000 +-CONFIG_DEFAULT_DEVICE_TREE="am335x-evm" + CONFIG_DISTRO_DEFAULTS=y +-CONFIG_SPL_LOAD_FIT=y +-CONFIG_SYS_EXTRA_OPTIONS="NAND" + CONFIG_SYS_CONSOLE_INFO_QUIET=y + CONFIG_VERSION_VARIABLE=y + CONFIG_ARCH_MISC_INIT=y + CONFIG_SPL=y + CONFIG_SPL_STACK_R=y +-CONFIG_SPL_MTD_SUPPORT=y + CONFIG_SPL_MUSB_NEW_SUPPORT=y + CONFIG_SPL_OS_BOOT=y ++CONFIG_AUTOBOOT_KEYED=y ++CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n" ++CONFIG_AUTOBOOT_DELAY_STR="d" ++CONFIG_AUTOBOOT_STOP_STR=" " + # CONFIG_CMD_IMLS is not set + # CONFIG_CMD_FLASH is not set ++CONFIG_CMD_USB_MASS_STORAGE=y + # CONFIG_CMD_SETEXPR is not set +-CONFIG_OF_CONTROL=y +-CONFIG_OF_LIST="am335x-evm am335x-bone am335x-boneblack am335x-evmsk am335x-bonegreen am335x-icev2" +-# CONFIG_BLK is not set ++CONFIG_DFU_TFTP=y + CONFIG_DFU_MMC=y +-CONFIG_DFU_NAND=y + CONFIG_DFU_RAM=y +-CONFIG_DM_I2C=y +-CONFIG_MISC=y +-CONFIG_DM_MMC=y + CONFIG_MMC_OMAP_HS=y + CONFIG_SPI_FLASH=y + CONFIG_SPI_FLASH_WINBOND=y +-CONFIG_DM_ETH=y + CONFIG_SYS_NS16550=y +-CONFIG_TIMER=y +-CONFIG_OMAP_TIMER=y + CONFIG_USB=y +-CONFIG_DM_USB=y + CONFIG_USB_MUSB_HOST=y + CONFIG_USB_MUSB_GADGET=y +-CONFIG_USB_MUSB_TI=y + CONFIG_USB_STORAGE=y + CONFIG_USB_GADGET=y + CONFIG_USB_GADGET_DOWNLOAD=y + CONFIG_G_DNL_MANUFACTURER="Texas Instruments" + CONFIG_G_DNL_VENDOR_NUM=0x0451 + CONFIG_G_DNL_PRODUCT_NUM=0xd022 +-CONFIG_RSA=y ++CONFIG_OF_LIBFDT=y ++CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_PHY_MSCC=y +diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h +index 0c6d2880da..05b2902450 100644 +--- a/include/configs/am335x_evm.h ++++ b/include/configs/am335x_evm.h +@@ -17,6 +17,7 @@ + #define __CONFIG_AM335X_EVM_H + + #include ++#define CONFIG_ENV_IS_NOWHERE + + #ifndef CONFIG_SPL_BUILD + # define CONFIG_TIMESTAMP +@@ -60,9 +61,14 @@ + + #define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel #instance "=" \ ++ "gpio clear 56; " \ ++ "gpio clear 55; " \ ++ "gpio clear 54; " \ ++ "gpio set 53; " \ ++ "setenv devtype mmc; " \ + "setenv mmcdev " #instance"; "\ +- "setenv bootpart " #instance":2 ; "\ +- "run mmcboot\0" ++ "setenv bootpart " #instance":1 ; "\ ++ "run boot\0" + + #define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \ + #devtypel #instance " " +@@ -79,7 +85,6 @@ + func(LEGACY_MMC, legacy_mmc, 0) \ + func(MMC, mmc, 1) \ + func(LEGACY_MMC, legacy_mmc, 1) \ +- func(NAND, nand, 0) \ + func(PXE, pxe, na) \ + func(DHCP, dhcp, na) + +@@ -136,18 +141,43 @@ + "run ramargs; " \ + "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \ + "findfdt="\ ++ "echo board_name=[$board_name] ...; " \ + "if test $board_name = A335BONE; then " \ +- "setenv fdtfile am335x-bone.dtb; fi; " \ ++ "setenv fdtfile am335x-bone.dtb; setenv fdtbase am335x-bone; fi; " \ + "if test $board_name = A335BNLT; then " \ +- "setenv fdtfile am335x-boneblack.dtb; fi; " \ ++ "echo board_rev=[$board_rev] ...; " \ ++ "if test $board_rev = GH01; then " \ ++ "setenv fdtfile am335x-boneblack.dtb; setenv fdtbase am335x-boneblack; " \ ++ "elif test $board_rev = BBG1; then " \ ++ "setenv fdtfile am335x-bonegreen.dtb; setenv fdtbase am335x-bonegreen; " \ ++ "elif test $board_rev = BP00; then " \ ++ "setenv fdtfile am335x-pocketbone.dtb; setenv fdtbase am335x-pocketbone; " \ ++ "elif test $board_rev = GW1A; then " \ ++ "setenv fdtfile am335x-bonegreen-wireless.dtb; setenv fdtbase am335x-bonegreen-wireless; " \ ++ "elif test $board_rev = AIA0; then " \ ++ "setenv fdtfile am335x-abbbi.dtb; setenv fdtbase am335x-abbbi; " \ ++ "elif test $board_rev = EIA0; then " \ ++ "setenv fdtfile am335x-boneblack.dtb; setenv fdtbase am335x-boneblack; " \ ++ "elif test $board_rev = SE0A; then " \ ++ "setenv fdtfile am335x-sancloud-bbe.dtb; setenv fdtbase am335x-sancloud-bbe; " \ ++ "elif test $board_rev = ME06; then " \ ++ "setenv fdtfile am335x-bonegreen.dtb; setenv fdtbase am335x-bonegreen; " \ ++ "elif test $board_rev = M10A; then " \ ++ "setenv fdtfile am335x-vsc8531bbb.dtb; setenv fdtbase am335x-vsc8531bbb; " \ ++ "else " \ ++ "setenv fdtfile am335x-boneblack.dtb; setenv fdtbase am335x-boneblack; " \ ++ "fi; " \ ++ "fi; " \ + "if test $board_name = BBBW; then " \ +- "setenv fdtfile am335x-boneblack-wireless.dtb; fi; " \ ++ "setenv fdtfile am335x-boneblack-wireless.dtb; setenv fdtbase am335x-boneblack-wireless; fi; " \ + "if test $board_name = BBG1; then " \ +- "setenv fdtfile am335x-bonegreen.dtb; fi; " \ ++ "setenv fdtfile am335x-bonegreen.dtb; setenv fdtbase am335x-bonegreen; fi; " \ + "if test $board_name = BBGW; then " \ +- "setenv fdtfile am335x-bonegreen-wireless.dtb; fi; " \ ++ "setenv fdtfile am335x-bonegreen-wireless.dtb; setenv fdtbase am335x-bonegreen-wireless; fi; " \ + "if test $board_name = BBBL; then " \ +- "setenv fdtfile am335x-boneblue.dtb; fi; " \ ++ "setenv fdtfile am335x-boneblue.dtb; setenv fdtbase am335x-boneblue; fi; " \ ++ "if test $board_name = SBBE; then " \ ++ "setenv fdtfile am335x-sancloud-bbe.dtb; setenv fdtbase am335x-sancloud-bbe; fi; " \ + "if test $board_name = A33515BB; then " \ + "setenv fdtfile am335x-evm.dtb; fi; " \ + "if test $board_name = A335X_SK; then " \ +@@ -155,13 +185,20 @@ + "if test $board_name = A335_ICE; then " \ + "setenv fdtfile am335x-icev2.dtb; fi; " \ + "if test $fdtfile = undefined; then " \ +- "echo WARNING: Could not determine device tree to use; fi; \0" \ ++ "setenv board_name A335BNLT; " \ ++ "setenv board_rev EMMC; " \ ++ "setenv fdtbase am335x-boneblack-emmc-overlay; " \ ++ "setenv fdtfile am335x-boneblack-emmc-overlay.dtb; " \ ++ "fi; \0" \ + "init_console=" \ + "if test $board_name = A335_ICE; then "\ + "setenv console ttyO3,115200n8;" \ + "else " \ + "setenv console ttyO0,115200n8;" \ + "fi;\0" \ ++ EEWIKI_NFS \ ++ EEWIKI_BOOT \ ++ EEWIKI_UNAME_BOOT \ + NANDARGS \ + NETARGS \ + DFUARGS \ +@@ -280,9 +317,7 @@ + #endif + + #ifdef CONFIG_USB_MUSB_GADGET +-#define CONFIG_USB_ETHER +-#define CONFIG_USB_ETH_RNDIS +-#define CONFIG_USBNET_HOST_ADDR "de:ad:be:af:00:00" ++#define CONFIG_USB_FUNCTION_MASS_STORAGE + #endif /* CONFIG_USB_MUSB_GADGET */ + + /* +diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h +index a4676d3a7f..d85f5fbd4c 100644 +--- a/include/configs/ti_armv7_common.h ++++ b/include/configs/ti_armv7_common.h +@@ -132,6 +132,226 @@ + /* Boot Argument Buffer Size */ + #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE + ++#define EEWIKI_NFS \ ++ "server_ip=192.168.1.100\0" \ ++ "gw_ip=192.168.1.1\0" \ ++ "netmask=255.255.255.0\0" \ ++ "hostname=\0" \ ++ "device=eth0\0" \ ++ "autoconf=off\0" \ ++ "root_dir=/home/userid/targetNFS\0" \ ++ "tftp_dir=\0" \ ++ "nfs_options=,vers=3\0" \ ++ "nfsrootfstype=ext4 rootwait fixrtc\0" \ ++ "nfsargs=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "${cape_disable} " \ ++ "${cape_enable} " \ ++ "${cape_uboot} " \ ++ "root=/dev/nfs rw " \ ++ "rootfstype=${nfsrootfstype} " \ ++ "nfsroot=${nfsroot} " \ ++ "ip=${ip} " \ ++ "${cmdline}\0" \ ++ "nfsboot=echo Booting from ${server_ip} ...; " \ ++ "setenv nfsroot ${server_ip}:${root_dir}${nfs_options}; " \ ++ "setenv ip ${client_ip}:${server_ip}:${gw_ip}:${netmask}:${hostname}:${device}:${autoconf}; " \ ++ "setenv autoload no; " \ ++ "setenv serverip ${server_ip}; " \ ++ "setenv ipaddr ${client_ip}; " \ ++ "tftp ${loadaddr} ${tftp_dir}${bootfile}; " \ ++ "tftp ${fdtaddr} ${tftp_dir}dtbs/${fdtfile}; " \ ++ "run nfsargs; " \ ++ "bootz ${loadaddr} - ${fdtaddr}\0" \ ++ "nfsboot_uname_r=echo Booting from ${server_ip} ...; " \ ++ "setenv nfsroot ${server_ip}:${root_dir}${nfs_options}; " \ ++ "setenv ip ${client_ip}:${server_ip}:${gw_ip}:${netmask}:${hostname}:${device}:${autoconf}; " \ ++ "setenv autoload no; " \ ++ "setenv serverip ${server_ip}; " \ ++ "setenv ipaddr ${client_ip}; " \ ++ "tftp ${loadaddr} ${tftp_dir}vmlinuz-${uname_r}; " \ ++ "tftp ${fdtaddr} ${tftp_dir}dtbs/${uname_r}/${fdtfile}; " \ ++ "run nfsargs; " \ ++ "bootz ${loadaddr} - ${fdtaddr}\0" \ ++ ++#define EEWIKI_BOOT \ ++ "boot=${devtype} dev ${mmcdev}; " \ ++ "if ${devtype} rescan; then " \ ++ "gpio set 54;" \ ++ "setenv bootpart ${mmcdev}:1; " \ ++ "if test -e ${devtype} ${bootpart} /etc/fstab; then " \ ++ "setenv mmcpart 1;" \ ++ "fi; " \ ++ "echo Checking for: /uEnv.txt ...;" \ ++ "if test -e ${devtype} ${bootpart} /uEnv.txt; then " \ ++ "if run loadbootenv; then " \ ++ "gpio set 55;" \ ++ "echo Loaded environment from /uEnv.txt;" \ ++ "run importbootenv;" \ ++ "fi;" \ ++ "if test -n ${cape}; then " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtbase}-${cape}.dtb; then " \ ++ "setenv fdtfile ${fdtbase}-${cape}.dtb; " \ ++ "fi; " \ ++ "echo using: $fdtfile...; " \ ++ "fi; " \ ++ "echo Checking if uenvcmd is set ...;" \ ++ "if test -n ${uenvcmd}; then " \ ++ "gpio set 56; " \ ++ "echo Running uenvcmd ...;" \ ++ "run uenvcmd;" \ ++ "fi;" \ ++ "echo Checking if client_ip is set ...;" \ ++ "if test -n ${client_ip}; then " \ ++ "if test -n ${dtb}; then " \ ++ "setenv fdtfile ${dtb};" \ ++ "echo using ${fdtfile} ...;" \ ++ "fi;" \ ++ "gpio set 56; " \ ++ "if test -n ${uname_r}; then " \ ++ "echo Running nfsboot_uname_r ...;" \ ++ "run nfsboot_uname_r;" \ ++ "fi;" \ ++ "echo Running nfsboot ...;" \ ++ "run nfsboot;" \ ++ "fi;" \ ++ "fi; " \ ++ "echo Checking for: /${script} ...;" \ ++ "if test -e ${devtype} ${bootpart} /${script}; then " \ ++ "gpio set 55;" \ ++ "setenv scriptfile ${script};" \ ++ "run loadbootscript;" \ ++ "echo Loaded script from ${scriptfile};" \ ++ "gpio set 56; " \ ++ "run bootscript;" \ ++ "fi; " \ ++ "echo Checking for: /boot/${script} ...;" \ ++ "if test -e ${devtype} ${bootpart} /boot/${script}; then " \ ++ "gpio set 55;" \ ++ "setenv scriptfile /boot/${script};" \ ++ "run loadbootscript;" \ ++ "echo Loaded script from ${scriptfile};" \ ++ "gpio set 56; " \ ++ "run bootscript;" \ ++ "fi; " \ ++ "echo Checking for: /boot/uEnv.txt ...;" \ ++ "for i in 1 2 3 4 5 6 7 ; do " \ ++ "setenv mmcpart ${i};" \ ++ "setenv bootpart ${mmcdev}:${mmcpart};" \ ++ "if test -e ${devtype} ${bootpart} /boot/uEnv.txt; then " \ ++ "gpio set 55;" \ ++ "load ${devtype} ${bootpart} ${loadaddr} /boot/uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /boot/uEnv.txt;" \ ++ "if test -n ${cape}; then " \ ++ "echo debug: [cape=${cape}] ... ;" \ ++ "setenv fdtfile ${fdtbase}-${cape}.dtb; " \ ++ "echo Using: dtb=${fdtfile} ...;" \ ++ "fi; " \ ++ "if test -n ${dtb}; then " \ ++ "echo debug: [dtb=${dtb}] ... ;" \ ++ "setenv fdtfile ${dtb};" \ ++ "echo Using: dtb=${fdtfile} ...;" \ ++ "fi;" \ ++ "echo Checking if uname_r is set in /boot/uEnv.txt...;" \ ++ "if test -n ${uname_r}; then " \ ++ "gpio set 56; " \ ++ "setenv oldroot /dev/mmcblk${mmcdev}p${mmcpart};" \ ++ "echo Running uname_boot ...;" \ ++ "run uname_boot;" \ ++ "fi;" \ ++ "fi;" \ ++ "done;" \ ++ "fi;\0" \ ++ ++#define EEWIKI_UNAME_BOOT \ ++ "uname_boot="\ ++ "setenv bootdir /boot; " \ ++ "setenv bootfile vmlinuz-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${bootdir}/${bootfile}; then " \ ++ "echo loading ${bootdir}/${bootfile} ...; "\ ++ "run loadimage;" \ ++ "setenv fdtdir /boot/dtbs/${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /usr/lib/linux-image-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtbs; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "if test -e ${devtype} ${bootpart} ${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "echo; echo unable to find [dtb=${fdtfile}] did you name it correctly? ...; " \ ++ "run failumsboot;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi; " \ ++ "setenv rdfile initrd.img-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${bootdir}/${rdfile}; then " \ ++ "echo loading ${bootdir}/${rdfile} ...; "\ ++ "run loadrd;" \ ++ "if test -n ${netinstall_enable}; then " \ ++ "run args_netinstall; run message;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "fi;" \ ++ "if test -n ${uenv_root}; then " \ ++ "run args_uenv_root;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "fi;" \ ++ "if test -n ${uuid}; then " \ ++ "run args_mmc_uuid;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "fi;" \ ++ "run args_mmc_old;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "else " \ ++ "if test -n ${uenv_root}; then " \ ++ "run args_uenv_root;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} - ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} - ${fdtaddr}; " \ ++ "fi;" \ ++ "run args_mmc_old;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} - ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} - ${fdtaddr}; " \ ++ "fi;" \ ++ "fi;\0" \ ++ + /* + * When we have SPI, NOR or NAND flash we expect to be making use of + * mtdparts, both for ease of use in U-Boot and for passing information +diff --git a/include/environment/ti/mmc.h b/include/environment/ti/mmc.h +index 4305ebdaaf..78fb04d5a3 100644 +--- a/include/environment/ti/mmc.h ++++ b/include/environment/ti/mmc.h +@@ -12,20 +12,60 @@ + #define DEFAULT_MMC_TI_ARGS \ + "mmcdev=0\0" \ + "mmcrootfstype=ext4 rootwait\0" \ +- "finduuid=part uuid mmc ${bootpart} uuid\0" \ ++ "finduuid=part uuid ${devtype} ${bootpart} uuid\0" \ + "args_mmc=run finduuid;setenv bootargs console=${console} " \ ++ "${cape_disable} " \ ++ "${cape_enable} " \ ++ "${cape_uboot} " \ ++ "root=PARTUUID=${uuid} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ ++ "args_mmc_old=setenv bootargs console=${console} " \ + "${optargs} " \ +- "root=PARTUUID=${uuid} rw " \ +- "rootfstype=${mmcrootfstype}\0" \ +- "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \ +- "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \ ++ "${cape_disable} " \ ++ "${cape_enable} " \ ++ "${cape_uboot} " \ ++ "root=${oldroot} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ ++ "args_mmc_uuid=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "${cape_disable} " \ ++ "${cape_enable} " \ ++ "${cape_uboot} " \ ++ "root=UUID=${uuid} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ ++ "args_uenv_root=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "${cape_disable} " \ ++ "${cape_enable} " \ ++ "${cape_uboot} " \ ++ "root=${uenv_root} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ ++ "args_netinstall=setenv bootargs ${netinstall_bootargs} " \ ++ "${optargs} " \ ++ "${cape_disable} " \ ++ "${cape_enable} " \ ++ "${cape_uboot} " \ ++ "root=/dev/ram rw " \ ++ "${cmdline}\0" \ ++ "script=boot.scr\0" \ ++ "scriptfile=${script}\0" \ ++ "loadbootscript=load ${devtype} ${bootpart} ${loadaddr} ${scriptfile};\0" \ ++ "bootscript=echo Running bootscript from mmc${bootpart} ...; " \ + "source ${loadaddr}\0" \ + "bootenvfile=uEnv.txt\0" \ +- "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \ ++ "bootenv=uEnv.txt\0" \ ++ "importbootenv=echo Importing environment from ${devtype} ...; " \ + "env import -t ${loadaddr} ${filesize}\0" \ +- "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}\0" \ ++ "loadbootenv=load ${devtype} ${bootpart} ${loadaddr} ${bootenvfile}\0" \ + "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ +- "loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ ++ "loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \ ++ "loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \ ++ "failumsboot=echo; echo FAILSAFE: U-Boot UMS (USB Mass Storage) enabled, media now available over the usb slave port ...; " \ ++ "ums 0 ${devtype} 1;\0" \ + "envboot=mmc dev ${mmcdev}; " \ + "if mmc rescan; then " \ + "echo SD/MMC found on device ${mmcdev};" \ +-- +2.11.0 + diff --git a/v2017.07-rc2/0001-at91sam9x5ek-uEnv.txt-bootz-n-fixes.patch b/v2017.07-rc2/0001-at91sam9x5ek-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..7dfd549 --- /dev/null +++ b/v2017.07-rc2/0001-at91sam9x5ek-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,98 @@ +From ace7d46ba55c9b49359ef81c48631b12e7b68fd0 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Fri, 9 Jun 2017 14:49:55 -0500 +Subject: [PATCH] at91sam9x5ek: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + configs/at91sam9x5ek_mmc_defconfig | 3 ++ + include/configs/at91sam9x5ek.h | 58 ++++++++++++++++++++++++++++++-------- + 2 files changed, 49 insertions(+), 12 deletions(-) + +diff --git a/configs/at91sam9x5ek_mmc_defconfig b/configs/at91sam9x5ek_mmc_defconfig +index fbe11ef6cd..411a1dc630 100644 +--- a/configs/at91sam9x5ek_mmc_defconfig ++++ b/configs/at91sam9x5ek_mmc_defconfig +@@ -21,7 +21,10 @@ CONFIG_CMD_USB=y + # CONFIG_CMD_SETEXPR is not set + CONFIG_CMD_DHCP=y + CONFIG_CMD_PING=y ++CONFIG_CMD_EXT2=y ++CONFIG_CMD_EXT4=y + CONFIG_CMD_FAT=y ++CONFIG_CMD_FS_GENERIC=y + CONFIG_CMD_UBI=y + CONFIG_OF_CONTROL=y + CONFIG_DM=y +diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h +index fd2dbed137..3514e7fb22 100644 +--- a/include/configs/at91sam9x5ek.h ++++ b/include/configs/at91sam9x5ek.h +@@ -154,18 +154,52 @@ + #endif + + #ifdef CONFIG_SYS_USE_MMC +-#define CONFIG_BOOTARGS "mem=128M console=ttyS0,115200 " \ +- "mtdparts=atmel_nand:" \ +- "8M(bootstrap/uboot/kernel)ro,-(rootfs) " \ +- "root=/dev/mmcblk0p2 " \ +- "rw rootfstype=ext4 rootwait" +-#else +-#define CONFIG_BOOTARGS \ +- "console=ttyS0,115200 earlyprintk " \ +- "mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro," \ +- "256k(env),256k(env_redundant),256k(spare)," \ +- "512k(dtb),6M(kernel)ro,-(rootfs) " \ +- "rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs rw" ++#define CONFIG_SUPPORT_RAW_INITRD ++#define CONFIG_EXTRA_ENV_SETTINGS \ ++ "initrd_high=0xffffffff\0" \ ++ "fdt_high=0xffffffff\0" \ ++ "loadaddr=0x22000000\0" \ ++ "fdtaddr=0x27FF0000\0" \ ++ "fdtfile=/dtbs/at91sam9g25ek.dtb\0" \ ++ "console=ttyS0,115200n8\0" \ ++ "optargs=\0" \ ++ "video=\0" \ ++ "mmcdev=0\0" \ ++ "mmcpart=1\0" \ ++ "mmcroot=/dev/mmcblk0p2 ro\0" \ ++ "mmcrootfstype=ext4 rootwait\0" \ ++ "mmcargs=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "root=${mmcroot} " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "video=${video}\0" \ ++ "loadbootenv=load mmc ${mmcdev}:${mmcpart} ${loadaddr} uEnv.txt\0" \ ++ "importbootenv=echo Importing environment from mmc (uEnv.txt)...; " \ ++ "env import -t ${loadaddr} ${filesize}\0" \ ++ "loadzimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} zImage\0" \ ++ "loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdtaddr} ${fdtfile}\0" \ ++ "mmcboot=echo Booting from mmc ...; " \ ++ "run mmcargs; " \ ++ "bootz ${loadaddr} - ${fdtaddr}\0" ++ ++#define CONFIG_BOOTCOMMAND \ ++ "mmc dev ${mmcdev};" \ ++ "if mmc rescan; then " \ ++ "echo SD/MMC found on device ${mmcdev};" \ ++ "if run loadbootenv; then " \ ++ "run importbootenv;" \ ++ "fi;" \ ++ "echo Checking if uenvcmd is set ...;" \ ++ "if test -n $uenvcmd; then " \ ++ "echo Running uenvcmd ...;" \ ++ "run uenvcmd;" \ ++ "fi;" \ ++ "echo Running default loadzimage ...;" \ ++ "if run loadzimage; then " \ ++ "run loadfdt;" \ ++ "run mmcboot;" \ ++ "fi;" \ ++ "fi;" + #endif + + #define CONFIG_SYS_CBSIZE 256 +-- +2.11.0 + diff --git a/v2017.07-rc2/0001-de0_nano-fixes.patch b/v2017.07-rc2/0001-de0_nano-fixes.patch new file mode 100644 index 0000000..077796f --- /dev/null +++ b/v2017.07-rc2/0001-de0_nano-fixes.patch @@ -0,0 +1,34 @@ +From 79057410fbc162d86a5ed9d210c8a4a775b49ca5 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Mon, 8 May 2017 15:26:20 -0500 +Subject: [PATCH] de0_nano fixes + +Signed-off-by: Robert Nelson +--- + configs/socfpga_de0_nano_soc_defconfig | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/configs/socfpga_de0_nano_soc_defconfig b/configs/socfpga_de0_nano_soc_defconfig +index 0697e2ec37..3992658924 100644 +--- a/configs/socfpga_de0_nano_soc_defconfig ++++ b/configs/socfpga_de0_nano_soc_defconfig +@@ -8,7 +8,7 @@ CONFIG_FIT=y + CONFIG_SYS_CONSOLE_IS_IN_ENV=y + CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y + CONFIG_SYS_CONSOLE_ENV_OVERWRITE=y +-CONFIG_DEFAULT_FDT_FILE="socfpga_cyclone5_de0_nano_soc.dtb" ++CONFIG_DEFAULT_FDT_FILE="socfpga_cyclone5_de0_sockit.dtb" + CONFIG_VERSION_VARIABLE=y + # CONFIG_DISPLAY_BOARDINFO is not set + CONFIG_SPL=y +@@ -21,6 +21,7 @@ CONFIG_CMD_ASKENV=y + CONFIG_CMD_GREPENV=y + # CONFIG_CMD_FLASH is not set + CONFIG_CMD_MMC=y ++CONFIG_CMD_PART=y + CONFIG_CMD_SF=y + CONFIG_CMD_SPI=y + CONFIG_CMD_I2C=y +-- +2.11.0 + diff --git a/v2017.07-rc2/0001-ls1021atwr-fixes.patch b/v2017.07-rc2/0001-ls1021atwr-fixes.patch new file mode 100644 index 0000000..d6de956 --- /dev/null +++ b/v2017.07-rc2/0001-ls1021atwr-fixes.patch @@ -0,0 +1,109 @@ +From d36d1c7b926f123553ad877e5384eba91fa40196 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Fri, 9 Jun 2017 14:51:43 -0500 +Subject: [PATCH] ls1021atwr fixes + +Signed-off-by: Robert Nelson +--- + configs/ls1021atwr_sdcard_qspi_defconfig | 4 +++ + include/configs/ls1021atwr.h | 43 +++++++++++++++++++++++++++----- + 2 files changed, 41 insertions(+), 6 deletions(-) + +diff --git a/configs/ls1021atwr_sdcard_qspi_defconfig b/configs/ls1021atwr_sdcard_qspi_defconfig +index 5ccfc96e9d..2618a58b99 100644 +--- a/configs/ls1021atwr_sdcard_qspi_defconfig ++++ b/configs/ls1021atwr_sdcard_qspi_defconfig +@@ -6,6 +6,7 @@ CONFIG_SPL_MMC_SUPPORT=y + CONFIG_SPL_SERIAL_SUPPORT=y + CONFIG_SPL_WATCHDOG_SUPPORT=y + CONFIG_VIDEO=y ++CONFIG_DISTRO_DEFAULTS=y + CONFIG_DEFAULT_DEVICE_TREE="ls1021a-twr-duart" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +@@ -39,7 +40,10 @@ CONFIG_CMD_MII=y + CONFIG_CMD_PING=y + CONFIG_CMD_BMP=y + CONFIG_CMD_EXT2=y ++CONFIG_CMD_EXT4=y ++CONFIG_CMD_EXT4_WRITE=y + CONFIG_CMD_FAT=y ++CONFIG_CMD_FS_GENERIC=y + # CONFIG_SPL_EFI_PARTITION is not set + CONFIG_OF_CONTROL=y + CONFIG_DM=y +diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h +index 067ef4df93..91bfc22755 100644 +--- a/include/configs/ls1021atwr.h ++++ b/include/configs/ls1021atwr.h +@@ -7,6 +7,8 @@ + #ifndef __CONFIG_H + #define __CONFIG_H + ++#include ++ + #define CONFIG_ARMV7_PSCI_1_0 + + #define CONFIG_ARMV7_SECURE_BASE OCRAM_BASE_S_ADDR +@@ -135,6 +137,10 @@ + #define CONFIG_SYS_TEXT_BASE 0x40100000 + #endif + ++#ifndef CONFIG_LOADADDR ++#define CONFIG_LOADADDR 0x82000000 ++#endif ++ + #ifndef CONFIG_SYS_TEXT_BASE + #define CONFIG_SYS_TEXT_BASE 0x60100000 + #endif +@@ -370,16 +376,41 @@ + + #ifdef CONFIG_LPUART + #define CONFIG_EXTRA_ENV_SETTINGS \ +- "bootargs=root=/dev/ram0 rw console=ttyLP0,115200\0" \ +- "initrd_high=0xffffffff\0" \ +- "fdt_high=0xffffffff\0" ++ "console=ttyLP0,115200\0" \ ++ "ftdfile=ls1021a-twr.dtb\0" \ ++ "initrd_high=0xffffffff\0" \ ++ "fdt_high=0xffffffff\0" \ ++ "fdt_addr_r=0x8f000000\0" \ ++ "fdt_addr=0x8f000000\0" \ ++ "findfdt=setenv fdtfile ls1021a-twr.dtb; \0" \ ++ "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ ++ "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ ++ "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \ ++ BOOTENV + #else + #define CONFIG_EXTRA_ENV_SETTINGS \ +- "bootargs=root=/dev/ram0 rw console=ttyS0,115200\0" \ +- "initrd_high=0xffffffff\0" \ +- "fdt_high=0xffffffff\0" ++ "console=ttyS0,115200\0" \ ++ "ftdfile=ls1021a-twr.dtb\0" \ ++ "initrd_high=0xffffffff\0" \ ++ "fdt_high=0xffffffff\0" \ ++ "fdt_addr_r=0x8f000000\0" \ ++ "fdt_addr=0x8f000000\0" \ ++ "findfdt=setenv fdtfile ls1021a-twr.dtb; \0" \ ++ "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ ++ "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ ++ "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \ ++ BOOTENV + #endif + ++#define BOOT_TARGET_DEVICES(func) \ ++ func(MMC, mmc, 0) ++ ++#define CONFIG_BOOTCOMMAND \ ++ "run findfdt; " \ ++ "run distro_bootcmd" ++ ++#include ++ + /* + * Miscellaneous configurable options + */ +-- +2.11.0 + diff --git a/v2017.07-rc2/0001-mx23_olinuxino-uEnv.txt-bootz-n-fixes.patch b/v2017.07-rc2/0001-mx23_olinuxino-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..cb37286 --- /dev/null +++ b/v2017.07-rc2/0001-mx23_olinuxino-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,185 @@ +From ccb5e1984cc34dc04828ab117062d1b58ff3f9ed Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 14 Mar 2017 11:10:30 -0500 +Subject: [PATCH] mx23_olinuxino: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + configs/mx23_olinuxino_defconfig | 3 ++ + include/configs/mx23_olinuxino.h | 112 +++++++++++++++++++++++++++++++++------ + 2 files changed, 100 insertions(+), 15 deletions(-) + +diff --git a/configs/mx23_olinuxino_defconfig b/configs/mx23_olinuxino_defconfig +index feaa0876ef..ee4cf5597d 100644 +--- a/configs/mx23_olinuxino_defconfig ++++ b/configs/mx23_olinuxino_defconfig +@@ -10,6 +10,7 @@ CONFIG_VERSION_VARIABLE=y + CONFIG_ARCH_MISC_INIT=y + CONFIG_SPL=y + CONFIG_HUSH_PARSER=y ++CONFIG_CMD_BOOTZ=y + # CONFIG_CMD_IMLS is not set + # CONFIG_CMD_FLASH is not set + CONFIG_CMD_MMC=y +@@ -19,7 +20,9 @@ CONFIG_CMD_GPIO=y + CONFIG_CMD_DHCP=y + CONFIG_CMD_CACHE=y + CONFIG_CMD_EXT2=y ++CONFIG_CMD_EXT4=y + CONFIG_CMD_FAT=y ++CONFIG_CMD_FS_GENERIC=y + CONFIG_LED_STATUS=y + CONFIG_LED_STATUS_GPIO=y + CONFIG_LED_STATUS0=y +diff --git a/include/configs/mx23_olinuxino.h b/include/configs/mx23_olinuxino.h +index cccc3a8ab0..e34b37272f 100644 +--- a/include/configs/mx23_olinuxino.h ++++ b/include/configs/mx23_olinuxino.h +@@ -12,6 +12,8 @@ + + /* U-Boot Commands */ + ++#define CONFIG_SUPPORT_RAW_INITRD ++ + /* Memory configuration */ + #define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */ + #define PHYS_SDRAM_1 0x40000000 /* Base address */ +@@ -64,20 +66,58 @@ + "console=ttyAMA0\0" \ + "fdt_file=imx23-olinuxino.dtb\0" \ + "fdt_addr=0x41000000\0" \ ++ "fdtdir=\0" \ ++ "bootfile=\0" \ ++ "bootdir=\0" \ + "boot_fdt=try\0" \ + "ip_dyn=yes\0" \ ++ "optargs=\0" \ ++ "cmdline=\0" \ + "mmcdev=0\0" \ + "mmcpart=2\0" \ +- "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \ ++ "mmcroot=/dev/mmcblk0p2 ro\0" \ ++ "mmcrootfstype=ext4 rootwait fixrtc\0" \ + "mmcargs=setenv bootargs console=${console},${baudrate} " \ +- "root=${mmcroot}\0" \ ++ "${optargs} " \ ++ "root=${mmcroot} " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ ++ "loadbootenv=load mmc ${bootpart} ${loadaddr} /boot/uEnv.txt\0" \ ++ "importbootenv=echo Importing environment from mmc (uEnv.txt)...; " \ ++ "env import -t ${loadaddr} ${filesize}\0" \ + "loadbootscript=" \ + "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ + "bootscript=echo Running bootscript from mmc ...; " \ + "source\0" \ +- "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \ +- "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ +- "mmcboot=echo Booting from mmc ...; " \ ++ "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ ++ "loadfdt=echo loading ${fdtdir}/${fdt_file} ...; load mmc ${bootpart} ${fdt_addr} ${fdtdir}/${fdt_file}\0" \ ++ "mmcboot=mmc dev ${mmcdev}; " \ ++ "if mmc rescan; then " \ ++ "echo SD/MMC found on device ${mmcdev};" \ ++ "echo Checking for: /boot/uEnv.txt ...;" \ ++ "for i in 2 3 4 5 6 7 ; do " \ ++ "setenv mmcpart ${i};" \ ++ "setenv bootpart ${mmcdev}:${mmcpart};" \ ++ "if test -e mmc ${bootpart} /boot/uEnv.txt; then " \ ++ "load mmc ${bootpart} ${loadaddr} /boot/uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /boot/uEnv.txt;" \ ++ "if test -n ${dtb}; then " \ ++ "setenv fdt_file ${dtb};" \ ++ "echo using ${fdt_file} ...;" \ ++ "fi;" \ ++ "echo Checking if uname_r is set in /boot/uEnv.txt...;" \ ++ "if test -n ${uname_r}; then " \ ++ "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart} ro;" \ ++ "if test -n ${uuid}; then " \ ++ "setenv mmcroot UUID=${uuid} ro;" \ ++ "fi;" \ ++ "run uname_boot;" \ ++ "fi;" \ ++ "fi;" \ ++ "done;" \ ++ "fi;\0" \ ++ "mmcboot_old=echo Booting from mmc ...; " \ + "run mmcargs; " \ + "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ + "if run loadfdt; then " \ +@@ -116,19 +156,61 @@ + "fi; " \ + "else " \ + "bootm; " \ ++ "fi;\0" \ ++ "uname_boot="\ ++ "setenv bootdir /boot; " \ ++ "setenv bootfile vmlinuz-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${bootdir}/${bootfile}; then " \ ++ "echo loading ${bootdir}/${bootfile} ...; "\ ++ "run loadimage;" \ ++ "setenv fdtdir /boot/dtbs/${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /usr/lib/linux-image-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtbs; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "echo; echo unable to find ${fdt_file} ...; echo booting legacy ...;"\ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr}] ... ;" \ ++ "bootz ${loadaddr}; " \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi; " \ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} - ${fdt_addr}] ... ;" \ ++ "bootz ${loadaddr} - ${fdt_addr}; " \ + "fi;\0" + + #define CONFIG_BOOTCOMMAND \ +- "mmc dev ${mmcdev}; if mmc rescan; then " \ +- "if run loadbootscript; then " \ +- "run bootscript; " \ +- "else " \ +- "if run loaduimage; then " \ +- "run mmcboot; " \ +- "else run netboot; " \ +- "fi; " \ +- "fi; " \ +- "else run netboot; fi" ++ "run mmcboot;" + + /* The rest of the configuration is shared */ + #include +-- +2.11.0 + diff --git a/v2017.07-rc2/0001-mx51evk-uEnv.txt-bootz-n-fixes.patch b/v2017.07-rc2/0001-mx51evk-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..8d17c2d --- /dev/null +++ b/v2017.07-rc2/0001-mx51evk-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,232 @@ +From d450970295b872f79956471c124c65f47a7ed89f Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Wed, 3 May 2017 12:56:37 -0500 +Subject: [PATCH] mx51evk: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + configs/mx51evk_defconfig | 3 + + drivers/mmc/fsl_esdhc.c | 9 +-- + include/configs/mx51evk.h | 143 ++++++++++++++++++++++++++++++++++++++++------ + 3 files changed, 129 insertions(+), 26 deletions(-) + +diff --git a/configs/mx51evk_defconfig b/configs/mx51evk_defconfig +index d7e5404048..0b9d1bb103 100644 +--- a/configs/mx51evk_defconfig ++++ b/configs/mx51evk_defconfig +@@ -19,7 +19,10 @@ CONFIG_CMD_DHCP=y + CONFIG_CMD_MII=y + CONFIG_CMD_PING=y + CONFIG_CMD_DATE=y ++CONFIG_CMD_EXT2=y ++CONFIG_CMD_EXT4=y + CONFIG_CMD_FAT=y ++CONFIG_CMD_FS_GENERIC=y + CONFIG_USB=y + CONFIG_USB_STORAGE=y + # CONFIG_VIDEO_SW_CURSOR is not set +diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c +index f3c63585a8..16f76c5cad 100644 +--- a/drivers/mmc/fsl_esdhc.c ++++ b/drivers/mmc/fsl_esdhc.c +@@ -290,15 +290,8 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data) + * Rounding up to next power of 2 + * => timeout + 13 = log2(mmc->clock/4) + 1 + * => timeout + 13 = fls(mmc->clock/4) +- * +- * However, the MMC spec "It is strongly recommended for hosts to +- * implement more than 500ms timeout value even if the card +- * indicates the 250ms maximum busy length." Even the previous +- * value of 300ms is known to be insufficient for some cards. +- * So, we use +- * => timeout + 13 = fls(mmc->clock/2) + */ +- timeout = fls(mmc->clock/2); ++ timeout = fls(mmc->clock/4); + timeout -= 13; + + if (timeout > 14) +diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h +index dfd7ea9d45..66bfa2486a 100644 +--- a/include/configs/mx51evk.h ++++ b/include/configs/mx51evk.h +@@ -63,6 +63,7 @@ + #define CONFIG_SYS_FSL_ESDHC_ADDR MMC_SDHC1_BASE_ADDR + #define CONFIG_SYS_FSL_ESDHC_NUM 2 + ++#define CONFIG_SUPPORT_RAW_INITRD + /* + * Eth Configs + */ +@@ -100,24 +101,75 @@ + #define CONFIG_LOADADDR 0x92000000 /* loadaddr env var */ + + #define CONFIG_EXTRA_ENV_SETTINGS \ ++ "initrd_high=0xffffffff\0" \ ++ "fdt_high=0xffffffff\0" \ + "script=boot.scr\0" \ + "image=zImage\0" \ + "fdt_file=imx51-babbage.dtb\0" \ +- "fdt_addr=0x91000000\0" \ ++ "fdt_addr=0x91ff0000\0" \ + "boot_fdt=try\0" \ + "ip_dyn=yes\0" \ ++ "loadaddr=0x90010000\0" \ ++ "rdaddr=0x92000000\0" \ ++ "console=ttymxc0,115200n8\0" \ ++ "optargs=\0" \ ++ "cmdline=\0" \ + "mmcdev=0\0" \ + "mmcpart=1\0" \ +- "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \ +- "mmcargs=setenv bootargs console=ttymxc0,${baudrate} " \ +- "root=${mmcroot}\0" \ ++ "mmcroot=/dev/mmcblk0p2 ro\0" \ ++ "mmcrootfstype=ext4 rootwait\0" \ ++ "mmcargs=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "root=${mmcroot} " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ + "loadbootscript=" \ +- "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ ++ "load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ + "bootscript=echo Running bootscript from mmc ...; " \ + "source\0" \ +- "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ +- "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ +- "mmcboot=echo Booting from mmc ...; " \ ++ "loadbootenv=load mmc ${mmcdev}:${mmcpart} ${loadaddr} uEnv.txt\0" \ ++ "importbootenv=echo Importing environment from mmc (uEnv.txt)...; " \ ++ "env import -t ${loadaddr} ${filesize}\0" \ ++ "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ ++ "loadrd=load mmc ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \ ++ "loadfdt=echo loading ${fdtdir}/${fdt_file} ...; load mmc ${bootpart} ${fdt_addr} ${fdtdir}/${fdt_file}\0" \ ++ "mmcboot=mmc dev ${mmcdev}; " \ ++ "if mmc rescan; then " \ ++ "echo SD/MMC found on device ${mmcdev};" \ ++ "setenv bootpart ${mmcdev}:1; " \ ++ "echo Checking for: /uEnv.txt ...;" \ ++ "if test -e mmc ${bootpart} /uEnv.txt; then " \ ++ "load mmc ${bootpart} ${loadaddr} /uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /uEnv.txt;" \ ++ "echo Checking if uenvcmd is set ...;" \ ++ "if test -n ${uenvcmd}; then " \ ++ "echo Running uenvcmd ...;" \ ++ "run uenvcmd;" \ ++ "fi;" \ ++ "fi; " \ ++ "echo Checking for: /boot/uEnv.txt ...;" \ ++ "for i in 1 2 3 4 5 6 7 ; do " \ ++ "setenv mmcpart ${i};" \ ++ "setenv bootpart ${mmcdev}:${mmcpart};" \ ++ "if test -e mmc ${bootpart} /boot/uEnv.txt; then " \ ++ "load mmc ${bootpart} ${loadaddr} /boot/uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /boot/uEnv.txt;" \ ++ "if test -n ${dtb}; then " \ ++ "setenv fdt_file ${dtb};" \ ++ "echo Using: dtb=${fdt_file} ...;" \ ++ "fi;" \ ++ "echo Checking if uname_r is set in /boot/uEnv.txt...;" \ ++ "if test -n ${uname_r}; then " \ ++ "echo Running uname_boot ...;" \ ++ "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart} ro;" \ ++ "run uname_boot;" \ ++ "fi;" \ ++ "fi;" \ ++ "done;" \ ++ "fi;\0" \ ++ "mmcboot_old=echo Booting from mmc ...; " \ + "run mmcargs; " \ + "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ + "if run loadfdt; then " \ +@@ -156,19 +208,74 @@ + "fi; " \ + "else " \ + "bootz; " \ ++ "fi;\0" \ ++ "uname_boot="\ ++ "setenv bootdir /boot; " \ ++ "setenv bootfile vmlinuz-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${bootdir}/${bootfile}; then " \ ++ "echo loading ${bootdir}/${bootfile} ...; "\ ++ "run loadimage;" \ ++ "setenv fdtdir /boot/dtbs/${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /usr/lib/linux-image-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtbs; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "echo; echo unable to find ${fdt_file} ...; echo booting legacy ...;"\ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr}] ... ;" \ ++ "bootz ${loadaddr}; " \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi; " \ ++ "setenv rdfile initrd.img-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${bootdir}/${rdfile}; then " \ ++ "echo loading ${bootdir}/${rdfile} ...; "\ ++ "run loadrd;" \ ++ "if test -n ${uuid}; then " \ ++ "setenv mmcroot UUID=${uuid} ro;" \ ++ "fi;" \ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdt_addr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdt_addr}; " \ ++ "else " \ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} - ${fdt_addr}] ... ;" \ ++ "bootz ${loadaddr} - ${fdt_addr}; " \ ++ "fi;" \ + "fi;\0" + + #define CONFIG_BOOTCOMMAND \ +- "mmc dev ${mmcdev}; if mmc rescan; then " \ +- "if run loadbootscript; then " \ +- "run bootscript; " \ +- "else " \ +- "if run loadimage; then " \ +- "run mmcboot; " \ +- "else run netboot; " \ +- "fi; " \ +- "fi; " \ +- "else run netboot; fi" ++ "run mmcboot;" + + #define CONFIG_ARP_TIMEOUT 200UL + +-- +2.11.0 + diff --git a/v2017.07-rc2/0001-mx53loco-uEnv.txt-bootz-n-fixes.patch b/v2017.07-rc2/0001-mx53loco-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..fe18613 --- /dev/null +++ b/v2017.07-rc2/0001-mx53loco-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,198 @@ +From 08db2dd4c35426576d39e647e419fe01cacbb88b Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Wed, 3 May 2017 13:01:25 -0500 +Subject: [PATCH] mx53loco: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + configs/m53evk_defconfig | 1 + + include/configs/mx53loco.h | 138 +++++++++++++++++++++++++++++++++++++++------ + 2 files changed, 122 insertions(+), 17 deletions(-) + +diff --git a/configs/m53evk_defconfig b/configs/m53evk_defconfig +index b0379b8e63..31b076399e 100644 +--- a/configs/m53evk_defconfig ++++ b/configs/m53evk_defconfig +@@ -28,6 +28,7 @@ CONFIG_CMD_MII=y + CONFIG_CMD_PING=y + CONFIG_CMD_BMP=y + CONFIG_CMD_DATE=y ++CONFIG_CMD_EXT2=y + CONFIG_CMD_EXT4=y + CONFIG_CMD_EXT4_WRITE=y + CONFIG_CMD_FAT=y +diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h +index 945be5835b..b04ebfba72 100644 +--- a/include/configs/mx53loco.h ++++ b/include/configs/mx53loco.h +@@ -78,26 +78,75 @@ + + #define CONFIG_ETHPRIME "FEC0" + +-#define CONFIG_LOADADDR 0x72000000 /* loadaddr env var */ ++#define CONFIG_LOADADDR 0x70010000 /* loadaddr env var */ + #define CONFIG_SYS_TEXT_BASE 0x77800000 + + #define CONFIG_EXTRA_ENV_SETTINGS \ ++ "initrd_high=0xffffffff\0" \ ++ "fdt_high=0xffffffff\0" \ + "script=boot.scr\0" \ + "image=zImage\0" \ +- "fdt_addr=0x71000000\0" \ ++ "fdt_dir=/dtbs/\0" \ ++ "fdt_addr=0x71ff0000\0" \ ++ "rdaddr=0x72000000\0" \ + "boot_fdt=try\0" \ + "ip_dyn=yes\0" \ ++ "console=ttymxc0,115200\0" \ ++ "optargs=\0" \ ++ "cmdline=\0" \ + "mmcdev=0\0" \ + "mmcpart=1\0" \ +- "mmcroot=/dev/mmcblk0p2 rw rootwait\0" \ +- "mmcargs=setenv bootargs console=ttymxc0,${baudrate} root=${mmcroot}\0" \ ++ "mmcroot=/dev/mmcblk0p2 ro\0" \ ++ "mmcrootfstype=ext4 rootwait fixrtc\0" \ ++ "mmcargs=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "root=${mmcroot} " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ + "loadbootscript=" \ + "load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ + "bootscript=echo Running bootscript from mmc ...; " \ + "source\0" \ +- "loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ +- "loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ +- "mmcboot=echo Booting from mmc ...; " \ ++ "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ ++ "loadrd=load mmc ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \ ++ "loadfdt=echo loading ${fdtdir}/${fdt_file} ...; load mmc ${bootpart} ${fdt_addr} ${fdtdir}/${fdt_file}\0" \ ++ "mmcboot=mmc dev ${mmcdev}; " \ ++ "if mmc rescan; then " \ ++ "echo SD/MMC found on device ${mmcdev};" \ ++ "setenv bootpart ${mmcdev}:1; " \ ++ "echo Checking for: /uEnv.txt ...;" \ ++ "if test -e mmc ${bootpart} /uEnv.txt; then " \ ++ "load mmc ${bootpart} ${loadaddr} /uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /uEnv.txt;" \ ++ "echo Checking if uenvcmd is set ...;" \ ++ "if test -n ${uenvcmd}; then " \ ++ "echo Running uenvcmd ...;" \ ++ "run uenvcmd;" \ ++ "fi;" \ ++ "fi; " \ ++ "echo Checking for: /boot/uEnv.txt ...;" \ ++ "for i in 1 2 3 4 5 6 7 ; do " \ ++ "setenv mmcpart ${i};" \ ++ "setenv bootpart ${mmcdev}:${mmcpart};" \ ++ "if test -e mmc ${bootpart} /boot/uEnv.txt; then " \ ++ "load mmc ${bootpart} ${loadaddr} /boot/uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /boot/uEnv.txt;" \ ++ "if test -n ${dtb}; then " \ ++ "setenv fdt_file ${dtb};" \ ++ "echo Using: dtb=${fdt_file} ...;" \ ++ "fi;" \ ++ "echo Checking if uname_r is set in /boot/uEnv.txt...;" \ ++ "if test -n ${uname_r}; then " \ ++ "echo Running uname_boot ...;" \ ++ "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart} ro;" \ ++ "run uname_boot;" \ ++ "fi;" \ ++ "fi;" \ ++ "done;" \ ++ "fi;\0" \ ++ "mmcboot_old=echo Booting from mmc ...; " \ + "run mmcargs; " \ + "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ + "if run loadfdt; then " \ +@@ -136,19 +185,74 @@ + "fi; " \ + "else " \ + "bootz; " \ ++ "fi;\0" \ ++ "uname_boot="\ ++ "setenv bootdir /boot; " \ ++ "setenv bootfile vmlinuz-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${bootdir}/${bootfile}; then " \ ++ "echo loading ${bootdir}/${bootfile} ...; "\ ++ "run loadimage;" \ ++ "setenv fdtdir /boot/dtbs/${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /usr/lib/linux-image-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtbs; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "echo; echo unable to find ${fdt_file} ...; echo booting legacy ...;"\ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr}] ... ;" \ ++ "bootz ${loadaddr}; " \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi; " \ ++ "setenv rdfile initrd.img-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${bootdir}/${rdfile}; then " \ ++ "echo loading ${bootdir}/${rdfile} ...; "\ ++ "run loadrd;" \ ++ "if test -n ${uuid}; then " \ ++ "setenv mmcroot UUID=${uuid} ro;" \ ++ "fi;" \ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdt_addr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdt_addr}; " \ ++ "else " \ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} - ${fdt_addr}] ... ;" \ ++ "bootz ${loadaddr} - ${fdt_addr}; " \ ++ "fi;" \ + "fi;\0" + + #define CONFIG_BOOTCOMMAND \ +- "mmc dev ${mmcdev}; if mmc rescan; then " \ +- "if run loadbootscript; then " \ +- "run bootscript; " \ +- "else " \ +- "if run loadimage; then " \ +- "run mmcboot; " \ +- "else run netboot; " \ +- "fi; " \ +- "fi; " \ +- "else run netboot; fi" ++ "run mmcboot;" + + #define CONFIG_ARP_TIMEOUT 200UL + +-- +2.11.0 + diff --git a/v2017.07-rc2/0001-mx6sabresd_spl-fixes.patch b/v2017.07-rc2/0001-mx6sabresd_spl-fixes.patch new file mode 100644 index 0000000..1d36d33 --- /dev/null +++ b/v2017.07-rc2/0001-mx6sabresd_spl-fixes.patch @@ -0,0 +1,401 @@ +From e9a72d341020db81ee31b7732ae8723e7fbd6f81 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Fri, 16 Jun 2017 10:49:18 -0500 +Subject: [PATCH] mx6sabresd_spl fixes + +Signed-off-by: Robert Nelson +--- + arch/arm/imx-common/cpu.c | 3 + + configs/mx6sabresd_spl_defconfig | 6 +- + drivers/pci/pcie_imx.c | 38 +++++++ + include/configs/mx6sabre_common.h | 221 ++++++++++++++++++++++++++------------ + include/pci.h | 4 + + 5 files changed, 200 insertions(+), 72 deletions(-) + +diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c +index 40fe813d29..74bdd24ed1 100644 +--- a/arch/arm/imx-common/cpu.c ++++ b/arch/arm/imx-common/cpu.c +@@ -275,6 +275,9 @@ u32 get_ahb_clk(void) + + void arch_preboot_os(void) + { ++#if defined(CONFIG_PCIE_IMX) ++ imx_pcie_remove(); ++#endif + #if defined(CONFIG_CMD_SATA) + sata_stop(); + #if defined(CONFIG_MX6) +diff --git a/configs/mx6sabresd_spl_defconfig b/configs/mx6sabresd_spl_defconfig +index 0e0edefab7..f6e37e9598 100644 +--- a/configs/mx6sabresd_spl_defconfig ++++ b/configs/mx6sabresd_spl_defconfig +@@ -10,7 +10,6 @@ CONFIG_SPL_LIBDISK_SUPPORT=y + CONFIG_SPL_WATCHDOG_SUPPORT=y + CONFIG_VIDEO=y + CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,SPL,MX6QDL" +-CONFIG_BOOTDELAY=3 + # CONFIG_CONSOLE_MUX is not set + CONFIG_SYS_CONSOLE_IS_IN_ENV=y + CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y +@@ -19,10 +18,15 @@ CONFIG_SPL_EXT_SUPPORT=y + CONFIG_SPL_I2C_SUPPORT=y + CONFIG_SPL_OS_BOOT=y + CONFIG_HUSH_PARSER=y ++CONFIG_AUTOBOOT_KEYED=y ++CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n" ++CONFIG_AUTOBOOT_DELAY_STR="d" ++CONFIG_AUTOBOOT_STOP_STR=" " + CONFIG_CMD_BOOTZ=y + # CONFIG_CMD_IMLS is not set + # CONFIG_CMD_FLASH is not set + CONFIG_CMD_MMC=y ++CONFIG_CMD_PART=y + CONFIG_CMD_SF=y + CONFIG_CMD_I2C=y + CONFIG_CMD_USB=y +diff --git a/drivers/pci/pcie_imx.c b/drivers/pci/pcie_imx.c +index 732d59d711..eab0a2b602 100644 +--- a/drivers/pci/pcie_imx.c ++++ b/drivers/pci/pcie_imx.c +@@ -42,6 +42,9 @@ + + /* PCIe Port Logic registers (memory-mapped) */ + #define PL_OFFSET 0x700 ++#define PCIE_PL_PFLR (PL_OFFSET + 0x08) ++#define PCIE_PL_PFLR_LINK_STATE_MASK (0x3f << 16) ++#define PCIE_PL_PFLR_FORCE_LINK (1 << 15) + #define PCIE_PHY_DEBUG_R0 (PL_OFFSET + 0x28) + #define PCIE_PHY_DEBUG_R1 (PL_OFFSET + 0x2c) + #define PCIE_PHY_DEBUG_R1_LINK_UP (1 << 4) +@@ -445,6 +448,36 @@ static int imx6_pcie_assert_core_reset(void) + /* Power up PCIe PHY */ + setbits_le32(&gpc_regs->cntr, PCIE_PHY_PUP_REQ); + #else ++ /* ++ * If the bootloader already enabled the link we need some special ++ * handling to get the core back into a state where it is safe to ++ * touch it for configuration. As there is no dedicated reset signal ++ * wired up for MX6QDL, we need to manually force LTSSM into "detect" ++ * state before completely disabling LTSSM, which is a prerequisite ++ * for core configuration. ++ * ++ * If both LTSSM_ENABLE and REF_SSP_ENABLE are active we have a strong ++ * indication that the bootloader activated the link. ++ */ ++ if (is_mx6dq()) { ++ u32 val, gpr1, gpr12; ++ ++ gpr1 = readl(&iomuxc_regs->gpr[1]); ++ gpr12 = readl(&iomuxc_regs->gpr[12]); ++ if ((gpr1 & IOMUXC_GPR1_PCIE_REF_CLK_EN) && ++ (gpr12 & IOMUXC_GPR12_PCIE_CTL_2)) { ++ val = readl(MX6_DBI_ADDR + PCIE_PL_PFLR); ++ val &= ~PCIE_PL_PFLR_LINK_STATE_MASK; ++ val |= PCIE_PL_PFLR_FORCE_LINK; ++ ++ imx_pcie_fix_dabt_handler(true); ++ writel(val, MX6_DBI_ADDR + PCIE_PL_PFLR); ++ imx_pcie_fix_dabt_handler(false); ++ ++ gpr12 &= ~IOMUXC_GPR12_PCIE_CTL_2; ++ writel(val, &iomuxc_regs->gpr[12]); ++ } ++ } + setbits_le32(&iomuxc_regs->gpr[1], IOMUXC_GPR1_TEST_POWERDOWN); + clrbits_le32(&iomuxc_regs->gpr[1], IOMUXC_GPR1_REF_SSP_EN); + #endif +@@ -652,6 +685,11 @@ void imx_pcie_init(void) + } + } + ++void imx_pcie_remove(void) ++{ ++ imx6_pcie_assert_core_reset(); ++} ++ + /* Probe function. */ + void pci_init_board(void) + { +diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h +index 9b0fe5a3c2..c2af5daeb6 100644 +--- a/include/configs/mx6sabre_common.h ++++ b/include/configs/mx6sabre_common.h +@@ -68,16 +68,25 @@ + "fdt_addr=0x18000000\0" \ + "boot_fdt=try\0" \ + "ip_dyn=yes\0" \ +- "console=" CONSOLE_DEV "\0" \ ++ "console=ttymxc0,115200\0" \ ++ "splashpos=m,m\0" \ ++ "fdtfile=undefined\0" \ ++ "rdaddr=0x12A00000\0" \ + "dfuspi=dfu 0 sf 0:0:10000000:0\0" \ + "dfu_alt_info_spl=spl raw 0x400\0" \ + "dfu_alt_info_img=u-boot raw 0x10000\0" \ + "dfu_alt_info=spl raw 0x400\0" \ + "fdt_high=0xffffffff\0" \ + "initrd_high=0xffffffff\0" \ +- "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \ ++ "fdt_addr_r=0x18000000\0" \ ++ "fdt_addr=0x18000000\0" \ ++ "ip_dyn=yes\0" \ ++ "optargs=\0" \ ++ "cmdline=\0" \ ++ "mmcdev=0\0" \ + "mmcpart=1\0" \ +- "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \ ++ "mmcroot=/dev/mmcblk0p2 ro\0" \ ++ "mmcrootfstype=ext4 rootwait\0" \ + "update_sd_firmware=" \ + "if test ${ip_dyn} = yes; then " \ + "setenv get_cmd dhcp; " \ +@@ -92,84 +101,154 @@ + "fi; " \ + "fi\0" \ + EMMC_ENV \ +- "mmcargs=setenv bootargs console=${console},${baudrate} " \ +- "root=${mmcroot}\0" \ +- "loadbootscript=" \ +- "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ +- "bootscript=echo Running bootscript from mmc ...; " \ +- "source\0" \ +- "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ +- "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ +- "mmcboot=echo Booting from mmc ...; " \ +- "run mmcargs; " \ +- "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ +- "if run loadfdt; then " \ +- "bootz ${loadaddr} - ${fdt_addr}; " \ +- "else " \ +- "if test ${boot_fdt} = try; then " \ +- "bootz; " \ +- "else " \ +- "echo WARN: Cannot load the DT; " \ +- "fi; " \ +- "fi; " \ +- "else " \ +- "bootz; " \ +- "fi;\0" \ +- "netargs=setenv bootargs console=${console},${baudrate} " \ +- "root=/dev/nfs " \ +- "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ +- "netboot=echo Booting from net ...; " \ +- "run netargs; " \ +- "if test ${ip_dyn} = yes; then " \ +- "setenv get_cmd dhcp; " \ +- "else " \ +- "setenv get_cmd tftp; " \ +- "fi; " \ +- "${get_cmd} ${image}; " \ +- "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ +- "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ +- "bootz ${loadaddr} - ${fdt_addr}; " \ +- "else " \ +- "if test ${boot_fdt} = try; then " \ +- "bootz; " \ +- "else " \ +- "echo WARN: Cannot load the DT; " \ +- "fi; " \ +- "fi; " \ +- "else " \ +- "bootz; " \ +- "fi;\0" \ ++ "mmcargs=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "root=${mmcroot} " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ + "findfdt="\ +- "if test $fdt_file = undefined; then " \ ++ "if test $fdtfile = undefined; then " \ + "if test $board_name = SABREAUTO && test $board_rev = MX6QP; then " \ +- "setenv fdt_file imx6qp-sabreauto.dtb; fi; " \ ++ "setenv fdtfile imx6qp-sabreauto.dtb; fi; " \ + "if test $board_name = SABREAUTO && test $board_rev = MX6Q; then " \ +- "setenv fdt_file imx6q-sabreauto.dtb; fi; " \ ++ "setenv fdtfile imx6q-sabreauto.dtb; fi; " \ + "if test $board_name = SABREAUTO && test $board_rev = MX6DL; then " \ +- "setenv fdt_file imx6dl-sabreauto.dtb; fi; " \ ++ "setenv fdtfile imx6dl-sabreauto.dtb; fi; " \ + "if test $board_name = SABRESD && test $board_rev = MX6QP; then " \ +- "setenv fdt_file imx6qp-sabresd.dtb; fi; " \ ++ "setenv fdtfile imx6qp-sabresd.dtb; fi; " \ + "if test $board_name = SABRESD && test $board_rev = MX6Q; then " \ +- "setenv fdt_file imx6q-sabresd.dtb; fi; " \ ++ "setenv fdtfile imx6q-sabresd.dtb; fi; " \ + "if test $board_name = SABRESD && test $board_rev = MX6DL; then " \ +- "setenv fdt_file imx6dl-sabresd.dtb; fi; " \ +- "if test $fdt_file = undefined; then " \ ++ "setenv fdtfile imx6dl-sabresd.dtb; fi; " \ ++ "if test $fdtfile = undefined; then " \ + "echo WARNING: Could not determine dtb to use; fi; " \ +- "fi;\0" \ ++ "fi;\0" \ ++ "loadimage=load ${interface} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ ++ "loadrd=load ${interface} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \ ++ "loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${interface} ${bootpart} ${fdt_addr} ${fdtdir}/${fdtfile}\0" \ ++ "mmcboot=${interface} dev ${mmcdev}; " \ ++ "if ${interface} rescan; then " \ ++ "echo SD/MMC found on device ${mmcdev};" \ ++ "setenv bootpart ${mmcdev}:1; " \ ++ "echo Checking for: /uEnv.txt ...;" \ ++ "if test -e ${interface} ${bootpart} /uEnv.txt; then " \ ++ "load ${interface} ${bootpart} ${loadaddr} /uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /uEnv.txt;" \ ++ "echo Checking if uenvcmd is set ...;" \ ++ "if test -n ${uenvcmd}; then " \ ++ "echo Running uenvcmd ...;" \ ++ "run uenvcmd;" \ ++ "fi;" \ ++ "fi; " \ ++ "echo Checking for: /boot/uEnv.txt ...;" \ ++ "for i in 1 2 3 4 5 6 7 ; do " \ ++ "setenv mmcpart ${i};" \ ++ "setenv bootpart ${mmcdev}:${mmcpart};" \ ++ "if test -e ${interface} ${bootpart} /boot/uEnv.txt; then " \ ++ "load ${interface} ${bootpart} ${loadaddr} /boot/uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /boot/uEnv.txt;" \ ++ "if test -n ${dtb}; then " \ ++ "setenv fdtfile ${dtb};" \ ++ "echo Using: dtb=${fdtfile} ...;" \ ++ "fi;" \ ++ "echo Checking if uname_r is set in /boot/uEnv.txt...;" \ ++ "if test -n ${uname_r}; then " \ ++ "echo Running uname_boot ...;" \ ++ "part uuid ${interface} ${bootpart} partuuid ;" \ ++ "setenv mmcroot PARTUUID=${partuuid} ro;" \ ++ "echo Using: mmcroot=${mmcroot} ...;" \ ++ "run uname_boot;" \ ++ "fi;" \ ++ "fi;" \ ++ "done;" \ ++ "fi;\0" \ ++ "uname_boot="\ ++ "setenv bootdir /boot; " \ ++ "setenv bootfile vmlinuz-${uname_r}; " \ ++ "if test -e ${interface} ${bootpart} ${bootdir}/${bootfile}; then " \ ++ "echo loading ${bootdir}/${bootfile} ...; "\ ++ "run loadimage;" \ ++ "setenv fdtdir /boot/dtbs/${uname_r}; " \ ++ "if test -e ${interface} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /usr/lib/linux-image-${uname_r}; " \ ++ "if test -e ${interface} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \ ++ "if test -e ${interface} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb-${uname_r}; " \ ++ "if test -e ${interface} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtbs; " \ ++ "if test -e ${interface} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb; " \ ++ "if test -e ${interface} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot; " \ ++ "if test -e ${interface} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "echo; echo unable to find ${fdtfile} ...; echo booting legacy ...;"\ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr}] ... ;" \ ++ "bootz ${loadaddr}; " \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi; " \ ++ "setenv rdfile initrd.img-${uname_r}; " \ ++ "if test -e ${interface} ${bootpart} ${bootdir}/${rdfile}; then " \ ++ "echo loading ${bootdir}/${rdfile} ...; "\ ++ "run loadrd;" \ ++ "if test -n ${uuid}; then " \ ++ "setenv mmcroot UUID=${uuid} ro;" \ ++ "fi;" \ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdt_addr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdt_addr}; " \ ++ "else " \ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} - ${fdt_addr}] ... ;" \ ++ "bootz ${loadaddr} - ${fdt_addr}; " \ ++ "fi;" \ ++ "fi;\0" \ ++ "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ ++ "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ ++ "ramdisk_addr_r=0x13000000\0" \ ++ "ramdiskaddr=0x13000000\0" \ ++ "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \ ++ BOOTENV ++ ++#define BOOT_TARGET_DEVICES(func) \ ++ func(MMC, mmc, 0) \ ++ func(MMC, mmc, 1) + + #define CONFIG_BOOTCOMMAND \ + "run findfdt;" \ +- "mmc dev ${mmcdev};" \ +- "if mmc rescan; then " \ +- "if run loadbootscript; then " \ +- "run bootscript; " \ +- "else " \ +- "if run loadimage; then " \ +- "run mmcboot; " \ +- "else run netboot; " \ +- "fi; " \ +- "fi; " \ +- "else run netboot; fi" ++ "setenv interface mmc;" \ ++ "setenv mmcdev 0;" \ ++ "run mmcboot;" \ ++ "setenv mmcdev 1;" \ ++ "run mmcboot;" \ ++ "run distro_bootcmd;" ++ ++#include + + #define CONFIG_ARP_TIMEOUT 200UL + +@@ -191,7 +270,7 @@ + (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) + + /* Environment organization */ +-#define CONFIG_ENV_SIZE (8 * 1024) ++#define CONFIG_ENV_SIZE (10 * 1024) + + #define CONFIG_ENV_IS_IN_MMC + +diff --git a/include/pci.h b/include/pci.h +index d3c955eb80..c8ef997d0d 100644 +--- a/include/pci.h ++++ b/include/pci.h +@@ -754,6 +754,10 @@ int pci_last_busno(void); + extern void pci_mpc85xx_init (struct pci_controller *hose); + #endif + ++#ifdef CONFIG_PCIE_IMX ++extern void imx_pcie_remove(void); ++#endif ++ + #if !defined(CONFIG_DM_PCI) || defined(CONFIG_DM_PCI_COMPAT) + /** + * pci_write_bar32() - Write the address of a BAR including control bits +-- +2.11.0 + diff --git a/v2017.07-rc2/0001-mx6ul_14x14_evk-fixes.patch b/v2017.07-rc2/0001-mx6ul_14x14_evk-fixes.patch new file mode 100644 index 0000000..72a9dd3 --- /dev/null +++ b/v2017.07-rc2/0001-mx6ul_14x14_evk-fixes.patch @@ -0,0 +1,182 @@ +From 43e5581d1339b9143f1d8ca5d4445379d64942b1 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Fri, 17 Jun 2016 11:54:48 -0500 +Subject: [PATCH] mx6ul_14x14_evk fixes + +Signed-off-by: Robert Nelson +--- + include/configs/mx6ul_14x14_evk.h | 134 +++++++++++++++++++++++++++++++++----- + 1 file changed, 116 insertions(+), 18 deletions(-) + +diff --git a/include/configs/mx6ul_14x14_evk.h b/include/configs/mx6ul_14x14_evk.h +index b2ba773..f27d9a4 100644 +--- a/include/configs/mx6ul_14x14_evk.h ++++ b/include/configs/mx6ul_14x14_evk.h +@@ -72,22 +72,66 @@ + "initrd_high=0xffffffff\0" \ + "fdt_file=undefined\0" \ + "fdt_addr=0x83000000\0" \ ++ "rdaddr=0x83080000\0" \ + "boot_fdt=try\0" \ + "ip_dyn=yes\0" \ ++ "optargs=\0" \ ++ "cmdline=\0" \ + "videomode=video=ctfb:x:480,y:272,depth:24,pclk:108695,le:8,ri:4,up:2,lo:4,hs:41,vs:10,sync:0,vmode:0\0" \ + "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \ + "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \ +- "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \ ++ "mmcroot=" CONFIG_MMCROOT " rootwait ro\0" \ ++ "mmcrootfstype=ext4 rootwait\0" \ + "mmcautodetect=yes\0" \ + "mmcargs=setenv bootargs console=${console},${baudrate} " \ +- "root=${mmcroot}\0" \ ++ "${optargs} " \ ++ "root=${mmcroot} " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ + "loadbootscript=" \ +- "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ ++ "load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ + "bootscript=echo Running bootscript from mmc ...; " \ + "source\0" \ +- "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ +- "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ +- "mmcboot=echo Booting from mmc ...; " \ ++ "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ ++ "loadrd=load mmc ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \ ++ "loadfdt=echo loading ${fdtdir}/${fdt_file} ...; load mmc ${bootpart} ${fdt_addr} ${fdtdir}/${fdt_file}\0" \ ++ "mmcboot=mmc dev ${mmcdev}; " \ ++ "if mmc rescan; then " \ ++ "echo SD/MMC found on device ${mmcdev};" \ ++ "setenv bootpart ${mmcdev}:1; " \ ++ "echo Checking for: /uEnv.txt ...;" \ ++ "if test -e mmc ${bootpart} /uEnv.txt; then " \ ++ "load mmc ${bootpart} ${loadaddr} /uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /uEnv.txt;" \ ++ "echo Checking if uenvcmd is set ...;" \ ++ "if test -n ${uenvcmd}; then " \ ++ "echo Running uenvcmd ...;" \ ++ "run uenvcmd;" \ ++ "fi;" \ ++ "fi; " \ ++ "echo Checking for: /boot/uEnv.txt ...;" \ ++ "for i in 1 2 3 4 5 6 7 ; do " \ ++ "setenv mmcpart ${i};" \ ++ "setenv bootpart ${mmcdev}:${mmcpart};" \ ++ "if test -e mmc ${bootpart} /boot/uEnv.txt; then " \ ++ "load mmc ${bootpart} ${loadaddr} /boot/uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /boot/uEnv.txt;" \ ++ "if test -n ${dtb}; then " \ ++ "setenv fdt_file ${dtb};" \ ++ "echo Using: dtb=${fdt_file} ...;" \ ++ "fi;" \ ++ "echo Checking if uname_r is set in /boot/uEnv.txt...;" \ ++ "if test -n ${uname_r}; then " \ ++ "echo Running uname_boot ...;" \ ++ "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart} ro;" \ ++ "run uname_boot;" \ ++ "fi;" \ ++ "fi;" \ ++ "done;" \ ++ "fi;\0" \ ++ "mmcboot_old=echo Booting from mmc ...; " \ + "run mmcargs; " \ + "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ + "if run loadfdt; then " \ +@@ -126,6 +170,70 @@ + "else " \ + "bootz; " \ + "fi;\0" \ ++ "uname_boot="\ ++ "setenv bootdir /boot; " \ ++ "setenv bootfile vmlinuz-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${bootdir}/${bootfile}; then " \ ++ "echo loading ${bootdir}/${bootfile} ...; "\ ++ "run loadimage;" \ ++ "setenv fdtdir /boot/dtbs/${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /usr/lib/linux-image-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtbs; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "echo; echo unable to find ${fdt_file} ...; echo booting legacy ...;"\ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr}] ... ;" \ ++ "bootz ${loadaddr}; " \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi; " \ ++ "setenv rdfile initrd.img-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${bootdir}/${rdfile}; then " \ ++ "echo loading ${bootdir}/${rdfile} ...; "\ ++ "run loadrd;" \ ++ "if test -n ${uuid}; then " \ ++ "setenv mmcroot UUID=${uuid} ro;" \ ++ "fi;" \ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdt_addr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdt_addr}; " \ ++ "else " \ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} - ${fdt_addr}] ... ;" \ ++ "bootz ${loadaddr} - ${fdt_addr}; " \ ++ "fi;" \ ++ "fi;\0" \ + "findfdt="\ + "if test $fdt_file = undefined; then " \ + "if test $board_name = EVK && test $board_rev = 9X9; then " \ +@@ -137,18 +245,8 @@ + "fi;\0" \ + + #define CONFIG_BOOTCOMMAND \ +- "run findfdt;" \ +- "mmc dev ${mmcdev};" \ +- "mmc dev ${mmcdev}; if mmc rescan; then " \ +- "if run loadbootscript; then " \ +- "run bootscript; " \ +- "else " \ +- "if run loadimage; then " \ +- "run mmcboot; " \ +- "else run netboot; " \ +- "fi; " \ +- "fi; " \ +- "else run netboot; fi" ++ "run findfdt; " \ ++ "run mmcboot; " + + /* Miscellaneous configurable options */ + #define CONFIG_SYS_MEMTEST_START 0x80000000 +-- +2.8.1 + diff --git a/v2017.07-rc2/0001-mx6ull_14x14_evk-fixes.patch b/v2017.07-rc2/0001-mx6ull_14x14_evk-fixes.patch new file mode 100644 index 0000000..96a45e5 --- /dev/null +++ b/v2017.07-rc2/0001-mx6ull_14x14_evk-fixes.patch @@ -0,0 +1,175 @@ +From 6efb4f15034d3caac600db548a9a59d13376a8e6 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Wed, 24 May 2017 12:59:55 -0500 +Subject: [PATCH] mx6ull_14x14_evk fixes + +Signed-off-by: Robert Nelson +--- + include/configs/mx6ullevk.h | 132 ++++++++++++++++++++++++++++++++++++++------ + 1 file changed, 115 insertions(+), 17 deletions(-) + +diff --git a/include/configs/mx6ullevk.h b/include/configs/mx6ullevk.h +index 19b0630d9d..eef65d5659 100644 +--- a/include/configs/mx6ullevk.h ++++ b/include/configs/mx6ullevk.h +@@ -62,22 +62,66 @@ + "initrd_high=0xffffffff\0" \ + "fdt_file=imx6ull-14x14-evk.dtb\0" \ + "fdt_addr=0x83000000\0" \ ++ "rdaddr=0x83080000\0" \ + "boot_fdt=try\0" \ + "ip_dyn=yes\0" \ ++ "optargs=\0" \ ++ "cmdline=\0" \ + "videomode=video=ctfb:x:480,y:272,depth:24,pclk:108695,le:8,ri:4,up:2,lo:4,hs:41,vs:10,sync:0,vmode:0\0" \ + "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \ + "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \ +- "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \ ++ "mmcroot=" CONFIG_MMCROOT " rootwait ro\0" \ ++ "mmcrootfstype=ext4 rootwait\0" \ + "mmcautodetect=yes\0" \ + "mmcargs=setenv bootargs console=${console},${baudrate} " \ +- "root=${mmcroot}\0" \ ++ "${optargs} " \ ++ "root=${mmcroot} " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ + "loadbootscript=" \ +- "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ ++ "load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ + "bootscript=echo Running bootscript from mmc ...; " \ + "source\0" \ +- "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ +- "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ +- "mmcboot=echo Booting from mmc ...; " \ ++ "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ ++ "loadrd=load mmc ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \ ++ "loadfdt=echo loading ${fdtdir}/${fdt_file} ...; load mmc ${bootpart} ${fdt_addr} ${fdtdir}/${fdt_file}\0" \ ++ "mmcboot=mmc dev ${mmcdev}; " \ ++ "if mmc rescan; then " \ ++ "echo SD/MMC found on device ${mmcdev};" \ ++ "setenv bootpart ${mmcdev}:1; " \ ++ "echo Checking for: /uEnv.txt ...;" \ ++ "if test -e mmc ${bootpart} /uEnv.txt; then " \ ++ "load mmc ${bootpart} ${loadaddr} /uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /uEnv.txt;" \ ++ "echo Checking if uenvcmd is set ...;" \ ++ "if test -n ${uenvcmd}; then " \ ++ "echo Running uenvcmd ...;" \ ++ "run uenvcmd;" \ ++ "fi;" \ ++ "fi; " \ ++ "echo Checking for: /boot/uEnv.txt ...;" \ ++ "for i in 1 2 3 4 5 6 7 ; do " \ ++ "setenv mmcpart ${i};" \ ++ "setenv bootpart ${mmcdev}:${mmcpart};" \ ++ "if test -e mmc ${bootpart} /boot/uEnv.txt; then " \ ++ "load mmc ${bootpart} ${loadaddr} /boot/uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /boot/uEnv.txt;" \ ++ "if test -n ${dtb}; then " \ ++ "setenv fdt_file ${dtb};" \ ++ "echo Using: dtb=${fdt_file} ...;" \ ++ "fi;" \ ++ "echo Checking if uname_r is set in /boot/uEnv.txt...;" \ ++ "if test -n ${uname_r}; then " \ ++ "echo Running uname_boot ...;" \ ++ "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart} ro;" \ ++ "run uname_boot;" \ ++ "fi;" \ ++ "fi;" \ ++ "done;" \ ++ "fi;\0" \ ++ "mmcboot_old=echo Booting from mmc ...; " \ + "run mmcargs; " \ + "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ + "if run loadfdt; then " \ +@@ -116,19 +160,73 @@ + "else " \ + "bootz; " \ + "fi;\0" \ ++ "uname_boot="\ ++ "setenv bootdir /boot; " \ ++ "setenv bootfile vmlinuz-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${bootdir}/${bootfile}; then " \ ++ "echo loading ${bootdir}/${bootfile} ...; "\ ++ "run loadimage;" \ ++ "setenv fdtdir /boot/dtbs/${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /usr/lib/linux-image-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtbs; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "echo; echo unable to find ${fdt_file} ...; echo booting legacy ...;"\ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr}] ... ;" \ ++ "bootz ${loadaddr}; " \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi; " \ ++ "setenv rdfile initrd.img-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${bootdir}/${rdfile}; then " \ ++ "echo loading ${bootdir}/${rdfile} ...; "\ ++ "run loadrd;" \ ++ "if test -n ${uuid}; then " \ ++ "setenv mmcroot UUID=${uuid} ro;" \ ++ "fi;" \ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdt_addr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdt_addr}; " \ ++ "else " \ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} - ${fdt_addr}] ... ;" \ ++ "bootz ${loadaddr} - ${fdt_addr}; " \ ++ "fi;" \ ++ "fi;\0" \ + + #define CONFIG_BOOTCOMMAND \ +- "mmc dev ${mmcdev};" \ +- "mmc dev ${mmcdev}; if mmc rescan; then " \ +- "if run loadbootscript; then " \ +- "run bootscript; " \ +- "else " \ +- "if run loadimage; then " \ +- "run mmcboot; " \ +- "else run netboot; " \ +- "fi; " \ +- "fi; " \ +- "else run netboot; fi" ++ "run mmcboot; " + + /* Miscellaneous configurable options */ + #define CONFIG_SYS_MEMTEST_START 0x80000000 +-- +2.11.0 + diff --git a/v2017.07-rc2/0001-omap3_beagle-uEnv.txt-bootz-n-fixes.patch b/v2017.07-rc2/0001-omap3_beagle-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..2472e02 --- /dev/null +++ b/v2017.07-rc2/0001-omap3_beagle-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,507 @@ +From 0bf606a4307a9af6d58bd5aadac8cf13f5f34cb8 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Mon, 19 Jun 2017 22:06:14 -0500 +Subject: [PATCH] omap3_beagle: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + board/ti/beagle/beagle.c | 38 ++++++++-- + configs/omap3_beagle_defconfig | 1 + + include/configs/omap3_beagle.h | 150 +++++++++----------------------------- + include/configs/ti_armv7_common.h | 128 +++++++++++++++++++++++++++++++- + include/environment/ti/mmc.h | 45 +++++++++--- + 5 files changed, 227 insertions(+), 135 deletions(-) + +diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c +index 887b577b6a..15863a2875 100644 +--- a/board/ti/beagle/beagle.c ++++ b/board/ti/beagle/beagle.c +@@ -56,6 +56,7 @@ + #define BBTOYS_WIFI 0x01000B00 + #define BBTOYS_VGA 0x02000B00 + #define BBTOYS_LCD 0x03000B00 ++#define BBTOYS_ULCD 0x04000B00 + #define BCT_BRETTL3 0x01000F00 + #define BCT_BRETTL4 0x02000F00 + #define LSR_COM6L_ADPT 0x01001300 +@@ -212,25 +213,25 @@ void get_board_mem_timings(struct board_sdrc_timings *timings) + * bus 1 for the availability of an AT24C01B serial EEPROM. + * returns the device_vendor field from the EEPROM + */ +-static unsigned int get_expansion_id(void) ++static unsigned int get_expansion_id(int eeprom_address) + { + i2c_set_bus_num(EXPANSION_EEPROM_I2C_BUS); + + /* return BEAGLE_NO_EEPROM if eeprom doesn't respond */ +- if (i2c_probe(EXPANSION_EEPROM_I2C_ADDRESS) == 1) { ++ if (i2c_probe(eeprom_address) == 1) { + i2c_set_bus_num(TWL4030_I2C_BUS); + return BEAGLE_NO_EEPROM; + } + + /* read configuration data */ +- i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 1, (u8 *)&expansion_config, ++ i2c_read(eeprom_address, 0, 1, (u8 *)&expansion_config, + sizeof(expansion_config)); + + /* retry reading configuration data with 16bit addressing */ + if ((expansion_config.device_vendor == 0xFFFFFF00) || + (expansion_config.device_vendor == 0xFFFFFFFF)) { + printf("EEPROM is blank or 8bit addressing failed: retrying with 16bit:\n"); +- i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 2, (u8 *)&expansion_config, ++ i2c_read(eeprom_address, 0, 2, (u8 *)&expansion_config, + sizeof(expansion_config)); + } + +@@ -342,15 +343,18 @@ int misc_init_r(void) + case REVISION_AXBX: + printf("Beagle Rev Ax/Bx\n"); + setenv("beaglerev", "AxBx"); ++ setenv("musb", "musb_hdrc.fifo_mode=5"); + break; + case REVISION_CX: + printf("Beagle Rev C1/C2/C3\n"); + setenv("beaglerev", "Cx"); ++ setenv("musb", "musb_hdrc.fifo_mode=5"); + MUX_BEAGLE_C(); + break; + case REVISION_C4: + printf("Beagle Rev C4\n"); + setenv("beaglerev", "C4"); ++ setenv("musb", "musb_hdrc.fifo_mode=5"); + MUX_BEAGLE_C(); + /* Set VAUX2 to 1.8V for EHCI PHY */ + twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED, +@@ -391,7 +395,7 @@ int misc_init_r(void) + generate_fake_mac = true; + } + +- switch (get_expansion_id()) { ++ switch (get_expansion_id(EXPANSION_EEPROM_I2C_ADDRESS)) { + case TINCANTOOLS_ZIPPY: + printf("Recognized Tincantools Zippy board (rev %d %s)\n", + expansion_config.revision, +@@ -474,6 +478,30 @@ int misc_init_r(void) + if (expansion_config.content == 1) + setenv(expansion_config.env_var, expansion_config.env_setting); + ++ /* Scan 0x51 as well for loop-thru boards */ ++ switch (get_expansion_id(EXPANSION_EEPROM_I2C_ADDRESS + 1)) { ++ case BBTOYS_ULCD: ++ printf("Recognized BeagleBoardToys uLCD-lite board\n"); ++ setenv("buddy2", "bbtoys-ulcd"); ++ setenv("defaultdisplay", "dvi"); ++ setenv("dvimode", "800x480MR-16@60"); ++ setenv("lcd1", "i2c mw 40 00 00; i2c mw 40 04 80; i2c mw 40 0d 05"); ++ setenv("lcdcmd", "i2c dev 1 ; run lcd1; i2c dev 0"); ++ setenv("kmsmode", "video=DVI-D-1:800x480"); ++ break; ++ case BEAGLE_NO_EEPROM: ++ printf("No EEPROM on expansion board\n"); ++ setenv("buddy2", "none"); ++ break; ++ default: ++ printf("Unrecognized expansion board: %x\n", ++ expansion_config.device_vendor); ++ setenv("buddy2", "unknown"); ++ } ++ ++ if (expansion_config.content == 1) ++ setenv(expansion_config.env_var, expansion_config.env_setting); ++ + twl4030_power_init(); + switch (get_board_revision()) { + case REVISION_XM_AB: +diff --git a/configs/omap3_beagle_defconfig b/configs/omap3_beagle_defconfig +index 3e4dee747b..2d28e3acfe 100644 +--- a/configs/omap3_beagle_defconfig ++++ b/configs/omap3_beagle_defconfig +@@ -1,5 +1,6 @@ + CONFIG_ARM=y + CONFIG_ARCH_OMAP2PLUS=y ++# CONFIG_SPL_EXT_SUPPORT is not set + CONFIG_TARGET_OMAP3_BEAGLE=y + CONFIG_DISTRO_DEFAULTS=y + CONFIG_SYS_EXTRA_OPTIONS="NAND" +diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h +index 0d48d4ecc1..600fac26d1 100644 +--- a/include/configs/omap3_beagle.h ++++ b/include/configs/omap3_beagle.h +@@ -93,86 +93,40 @@ + #define CONFIG_BOOTCOMMAND \ + "run findfdt; " \ + "run distro_bootcmd; " \ +- "mmc dev ${mmcdev}; if mmc rescan; then " \ +- "if run userbutton; then " \ +- "setenv bootenv uEnv.txt;" \ +- "else " \ +- "setenv bootenv user.txt;" \ +- "fi;" \ +- "echo SD/MMC found on device ${mmcdev};" \ +- "if run loadbootenv; then " \ +- "echo Loaded environment from ${bootenv};" \ +- "run importbootenv;" \ +- "fi;" \ +- "if test -n $uenvcmd; then " \ +- "echo Running uenvcmd ...;" \ +- "run uenvcmd;" \ +- "fi;" \ +- "if run loadbootscript; then " \ +- "run bootscript; " \ +- "else " \ +- "if run loadimage; then " \ +- "run mmcboot;" \ +- "fi;" \ +- "fi; " \ +- "fi;" \ +- "run nandboot;" \ +- "setenv bootfile zImage;" \ +- "if run loadimage; then " \ +- "run loadfdt;" \ +- "run mmcbootz; " \ +- "fi; " \ ++ "setenv devtype mmc; " \ ++ "setenv mmcblk 0; " \ ++ "setenv mmcdev 0; " \ ++ "run boot;" \ + + #include + ++#include ++ + #define CONFIG_EXTRA_ENV_SETTINGS \ +- "loadaddr=0x80200000\0" \ +- "kernel_addr_r=0x80200000\0" \ +- "rdaddr=0x81000000\0" \ +- "initrd_addr_r=0x81000000\0" \ +- "fdt_high=0xffffffff\0" \ +- "fdtaddr=0x80f80000\0" \ +- "fdt_addr_r=0x80f80000\0" \ +- "usbtty=cdc_acm\0" \ +- "bootfile=uImage\0" \ +- "ramdisk=ramdisk.gz\0" \ +- "bootdir=/boot\0" \ +- "bootpart=0:2\0" \ ++ DEFAULT_LINUX_BOOT_ENV \ ++ DEFAULT_MMC_TI_ARGS \ + "console=ttyO2,115200n8\0" \ +- "mpurate=auto\0" \ +- "buddy=none\0" \ +- "optargs=\0" \ +- "camera=none\0" \ +- "vram=12M\0" \ +- "dvimode=640x480MR-16@60\0" \ +- "defaultdisplay=dvi\0" \ +- "mmcdev=0\0" \ +- "mmcroot=/dev/mmcblk0p2 rw\0" \ +- "mmcrootfstype=ext3 rootwait\0" \ +- "nandroot=ubi0:rootfs ubi.mtd=4\0" \ +- "nandrootfstype=ubifs\0" \ +- "ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=0x81000000,64M\0" \ +- "ramrootfstype=ext2\0" \ +- "mmcargs=setenv bootargs console=${console} " \ +- "${optargs} " \ +- "mpurate=${mpurate} " \ +- "buddy=${buddy} "\ +- "camera=${camera} "\ +- "vram=${vram} " \ +- "omapfb.mode=dvi:${dvimode} " \ +- "omapdss.def_disp=${defaultdisplay} " \ +- "root=${mmcroot} " \ +- "rootfstype=${mmcrootfstype}\0" \ +- "nandargs=setenv bootargs console=${console} " \ +- "${optargs} " \ +- "mpurate=${mpurate} " \ +- "buddy=${buddy} "\ +- "camera=${camera} "\ +- "vram=${vram} " \ +- "omapfb.mode=dvi:${dvimode} " \ +- "omapdss.def_disp=${defaultdisplay} " \ +- "root=${nandroot} " \ +- "rootfstype=${nandrootfstype}\0" \ ++ "fdtfile=undefined\0" \ ++ "bootpart=0:2\0" \ ++ "bootdir=/boot\0" \ ++ "bootfile=zImage\0" \ ++ "usbtty=cdc_acm\0" \ ++ "vram=16M\0" \ ++ "loadbootscript=load ${devtype} ${mmcdev} ${loadaddr} boot.scr\0" \ ++ "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \ ++ "source ${loadaddr}\0" \ ++ "bootenv=uEnv.txt\0" \ ++ "loadbootenv=load ${devtype} ${bootpart} ${loadaddr} ${bootenv}\0" \ ++ "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \ ++ "env import -t ${loadaddr} ${filesize}\0" \ ++ "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ ++ "loaduimage=load ${devtype} ${mmcdev} ${loadaddr} uImage\0" \ ++ "mmcboot=echo Booting from mmc${mmcdev} ...; " \ ++ "run args_mmc; " \ ++ "bootz ${loadaddr} - ${fdtaddr}\0" \ ++ "uimageboot=echo Booting from mmc${mmcdev} ...; " \ ++ "run args_mmc; " \ ++ "bootm ${loadaddr}\0" \ + "findfdt=" \ + "if test $beaglerev = AxBx; then " \ + "setenv fdtfile omap3-beagle.dtb; fi; " \ +@@ -186,48 +140,10 @@ + "setenv fdtfile omap3-beagle-xm.dtb; fi; " \ + "if test $fdtfile = undefined; then " \ + "echo WARNING: Could not determine device tree to use; fi; \0" \ +- "validatefdt=" \ +- "if test $beaglerev = xMAB; then " \ +- "if test ! -e mmc ${bootpart} ${bootdir}/${fdtfile}; then " \ +- "setenv fdtfile omap3-beagle-xm.dtb; " \ +- "fi; " \ +- "fi; \0" \ +- "bootenv=uEnv.txt\0" \ +- "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \ +- "importbootenv=echo Importing environment from mmc ...; " \ +- "env import -t -r $loadaddr $filesize\0" \ +- "ramargs=setenv bootargs console=${console} " \ +- "${optargs} " \ +- "mpurate=${mpurate} " \ +- "buddy=${buddy} "\ +- "vram=${vram} " \ +- "omapfb.mode=dvi:${dvimode} " \ +- "omapdss.def_disp=${defaultdisplay} " \ +- "root=${ramroot} " \ +- "rootfstype=${ramrootfstype}\0" \ +- "loadramdisk=load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \ +- "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ +- "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \ +- "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \ +- "source ${loadaddr}\0" \ +- "loadfdt=run validatefdt; load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ +- "mmcboot=echo Booting from mmc ...; " \ +- "run mmcargs; " \ +- "bootm ${loadaddr}\0" \ +- "mmcbootz=echo Booting with DT from mmc${mmcdev} ...; " \ +- "run mmcargs; " \ +- "bootz ${loadaddr} - ${fdtaddr}\0" \ +- "nandboot=echo Booting from nand ...; " \ +- "run nandargs; " \ +- "nand read ${loadaddr} 280000 400000; " \ +- "bootm ${loadaddr}\0" \ +- "ramboot=echo Booting from ramdisk ...; " \ +- "run ramargs; " \ +- "bootm ${loadaddr}\0" \ +- "userbutton=if gpio input 173; then run userbutton_xm; " \ +- "else run userbutton_nonxm; fi;\0" \ +- "userbutton_xm=gpio input 4;\0" \ +- "userbutton_nonxm=gpio input 7;\0" \ ++ "loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \ ++ "loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \ ++ EEWIKI_BOOT \ ++ EEWIKI_UNAME_BOOT \ + BOOTENV + + /* +diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h +index a4676d3a7f..a3debf92ed 100644 +--- a/include/configs/ti_armv7_common.h ++++ b/include/configs/ti_armv7_common.h +@@ -132,6 +132,132 @@ + /* Boot Argument Buffer Size */ + #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE + ++#define EEWIKI_BOOT \ ++ "boot=${devtype} dev ${mmcdev}; " \ ++ "if ${devtype} rescan; then " \ ++ "echo SD/MMC found on device ${mmcdev};" \ ++ "setenv bootpart ${mmcdev}:1; " \ ++ "echo Checking for: /uEnv.txt ...;" \ ++ "if test -e ${devtype} ${bootpart} /uEnv.txt; then " \ ++ "load ${devtype} ${bootpart} ${loadaddr} /uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /uEnv.txt;" \ ++ "echo Checking if uenvcmd is set ...;" \ ++ "if test -n ${uenvcmd}; then " \ ++ "echo Running uenvcmd ...;" \ ++ "run uenvcmd;" \ ++ "fi;" \ ++ "fi; " \ ++ "echo Checking for: /boot/uEnv.txt ...;" \ ++ "for i in 1 2 3 4 5 6 7 ; do " \ ++ "setenv mmcpart ${i};" \ ++ "setenv bootpart ${mmcdev}:${mmcpart};" \ ++ "if test -e ${devtype} ${bootpart} /boot/uEnv.txt; then " \ ++ "load ${devtype} ${bootpart} ${loadaddr} /boot/uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /boot/uEnv.txt;" \ ++ "if test -n ${dtb}; then " \ ++ "setenv fdtfile ${dtb};" \ ++ "echo Using: dtb=${fdtfile} ...;" \ ++ "fi;" \ ++ "echo Checking if uname_r is set in /boot/uEnv.txt...;" \ ++ "if test -n ${uname_r}; then " \ ++ "setenv oldroot /dev/mmcblk${mmcblk}p${mmcpart};" \ ++ "echo Running uname_boot ...;" \ ++ "run uname_boot;" \ ++ "fi;" \ ++ "fi;" \ ++ "done;" \ ++ "fi;\0" \ ++ ++#define EEWIKI_UNAME_BOOT \ ++ "uname_boot="\ ++ "setenv bootdir /boot; " \ ++ "setenv bootfile vmlinuz-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${bootdir}/${bootfile}; then " \ ++ "echo loading ${bootdir}/${bootfile} ...; "\ ++ "run loadimage;" \ ++ "setenv fdtdir /boot/dtbs/${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /usr/lib/linux-image-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtbs; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "echo; echo unable to find ${fdtfile} ...; echo booting legacy ...;"\ ++ "run args_mmc;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr}] ... ;" \ ++ "bootz ${loadaddr}; " \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi; " \ ++ "setenv rdfile initrd.img-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${bootdir}/${rdfile}; then " \ ++ "echo loading ${bootdir}/${rdfile} ...; "\ ++ "run loadrd;" \ ++ "if test -n ${netinstall_enable}; then " \ ++ "run args_netinstall; run message;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "fi;" \ ++ "if test -n ${uenv_root}; then " \ ++ "run args_uenv_root;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "fi;" \ ++ "if test -n ${uuid}; then " \ ++ "run args_mmc_uuid;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "else " \ ++ "run args_mmc_old;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "fi;" \ ++ "else " \ ++ "if test -n ${uenv_root}; then " \ ++ "run args_uenv_root;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} - ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} - ${fdtaddr}; " \ ++ "fi;" \ ++ "run args_mmc_old;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} - ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} - ${fdtaddr}; " \ ++ "fi;" \ ++ "fi;\0" \ ++ + /* + * When we have SPI, NOR or NAND flash we expect to be making use of + * mtdparts, both for ease of use in U-Boot and for passing information +@@ -244,6 +370,4 @@ + #define NETARGS "" + #endif + +-#include +- + #endif /* __CONFIG_TI_ARMV7_COMMON_H__ */ +diff --git a/include/environment/ti/mmc.h b/include/environment/ti/mmc.h +index 4305ebdaaf..7947ac5ba7 100644 +--- a/include/environment/ti/mmc.h ++++ b/include/environment/ti/mmc.h +@@ -12,22 +12,45 @@ + #define DEFAULT_MMC_TI_ARGS \ + "mmcdev=0\0" \ + "mmcrootfstype=ext4 rootwait\0" \ +- "finduuid=part uuid mmc ${bootpart} uuid\0" \ ++ "finduuid=part uuid ${interface} ${bootpart} uuid\0" \ + "args_mmc=run finduuid;setenv bootargs console=${console} " \ + "${optargs} " \ +- "root=PARTUUID=${uuid} rw " \ +- "rootfstype=${mmcrootfstype}\0" \ +- "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \ +- "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \ ++ "root=PARTUUID=${uuid} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ ++ "args_mmc_old=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "root=${oldroot} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ ++ "args_mmc_uuid=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "root=UUID=${uuid} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ ++ "args_uenv_root=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "root=${uenv_root} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${musb} ${cmdline}\0" \ ++ "args_netinstall=setenv bootargs ${netinstall_bootargs} " \ ++ "${optargs} " \ ++ "${cape_disable} " \ ++ "${cape_enable} " \ ++ "root=/dev/ram rw " \ ++ "${cmdline}\0" \ ++ "loadbootscript=load ${interface} ${mmcdev} ${loadaddr} boot.scr\0" \ ++ "bootscript=echo Running bootscript from ${interface}${mmcdev} ...; " \ + "source ${loadaddr}\0" \ + "bootenvfile=uEnv.txt\0" \ +- "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \ ++ "importbootenv=echo Importing environment from ${interface}${mmcdev} ...; " \ + "env import -t ${loadaddr} ${filesize}\0" \ +- "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}\0" \ +- "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ +- "loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ +- "envboot=mmc dev ${mmcdev}; " \ +- "if mmc rescan; then " \ ++ "loadbootenv=fatload ${interface} ${mmcdev} ${loadaddr} ${bootenvfile}\0" \ ++ "loadimage=load ${interface} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ ++ "loadrd=load ${interface} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \ ++ "loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${interface} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \ ++ "envboot=${interface} dev ${mmcdev}; " \ ++ "if ${interface} rescan; then " \ + "echo SD/MMC found on device ${mmcdev};" \ + "if run loadbootscript; then " \ + "run bootscript;" \ +-- +2.11.0 + diff --git a/v2017.07-rc2/0001-omap4_common-uEnv.txt-bootz-n-fixes.patch b/v2017.07-rc2/0001-omap4_common-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..d90f6ae --- /dev/null +++ b/v2017.07-rc2/0001-omap4_common-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,261 @@ +From e63563b8e6d5243b6566188cc445a91a05be9456 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Mon, 17 Apr 2017 21:09:22 -0500 +Subject: [PATCH] ti_omap4_common: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + configs/omap4_panda_defconfig | 5 +- + include/configs/ti_armv7_common.h | 126 ++++++++++++++++++++++++++++++++++++++ + include/configs/ti_omap4_common.h | 8 ++- + include/environment/ti/mmc.h | 31 ++++++++-- + 4 files changed, 163 insertions(+), 7 deletions(-) + +diff --git a/configs/omap4_panda_defconfig b/configs/omap4_panda_defconfig +index 91e8caf541..965560c728 100644 +--- a/configs/omap4_panda_defconfig ++++ b/configs/omap4_panda_defconfig +@@ -10,6 +10,10 @@ CONFIG_SPL=y + # CONFIG_SPL_EXT_SUPPORT is not set + # CONFIG_SPL_I2C_SUPPORT is not set + CONFIG_SPL_OS_BOOT=y ++CONFIG_AUTOBOOT_KEYED=y ++CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n" ++CONFIG_AUTOBOOT_DELAY_STR="d" ++CONFIG_AUTOBOOT_STOP_STR=" " + # CONFIG_CMD_IMLS is not set + CONFIG_CMD_ASKENV=y + # CONFIG_CMD_FLASH is not set +@@ -20,7 +24,6 @@ CONFIG_CMD_USB=y + CONFIG_CMD_GPIO=y + # CONFIG_CMD_SETEXPR is not set + # CONFIG_CMD_NFS is not set +-CONFIG_CMD_EXT4_WRITE=y + CONFIG_MMC_OMAP_HS=y + CONFIG_SYS_NS16550=y + CONFIG_USB=y +diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h +index 1561d54c9a..8855f7c718 100644 +--- a/include/configs/ti_armv7_common.h ++++ b/include/configs/ti_armv7_common.h +@@ -132,6 +132,132 @@ + /* Boot Argument Buffer Size */ + #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE + ++#define EEWIKI_BOOT \ ++ "boot=${devtype} dev ${mmcdev}; " \ ++ "if ${devtype} rescan; then " \ ++ "echo SD/MMC found on device ${mmcdev};" \ ++ "setenv bootpart ${mmcdev}:1; " \ ++ "echo Checking for: /uEnv.txt ...;" \ ++ "if test -e ${devtype} ${bootpart} /uEnv.txt; then " \ ++ "load ${devtype} ${bootpart} ${loadaddr} /uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /uEnv.txt;" \ ++ "echo Checking if uenvcmd is set ...;" \ ++ "if test -n ${uenvcmd}; then " \ ++ "echo Running uenvcmd ...;" \ ++ "run uenvcmd;" \ ++ "fi;" \ ++ "fi; " \ ++ "echo Checking for: /boot/uEnv.txt ...;" \ ++ "for i in 1 2 3 4 5 6 7 ; do " \ ++ "setenv mmcpart ${i};" \ ++ "setenv bootpart ${mmcdev}:${mmcpart};" \ ++ "if test -e ${devtype} ${bootpart} /boot/uEnv.txt; then " \ ++ "load ${devtype} ${bootpart} ${loadaddr} /boot/uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /boot/uEnv.txt;" \ ++ "if test -n ${dtb}; then " \ ++ "setenv fdtfile ${dtb};" \ ++ "echo Using: dtb=${fdtfile} ...;" \ ++ "fi;" \ ++ "echo Checking if uname_r is set in /boot/uEnv.txt...;" \ ++ "if test -n ${uname_r}; then " \ ++ "setenv oldroot /dev/mmcblk${mmcdev}p${mmcpart};" \ ++ "echo Running uname_boot ...;" \ ++ "run uname_boot;" \ ++ "fi;" \ ++ "fi;" \ ++ "done;" \ ++ "fi;\0" \ ++ ++#define EEWIKI_UNAME_BOOT \ ++ "uname_boot="\ ++ "setenv bootdir /boot; " \ ++ "setenv bootfile vmlinuz-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${bootdir}/${bootfile}; then " \ ++ "echo loading ${bootdir}/${bootfile} ...; "\ ++ "run loadimage;" \ ++ "setenv fdtdir /boot/dtbs/${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /usr/lib/linux-image-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtbs; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "echo; echo unable to find ${fdtfile} ...; echo booting legacy ...;"\ ++ "run args_mmc;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr}] ... ;" \ ++ "bootz ${loadaddr}; " \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi; " \ ++ "setenv rdfile initrd.img-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${bootdir}/${rdfile}; then " \ ++ "echo loading ${bootdir}/${rdfile} ...; "\ ++ "run loadrd;" \ ++ "if test -n ${netinstall_enable}; then " \ ++ "run args_netinstall; run message;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "fi;" \ ++ "if test -n ${uenv_root}; then " \ ++ "run args_uenv_root;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "fi;" \ ++ "if test -n ${uuid}; then " \ ++ "run args_mmc_uuid;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "else " \ ++ "run args_mmc_old;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "fi;" \ ++ "else " \ ++ "if test -n ${uenv_root}; then " \ ++ "run args_uenv_root;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} - ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} - ${fdtaddr}; " \ ++ "fi;" \ ++ "run args_mmc_old;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} - ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} - ${fdtaddr}; " \ ++ "fi;" \ ++ "fi;\0" \ ++ + /* + * When we have SPI, NOR or NAND flash we expect to be making use of + * mtdparts, both for ease of use in U-Boot and for passing information +diff --git a/include/configs/ti_omap4_common.h b/include/configs/ti_omap4_common.h +index b85db500b5..929ce370ed 100644 +--- a/include/configs/ti_omap4_common.h ++++ b/include/configs/ti_omap4_common.h +@@ -40,6 +40,7 @@ + * the timings to use or use pre-determined timings (based on using the + * dynamic method. Default to the static timing infomation. + */ ++/* Comment out next line for ES Rev B3 or A4 with new "M" Micron memory... */ + #define CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS + #ifndef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS + #define CONFIG_SYS_AUTOMATIC_SDRAM_DETECTION +@@ -77,9 +78,10 @@ + */ + #define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel #instance "=" \ ++ "setenv devtype mmc; " \ + "setenv mmcdev " #instance"; "\ +- "setenv bootpart " #instance":2 ; "\ +- "run mmcboot\0" ++ "setenv bootpart " #instance":1 ; "\ ++ "run boot\0" + + #define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \ + #devtypel #instance " " +@@ -134,6 +136,8 @@ + "setenv fdtfile omap4-duovero-parlor.dtb; fi;" \ + "if test $fdtfile = undefined; then " \ + "echo WARNING: Could not determine device tree to use; fi; \0" \ ++ EEWIKI_BOOT \ ++ EEWIKI_UNAME_BOOT \ + BOOTENV + + /* +diff --git a/include/environment/ti/mmc.h b/include/environment/ti/mmc.h +index b987f71516..ae4c6e3431 100644 +--- a/include/environment/ti/mmc.h ++++ b/include/environment/ti/mmc.h +@@ -9,11 +9,33 @@ + #define DEFAULT_MMC_TI_ARGS \ + "mmcdev=0\0" \ + "mmcrootfstype=ext4 rootwait\0" \ +- "finduuid=part uuid mmc ${bootpart} uuid\0" \ ++ "finduuid=part uuid ${devtype} ${bootpart} uuid\0" \ + "args_mmc=run finduuid;setenv bootargs console=${console} " \ + "${optargs} " \ +- "root=PARTUUID=${uuid} rw " \ +- "rootfstype=${mmcrootfstype}\0" \ ++ "root=PARTUUID=${uuid} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ ++ "args_mmc_old=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "root=${oldroot} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ ++ "args_mmc_uuid=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "root=UUID=${uuid} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ ++ "args_uenv_root=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "root=${uenv_root} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${musb} ${cmdline}\0" \ ++ "args_netinstall=setenv bootargs ${netinstall_bootargs} " \ ++ "${optargs} " \ ++ "${cape_disable} " \ ++ "${cape_enable} " \ ++ "root=/dev/ram rw " \ ++ "${cmdline}\0" \ + "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \ + "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \ + "source ${loadaddr}\0" \ +@@ -22,7 +44,8 @@ + "env import -t ${loadaddr} ${filesize}\0" \ + "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}\0" \ + "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ +- "loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ ++ "loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \ ++ "loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \ + "envboot=mmc dev ${mmcdev}; " \ + "if mmc rescan; then " \ + "echo SD/MMC found on device ${mmcdev};" \ +-- +2.11.0 + diff --git a/v2017.07-rc2/0001-omap5_common-uEnv.txt-bootz-n-fixes.patch b/v2017.07-rc2/0001-omap5_common-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..7fc8565 --- /dev/null +++ b/v2017.07-rc2/0001-omap5_common-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,265 @@ +From eeb68de959f9e3a5aa56647070de8d571af6ad56 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Mon, 17 Apr 2017 21:11:24 -0500 +Subject: [PATCH] ti_omap5_common: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + configs/omap5_uevm_defconfig | 5 +- + include/configs/ti_armv7_common.h | 126 ++++++++++++++++++++++++++++++++++++++ + include/configs/ti_omap5_common.h | 21 +++---- + include/environment/ti/mmc.h | 31 ++++++++-- + 4 files changed, 165 insertions(+), 18 deletions(-) + +diff --git a/configs/omap5_uevm_defconfig b/configs/omap5_uevm_defconfig +index 9172613ae9..1ec38d3fb7 100644 +--- a/configs/omap5_uevm_defconfig ++++ b/configs/omap5_uevm_defconfig +@@ -8,6 +8,10 @@ CONFIG_VERSION_VARIABLE=y + CONFIG_SPL=y + CONFIG_SPL_OS_BOOT=y + CONFIG_HUSH_PARSER=y ++CONFIG_AUTOBOOT_KEYED=y ++CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n" ++CONFIG_AUTOBOOT_DELAY_STR="d" ++CONFIG_AUTOBOOT_STOP_STR=" " + CONFIG_CMD_BOOTZ=y + # CONFIG_CMD_IMLS is not set + CONFIG_CMD_ASKENV=y +@@ -26,7 +30,6 @@ CONFIG_CMD_MII=y + CONFIG_CMD_PING=y + CONFIG_CMD_EXT2=y + CONFIG_CMD_EXT4=y +-CONFIG_CMD_EXT4_WRITE=y + CONFIG_CMD_FAT=y + CONFIG_CMD_FS_GENERIC=y + CONFIG_ISO_PARTITION=y +diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h +index 1561d54c9a..f2e2bc477a 100644 +--- a/include/configs/ti_armv7_common.h ++++ b/include/configs/ti_armv7_common.h +@@ -132,6 +132,132 @@ + /* Boot Argument Buffer Size */ + #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE + ++#define EEWIKI_BOOT \ ++ "boot=${devtype} dev ${mmcdev}; " \ ++ "if ${devtype} rescan; then " \ ++ "echo SD/MMC found on device ${mmcdev};" \ ++ "setenv bootpart ${mmcdev}:1; " \ ++ "echo Checking for: /uEnv.txt ...;" \ ++ "if test -e ${devtype} ${bootpart} /uEnv.txt; then " \ ++ "load ${devtype} ${bootpart} ${loadaddr} /uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /uEnv.txt;" \ ++ "echo Checking if uenvcmd is set ...;" \ ++ "if test -n ${uenvcmd}; then " \ ++ "echo Running uenvcmd ...;" \ ++ "run uenvcmd;" \ ++ "fi;" \ ++ "fi; " \ ++ "echo Checking for: /boot/uEnv.txt ...;" \ ++ "for i in 1 2 3 4 5 6 7 ; do " \ ++ "setenv mmcpart ${i};" \ ++ "setenv bootpart ${mmcdev}:${mmcpart};" \ ++ "if test -e ${devtype} ${bootpart} /boot/uEnv.txt; then " \ ++ "load ${devtype} ${bootpart} ${loadaddr} /boot/uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /boot/uEnv.txt;" \ ++ "if test -n ${dtb}; then " \ ++ "setenv fdtfile ${dtb};" \ ++ "echo Using: dtb=${fdtfile} ...;" \ ++ "fi;" \ ++ "echo Checking if uname_r is set in /boot/uEnv.txt...;" \ ++ "if test -n ${uname_r}; then " \ ++ "setenv oldroot /dev/mmcblk${mmcblk}p${mmcpart};" \ ++ "echo Running uname_boot ...;" \ ++ "run uname_boot;" \ ++ "fi;" \ ++ "fi;" \ ++ "done;" \ ++ "fi;\0" \ ++ ++#define EEWIKI_UNAME_BOOT \ ++ "uname_boot="\ ++ "setenv bootdir /boot; " \ ++ "setenv bootfile vmlinuz-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${bootdir}/${bootfile}; then " \ ++ "echo loading ${bootdir}/${bootfile} ...; "\ ++ "run loadimage;" \ ++ "setenv fdtdir /boot/dtbs/${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /usr/lib/linux-image-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtbs; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "echo; echo unable to find ${fdtfile} ...; echo booting legacy ...;"\ ++ "run args_mmc;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr}] ... ;" \ ++ "bootz ${loadaddr}; " \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi; " \ ++ "setenv rdfile initrd.img-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${bootdir}/${rdfile}; then " \ ++ "echo loading ${bootdir}/${rdfile} ...; "\ ++ "run loadrd;" \ ++ "if test -n ${netinstall_enable}; then " \ ++ "run args_netinstall; run message;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "fi;" \ ++ "if test -n ${uenv_root}; then " \ ++ "run args_uenv_root;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "fi;" \ ++ "if test -n ${uuid}; then " \ ++ "run args_mmc_uuid;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "else " \ ++ "run args_mmc_old;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "fi;" \ ++ "else " \ ++ "if test -n ${uenv_root}; then " \ ++ "run args_uenv_root;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} - ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} - ${fdtaddr}; " \ ++ "fi;" \ ++ "run args_mmc_old;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} - ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} - ${fdtaddr}; " \ ++ "fi;" \ ++ "fi;\0" \ ++ + /* + * When we have SPI, NOR or NAND flash we expect to be making use of + * mtdparts, both for ease of use in U-Boot and for passing information +diff --git a/include/configs/ti_omap5_common.h b/include/configs/ti_omap5_common.h +index d45baabf0b..76d099babb 100644 +--- a/include/configs/ti_omap5_common.h ++++ b/include/configs/ti_omap5_common.h +@@ -100,25 +100,20 @@ + "setenv fdtfile am571x-idk.dtb; fi;" \ + "if test $fdtfile = undefined; then " \ + "echo WARNING: Could not determine device tree to use; fi; \0" \ ++ EEWIKI_BOOT \ ++ EEWIKI_UNAME_BOOT \ + DFUARGS \ + NETARGS \ + + #define CONFIG_BOOTCOMMAND \ +- "if test ${dofastboot} -eq 1; then " \ +- "echo Boot fastboot requested, resetting dofastboot ...;" \ +- "setenv dofastboot 0; saveenv;" \ +- "echo Booting into fastboot ...; " \ +- "fastboot " __stringify(CONFIG_FASTBOOT_USB_DEV) "; " \ +- "fi;" \ +- "if test ${boot_fit} -eq 1; then " \ +- "run update_to_fit;" \ +- "fi;" \ + "run findfdt; " \ +- "run envboot; " \ +- "run mmcboot;" \ ++ "setenv devtype mmc; " \ ++ "setenv mmcblk 1; " \ ++ "setenv mmcdev 0; " \ ++ "run boot;" \ ++ "setenv mmcblk 0; " \ + "setenv mmcdev 1; " \ +- "setenv bootpart 1:2; " \ +- "setenv mmcroot /dev/mmcblk0p2 rw; " \ ++ "run boot;" \ + "run mmcboot;" \ + "" + +diff --git a/include/environment/ti/mmc.h b/include/environment/ti/mmc.h +index b987f71516..ae4c6e3431 100644 +--- a/include/environment/ti/mmc.h ++++ b/include/environment/ti/mmc.h +@@ -9,11 +9,33 @@ + #define DEFAULT_MMC_TI_ARGS \ + "mmcdev=0\0" \ + "mmcrootfstype=ext4 rootwait\0" \ +- "finduuid=part uuid mmc ${bootpart} uuid\0" \ ++ "finduuid=part uuid ${devtype} ${bootpart} uuid\0" \ + "args_mmc=run finduuid;setenv bootargs console=${console} " \ + "${optargs} " \ +- "root=PARTUUID=${uuid} rw " \ +- "rootfstype=${mmcrootfstype}\0" \ ++ "root=PARTUUID=${uuid} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ ++ "args_mmc_old=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "root=${oldroot} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ ++ "args_mmc_uuid=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "root=UUID=${uuid} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ ++ "args_uenv_root=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "root=${uenv_root} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${musb} ${cmdline}\0" \ ++ "args_netinstall=setenv bootargs ${netinstall_bootargs} " \ ++ "${optargs} " \ ++ "${cape_disable} " \ ++ "${cape_enable} " \ ++ "root=/dev/ram rw " \ ++ "${cmdline}\0" \ + "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \ + "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \ + "source ${loadaddr}\0" \ +@@ -22,7 +44,8 @@ + "env import -t ${loadaddr} ${filesize}\0" \ + "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}\0" \ + "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ +- "loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ ++ "loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \ ++ "loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \ + "envboot=mmc dev ${mmcdev}; " \ + "if mmc rescan; then " \ + "echo SD/MMC found on device ${mmcdev};" \ +-- +2.11.0 + diff --git a/v2017.07-rc2/0001-sama5d2_xplained-fixes.patch b/v2017.07-rc2/0001-sama5d2_xplained-fixes.patch new file mode 100644 index 0000000..5d93940 --- /dev/null +++ b/v2017.07-rc2/0001-sama5d2_xplained-fixes.patch @@ -0,0 +1,71 @@ +From 34264e74657d148c8de78c9a5ce9100087750a2a Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 23 May 2017 11:54:20 -0500 +Subject: [PATCH] sama5d2_xplained fixes + +Signed-off-by: Robert Nelson +--- + arch/arm/mach-at91/spl.c | 2 +- + configs/sama5d2_xplained_mmc_defconfig | 5 +++++ + include/configs/sama5d2_xplained.h | 8 +++----- + 3 files changed, 9 insertions(+), 6 deletions(-) + +diff --git a/arch/arm/mach-at91/spl.c b/arch/arm/mach-at91/spl.c +index e113336b7b..7f128b50a7 100644 +--- a/arch/arm/mach-at91/spl.c ++++ b/arch/arm/mach-at91/spl.c +@@ -40,7 +40,7 @@ u32 spl_boot_device(void) + #if defined(CONFIG_SYS_USE_MMC) + if (dev == ATMEL_SAMA5_BOOT_FROM_MCI) { + #if defined(CONFIG_SPL_OF_CONTROL) +- return BOOT_DEVICE_MMC1; ++ return BOOT_DEVICE_MMC2; + #else + if (off == 0) + return BOOT_DEVICE_MMC1; +diff --git a/configs/sama5d2_xplained_mmc_defconfig b/configs/sama5d2_xplained_mmc_defconfig +index f064a43c6b..272263085c 100644 +--- a/configs/sama5d2_xplained_mmc_defconfig ++++ b/configs/sama5d2_xplained_mmc_defconfig +@@ -18,12 +18,17 @@ CONFIG_BOOTDELAY=3 + CONFIG_SPL=y + CONFIG_SPL_SEPARATE_BSS=y + CONFIG_HUSH_PARSER=y ++CONFIG_AUTOBOOT_KEYED=y ++CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n" ++CONFIG_AUTOBOOT_DELAY_STR="d" ++CONFIG_AUTOBOOT_STOP_STR=" " + CONFIG_CMD_BOOTZ=y + # CONFIG_CMD_IMI is not set + # CONFIG_CMD_IMLS is not set + # CONFIG_CMD_LOADS is not set + # CONFIG_CMD_FLASH is not set + CONFIG_CMD_MMC=y ++CONFIG_CMD_PART=y + CONFIG_CMD_SF=y + CONFIG_CMD_I2C=y + CONFIG_CMD_USB=y +diff --git a/include/configs/sama5d2_xplained.h b/include/configs/sama5d2_xplained.h +index 42fb1e11d0..6643627f67 100644 +--- a/include/configs/sama5d2_xplained.h ++++ b/include/configs/sama5d2_xplained.h +@@ -61,13 +61,11 @@ + #undef CONFIG_BOOTCOMMAND + + #define FAT_ENV_DEVICE_AND_PART "1" +-#define CONFIG_BOOTCOMMAND "fatload mmc 1:1 0x21000000 at91-sama5d2_xplained.dtb; " \ ++#define CONFIG_BOOTCOMMAND "part uuid mmc 1:2 partuuid; " \ ++ "setenv bootargs console=ttyS0,115200 root=PARTUUID=${partuuid} ro rootwait; " \ ++ "fatload mmc 1:1 0x21000000 /dtbs/at91-sama5d2_xplained.dtb; " \ + "fatload mmc 1:1 0x22000000 zImage; " \ + "bootz 0x22000000 - 0x21000000" +-#undef CONFIG_BOOTARGS +-#define CONFIG_BOOTARGS \ +- "console=ttyS0,115200 earlyprintk root=/dev/mmcblk1p2 rw rootwait" +- + #endif + + /* SPL */ +-- +2.11.0 + diff --git a/v2017.07-rc2/0001-sama5d3_xplained-uEnv.txt-bootz-n-fixes.patch b/v2017.07-rc2/0001-sama5d3_xplained-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..aba62be --- /dev/null +++ b/v2017.07-rc2/0001-sama5d3_xplained-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,56 @@ +From 3b503adca9244a71b0d3f0db310cdc00e2a0d126 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 23 May 2017 14:01:05 -0500 +Subject: [PATCH] sama5d3_xplained: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + configs/sama5d3_xplained_mmc_defconfig | 5 +++++ + include/configs/at91-sama5_common.h | 7 +++---- + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/configs/sama5d3_xplained_mmc_defconfig b/configs/sama5d3_xplained_mmc_defconfig +index d28d1d9a33..8cbfe424ec 100644 +--- a/configs/sama5d3_xplained_mmc_defconfig ++++ b/configs/sama5d3_xplained_mmc_defconfig +@@ -18,12 +18,17 @@ CONFIG_BOOTDELAY=3 + CONFIG_SPL=y + CONFIG_SPL_SEPARATE_BSS=y + CONFIG_HUSH_PARSER=y ++CONFIG_AUTOBOOT_KEYED=y ++CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n" ++CONFIG_AUTOBOOT_DELAY_STR="d" ++CONFIG_AUTOBOOT_STOP_STR=" " + CONFIG_CMD_BOOTZ=y + # CONFIG_CMD_IMI is not set + # CONFIG_CMD_IMLS is not set + # CONFIG_CMD_LOADS is not set + # CONFIG_CMD_FLASH is not set + CONFIG_CMD_MMC=y ++CONFIG_CMD_PART=y + CONFIG_CMD_USB=y + # CONFIG_CMD_FPGA is not set + CONFIG_CMD_DHCP=y +diff --git a/include/configs/at91-sama5_common.h b/include/configs/at91-sama5_common.h +index dbd4d843eb..afc59e01ef 100644 +--- a/include/configs/at91-sama5_common.h ++++ b/include/configs/at91-sama5_common.h +@@ -64,12 +64,11 @@ + #define CONFIG_BOOTCOMMAND "if test ! -n ${dtb_name}; then " \ + "setenv dtb_name at91-${board_name}.dtb; " \ + "fi; " \ +- "fatload mmc 0:1 0x21000000 ${dtb_name}; " \ ++ "part uuid mmc 0:2 partuuid; " \ ++ "setenv bootargs console=ttyS0,115200 root=PARTUUID=${partuuid} ro rootwait; " \ ++ "fatload mmc 0:1 0x21000000 /dtbs/${dtb_name}; " \ + "fatload mmc 0:1 0x22000000 zImage; " \ + "bootz 0x22000000 - 0x21000000" +-#define CONFIG_BOOTARGS \ +- "console=ttyS0,115200 earlyprintk " \ +- "root=/dev/mmcblk0p2 rw rootwait" + #else + #define CONFIG_BOOTARGS \ + "console=ttyS0,115200 earlyprintk " \ +-- +2.11.0 + diff --git a/v2017.07-rc2/0001-sama5d3xek-uEnv.txt-bootz-n-fixes.patch b/v2017.07-rc2/0001-sama5d3xek-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..8efb72c --- /dev/null +++ b/v2017.07-rc2/0001-sama5d3xek-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,54 @@ +From 062d4ffd88c705b38917a602d1ebc4439fe012c2 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 23 May 2017 14:03:51 -0500 +Subject: [PATCH] sama5d3xek: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + configs/sama5d3xek_mmc_defconfig | 5 +++++ + include/configs/at91-sama5_common.h | 7 +++---- + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/configs/sama5d3xek_mmc_defconfig b/configs/sama5d3xek_mmc_defconfig +index 994bc048ba..ea7c3f9b9e 100644 +--- a/configs/sama5d3xek_mmc_defconfig ++++ b/configs/sama5d3xek_mmc_defconfig +@@ -20,10 +20,15 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y + CONFIG_SPL=y + CONFIG_SPL_SEPARATE_BSS=y + CONFIG_HUSH_PARSER=y ++CONFIG_AUTOBOOT_KEYED=y ++CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n" ++CONFIG_AUTOBOOT_DELAY_STR="d" ++CONFIG_AUTOBOOT_STOP_STR=" " + CONFIG_CMD_BOOTZ=y + # CONFIG_CMD_IMI is not set + # CONFIG_CMD_LOADS is not set + CONFIG_CMD_MMC=y ++CONFIG_CMD_PART=y + CONFIG_CMD_SF=y + CONFIG_CMD_USB=y + # CONFIG_CMD_FPGA is not set +diff --git a/include/configs/at91-sama5_common.h b/include/configs/at91-sama5_common.h +index dbd4d843eb..afc59e01ef 100644 +--- a/include/configs/at91-sama5_common.h ++++ b/include/configs/at91-sama5_common.h +@@ -64,12 +64,11 @@ + #define CONFIG_BOOTCOMMAND "if test ! -n ${dtb_name}; then " \ + "setenv dtb_name at91-${board_name}.dtb; " \ + "fi; " \ +- "fatload mmc 0:1 0x21000000 ${dtb_name}; " \ ++ "part uuid mmc 0:2 partuuid; " \ ++ "setenv bootargs console=ttyS0,115200 root=PARTUUID=${partuuid} ro rootwait; " \ ++ "fatload mmc 0:1 0x21000000 /dtbs/${dtb_name}; " \ + "fatload mmc 0:1 0x22000000 zImage; " \ + "bootz 0x22000000 - 0x21000000" +-#define CONFIG_BOOTARGS \ +- "console=ttyS0,115200 earlyprintk " \ +- "root=/dev/mmcblk0p2 rw rootwait" + #else + #define CONFIG_BOOTARGS \ + "console=ttyS0,115200 earlyprintk " \ +-- +2.11.0 + diff --git a/v2017.07-rc2/0001-sama5d4_xplained-uEnv.txt-bootz-n-fixes.patch b/v2017.07-rc2/0001-sama5d4_xplained-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..dcf1173 --- /dev/null +++ b/v2017.07-rc2/0001-sama5d4_xplained-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,56 @@ +From fd7c766f556034c3183704331fd27b465a07c68b Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 23 May 2017 14:16:27 -0500 +Subject: [PATCH] sama5d4_xplained: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + configs/sama5d4_xplained_mmc_defconfig | 5 +++++ + include/configs/at91-sama5_common.h | 7 +++---- + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/configs/sama5d4_xplained_mmc_defconfig b/configs/sama5d4_xplained_mmc_defconfig +index 4fc44e5747..b24a3b1663 100644 +--- a/configs/sama5d4_xplained_mmc_defconfig ++++ b/configs/sama5d4_xplained_mmc_defconfig +@@ -18,12 +18,17 @@ CONFIG_BOOTDELAY=3 + CONFIG_SPL=y + CONFIG_SPL_SEPARATE_BSS=y + CONFIG_HUSH_PARSER=y ++CONFIG_AUTOBOOT_KEYED=y ++CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n" ++CONFIG_AUTOBOOT_DELAY_STR="d" ++CONFIG_AUTOBOOT_STOP_STR=" " + CONFIG_CMD_BOOTZ=y + # CONFIG_CMD_IMI is not set + # CONFIG_CMD_IMLS is not set + # CONFIG_CMD_LOADS is not set + # CONFIG_CMD_FLASH is not set + CONFIG_CMD_MMC=y ++CONFIG_CMD_PART=y + CONFIG_CMD_SF=y + CONFIG_CMD_USB=y + # CONFIG_CMD_FPGA is not set +diff --git a/include/configs/at91-sama5_common.h b/include/configs/at91-sama5_common.h +index dbd4d843eb..afc59e01ef 100644 +--- a/include/configs/at91-sama5_common.h ++++ b/include/configs/at91-sama5_common.h +@@ -64,12 +64,11 @@ + #define CONFIG_BOOTCOMMAND "if test ! -n ${dtb_name}; then " \ + "setenv dtb_name at91-${board_name}.dtb; " \ + "fi; " \ +- "fatload mmc 0:1 0x21000000 ${dtb_name}; " \ ++ "part uuid mmc 0:2 partuuid; " \ ++ "setenv bootargs console=ttyS0,115200 root=PARTUUID=${partuuid} ro rootwait; " \ ++ "fatload mmc 0:1 0x21000000 /dtbs/${dtb_name}; " \ + "fatload mmc 0:1 0x22000000 zImage; " \ + "bootz 0x22000000 - 0x21000000" +-#define CONFIG_BOOTARGS \ +- "console=ttyS0,115200 earlyprintk " \ +- "root=/dev/mmcblk0p2 rw rootwait" + #else + #define CONFIG_BOOTARGS \ + "console=ttyS0,115200 earlyprintk " \ +-- +2.11.0 + diff --git a/v2017.07-rc2/0001-sama5d4ek-uEnv.txt-bootz-n-fixes.patch b/v2017.07-rc2/0001-sama5d4ek-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..e90e5e0 --- /dev/null +++ b/v2017.07-rc2/0001-sama5d4ek-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,42 @@ +From 0fa00e30e62cbdf3cf581fdc6d4bca24d438085e Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Mon, 20 Jun 2016 14:41:08 -0500 +Subject: [PATCH] sama5d4ek: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + include/configs/at91-sama5_common.h | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/include/configs/at91-sama5_common.h b/include/configs/at91-sama5_common.h +index dc955b2..f9b5786 100644 +--- a/include/configs/at91-sama5_common.h ++++ b/include/configs/at91-sama5_common.h +@@ -49,6 +49,8 @@ + */ + + #ifdef CONFIG_SYS_USE_MMC ++#define CONFIG_PARTITION_UUIDS ++#define CONFIG_CMD_PART + + #ifdef CONFIG_ENV_IS_IN_MMC + /* Use raw reserved sectors to save environment */ +@@ -68,12 +70,11 @@ + #define CONFIG_BOOTCOMMAND "if test ! -n ${dtb_name}; then " \ + "setenv dtb_name at91-${board_name}.dtb; " \ + "fi; " \ +- "fatload mmc 0:1 0x21000000 ${dtb_name}; " \ ++ "part uuid mmc 0:2 partuuid; " \ ++ "setenv bootargs console=ttyS0,115200 root=PARTUUID=${partuuid} ro rootwait; " \ ++ "fatload mmc 0:1 0x21000000 /dtbs/${dtb_name}; " \ + "fatload mmc 0:1 0x22000000 zImage; " \ + "bootz 0x22000000 - 0x21000000" +-#define CONFIG_BOOTARGS \ +- "console=ttyS0,115200 earlyprintk " \ +- "root=/dev/mmcblk0p2 rw rootwait" + #else + #define CONFIG_BOOTARGS \ + "console=ttyS0,115200 earlyprintk " \ +-- +2.8.1 + diff --git a/v2017.07-rc2/0001-udoo-uEnv.txt-bootz-n-fixes.patch b/v2017.07-rc2/0001-udoo-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..ee3ccb7 --- /dev/null +++ b/v2017.07-rc2/0001-udoo-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,284 @@ +From 2186a68bbcca5b5ce03c47d09d9fac8c0349d042 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Wed, 24 May 2017 14:14:00 -0500 +Subject: [PATCH] udoo: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + configs/udoo_defconfig | 6 ++ + include/configs/udoo.h | 202 +++++++++++++++++++++++++++++++++---------------- + 2 files changed, 144 insertions(+), 64 deletions(-) + +diff --git a/configs/udoo_defconfig b/configs/udoo_defconfig +index 3bf55058d7..f4d03fe616 100644 +--- a/configs/udoo_defconfig ++++ b/configs/udoo_defconfig +@@ -8,16 +8,22 @@ CONFIG_SPL_MMC_SUPPORT=y + CONFIG_SPL_SERIAL_SUPPORT=y + CONFIG_SPL_LIBDISK_SUPPORT=y + CONFIG_SPL_WATCHDOG_SUPPORT=y ++CONFIG_DISTRO_DEFAULTS=y + CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6QDL" + CONFIG_BOOTDELAY=3 + CONFIG_BOARD_EARLY_INIT_F=y + CONFIG_SPL=y + CONFIG_SPL_EXT_SUPPORT=y + CONFIG_SPL_I2C_SUPPORT=y ++CONFIG_AUTOBOOT_KEYED=y ++CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n" ++CONFIG_AUTOBOOT_DELAY_STR="d" ++CONFIG_AUTOBOOT_STOP_STR=" " + CONFIG_HUSH_PARSER=y + CONFIG_CMD_BOOTZ=y + # CONFIG_CMD_IMLS is not set + CONFIG_CMD_MMC=y ++CONFIG_CMD_PART=y + CONFIG_CMD_GPIO=y + CONFIG_CMD_DHCP=y + CONFIG_CMD_MII=y +diff --git a/include/configs/udoo.h b/include/configs/udoo.h +index d84aa1679e..a245e2f2b6 100644 +--- a/include/configs/udoo.h ++++ b/include/configs/udoo.h +@@ -9,6 +9,7 @@ + #ifndef __CONFIG_H + #define __CONFIG_H + ++#include + #include "mx6_common.h" + + #include "imx6_spl.h" +@@ -55,19 +56,21 @@ + #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + + #define CONFIG_EXTRA_ENV_SETTINGS \ +- "script=boot.scr\0" \ +- "image=zImage\0" \ +- "console=ttymxc1\0" \ ++ "console=ttymxc1,115200\0" \ + "splashpos=m,m\0" \ ++ "fdtfile=undefined\0" \ + "fdt_high=0xffffffff\0" \ + "initrd_high=0xffffffff\0" \ +- "fdt_file=undefined\0" \ ++ "rdaddr=0x12A00000\0" \ ++ "fdt_addr_r=0x18000000\0" \ + "fdt_addr=0x18000000\0" \ +- "boot_fdt=try\0" \ + "ip_dyn=yes\0" \ ++ "optargs=\0" \ ++ "cmdline=\0" \ + "mmcdev=0\0" \ + "mmcpart=1\0" \ +- "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \ ++ "mmcroot=/dev/mmcblk0p2 ro\0" \ ++ "mmcrootfstype=ext4 rootwait\0" \ + "update_sd_firmware_filename=u-boot.imx\0" \ + "update_sd_firmware=" \ + "if test ${ip_dyn} = yes; then " \ +@@ -82,73 +85,144 @@ + "mmc write ${loadaddr} 0x2 ${fw_sz}; " \ + "fi; " \ + "fi\0" \ +- "mmcargs=setenv bootargs console=${console},${baudrate} " \ +- "root=${mmcroot}\0" \ +- "loadbootscript=" \ +- "load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ +- "bootscript=echo Running bootscript from mmc ...; " \ +- "source\0" \ +- "loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ +- "loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ +- "mmcboot=echo Booting from mmc ...; " \ +- "run mmcargs; " \ +- "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ +- "if run loadfdt; then " \ +- "bootz ${loadaddr} - ${fdt_addr}; " \ +- "else " \ +- "if test ${boot_fdt} = try; then " \ +- "bootz; " \ +- "else " \ +- "echo WARN: Cannot load the DT; " \ +- "fi; " \ ++ "mmcargs=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "root=${mmcroot} " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ ++ "findfdt="\ ++ "if test $board_rev = MX6Q ; then " \ ++ "setenv fdtfile imx6q-udoo.dtb; fi; " \ ++ "if test $board_rev = MX6DL ; then " \ ++ "setenv fdtfile imx6dl-udoo.dtb; fi; " \ ++ "if test $fdtfile = undefined; then " \ ++ "echo WARNING: Could not determine dtb to use; fi; \0" \ ++ "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ ++ "loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \ ++ "loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdt_addr} ${fdtdir}/${fdtfile}\0" \ ++ "mmcboot=${devtype} dev ${mmcdev}; " \ ++ "if ${devtype} rescan; then " \ ++ "echo SD/MMC found on device ${mmcdev};" \ ++ "setenv bootpart ${mmcdev}:1; " \ ++ "echo Checking for: /uEnv.txt ...;" \ ++ "if test -e ${devtype} ${bootpart} /uEnv.txt; then " \ ++ "load ${devtype} ${bootpart} ${loadaddr} /uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /uEnv.txt;" \ ++ "echo Checking if uenvcmd is set ...;" \ ++ "if test -n ${uenvcmd}; then " \ ++ "echo Running uenvcmd ...;" \ ++ "run uenvcmd;" \ ++ "fi;" \ + "fi; " \ +- "else " \ +- "bootz; " \ ++ "echo Checking for: /boot/uEnv.txt ...;" \ ++ "for i in 1 2 3 4 5 6 7 ; do " \ ++ "setenv mmcpart ${i};" \ ++ "setenv bootpart ${mmcdev}:${mmcpart};" \ ++ "if test -e ${devtype} ${bootpart} /boot/uEnv.txt; then " \ ++ "load ${devtype} ${bootpart} ${loadaddr} /boot/uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /boot/uEnv.txt;" \ ++ "if test -n ${dtb}; then " \ ++ "setenv fdtfile ${dtb};" \ ++ "echo Using: dtb=${fdtfile} ...;" \ ++ "fi;" \ ++ "echo Checking if uname_r is set in /boot/uEnv.txt...;" \ ++ "if test -n ${uname_r}; then " \ ++ "echo Running uname_boot ...;" \ ++ "part uuid ${devtype} ${bootpart} partuuid ;" \ ++ "setenv mmcroot PARTUUID=${partuuid} ro;" \ ++ "echo Using: mmcroot=${mmcroot} ...;" \ ++ "run uname_boot;" \ ++ "fi;" \ ++ "fi;" \ ++ "done;" \ + "fi;\0" \ +- "netargs=setenv bootargs console=${console},${baudrate} " \ +- "root=/dev/nfs " \ +- "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ +- "netboot=echo Booting from net ...; " \ +- "run netargs; " \ +- "if test ${ip_dyn} = yes; then " \ +- "setenv get_cmd dhcp; " \ +- "else " \ +- "setenv get_cmd tftp; " \ +- "fi; " \ +- "${get_cmd} ${image}; " \ +- "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ +- "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ +- "bootz ${loadaddr} - ${fdt_addr}; " \ ++ "uname_boot="\ ++ "setenv bootdir /boot; " \ ++ "setenv bootfile vmlinuz-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${bootdir}/${bootfile}; then " \ ++ "echo loading ${bootdir}/${bootfile} ...; "\ ++ "run loadimage;" \ ++ "setenv fdtdir /boot/dtbs/${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ + "else " \ +- "if test ${boot_fdt} = try; then " \ +- "bootz; " \ ++ "setenv fdtdir /usr/lib/linux-image-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ + "else " \ +- "echo WARN: Cannot load the DT; " \ +- "fi; " \ ++ "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtbs; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "echo; echo unable to find ${fdtfile} ...; echo booting legacy ...;"\ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr}] ... ;" \ ++ "bootz ${loadaddr}; " \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ + "fi; " \ +- "else " \ +- "bootz; " \ ++ "setenv rdfile initrd.img-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${bootdir}/${rdfile}; then " \ ++ "echo loading ${bootdir}/${rdfile} ...; "\ ++ "run loadrd;" \ ++ "if test -n ${uuid}; then " \ ++ "setenv mmcroot UUID=${uuid} ro;" \ ++ "fi;" \ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdt_addr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdt_addr}; " \ ++ "else " \ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} - ${fdt_addr}] ... ;" \ ++ "bootz ${loadaddr} - ${fdt_addr}; " \ ++ "fi;" \ + "fi;\0" \ +- "findfdt=" \ +- "if test $board_rev = MX6Q ; then " \ +- "setenv fdt_file imx6q-udoo.dtb; fi; " \ +- "if test $board_rev = MX6DL ; then " \ +- "setenv fdt_file imx6dl-udoo.dtb; fi; " \ +- "if test $fdt_file = undefined; then " \ +- "echo WARNING: Could not determine dtb to use; fi; \0" ++ "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ ++ "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ ++ "ramdisk_addr_r=0x13000000\0" \ ++ "ramdiskaddr=0x13000000\0" \ ++ "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \ ++ BOOTENV ++ ++#define BOOT_TARGET_DEVICES(func) \ ++ func(MMC, mmc, 0) \ ++ func(MMC, mmc, 1) + + #define CONFIG_BOOTCOMMAND \ + "run findfdt; " \ +- "mmc dev ${mmcdev}; if mmc rescan; then " \ +- "if run loadbootscript; then " \ +- "run bootscript; " \ +- "else " \ +- "if run loadimage; then " \ +- "run mmcboot; " \ +- "else run netboot; " \ +- "fi; " \ +- "fi; " \ +- "else run netboot; fi" ++ "setenv devtype mmc;" \ ++ "setenv mmcdev 0;" \ ++ "run mmcboot;" \ ++ "setenv mmcdev 1;" \ ++ "run mmcboot;" \ ++ "run distro_bootcmd" ++ ++#include + + /* Print Buffer Size */ + #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) +-- +2.11.0 + diff --git a/v2017.07-rc2/0001-vf610twr-uEnv.txt-bootz-n-fixes.patch b/v2017.07-rc2/0001-vf610twr-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..4231cc4 --- /dev/null +++ b/v2017.07-rc2/0001-vf610twr-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,151 @@ +From 8f9288f63e0e67c5c145ec0a17cab1b164154032 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Wed, 28 Sep 2016 10:25:33 -0500 +Subject: [PATCH] vf610twr: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + configs/vf610twr_defconfig | 2 ++ + include/configs/vf610twr.h | 80 ++++++++++++++++++++++++++++++++++++---------- + 2 files changed, 65 insertions(+), 17 deletions(-) + +diff --git a/configs/vf610twr_defconfig b/configs/vf610twr_defconfig +index 5794c28..49b6a7c 100644 +--- a/configs/vf610twr_defconfig ++++ b/configs/vf610twr_defconfig +@@ -15,6 +15,8 @@ CONFIG_CMD_DHCP=y + CONFIG_CMD_MII=y + CONFIG_CMD_PING=y + CONFIG_CMD_FAT=y ++CONFIG_CMD_EXT4=y ++CONFIG_CMD_FS_GENERIC=y + CONFIG_CMD_UBI=y + CONFIG_OF_CONTROL=y + CONFIG_DM=y +diff --git a/include/configs/vf610twr.h b/include/configs/vf610twr.h +index 03586f0..0ba42b6 100644 +--- a/include/configs/vf610twr.h ++++ b/include/configs/vf610twr.h +@@ -76,6 +76,7 @@ + + #define CONFIG_GENERIC_MMC + #define CONFIG_DOS_PARTITION ++#define CONFIG_SUPPORT_RAW_INITRD + + #define CONFIG_FEC_MXC + #define CONFIG_MII +@@ -130,13 +131,16 @@ + MEM_LAYOUT_ENV_SETTINGS \ + "script=boot.scr\0" \ + "image=zImage\0" \ +- "console=ttyLP1\0" \ ++ "console=ttyLP1,115200\0" \ + "fdt_file=vf610-twr.dtb\0" \ + "boot_fdt=try\0" \ + "ip_dyn=yes\0" \ + "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \ + "mmcpart=1\0" \ +- "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \ ++ "mmcroot=/dev/mmcblk0p2 ro\0" \ ++ "mmcrootfstype=ext4 rootwait\0" \ ++ "optargs=\0" \ ++ "cmdline=\0" \ + "update_sd_firmware_filename=u-boot.imx\0" \ + "update_sd_firmware=" \ + "if test ${ip_dyn} = yes; then " \ +@@ -151,15 +155,41 @@ + "mmc write ${loadaddr} 0x2 ${fw_sz}; " \ + "fi; " \ + "fi\0" \ +- "mmcargs=setenv bootargs console=${console},${baudrate} " \ +- "root=${mmcroot}\0" \ ++ "mmcargs=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "root=${mmcroot} " \ ++ "rootfstype=${mmcrootfstype}\0" \ ++ "${cmdline}\0" \ + "loadbootscript=" \ + "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ + "bootscript=echo Running bootscript from mmc ...; " \ + "source\0" \ +- "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ +- "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ +- "mmcboot=echo Booting from mmc ...; " \ ++ "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ ++ "loadfdt=echo loading ${fdtdir}/${fdt_file} ...; load mmc ${bootpart} ${fdt_addr} ${fdtdir}/${fdt_file}\0" \ ++ "mmcboot=mmc dev ${mmcdev}; " \ ++ "if mmc rescan; then " \ ++ "echo Checking for: /boot/uEnv.txt ...;" \ ++ "for i in 1 2 3 4 5 6 7 ; do " \ ++ "setenv mmcpart ${i};" \ ++ "setenv bootpart ${mmcdev}:${mmcpart};" \ ++ "if test -e mmc ${bootpart} /boot/uEnv.txt; then " \ ++ "load mmc ${bootpart} ${loadaddr} /boot/uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /boot/uEnv.txt;" \ ++ "if test -n ${dtb}; then " \ ++ "setenv fdt_file ${dtb};" \ ++ "echo Using: dtb=${fdt_file} ...;" \ ++ "fi;" \ ++ "echo Checking if uname_r is set in /boot/uEnv.txt...;" \ ++ "if test -n ${uname_r}; then " \ ++ "echo Running uname_boot ...;" \ ++ "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart} ro;" \ ++ "run uname_boot;" \ ++ "fi;" \ ++ "fi;" \ ++ "done;" \ ++ "fi;\0" \ ++ "mmcboot_old=echo Booting from mmc ...; " \ + "run mmcargs; " \ + "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ + "if run loadfdt; then " \ +@@ -197,19 +227,35 @@ + "fi; " \ + "else " \ + "bootz; " \ ++ "fi;\0" \ ++ "uname_boot="\ ++ "setenv bootdir /boot; " \ ++ "setenv bootfile vmlinuz-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${bootdir}/${bootfile}; then " \ ++ "echo loading ${bootdir}/${bootfile} ...; "\ ++ "run loadimage;" \ ++ "setenv fdtdir /boot/dtbs/${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /usr/lib/linux-image-${uname_r}; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \ ++ "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi; " \ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} - ${fdt_addr}] ... ;" \ ++ "bootz ${loadaddr} - ${fdt_addr}; " \ + "fi;\0" + + #define CONFIG_BOOTCOMMAND \ +- "mmc dev ${mmcdev}; if mmc rescan; then " \ +- "if run loadbootscript; then " \ +- "run bootscript; " \ +- "else " \ +- "if run loadimage; then " \ +- "run mmcboot; " \ +- "else run netboot; " \ +- "fi; " \ +- "fi; " \ +- "else run netboot; fi" ++ "run mmcboot;" + + /* Miscellaneous configurable options */ + #define CONFIG_SYS_LONGHELP /* undef to save memory */ +-- +2.9.3 + diff --git a/v2017.07-rc2/0001-wandboard-uEnv.txt-bootz-n-fixes.patch b/v2017.07-rc2/0001-wandboard-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..c8d2f4c --- /dev/null +++ b/v2017.07-rc2/0001-wandboard-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,200 @@ +From 58930bcc44362e35021ab1d7d4e36dceb55f08cb Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Fri, 19 May 2017 16:43:24 -0500 +Subject: [PATCH] wandboard: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + configs/wandboard_defconfig | 5 ++ + include/configs/wandboard.h | 125 +++++++++++++++++++++++++++++++++++++++++++- + 2 files changed, 128 insertions(+), 2 deletions(-) + +diff --git a/configs/wandboard_defconfig b/configs/wandboard_defconfig +index f4c9b6bc76..7aa2767eb4 100644 +--- a/configs/wandboard_defconfig ++++ b/configs/wandboard_defconfig +@@ -18,9 +18,14 @@ CONFIG_BOARD_EARLY_INIT_F=y + CONFIG_SPL=y + CONFIG_SPL_EXT_SUPPORT=y + CONFIG_SPL_I2C_SUPPORT=y ++CONFIG_AUTOBOOT_KEYED=y ++CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n" ++CONFIG_AUTOBOOT_DELAY_STR="d" ++CONFIG_AUTOBOOT_STOP_STR=" " + # CONFIG_CMD_IMLS is not set + # CONFIG_CMD_FLASH is not set + CONFIG_CMD_MMC=y ++CONFIG_CMD_PART=y + CONFIG_CMD_I2C=y + CONFIG_CMD_USB=y + CONFIG_CMD_GPIO=y +diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h +index 47daf724ab..c4ef31b80e 100644 +--- a/include/configs/wandboard.h ++++ b/include/configs/wandboard.h +@@ -88,10 +88,16 @@ + "fdtfile=undefined\0" \ + "fdt_high=0xffffffff\0" \ + "initrd_high=0xffffffff\0" \ ++ "rdaddr=0x12A00000\0" \ + "fdt_addr_r=0x18000000\0" \ + "fdt_addr=0x18000000\0" \ + "ip_dyn=yes\0" \ +- "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \ ++ "optargs=\0" \ ++ "cmdline=\0" \ ++ "mmcdev=0\0" \ ++ "mmcpart=1\0" \ ++ "mmcroot=/dev/mmcblk0p2 ro\0" \ ++ "mmcrootfstype=ext4 rootwait\0" \ + "update_sd_firmware_filename=u-boot.imx\0" \ + "update_sd_firmware=" \ + "if test ${ip_dyn} = yes; then " \ +@@ -106,6 +112,11 @@ + "mmc write ${loadaddr} 0x2 ${fw_sz}; " \ + "fi; " \ + "fi\0" \ ++ "mmcargs=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "root=${mmcroot} " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ + "findfdt="\ + "if test $board_name = C1 && test $board_rev = MX6Q ; then " \ + "setenv fdtfile imx6q-wandboard.dtb; fi; " \ +@@ -117,6 +128,111 @@ + "setenv fdtfile imx6dl-wandboard-revb1.dtb; fi; " \ + "if test $fdtfile = undefined; then " \ + "echo WARNING: Could not determine dtb to use; fi; \0" \ ++ "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ ++ "loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \ ++ "loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdt_addr} ${fdtdir}/${fdtfile}\0" \ ++ "mmcboot=${devtype} dev ${mmcdev}; " \ ++ "if ${devtype} rescan; then " \ ++ "echo SD/MMC found on device ${mmcdev};" \ ++ "setenv bootpart ${mmcdev}:1; " \ ++ "echo Checking for: /uEnv.txt ...;" \ ++ "if test -e ${devtype} ${bootpart} /uEnv.txt; then " \ ++ "load ${devtype} ${bootpart} ${loadaddr} /uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /uEnv.txt;" \ ++ "echo Checking if uenvcmd is set ...;" \ ++ "if test -n ${uenvcmd}; then " \ ++ "echo Running uenvcmd ...;" \ ++ "run uenvcmd;" \ ++ "fi;" \ ++ "fi; " \ ++ "echo Checking for: /boot/uEnv.txt ...;" \ ++ "for i in 1 2 3 4 5 6 7 ; do " \ ++ "setenv mmcpart ${i};" \ ++ "setenv bootpart ${mmcdev}:${mmcpart};" \ ++ "if test -e ${devtype} ${bootpart} /boot/uEnv.txt; then " \ ++ "load ${devtype} ${bootpart} ${loadaddr} /boot/uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /boot/uEnv.txt;" \ ++ "if test -n ${dtb}; then " \ ++ "setenv fdtfile ${dtb};" \ ++ "echo Using: dtb=${fdtfile} ...;" \ ++ "fi;" \ ++ "echo Checking if uname_r is set in /boot/uEnv.txt...;" \ ++ "if test -n ${uname_r}; then " \ ++ "echo Running uname_boot ...;" \ ++ "part uuid ${devtype} ${bootpart} partuuid ;" \ ++ "setenv mmcroot PARTUUID=${partuuid} ro;" \ ++ "echo Using: mmcroot=${mmcroot} ...;" \ ++ "run uname_boot;" \ ++ "fi;" \ ++ "fi;" \ ++ "done;" \ ++ "fi;\0" \ ++ "uname_boot="\ ++ "setenv bootdir /boot; " \ ++ "setenv bootfile vmlinuz-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${bootdir}/${bootfile}; then " \ ++ "echo loading ${bootdir}/${bootfile} ...; "\ ++ "run loadimage;" \ ++ "setenv fdtdir /boot/dtbs/${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /usr/lib/linux-image-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtbs; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "echo; echo unable to find ${fdtfile} ...; echo booting legacy ...;"\ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr}] ... ;" \ ++ "bootz ${loadaddr}; " \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi; " \ ++ "setenv rdfile initrd.img-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${bootdir}/${rdfile}; then " \ ++ "echo loading ${bootdir}/${rdfile} ...; "\ ++ "run loadrd;" \ ++ "if test -n ${uuid}; then " \ ++ "setenv mmcroot UUID=${uuid} ro;" \ ++ "fi;" \ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdt_addr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdt_addr}; " \ ++ "else " \ ++ "run mmcargs;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} - ${fdt_addr}] ... ;" \ ++ "bootz ${loadaddr} - ${fdt_addr}; " \ ++ "fi;" \ ++ "fi;\0" \ + "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "ramdisk_addr_r=0x13000000\0" \ +@@ -133,6 +249,11 @@ + + #define CONFIG_BOOTCOMMAND \ + "run findfdt; " \ ++ "setenv devtype mmc;" \ ++ "setenv mmcdev 0;" \ ++ "run mmcboot;" \ ++ "setenv mmcdev 1;" \ ++ "run mmcboot;" \ + "run distro_bootcmd" + + #include +@@ -151,7 +272,7 @@ + (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) + + /* Environment organization */ +-#define CONFIG_ENV_SIZE (8 * 1024) ++#define CONFIG_ENV_SIZE (10 * 1024) + + #define CONFIG_ENV_IS_IN_MMC + #define CONFIG_ENV_OFFSET (768 * 1024) +-- +2.11.0 + diff --git a/v2017.07-rc2/0002-U-Boot-BeagleBone-Cape-Manager.patch b/v2017.07-rc2/0002-U-Boot-BeagleBone-Cape-Manager.patch new file mode 100644 index 0000000..2e9a0e9 --- /dev/null +++ b/v2017.07-rc2/0002-U-Boot-BeagleBone-Cape-Manager.patch @@ -0,0 +1,819 @@ +From b0d49233b84d46f1af5017e8ce72267a98ec99e1 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Fri, 9 Jun 2017 14:36:29 -0500 +Subject: [PATCH 2/2] U-Boot: BeagleBone Cape Manager + +Signed-off-by: Robert Nelson +--- + arch/arm/mach-omap2/am33xx/clock_am33xx.c | 1 + + board/ti/am335x/board.c | 369 ++++++++++++++++++++++++++++++ + board/ti/am335x/board.h | 17 ++ + board/ti/am335x/hash-string.h | 59 +++++ + board/ti/am335x/mux.c | 15 ++ + include/configs/ti_armv7_common.h | 185 +++++++++++++++ + include/configs/ti_armv7_omap.h | 3 + + include/environment/ti/mmc.h | 15 ++ + 8 files changed, 664 insertions(+) + create mode 100644 board/ti/am335x/hash-string.h + +diff --git a/arch/arm/mach-omap2/am33xx/clock_am33xx.c b/arch/arm/mach-omap2/am33xx/clock_am33xx.c +index 1780bbdb6f..a1ee457328 100644 +--- a/arch/arm/mach-omap2/am33xx/clock_am33xx.c ++++ b/arch/arm/mach-omap2/am33xx/clock_am33xx.c +@@ -214,6 +214,7 @@ void enable_basic_clocks(void) + &cmper->gpio2clkctrl, + &cmper->gpio3clkctrl, + &cmper->i2c1clkctrl, ++ &cmper->i2c2clkctrl, + &cmper->cpgmac0clkctrl, + &cmper->spi0clkctrl, + &cmrtc->rtcclkctrl, +diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c +index 2fb58e6ed8..97b6516945 100644 +--- a/board/ti/am335x/board.c ++++ b/board/ti/am335x/board.c +@@ -38,6 +38,7 @@ + #include + #include "../common/board_detect.h" + #include "board.h" ++#include "hash-string.h" + + DECLARE_GLOBAL_DATA_PTR; + +@@ -75,9 +76,371 @@ void do_board_detect(void) + if (ti_i2c_eeprom_am_get(CONFIG_EEPROM_BUS_ADDRESS, + CONFIG_EEPROM_CHIP_ADDRESS)) + printf("ti_i2c_eeprom_init failed\n"); ++ ++ //hack-ish, needs to mux'ed early, in do_cape_detect was too late... ++ enable_i2c2_pin_mux(); ++ i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED2, CONFIG_SYS_OMAP24_I2C_SLAVE2); + } + #endif + ++#define CAPE_EEPROM_ADDR0 0x54 ++#define CAPE_EEPROM_ADDR1 0x55 ++#define CAPE_EEPROM_ADDR2 0x56 ++#define CAPE_EEPROM_ADDR3 0x57 ++ ++void write_hex (unsigned char i) ++{ ++ char cc; ++ ++ cc = i >> 4; ++ cc &= 0xf; ++ if (cc > 9) ++ serial_putc (cc + 55); ++ else ++ serial_putc (cc + 48); ++ cc = i & 0xf; ++ if (cc > 9) ++ serial_putc (cc + 55); ++ else ++ serial_putc (cc + 48); ++} ++ ++#define NOT_POP 0x0 ++#define PINS_TAKEN 0x0 ++ ++#define UNK_BASE_DTB 0x0 ++#define BBB_BASE_DTB 0x1 ++#define BBBL_BASE_DTB 0x2 ++#define BBE_BASE_DTB 0x3 ++ ++#define BBB_EMMC 0x1 ++ ++#define BBB_TDA998X_AUDIO 0x1 ++#define BBB_TDA998X_NAUDIO 0x2 ++#define BBB_ADV7511_AUDIO 0x3 ++#define BBB_ADV7511_NAUDIO 0x4 ++ ++#define BBB_ADC 0x1 ++ ++#define BBBW_WL1835 0x1 ++#define BBGW_WL1835 0x2 ++ ++#define BBB_GENERIC_SILICON 0x0 ++/* ES 2.0 Silcon doesnt have 1Ghz eFuse */ ++#define BBB_AM335X_2_SILICON 0x1 ++/* Octavo, ti-cpufreq, detects extra 300Mhz mode, thus disabling cpufreq */ ++#define BBB_OSD3358_SILICON 0x2 ++ ++#define CAPE_UNIVERSAL 0x0 ++#define CAPE_UNIVERSAL_BBB 0x01 ++#define CAPE_UNIVERSAL_BBG 0x02 ++#define CAPE_UNIVERSAL_BBGW 0x03 ++ ++static int probe_cape_eeprom(struct am335x_cape_eeprom_id *cape_header) ++{ ++ unsigned char addr; ++ /* /lib/firmware/BB-CAPE-DISP-CT4-00A0.dtbo */ ++ /* 14 + 16 + 1 + 4 + 5 = 40 */ ++ char cape_overlay[40]; ++ const char s[2] = "."; ++ char *token; ++ ++ char base_dtb=BBB_BASE_DTB; ++ char virtual_emmc=NOT_POP; ++ char virtual_video=NOT_POP; ++ char virtual_wireless=NOT_POP; ++ char silicon=BBB_GENERIC_SILICON; ++ char cape_universal=CAPE_UNIVERSAL; ++ char virtual_adc=NOT_POP; ++ ++ char *name = NULL; ++ ++ if (board_is_bone_lt()) { ++ puts("BeagleBone Black:\n"); ++ virtual_emmc=BBB_EMMC; ++ virtual_video=BBB_TDA998X_AUDIO; ++ virtual_wireless=NOT_POP; ++ virtual_adc=BBB_ADC; ++ silicon=BBB_AM335X_2_SILICON; ++ cape_universal=CAPE_UNIVERSAL_BBB; ++ name = "A335BNLT"; ++ ++ if (!strncmp(board_ti_get_rev(), "BLA", 3)) { ++ puts("Model: BeagleBoard.org BeagleBone Blue:\n"); ++ /* Special case */ ++ base_dtb=BBBL_BASE_DTB; ++ virtual_emmc=NOT_POP; ++ virtual_video=NOT_POP; ++ virtual_wireless=NOT_POP; ++ virtual_adc=NOT_POP; ++ silicon=BBB_OSD3358_SILICON; ++ cape_universal=CAPE_UNIVERSAL; ++ name = "BBBL"; ++ } ++ if (!strncmp(board_ti_get_rev(), "BW", 2)) { ++ puts("Model: BeagleBoard.org BeagleBone Black Wireless:\n"); ++ virtual_wireless=BBBW_WL1835; ++ silicon=BBB_OSD3358_SILICON; ++ name = "BBBW"; ++ } ++ if (!strncmp(board_ti_get_rev(), "BBG", 3)) { ++ /* catches again in board_is_bbg1() */ ++ //puts("Model: SeeedStudio BeagleBone Green:\n"); ++ virtual_video=NOT_POP; ++ silicon=BBB_GENERIC_SILICON; ++ cape_universal=CAPE_UNIVERSAL_BBG; ++ name = "BBG1"; ++ } ++ if (!strncmp(board_ti_get_rev(), "GW1", 3)) { ++ puts("Model: SeeedStudio BeagleBone Green Wireless:\n"); ++ virtual_video=NOT_POP; ++ virtual_wireless=BBGW_WL1835; ++ silicon=BBB_GENERIC_SILICON; ++ cape_universal=CAPE_UNIVERSAL_BBGW; ++ } ++ if (!strncmp(board_ti_get_rev(), "AIA", 3)) { ++ puts("Model: Arrow BeagleBone Black Industrial:\n"); ++ virtual_video=BBB_ADV7511_AUDIO; ++ silicon=BBB_GENERIC_SILICON; ++ cape_universal=CAPE_UNIVERSAL; ++ } ++ if (!strncmp(board_ti_get_rev(), "EIA", 3)) { ++ puts("Model: Element14 BeagleBone Black Industrial:\n"); ++ silicon=BBB_GENERIC_SILICON; ++ } ++ if (!strncmp(board_ti_get_rev(), "SE", 2)) { ++ puts("Model: SanCloud BeagleBone Enhanced:\n"); ++ base_dtb=BBE_BASE_DTB; ++ silicon=BBB_GENERIC_SILICON; ++ cape_universal=CAPE_UNIVERSAL_BBB; ++ name = "SBBE"; ++ } ++ if (!strncmp(board_ti_get_rev(), "ME0", 3)) { ++ puts("Model: MENTOREL BeagleBone uSomIQ:\n"); ++ virtual_video=NOT_POP; ++ silicon=BBB_GENERIC_SILICON; ++ cape_universal=CAPE_UNIVERSAL_BBG; ++ } ++ if (!strncmp(board_ti_get_rev(), "NAD", 3)) { ++ puts("Model: Neuromeka BeagleBone Air:\n"); ++ silicon=BBB_GENERIC_SILICON; ++ cape_universal=CAPE_UNIVERSAL; ++ } ++ } ++ ++ if (board_is_bbg1()) { ++ puts("Model: SeeedStudio BeagleBone Green:\n"); ++ virtual_emmc=BBB_EMMC; ++ virtual_video=NOT_POP; ++ virtual_wireless=NOT_POP; ++ virtual_adc=BBB_ADC; ++ silicon=BBB_GENERIC_SILICON; ++ cape_universal=CAPE_UNIVERSAL_BBG; ++ name = "BBG1"; ++ } ++ ++ set_board_info_env(name); ++ ++ i2c_set_bus_num(2); ++ ++ for ( addr = CAPE_EEPROM_ADDR0; addr <= CAPE_EEPROM_ADDR3; addr++ ) { ++ if (i2c_probe(addr)) { ++ puts("BeagleBone: cape eeprom: i2c_probe: 0x"); write_hex(addr); puts(":\n"); ++ } else { ++ /* read the eeprom using i2c */ ++ if (i2c_read(addr, 0, 2, (uchar *)cape_header, ++ sizeof(struct am335x_cape_eeprom_id))) { ++ puts("BeagleBone: cape eeprom: Could not read the EEPROM; something fundamentally" ++ " wrong on the I2C bus.\n"); ++ return -EIO; ++ } ++ ++ if (cape_header->header == 0xEE3355AA) { ++ strlcpy(cape_overlay, "/lib/firmware/", 14 + 1); ++ ++ /* cape_header->part_number stop at [.] */ ++ token = strtok(cape_header->part_number, s); ++ strncat(cape_overlay, token, 16); ++ ++ strncat(cape_overlay, "-", 1); ++ strncat(cape_overlay, cape_header->version, 4); ++ strncat(cape_overlay, ".dtbo", 5); ++ ++ unsigned long cape_overlay_hash = hash_string(cape_overlay); ++ ++ puts("BeagleBone: cape eeprom: i2c_probe: 0x"); ++ write_hex(addr); ++ printf(": %s [0x%lx]\n", cape_overlay, cape_overlay_hash); ++ ++ switch(cape_overlay_hash) { ++ case 0x3c766f: /* /lib/firmware/BB-CAPE-DISP-CT4-00A0.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0x24f51cf: /* /lib/firmware/BB-BONE-CAM-VVDN-00A0.dtbo */ ++ virtual_emmc=PINS_TAKEN; ++ break; ++ case 0x4b0c13f: /* /lib/firmware/NL-AB-BBCL-00B0.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0x93b574f: /* /lib/firmware/BB-GREEN-HDMI-00A0.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ //d15bb ++ case 0xd15b80f: /* /lib/firmware/DLPDLCR2000-00A0.dtbo */ ++ virtual_video=PINS_TAKEN; ++ //FIXME: still needs to be tested on hardware... ++ setenv("overlay_i2c_script", "i2c dev 2; i2c mw 0x1b 0x0b.2 0x00; i2c mw 0x1b 0x0c.2 0x1b;"); ++ break; ++ case 0xe3f55df: /* /lib/firmware/BB-BONE-NH7C-01-A0.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0xfc93c8f: /* /lib/firmware/BB-BONE-LCD7-01-00A3.dtbo */ ++ virtual_video=PINS_TAKEN; ++ virtual_adc=PINS_TAKEN; ++ break; ++ //fe131 ++ case 0xfe1313f: /* /lib/firmware/BB-BONE-4D5R-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ //fe132 ++ case 0xfe1323f: /* /lib/firmware/BB-BONE-4D4R-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0xfe1327f: /* /lib/firmware/BB-BONE-4D4N-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0xfe132cf: /* /lib/firmware/BB-BONE-4D4C-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ //fe133 ++ case 0xfe1337f: /* /lib/firmware/BB-BONE-4D7N-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0xfe133cf: /* /lib/firmware/BB-BONE-4D7C-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ //fe135 ++ case 0xfe1357f: /* /lib/firmware/BB-BONE-4D5N-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0xfe135cf: /* /lib/firmware/BB-BONE-4D5C-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ //fe137 ++ case 0xfe1373f: /* /lib/firmware/BB-BONE-4D7R-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0xfe93c1f: /* /lib/firmware/BB-BONE-LCD4-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ virtual_adc=PINS_TAKEN; ++ break; ++ } ++ ++ switch(addr) { ++ case CAPE_EEPROM_ADDR0: ++ setenv("uboot_overlay_addr0", cape_overlay); ++ break; ++ case CAPE_EEPROM_ADDR1: ++ setenv("uboot_overlay_addr1", cape_overlay); ++ break; ++ case CAPE_EEPROM_ADDR2: ++ setenv("uboot_overlay_addr2", cape_overlay); ++ break; ++ case CAPE_EEPROM_ADDR3: ++ setenv("uboot_overlay_addr3", cape_overlay); ++ break; ++ } ++ } else { ++ puts("BeagleBone: found invalid cape eeprom: i2c_probe: 0x"); write_hex(addr); puts(":\n"); ++ } ++ } ++ } ++ ++ switch(base_dtb) { ++ case BBB_BASE_DTB: ++ setenv("uboot_base_dtb", "am335x-boneblack-uboot.dtb"); ++ setenv("uboot_try_cape_universal", "1"); ++ break; ++ case BBE_BASE_DTB: ++ setenv("uboot_base_dtb", "am335x-sancloud-bbe-uboot.dtb"); ++ setenv("uboot_try_cape_universal", "1"); ++ break; ++ case BBBL_BASE_DTB: ++ setenv("uboot_base_dtb", "am335x-boneblue.dtb"); ++ break; ++ } ++ ++ switch(silicon) { ++ case BBB_AM335X_2_SILICON: ++ setenv("uboot_silicon", "/lib/firmware/AM335X-20-00A0.dtbo"); ++ break; ++ case BBB_OSD3358_SILICON: ++ setenv("uboot_silicon", "/lib/firmware/OSD3358-00A0.dtbo"); ++ break; ++ } ++ ++ if (virtual_emmc == BBB_EMMC) { ++ setenv("uboot_emmc", "/lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo"); ++ } ++ ++ switch(virtual_video) { ++ case BBB_TDA998X_AUDIO: ++ setenv("uboot_video", "/lib/firmware/BB-HDMI-TDA998x-00A0.dtbo"); ++ setenv("uboot_video_naudio", "/lib/firmware/BB-NHDMI-TDA998x-00A0.dtbo"); ++ break; ++ case BBB_TDA998X_NAUDIO: ++ setenv("uboot_video", "/lib/firmware/BB-NHDMI-TDA998x-00A0.dtbo"); ++ setenv("uboot_video_naudio", "/lib/firmware/BB-NHDMI-TDA998x-00A0.dtbo"); ++ break; ++ case BBB_ADV7511_AUDIO: ++ setenv("uboot_video", "/lib/firmware/BB-HDMI-ADV7511-00A0.dtbo"); ++ setenv("uboot_video_naudio", "/lib/firmware/BB-NHDMI-ADV7511-00A0.dtbo"); ++ break; ++ case BBB_ADV7511_NAUDIO: ++ setenv("uboot_video", "/lib/firmware/BB-NHDMI-ADV7511-00A0.dtbo"); ++ setenv("uboot_video_naudio", "/lib/firmware/BB-NHDMI-ADV7511-00A0.dtbo"); ++ break; ++ } ++ ++ switch(virtual_wireless) { ++ case BBBW_WL1835: ++ setenv("uboot_wireless", "/lib/firmware/BB-BBBW-WL1835-00A0.dtbo"); ++ break; ++ case BBGW_WL1835: ++ setenv("uboot_wireless", "/lib/firmware/BB-BBGW-WL1835-00A0.dtbo"); ++ break; ++ } ++ ++ switch(virtual_adc) { ++ case BBB_ADC: ++ setenv("uboot_adc", "/lib/firmware/BB-ADC-00A0.dtbo"); ++ break; ++ } ++ ++ switch(cape_universal) { ++ case CAPE_UNIVERSAL_BBB: ++ setenv("uboot_cape_universal_bbb", "1"); ++ break; ++ case CAPE_UNIVERSAL_BBG: ++ setenv("uboot_cape_universal_bbg", "1"); ++ break; ++ case CAPE_UNIVERSAL_BBGW: ++ setenv("uboot_cape_universal_bbgw", "1"); ++ break; ++ } ++ ++ i2c_set_bus_num(0); ++ return 0; ++} ++ ++void do_cape_detect(void) ++{ ++ struct am335x_cape_eeprom_id cape_header; ++ ++ i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED2, CONFIG_SYS_OMAP24_I2C_SLAVE2); ++ probe_cape_eeprom(&cape_header); ++} ++ + #ifndef CONFIG_DM_SERIAL + struct serial_device *default_serial_console(void) + { +@@ -787,6 +1150,12 @@ int board_late_init(void) + } + #endif + ++#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG ++#ifdef CONFIG_TI_I2C_BOARD_DETECT ++ do_cape_detect(); ++#endif ++#endif ++ + return 0; + } + #endif +diff --git a/board/ti/am335x/board.h b/board/ti/am335x/board.h +index fdf8c56258..4962e610f4 100644 +--- a/board/ti/am335x/board.h ++++ b/board/ti/am335x/board.h +@@ -11,6 +11,22 @@ + #ifndef _BOARD_H_ + #define _BOARD_H_ + ++struct am335x_cape_eeprom_id { ++ unsigned int header; ++ char eeprom_rev[2]; ++ char board_name[32]; ++ char version[4]; ++ char manufacture[16]; ++ char part_number[16]; ++ char number_of_pins[2]; ++ char serial_number[12]; ++ char pin_usage[140]; ++ char vdd_3v3exp[ 2]; ++ char vdd_5v[ 2]; ++ char sys_5v[2]; ++ char dc_supplied[2]; ++}; ++ + /** + * AM335X (EMIF_4D) EMIF REG_COS_COUNT_1, REG_COS_COUNT_2, and + * REG_PR_OLD_COUNT values to avoid LCDC DMA FIFO underflows and Frame +@@ -98,5 +114,6 @@ void enable_uart3_pin_mux(void); + void enable_uart4_pin_mux(void); + void enable_uart5_pin_mux(void); + void enable_i2c0_pin_mux(void); ++void enable_i2c2_pin_mux(void); + void enable_board_pin_mux(void); + #endif +diff --git a/board/ti/am335x/hash-string.h b/board/ti/am335x/hash-string.h +new file mode 100644 +index 0000000000..b267a87788 +--- /dev/null ++++ b/board/ti/am335x/hash-string.h +@@ -0,0 +1,59 @@ ++/* Description of GNU message catalog format: string hashing function. ++ Copyright (C) 1995, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify it ++ under the terms of the GNU Library General Public License as published ++ by the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Library General Public ++ License along with this program; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++ USA. */ ++ ++/* @@ end of prolog @@ */ ++ ++#ifndef PARAMS ++# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES ++# define PARAMS(Args) Args ++# else ++# define PARAMS(Args) () ++# endif ++#endif ++ ++/* We assume to have `unsigned long int' value with at least 32 bits. */ ++#define HASHWORDBITS 32 ++ ++ ++/* Defines the so called `hashpjw' function by P.J. Weinberger ++ [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools, ++ 1986, 1987 Bell Telephone Laboratories, Inc.] */ ++static unsigned long int hash_string PARAMS ((const char *__str_param)); ++ ++static inline unsigned long int ++hash_string (str_param) ++ const char *str_param; ++{ ++ unsigned long int hval, g; ++ const char *str = str_param; ++ ++ /* Compute the hash value for the given string. */ ++ hval = 0; ++ while (*str != '\0') ++ { ++ hval <<= 4; ++ hval += (unsigned long int) *str++; ++ g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4)); ++ if (g != 0) ++ { ++ hval ^= g >> (HASHWORDBITS - 8); ++ hval ^= g; ++ } ++ } ++ return hval; ++} +diff --git a/board/ti/am335x/mux.c b/board/ti/am335x/mux.c +index 6d65e99a1a..2ae077fb14 100644 +--- a/board/ti/am335x/mux.c ++++ b/board/ti/am335x/mux.c +@@ -120,6 +120,14 @@ static struct module_pin_mux i2c1_pin_mux[] = { + {-1}, + }; + ++static struct module_pin_mux i2c2_pin_mux[] = { ++ {OFFSET(uart1_ctsn), (MODE(3) | RXACTIVE | ++ PULLUP_EN | PULLUDEN | SLEWCTRL)}, /* I2C_DATA */ ++ {OFFSET(uart1_rtsn), (MODE(3) | RXACTIVE | ++ PULLUP_EN | PULLUDEN | SLEWCTRL)}, /* I2C_SCLK */ ++ {-1}, ++}; ++ + static struct module_pin_mux spi0_pin_mux[] = { + {OFFSET(spi0_sclk), (MODE(0) | RXACTIVE | PULLUDEN)}, /* SPI0_SCLK */ + {OFFSET(spi0_d0), (MODE(0) | RXACTIVE | +@@ -304,6 +312,11 @@ void enable_i2c0_pin_mux(void) + configure_module_pin_mux(i2c0_pin_mux); + } + ++void enable_i2c2_pin_mux(void) ++{ ++ configure_module_pin_mux(i2c2_pin_mux); ++} ++ + /* + * The AM335x GP EVM, if daughter card(s) are connected, can have 8 + * different profiles. These profiles determine what peripherals are +@@ -352,6 +365,7 @@ void enable_board_pin_mux(void) + #else + configure_module_pin_mux(mmc1_pin_mux); + #endif ++ configure_module_pin_mux(i2c2_pin_mux); + } else if (board_is_gp_evm()) { + /* General Purpose EVM */ + unsigned short profile = detect_daughter_board_profile(); +@@ -397,6 +411,7 @@ void enable_board_pin_mux(void) + #else + configure_module_pin_mux(mmc1_pin_mux); + #endif ++ configure_module_pin_mux(i2c2_pin_mux); + } else if (board_is_icev2()) { + configure_module_pin_mux(mmc0_pin_mux); + configure_module_pin_mux(gpio0_18_pin_mux); +diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h +index d85f5fbd4c..b7228b89dc 100644 +--- a/include/configs/ti_armv7_common.h ++++ b/include/configs/ti_armv7_common.h +@@ -272,6 +272,19 @@ + "echo loading ${bootdir}/${bootfile} ...; "\ + "run loadimage;" \ + "setenv fdtdir /boot/dtbs/${uname_r}; " \ ++ "if test -n ${enable_uboot_overlays}; then " \ ++ "if test -n ${uboot_base_dtb}; then " \ ++ "if test -n ${dtb}; then " \ ++ "echo uboot_overlays: dtb=${dtb} in /boot/uEnv.txt, unable to use [uboot_base_dtb=${uboot_base_dtb}] ... ;" \ ++ "else " \ ++ "echo uboot_overlays: [uboot_base_dtb=${uboot_base_dtb}] ... ;" \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${uboot_base_dtb}; then " \ ++ "setenv fdtfile ${uboot_base_dtb};" \ ++ "echo uboot_overlays: Switching too: dtb=${fdtfile} ...;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ + "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ + "run loadfdt;" \ + "else " \ +@@ -312,6 +325,178 @@ + "fi;" \ + "fi;" \ + "fi; " \ ++ "if test $board_name = BBBL; then " \ ++ "env delete -f enable_uboot_overlays; fi; " \ ++ "if test -n ${enable_uboot_overlays}; then " \ ++ "setenv fdt_buffer 0x60000;" \ ++ "if test -n ${uboot_fdt_buffer}; then " \ ++ "setenv fdt_buffer ${uboot_fdt_buffer};" \ ++ "fi;" \ ++ "echo uboot_overlays: [fdt_buffer=${fdt_buffer}] ... ;" \ ++ "if test -n ${uboot_silicon}; then " \ ++ "setenv uboot_overlay ${uboot_silicon}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_addr0}; then " \ ++ "if test -n ${disable_uboot_overlay_addr0}; then " \ ++ "echo uboot_overlays: uboot loading of [${uboot_overlay_addr0}] disabled by /boot/uEnv.txt [disable_uboot_overlay_addr0=1]...;" \ ++ "else " \ ++ "setenv uboot_overlay ${uboot_overlay_addr0}; " \ ++ "run capeloadoverlay;" \ ++ "fi;" \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_addr1}; then " \ ++ "if test -n ${disable_uboot_overlay_addr1}; then " \ ++ "echo uboot_overlays: uboot loading of [${uboot_overlay_addr1}] disabled by /boot/uEnv.txt [disable_uboot_overlay_addr1=1]...;" \ ++ "else " \ ++ "setenv uboot_overlay ${uboot_overlay_addr1}; " \ ++ "run capeloadoverlay;" \ ++ "fi;" \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_addr2}; then " \ ++ "if test -n ${disable_uboot_overlay_addr2}; then " \ ++ "echo uboot_overlays: uboot loading of [${uboot_overlay_addr2}] disabled by /boot/uEnv.txt [disable_uboot_overlay_addr2=1]...;" \ ++ "else " \ ++ "setenv uboot_overlay ${uboot_overlay_addr2}; " \ ++ "run capeloadoverlay;" \ ++ "fi;" \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_addr3}; then " \ ++ "if test -n ${disable_uboot_overlay_addr3}; then " \ ++ "echo uboot_overlays: uboot loading of [${uboot_overlay_addr3}] disabled by /boot/uEnv.txt [disable_uboot_overlay_addr3=1]...;" \ ++ "else " \ ++ "setenv uboot_overlay ${uboot_overlay_addr3}; " \ ++ "run capeloadoverlay;" \ ++ "fi;" \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_addr4}; then " \ ++ "setenv uboot_overlay ${uboot_overlay_addr4}; " \ ++ "run capeloadoverlay;" \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_addr5}; then " \ ++ "setenv uboot_overlay ${uboot_overlay_addr5}; " \ ++ "run capeloadoverlay;" \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_addr6}; then " \ ++ "setenv uboot_overlay ${uboot_overlay_addr6}; " \ ++ "run capeloadoverlay;" \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_addr7}; then " \ ++ "setenv uboot_overlay ${uboot_overlay_addr7}; " \ ++ "run capeloadoverlay;" \ ++ "fi;" \ ++ "if test -n ${uboot_emmc}; then " \ ++ "if test -n ${disable_uboot_overlay_emmc}; then " \ ++ "echo uboot_overlays: uboot loading of [${uboot_emmc}] disabled by /boot/uEnv.txt [disable_uboot_overlay_emmc=1]...;" \ ++ "else " \ ++ "setenv uboot_overlay ${uboot_emmc}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "fi;" \ ++ "if test -n ${uboot_video}; then " \ ++ "if test -n ${disable_uboot_overlay_video}; then " \ ++ "echo uboot_overlays: uboot loading of [${uboot_video}] disabled by /boot/uEnv.txt [disable_uboot_overlay_video=1]...;" \ ++ "else " \ ++ "if test -n ${disable_uboot_overlay_audio}; then " \ ++ "echo uboot_overlays: uboot loading of [${uboot_video}] disabled by /boot/uEnv.txt [disable_uboot_overlay_audio=1]...;" \ ++ "setenv uboot_overlay ${uboot_video_naudio}; " \ ++ "run virtualloadoverlay;" \ ++ "else " \ ++ "setenv uboot_overlay ${uboot_video}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "if test -n ${uboot_wireless}; then " \ ++ "if test -n ${disable_uboot_overlay_wireless}; then " \ ++ "echo uboot_overlays: uboot loading of [${uboot_wireless}] disabled by /boot/uEnv.txt [disable_uboot_overlay_wireless=1]...;" \ ++ "else " \ ++ "setenv uboot_overlay ${uboot_wireless}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "fi;" \ ++ "if test -n ${uboot_adc}; then " \ ++ "if test -n ${disable_uboot_overlay_adc}; then " \ ++ "echo uboot_overlays: uboot loading of [${uboot_adc}] disabled by /boot/uEnv.txt [disable_uboot_overlay_adc=1]...;" \ ++ "else " \ ++ "setenv uboot_overlay ${uboot_adc}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_pru}; then " \ ++ "setenv uboot_overlay ${uboot_overlay_pru}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "if test -n ${dtb_overlay}; then " \ ++ "setenv uboot_overlay ${dtb_overlay}; " \ ++ "echo uboot_overlays: [dtb_overlay=${uboot_overlay}] ... ;" \ ++ "run capeloadoverlay;" \ ++ "fi;" \ ++ "if test -n ${overlay_i2c_script}; then " \ ++ "echo running: [${overlay_i2c_script}] ... ;" \ ++ "run overlay_i2c_script;" \ ++ "fi;" \ ++ "if test -n ${uboot_try_cape_universal}; then " \ ++ "if test -n ${enable_uboot_cape_universal}; then " \ ++ "if test -n ${cape_uboot}; then " \ ++ "echo uboot_overlays: cape universal disabled, external cape enabled or detected...;" \ ++ "else " \ ++ "if test -n ${uboot_cape_universal_bbb}; then " \ ++ "if test -n ${disable_uboot_overlay_emmc}; then " \ ++ "if test -n ${disable_uboot_overlay_video}; then " \ ++ "setenv uboot_overlay /lib/firmware/univ-bbb-xxx-00A0.dtbo; " \ ++ "else " \ ++ "if test -n ${disable_uboot_overlay_audio}; then " \ ++ "setenv uboot_overlay /lib/firmware/univ-bbb-xVx-00A0.dtbo; " \ ++ "else " \ ++ "setenv uboot_overlay /lib/firmware/univ-bbb-xVA-00A0.dtbo; " \ ++ "fi;" \ ++ "fi;" \ ++ "else " \ ++ "if test -n ${disable_uboot_overlay_video}; then " \ ++ "setenv uboot_overlay /lib/firmware/univ-bbb-Exx-00A0.dtbo; " \ ++ "else " \ ++ "if test -n ${disable_uboot_overlay_audio}; then " \ ++ "setenv uboot_overlay /lib/firmware/univ-bbb-EVx-00A0.dtbo; " \ ++ "else " \ ++ "setenv uboot_overlay /lib/firmware/univ-bbb-EVA-00A0.dtbo; " \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "run capeloadoverlay;" \ ++ "fi;" \ ++ "if test -n ${uboot_cape_universal_bbg}; then " \ ++ "if test -n ${disable_uboot_overlay_emmc}; then " \ ++ "setenv uboot_overlay /lib/firmware/univ-bbb-xxx-00A0.dtbo; " \ ++ "else " \ ++ "setenv uboot_overlay /lib/firmware/univ-bbb-Exx-00A0.dtbo; " \ ++ "fi;" \ ++ "run capeloadoverlay;" \ ++ "fi;" \ ++ "if test -n ${uboot_cape_universal_bbgw}; then " \ ++ "if test -n ${disable_uboot_overlay_emmc}; then " \ ++ "if test -n ${disable_uboot_overlay_wireless}; then " \ ++ "setenv uboot_overlay /lib/firmware/univ-bbgw-xx-00A0.dtbo; " \ ++ "else " \ ++ "setenv uboot_overlay /lib/firmware/univ-bbgw-xW-00A0.dtbo; " \ ++ "fi;" \ ++ "else " \ ++ "if test -n ${disable_uboot_overlay_wireless}; then " \ ++ "setenv uboot_overlay /lib/firmware/univ-bbgw-Ex-00A0.dtbo; " \ ++ "else " \ ++ "setenv uboot_overlay /lib/firmware/univ-bbgw-EW-00A0.dtbo; " \ ++ "fi;" \ ++ "fi;" \ ++ "run capeloadoverlay;" \ ++ "fi;" \ ++ "fi;" \ ++ "else " \ ++ "echo uboot_overlays: add [enable_uboot_cape_universal=1] to /boot/uEnv.txt to enable...;" \ ++ "fi;" \ ++ "fi;" \ ++ "else " \ ++ "echo uboot_overlays: add [enable_uboot_overlays=1] to /boot/uEnv.txt to enable...;" \ ++ "fi;" \ + "setenv rdfile initrd.img-${uname_r}; " \ + "if test -e ${devtype} ${bootpart} ${bootdir}/${rdfile}; then " \ + "echo loading ${bootdir}/${rdfile} ...; "\ +diff --git a/include/configs/ti_armv7_omap.h b/include/configs/ti_armv7_omap.h +index b4565daf41..f2a4e18b8c 100644 +--- a/include/configs/ti_armv7_omap.h ++++ b/include/configs/ti_armv7_omap.h +@@ -17,6 +17,9 @@ + #define CONFIG_SYS_OMAP24_I2C_SLAVE 1 + #define CONFIG_SYS_I2C_OMAP24XX + ++#define CONFIG_SYS_OMAP24_I2C_SPEED2 100000 ++#define CONFIG_SYS_OMAP24_I2C_SLAVE2 1 ++ + /* SPI IP Block */ + #define CONFIG_OMAP3_SPI + +diff --git a/include/environment/ti/mmc.h b/include/environment/ti/mmc.h +index a338febbbe..e99127e1a1 100644 +--- a/include/environment/ti/mmc.h ++++ b/include/environment/ti/mmc.h +@@ -61,6 +61,21 @@ + "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ + "loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \ + "loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \ ++ "loadoverlay=echo uboot_overlays: loading ${uboot_overlay} ...; " \ ++ "load ${devtype} ${bootpart} ${rdaddr} ${uboot_overlay}; " \ ++ "fdt addr ${fdtaddr}; fdt resize ${fdt_buffer}; " \ ++ "fdt apply ${rdaddr}; fdt resize ${fdt_buffer};\0" \ ++ "virtualloadoverlay=if test -e ${devtype} ${bootpart} ${uboot_overlay}; then " \ ++ "run loadoverlay;" \ ++ "else " \ ++ "echo uboot_overlays: unable to find [${devtype} ${bootpart} ${uboot_overlay}]...;" \ ++ "fi;\0" \ ++ "capeloadoverlay=if test -e ${devtype} ${bootpart} ${uboot_overlay}; then " \ ++ "run loadoverlay;" \ ++ "setenv cape_uboot bone_capemgr.uboot_capemgr_enabled=1; " \ ++ "else " \ ++ "echo uboot_overlays: unable to find [${devtype} ${bootpart} ${uboot_overlay}]...;" \ ++ "fi;\0" \ + "failumsboot=echo; echo FAILSAFE: U-Boot UMS (USB Mass Storage) enabled, media now available over the usb slave port ...; " \ + "ums 0 ${devtype} 1;\0" \ + "envboot=mmc dev ${mmcdev}; " \ +-- +2.11.0 +