From 246423d36d772a1d14befeb23cccd502fec0233c Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Fri, 30 Dec 2016 12:06:37 -0600 Subject: [PATCH] v2017.01-rc2 Signed-off-by: Robert Nelson --- ...-PHY-VSC8530-VSC8531-VSC8540-VSC8541.patch | 573 ++++++++ ...01-am335x_evm-uEnv.txt-bootz-n-fixes.patch | 1293 +++++++++++++++++ ...-at91sam9x5ek-uEnv.txt-bootz-n-fixes.patch | 105 ++ v2017.01-rc2/0001-de0_nano-fixes.patch | 149 ++ v2017.01-rc2/0001-ls1021atwr-fixes.patch | 76 + ...x23_olinuxino-uEnv.txt-bootz-n-fixes.patch | 185 +++ .../0001-mx51evk-uEnv.txt-bootz-n-fixes.patch | 232 +++ ...0001-mx53loco-uEnv.txt-bootz-n-fixes.patch | 198 +++ ...qsabre_common-uEnv.txt-bootz-n-fixes.patch | 197 +++ v2017.01-rc2/0001-mx6ul_14x14_evk-fixes.patch | 182 +++ ...-omap3_beagle-uEnv.txt-bootz-n-fixes.patch | 489 +++++++ ...-omap4_common-uEnv.txt-bootz-n-fixes.patch | 256 ++++ ...-omap5_common-uEnv.txt-bootz-n-fixes.patch | 260 ++++ .../0001-sama5d2_xplained-fixes.patch | 58 + ...a5d3_xplained-uEnv.txt-bootz-n-fixes.patch | 58 + ...01-sama5d3xek-uEnv.txt-bootz-n-fixes.patch | 42 + ...a5d4_xplained-uEnv.txt-bootz-n-fixes.patch | 58 + ...001-sama5d4ek-uEnv.txt-bootz-n-fixes.patch | 42 + .../0001-udoo-uEnv.txt-bootz-n-fixes.patch | 191 +++ ...0001-vf610twr-uEnv.txt-bootz-n-fixes.patch | 151 ++ ...001-wandboard-uEnv.txt-bootz-n-fixes.patch | 196 +++ .../0002-U-Boot-BeagleBone-Cape-Manager.patch | 329 +++++ 22 files changed, 5320 insertions(+) create mode 100644 v2017.01-rc2/0001-Adding-MSCC-PHY-VSC8530-VSC8531-VSC8540-VSC8541.patch create mode 100644 v2017.01-rc2/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch create mode 100644 v2017.01-rc2/0001-at91sam9x5ek-uEnv.txt-bootz-n-fixes.patch create mode 100644 v2017.01-rc2/0001-de0_nano-fixes.patch create mode 100644 v2017.01-rc2/0001-ls1021atwr-fixes.patch create mode 100644 v2017.01-rc2/0001-mx23_olinuxino-uEnv.txt-bootz-n-fixes.patch create mode 100644 v2017.01-rc2/0001-mx51evk-uEnv.txt-bootz-n-fixes.patch create mode 100644 v2017.01-rc2/0001-mx53loco-uEnv.txt-bootz-n-fixes.patch create mode 100644 v2017.01-rc2/0001-mx6qsabre_common-uEnv.txt-bootz-n-fixes.patch create mode 100644 v2017.01-rc2/0001-mx6ul_14x14_evk-fixes.patch create mode 100644 v2017.01-rc2/0001-omap3_beagle-uEnv.txt-bootz-n-fixes.patch create mode 100644 v2017.01-rc2/0001-omap4_common-uEnv.txt-bootz-n-fixes.patch create mode 100644 v2017.01-rc2/0001-omap5_common-uEnv.txt-bootz-n-fixes.patch create mode 100644 v2017.01-rc2/0001-sama5d2_xplained-fixes.patch create mode 100644 v2017.01-rc2/0001-sama5d3_xplained-uEnv.txt-bootz-n-fixes.patch create mode 100644 v2017.01-rc2/0001-sama5d3xek-uEnv.txt-bootz-n-fixes.patch create mode 100644 v2017.01-rc2/0001-sama5d4_xplained-uEnv.txt-bootz-n-fixes.patch create mode 100644 v2017.01-rc2/0001-sama5d4ek-uEnv.txt-bootz-n-fixes.patch create mode 100644 v2017.01-rc2/0001-udoo-uEnv.txt-bootz-n-fixes.patch create mode 100644 v2017.01-rc2/0001-vf610twr-uEnv.txt-bootz-n-fixes.patch create mode 100644 v2017.01-rc2/0001-wandboard-uEnv.txt-bootz-n-fixes.patch create mode 100644 v2017.01-rc2/0002-U-Boot-BeagleBone-Cape-Manager.patch diff --git a/v2017.01-rc2/0001-Adding-MSCC-PHY-VSC8530-VSC8531-VSC8540-VSC8541.patch b/v2017.01-rc2/0001-Adding-MSCC-PHY-VSC8530-VSC8531-VSC8540-VSC8541.patch new file mode 100644 index 0000000..39053a2 --- /dev/null +++ b/v2017.01-rc2/0001-Adding-MSCC-PHY-VSC8530-VSC8531-VSC8540-VSC8541.patch @@ -0,0 +1,573 @@ +From ae28bdd1bbe0d39c1197941075075c5404fd4dd1 Mon Sep 17 00:00:00 2001 +From: John Haechten +Date: Wed, 7 Dec 2016 07:51:37 -0800 +Subject: [PATCH] Adding MSCC PHY-VSC8530-VSC8531-VSC8540-VSC8541 + +(C) Copyright 2016 Microsemi Corporation, MIT License (MIT) +Author:John Haechten +Reviewed-by:Howard Hicks +Reviewed-by:Joe Hershberger +Tested-by:Howard Hicks +Version:1 +Prefix:None +Signed-off-by: John Haechten +--- + drivers/net/phy/Makefile | 1 + + drivers/net/phy/mscc.c | 480 ++++++++++++++++++++++++++++++++++++ + drivers/net/phy/phy.c | 3 + + include/config_phylib_all_drivers.h | 1 + + include/configs/am335x_evm.h | 3 + + include/phy.h | 1 + + 6 files changed, 489 insertions(+) + create mode 100644 drivers/net/phy/mscc.c + +diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile +index 1e299b9..d372971 100644 +--- a/drivers/net/phy/Makefile ++++ b/drivers/net/phy/Makefile +@@ -27,3 +27,4 @@ obj-$(CONFIG_PHY_TERANETICS) += teranetics.o + obj-$(CONFIG_PHY_TI) += ti.o + obj-$(CONFIG_PHY_XILINX) += xilinx_phy.o + obj-$(CONFIG_PHY_VITESSE) += vitesse.o ++obj-$(CONFIG_PHY_MSCC) += mscc.o +diff --git a/drivers/net/phy/mscc.c b/drivers/net/phy/mscc.c +new file mode 100644 +index 0000000..e63bd43 +--- /dev/null ++++ b/drivers/net/phy/mscc.c +@@ -0,0 +1,480 @@ ++/* ++ * Driver for Microsemi VSC85xx PHYs ++ * ++ * Author: John Haechten ++ * ++ * The MIT License (MIT) ++ * ++ * Copyright (c) 2016 Microsemi Corporation ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a copy ++ * of this software and associated documentation files (the "Software"), to deal ++ * in the Software without restriction, including without limitation the rights ++ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ++ * copies of the Software, and to permit persons to whom the Software is ++ * furnished to do so, subject to the following conditions: ++ * The above copyright notice and this permission notice shall be included in ++ * all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ++ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ++ * SOFTWARE. ++ * ++ */ ++ ++#include ++#include ++ ++/* Note: To include this PHY Driver file, #define CONFIG_PHY_MSCC */ ++ ++/* Microsemi PHY ID's */ ++#define PHY_ID_VSC8530 0x00070560 ++#define PHY_ID_VSC8531 0x00070570 ++#define PHY_ID_VSC8540 0x00070760 ++#define PHY_ID_VSC8541 0x00070770 ++/* Microsemi VSC85xx PHY Register Pages */ ++#define MSCC_EXT_PAGE_ACCESS 31 /* Page Access Register */ ++#define MSCC_PHY_PAGE_STD 0x0000 /* Standard registers */ ++#define MSCC_PHY_PAGE_EXT1 0x0001 /* Extended registers - page 1 */ ++#define MSCC_PHY_PAGE_EXT2 0x0002 /* Extended registers - page 2 */ ++#define MSCC_PHY_PAGE_EXT3 0x0003 /* Extended registers - page 3 */ ++#define MSCC_PHY_PAGE_EXT4 0x0004 /* Extended registers - page 4 */ ++#define MSCC_PHY_PAGE_GPIO 0x0010 /* GPIO registers */ ++#define MSCC_PHY_PAGE_TEST 0x2A30 /* TEST Page registers */ ++#define MSCC_PHY_PAGE_TR 0x52B5 /* Token Ring Page registers */ ++/* Std Page Register 28 - PHY AUX Control/Status */ ++#define MIIM_AUX_CNTRL_STAT_REG 0x1c ++#define MIIM_AUX_CNTRL_STAT_ACTIPHY_TO 0x0004 ++#define MIIM_AUX_CNTRL_STAT_F_DUPLEX 0x0020 ++#define MIIM_AUX_CNTRL_STAT_SPEED_MASK 0x0018 ++#define MIIM_AUX_CNTRL_STAT_SPEED_POS (3) ++#define MIIM_AUX_CNTRL_STAT_SPEED_10M (0x0) ++#define MIIM_AUX_CNTRL_STAT_SPEED_100M (0x1) ++#define MIIM_AUX_CNTRL_STAT_SPEED_1000M (0x2) ++/* Std Page Register 23 - Extended PHY CTRL_1 */ ++#define MSCC_PHY_EXT_PHY_CNTL_1 23 ++#define MAC_IF_SELECTION_MASK 0x1800 ++#define MAC_IF_SELECTION_GMII 0 ++#define MAC_IF_SELECTION_RMII 1 ++#define MAC_IF_SELECTION_RGMII 2 ++#define MAC_IF_SELECTION_POS 11 ++#define MAC_IF_SELECTION_WIDTH 2 ++/* Extended Page 2 Register 20E2 */ ++#define MSCC_PHY_RGMII_CNTL 20 ++#define VSC_FAST_LINK_FAIL2_ENA_MASK 0x8000 ++#define RX_CLK_OUT_MASK 0x0800 ++#define RX_CLK_OUT_POS 11 ++#define RX_CLK_OUT_WIDTH 1 ++#define RX_CLK_OUT_NORMAL 0 ++#define RX_CLK_OUT_DISABLE 1 ++#define RGMII_RX_CLK_DELAY_POS 4 ++#define RGMII_RX_CLK_DELAY_WIDTH 3 ++#define RGMII_RX_CLK_DELAY_MASK 0x0070 ++#define RGMII_TX_CLK_DELAY_POS 0 ++#define RGMII_TX_CLK_DELAY_WIDTH 3 ++#define RGMII_TX_CLK_DELAY_MASK 0x0007 ++/* Extended Page 2 Register 27E2 */ ++#define MSCC_PHY_WOL_MAC_CONTROL 27 ++#define EDGE_RATE_CNTL_POS 5 ++#define EDGE_RATE_CNTL_WIDTH 3 ++#define EDGE_RATE_CNTL_MASK 0x00E0 ++#define RMII_CLK_OUT_ENABLE_POS 4 ++#define RMII_CLK_OUT_ENABLE_WIDTH 1 ++#define RMII_CLK_OUT_ENABLE_MASK 0x10 ++/* Token Ring Page 0x52B5 Registers */ ++#define MSCC_PHY_REG_TR_ADDR_16 16 ++#define MSCC_PHY_REG_TR_DATA_17 17 ++#define MSCC_PHY_REG_TR_DATA_18 18 ++/* Token Ring Registers */ ++#define MSCC_PHY_TR_LINKDETCTRL_POS 3 ++#define MSCC_PHY_TR_LINKDETCTRL_WIDTH 2 ++#define MSCC_PHY_TR_LINKDETCTRL_MASK 0x18 ++#define MSCC_PHY_TR_VGATHRESH100_POS 0 ++#define MSCC_PHY_TR_VGATHRESH100_WIDTH 7 ++#define MSCC_PHY_TR_VGATHRESH100_MASK 0x7f ++#define MSCC_PHY_TR_VGAGAIN10_U_POS 0 ++#define MSCC_PHY_TR_VGAGAIN10_U_WIDTH 1 ++#define MSCC_PHY_TR_VGAGAIN10_U_MASK 0x01 ++#define MSCC_PHY_TR_VGAGAIN10_L_POS 12 ++#define MSCC_PHY_TR_VGAGAIN10_L_WIDTH 4 ++#define MSCC_PHY_TR_VGAGAIN10_L_MASK 0xf000 ++/* General Timeout Values */ ++#define MSCC_PHY_RESET_TIMEOUT (100) ++#define MSCC_PHY_MICRO_TIMEOUT (500) ++ ++/**< RGMII/GMII Clock Delay (Skew) Options */ ++enum vsc_phy_rgmii_skew { ++ VSC_PHY_RGMII_DELAY_200_PS, ++ VSC_PHY_RGMII_DELAY_800_PS, ++ VSC_PHY_RGMII_DELAY_1100_PS, ++ VSC_PHY_RGMII_DELAY_1700_PS, ++ VSC_PHY_RGMII_DELAY_2000_PS, ++ VSC_PHY_RGMII_DELAY_2300_PS, ++ VSC_PHY_RGMII_DELAY_2600_PS, ++ VSC_PHY_RGMII_DELAY_3400_PS ++}; ++ ++/**< MAC i/f Clock Edge Rage Control (Slew), See Reg27E2 */ ++enum vsc_phy_clk_slew { ++ VSC_PHY_CLK_SLEW_RATE_0, ++ VSC_PHY_CLK_SLEW_RATE_1, ++ VSC_PHY_CLK_SLEW_RATE_2, ++ VSC_PHY_CLK_SLEW_RATE_3, ++ VSC_PHY_CLK_SLEW_RATE_4, ++ VSC_PHY_CLK_SLEW_RATE_5, ++ VSC_PHY_CLK_SLEW_RATE_6, ++ VSC_PHY_CLK_SLEW_RATE_7 ++}; ++ ++ ++static int mscc_vsc8531_vsc8541_init_scripts(struct phy_device *phydev) ++{ ++ u16 reg_val17; ++ u16 reg_val18; ++ ++ /* Set to Access Token Ring Registers */ ++ phy_write(phydev, MDIO_DEVAD_NONE, ++ MSCC_EXT_PAGE_ACCESS, MSCC_PHY_PAGE_TR); ++ ++ /* Update LinkDetectCtrl default to optimized values */ ++ /* Determined during Silicon Validation Testing */ ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_PHY_REG_TR_ADDR_16, 0xA7F8); ++ reg_val17 = phy_read(phydev, MDIO_DEVAD_NONE, MSCC_PHY_REG_TR_DATA_17); ++ reg_val17 = bitfield_replace(reg_val17, MSCC_PHY_TR_LINKDETCTRL_POS, ++ MSCC_PHY_TR_LINKDETCTRL_WIDTH, 3); ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_PHY_REG_TR_DATA_17, reg_val17); ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_PHY_REG_TR_ADDR_16, 0x87F8); ++ ++ /* Update VgaThresh100 defaults to optimized values */ ++ /* Determined during Silicon Validation Testing */ ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_PHY_REG_TR_ADDR_16, 0xAFA4); ++ reg_val18 = phy_read(phydev, MDIO_DEVAD_NONE, MSCC_PHY_REG_TR_DATA_18); ++ reg_val18 = bitfield_replace(reg_val18, MSCC_PHY_TR_VGATHRESH100_POS, ++ MSCC_PHY_TR_VGATHRESH100_WIDTH, 24); ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_PHY_REG_TR_DATA_18, reg_val18); ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_PHY_REG_TR_ADDR_16, 0x8FA4); ++ ++ /* Update VgaGain10 defaults to optimized values */ ++ /* Determined during Silicon Validation Testing */ ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_PHY_REG_TR_ADDR_16, 0xAF92); ++ reg_val18 = phy_read(phydev, MDIO_DEVAD_NONE, MSCC_PHY_REG_TR_DATA_18); ++ reg_val17 = phy_read(phydev, MDIO_DEVAD_NONE, MSCC_PHY_REG_TR_DATA_17); ++ reg_val18 = bitfield_replace(reg_val18, MSCC_PHY_TR_VGAGAIN10_U_POS, ++ MSCC_PHY_TR_VGAGAIN10_U_WIDTH, 0); ++ ++ reg_val17 = bitfield_replace(reg_val17, MSCC_PHY_TR_VGAGAIN10_L_POS, ++ MSCC_PHY_TR_VGAGAIN10_L_WIDTH, 1); ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_PHY_REG_TR_DATA_18, reg_val18); ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_PHY_REG_TR_DATA_17, reg_val17); ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_PHY_REG_TR_ADDR_16, 0x8F92); ++ ++ /* Set back to Access Standard Page Registers */ ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_EXT_PAGE_ACCESS, ++ MSCC_PHY_PAGE_STD); ++ ++ return 0; ++} ++ ++static int mscc_parse_status(struct phy_device *phydev) ++{ ++ u16 speed; ++ u16 mii_reg; ++ ++ mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_AUX_CNTRL_STAT_REG); ++ ++ if (mii_reg & MIIM_AUX_CNTRL_STAT_F_DUPLEX) ++ phydev->duplex = DUPLEX_FULL; ++ else ++ phydev->duplex = DUPLEX_HALF; ++ ++ speed = mii_reg & MIIM_AUX_CNTRL_STAT_SPEED_MASK; ++ speed = speed >> MIIM_AUX_CNTRL_STAT_SPEED_POS; ++ ++ switch (speed) { ++ case MIIM_AUX_CNTRL_STAT_SPEED_1000M: ++ phydev->speed = SPEED_1000; ++ break; ++ case MIIM_AUX_CNTRL_STAT_SPEED_100M: ++ phydev->speed = SPEED_100; ++ break; ++ case MIIM_AUX_CNTRL_STAT_SPEED_10M: ++ phydev->speed = SPEED_10; ++ break; ++ default: ++ phydev->speed = SPEED_10; ++ break; ++ } ++ ++ return 0; ++} ++ ++static int mscc_startup(struct phy_device *phydev) ++{ ++ int ret; ++ ++ ret = genphy_update_link(phydev); ++ if (ret) ++ return ret; ++ return mscc_parse_status(phydev); ++} ++ ++static int mscc_phy_soft_reset(struct phy_device *phydev) ++{ ++ int rc = 0; ++ u16 timeout = MSCC_PHY_RESET_TIMEOUT; ++ u16 reg_val = 0; ++ ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_EXT_PAGE_ACCESS, ++ MSCC_PHY_PAGE_STD); ++ ++ reg_val = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMCR); ++ reg_val |= BMCR_RESET; ++ phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, reg_val); ++ ++ reg_val = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMCR); ++ ++ while ((reg_val & BMCR_RESET) && (timeout > 0)) { ++ reg_val = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMCR); ++ timeout--; ++ udelay(1000); /* 1 ms */ ++ } ++ ++ if (timeout == 0) { ++ printf("MSCC PHY Soft_Reset Error: mac i/f = 0x%x\n", ++ phydev->interface); ++ rc = -ETIME; ++ } ++ ++ return rc; ++} ++ ++static int vsc8531_vsc8541_mac_config(struct phy_device *phydev) ++{ ++ int rc = 0; ++ u16 reg_val = 0; ++ u16 mac_if = 0; ++ u16 rx_clk_out = 0; ++ ++ /* For VSC8530/31 the only MAC modes are RMII/RGMII. */ ++ /* For VSC8540/41 the only MAC modes are (G)MII and RMII/RGMII. */ ++ /* Setup MAC Configuration */ ++ switch (phydev->interface) { ++ case PHY_INTERFACE_MODE_MII: ++ case PHY_INTERFACE_MODE_GMII: ++ /* Set Reg23.12:11=0 */ ++ mac_if = MAC_IF_SELECTION_GMII; ++ /* Set Reg20E2.11=1 */ ++ rx_clk_out = RX_CLK_OUT_DISABLE; ++ break; ++ ++ case PHY_INTERFACE_MODE_RMII: ++ /* Set Reg23.12:11=1 */ ++ mac_if = MAC_IF_SELECTION_RMII; ++ /* Set Reg20E2.11=0 */ ++ rx_clk_out = RX_CLK_OUT_NORMAL; ++ break; ++ ++ case PHY_INTERFACE_MODE_RGMII: ++ /* Set Reg23.12:11=2 */ ++ mac_if = MAC_IF_SELECTION_RGMII; ++ /* Set Reg20E2.11=0 */ ++ rx_clk_out = RX_CLK_OUT_NORMAL; ++ break; ++ ++ default: ++ printf("MSCC PHY - INVALID MAC i/f Config: mac i/f = 0x%x\n", ++ phydev->interface); ++ return -EINVAL; ++ } ++ ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_EXT_PAGE_ACCESS, ++ MSCC_PHY_PAGE_STD); ++ ++ /* Read Reg23 */ ++ reg_val = phy_read(phydev, MDIO_DEVAD_NONE, ++ MSCC_PHY_EXT_PHY_CNTL_1); ++ /* Set MAC i/f bits Reg23.12:11 */ ++ reg_val = bitfield_replace(reg_val, MAC_IF_SELECTION_POS, ++ MAC_IF_SELECTION_WIDTH, mac_if); ++ /* Update Reg23.12:11 */ ++ phy_write(phydev, MDIO_DEVAD_NONE, ++ MSCC_PHY_EXT_PHY_CNTL_1, reg_val); ++ /* Setup ExtPg_2 Register Access */ ++ phy_write(phydev, MDIO_DEVAD_NONE, ++ MSCC_EXT_PAGE_ACCESS, MSCC_PHY_PAGE_EXT2); ++ /* Read Reg20E2 */ ++ reg_val = phy_read(phydev, MDIO_DEVAD_NONE, ++ MSCC_PHY_RGMII_CNTL); ++ reg_val = bitfield_replace(reg_val, RX_CLK_OUT_POS, ++ RX_CLK_OUT_WIDTH, rx_clk_out); ++ /* Update Reg20E2.11 */ ++ phy_write(phydev, MDIO_DEVAD_NONE, ++ MSCC_PHY_RGMII_CNTL, reg_val); ++ /* Before leaving - Change back to Std Page Register Access */ ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_EXT_PAGE_ACCESS, ++ MSCC_PHY_PAGE_STD); ++ ++ return rc; ++} ++ ++static int vsc8531_config(struct phy_device *phydev) ++{ ++ u16 reg_val; ++ u16 rmii_clk_out; ++ enum vsc_phy_rgmii_skew rx_clk_skew = VSC_PHY_RGMII_DELAY_1700_PS; ++ enum vsc_phy_rgmii_skew tx_clk_skew = VSC_PHY_RGMII_DELAY_800_PS; ++ enum vsc_phy_clk_slew edge_rate = VSC_PHY_CLK_SLEW_RATE_4; ++ ++ /* For VSC8530/31 and VSC8540/41 the init scripts are the same */ ++ mscc_vsc8531_vsc8541_init_scripts(phydev); ++ ++ /* For VSC8530/31 the only MAC modes are RMII/RGMII. */ ++ switch (phydev->interface) { ++ case PHY_INTERFACE_MODE_RMII: ++ case PHY_INTERFACE_MODE_RGMII: ++ vsc8531_vsc8541_mac_config(phydev); ++ mscc_phy_soft_reset(phydev); ++ break; ++ default: ++ printf("PHY 8530/31 MAC i/f Config Error: mac i/f = 0x%x\n", ++ phydev->interface); ++ return -EINVAL; ++ } ++ /* Default RMII Clk Output to 0=OFF/1=ON */ ++ rmii_clk_out = 0; ++ ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_EXT_PAGE_ACCESS, ++ MSCC_PHY_PAGE_EXT2); ++ reg_val = phy_read(phydev, MDIO_DEVAD_NONE, MSCC_PHY_RGMII_CNTL); ++ ++ /* Reg20E2 - Update RGMII RX_Clk Skews. */ ++ reg_val = bitfield_replace(reg_val, RGMII_RX_CLK_DELAY_POS, ++ RGMII_RX_CLK_DELAY_WIDTH, rx_clk_skew); ++ /* Reg20E2 - Update RGMII TX_Clk Skews. */ ++ reg_val = bitfield_replace(reg_val, RGMII_TX_CLK_DELAY_POS, ++ RGMII_TX_CLK_DELAY_WIDTH, tx_clk_skew); ++ ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_PHY_RGMII_CNTL, reg_val); ++ ++ reg_val = phy_read(phydev, MDIO_DEVAD_NONE, MSCC_PHY_WOL_MAC_CONTROL); ++ /* Reg27E2 - Update Clk Slew Rate. */ ++ reg_val = bitfield_replace(reg_val, EDGE_RATE_CNTL_POS, ++ EDGE_RATE_CNTL_WIDTH, edge_rate); ++ /* Reg27E2 - Update RMII Clk Out. */ ++ reg_val = bitfield_replace(reg_val, RMII_CLK_OUT_ENABLE_POS, ++ RMII_CLK_OUT_ENABLE_WIDTH, rmii_clk_out); ++ /* Update Reg27E2 */ ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_PHY_WOL_MAC_CONTROL, reg_val); ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_EXT_PAGE_ACCESS, ++ MSCC_PHY_PAGE_STD); ++ ++ return genphy_config_aneg(phydev); ++} ++ ++static int vsc8541_config(struct phy_device *phydev) ++{ ++ u16 reg_val; ++ u16 rmii_clk_out; ++ enum vsc_phy_rgmii_skew rx_clk_skew = VSC_PHY_RGMII_DELAY_1700_PS; ++ enum vsc_phy_rgmii_skew tx_clk_skew = VSC_PHY_RGMII_DELAY_800_PS; ++ enum vsc_phy_clk_slew edge_rate = VSC_PHY_CLK_SLEW_RATE_4; ++ ++ /* For VSC8530/31 and VSC8540/41 the init scripts are the same */ ++ mscc_vsc8531_vsc8541_init_scripts(phydev); ++ ++ /* For VSC8540/41 the only MAC modes are (G)MII and RMII/RGMII. */ ++ switch (phydev->interface) { ++ case PHY_INTERFACE_MODE_MII: ++ case PHY_INTERFACE_MODE_GMII: ++ case PHY_INTERFACE_MODE_RMII: ++ case PHY_INTERFACE_MODE_RGMII: ++ vsc8531_vsc8541_mac_config(phydev); ++ mscc_phy_soft_reset(phydev); ++ break; ++ default: ++ printf("PHY 8541 MAC i/f config Error: mac i/f = 0x%x\n", ++ phydev->interface); ++ return -EINVAL; ++ } ++ /* Default RMII Clk Output to 0=OFF/1=ON */ ++ rmii_clk_out = 0; ++ ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_EXT_PAGE_ACCESS, ++ MSCC_PHY_PAGE_EXT2); ++ reg_val = phy_read(phydev, MDIO_DEVAD_NONE, MSCC_PHY_RGMII_CNTL); ++ /* Reg20E2 - Update RGMII RX_Clk Skews. */ ++ reg_val = bitfield_replace(reg_val, RGMII_RX_CLK_DELAY_POS, ++ RGMII_RX_CLK_DELAY_WIDTH, rx_clk_skew); ++ /* Reg20E2 - Update RGMII TX_Clk Skews. */ ++ reg_val = bitfield_replace(reg_val, RGMII_TX_CLK_DELAY_POS, ++ RGMII_TX_CLK_DELAY_WIDTH, tx_clk_skew); ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_PHY_RGMII_CNTL, reg_val); ++ ++ reg_val = phy_read(phydev, MDIO_DEVAD_NONE, MSCC_PHY_WOL_MAC_CONTROL); ++ /* Reg27E2 - Update Clk Slew Rate. */ ++ reg_val = bitfield_replace(reg_val, EDGE_RATE_CNTL_POS, ++ EDGE_RATE_CNTL_WIDTH, edge_rate); ++ /* Reg27E2 - Update RMII Clk Out. */ ++ reg_val = bitfield_replace(reg_val, RMII_CLK_OUT_ENABLE_POS, ++ RMII_CLK_OUT_ENABLE_WIDTH, rmii_clk_out); ++ /* Update Reg27E2 */ ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_PHY_WOL_MAC_CONTROL, reg_val); ++ phy_write(phydev, MDIO_DEVAD_NONE, MSCC_EXT_PAGE_ACCESS, ++ MSCC_PHY_PAGE_STD); ++ ++ return genphy_config_aneg(phydev); ++} ++ ++static struct phy_driver VSC8530_driver = { ++ .name = "Microsemi VSC8530", ++ .uid = PHY_ID_VSC8530, ++ .mask = 0x000ffff0, ++ .features = PHY_BASIC_FEATURES, ++ .config = &vsc8531_config, ++ .startup = &mscc_startup, ++ .shutdown = &genphy_shutdown, ++}; ++ ++static struct phy_driver VSC8531_driver = { ++ .name = "Microsemi VSC8531", ++ .uid = PHY_ID_VSC8531, ++ .mask = 0x000ffff0, ++ .features = PHY_GBIT_FEATURES, ++ .config = &vsc8531_config, ++ .startup = &mscc_startup, ++ .shutdown = &genphy_shutdown, ++}; ++ ++static struct phy_driver VSC8540_driver = { ++ .name = "Microsemi VSC8540", ++ .uid = PHY_ID_VSC8540, ++ .mask = 0x000ffff0, ++ .features = PHY_BASIC_FEATURES, ++ .config = &vsc8541_config, ++ .startup = &mscc_startup, ++ .shutdown = &genphy_shutdown, ++}; ++ ++static struct phy_driver VSC8541_driver = { ++ .name = "Microsemi VSC8541", ++ .uid = PHY_ID_VSC8541, ++ .mask = 0x000ffff0, ++ .features = PHY_GBIT_FEATURES, ++ .config = &vsc8541_config, ++ .startup = &mscc_startup, ++ .shutdown = &genphy_shutdown, ++}; ++ ++int phy_mscc_init(void) ++{ ++ phy_register(&VSC8530_driver); ++ phy_register(&VSC8531_driver); ++ phy_register(&VSC8540_driver); ++ phy_register(&VSC8541_driver); ++ ++ return 0; ++} +diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c +index 80bdfb6..8db6574 100644 +--- a/drivers/net/phy/phy.c ++++ b/drivers/net/phy/phy.c +@@ -512,6 +512,9 @@ int phy_init(void) + #ifdef CONFIG_PHY_XILINX + phy_xilinx_init(); + #endif ++#ifdef CONFIG_PHY_MSCC ++ phy_mscc_init(); ++#endif + + return 0; + } +diff --git a/include/config_phylib_all_drivers.h b/include/config_phylib_all_drivers.h +index 12828c6..d2965ed 100644 +--- a/include/config_phylib_all_drivers.h ++++ b/include/config_phylib_all_drivers.h +@@ -14,6 +14,7 @@ + + #ifdef CONFIG_PHYLIB + ++#define CONFIG_PHY_MSCC + #define CONFIG_PHY_VITESSE + #define CONFIG_PHY_MARVELL + #define CONFIG_PHY_MICREL +diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h +index ec70b72..694e249 100644 +--- a/include/configs/am335x_evm.h ++++ b/include/configs/am335x_evm.h +@@ -433,6 +433,9 @@ + #define CONFIG_PHY_SMSC + /* Enable Atheros phy driver */ + #define CONFIG_PHY_ATHEROS ++/* Enable MSCC phy driver */ ++#define CONFIG_PHY_MSCC ++ + + /* + * NOR Size = 16 MiB +diff --git a/include/phy.h b/include/phy.h +index 268d9a1..5477496 100644 +--- a/include/phy.h ++++ b/include/phy.h +@@ -266,6 +266,7 @@ int phy_teranetics_init(void); + int phy_ti_init(void); + int phy_vitesse_init(void); + int phy_xilinx_init(void); ++int phy_mscc_init(void); + + int board_phy_config(struct phy_device *phydev); + int get_phy_id(struct mii_dev *bus, int addr, int devad, u32 *phy_id); +-- +2.10.2 + diff --git a/v2017.01-rc2/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch b/v2017.01-rc2/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..93a9bb0 --- /dev/null +++ b/v2017.01-rc2/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,1293 @@ +From d9602b70f0ff885fe04f4bd5ead77976d74b0e6b Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Fri, 30 Dec 2016 11:06:56 -0600 +Subject: [PATCH] am335x_evm: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + arch/arm/dts/Makefile | 11 +- + arch/arm/dts/am335x-bone-common.dtsi | 78 ------- + arch/arm/dts/am335x-bone-common_mii.dtsi | 83 ++++++++ + arch/arm/dts/am335x-bone-common_rgmii.dtsi | 81 ++++++++ + arch/arm/dts/am335x-bone.dts | 5 + + arch/arm/dts/am335x-boneblack-emmc-overlay.dts | 43 ++++ + arch/arm/dts/am335x-boneblack.dts | 1 + + arch/arm/dts/am335x-bonegreen.dts | 1 + + arch/arm/dts/am335x-sancloud-bbe.dts | 100 +++++++++ + arch/arm/dts/am335x-vsc8531bbb.dts | 91 ++++++++ + board/ti/am335x/board.c | 51 ++++- + board/ti/am335x/board.h | 15 ++ + board/ti/am335x/mux.c | 9 +- + configs/am335x_boneblack_defconfig | 2 +- + configs/am335x_evm_defconfig | 23 +-- + include/configs/am335x_evm.h | 60 ++++-- + include/configs/ti_armv7_common.h | 276 ++++++++++++++++++++++++- + scripts/config_whitelist.txt | 1 + + 18 files changed, 800 insertions(+), 131 deletions(-) + create mode 100644 arch/arm/dts/am335x-bone-common_mii.dtsi + create mode 100644 arch/arm/dts/am335x-bone-common_rgmii.dtsi + create mode 100644 arch/arm/dts/am335x-boneblack-emmc-overlay.dts + create mode 100644 arch/arm/dts/am335x-sancloud-bbe.dts + create mode 100644 arch/arm/dts/am335x-vsc8531bbb.dts + +diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile +index 3ee608b5b4..53c1e5955c 100644 +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -115,13 +115,10 @@ dtb-$(CONFIG_ARCH_ZYNQMP) += \ + zynqmp-zc1751-xm018-dc4.dtb \ + zynqmp-zc1751-xm019-dc5.dtb + dtb-$(CONFIG_AM33XX) += am335x-boneblack.dtb am335x-bone.dtb \ +- am335x-draco.dtb \ +- am335x-evm.dtb \ +- am335x-evmsk.dtb \ +- am335x-bonegreen.dtb \ +- am335x-icev2.dtb \ +- am335x-pxm50.dtb \ +- am335x-rut.dtb ++ am335x-boneblack-emmc-overlay.dtb \ ++ am335x-sancloud-bbe.dtb \ ++ am335x-vsc8531bbb.dtb \ ++ am335x-bonegreen.dtb + dtb-$(CONFIG_AM43XX) += am437x-gp-evm.dtb am437x-sk-evm.dtb \ + am43x-epos-evm.dtb \ + am437x-idk-evm.dtb +diff --git a/arch/arm/dts/am335x-bone-common.dtsi b/arch/arm/dts/am335x-bone-common.dtsi +index 40a3c35ff8..2a0030149e 100644 +--- a/arch/arm/dts/am335x-bone-common.dtsi ++++ b/arch/arm/dts/am335x-bone-common.dtsi +@@ -106,60 +106,6 @@ + >; + }; + +- cpsw_default: cpsw_default { +- pinctrl-single,pins = < +- /* Slave 1 */ +- 0x110 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxerr.mii1_rxerr */ +- 0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txen.mii1_txen */ +- 0x118 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxdv.mii1_rxdv */ +- 0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd3.mii1_txd3 */ +- 0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd2.mii1_txd2 */ +- 0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd1.mii1_txd1 */ +- 0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd0.mii1_txd0 */ +- 0x12c (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_txclk.mii1_txclk */ +- 0x130 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxclk.mii1_rxclk */ +- 0x134 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd3.mii1_rxd3 */ +- 0x138 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd2.mii1_rxd2 */ +- 0x13c (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd1.mii1_rxd1 */ +- 0x140 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd0.mii1_rxd0 */ +- >; +- }; +- +- cpsw_sleep: cpsw_sleep { +- pinctrl-single,pins = < +- /* Slave 1 reset value */ +- 0x110 (PIN_INPUT_PULLDOWN | MUX_MODE7) +- 0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7) +- 0x118 (PIN_INPUT_PULLDOWN | MUX_MODE7) +- 0x11c (PIN_INPUT_PULLDOWN | MUX_MODE7) +- 0x120 (PIN_INPUT_PULLDOWN | MUX_MODE7) +- 0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7) +- 0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7) +- 0x12c (PIN_INPUT_PULLDOWN | MUX_MODE7) +- 0x130 (PIN_INPUT_PULLDOWN | MUX_MODE7) +- 0x134 (PIN_INPUT_PULLDOWN | MUX_MODE7) +- 0x138 (PIN_INPUT_PULLDOWN | MUX_MODE7) +- 0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7) +- 0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7) +- >; +- }; +- +- davinci_mdio_default: davinci_mdio_default { +- pinctrl-single,pins = < +- /* MDIO */ +- 0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */ +- 0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */ +- >; +- }; +- +- davinci_mdio_sleep: davinci_mdio_sleep { +- pinctrl-single,pins = < +- /* MDIO reset value */ +- 0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7) +- 0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7) +- >; +- }; +- + mmc1_pins: pinmux_mmc1_pins { + pinctrl-single,pins = < + 0x160 (PIN_INPUT | MUX_MODE7) /* GPIO0_6 */ +@@ -359,30 +305,6 @@ + }; + }; + +-&cpsw_emac0 { +- phy_id = <&davinci_mdio>, <0>; +- phy-mode = "mii"; +-}; +- +-&cpsw_emac1 { +- phy_id = <&davinci_mdio>, <1>; +- phy-mode = "mii"; +-}; +- +-&mac { +- pinctrl-names = "default", "sleep"; +- pinctrl-0 = <&cpsw_default>; +- pinctrl-1 = <&cpsw_sleep>; +- status = "okay"; +-}; +- +-&davinci_mdio { +- pinctrl-names = "default", "sleep"; +- pinctrl-0 = <&davinci_mdio_default>; +- pinctrl-1 = <&davinci_mdio_sleep>; +- status = "okay"; +-}; +- + &mmc1 { + status = "okay"; + bus-width = <0x4>; +diff --git a/arch/arm/dts/am335x-bone-common_mii.dtsi b/arch/arm/dts/am335x-bone-common_mii.dtsi +new file mode 100644 +index 0000000000..b7b1da2aa6 +--- /dev/null ++++ b/arch/arm/dts/am335x-bone-common_mii.dtsi +@@ -0,0 +1,83 @@ ++/* ++ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++&am33xx_pinmux { ++ cpsw_default: cpsw_default { ++ pinctrl-single,pins = < ++ /* Slave 1 */ ++ 0x110 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxerr.mii1_rxerr */ ++ 0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txen.mii1_txen */ ++ 0x118 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxdv.mii1_rxdv */ ++ 0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd3.mii1_txd3 */ ++ 0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd2.mii1_txd2 */ ++ 0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd1.mii1_txd1 */ ++ 0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd0.mii1_txd0 */ ++ 0x12c (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_txclk.mii1_txclk */ ++ 0x130 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxclk.mii1_rxclk */ ++ 0x134 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd3.mii1_rxd3 */ ++ 0x138 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd2.mii1_rxd2 */ ++ 0x13c (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd1.mii1_rxd1 */ ++ 0x140 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd0.mii1_rxd0 */ ++ >; ++ }; ++ ++ cpsw_sleep: cpsw_sleep { ++ pinctrl-single,pins = < ++ /* Slave 1 reset value */ ++ 0x110 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x118 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x11c (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x120 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x12c (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x130 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x134 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x138 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ >; ++ }; ++ ++ davinci_mdio_default: davinci_mdio_default { ++ pinctrl-single,pins = < ++ /* MDIO */ ++ 0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */ ++ 0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */ ++ >; ++ }; ++ ++ davinci_mdio_sleep: davinci_mdio_sleep { ++ pinctrl-single,pins = < ++ /* MDIO reset value */ ++ 0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ >; ++ }; ++}; ++ ++&cpsw_emac0 { ++ phy_id = <&davinci_mdio>, <0>; ++ phy-mode = "mii"; ++}; ++ ++&mac { ++ pinctrl-names = "default", "sleep"; ++ pinctrl-0 = <&cpsw_default>; ++ pinctrl-1 = <&cpsw_sleep>; ++ slaves = <1>; ++ status = "okay"; ++}; ++ ++&davinci_mdio { ++ pinctrl-names = "default", "sleep"; ++ pinctrl-0 = <&davinci_mdio_default>; ++ pinctrl-1 = <&davinci_mdio_sleep>; ++ status = "okay"; ++}; +diff --git a/arch/arm/dts/am335x-bone-common_rgmii.dtsi b/arch/arm/dts/am335x-bone-common_rgmii.dtsi +new file mode 100644 +index 0000000000..07e7342679 +--- /dev/null ++++ b/arch/arm/dts/am335x-bone-common_rgmii.dtsi +@@ -0,0 +1,81 @@ ++/* ++ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++&am33xx_pinmux { ++ cpsw_default: cpsw_default { ++ pinctrl-single,pins = < ++ /* Slave 1 */ ++ 0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txen.rgmii1_tctl */ ++ 0x118 (PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxdv.rgmii1_rctl */ ++ 0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd3.rgmii1_txd3 */ ++ 0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd2.rgmii1_txd2 */ ++ 0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd1.rgmii1_txd1 */ ++ 0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd0.rgmii1_txd0 */ ++ 0x12c (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txclk.rgmii1_txclk */ ++ 0x130 (PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxclk.rgmii1_rxclk */ ++ 0x134 (PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxd3.rgmii1_rxd3 */ ++ 0x138 (PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxd2.rgmii1_rxd2 */ ++ 0x13c (PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxd1.rgmii1_rxd1 */ ++ 0x140 (PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxd0.rgmii1_rxd0 */ ++ >; ++ }; ++ ++ cpsw_sleep: cpsw_sleep { ++ pinctrl-single,pins = < ++ /* Slave 1 reset value */ ++ 0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x118 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x11c (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x120 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x12c (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x130 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x134 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x138 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ >; ++ }; ++ ++ davinci_mdio_default: davinci_mdio_default { ++ pinctrl-single,pins = < ++ /* MDIO */ ++ 0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */ ++ 0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */ ++ >; ++ }; ++ ++ davinci_mdio_sleep: davinci_mdio_sleep { ++ pinctrl-single,pins = < ++ /* MDIO reset value */ ++ 0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ 0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7) ++ >; ++ }; ++}; ++ ++&cpsw_emac0 { ++ phy_id = <&davinci_mdio>, <0>; ++ phy-mode = "rgmii"; ++}; ++ ++&mac { ++ pinctrl-names = "default", "sleep"; ++ pinctrl-0 = <&cpsw_default>; ++ pinctrl-1 = <&cpsw_sleep>; ++ slaves = <1>; ++ status = "okay"; ++}; ++ ++&davinci_mdio { ++ pinctrl-names = "default", "sleep"; ++ pinctrl-0 = <&davinci_mdio_default>; ++ pinctrl-1 = <&davinci_mdio_sleep>; ++ status = "okay"; ++}; +diff --git a/arch/arm/dts/am335x-bone.dts b/arch/arm/dts/am335x-bone.dts +index 6b84937204..610dde45f4 100644 +--- a/arch/arm/dts/am335x-bone.dts ++++ b/arch/arm/dts/am335x-bone.dts +@@ -9,10 +9,15 @@ + + #include "am33xx.dtsi" + #include "am335x-bone-common.dtsi" ++#include "am335x-bone-common_mii.dtsi" + + / { + model = "TI AM335x BeagleBone"; + compatible = "ti,am335x-bone", "ti,am33xx"; ++ chosen { ++ stdout-path = &uart0; ++ tick-timer = &timer2; ++ }; + }; + + &ldo3_reg { +diff --git a/arch/arm/dts/am335x-boneblack-emmc-overlay.dts b/arch/arm/dts/am335x-boneblack-emmc-overlay.dts +new file mode 100644 +index 0000000000..3830571c4a +--- /dev/null ++++ b/arch/arm/dts/am335x-boneblack-emmc-overlay.dts +@@ -0,0 +1,43 @@ ++/* ++ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++/dts-v1/; ++ ++#include "am33xx.dtsi" ++#include "am335x-bone-common.dtsi" ++#include "am335x-bone-common_mii.dtsi" ++ ++/ { ++ model = "TI AM335x BeagleBone Black"; ++ compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx"; ++ chosen { ++ stdout-path = &uart0; ++ tick-timer = &timer2; ++ }; ++}; ++ ++&ldo3_reg { ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-always-on; ++}; ++ ++&mmc1 { ++ vmmc-supply = <&vmmcsd_fixed>; ++}; ++ ++&mmc2 { ++ vmmc-supply = <&vmmcsd_fixed>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emmc_pins>; ++ bus-width = <8>; ++ status = "okay"; ++}; ++ ++&rtc { ++ system-power-controller; ++}; +diff --git a/arch/arm/dts/am335x-boneblack.dts b/arch/arm/dts/am335x-boneblack.dts +index 27ebe4a65d..a4ed1356e6 100644 +--- a/arch/arm/dts/am335x-boneblack.dts ++++ b/arch/arm/dts/am335x-boneblack.dts +@@ -9,6 +9,7 @@ + + #include "am33xx.dtsi" + #include "am335x-bone-common.dtsi" ++#include "am335x-bone-common_mii.dtsi" + + / { + model = "TI AM335x BeagleBone Black"; +diff --git a/arch/arm/dts/am335x-bonegreen.dts b/arch/arm/dts/am335x-bonegreen.dts +index 9c59da90fa..fd4e92974e 100644 +--- a/arch/arm/dts/am335x-bonegreen.dts ++++ b/arch/arm/dts/am335x-bonegreen.dts +@@ -9,6 +9,7 @@ + + #include "am33xx.dtsi" + #include "am335x-bone-common.dtsi" ++#include "am335x-bone-common_mii.dtsi" + + / { + model = "TI AM335x BeagleBone Green"; +diff --git a/arch/arm/dts/am335x-sancloud-bbe.dts b/arch/arm/dts/am335x-sancloud-bbe.dts +new file mode 100644 +index 0000000000..63338c8517 +--- /dev/null ++++ b/arch/arm/dts/am335x-sancloud-bbe.dts +@@ -0,0 +1,100 @@ ++/* ++ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++/dts-v1/; ++ ++#include "am33xx.dtsi" ++#include "am335x-bone-common.dtsi" ++#include "am335x-bone-common_rgmii.dtsi" ++ ++/ { ++ model = "SanCloud BeagleBone Enhanced"; ++ compatible = "sancloud,am335x-boneenhanced", "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx"; ++ chosen { ++ stdout-path = &uart0; ++ tick-timer = &timer2; ++ }; ++}; ++ ++&ldo3_reg { ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-always-on; ++}; ++ ++&mmc1 { ++ vmmc-supply = <&vmmcsd_fixed>; ++}; ++ ++&mmc2 { ++ vmmc-supply = <&vmmcsd_fixed>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emmc_pins>; ++ bus-width = <8>; ++ status = "okay"; ++}; ++ ++&am33xx_pinmux { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb_hub_ctrl>; ++ ++ nxp_hdmi_bonelt_pins: nxp_hdmi_bonelt_pins { ++ pinctrl-single,pins = < ++ 0x1b0 0x03 /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */ ++ 0xa0 0x08 /* lcd_data0.lcd_data0, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xa4 0x08 /* lcd_data1.lcd_data1, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xa8 0x08 /* lcd_data2.lcd_data2, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xac 0x08 /* lcd_data3.lcd_data3, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xb0 0x08 /* lcd_data4.lcd_data4, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xb4 0x08 /* lcd_data5.lcd_data5, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xb8 0x08 /* lcd_data6.lcd_data6, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xbc 0x08 /* lcd_data7.lcd_data7, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xc0 0x08 /* lcd_data8.lcd_data8, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xc4 0x08 /* lcd_data9.lcd_data9, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xc8 0x08 /* lcd_data10.lcd_data10, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xcc 0x08 /* lcd_data11.lcd_data11, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xd0 0x08 /* lcd_data12.lcd_data12, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xd4 0x08 /* lcd_data13.lcd_data13, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xd8 0x08 /* lcd_data14.lcd_data14, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xdc 0x08 /* lcd_data15.lcd_data15, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xe0 0x00 /* lcd_vsync.lcd_vsync, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */ ++ 0xe4 0x00 /* lcd_hsync.lcd_hsync, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */ ++ 0xe8 0x00 /* lcd_pclk.lcd_pclk, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */ ++ 0xec 0x00 /* lcd_ac_bias_en.lcd_ac_bias_en, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */ ++ >; ++ }; ++ nxp_hdmi_bonelt_off_pins: nxp_hdmi_bonelt_off_pins { ++ pinctrl-single,pins = < ++ 0x1b0 0x03 /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */ ++ >; ++ }; ++ ++ usb_hub_ctrl: usb_hub_ctrl { ++ pinctrl-single,pins = < ++ 0x144 (PIN_OUTPUT_PULLUP | MUX_MODE7) /* mcasp0_ahclkr.gpio3_17 */ ++ >; ++ }; ++}; ++ ++&lcdc { ++ status = "okay"; ++}; ++ ++/ { ++ hdmi { ++ compatible = "ti,tilcdc,slave"; ++ i2c = <&i2c0>; ++ pinctrl-names = "default", "off"; ++ pinctrl-0 = <&nxp_hdmi_bonelt_pins>; ++ pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>; ++ status = "okay"; ++ }; ++}; ++ ++&rtc { ++ system-power-controller; ++}; +diff --git a/arch/arm/dts/am335x-vsc8531bbb.dts b/arch/arm/dts/am335x-vsc8531bbb.dts +new file mode 100644 +index 0000000000..d2df1aaf1e +--- /dev/null ++++ b/arch/arm/dts/am335x-vsc8531bbb.dts +@@ -0,0 +1,91 @@ ++/* ++ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++/dts-v1/; ++ ++#include "am33xx.dtsi" ++#include "am335x-bone-common.dtsi" ++#include "am335x-bone-common_rgmii.dtsi" ++ ++/ { ++ model = "TI AM335x BeagleBone Black"; ++ compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx"; ++ chosen { ++ stdout-path = &uart0; ++ tick-timer = &timer2; ++ }; ++}; ++ ++&ldo3_reg { ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-always-on; ++}; ++ ++&mmc1 { ++ vmmc-supply = <&vmmcsd_fixed>; ++}; ++ ++&mmc2 { ++ vmmc-supply = <&vmmcsd_fixed>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emmc_pins>; ++ bus-width = <8>; ++ status = "okay"; ++}; ++ ++&am33xx_pinmux { ++ nxp_hdmi_bonelt_pins: nxp_hdmi_bonelt_pins { ++ pinctrl-single,pins = < ++ 0x1b0 0x03 /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */ ++ 0xa0 0x08 /* lcd_data0.lcd_data0, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xa4 0x08 /* lcd_data1.lcd_data1, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xa8 0x08 /* lcd_data2.lcd_data2, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xac 0x08 /* lcd_data3.lcd_data3, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xb0 0x08 /* lcd_data4.lcd_data4, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xb4 0x08 /* lcd_data5.lcd_data5, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xb8 0x08 /* lcd_data6.lcd_data6, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xbc 0x08 /* lcd_data7.lcd_data7, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xc0 0x08 /* lcd_data8.lcd_data8, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xc4 0x08 /* lcd_data9.lcd_data9, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xc8 0x08 /* lcd_data10.lcd_data10, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xcc 0x08 /* lcd_data11.lcd_data11, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xd0 0x08 /* lcd_data12.lcd_data12, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xd4 0x08 /* lcd_data13.lcd_data13, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xd8 0x08 /* lcd_data14.lcd_data14, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xdc 0x08 /* lcd_data15.lcd_data15, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xe0 0x00 /* lcd_vsync.lcd_vsync, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */ ++ 0xe4 0x00 /* lcd_hsync.lcd_hsync, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */ ++ 0xe8 0x00 /* lcd_pclk.lcd_pclk, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */ ++ 0xec 0x00 /* lcd_ac_bias_en.lcd_ac_bias_en, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */ ++ >; ++ }; ++ nxp_hdmi_bonelt_off_pins: nxp_hdmi_bonelt_off_pins { ++ pinctrl-single,pins = < ++ 0x1b0 0x03 /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */ ++ >; ++ }; ++}; ++ ++&lcdc { ++ status = "okay"; ++}; ++ ++/ { ++ hdmi { ++ compatible = "ti,tilcdc,slave"; ++ i2c = <&i2c0>; ++ pinctrl-names = "default", "off"; ++ pinctrl-0 = <&nxp_hdmi_bonelt_pins>; ++ pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>; ++ status = "okay"; ++ }; ++}; ++ ++&rtc { ++ system-power-controller; ++}; +diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c +index 8eaf3e9a5c..b385de0447 100644 +--- a/board/ti/am335x/board.c ++++ b/board/ti/am335x/board.c +@@ -556,6 +556,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 +@@ -651,8 +669,22 @@ int board_late_init(void) + #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + char *name = NULL; + ++ if (board_is_bone_lt()) { ++ puts("Board: BeagleBone Black\n"); ++ name = "A335BNLT"; ++ if (!strncmp(board_ti_get_rev(), "BW", 2)) { ++ puts("Model: BeagleBone Black Wireless\n"); ++ name = "BBBW"; ++ } ++ if (!strncmp(board_ti_get_rev(), "SE", 2)) { ++ puts("Model: SanCloud BeagleBone Enhanced\n"); ++ name = "SBBE"; ++ } ++ } ++ + if (board_is_bbg1()) + name = "BBG1"; ++ + set_board_info_env(name); + + /* +@@ -788,18 +820,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; +@@ -824,7 +859,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(); + +@@ -854,17 +889,17 @@ int board_eth_init(bd_t *bis) + #ifdef CONFIG_SPL_LOAD_FIT + int board_fit_config_name_match(const char *name) + { +- if (board_is_gp_evm() && !strcmp(name, "am335x-evm")) +- return 0; +- else if (board_is_bone() && !strcmp(name, "am335x-bone")) ++ if (board_is_bone() && !strcmp(name, "am335x-bone")) + return 0; + else if (board_is_bone_lt() && !strcmp(name, "am335x-boneblack")) + return 0; +- else if (board_is_evm_sk() && !strcmp(name, "am335x-evmsk")) ++ else if (board_is_bbbw() && !strcmp(name, "am335x-boneblack")) + return 0; +- else if (board_is_bbg1() && !strcmp(name, "am335x-bonegreen")) ++ else if (board_is_m10a() && !strcmp(name, "am335x-vsc8531bbb")) ++ return 0; ++ else if (board_is_bone_lt_enhanced() && !strcmp(name, "am335x-sancloud-bbe")) + return 0; +- else if (board_is_icev2() && !strcmp(name, "am335x-icev2")) ++ else if (board_is_bbg1() && !strcmp(name, "am335x-bonegreen")) + return 0; + else + return -1; +diff --git a/board/ti/am335x/board.h b/board/ti/am335x/board.h +index 48c139a817..8e872bb1c7 100644 +--- a/board/ti/am335x/board.h ++++ b/board/ti/am335x/board.h +@@ -34,11 +34,26 @@ 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_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_evm_sk(void) + { + return board_ti_is("A335X_SK"); +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 79125ea8fe..39e954997e 100644 +--- a/configs/am335x_boneblack_defconfig ++++ b/configs/am335x_boneblack_defconfig +@@ -5,7 +5,6 @@ CONFIG_TARGET_AM335X_EVM=y + CONFIG_SPL_STACK_R_ADDR=0x82000000 + CONFIG_DISTRO_DEFAULTS=y + CONFIG_FIT=y +-CONFIG_SYS_EXTRA_OPTIONS="EMMC_BOOT" + CONFIG_SYS_CONSOLE_INFO_QUIET=y + CONFIG_VERSION_VARIABLE=y + CONFIG_SPL=y +@@ -44,3 +43,4 @@ 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 +diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig +index 08c1e79f74..2988a46eb6 100644 +--- a/configs/am335x_evm_defconfig ++++ b/configs/am335x_evm_defconfig +@@ -1,19 +1,20 @@ + CONFIG_ARM=y + CONFIG_AM33XX=y ++# CONFIG_SPL_NAND_SUPPORT is not set + CONFIG_TARGET_AM335X_EVM=y + CONFIG_SPL_STACK_R_ADDR=0x82000000 +-CONFIG_DEFAULT_DEVICE_TREE="am335x-evm" + CONFIG_DISTRO_DEFAULTS=y + CONFIG_FIT=y +-CONFIG_SYS_EXTRA_OPTIONS="NAND" +-CONFIG_SPL_LOAD_FIT=y + CONFIG_SYS_CONSOLE_INFO_QUIET=y + CONFIG_VERSION_VARIABLE=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_ASKENV=y + # CONFIG_CMD_FLASH is not set +@@ -22,25 +23,17 @@ CONFIG_CMD_SF=y + CONFIG_CMD_SPI=y + CONFIG_CMD_I2C=y + CONFIG_CMD_USB=y ++CONFIG_CMD_USB_MASS_STORAGE=y + CONFIG_CMD_DFU=y + CONFIG_CMD_GPIO=y + # CONFIG_CMD_SETEXPR is not set + CONFIG_CMD_EXT4_WRITE=y +-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_MMC=y +-CONFIG_DFU_NAND=y + CONFIG_DFU_RAM=y +-CONFIG_DM_I2C=y +-CONFIG_DM_MMC=y +-# CONFIG_DM_MMC_OPS is not set + 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_USB_MUSB_HOST=y + CONFIG_USB_MUSB_GADGET=y +@@ -50,5 +43,5 @@ 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_SPL_OF_LIBFDT=y ++CONFIG_OF_LIBFDT=y ++CONFIG_OF_LIBFDT_OVERLAY=y +diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h +index e0cb6dc2ec..cec33dd6dd 100644 +--- a/include/configs/am335x_evm.h ++++ b/include/configs/am335x_evm.h +@@ -18,6 +18,7 @@ + + #include + #include ++#define CONFIG_ENV_IS_NOWHERE + + #ifndef CONFIG_SPL_BUILD + # define CONFIG_TIMESTAMP +@@ -67,9 +68,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 " " +@@ -86,7 +92,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) + +@@ -140,12 +145,39 @@ + "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 = BLA0; then " \ ++ "setenv fdtfile am335x-boneblue.dtb; setenv fdtbase am335x-boneblue; " \ ++ "elif test $board_rev = BBG1; then " \ ++ "setenv fdtfile am335x-bonegreen.dtb; setenv fdtbase am335x-bonegreen; " \ ++ "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 = BBG1; then " \ +- "setenv fdtfile am335x-bonegreen.dtb; fi; " \ ++ "setenv fdtfile am335x-bonegreen.dtb; setenv fdtbase am335x-bonegreen; fi; " \ ++ "if test $board_name = BBBW; then " \ ++ "setenv fdtfile am335x-boneblack-wireless.dtb; setenv fdtbase am335x-boneblack-wireless; 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 " \ +@@ -153,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 \ +@@ -281,12 +320,7 @@ + #endif + + #ifdef CONFIG_USB_MUSB_GADGET +-/* Removing USB gadget and can be enabled adter adding support usb DM */ +-#ifndef CONFIG_DM_ETH +-#define CONFIG_USB_ETHER +-#define CONFIG_USB_ETH_RNDIS +-#define CONFIG_USBNET_HOST_ADDR "de:ad:be:af:00:00" +-#endif /* CONFIG_DM_ETH */ ++#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 d13fc94785..4b6cbb9e89 100644 +--- a/include/configs/ti_armv7_common.h ++++ b/include/configs/ti_armv7_common.h +@@ -60,20 +60,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};" \ +@@ -127,6 +167,226 @@ + "loadfit=run args_fit; bootm ${loadaddr}:kernel@1 " \ + "${loadaddr}:ramdisk@1 ${loadaddr}:${fdtfile};\0" \ + ++#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" \ ++ + /* + * DDR information. If the CONFIG_NR_DRAM_BANKS is not defined, + * we say (for simplicity) that we have 1 bank, always, even when +diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt +index 8814841e1f..5a9bdbfaf6 100644 +--- a/scripts/config_whitelist.txt ++++ b/scripts/config_whitelist.txt +@@ -3490,6 +3490,7 @@ CONFIG_PHY_LXT + CONFIG_PHY_M88E1111 + CONFIG_PHY_MARVELL + CONFIG_PHY_MAX_ADDR ++CONFIG_PHY_MSCC + CONFIG_PHY_MICREL + CONFIG_PHY_MICREL_KSZ9021 + CONFIG_PHY_MICREL_KSZ9031 +-- +2.11.0 + diff --git a/v2017.01-rc2/0001-at91sam9x5ek-uEnv.txt-bootz-n-fixes.patch b/v2017.01-rc2/0001-at91sam9x5ek-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..b6b956c --- /dev/null +++ b/v2017.01-rc2/0001-at91sam9x5ek-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,105 @@ +From 109d44956988f3121d264e451f677df8647411a5 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Wed, 28 Sep 2016 09:58:30 -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 eb88bbb..ad9e442 100644 +--- a/configs/at91sam9x5ek_mmc_defconfig ++++ b/configs/at91sam9x5ek_mmc_defconfig +@@ -16,7 +16,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_SPI_FLASH=y + CONFIG_SPI_FLASH_ATMEL=y +diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h +index edad1dd..3c6aab2 100644 +--- a/include/configs/at91sam9x5ek.h ++++ b/include/configs/at91sam9x5ek.h +@@ -117,6 +117,7 @@ + #define CONFIG_MMC + #define CONFIG_GENERIC_MMC + #define CONFIG_GENERIC_ATMEL_MCI ++#define CONFIG_SUPPORT_RAW_INITRD + #endif + + /* FAT */ +@@ -191,18 +192,51 @@ + #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_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_BAUDRATE 115200 +-- +2.9.3 + diff --git a/v2017.01-rc2/0001-de0_nano-fixes.patch b/v2017.01-rc2/0001-de0_nano-fixes.patch new file mode 100644 index 0000000..6f42921 --- /dev/null +++ b/v2017.01-rc2/0001-de0_nano-fixes.patch @@ -0,0 +1,149 @@ +From 9b87177da1720a40857e666619706430382e715f Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Fri, 18 Nov 2016 15:48:35 -0600 +Subject: [PATCH] de0_nano fixes + +Signed-off-by: Robert Nelson +--- + include/configs/socfpga_de0_nano_soc.h | 111 ++++++++++++++++++++++++++++----- + 1 file changed, 96 insertions(+), 15 deletions(-) + +diff --git a/include/configs/socfpga_de0_nano_soc.h b/include/configs/socfpga_de0_nano_soc.h +index 6b9546e..bc69bf8 100644 +--- a/include/configs/socfpga_de0_nano_soc.h ++++ b/include/configs/socfpga_de0_nano_soc.h +@@ -13,6 +13,7 @@ + #define CONFIG_DOS_PARTITION + #define CONFIG_FAT_WRITE + #define CONFIG_HW_WATCHDOG ++#define CONFIG_SUPPORT_RAW_INITRD + + /* Memory configurations */ + #define PHYS_SDRAM_1_SIZE 0x40000000 /* 1GiB */ +@@ -20,7 +21,7 @@ + /* Booting Linux */ + #define CONFIG_BOOTFILE "fitImage" + #define CONFIG_BOOTARGS "console=ttyS0," __stringify(CONFIG_BAUDRATE) +-#define CONFIG_BOOTCOMMAND "run mmcload; run mmcboot" ++#define CONFIG_BOOTCOMMAND "run mmcboot" + #define CONFIG_LOADADDR 0x01000000 + #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR + +@@ -34,20 +35,100 @@ + + /* Extra Environment */ + #define CONFIG_EXTRA_ENV_SETTINGS \ +- "loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ +- "ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \ +- "bootm ${loadaddr} - ${fdt_addr}\0" \ +- "bootimage=zImage\0" \ +- "fdt_addr=100\0" \ +- "fdtimage=socfpga.dtb\0" \ +- "bootm ${loadaddr} - ${fdt_addr}\0" \ +- "mmcroot=/dev/mmcblk0p2\0" \ +- "mmcboot=setenv bootargs " CONFIG_BOOTARGS \ +- " root=${mmcroot} rw rootwait;" \ +- "bootz ${loadaddr} - ${fdt_addr}\0" \ +- "mmcload=mmc rescan;" \ +- "load mmc 0:1 ${loadaddr} ${bootimage};" \ +- "load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \ ++ "console=ttyS0,115200\0" \ ++ "loadaddr=0x01000000\0" \ ++ "fdt_addr=0x07000000\0" \ ++ "fdt_file=socfpga_cyclone5_de0_sockit.dtb\0" \ ++ "rdaddr=0x07080000\0" \ ++ "fpgadata=0x2000000\0" \ ++ "devtype=mmc\0" \ ++ "optargs=\0" \ ++ "cmdline=\0" \ ++ "mmcdev=0\0" \ ++ "mmcpart=\0" \ ++ "mmcroot=/dev/mmcblk0p2 ro\0" \ ++ "mmcrootfstype=ext4 rootwait\0" \ ++ "mmcargs=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "root=${mmcroot} " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${cmdline}\0" \ ++ "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ ++ "loadfpga=load ${devtype} ${bootpart} ${fpgadata} ${bootdir}/${fpga_file}; setenv fpgadatasize ${filesize}\0" \ ++ "uploadfpga=fpga load 0 ${fpgadata} ${fpgadatasize}\0" \ ++ "loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \ ++ "loadfdt=echo loading ${fdtdir}/${fdt_file} ...; load ${devtype} ${bootpart} ${fdt_addr} ${fdtdir}/${fdt_file}\0" \ ++ "mmcboot=${devtype} dev ${mmcdev}; " \ ++ "if ${devtype} rescan; then " \ ++ "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 ${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 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" \ ++ "uname_boot="\ ++ "setenv bootdir /boot; " \ ++ "if test -n ${fpgafile}; then " \ ++ "setenv fpga_file ${fpgafile};" \ ++ "if test -e ${devtype} ${bootpart} ${bootdir}/${fpga_file}; then " \ ++ "echo loading ${bootdir}/${fpga_file} ...; "\ ++ "run loadfpga;" \ ++ "echo uploading to fpga ...; "\ ++ "run uploadfpga;" \ ++ "echo fpga loading complete ...; "\ ++ "fi;" \ ++ "fi;" \ ++ "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}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /usr/lib/linux-image-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdt_file}; then " \ ++ "run loadfdt;" \ ++ "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" + + /* The rest of the configuration is shared */ + #include +-- +2.10.2 + diff --git a/v2017.01-rc2/0001-ls1021atwr-fixes.patch b/v2017.01-rc2/0001-ls1021atwr-fixes.patch new file mode 100644 index 0000000..df4d05d --- /dev/null +++ b/v2017.01-rc2/0001-ls1021atwr-fixes.patch @@ -0,0 +1,76 @@ +From 9405e2e4ce516160cfb36ffd36d835c17406e817 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Mon, 20 Jun 2016 17:05:54 -0500 +Subject: [PATCH] ls1021atwr fixes + +Signed-off-by: Robert Nelson +--- + include/configs/ls1021atwr.h | 42 +++++++++++++++++++++++++++++++++--------- + 1 file changed, 33 insertions(+), 9 deletions(-) + +diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h +index 0fb28ef..a34f59f 100644 +--- a/include/configs/ls1021atwr.h ++++ b/include/configs/ls1021atwr.h +@@ -418,17 +418,40 @@ + + + #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" ++#define CONFIG_CONSOLE_DEV "ttyLP0" + #else +-#define CONFIG_EXTRA_ENV_SETTINGS \ +- "bootargs=root=/dev/ram0 rw console=ttyS0,115200\0" \ +- "initrd_high=0xffffffff\0" \ +- "fdt_high=0xffffffff\0" ++#define CONFIG_CONSOLE_DEV "ttyS0" + #endif + ++#ifndef CONFIG_SPL_BUILD ++#define CONFIG_EXTRA_ENV_SETTINGS \ ++ "console=" CONFIG_CONSOLE_DEV ",115200\0" \ ++ "fdtfile=ls1021a-twr.dtb\0" \ ++ "fdt_high=0xffffffff\0" \ ++ "initrd_high=0xffffffff\0" \ ++ "fdt_addr_r=0x18000000\0" \ ++ "fdt_addr=0x18000000\0" \ ++ "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \ ++ "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ ++ "pxe_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ ++ "ramdisk_addr_r=0x13000000\0" \ ++ "ramdiskaddr=0x13000000\0" \ ++ "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \ ++ BOOTENV ++ ++#define CONFIG_BOOTCOMMAND \ ++ "run distro_bootcmd" ++ ++#define BOOT_TARGET_DEVICES(func) \ ++ func(MMC, mmc, 0) ++ ++#include ++#include ++ ++#else ++#define CONFIG_EXTRA_ENV_SETTINGS ++#endif /* CONFIG_SPL_BUILD */ ++ + /* + * Miscellaneous configurable options + */ +@@ -443,7 +466,8 @@ + #define CONFIG_SYS_MEMTEST_START 0x80000000 + #define CONFIG_SYS_MEMTEST_END 0x9fffffff + +-#define CONFIG_SYS_LOAD_ADDR 0x82000000 ++#define CONFIG_LOADADDR 0x82000000 ++#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR + + #define CONFIG_LS102XA_STREAM_ID + +-- +2.8.1 + diff --git a/v2017.01-rc2/0001-mx23_olinuxino-uEnv.txt-bootz-n-fixes.patch b/v2017.01-rc2/0001-mx23_olinuxino-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..4421238 --- /dev/null +++ b/v2017.01-rc2/0001-mx23_olinuxino-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,185 @@ +From 9edeb8dcba24d18ec5313d9687e2350540cf7bbb Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 18 Oct 2016 15:00:45 -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 ad27842..d9508a1 100644 +--- a/configs/mx23_olinuxino_defconfig ++++ b/configs/mx23_olinuxino_defconfig +@@ -9,6 +9,7 @@ CONFIG_VERSION_VARIABLE=y + # CONFIG_DISPLAY_BOARDINFO is not set + 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 +@@ -18,7 +19,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_USB=y + CONFIG_USB_STORAGE=y + CONFIG_OF_LIBFDT=y +diff --git a/include/configs/mx23_olinuxino.h b/include/configs/mx23_olinuxino.h +index 36ff7ce..1ee598f 100644 +--- a/include/configs/mx23_olinuxino.h ++++ b/include/configs/mx23_olinuxino.h +@@ -16,6 +16,8 @@ + + #define CONFIG_CMD_LED + ++#define CONFIG_SUPPORT_RAW_INITRD ++ + /* Memory configuration */ + #define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */ + #define PHYS_SDRAM_1 0x40000000 /* Base address */ +@@ -75,20 +77,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 " \ +@@ -127,19 +167,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.9.3 + diff --git a/v2017.01-rc2/0001-mx51evk-uEnv.txt-bootz-n-fixes.patch b/v2017.01-rc2/0001-mx51evk-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..bf82eaf --- /dev/null +++ b/v2017.01-rc2/0001-mx51evk-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,232 @@ +From 279adbc10e57c464db355f4d7ad6dbf8f7c88c74 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 1 Nov 2016 10:10:29 -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 9ac4b65..50c19c7 100644 +--- a/configs/mx51evk_defconfig ++++ b/configs/mx51evk_defconfig +@@ -16,7 +16,10 @@ CONFIG_CMD_USB=y + CONFIG_CMD_DHCP=y + CONFIG_CMD_MII=y + CONFIG_CMD_PING=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 9796d39..d7f9374 100644 +--- a/drivers/mmc/fsl_esdhc.c ++++ b/drivers/mmc/fsl_esdhc.c +@@ -288,15 +288,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 3c1d53f..d49f3e8 100644 +--- a/include/configs/mx51evk.h ++++ b/include/configs/mx51evk.h +@@ -72,6 +72,7 @@ + #define CONFIG_GENERIC_MMC + #define CONFIG_DOS_PARTITION + ++#define CONFIG_SUPPORT_RAW_INITRD + /* + * Eth Configs + */ +@@ -117,24 +118,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 " \ +@@ -173,19 +225,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.10.1 + diff --git a/v2017.01-rc2/0001-mx53loco-uEnv.txt-bootz-n-fixes.patch b/v2017.01-rc2/0001-mx53loco-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..4b8bd52 --- /dev/null +++ b/v2017.01-rc2/0001-mx53loco-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,198 @@ +From 9599de76bfa41ee393c927b17e4244048c2a3082 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Fri, 17 Jun 2016 10:28:59 -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 62496c3..9c0d7bc 100644 +--- a/configs/m53evk_defconfig ++++ b/configs/m53evk_defconfig +@@ -14,6 +14,7 @@ CONFIG_CMD_USB=y + CONFIG_CMD_DHCP=y + 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 +diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h +index 8743ddc..bd64fef 100644 +--- a/include/configs/mx53loco.h ++++ b/include/configs/mx53loco.h +@@ -91,26 +91,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 " \ +@@ -149,19 +198,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.8.1 + diff --git a/v2017.01-rc2/0001-mx6qsabre_common-uEnv.txt-bootz-n-fixes.patch b/v2017.01-rc2/0001-mx6qsabre_common-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..bec9dc4 --- /dev/null +++ b/v2017.01-rc2/0001-mx6qsabre_common-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,197 @@ +From feb845a61c93562ca91cbf98726e17a222d00690 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 1 Nov 2016 10:17:21 -0500 +Subject: [PATCH] mx6qsabre_common: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + include/configs/mx6sabre_common.h | 139 +++++++++++++++++++++++++++++++++----- + 1 file changed, 121 insertions(+), 18 deletions(-) + +diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h +index e404d5b..1408e5a 100644 +--- a/include/configs/mx6sabre_common.h ++++ b/include/configs/mx6sabre_common.h +@@ -72,9 +72,12 @@ + "image=zImage\0" \ + "fdt_file=undefined\0" \ + "fdt_addr=0x18000000\0" \ ++ "rdaddr=0x12A00000\0" \ + "boot_fdt=try\0" \ + "ip_dyn=yes\0" \ +- "console=" CONSOLE_DEV "\0" \ ++ "console=ttymxc0,115200\0" \ ++ "optargs=\0" \ ++ "cmdline=\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" \ +@@ -83,7 +86,8 @@ + "initrd_high=0xffffffff\0" \ + "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \ + "mmcpart=1\0" \ +- "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \ ++ "mmcroot=/dev/mmcblk0p2 ro\0" \ ++ "mmcrootfstype=ext4 rootwait fixrtc\0" \ + "update_sd_firmware=" \ + "if test ${ip_dyn} = yes; then " \ + "setenv get_cmd dhcp; " \ +@@ -98,15 +102,55 @@ + "fi; " \ + "fi\0" \ + EMMC_ENV \ +- "mmcargs=setenv bootargs console=${console},${baudrate} " \ +- "root=${mmcroot}\0" \ ++ "mmcargs=setenv bootargs console=${console}" \ ++ "${optargs} " \ ++ "root=${mmcroot} " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${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" \ ++ "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${mmckernel}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 " \ +@@ -145,6 +189,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 = SABREAUTO && test $board_rev = MX6QP; then " \ +@@ -165,17 +273,12 @@ + + #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 mmcdev 1;" \ ++ "setenv mmckernel 0;" \ ++ "run mmcboot;" \ ++ "setenv mmcdev 0;" \ ++ "setenv mmckernel 0;" \ ++ "run mmcboot;" + + #define CONFIG_ARP_TIMEOUT 200UL + +-- +2.10.1 + diff --git a/v2017.01-rc2/0001-mx6ul_14x14_evk-fixes.patch b/v2017.01-rc2/0001-mx6ul_14x14_evk-fixes.patch new file mode 100644 index 0000000..72a9dd3 --- /dev/null +++ b/v2017.01-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.01-rc2/0001-omap3_beagle-uEnv.txt-bootz-n-fixes.patch b/v2017.01-rc2/0001-omap3_beagle-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..4cad161 --- /dev/null +++ b/v2017.01-rc2/0001-omap3_beagle-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,489 @@ +From b6fda4d7b15f22e1011faccb188e92af5dd08d12 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 6 Dec 2016 09:59:40 -0600 +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 | 148 ++++++++--------------------------- + include/configs/ti_armv7_common.h | 158 ++++++++++++++++++++++++++++++++++++-- + 4 files changed, 216 insertions(+), 129 deletions(-) + +diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c +index cfdab3e..ebf4683 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 +@@ -211,25 +212,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)); + } + +@@ -341,15 +342,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, +@@ -390,7 +394,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, +@@ -473,6 +477,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 4816a03..ce48865 100644 +--- a/configs/omap3_beagle_defconfig ++++ b/configs/omap3_beagle_defconfig +@@ -1,5 +1,6 @@ + CONFIG_ARM=y + CONFIG_OMAP34XX=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 9850aa6..6e505ab 100644 +--- a/include/configs/omap3_beagle.h ++++ b/include/configs/omap3_beagle.h +@@ -110,86 +110,38 @@ + #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 + + #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; " \ +@@ -203,48 +155,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 d13fc94..fb9a4f1 100644 +--- a/include/configs/ti_armv7_common.h ++++ b/include/configs/ti_armv7_common.h +@@ -60,11 +60,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} " \ ++ "${musb} ${cmdline}\0" \ ++ "args_mmc_old=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "root=${oldroot} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${musb} ${cmdline}\0" \ ++ "args_mmc_uuid=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "root=UUID=${uuid} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${musb} ${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 " \ ++ "${musb} ${cmdline}\0"\ + "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \ + "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \ + "source ${loadaddr}\0" \ +@@ -127,6 +149,132 @@ + "loadfit=run args_fit; bootm ${loadaddr}:kernel@1 " \ + "${loadaddr}:ramdisk@1 ${loadaddr}:${fdtfile};\0" \ + ++#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" \ ++ + /* + * DDR information. If the CONFIG_NR_DRAM_BANKS is not defined, + * we say (for simplicity) that we have 1 bank, always, even when +@@ -292,8 +440,6 @@ + #define CONFIG_CMD_SPL + #endif + +-#define CONFIG_SYS_THUMB_BUILD +- + /* General parts of the framework, required. */ + #define CONFIG_SPL_BOARD_INIT + +@@ -331,6 +477,4 @@ + #define NETARGS "" + #endif + +-#include +- + #endif /* __CONFIG_TI_ARMV7_COMMON_H__ */ +-- +2.10.2 + diff --git a/v2017.01-rc2/0001-omap4_common-uEnv.txt-bootz-n-fixes.patch b/v2017.01-rc2/0001-omap4_common-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..42390bc --- /dev/null +++ b/v2017.01-rc2/0001-omap4_common-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,256 @@ +From c6caa773987f269da468a81a08bf76f5a9b61cbb Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 6 Dec 2016 10:08:13 -0600 +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 | 157 +++++++++++++++++++++++++++++++++++++- + include/configs/ti_omap4_common.h | 8 +- + 3 files changed, 163 insertions(+), 7 deletions(-) + +diff --git a/configs/omap4_panda_defconfig b/configs/omap4_panda_defconfig +index 8d90248..63f17d6 100644 +--- a/configs/omap4_panda_defconfig ++++ b/configs/omap4_panda_defconfig +@@ -10,6 +10,10 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y + CONFIG_VERSION_VARIABLE=y + CONFIG_SPL=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_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_SYS_NS16550=y + CONFIG_USB=y + CONFIG_USB_STORAGE=y +diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h +index d13fc94..50988d7 100644 +--- a/include/configs/ti_armv7_common.h ++++ b/include/configs/ti_armv7_common.h +@@ -60,11 +60,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" \ +@@ -73,7 +95,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};" \ +@@ -127,6 +150,132 @@ + "loadfit=run args_fit; bootm ${loadaddr}:kernel@1 " \ + "${loadaddr}:ramdisk@1 ${loadaddr}:${fdtfile};\0" \ + ++#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" \ ++ + /* + * DDR information. If the CONFIG_NR_DRAM_BANKS is not defined, + * we say (for simplicity) that we have 1 bank, always, even when +diff --git a/include/configs/ti_omap4_common.h b/include/configs/ti_omap4_common.h +index 8e0f9eb..587216b 100644 +--- a/include/configs/ti_omap4_common.h ++++ b/include/configs/ti_omap4_common.h +@@ -42,6 +42,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 +@@ -79,9 +80,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 " " +@@ -135,6 +137,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 + + /* +-- +2.10.2 + diff --git a/v2017.01-rc2/0001-omap5_common-uEnv.txt-bootz-n-fixes.patch b/v2017.01-rc2/0001-omap5_common-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..6e8b74f --- /dev/null +++ b/v2017.01-rc2/0001-omap5_common-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,260 @@ +From 601f71558ff09e1fee20d505e4befcd2cc9a1101 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 6 Dec 2016 10:13:58 -0600 +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 | 157 +++++++++++++++++++++++++++++++++++++- + include/configs/ti_omap5_common.h | 21 ++--- + 3 files changed, 165 insertions(+), 18 deletions(-) + +diff --git a/configs/omap5_uevm_defconfig b/configs/omap5_uevm_defconfig +index 3005ffd..19037e3 100644 +--- a/configs/omap5_uevm_defconfig ++++ b/configs/omap5_uevm_defconfig +@@ -7,6 +7,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 +@@ -23,7 +27,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_DFU_MMC=y +diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h +index d13fc94..499f3e5 100644 +--- a/include/configs/ti_armv7_common.h ++++ b/include/configs/ti_armv7_common.h +@@ -60,11 +60,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" \ +@@ -73,7 +95,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};" \ +@@ -127,6 +150,132 @@ + "loadfit=run args_fit; bootm ${loadaddr}:kernel@1 " \ + "${loadaddr}:ramdisk@1 ${loadaddr}:${fdtfile};\0" \ + ++#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" \ ++ + /* + * DDR information. If the CONFIG_NR_DRAM_BANKS is not defined, + * we say (for simplicity) that we have 1 bank, always, even when +diff --git a/include/configs/ti_omap5_common.h b/include/configs/ti_omap5_common.h +index 37d6565..f5aedfb 100644 +--- a/include/configs/ti_omap5_common.h ++++ b/include/configs/ti_omap5_common.h +@@ -101,25 +101,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;" \ + "" + +-- +2.10.2 + diff --git a/v2017.01-rc2/0001-sama5d2_xplained-fixes.patch b/v2017.01-rc2/0001-sama5d2_xplained-fixes.patch new file mode 100644 index 0000000..47caaff --- /dev/null +++ b/v2017.01-rc2/0001-sama5d2_xplained-fixes.patch @@ -0,0 +1,58 @@ +From 29e24cadf3247049db44292317b437da7d9a9701 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 18 Oct 2016 15:14:29 -0500 +Subject: [PATCH] sama5d2_xplained fixes + +Signed-off-by: Robert Nelson +--- + configs/sama5d2_xplained_mmc_defconfig | 4 ++++ + include/configs/sama5d2_xplained.h | 10 +++++----- + 2 files changed, 9 insertions(+), 5 deletions(-) + +diff --git a/configs/sama5d2_xplained_mmc_defconfig b/configs/sama5d2_xplained_mmc_defconfig +index 23ab4d6..390d4ef 100644 +--- a/configs/sama5d2_xplained_mmc_defconfig ++++ b/configs/sama5d2_xplained_mmc_defconfig +@@ -14,6 +14,10 @@ CONFIG_BOOTDELAY=3 + # CONFIG_DISPLAY_BOARDINFO is not set + CONFIG_SPL=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 +diff --git a/include/configs/sama5d2_xplained.h b/include/configs/sama5d2_xplained.h +index e684d2a..95d396c 100644 +--- a/include/configs/sama5d2_xplained.h ++++ b/include/configs/sama5d2_xplained.h +@@ -101,19 +101,19 @@ + #endif + + #ifdef CONFIG_SYS_USE_MMC ++#define CONFIG_PARTITION_UUIDS ++#define CONFIG_CMD_PART + + /* bootstrap + u-boot + env in sd card */ + #undef FAT_ENV_DEVICE_AND_PART + #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.9.3 + diff --git a/v2017.01-rc2/0001-sama5d3_xplained-uEnv.txt-bootz-n-fixes.patch b/v2017.01-rc2/0001-sama5d3_xplained-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..5c807f9 --- /dev/null +++ b/v2017.01-rc2/0001-sama5d3_xplained-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,58 @@ +From 5e26c6358f1c63362805c704254ac2c87a9693e1 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 18 Oct 2016 15:19:10 -0500 +Subject: [PATCH] sama5d3_xplained: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + configs/sama5d3_xplained_mmc_defconfig | 4 ++++ + include/configs/at91-sama5_common.h | 9 +++++---- + 2 files changed, 9 insertions(+), 4 deletions(-) + +diff --git a/configs/sama5d3_xplained_mmc_defconfig b/configs/sama5d3_xplained_mmc_defconfig +index 4f4e51b..385ff99 100644 +--- a/configs/sama5d3_xplained_mmc_defconfig ++++ b/configs/sama5d3_xplained_mmc_defconfig +@@ -14,6 +14,10 @@ CONFIG_BOOTDELAY=3 + # CONFIG_DISPLAY_BOARDINFO is not set + CONFIG_SPL=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 +diff --git a/include/configs/at91-sama5_common.h b/include/configs/at91-sama5_common.h +index b09ef33..c528275 100644 +--- a/include/configs/at91-sama5_common.h ++++ b/include/configs/at91-sama5_common.h +@@ -45,6 +45,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 */ +@@ -64,12 +66,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.9.3 + diff --git a/v2017.01-rc2/0001-sama5d3xek-uEnv.txt-bootz-n-fixes.patch b/v2017.01-rc2/0001-sama5d3xek-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..f7047eb --- /dev/null +++ b/v2017.01-rc2/0001-sama5d3xek-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,42 @@ +From 47e8e8a2b961a0897745604144aaa0ee5c8c7e76 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Mon, 20 Jun 2016 14:26:00 -0500 +Subject: [PATCH] sama5d3xek: 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.01-rc2/0001-sama5d4_xplained-uEnv.txt-bootz-n-fixes.patch b/v2017.01-rc2/0001-sama5d4_xplained-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..a4ac256 --- /dev/null +++ b/v2017.01-rc2/0001-sama5d4_xplained-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,58 @@ +From 9b205b9fa9ca5d61726e554dedf814202c8f0812 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 18 Oct 2016 15:23:34 -0500 +Subject: [PATCH] sama5d4_xplained: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + configs/sama5d4_xplained_mmc_defconfig | 4 ++++ + include/configs/at91-sama5_common.h | 9 +++++---- + 2 files changed, 9 insertions(+), 4 deletions(-) + +diff --git a/configs/sama5d4_xplained_mmc_defconfig b/configs/sama5d4_xplained_mmc_defconfig +index 5ff4688..9d90f37 100644 +--- a/configs/sama5d4_xplained_mmc_defconfig ++++ b/configs/sama5d4_xplained_mmc_defconfig +@@ -14,6 +14,10 @@ CONFIG_BOOTDELAY=3 + # CONFIG_DISPLAY_BOARDINFO is not set + CONFIG_SPL=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 +diff --git a/include/configs/at91-sama5_common.h b/include/configs/at91-sama5_common.h +index b09ef33..c528275 100644 +--- a/include/configs/at91-sama5_common.h ++++ b/include/configs/at91-sama5_common.h +@@ -45,6 +45,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 */ +@@ -64,12 +66,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.9.3 + diff --git a/v2017.01-rc2/0001-sama5d4ek-uEnv.txt-bootz-n-fixes.patch b/v2017.01-rc2/0001-sama5d4ek-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..e90e5e0 --- /dev/null +++ b/v2017.01-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.01-rc2/0001-udoo-uEnv.txt-bootz-n-fixes.patch b/v2017.01-rc2/0001-udoo-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..370154c --- /dev/null +++ b/v2017.01-rc2/0001-udoo-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,191 @@ +From 657b7928d41f3dc51d1deaa410c88d600ec40fae Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Fri, 17 Jun 2016 10:40:43 -0500 +Subject: [PATCH] udoo: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + include/configs/udoo.h | 133 ++++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 116 insertions(+), 17 deletions(-) + +diff --git a/include/configs/udoo.h b/include/configs/udoo.h +index fba78d0..df1c579 100644 +--- a/include/configs/udoo.h ++++ b/include/configs/udoo.h +@@ -65,17 +65,21 @@ + #define CONFIG_EXTRA_ENV_SETTINGS \ + "script=boot.scr\0" \ + "image=zImage\0" \ +- "console=ttymxc1\0" \ ++ "console=ttymxc1,115200\0" \ + "splashpos=m,m\0" \ + "fdt_high=0xffffffff\0" \ + "initrd_high=0xffffffff\0" \ + "fdt_file=undefined\0" \ + "fdt_addr=0x18000000\0" \ ++ "rdaddr=0x12A00000\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 " \ +@@ -90,15 +94,55 @@ + "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} " \ ++ "${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 " \ +@@ -137,6 +181,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 $board_rev = MX6Q ; then " \ + "setenv fdt_file imx6q-udoo.dtb; fi; " \ +@@ -147,16 +255,7 @@ + + #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" ++ "run mmcboot; " + + /* Print Buffer Size */ + #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) +-- +2.8.1 + diff --git a/v2017.01-rc2/0001-vf610twr-uEnv.txt-bootz-n-fixes.patch b/v2017.01-rc2/0001-vf610twr-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..4231cc4 --- /dev/null +++ b/v2017.01-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.01-rc2/0001-wandboard-uEnv.txt-bootz-n-fixes.patch b/v2017.01-rc2/0001-wandboard-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..8981490 --- /dev/null +++ b/v2017.01-rc2/0001-wandboard-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,196 @@ +From 7468b645865d16e2d8fc76646a2f7a0b78242ddf Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 6 Dec 2016 10:31:04 -0600 +Subject: [PATCH] wandboard: uEnv.txt, bootz, n fixes + +Signed-off-by: Robert Nelson +--- + configs/wandboard_defconfig | 4 ++ + include/configs/wandboard.h | 125 +++++++++++++++++++++++++++++++++++++++++++- + 2 files changed, 127 insertions(+), 2 deletions(-) + +diff --git a/configs/wandboard_defconfig b/configs/wandboard_defconfig +index 3054a3a..85c110d 100644 +--- a/configs/wandboard_defconfig ++++ b/configs/wandboard_defconfig +@@ -17,6 +17,10 @@ CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6QDL" + CONFIG_SYS_CONSOLE_IS_IN_ENV=y + CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y + CONFIG_SPL=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 +diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h +index 406591c..69629ac 100644 +--- a/include/configs/wandboard.h ++++ b/include/configs/wandboard.h +@@ -95,10 +95,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 " \ +@@ -113,6 +119,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; " \ +@@ -124,6 +135,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" \ +@@ -140,6 +256,11 @@ + + #define CONFIG_BOOTCOMMAND \ + "run findfdt; " \ ++ "setenv devtype mmc;" \ ++ "setenv mmcdev 0;" \ ++ "run mmcboot;" \ ++ "setenv mmcdev 1;" \ ++ "run mmcboot;" \ + "run distro_bootcmd" + + #include +@@ -158,7 +279,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.10.2 + diff --git a/v2017.01-rc2/0002-U-Boot-BeagleBone-Cape-Manager.patch b/v2017.01-rc2/0002-U-Boot-BeagleBone-Cape-Manager.patch new file mode 100644 index 0000000..330b684 --- /dev/null +++ b/v2017.01-rc2/0002-U-Boot-BeagleBone-Cape-Manager.patch @@ -0,0 +1,329 @@ +From b2aacc132ac9f35ad8b5fa24ac8d564908c030bc Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Fri, 30 Dec 2016 11:24:44 -0600 +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 | 99 +++++++++++++++++++++++++++++++ + board/ti/am335x/board.h | 17 ++++++ + board/ti/am335x/mux.c | 15 +++++ + include/configs/ti_armv7_common.h | 73 +++++++++++++++++++++++ + include/configs/ti_armv7_omap.h | 3 + + 6 files changed, 208 insertions(+) + +diff --git a/arch/arm/mach-omap2/am33xx/clock_am33xx.c b/arch/arm/mach-omap2/am33xx/clock_am33xx.c +index 7b841b2d55..119ca3d62c 100644 +--- a/arch/arm/mach-omap2/am33xx/clock_am33xx.c ++++ b/arch/arm/mach-omap2/am33xx/clock_am33xx.c +@@ -145,6 +145,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 b385de0447..4a98510aec 100644 +--- a/board/ti/am335x/board.c ++++ b/board/ti/am335x/board.c +@@ -72,9 +72,104 @@ void do_board_detect(void) + + if (ti_i2c_eeprom_am_get(-1, CONFIG_SYS_I2C_EEPROM_ADDR)) + 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); ++} ++ ++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; ++ ++ 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); ++ ++ puts("BeagleBone: cape eeprom: i2c_probe: 0x"); ++ write_hex(addr); ++ printf(": %s\n", cape_overlay); ++ ++ 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; ++ } ++ } ++ } ++ } ++ ++ 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) + { +@@ -728,6 +823,10 @@ int board_late_init(void) + } + #endif + ++#ifdef CONFIG_TI_I2C_BOARD_DETECT ++ do_cape_detect(); ++#endif ++ + return 0; + } + #endif +diff --git a/board/ti/am335x/board.h b/board/ti/am335x/board.h +index 8e872bb1c7..05d713e228 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 +@@ -93,5 +109,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/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 4b6cbb9e89..f6c668060a 100644 +--- a/include/configs/ti_armv7_common.h ++++ b/include/configs/ti_armv7_common.h +@@ -347,6 +347,79 @@ + "fi;" \ + "fi;" \ + "fi; " \ ++ "if test -n ${enable_uboot_overlays}; then " \ ++ "if test -n ${uboot_overlay_addr0}; then " \ ++ "echo debug: [uboot_overlay_addr0=${uboot_overlay_addr0}] ... ;" \ ++ "if test -e ${devtype} ${bootpart} ${uboot_overlay_addr0}; then " \ ++ "echo loading ${uboot_overlay_addr0} ...;" \ ++ "load ${devtype} ${bootpart} ${rdaddr} ${uboot_overlay_addr0};" \ ++ "fdt addr ${fdtaddr};" \ ++ "fdt resize;" \ ++ "fdt apply ${rdaddr};" \ ++ "fdt resize;" \ ++ "setenv cape_uboot bone_capemgr.uboot_capemgr_enabled=1; " \ ++ "else " \ ++ "echo unable to find [${devtype} ${bootpart} ${uboot_overlay_addr0}]...;" \ ++ "fi; " \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_addr1}; then " \ ++ "echo debug: [uboot_overlay_addr1=${uboot_overlay_addr1}] ... ;" \ ++ "if test -e ${devtype} ${bootpart} ${uboot_overlay_addr1}; then " \ ++ "echo loading ${uboot_overlay_addr1} ...;" \ ++ "load ${devtype} ${bootpart} ${rdaddr} ${uboot_overlay_addr1};" \ ++ "fdt addr ${fdtaddr};" \ ++ "fdt resize;" \ ++ "fdt apply ${rdaddr};" \ ++ "fdt resize;" \ ++ "setenv cape_uboot bone_capemgr.uboot_capemgr_enabled=1; " \ ++ "else " \ ++ "echo unable to find [${devtype} ${bootpart} ${uboot_overlay_addr1}]...;" \ ++ "fi; " \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_addr2}; then " \ ++ "echo debug: [uboot_overlay_addr2=${uboot_overlay_addr2}] ... ;" \ ++ "if test -e ${devtype} ${bootpart} ${uboot_overlay_addr2}; then " \ ++ "echo loading ${uboot_overlay_addr2} ...;" \ ++ "load ${devtype} ${bootpart} ${rdaddr} ${uboot_overlay_addr2};" \ ++ "fdt addr ${fdtaddr};" \ ++ "fdt resize;" \ ++ "fdt apply ${rdaddr};" \ ++ "fdt resize;" \ ++ "setenv cape_uboot bone_capemgr.uboot_capemgr_enabled=1; " \ ++ "else " \ ++ "echo unable to find [${devtype} ${bootpart} ${uboot_overlay_addr2}]...;" \ ++ "fi; " \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_addr3}; then " \ ++ "echo debug: [uboot_overlay_addr3=${uboot_overlay_addr3}] ... ;" \ ++ "if test -e ${devtype} ${bootpart} ${uboot_overlay_addr3}; then " \ ++ "echo loading ${uboot_overlay_addr3} ...;" \ ++ "load ${devtype} ${bootpart} ${rdaddr} ${uboot_overlay_addr3};" \ ++ "fdt addr ${fdtaddr};" \ ++ "fdt resize;" \ ++ "fdt apply ${rdaddr};" \ ++ "fdt resize;" \ ++ "setenv cape_uboot bone_capemgr.uboot_capemgr_enabled=1; " \ ++ "else " \ ++ "echo unable to find [${devtype} ${bootpart} ${uboot_overlay_addr3}]...;" \ ++ "fi; " \ ++ "fi;" \ ++ "if test -n ${dtb_overlay}; then " \ ++ "echo debug: [dtb_overlay=${dtb_overlay}] ... ;" \ ++ "if test -e ${devtype} ${bootpart} ${dtb_overlay}; then " \ ++ "echo loading ${dtb_overlay} ...;" \ ++ "load ${devtype} ${bootpart} ${rdaddr} ${dtb_overlay};" \ ++ "fdt addr ${fdtaddr};" \ ++ "fdt resize;" \ ++ "fdt apply ${rdaddr};" \ ++ "fdt resize;" \ ++ "else " \ ++ "echo unable to find [${devtype} ${bootpart} ${dtb_overlay}]...;" \ ++ "fi; " \ ++ "fi;" \ ++ "else " \ ++ "echo 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 6d9d4b2d97..9c9e2266fc 100644 +--- a/include/configs/ti_armv7_omap.h ++++ b/include/configs/ti_armv7_omap.h +@@ -20,6 +20,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 ++ + /* MMC/SD IP block */ + #define CONFIG_OMAP_HSMMC + +-- +2.11.0 +