[U-Boot] [PATCH v2 1/4] phy: sun4i-usb: Call phy_passby even for PHY#0

2018-07-20 Thread Jagan Teki
On newer Allwinner SoC, there is a pair of EHCI/OHCI USB hosts
for OTG host mode. USB PHY passby must be configured for its
corresponding PHY. so we can call for PHY#0. on the other hand
in past usb-phy code the same thing can be restricted for
Lower SoC's, other than H3/H5/A64.

Now there is no need to restrict usb passby since the phy driver
is DT enabled, and the respective phy calls will trigger based
DT information initiated by the drivers.

Signed-off-by: Jagan Teki 
---
Changes for v2:
- update commit message, suggested by 'Chen-Yu'

 drivers/phy/allwinner/phy-sun4i-usb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c 
b/drivers/phy/allwinner/phy-sun4i-usb.c
index 2b3cf48025..01f585a283 100644
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
@@ -300,8 +300,7 @@ static int sun4i_usb_phy_init(struct phy *phy)
data->cfg->disc_thresh, PHY_DISCON_TH_LEN);
}
 
-   if (usb_phy->id != 0)
-   sun4i_usb_phy_passby(phy, true);
+   sun4i_usb_phy_passby(phy, true);
 
sun4i_usb_phy0_reroute(data, true);
 
-- 
2.17.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 3/4] phy: sun4i-usb: Update PHY#3 rst_mask only for H3_H5

2018-07-20 Thread Jagan Teki
Only H3 and H5 have 4 PHYS so restrict rst_mask only for them
by checking PHY id as 3 and update the proper bits.

Signed-off-by: Jagan Teki 
---
Changes for v2:
- update rst_mask value for H3_H5

 drivers/phy/allwinner/phy-sun4i-usb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c 
b/drivers/phy/allwinner/phy-sun4i-usb.c
index 3096f12c1c..a7d7e3f044 100644
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
@@ -117,9 +117,6 @@ struct sun4i_usb_phy_info {
.gpio_vbus = CONFIG_USB3_VBUS_PIN,
.gpio_vbus_det = NULL,
.gpio_id_det = NULL,
-#ifdef CONFIG_MACH_SUN6I
-   .rst_mask = (CCM_USB_CTRL_PHY3_RST | CCM_USB_CTRL_PHY3_CLK),
-#endif
},
 };
 
@@ -460,6 +457,8 @@ static int sun4i_usb_phy_probe(struct udevice *dev)
 
phy->id = i;
phy->rst_mask = info->rst_mask;
+   if ((data->cfg->type == sun8i_h3_phy) && (phy->id == 3))
+   phy->rst_mask = (BIT(3) | BIT(11));
};
 
debug("Allwinner Sun4I USB PHY driver loaded\n");
-- 
2.17.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 2/4] phy: sun4i-usb: Remove usb_clk_cfg set in probe

2018-07-20 Thread Jagan Teki
usb_clk_cfg is setting CTRL_PHYGATE bit value in probe
which is BIT 0 for sun4i, 6i and 8 for a83t but all
these were handling in phy ops init exit calls.

Signed-off-by: Jagan Teki 
---
Changes for v2:
- none

 drivers/phy/allwinner/phy-sun4i-usb.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c 
b/drivers/phy/allwinner/phy-sun4i-usb.c
index 01f585a283..3096f12c1c 100644
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
@@ -462,8 +462,6 @@ static int sun4i_usb_phy_probe(struct udevice *dev)
phy->rst_mask = info->rst_mask;
};
 
-   setbits_le32(&data->ccm->usb_clk_cfg, CCM_USB_CTRL_PHYGATE);
-
debug("Allwinner Sun4I USB PHY driver loaded\n");
return 0;
 }
-- 
2.17.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 4/4] configs: sunxi: Drop CONFIG_SUNXI_USB_PHYS

2018-07-20 Thread Jagan Teki
Now number of PHY on Allwinner is handling via dt data,
drivers at phy/allwinner/phy-sun4i-usb.c

Signed-off-by: Jagan Teki 
---
Changes for v2:
- new patch

 include/configs/sun4i.h  |  2 --
 include/configs/sun50i.h |  2 --
 include/configs/sun5i.h  |  2 --
 include/configs/sun6i.h  |  2 --
 include/configs/sun7i.h  |  2 --
 include/configs/sun8i.h  | 10 --
 scripts/config_whitelist.txt |  1 -
 7 files changed, 21 deletions(-)

diff --git a/include/configs/sun4i.h b/include/configs/sun4i.h
index 63c84b1ceb..af079a71ee 100644
--- a/include/configs/sun4i.h
+++ b/include/configs/sun4i.h
@@ -15,8 +15,6 @@
 #define CONFIG_USB_EHCI_SUNXI
 #endif
 
-#define CONFIG_SUNXI_USB_PHYS  3
-
 /*
  * Include common sunxi configuration where most the settings are
  */
diff --git a/include/configs/sun50i.h b/include/configs/sun50i.h
index 5ce2cde388..8cfac38106 100644
--- a/include/configs/sun50i.h
+++ b/include/configs/sun50i.h
@@ -15,8 +15,6 @@
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
 #endif
 
-#define CONFIG_SUNXI_USB_PHYS  1
-
 #define GICD_BASE  0x1c81000
 #define GICC_BASE  0x1c82000
 
diff --git a/include/configs/sun5i.h b/include/configs/sun5i.h
index cb33d01e16..c3692caa73 100644
--- a/include/configs/sun5i.h
+++ b/include/configs/sun5i.h
@@ -15,8 +15,6 @@
 #define CONFIG_USB_EHCI_SUNXI
 #endif
 
-#define CONFIG_SUNXI_USB_PHYS  2
-
 /*
  * Include common sunxi configuration where most the settings are
  */
diff --git a/include/configs/sun6i.h b/include/configs/sun6i.h
index a3f768f936..1523684fad 100644
--- a/include/configs/sun6i.h
+++ b/include/configs/sun6i.h
@@ -18,8 +18,6 @@
 #define CONFIG_USB_EHCI_SUNXI
 #endif
 
-#define CONFIG_SUNXI_USB_PHYS  3
-
 #define CONFIG_ARMV7_SECURE_BASE   SUNXI_SRAM_B_BASE
 #define CONFIG_ARMV7_SECURE_MAX_SIZE(64 * 1024) /* 64 KB */
 
diff --git a/include/configs/sun7i.h b/include/configs/sun7i.h
index d3c4c7dbcf..bb8f217b25 100644
--- a/include/configs/sun7i.h
+++ b/include/configs/sun7i.h
@@ -16,8 +16,6 @@
 #define CONFIG_USB_EHCI_SUNXI
 #endif
 
-#define CONFIG_SUNXI_USB_PHYS  3
-
 #define CONFIG_ARMV7_SECURE_BASE   SUNXI_SRAM_B_BASE
 #define CONFIG_ARMV7_SECURE_MAX_SIZE   (64 * 1024) /* 64 KB */
 
diff --git a/include/configs/sun8i.h b/include/configs/sun8i.h
index 4fdf68a491..7dc8693b76 100644
--- a/include/configs/sun8i.h
+++ b/include/configs/sun8i.h
@@ -16,16 +16,6 @@
 #define CONFIG_USB_EHCI_SUNXI
 #endif
 
-#ifdef CONFIG_MACH_SUN8I_H3
-   #define CONFIG_SUNXI_USB_PHYS   4
-#elif defined CONFIG_MACH_SUN8I_A83T
-   #define CONFIG_SUNXI_USB_PHYS   3
-#elif defined CONFIG_MACH_SUN8I_V3S
-   #define CONFIG_SUNXI_USB_PHYS   1
-#else
-   #define CONFIG_SUNXI_USB_PHYS   2
-#endif
-
 /*
  * Include common sunxi configuration where most the settings are
  */
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 2f6c9557a5..1065066bc3 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -2017,7 +2017,6 @@ CONFIG_ST_SMI
 CONFIG_SUNXI_AHCI
 CONFIG_SUNXI_GPIO
 CONFIG_SUNXI_MAX_FB_SIZE
-CONFIG_SUNXI_USB_PHYS
 CONFIG_SUPERH_ON_CHIP_R8A66597
 CONFIG_SUPPORT_EMMC_BOOT
 CONFIG_SUVD3
-- 
2.17.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] arm: zynq: add support for the zybo z7 board

2018-07-20 Thread Michal Simek
On 13.7.2018 17:44, Luis Araneda wrote:
> The board is manufactured by Digilent
> Main features:
> - Soc: XC7Z010 (Z7-10) or XC7Z020 (Z7-20)
> - RAM: 1 GB DDR3L
> - FLASH: 16 MB QSPI
> - 1 Gbps Ethernet
> - USB 2.0
> - microSD slot
> - Pcam camera connector
> - HDMI Tx and Rx
> - Audio codec: stereo out, stereo in, mic
> - 5 (Z7-10) or 6 (Z7-20) Pmod ports
> - 6 push-buttons, 4 switches, 5 LEDs
> - 1 (Z7-10) or 2 (Z7-20) RGB LEDs
> 
> The device-tree was taken from Linux with some minor corrections
> 
> Signed-off-by: Luis Araneda 
> ---
>  arch/arm/dts/Makefile  |  3 +-
>  arch/arm/dts/zynq-zybo-z7.dts  | 91 ++
>  configs/zynq_zybo_z7_defconfig | 68 +
>  3 files changed, 161 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/dts/zynq-zybo-z7.dts
>  create mode 100644 configs/zynq_zybo_z7_defconfig
> 
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index 946023093d..cee301a4c6 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -145,7 +145,8 @@ dtb-$(CONFIG_ARCH_ZYNQ) += \
>   zynq-zc770-xm013.dtb \
>   zynq-zed.dtb \
>   zynq-zturn.dtb \
> - zynq-zybo.dtb
> + zynq-zybo.dtb \
> + zynq-zybo-z7.dtb
>  dtb-$(CONFIG_ARCH_ZYNQMP) += \
>   zynqmp-mini-emmc0.dtb   \
>   zynqmp-mini-emmc1.dtb   \
> diff --git a/arch/arm/dts/zynq-zybo-z7.dts b/arch/arm/dts/zynq-zybo-z7.dts
> new file mode 100644
> index 00..ad9264e9b1
> --- /dev/null
> +++ b/arch/arm/dts/zynq-zybo-z7.dts
> @@ -0,0 +1,91 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + *  Copyright (C) 2011 - 2015 Xilinx
> + *  Copyright (C) 2012 National Instruments Corp.
> + */
> +/dts-v1/;
> +#include "zynq-7000.dtsi"
> +#include 
> +
> +/ {
> + model = "Digilent Zybo Z7 board";
> + compatible = "digilent,zynq-zybo-z7", "xlnx,zynq-7000";
> +
> + aliases {
> + ethernet0 = &gem0;
> + serial0 = &uart1;
> + spi0 = &qspi;
> + i2c0 = &i2c0;
> + i2c1 = &i2c1;
> + mmc0 = &sdhci0;
> + };
> +
> + memory@0 {
> + device_type = "memory";
> + reg = <0x0 0x4000>;
> + };
> +
> + chosen {
> + bootargs = "";
> + stdout-path = "serial0:115200n8";
> + };
> +
> + gpio-leds {
> + compatible = "gpio-leds";
> +
> + ld4 {
> + label = "zynq-zybo-z7:green:ld4";
> + gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
> + };
> + };
> +
> + usb_phy0: phy0 {
> + #phy-cells = <0>;
> + compatible = "usb-nop-xceiv";
> + reset-gpios = <&gpio0 46 GPIO_ACTIVE_LOW>;
> + };
> +};
> +
> +&clkc {
> + ps-clk-frequency = <>;
> +};
> +
> +&gem0 {
> + status = "okay";
> + phy-mode = "rgmii-id";
> + phy-handle = <ðernet_phy>;
> +
> + ethernet_phy: ethernet-phy@0 {
> + reg = <0>;
> + device_type = "ethernet-phy";
> + };
> +};
> +
> +&i2c0 {
> + status = "okay";
> +};
> +
> +&i2c1 {
> + status = "okay";
> +};
> +
> +&qspi {
> + u-boot,dm-pre-reloc;
> + status = "okay";
> +};
> +
> +&sdhci0 {
> + u-boot,dm-pre-reloc;
> + status = "okay";
> +};
> +
> +&uart1 {
> + u-boot,dm-pre-reloc;
> + status = "okay";
> +};
> +
> +&usb0 {
> + status = "okay";
> + dr_mode = "host";
> + usb-phy = <&usb_phy0>;
> +};
> diff --git a/configs/zynq_zybo_z7_defconfig b/configs/zynq_zybo_z7_defconfig
> new file mode 100644
> index 00..068a5a96e2
> --- /dev/null
> +++ b/configs/zynq_zybo_z7_defconfig
> @@ -0,0 +1,68 @@
> +CONFIG_ARM=y
> +CONFIG_ARCH_ZYNQ=y
> +CONFIG_SYS_TEXT_BASE=0x400
> +CONFIG_SPL=y
> +CONFIG_DEBUG_UART_BASE=0xe0001000
> +CONFIG_DEBUG_UART_CLOCK=5000
> +CONFIG_SPL_STACK_R_ADDR=0x20
> +CONFIG_DEFAULT_DEVICE_TREE="zynq-zybo-z7"
> +CONFIG_DEBUG_UART=y
> +CONFIG_DISTRO_DEFAULTS=y
> +CONFIG_FIT=y
> +CONFIG_FIT_SIGNATURE=y
> +CONFIG_FIT_VERBOSE=y
> +CONFIG_IMAGE_FORMAT_LEGACY=y
> +CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd"
> +CONFIG_SPL_STACK_R=y
> +CONFIG_SPL_OS_BOOT=y
> +CONFIG_SPL_SPI_LOAD=y
> +CONFIG_SYS_PROMPT="Zynq> "
> +CONFIG_CMD_THOR_DOWNLOAD=y
> +CONFIG_CMD_DFU=y
> +# CONFIG_CMD_FLASH is not set
> +CONFIG_CMD_FPGA_LOADBP=y
> +CONFIG_CMD_FPGA_LOADFS=y
> +CONFIG_CMD_FPGA_LOADMK=y
> +CONFIG_CMD_FPGA_LOADP=y
> +CONFIG_CMD_GPIO=y
> +CONFIG_CMD_I2C=y
> +CONFIG_CMD_MMC=y
> +CONFIG_CMD_SF=y
> +CONFIG_CMD_USB=y
> +# CONFIG_CMD_SETEXPR is not set
> +CONFIG_CMD_TFTPPUT=y
> +CONFIG_CMD_CACHE=y
> +CONFIG_CMD_EXT4_WRITE=y
> +CONFIG_ENV_IS_IN_SPI_FLASH=y
> +CONFIG_NET_RANDOM_ETHADDR=y
> +CONFIG_SPL_DM_SEQ_ALIAS=y
> +CONFIG_DFU_MMC=y
> +CONFIG_DFU_RAM=y
> +CONFIG_FPGA_XILINX=y
> +CONFIG_FPGA_ZYNQPL=y
> +CONFIG_DM_GPIO=y
> +CONFIG_DM_I2C=y
> +CONFIG_SYS_I2C_CADENCE=y
> +CONFIG_MMC_SDHCI=y
> +CONFIG_MMC_SDHCI_ZYNQ=y
> +CONFIG_SPI_FLASH=y
> +CONFIG_SPI_FLA

[U-Boot] [PATCH v2 0/6] musb-new: Improve shutdown code

2018-07-20 Thread Jagan Teki
This is v2 for previous series[1], by excluding sunxi phy changes.

One patch mark it as 'RFC' about "including UCLASS_USB_DEV_GENERIC
into shutdown caller" so expecting some inputs on the same

[1] https://patchwork.ozlabs.org/cover/941588/

Jagan Teki (6):
  usb: musb-new: Fix improper musb host pointer
  usb: musb-new: sunxi: Allocate struct phy in private
  dm: usb: Add UCLASS_USB_DEV_GENERIC shutdown
  musb-new: sunxi: Access ahb_reset0_cfg via ccm offset
  usb: musb-new: sunxi: Add proper musb exit support
  usb: musb-new: Call musb_platform_exit from musb_stop

 board/compulab/cm_t3517/cm_t3517.c |   4 +-
 drivers/usb/host/usb-uclass.c  |  43 
 drivers/usb/musb-new/musb_core.c   |   1 +
 drivers/usb/musb-new/musb_uboot.c  |  12 ++--
 drivers/usb/musb-new/pic32.c   |   6 +-
 drivers/usb/musb-new/sunxi.c   | 107 ++---
 include/linux/usb/musb.h   |   4 +-
 7 files changed, 123 insertions(+), 54 deletions(-)

-- 
2.17.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 1/6] usb: musb-new: Fix improper musb host pointer

2018-07-20 Thread Jagan Teki
When MUSB is operating in peripheral mode, probe registering
musb core using musb_register which intern return int value
for validation. so there is no scope to preserve struct musb
pointer but the same can be used in .remove musb_stop.
So fix this by return musb_register with struct musb pointer.

Cc: Igor Grinberg 
Cc: Purna Chandra Mandal 
Signed-off-by: Jagan Teki 
---
Changes for v2:
- use proper error codes for musb_register

 board/compulab/cm_t3517/cm_t3517.c |  4 ++--
 drivers/usb/musb-new/musb_uboot.c  | 12 ++--
 drivers/usb/musb-new/pic32.c   |  6 --
 drivers/usb/musb-new/sunxi.c   |  8 +---
 include/linux/usb/musb.h   |  4 ++--
 5 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/board/compulab/cm_t3517/cm_t3517.c 
b/board/compulab/cm_t3517/cm_t3517.c
index 09cb27def0..668bb7631a 100644
--- a/board/compulab/cm_t3517/cm_t3517.c
+++ b/board/compulab/cm_t3517/cm_t3517.c
@@ -74,8 +74,8 @@ static void cm_t3517_musb_init(void)
CONF2_REFFREQ_13MHZ | CONF2_SESENDEN |
CONF2_VBDTCTEN | CONF2_DATPOL);
 
-   if (musb_register(&cm_t3517_musb_pdata, &cm_t3517_musb_board_data,
- (void *)AM35XX_IPSS_USBOTGSS_BASE))
+   if (!musb_register(&cm_t3517_musb_pdata, &cm_t3517_musb_board_data,
+  (void *)AM35XX_IPSS_USBOTGSS_BASE))
printf("Failed initializing AM35x MUSB!\n");
 }
 #else
diff --git a/drivers/usb/musb-new/musb_uboot.c 
b/drivers/usb/musb-new/musb_uboot.c
index 2b04fbd046..2bf918eab4 100644
--- a/drivers/usb/musb-new/musb_uboot.c
+++ b/drivers/usb/musb-new/musb_uboot.c
@@ -419,8 +419,8 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver 
*driver)
 }
 #endif /* CONFIG_USB_MUSB_GADGET */
 
-int musb_register(struct musb_hdrc_platform_data *plat, void *bdata,
-   void *ctl_regs)
+struct musb *musb_register(struct musb_hdrc_platform_data *plat, void *bdata,
+  void *ctl_regs)
 {
struct musb **musbp;
 
@@ -436,14 +436,14 @@ int musb_register(struct musb_hdrc_platform_data *plat, 
void *bdata,
break;
 #endif
default:
-   return -EINVAL;
+   return ERR_PTR(-EINVAL);
}
 
*musbp = musb_init_controller(plat, (struct device *)bdata, ctl_regs);
-   if (!*musbp) {
+   if (IS_ERR(*musbp)) {
printf("Failed to init the controller\n");
-   return -EIO;
+   return ERR_CAST(*musbp);
}
 
-   return 0;
+   return *musbp;
 }
diff --git a/drivers/usb/musb-new/pic32.c b/drivers/usb/musb-new/pic32.c
index f04719d7af..3a19900e21 100644
--- a/drivers/usb/musb-new/pic32.c
+++ b/drivers/usb/musb-new/pic32.c
@@ -251,9 +251,11 @@ static int musb_usb_probe(struct udevice *dev)
ret = musb_lowlevel_init(mdata);
 #else
pic32_musb_plat.mode = MUSB_PERIPHERAL;
-   ret = musb_register(&pic32_musb_plat, &pdata->dev, mregs);
+   mdata->host = musb_register(&pic32_musb_plat, &pdata->dev, mregs);
+   if (!mdata->host)
+   return -EIO;
 #endif
-   if (ret == 0)
+   if ((ret == 0) && mdata->host)
printf("PIC32 MUSB OTG\n");
 
return ret;
diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c
index 08de9c69c7..b846afb094 100644
--- a/drivers/usb/musb-new/sunxi.c
+++ b/drivers/usb/musb-new/sunxi.c
@@ -444,9 +444,11 @@ static int musb_usb_probe(struct udevice *dev)
printf("Allwinner mUSB OTG (Host)\n");
 #else
pdata.mode = MUSB_PERIPHERAL;
-   ret = musb_register(&pdata, &glue->dev, base);
-   if (!ret)
-   printf("Allwinner mUSB OTG (Peripheral)\n");
+   host->host = musb_register(&pdata, &glue->dev, base);
+   if (!host->host)
+   return -EIO;
+
+   printf("Allwinner mUSB OTG (Peripheral)\n");
 #endif
 
return ret;
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h
index 9104414cf0..a31ce67a81 100644
--- a/include/linux/usb/musb.h
+++ b/include/linux/usb/musb.h
@@ -150,7 +150,7 @@ extern int tusb6010_platform_retime(unsigned is_refclk);
 /*
  * U-Boot specfic stuff
  */
-int musb_register(struct musb_hdrc_platform_data *plat, void *bdata,
-   void *ctl_regs);
+struct musb *musb_register(struct musb_hdrc_platform_data *plat, void *bdata,
+  void *ctl_regs);
 
 #endif /* __LINUX_USB_MUSB_H */
-- 
2.17.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [RFC PATCH v2 3/6] dm: usb: Add UCLASS_USB_DEV_GENERIC shutdown

2018-07-20 Thread Jagan Teki
Some OTG controllers which operates on Peripheral
mode are registered as UCLASS_USB_DEV_GENERIC.

So add support to shutdown them as well. shutdown
happened during 'usb reset' and U-Boot handoff code
for Linux boot.

controller restarting in 'usb reset' like probing
again is still missing for this type of UCLASS.

Cc: Simon Glass 
Signed-off-by: Jagan Teki 
---
Note:
I tried of traversing for multiple UCLASS in removal
code in usb_stop, but couldn't come with proper solutions.
I don't think any other area of code need a requirement like
this, or may be I'm missing. any help would appreciate. 

Changes for v2:
- none

 drivers/usb/host/usb-uclass.c | 43 +++
 1 file changed, 43 insertions(+)

diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c
index 611ea97a72..99cf3d2b49 100644
--- a/drivers/usb/host/usb-uclass.c
+++ b/drivers/usb/host/usb-uclass.c
@@ -158,6 +158,45 @@ int usb_get_max_xfer_size(struct usb_device *udev, size_t 
*size)
return ops->get_max_xfer_size(bus, size);
 }
 
+int __usb_stop(void)
+{
+   struct udevice *bus;
+   struct udevice *rh;
+   struct uclass *uc;
+   struct usb_uclass_priv *uc_priv;
+   int err = 0, ret;
+
+   /* De-activate any devices that have been activated */
+   ret = uclass_get(UCLASS_USB_DEV_GENERIC, &uc);
+   if (ret)
+   return ret;
+
+   uc_priv = uc->priv;
+
+   uclass_foreach_dev(bus, uc) {
+   ret = device_remove(bus, DM_REMOVE_NORMAL);
+   if (ret && !err)
+   err = ret;
+
+   /* Locate root hub device */
+   device_find_first_child(bus, &rh);
+   if (rh) {
+   /*
+* All USB devices are children of root hub.
+* Unbinding root hub will unbind all of its children.
+*/
+   ret = device_unbind(rh);
+   if (ret && !err)
+   err = ret;
+   }
+   }
+
+   uc_priv->companion_device_count = 0;
+   usb_started = 0;
+
+   return err;
+}
+
 int usb_stop(void)
 {
struct udevice *bus;
@@ -166,6 +205,10 @@ int usb_stop(void)
struct usb_uclass_priv *uc_priv;
int err = 0, ret;
 
+   ret = __usb_stop();
+   if (ret)
+   return ret;
+
/* De-activate any devices that have been activated */
ret = uclass_get(UCLASS_USB, &uc);
if (ret)
-- 
2.17.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 2/6] usb: musb-new: sunxi: Allocate struct phy in private

2018-07-20 Thread Jagan Teki
Allocate struct phy in private structure instead of allocating
locally and assign it to a pointer. This eventually fix miss
alignment phy which is used in another functions.

Signed-off-by: Jagan Teki 
---
Changes for v2:
- none

 drivers/usb/musb-new/sunxi.c | 24 +++-
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c
index b846afb094..aa2880eeb9 100644
--- a/drivers/usb/musb-new/sunxi.c
+++ b/drivers/usb/musb-new/sunxi.c
@@ -87,7 +87,7 @@ struct sunxi_glue {
struct sunxi_ccm_reg *ccm;
struct sunxi_musb_config *cfg;
struct device dev;
-   struct phy *phy;
+   struct phy phy;
 };
 #define to_sunxi_glue(d)   container_of(d, struct sunxi_glue, dev)
 
@@ -235,19 +235,19 @@ static int sunxi_musb_enable(struct musb *musb)
musb_writeb(musb->mregs, USBC_REG_o_VEND0, 0);
 
if (is_host_enabled(musb)) {
-   ret = sun4i_usb_phy_vbus_detect(glue->phy);
+   ret = sun4i_usb_phy_vbus_detect(&glue->phy);
if (ret == 1) {
printf("A charger is plugged into the OTG: ");
return -ENODEV;
}
 
-   ret = sun4i_usb_phy_id_detect(glue->phy);
+   ret = sun4i_usb_phy_id_detect(&glue->phy);
if (ret == 1) {
printf("No host cable detected: ");
return -ENODEV;
}
 
-   ret = generic_phy_power_on(glue->phy);
+   ret = generic_phy_power_on(&glue->phy);
if (ret) {
pr_err("failed to power on USB PHY\n");
return ret;
@@ -271,7 +271,7 @@ static void sunxi_musb_disable(struct musb *musb)
return;
 
if (is_host_enabled(musb)) {
-   ret = generic_phy_power_off(glue->phy);
+   ret = generic_phy_power_off(&glue->phy);
if (ret) {
pr_err("failed to power off USB PHY\n");
return;
@@ -291,7 +291,7 @@ static int sunxi_musb_init(struct musb *musb)
 
pr_debug("%s():\n", __func__);
 
-   ret = generic_phy_init(glue->phy);
+   ret = generic_phy_init(&glue->phy);
if (ret) {
pr_err("failed to init USB PHY\n");
return ret;
@@ -330,14 +330,14 @@ static void sunxi_musb_pre_root_reset_end(struct musb 
*musb)
 {
struct sunxi_glue *glue = to_sunxi_glue(musb->controller);
 
-   sun4i_usb_phy_set_squelch_detect(glue->phy, false);
+   sun4i_usb_phy_set_squelch_detect(&glue->phy, false);
 }
 
 static void sunxi_musb_post_root_reset_end(struct musb *musb)
 {
struct sunxi_glue *glue = to_sunxi_glue(musb->controller);
 
-   sun4i_usb_phy_set_squelch_detect(glue->phy, true);
+   sun4i_usb_phy_set_squelch_detect(&glue->phy, true);
 }
 
 static const struct musb_platform_ops sunxi_musb_ops = {
@@ -405,7 +405,6 @@ static int musb_usb_probe(struct udevice *dev)
struct usb_bus_priv *priv = dev_get_uclass_priv(dev);
struct musb_hdrc_platform_data pdata;
void *base = dev_read_addr_ptr(dev);
-   struct phy phy;
int ret;
 
if (!base)
@@ -419,13 +418,12 @@ static int musb_usb_probe(struct udevice *dev)
if (IS_ERR(glue->ccm))
return PTR_ERR(glue->ccm);
 
-   ret = generic_phy_get_by_name(dev, "usb", &phy);
+   ret = generic_phy_get_by_name(dev, "usb", &glue->phy);
if (ret) {
pr_err("failed to get usb PHY\n");
return ret;
}
 
-   glue->phy = &phy;
priv->desc_before_addr = true;
 
memset(&pdata, 0, sizeof(pdata));
@@ -460,8 +458,8 @@ static int musb_usb_remove(struct udevice *dev)
struct musb_host_data *host = &glue->mdata;
int ret;
 
-   if (generic_phy_valid(glue->phy)) {
-   ret = generic_phy_exit(glue->phy);
+   if (generic_phy_valid(&glue->phy)) {
+   ret = generic_phy_exit(&glue->phy);
if (ret) {
pr_err("failed to exit %s USB PHY\n", dev->name);
return ret;
-- 
2.17.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 5/6] usb: musb-new: sunxi: Add proper musb exit support

2018-07-20 Thread Jagan Teki
musb have platform ops to do proper graceful exit,
so add the exit call and move musb platform exit code
instead of keeping it in driver remove.
This make proper shutdown of musb where .remove will
call disable, exit serially via musb_stop.

Signed-off-by: Jagan Teki 
---
Changes for v2:
- use driver data for sun6i changes

 drivers/usb/musb-new/sunxi.c | 49 
 1 file changed, 28 insertions(+), 21 deletions(-)

diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c
index d909b9ea53..6cf9826cda 100644
--- a/drivers/usb/musb-new/sunxi.c
+++ b/drivers/usb/musb-new/sunxi.c
@@ -331,6 +331,33 @@ static int sunxi_musb_init(struct musb *musb)
return 0;
 }
 
+static int sunxi_musb_exit(struct musb *musb)
+{
+   struct sunxi_glue *glue = to_sunxi_glue(musb->controller);
+   int ret = 0;
+
+   if (generic_phy_valid(&glue->phy)) {
+   ret = generic_phy_exit(&glue->phy);
+   if (ret) {
+   dev_err(dev, "failed to power off usb phy\n");
+   return ret;
+   }
+   }
+
+   if (glue->cfg->has_reset)
+   clrbits_le32(glue->reg_reset0, BIT(AHB_GATE_OFFSET_USB0));
+
+   if (glue->cfg->rst_bit)
+   clrbits_le32(glue->reg_reset0, BIT(glue->cfg->rst_bit));
+
+   clrbits_le32(&glue->ccm->ahb_gate0, BIT(AHB_GATE_OFFSET_USB0));
+   if (glue->cfg->clkgate_bit)
+   clrbits_le32(&glue->ccm->ahb_gate0,
+BIT(glue->cfg->clkgate_bit));
+
+   return 0;
+}
+
 static void sunxi_musb_pre_root_reset_end(struct musb *musb)
 {
struct sunxi_glue *glue = to_sunxi_glue(musb->controller);
@@ -347,6 +374,7 @@ static void sunxi_musb_post_root_reset_end(struct musb 
*musb)
 
 static const struct musb_platform_ops sunxi_musb_ops = {
.init   = sunxi_musb_init,
+   .exit   = sunxi_musb_exit,
.enable = sunxi_musb_enable,
.disable= sunxi_musb_disable,
.pre_root_reset_end = sunxi_musb_pre_root_reset_end,
@@ -463,29 +491,8 @@ static int musb_usb_remove(struct udevice *dev)
 {
struct sunxi_glue *glue = dev_get_priv(dev);
struct musb_host_data *host = &glue->mdata;
-   int ret;
-
-   if (generic_phy_valid(&glue->phy)) {
-   ret = generic_phy_exit(&glue->phy);
-   if (ret) {
-   pr_err("failed to exit %s USB PHY\n", dev->name);
-   return ret;
-   }
-   }
 
musb_stop(host->host);
-
-   if (glue->cfg->has_reset)
-   clrbits_le32(glue->reg_reset0, BIT(AHB_GATE_OFFSET_USB0));
-
-   if (glue->cfg->rst_bit)
-   clrbits_le32(glue->reg_reset0, BIT(glue->cfg->rst_bit));
-
-   clrbits_le32(&glue->ccm->ahb_gate0, BIT(AHB_GATE_OFFSET_USB0));
-   if (glue->cfg->clkgate_bit)
-   clrbits_le32(&glue->ccm->ahb_gate0,
-BIT(glue->cfg->clkgate_bit));
-
free(host->host);
host->host = NULL;
 
-- 
2.17.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 4/6] musb-new: sunxi: Access ahb_reset0_cfg via ccm offset

2018-07-20 Thread Jagan Teki
reset0 is not available for sun4i, 5i and 7i so access
the reset0 offset from ccm via driver data for relevant
Allwinner SoC. this will eventually drop the existing
ifdef for SUN6I.

Signed-off-by: Jagan Teki 
---
Changes for v2:
- new patch

 drivers/usb/musb-new/sunxi.c | 40 +---
 1 file changed, 28 insertions(+), 12 deletions(-)

diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c
index aa2880eeb9..d909b9ea53 100644
--- a/drivers/usb/musb-new/sunxi.c
+++ b/drivers/usb/musb-new/sunxi.c
@@ -76,15 +76,20 @@
  * From usbc/usbc.c
  
**/
 
+#define OFF_SUN6I_AHB_RESET0   0x2c0
+
 struct sunxi_musb_config {
struct musb_hdrc_config *config;
+   bool has_reset;
u8 rst_bit;
u8 clkgate_bit;
+   u32 off_reset0;
 };
 
 struct sunxi_glue {
struct musb_host_data mdata;
struct sunxi_ccm_reg *ccm;
+   u32 *reg_reset0;
struct sunxi_musb_config *cfg;
struct device dev;
struct phy phy;
@@ -303,12 +308,12 @@ static int sunxi_musb_init(struct musb *musb)
if (glue->cfg->clkgate_bit)
setbits_le32(&glue->ccm->ahb_gate0,
 BIT(glue->cfg->clkgate_bit));
-#ifdef CONFIG_SUNXI_GEN_SUN6I
-   setbits_le32(&glue->ccm->ahb_reset0_cfg, BIT(AHB_GATE_OFFSET_USB0));
+
+   if (glue->cfg->has_reset)
+   setbits_le32(glue->reg_reset0, BIT(AHB_GATE_OFFSET_USB0));
+
if (glue->cfg->rst_bit)
-   setbits_le32(&glue->ccm->ahb_reset0_cfg,
-BIT(glue->cfg->rst_bit));
-#endif
+   setbits_le32(glue->reg_reset0, BIT(glue->cfg->rst_bit));
 
USBC_ConfigFIFO_Base();
USBC_EnableDpDmPullUp(musb->mregs);
@@ -418,6 +423,8 @@ static int musb_usb_probe(struct udevice *dev)
if (IS_ERR(glue->ccm))
return PTR_ERR(glue->ccm);
 
+   glue->reg_reset0 = (void *)glue->ccm + glue->cfg->off_reset0;
+
ret = generic_phy_get_by_name(dev, "usb", &glue->phy);
if (ret) {
pr_err("failed to get usb PHY\n");
@@ -468,12 +475,12 @@ static int musb_usb_remove(struct udevice *dev)
 
musb_stop(host->host);
 
-#ifdef CONFIG_SUNXI_GEN_SUN6I
-   clrbits_le32(&glue->ccm->ahb_reset0_cfg, BIT(AHB_GATE_OFFSET_USB0));
+   if (glue->cfg->has_reset)
+   clrbits_le32(glue->reg_reset0, BIT(AHB_GATE_OFFSET_USB0));
+
if (glue->cfg->rst_bit)
-   clrbits_le32(&glue->ccm->ahb_reset0_cfg,
-BIT(glue->cfg->rst_bit));
-#endif
+   clrbits_le32(glue->reg_reset0, BIT(glue->cfg->rst_bit));
+
clrbits_le32(&glue->ccm->ahb_gate0, BIT(AHB_GATE_OFFSET_USB0));
if (glue->cfg->clkgate_bit)
clrbits_le32(&glue->ccm->ahb_gate0,
@@ -487,21 +494,30 @@ static int musb_usb_remove(struct udevice *dev)
 
 static const struct sunxi_musb_config sun4i_a10_cfg = {
.config = &musb_config,
+   .has_reset = false,
+};
+
+static const struct sunxi_musb_config sun6i_a31_cfg = {
+   .config = &musb_config,
+   .has_reset = true,
+   .off_reset0 = OFF_SUN6I_AHB_RESET0,
 };
 
 static const struct sunxi_musb_config sun8i_h3_cfg = {
.config = &musb_config_h3,
+   .has_reset = true,
.rst_bit = 23,
.clkgate_bit = 23,
+   .off_reset0 = OFF_SUN6I_AHB_RESET0,
 };
 
 static const struct udevice_id sunxi_musb_ids[] = {
{ .compatible = "allwinner,sun4i-a10-musb",
.data = (ulong)&sun4i_a10_cfg },
{ .compatible = "allwinner,sun6i-a31-musb",
-   .data = (ulong)&sun4i_a10_cfg },
+   .data = (ulong)&sun6i_a31_cfg },
{ .compatible = "allwinner,sun8i-a33-musb",
-   .data = (ulong)&sun4i_a10_cfg },
+   .data = (ulong)&sun6i_a31_cfg },
{ .compatible = "allwinner,sun8i-h3-musb",
.data = (ulong)&sun8i_h3_cfg },
{ }
-- 
2.17.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 6/6] usb: musb-new: Call musb_platform_exit from musb_stop

2018-07-20 Thread Jagan Teki
musb stop is musb core call during unregister or shutting down
gadget or host musb. For graceful exit add musb_platform_exit
on musb_stop so-that it can exit the musb platform driver as well.

Signed-off-by: Jagan Teki 
---
Changes for v2:
- update proper commit message

 drivers/usb/musb-new/musb_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/musb-new/musb_core.c b/drivers/usb/musb-new/musb_core.c
index 8fec6f38ad..afea9fbcef 100644
--- a/drivers/usb/musb-new/musb_core.c
+++ b/drivers/usb/musb-new/musb_core.c
@@ -1007,6 +1007,7 @@ void musb_stop(struct musb *musb)
 *  - ...
 */
musb_platform_try_idle(musb, 0);
+   musb_platform_exit(musb);
 }
 
 #ifndef __UBOOT__
-- 
2.17.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 21/25] fastboot: sunxi: Update fastboot mmc default device

2018-07-20 Thread Maxime Ripard
On Thu, Jul 19, 2018 at 07:43:24PM +0100, Alex Kiernan wrote:
> On Thu, Jul 19, 2018 at 2:26 PM Maxime Ripard  
> wrote:
> >
> > On Wed, Jul 18, 2018 at 08:15:23PM +0100, Alex Kiernan wrote:
> > > On Tue, Jul 17, 2018 at 12:57 PM Maxime Ripard
> > >  wrote:
> > > >
> > > > On Mon, Jul 16, 2018 at 12:11:59PM +0100, Alex Kiernan wrote:
> > > > > On Mon, Jul 16, 2018 at 11:13 AM Jagan Teki 
> > > > >  wrote:
> > > > > >
> > > > > > On Mon, Jul 16, 2018 at 3:16 PM, Maxime Ripard
> > > > > >  wrote:
> > > > > > > On Mon, Jul 16, 2018 at 01:49:52PM +0530, Jagan Teki wrote:
> > > > > > >> Usually eMMC is default env fat device for environment,
> > > > > > >> if MMC_SUNXI_SLOT_EXTRA != 1 Sunxi always probed emmc
> > > > > > >> device as 1. but with DM_MMC it can be more possible to
> > > > > > >> probe eMMC as device 2 since for most of the sunxi platforms
> > > > > > >> eMMC is configured mmc2.
> > > > > > >>
> > > > > > >> So update the fastboot mmc default device as 2 if DM_MMC and
> > > > > > >> MMC_SUNXI_SLOT_EXTRA != 1 slot is 2 defined but some boards
> > > > > > >> may not use all possible mmc devices or partly disabled in DT,
> > > > > > >> for those update the device in board specific defconfig.
> > > > > > >>
> > > > > > >> Cc: Olliver Schinagl 
> > > > > > >> Cc: Chen-Yu Tsai 
> > > > > > >> Signed-off-by: Jagan Teki 
> > > > > > >> ---
> > > > > > >>  configs/A20-OLinuXino-Lime2-eMMC_defconfig | 1 +
> > > > > > >>  configs/Sinlinx_SinA33_defconfig   | 1 +
> > > > > > >>  configs/amarula_a64_relic_defconfig| 1 +
> > > > > > >>  drivers/fastboot/Kconfig   | 3 ++-
> > > > > > >>  4 files changed, 5 insertions(+), 1 deletion(-)
> > > > > > >>
> > > > > > >> diff --git a/configs/A20-OLinuXino-Lime2-eMMC_defconfig 
> > > > > > >> b/configs/A20-OLinuXino-Lime2-eMMC_defconfig
> > > > > > >> index 5657fc2594..20ea254191 100644
> > > > > > >> --- a/configs/A20-OLinuXino-Lime2-eMMC_defconfig
> > > > > > >> +++ b/configs/A20-OLinuXino-Lime2-eMMC_defconfig
> > > > > > >> @@ -29,4 +29,5 @@ CONFIG_AXP_ALDO4_VOLT=2800
> > > > > > >>  CONFIG_SCSI=y
> > > > > > >>  CONFIG_USB_EHCI_HCD=y
> > > > > > >>  CONFIG_USB_MUSB_GADGET=y
> > > > > > >> +CONFIG_FASTBOOT_FLASH_MMC_DEV=1
> > > > > > >>  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
> > > > > > >> diff --git a/configs/Sinlinx_SinA33_defconfig 
> > > > > > >> b/configs/Sinlinx_SinA33_defconfig
> > > > > > >> index 394534b8b5..7841219a65 100644
> > > > > > >> --- a/configs/Sinlinx_SinA33_defconfig
> > > > > > >> +++ b/configs/Sinlinx_SinA33_defconfig
> > > > > > >> @@ -21,5 +21,6 @@ CONFIG_DFU_RAM=y
> > > > > > >>  CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
> > > > > > >>  CONFIG_USB_EHCI_HCD=y
> > > > > > >>  CONFIG_USB_MUSB_GADGET=y
> > > > > > >> +CONFIG_FASTBOOT_FLASH_MMC_DEV=1
> > > > > > >
> > > > > > > Your commit doesn't make any sense: the SinaA33 and the Lime2 both
> > > > > > > have the eMMC on MMC2, and you claim you want to update the 
> > > > > > > default to
> > > > > > > point to MMC2, but you're changing both these boards to point to 
> > > > > > > MMC1
> > > > > > > instead?
> > > > > >
> > > > > > If DM_MMC and SLOT != 1 => default device 2 which is updated by
> > > > > > kconfig, this is with all relevant mmc nodes are enabled
> > > > > > but these two boards mmc1 is not enabled so emmc will detected in 
> > > > > > device 1
> > > > > >
> > > > > > >
> > > > > > >>  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
> > > > > > >>  CONFIG_USB_FUNCTION_MASS_STORAGE=y
> > > > > > >> diff --git a/configs/amarula_a64_relic_defconfig 
> > > > > > >> b/configs/amarula_a64_relic_defconfig
> > > > > > >> index b72cbfabc6..caeb3f6008 100644
> > > > > > >> --- a/configs/amarula_a64_relic_defconfig
> > > > > > >> +++ b/configs/amarula_a64_relic_defconfig
> > > > > > >> @@ -12,4 +12,5 @@ 
> > > > > > >> CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-amarula-relic"
> > > > > > >>  # CONFIG_SPL_DOS_PARTITION is not set
> > > > > > >>  # CONFIG_SPL_EFI_PARTITION is not set
> > > > > > >>  CONFIG_USB_MUSB_GADGET=y
> > > > > > >> +CONFIG_FASTBOOT_FLASH_MMC_DEV=0
> > > > > > >>  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
> > > > > > >> diff --git a/drivers/fastboot/Kconfig b/drivers/fastboot/Kconfig
> > > > > > >> index bc25ea1d9c..4a1bfd119c 100644
> > > > > > >> --- a/drivers/fastboot/Kconfig
> > > > > > >> +++ b/drivers/fastboot/Kconfig
> > > > > > >> @@ -88,7 +88,8 @@ config FASTBOOT_FLASH_MMC_DEV
> > > > > > >>   int "Define FASTBOOT MMC FLASH default device"
> > > > > > >>   depends on FASTBOOT_FLASH_MMC
> > > > > > >>   default 0 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA = -1
> > > > > > >> - default 1 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA != -1
> > > > > > >> + default 1 if ARCH_SUNXI && !DM_MMC && MMC_SUNXI_SLOT_EXTRA 
> > > > > > >> != -1
> > > > > > >> + default 2 if ARCH_SUNXI && DM_MMC && MMC_SUNXI_SLOT_EXTRA 
> > > > > > >> != -1
> > > > > > >
> > > > > > > It'd be better to be fixed properly, instead of just relying on a
> > > > > >

Re: [U-Boot] [PATCH 21/25] fastboot: sunxi: Update fastboot mmc default device

2018-07-20 Thread Maxime Ripard
On Thu, Jul 19, 2018 at 11:41:10PM +0530, Jagan Teki wrote:
> On Thu, Jul 19, 2018 at 6:56 PM, Maxime Ripard
>  wrote:
> > On Wed, Jul 18, 2018 at 08:15:23PM +0100, Alex Kiernan wrote:
> >> On Tue, Jul 17, 2018 at 12:57 PM Maxime Ripard
> >>  wrote:
> >> >
> >> > On Mon, Jul 16, 2018 at 12:11:59PM +0100, Alex Kiernan wrote:
> >> > > On Mon, Jul 16, 2018 at 11:13 AM Jagan Teki  
> >> > > wrote:
> >> > > >
> >> > > > On Mon, Jul 16, 2018 at 3:16 PM, Maxime Ripard
> >> > > >  wrote:
> >> > > > > On Mon, Jul 16, 2018 at 01:49:52PM +0530, Jagan Teki wrote:
> >> > > > >> Usually eMMC is default env fat device for environment,
> >> > > > >> if MMC_SUNXI_SLOT_EXTRA != 1 Sunxi always probed emmc
> >> > > > >> device as 1. but with DM_MMC it can be more possible to
> >> > > > >> probe eMMC as device 2 since for most of the sunxi platforms
> >> > > > >> eMMC is configured mmc2.
> >> > > > >>
> >> > > > >> So update the fastboot mmc default device as 2 if DM_MMC and
> >> > > > >> MMC_SUNXI_SLOT_EXTRA != 1 slot is 2 defined but some boards
> >> > > > >> may not use all possible mmc devices or partly disabled in DT,
> >> > > > >> for those update the device in board specific defconfig.
> >> > > > >>
> >> > > > >> Cc: Olliver Schinagl 
> >> > > > >> Cc: Chen-Yu Tsai 
> >> > > > >> Signed-off-by: Jagan Teki 
> >> > > > >> ---
> >> > > > >>  configs/A20-OLinuXino-Lime2-eMMC_defconfig | 1 +
> >> > > > >>  configs/Sinlinx_SinA33_defconfig   | 1 +
> >> > > > >>  configs/amarula_a64_relic_defconfig| 1 +
> >> > > > >>  drivers/fastboot/Kconfig   | 3 ++-
> >> > > > >>  4 files changed, 5 insertions(+), 1 deletion(-)
> >> > > > >>
> >> > > > >> diff --git a/configs/A20-OLinuXino-Lime2-eMMC_defconfig 
> >> > > > >> b/configs/A20-OLinuXino-Lime2-eMMC_defconfig
> >> > > > >> index 5657fc2594..20ea254191 100644
> >> > > > >> --- a/configs/A20-OLinuXino-Lime2-eMMC_defconfig
> >> > > > >> +++ b/configs/A20-OLinuXino-Lime2-eMMC_defconfig
> >> > > > >> @@ -29,4 +29,5 @@ CONFIG_AXP_ALDO4_VOLT=2800
> >> > > > >>  CONFIG_SCSI=y
> >> > > > >>  CONFIG_USB_EHCI_HCD=y
> >> > > > >>  CONFIG_USB_MUSB_GADGET=y
> >> > > > >> +CONFIG_FASTBOOT_FLASH_MMC_DEV=1
> >> > > > >>  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
> >> > > > >> diff --git a/configs/Sinlinx_SinA33_defconfig 
> >> > > > >> b/configs/Sinlinx_SinA33_defconfig
> >> > > > >> index 394534b8b5..7841219a65 100644
> >> > > > >> --- a/configs/Sinlinx_SinA33_defconfig
> >> > > > >> +++ b/configs/Sinlinx_SinA33_defconfig
> >> > > > >> @@ -21,5 +21,6 @@ CONFIG_DFU_RAM=y
> >> > > > >>  CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
> >> > > > >>  CONFIG_USB_EHCI_HCD=y
> >> > > > >>  CONFIG_USB_MUSB_GADGET=y
> >> > > > >> +CONFIG_FASTBOOT_FLASH_MMC_DEV=1
> >> > > > >
> >> > > > > Your commit doesn't make any sense: the SinaA33 and the Lime2 both
> >> > > > > have the eMMC on MMC2, and you claim you want to update the 
> >> > > > > default to
> >> > > > > point to MMC2, but you're changing both these boards to point to 
> >> > > > > MMC1
> >> > > > > instead?
> >> > > >
> >> > > > If DM_MMC and SLOT != 1 => default device 2 which is updated by
> >> > > > kconfig, this is with all relevant mmc nodes are enabled
> >> > > > but these two boards mmc1 is not enabled so emmc will detected in 
> >> > > > device 1
> >> > > >
> >> > > > >
> >> > > > >>  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
> >> > > > >>  CONFIG_USB_FUNCTION_MASS_STORAGE=y
> >> > > > >> diff --git a/configs/amarula_a64_relic_defconfig 
> >> > > > >> b/configs/amarula_a64_relic_defconfig
> >> > > > >> index b72cbfabc6..caeb3f6008 100644
> >> > > > >> --- a/configs/amarula_a64_relic_defconfig
> >> > > > >> +++ b/configs/amarula_a64_relic_defconfig
> >> > > > >> @@ -12,4 +12,5 @@ 
> >> > > > >> CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-amarula-relic"
> >> > > > >>  # CONFIG_SPL_DOS_PARTITION is not set
> >> > > > >>  # CONFIG_SPL_EFI_PARTITION is not set
> >> > > > >>  CONFIG_USB_MUSB_GADGET=y
> >> > > > >> +CONFIG_FASTBOOT_FLASH_MMC_DEV=0
> >> > > > >>  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
> >> > > > >> diff --git a/drivers/fastboot/Kconfig b/drivers/fastboot/Kconfig
> >> > > > >> index bc25ea1d9c..4a1bfd119c 100644
> >> > > > >> --- a/drivers/fastboot/Kconfig
> >> > > > >> +++ b/drivers/fastboot/Kconfig
> >> > > > >> @@ -88,7 +88,8 @@ config FASTBOOT_FLASH_MMC_DEV
> >> > > > >>   int "Define FASTBOOT MMC FLASH default device"
> >> > > > >>   depends on FASTBOOT_FLASH_MMC
> >> > > > >>   default 0 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA = -1
> >> > > > >> - default 1 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA != -1
> >> > > > >> + default 1 if ARCH_SUNXI && !DM_MMC && MMC_SUNXI_SLOT_EXTRA 
> >> > > > >> != -1
> >> > > > >> + default 2 if ARCH_SUNXI && DM_MMC && MMC_SUNXI_SLOT_EXTRA 
> >> > > > >> != -1
> >> > > > >
> >> > > > > It'd be better to be fixed properly, instead of just relying on a
> >> > > > > broken index.
> >> > > >
> >> > > > I don't think we can't do anything with this now, since this IN

Re: [U-Boot] [PATCH] env: Merge Rockchip, Sunxi, Zynq and ZynqMP

2018-07-20 Thread Maxime Ripard
On Fri, Jul 20, 2018 at 08:28:07AM +0200, Michal Simek wrote:
> On 19.7.2018 17:50, Maxime Ripard wrote:
> > On Thu, Jul 19, 2018 at 10:53:44AM -0400, Tom Rini wrote:
> >> On Thu, Jul 19, 2018 at 03:45:11PM +0200, Michal Simek wrote:
> >>> On 19.7.2018 13:13, Maxime Ripard wrote:
>  Hi,
> 
>  On Thu, Jul 19, 2018 at 08:45:45AM +0200, Michal Simek wrote:
> > There is no reason to have the same Kconfig options for different SoCs
> > separately. The patch is merging them together.
> >
> > Signed-off-by: Michal Simek 
> > ---
> >
> > Patch is based on
> > https://lists.denx.de/pipermail/u-boot/2018-July/335126.html
> >
> > I have ENV_SECT_SIZE just for zynq/zynqmp because rockchip and sunxi
> > have this in their configs. When they decide to move then can enable
> > that option for them too.
> > I expect when more platforms extend this we will have less constrain
> > Kconfig setup.
> >
> > ---
> >  env/Kconfig | 66 
> > -
> >  1 file changed, 17 insertions(+), 49 deletions(-)
> >
> > diff --git a/env/Kconfig b/env/Kconfig
> > index b37dcd78eb75..0ded003d7d41 100644
> > --- a/env/Kconfig
> > +++ b/env/Kconfig
> > @@ -431,23 +431,37 @@ config ENV_EXT4_FILE
> >   It's a string of the EXT4 file name. This file use to store 
> > the
> >   environment (explicit path to the file)
> >  
> > -if ARCH_SUNXI
> > +if ARCH_ROCKCHIP || ARCH_SUNXI || ARCH_ZYNQ || ARCH_ZYNQMP
> 
>  Can we have a depends on instead? That would be more flexible.
> >>>
> >>> In what sense? If depends is used below then the same 4 platforms will
> >>> be listed on all options below. (I want to also add ZYNQMP_R5 there too)
> >>> And changing this in one place seems to me better then on four.
> >>
> >> For now I like the "if" method for now as we can't (or couldn't a while
> >> ago) globally migrate everyone over.  I think trying to move everyone
> >> over again is something I should give another try.
> > 
> > Ack.
> > 
> >  config ENV_OFFSET
> > hex "Environment Offset"
> > depends on !ENV_IS_IN_UBI
> > depends on !ENV_IS_NOWHERE
> > +   default 0x3f8000 if ARCH_ROCKCHIP
> > default 0x88000 if ARCH_SUNXI
> > +   default 0xE if ARCH_ZYNQ
> > +   default 0x1E0 if ARCH_ZYNQMP
> > help
> >   Offset from the start of the device (or partition)
> >  
> >  config ENV_SIZE
> > hex "Environment Size"
> > -   depends on !ENV_IS_NOWHERE
> > -   default 0x2 if ARCH_SUNXI
> > +   default 0x8000 if ARCH_ROCKCHIP && !ENV_IS_NOWHERE
> > +   default 0x2 if ARCH_SUNXI && !ENV_IS_NOWHERE
> 
>  I'm not sure why you removed the depends on !ENV_IS_NOWHERE. Do you
>  have a case where the environment is not store anywhere but still need
>  a size?
> >>>
> >>> yes, I had a compilation warning for that case.
> >>>
> >>> in include/environment.h at line 145 it is written this
> >>> #define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE)
> >>>
> >>> ENV_SIZE is also used in typedef struct environment_s some lines below.
> >>> And this structure is used a lot.
> >>>
> >>> How did you find out that this can't be used for ENV_IS_NOWHERE?
> >>
> >> I would have sworn that ENV_SIZE is used for ENV_IS_NOWHERE as that's
> >> how much space we have for environment when it's in memory as well.
> > 
> > Argh, sorry for that I was abused by sunxi-common still having that:
> > https://git.denx.de/?p=u-boot.git;a=blob;f=include/configs/sunxi-common.h#l161
> > 
> > While i was convinced that we were relying solely on Kconfig. I'll
> > send a subsequent patch, that one works for me.
> 
> Ok. Can you please convert this to any official tag which I can include?

Acked-by: Maxime Ripard 

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v1 0/6] Add support of CONFIG_BLK for STM32Fx platforms

2018-07-20 Thread Patrice Chotard

This series :
  _ adds support of CONFIG_BLK flag to STM32Fx platforms
  _ enables CONFIG_BLK flag for STM32Fx based boards
  _ adds missing clk_free() call in error path
  _ adds read of "cd_inverted" DT property


Patrice Chotard (6):
  configs: stm32f429-evaluation: Enable CONFIG_BLK
  configs: stm32f746-disco: Enable CONFIG_BLK
  configs: stm32f769-disco: Enable CONFIG_BLK
  mmc: arm_pl180_mmci: Update to support CONFIG_BLK
  mmc: arm_pl180_mmci: Add missing clk_free
  mmc: arm_pl180_mmci: Add "cd_inverted" DT property read

 configs/stm32f429-evaluation_defconfig |  1 -
 configs/stm32f469-discovery_defconfig  |  1 -
 configs/stm32f746-disco_defconfig  |  1 -
 drivers/mmc/arm_pl180_mmci.c   | 87 ++
 4 files changed, 47 insertions(+), 43 deletions(-)

-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v1 2/6] configs: stm32f746-disco: Enable CONFIG_BLK

2018-07-20 Thread Patrice Chotard
CONFIG_BLK config flag becomes mandatory, enable it.

Signed-off-by: Patrice Chotard 
---

 configs/stm32f746-disco_defconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/configs/stm32f746-disco_defconfig 
b/configs/stm32f746-disco_defconfig
index aa7403f3c516..6f07ff155862 100644
--- a/configs/stm32f746-disco_defconfig
+++ b/configs/stm32f746-disco_defconfig
@@ -40,7 +40,6 @@ CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_NETCONSOLE=y
-# CONFIG_BLK is not set
 CONFIG_DM_MMC=y
 # CONFIG_SPL_DM_MMC is not set
 CONFIG_ARM_PL180_MMCI=y
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v1 3/6] configs: stm32f769-disco: Enable CONFIG_BLK

2018-07-20 Thread Patrice Chotard
CONFIG_BLK config flag becomes mandatory, enable it.

Signed-off-by: Patrice Chotard 
---

 configs/stm32f469-discovery_defconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/configs/stm32f469-discovery_defconfig 
b/configs/stm32f469-discovery_defconfig
index 4de03edcc2ca..a55476f2f323 100644
--- a/configs/stm32f469-discovery_defconfig
+++ b/configs/stm32f469-discovery_defconfig
@@ -26,7 +26,6 @@ CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_OF_EMBED=y
-# CONFIG_BLK is not set
 CONFIG_DM_MMC=y
 CONFIG_ARM_PL180_MMCI=y
 CONFIG_MTD_NOR_FLASH=y
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v1 1/6] configs: stm32f429-evaluation: Enable CONFIG_BLK

2018-07-20 Thread Patrice Chotard
Signed-off-by: Patrice Chotard 
---

 configs/stm32f429-evaluation_defconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/configs/stm32f429-evaluation_defconfig 
b/configs/stm32f429-evaluation_defconfig
index 1b14a4964067..3ddd5c50fb1d 100644
--- a/configs/stm32f429-evaluation_defconfig
+++ b/configs/stm32f429-evaluation_defconfig
@@ -26,7 +26,6 @@ CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_OF_EMBED=y
-# CONFIG_BLK is not set
 CONFIG_DM_MMC=y
 CONFIG_ARM_PL180_MMCI=y
 CONFIG_MTD_NOR_FLASH=y
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v1 4/6] mmc: arm_pl180_mmci: Update to support CONFIG_BLK

2018-07-20 Thread Patrice Chotard
Config flag CONFIG_BLK becomes mandatory, update arm_pl180_mmci
to support this config.

This driver is used by STM32Fx and by Vexpress platforms.
Only STM32Fx are DM ready. No DM code is isolated and will be
removed easily when wexpress will be converted to DM.

Signed-off-by: Patrice Chotard 
---

 drivers/mmc/arm_pl180_mmci.c | 85 +++-
 1 file changed, 45 insertions(+), 40 deletions(-)

diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c
index e267cd782e8b..e988bac62298 100644
--- a/drivers/mmc/arm_pl180_mmci.c
+++ b/drivers/mmc/arm_pl180_mmci.c
@@ -357,13 +357,13 @@ static const struct mmc_ops arm_pl180_mmci_ops = {
.set_ios = host_set_ios,
.init = mmc_host_reset,
 };
-#endif
 
 /*
  * mmc_host_init - initialize the mmc controller.
  * Set initial clock and power for mmc slot.
  * Initialize mmc struct and register with mmc framework.
  */
+
 int arm_pl180_mmci_init(struct pl180_mmc_host *host, struct mmc **mmc)
 {
u32 sdi_u32;
@@ -377,9 +377,8 @@ int arm_pl180_mmci_init(struct pl180_mmc_host *host, struct 
mmc **mmc)
writel(sdi_u32, &host->base->mask0);
 
host->cfg.name = host->name;
-#ifndef CONFIG_DM_MMC
host->cfg.ops = &arm_pl180_mmci_ops;
-#endif
+
/* TODO remove the duplicates */
host->cfg.host_caps = host->caps;
host->cfg.voltages = host->voltages;
@@ -393,23 +392,44 @@ int arm_pl180_mmci_init(struct pl180_mmc_host *host, 
struct mmc **mmc)
*mmc = mmc_create(&host->cfg, host);
if (!*mmc)
return -1;
-
debug("registered mmc interface number is:%d\n",
  (*mmc)->block_dev.devnum);
 
return 0;
 }
+#endif
 
 #ifdef CONFIG_DM_MMC
+static void arm_pl180_mmc_init(struct pl180_mmc_host *host)
+{
+   u32 sdi_u32;
+
+   writel(host->pwr_init, &host->base->power);
+   writel(host->clkdiv_init, &host->base->clock);
+   udelay(CLK_CHANGE_DELAY);
+
+   /* Disable mmc interrupts */
+   sdi_u32 = readl(&host->base->mask0) & ~SDI_MASK0_MASK;
+   writel(sdi_u32, &host->base->mask0);
+}
+
 static int arm_pl180_mmc_probe(struct udevice *dev)
 {
struct arm_pl180_mmc_plat *pdata = dev_get_platdata(dev);
struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
struct mmc *mmc = &pdata->mmc;
-   struct pl180_mmc_host *host = mmc->priv;
+   struct pl180_mmc_host *host = dev->priv;
+   struct mmc_config *cfg = &pdata->cfg;
struct clk clk;
u32 bus_width;
int ret;
+   fdt_addr_t addr;
+
+   addr = devfdt_get_addr(dev);
+   if (addr == FDT_ADDR_T_NONE)
+   return -EINVAL;
+
+   host->base = (void *)addr;
 
ret = clk_get_by_index(dev, 0, &clk);
if (ret < 0)
@@ -421,27 +441,28 @@ static int arm_pl180_mmc_probe(struct udevice *dev)
return ret;
}
 
-   strcpy(host->name, "MMC");
host->pwr_init = INIT_PWR;
host->clkdiv_init = SDI_CLKCR_CLKDIV_INIT_V1 | SDI_CLKCR_CLKEN |
SDI_CLKCR_HWFC_EN;
-   host->voltages = VOLTAGE_WINDOW_SD;
-   host->caps = 0;
host->clock_in = clk_get_rate(&clk);
-   host->clock_min = host->clock_in / (2 * (SDI_CLKCR_CLKDIV_INIT_V1 + 1));
-   host->clock_max = dev_read_u32_default(dev, "max-frequency",
-  MMC_CLOCK_MAX);
host->version2 = dev_get_driver_data(dev);
 
+   cfg->name = dev->name;
+   cfg->voltages = VOLTAGE_WINDOW_SD;
+   cfg->host_caps = 0;
+   cfg->f_min = host->clock_in / (2 * (SDI_CLKCR_CLKDIV_INIT_V1 + 1));
+   cfg->f_max = dev_read_u32_default(dev, "max-frequency", MMC_CLOCK_MAX);
+   cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
+
gpio_request_by_name(dev, "cd-gpios", 0, &host->cd_gpio, GPIOD_IS_IN);
 
bus_width = dev_read_u32_default(dev, "bus-width", 1);
switch (bus_width) {
case 8:
-   host->caps |= MMC_MODE_8BIT;
+   cfg->host_caps |= MMC_MODE_8BIT;
/* Hosts capable of 8-bit transfers can also do 4 bits */
case 4:
-   host->caps |= MMC_MODE_4BIT;
+   cfg->host_caps |= MMC_MODE_4BIT;
break;
case 1:
break;
@@ -449,19 +470,21 @@ static int arm_pl180_mmc_probe(struct udevice *dev)
dev_err(dev, "Invalid bus-width value %u\n", bus_width);
}
 
-   ret = arm_pl180_mmci_init(host, &mmc);
-   if (ret) {
-   dev_err(dev, "arm_pl180_mmci init failed\n");
-   return ret;
-   }
-
+   arm_pl180_mmc_init(host);
+   mmc->priv = host;
mmc->dev = dev;
-   dev->priv = host;
upriv->mmc = mmc;
 
return 0;
 }
 
+int arm_pl180_mmc_bind(struct udevice *dev)
+{
+   struct arm_pl180_mmc_plat *plat = dev_get_platdata(dev);
+
+   return mmc_bind(dev, &plat->mmc, &plat->cfg);
+}
+
 static

[U-Boot] [PATCH v1 6/6] mmc: arm_pl180_mmci: Add "cd_inverted" DT property read

2018-07-20 Thread Patrice Chotard
Add missing read of "cd_inverted" property in DT.

Signed-off-by: Patrice Chotard 
---

 drivers/mmc/arm_pl180_mmci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c
index 29a05ea0c39a..7341f2f78581 100644
--- a/drivers/mmc/arm_pl180_mmci.c
+++ b/drivers/mmc/arm_pl180_mmci.c
@@ -447,6 +447,7 @@ static int arm_pl180_mmc_probe(struct udevice *dev)
SDI_CLKCR_HWFC_EN;
host->clock_in = clk_get_rate(&clk);
host->version2 = dev_get_driver_data(dev);
+   host->cd_inverted = dev_read_bool(dev, "cd-inverted");
 
cfg->name = dev->name;
cfg->voltages = VOLTAGE_WINDOW_SD;
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v1 5/6] mmc: arm_pl180_mmci: Add missing clk_free

2018-07-20 Thread Patrice Chotard
Add missing clk_free() call in case of failure
when enabling the clock.

Signed-off-by: Patrice Chotard 
---

 drivers/mmc/arm_pl180_mmci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c
index e988bac62298..29a05ea0c39a 100644
--- a/drivers/mmc/arm_pl180_mmci.c
+++ b/drivers/mmc/arm_pl180_mmci.c
@@ -437,6 +437,7 @@ static int arm_pl180_mmc_probe(struct udevice *dev)
 
ret = clk_enable(&clk);
if (ret) {
+   clk_free(&clk);
dev_err(dev, "failed to enable clock\n");
return ret;
}
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [UBOOT PATCH] gpio: zynq: Used platdata structure for storing static data instead of priv

2018-07-20 Thread Vipul Kumar
This patch used platdata structure instead of priv for storing static
information read from DT.

Signed-off-by: Vipul Kumar 
---
 drivers/gpio/zynq_gpio.c | 67 
 1 file changed, 34 insertions(+), 33 deletions(-)

diff --git a/drivers/gpio/zynq_gpio.c b/drivers/gpio/zynq_gpio.c
index f793ee5..6fbaafb 100644
--- a/drivers/gpio/zynq_gpio.c
+++ b/drivers/gpio/zynq_gpio.c
@@ -93,7 +93,7 @@
 /* GPIO upper 16 bit mask */
 #define ZYNQ_GPIO_UPPER_MASK 0x
 
-struct zynq_gpio_privdata {
+struct zynq_gpio_platdata {
phys_addr_t base;
const struct zynq_platform_data *p_data;
 };
@@ -162,20 +162,20 @@ static inline void zynq_gpio_get_bank_pin(unsigned int 
pin_num,
  unsigned int *bank_pin_num,
  struct udevice *dev)
 {
-   struct zynq_gpio_privdata *priv = dev_get_priv(dev);
+   struct zynq_gpio_platdata *platdata = dev_get_platdata(dev);
u32 bank;
 
-   for (bank = 0; bank < priv->p_data->max_bank; bank++) {
-   if ((pin_num >= priv->p_data->bank_min[bank]) &&
-   (pin_num <= priv->p_data->bank_max[bank])) {
-   *bank_num = bank;
-   *bank_pin_num = pin_num -
-   priv->p_data->bank_min[bank];
-   return;
+   for (bank = 0; bank < platdata->p_data->max_bank; bank++) {
+   if (pin_num >= platdata->p_data->bank_min[bank] &&
+   pin_num <= platdata->p_data->bank_max[bank]) {
+   *bank_num = bank;
+   *bank_pin_num = pin_num -
+   platdata->p_data->bank_min[bank];
+   return;
}
}
 
-   if (bank >= priv->p_data->max_bank) {
+   if (bank >= platdata->p_data->max_bank) {
printf("Invalid bank and pin num\n");
*bank_num = 0;
*bank_pin_num = 0;
@@ -184,9 +184,9 @@ static inline void zynq_gpio_get_bank_pin(unsigned int 
pin_num,
 
 static int gpio_is_valid(unsigned gpio, struct udevice *dev)
 {
-   struct zynq_gpio_privdata *priv = dev_get_priv(dev);
+   struct zynq_gpio_platdata *platdata = dev_get_platdata(dev);
 
-   return gpio < priv->p_data->ngpio;
+   return gpio < platdata->p_data->ngpio;
 }
 
 static int check_gpio(unsigned gpio, struct udevice *dev)
@@ -202,14 +202,14 @@ static int zynq_gpio_get_value(struct udevice *dev, 
unsigned gpio)
 {
u32 data;
unsigned int bank_num, bank_pin_num;
-   struct zynq_gpio_privdata *priv = dev_get_priv(dev);
+   struct zynq_gpio_platdata *platdata = dev_get_platdata(dev);
 
if (check_gpio(gpio, dev) < 0)
return -1;
 
zynq_gpio_get_bank_pin(gpio, &bank_num, &bank_pin_num, dev);
 
-   data = readl(priv->base +
+   data = readl(platdata->base +
 ZYNQ_GPIO_DATA_RO_OFFSET(bank_num));
 
return (data >> bank_pin_num) & 1;
@@ -218,7 +218,7 @@ static int zynq_gpio_get_value(struct udevice *dev, 
unsigned gpio)
 static int zynq_gpio_set_value(struct udevice *dev, unsigned gpio, int value)
 {
unsigned int reg_offset, bank_num, bank_pin_num;
-   struct zynq_gpio_privdata *priv = dev_get_priv(dev);
+   struct zynq_gpio_platdata *platdata = dev_get_platdata(dev);
 
if (check_gpio(gpio, dev) < 0)
return -1;
@@ -241,7 +241,7 @@ static int zynq_gpio_set_value(struct udevice *dev, 
unsigned gpio, int value)
value = ~(1 << (bank_pin_num + ZYNQ_GPIO_MID_PIN_NUM)) &
((value << bank_pin_num) | ZYNQ_GPIO_UPPER_MASK);
 
-   writel(value, priv->base + reg_offset);
+   writel(value, platdata->base + reg_offset);
 
return 0;
 }
@@ -250,7 +250,7 @@ static int zynq_gpio_direction_input(struct udevice *dev, 
unsigned gpio)
 {
u32 reg;
unsigned int bank_num, bank_pin_num;
-   struct zynq_gpio_privdata *priv = dev_get_priv(dev);
+   struct zynq_gpio_platdata *platdata = dev_get_platdata(dev);
 
if (check_gpio(gpio, dev) < 0)
return -1;
@@ -262,9 +262,9 @@ static int zynq_gpio_direction_input(struct udevice *dev, 
unsigned gpio)
return -1;
 
/* clear the bit in direction mode reg to set the pin as input */
-   reg = readl(priv->base + ZYNQ_GPIO_DIRM_OFFSET(bank_num));
+   reg = readl(platdata->base + ZYNQ_GPIO_DIRM_OFFSET(bank_num));
reg &= ~BIT(bank_pin_num);
-   writel(reg, priv->base + ZYNQ_GPIO_DIRM_OFFSET(bank_num));
+   writel(reg, platdata->base + ZYNQ_GPIO_DIRM_OFFSET(bank_num));
 
return 0;
 }
@@ -274,7 +274,7 @@ static int zynq_gpio_direction_output(struct udevice *dev, 
unsigned gpio,
 {
u32 reg;
unsigned int bank_num, bank_pin_num;
-   struct zynq_gpio_privdata *pri

[U-Boot] [PATCH] spi: Kconfig: Create ISSI Kconfig entry

2018-07-20 Thread Michal Simek
Add ISSI to Kconfig to make it selectable via menuconfig.
Also convert all current platforms.

Signed-off-by: Michal Simek 
---

 configs/stmark2_defconfig  | 1 +
 configs/zynq_cc108_defconfig   | 1 +
 configs/zynq_cse_qspi_defconfig| 1 +
 configs/zynq_zc702_defconfig   | 1 +
 configs/zynq_zc706_defconfig   | 1 +
 configs/zynq_zc770_xm010_defconfig | 1 +
 configs/zynq_zc770_xm013_defconfig | 1 +
 drivers/mtd/spi/Kconfig| 5 +
 include/configs/stmark2.h  | 1 -
 include/configs/topic_miami.h  | 1 -
 include/configs/zynq-common.h  | 1 -
 11 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/configs/stmark2_defconfig b/configs/stmark2_defconfig
index 671c0aa4d9c7..c2b8dc6101b9 100644
--- a/configs/stmark2_defconfig
+++ b/configs/stmark2_defconfig
@@ -22,6 +22,7 @@ 
CONFIG_MTDPARTS_DEFAULT="mtdparts=spi-flash.0:1m(u-boot),7m(kernel),-(rootfs)"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 # CONFIG_NET is not set
 CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_SPI=y
 CONFIG_CF_SPI=y
diff --git a/configs/zynq_cc108_defconfig b/configs/zynq_cc108_defconfig
index ac8e1f193c95..26fdafb7c098 100644
--- a/configs/zynq_cc108_defconfig
+++ b/configs/zynq_cc108_defconfig
@@ -35,6 +35,7 @@ CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
+CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/zynq_cse_qspi_defconfig b/configs/zynq_cse_qspi_defconfig
index c094a5e7de48..0b2cd8cd62b1 100644
--- a/configs/zynq_cse_qspi_defconfig
+++ b/configs/zynq_cse_qspi_defconfig
@@ -55,6 +55,7 @@ CONFIG_SPL_DM_SEQ_ALIAS=y
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
+CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/zynq_zc702_defconfig b/configs/zynq_zc702_defconfig
index dd5f83476eba..bac538c8e2a0 100644
--- a/configs/zynq_zc702_defconfig
+++ b/configs/zynq_zc702_defconfig
@@ -52,6 +52,7 @@ CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
+CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/zynq_zc706_defconfig b/configs/zynq_zc706_defconfig
index ea61a964ff2b..991784d63b9b 100644
--- a/configs/zynq_zc706_defconfig
+++ b/configs/zynq_zc706_defconfig
@@ -50,6 +50,7 @@ CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
+CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/zynq_zc770_xm010_defconfig 
b/configs/zynq_zc770_xm010_defconfig
index 5697ad402490..6364e2b9d75b 100644
--- a/configs/zynq_zc770_xm010_defconfig
+++ b/configs/zynq_zc770_xm010_defconfig
@@ -42,6 +42,7 @@ CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
+CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/zynq_zc770_xm013_defconfig 
b/configs/zynq_zc770_xm013_defconfig
index e83222dcc128..833753e747a3 100644
--- a/configs/zynq_zc770_xm013_defconfig
+++ b/configs/zynq_zc770_xm013_defconfig
@@ -36,6 +36,7 @@ CONFIG_DM_GPIO=y
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
+CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/drivers/mtd/spi/Kconfig b/drivers/mtd/spi/Kconfig
index 4484cf81951a..98485b123659 100644
--- a/drivers/mtd/spi/Kconfig
+++ b/drivers/mtd/spi/Kconfig
@@ -66,6 +66,11 @@ config SPI_FLASH_GIGADEVICE
help
  Add support for various GigaDevice SPI flash chips (GD25xxx)
 
+config SPI_FLASH_ISSI
+   bool "ISSI SPI flash support"
+   help
+ Add support for various ISSI SPI flash chips (ISxxx)
+
 config SPI_FLASH_MACRONIX
bool "Macronix SPI flash support"
help
diff --git a/include/configs/stmark2.h b/include/configs/stmark2.h
index 36b7f288e00c..263a9c924acf 100644
--- a/include/configs/stmark2.h
+++ b/include/configs/stmark2.h
@@ -68,7 +68,6 @@
 #define CONFIG_SF_DEFAULT_SPEED5000
 #define CONFIG_SERIAL_FLASH
 #define CONFIG_HARD_SPI
-#define CONFIG_SPI_FLASH_ISSI
 #define CONFIG_ENV_SPI_BUS 0
 #define CONFIG_ENV_SPI_CS  1
 
diff --git a/include/configs/topic_miami.h b/include/configs/topic_miami.h
index 9ab2b2da20ae..f14c4ee3a846 100644
--- a/include/configs/topic_miami.h
+++ b/include/configs/topic_miami.h
@@ -53,7 +53,6 @@
 #define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
 #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
 #undef CONFIG_SPI_FLASH_WINBOND
-#undef CONFIG_SPI_FLASH_ISSI
 
 /* Setup proper boot sequences for Miami boards */
 
diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
index c41dc2c9070e..526d92c60

[U-Boot] [PATCH] arm: zynqmp: Move NR_DRAM_BANKS for mini confiration

2018-07-20 Thread Michal Simek
There is no reason to have the same setting in subsequent config if we
can have it only once in shared.

Signed-off-by: Michal Simek 
---

 include/configs/xilinx_zynqmp_mini.h  | 1 +
 include/configs/xilinx_zynqmp_mini_emmc.h | 1 -
 include/configs/xilinx_zynqmp_mini_nand.h | 1 -
 include/configs/xilinx_zynqmp_mini_qspi.h | 1 -
 4 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/configs/xilinx_zynqmp_mini.h 
b/include/configs/xilinx_zynqmp_mini.h
index 8ba91d0d1dda..b35659bb0533 100644
--- a/include/configs/xilinx_zynqmp_mini.h
+++ b/include/configs/xilinx_zynqmp_mini.h
@@ -32,5 +32,6 @@
 #undef CONFIG_BOOTP_MAY_FAIL
 
 #undef CONFIG_NR_DRAM_BANKS
+#define CONFIG_NR_DRAM_BANKS   1
 
 #endif /* __CONFIG_ZYNQMP_MINI_H */
diff --git a/include/configs/xilinx_zynqmp_mini_emmc.h 
b/include/configs/xilinx_zynqmp_mini_emmc.h
index 6531599c79d9..8fdff505283f 100644
--- a/include/configs/xilinx_zynqmp_mini_emmc.h
+++ b/include/configs/xilinx_zynqmp_mini_emmc.h
@@ -13,7 +13,6 @@
 #include 
 
 #define CONFIG_SYS_ICACHE_OFF
-#define CONFIG_NR_DRAM_BANKS   1
 #define CONFIG_SYS_INIT_SP_ADDRCONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_MALLOC_LEN  0x80
 
diff --git a/include/configs/xilinx_zynqmp_mini_nand.h 
b/include/configs/xilinx_zynqmp_mini_nand.h
index 00db44964847..aaa9eee00960 100644
--- a/include/configs/xilinx_zynqmp_mini_nand.h
+++ b/include/configs/xilinx_zynqmp_mini_nand.h
@@ -13,7 +13,6 @@
 #include 
 
 #define CONFIG_SYS_ICACHE_OFF
-#define CONFIG_NR_DRAM_BANKS   1
 #define CONFIG_SYS_SDRAM_SIZE  0x100
 #define CONFIG_SYS_SDRAM_BASE  0x0
 #define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_SDRAM_BASE + 0x4)
diff --git a/include/configs/xilinx_zynqmp_mini_qspi.h 
b/include/configs/xilinx_zynqmp_mini_qspi.h
index 229132675ee3..679ad0be3e00 100644
--- a/include/configs/xilinx_zynqmp_mini_qspi.h
+++ b/include/configs/xilinx_zynqmp_mini_qspi.h
@@ -13,7 +13,6 @@
 #include 
 
 #define CONFIG_SYS_ICACHE_OFF
-#define CONFIG_NR_DRAM_BANKS   1
 #define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_TEXT_BASE + 0x2)
 #define CONFIG_SYS_MALLOC_LEN  0x2000
 
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] arm: zynqmp: Fix sdhci clock in emmc1 mini configuration

2018-07-20 Thread Michal Simek
Add missing clocks property with fix clock-names property to be aligned
with emmc0 configuration and binding doc.

Signed-off-by: Michal Simek 
---

 arch/arm/dts/zynqmp-mini-emmc1.dts | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/dts/zynqmp-mini-emmc1.dts 
b/arch/arm/dts/zynqmp-mini-emmc1.dts
index d1549b6dc6d4..530ab3cdc22e 100644
--- a/arch/arm/dts/zynqmp-mini-emmc1.dts
+++ b/arch/arm/dts/zynqmp-mini-emmc1.dts
@@ -52,7 +52,8 @@
compatible = "xlnx,zynqmp-8.9a", "arasan,sdhci-8.9a";
status = "disabled";
reg = <0x0 0xff17 0x0 0x1000>;
-   clock-names = "clk_xin", "clk_xin";
+   clock-names = "clk_xin", "clk_ahb";
+   clocks = <&clk_xin &clk_xin>;
xlnx,device_id = <1>;
};
};
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [UBOOT PATCH] Kconfig: Move config SYS_MALLOC_LEN to Kconfig for zynq

2018-07-20 Thread Vipul Kumar
From: Siva Durga Prasad Paladugu 

This patch moves the the config SYS_MALLOC_LEN to
Kconfig. It will be just for Zynq arch and to do
will be for all other archs.

Signed-off-by: Siva Durga Prasad Paladugu 
Signed-off-by: Vipul Kumar 
---
 Kconfig | 7 +++
 arch/arm/mach-zynq/Kconfig  | 3 +++
 configs/zynq_cse_nand_defconfig | 1 +
 configs/zynq_cse_nor_defconfig  | 1 +
 configs/zynq_cse_qspi_defconfig | 1 +
 include/configs/zynq-common.h   | 2 --
 include/configs/zynq_cse.h  | 3 ---
 7 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/Kconfig b/Kconfig
index c8b86cd..61795e3 100644
--- a/Kconfig
+++ b/Kconfig
@@ -136,6 +136,13 @@ config SYS_MALLOC_F_LEN
  particular needs this to operate, so that it can allocate the
  initial serial device and any others that are needed.
 
+config SYS_MALLOC_LEN
+   hex "Define memory for Dynamic allocation"
+   depends on ARCH_ZYNQ
+   help
+ This defines memory to be allocated for Dynamic allocation
+ TODO: Use for other architectures
+
 config SPL_SYS_MALLOC_F_LEN
 hex "Size of malloc() pool in SPL before relocation"
 depends on SYS_MALLOC_F
diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig
index 1352359..a599ed6 100644
--- a/arch/arm/mach-zynq/Kconfig
+++ b/arch/arm/mach-zynq/Kconfig
@@ -57,6 +57,9 @@ config SYS_CONFIG_NAME
 config SYS_MALLOC_F_LEN
default 0x600
 
+config SYS_MALLOC_LEN
+   default 0x140
+
 config BOOT_INIT_FILE
string "boot.bin init register filename"
default ""
diff --git a/configs/zynq_cse_nand_defconfig b/configs/zynq_cse_nand_defconfig
index eb7e574..d228f9a 100644
--- a/configs/zynq_cse_nand_defconfig
+++ b/configs/zynq_cse_nand_defconfig
@@ -5,6 +5,7 @@ CONFIG_SYS_TEXT_BASE=0x10
 CONFIG_ENV_SIZE=0x190
 CONFIG_SPL=y
 CONFIG_SPL_STACK_R_ADDR=0x20
+CONFIG_SYS_MALLOC_LEN=0x1000
 CONFIG_DEFAULT_DEVICE_TREE="zynq-cse-nand"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_STACK_R=y
diff --git a/configs/zynq_cse_nor_defconfig b/configs/zynq_cse_nor_defconfig
index 95b31a0..3052c5b 100644
--- a/configs/zynq_cse_nor_defconfig
+++ b/configs/zynq_cse_nor_defconfig
@@ -5,6 +5,7 @@ CONFIG_SYS_TEXT_BASE=0xFFFC
 CONFIG_ENV_SIZE=0x190
 CONFIG_SPL=y
 CONFIG_SPL_STACK_R_ADDR=0x20
+CONFIG_SYS_MALLOC_LEN=0x1000
 CONFIG_DEFAULT_DEVICE_TREE="zynq-cse-nor"
 CONFIG_BOOTDELAY=-1
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/zynq_cse_qspi_defconfig b/configs/zynq_cse_qspi_defconfig
index c094a5e..2410806 100644
--- a/configs/zynq_cse_qspi_defconfig
+++ b/configs/zynq_cse_qspi_defconfig
@@ -8,6 +8,7 @@ CONFIG_DEBUG_UART_BASE=0x0
 CONFIG_DEBUG_UART_CLOCK=0
 CONFIG_SPL_STACK_R_ADDR=0x20
 # CONFIG_ZYNQ_DDRC_INIT is not set
+CONFIG_SYS_MALLOC_LEN=0x1000
 # CONFIG_CMD_ZYNQ is not set
 CONFIG_DEFAULT_DEVICE_TREE="zynq-cse-qspi-single"
 CONFIG_DEBUG_UART=y
diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
index c41dc2c..3c2987b 100644
--- a/include/configs/zynq-common.h
+++ b/include/configs/zynq-common.h
@@ -236,8 +236,6 @@
 #define CONFIG_SYS_MEMTEST_START   0
 #define CONFIG_SYS_MEMTEST_END 0x1000
 
-#define CONFIG_SYS_MALLOC_LEN  0x140
-
 #define CONFIG_SYS_INIT_RAM_ADDR   0x
 #define CONFIG_SYS_INIT_RAM_SIZE   0x1000
 #define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_INIT_RAM_ADDR + \
diff --git a/include/configs/zynq_cse.h b/include/configs/zynq_cse.h
index 36fbe0e..c4587a1 100644
--- a/include/configs/zynq_cse.h
+++ b/include/configs/zynq_cse.h
@@ -36,7 +36,4 @@
 #define CONFIG_SPL_BSS_START_ADDR  0x2
 #define CONFIG_SPL_BSS_MAX_SIZE0x8000
 
-#undef CONFIG_SYS_MALLOC_LEN
-#define CONFIG_SYS_MALLOC_LEN  0x1000
-
 #endif /* __CONFIG_ZYNQ_CSE_H */
-- 
2.7.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 2/2] arm: zynq: Fix indentation for zynq-cse targets

2018-07-20 Thread Michal Simek
Trivial DT style fixes.

Signed-off-by: Michal Simek 
---

 arch/arm/dts/zynq-cse-nand.dts | 3 +--
 arch/arm/dts/zynq-cse-nor.dts  | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/arm/dts/zynq-cse-nand.dts b/arch/arm/dts/zynq-cse-nand.dts
index 9b1dd19a85df..1e16d7fab97d 100644
--- a/arch/arm/dts/zynq-cse-nand.dts
+++ b/arch/arm/dts/zynq-cse-nand.dts
@@ -38,7 +38,7 @@
#size-cells = <1>;
ranges;
 
-   slcr: slcr@f800 {
+   slcr: slcr@f800 {
u-boot,dm-pre-reloc;
#address-cells = <1>;
#size-cells = <1>;
@@ -72,7 +72,6 @@
};
};
};
-
 };
 
 &dcc {
diff --git a/arch/arm/dts/zynq-cse-nor.dts b/arch/arm/dts/zynq-cse-nor.dts
index edc8f59f6cea..9710abadcf02 100644
--- a/arch/arm/dts/zynq-cse-nor.dts
+++ b/arch/arm/dts/zynq-cse-nor.dts
@@ -79,7 +79,6 @@
};
};
};
-
 };
 
 &dcc {
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 1/2] arm: zynq: Remove fclk-enable property for cse-nor target

2018-07-20 Thread Michal Simek
Mini cse NOR configuration is running without PL that's why there is no
reason to enable clock to PL.

Signed-off-by: Michal Simek 
---

 arch/arm/dts/zynq-cse-nor.dts | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/dts/zynq-cse-nor.dts b/arch/arm/dts/zynq-cse-nor.dts
index ba6f9a1a79e3..edc8f59f6cea 100644
--- a/arch/arm/dts/zynq-cse-nor.dts
+++ b/arch/arm/dts/zynq-cse-nor.dts
@@ -56,7 +56,6 @@
clkc: clkc@100 {
#clock-cells = <1>;
compatible = "xlnx,ps7-clkc";
-   fclk-enable = <0xf>;
clock-output-names = "armpll", "ddrpll",
"iopll", "cpu_6or4x",
"cpu_3or2x", "cpu_2x", "cpu_1x",
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 0/6] musb-new: Improve shutdown code

2018-07-20 Thread Marek Vasut
On 07/20/2018 09:13 AM, Jagan Teki wrote:
> This is v2 for previous series[1], by excluding sunxi phy changes.
> 
> One patch mark it as 'RFC' about "including UCLASS_USB_DEV_GENERIC
> into shutdown caller" so expecting some inputs on the same
> 
> [1] https://patchwork.ozlabs.org/cover/941588/
> 
> Jagan Teki (6):
>   usb: musb-new: Fix improper musb host pointer
>   usb: musb-new: sunxi: Allocate struct phy in private
>   dm: usb: Add UCLASS_USB_DEV_GENERIC shutdown
>   musb-new: sunxi: Access ahb_reset0_cfg via ccm offset
>   usb: musb-new: sunxi: Add proper musb exit support
>   usb: musb-new: Call musb_platform_exit from musb_stop
> 
>  board/compulab/cm_t3517/cm_t3517.c |   4 +-
>  drivers/usb/host/usb-uclass.c  |  43 
>  drivers/usb/musb-new/musb_core.c   |   1 +
>  drivers/usb/musb-new/musb_uboot.c  |  12 ++--
>  drivers/usb/musb-new/pic32.c   |   6 +-
>  drivers/usb/musb-new/sunxi.c   | 107 ++---
>  include/linux/usb/musb.h   |   4 +-
>  7 files changed, 123 insertions(+), 54 deletions(-)
> 

+CC Vasily, I want his AB/TB on this. Please keep him CCed on those USB
patches.

-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 00/17] fs: fat: extend FAT write operations

2018-07-20 Thread Heinrich Schuchardt


On 07/20/2018 04:57 AM, AKASHI Takahiro wrote:

This patch series is an attempt to address FAT write related issues
in an effort of running UEFI SCT (Self-Certification Test) to verify
UEFI support on u-boot.

SCT is a test platform as well as an extentisive collection of test
cases for UEFI specification. It can run all the tests automatically
and save test results to dedicated log files.

AFAIK, what's missing in the current fat file system to safely run
SCT without errors (I don't mean test case failures) are:
* write a file located under sub-directories
* write a file with non-zero offset
* delete a file
* create a directory

Patch#1 to patch#6 are some sort of preparatory ones.
Patch#7 implements write with sub-directories path.
Patch#8 to patch#10 implement write with non-zero offset.
Patch#11 to patch#15 are related to creating a directory.
Patch#16 provides delete, but it doesn't actually delete a file
but instead return 0 with purging a file content, which is good
enough to run SCT for now.
Finally, patch#17 fixes a minor bug in fs-test.sh.

I applied this patch set on top of v2018.07 along with a couple of
yet-to--be-upstreamed UEFI-related patches, and could successfully
run unmodified SCT[1] on qemu-arm.

[1] http://uefi.org/testtools


Thanks Takahiro for getting this all implemented.

I have some questions concerning code pages:

The FAT file system contains a short name and a long name. The short 
name is in the 8-bit code page of the system. The long name is 16bit 
Unicode.


Which local code page do you assume? I would suggest to use 437 as we do 
in some other drivers.


With your patch fat_mkdir() and fat_file_write() do not yet support 
UTF-8 as file names and convert this to the 437 local page for the short 
name and to UTF-16 for the long name.


Without this conversoin we will not be able to implement the EFI 
specification.


normalize_longname() simply ignores codes 0x80-0xFF. Please, have a look at

https://www.win.tue.nl/~aeb/linux/fs/fat/fatgen103.pdf
Microsoft Extensible Firmware Initiative FAT32 File System Specification
FAT: General Overview of On-Disk Format
Version 1.03, December 6, 2000

Shouldn't we implement the base-name algorithm as described in the paper?

Best regards

Heinrich
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] mkimage: fit_image: Use macros from image.h

2018-07-20 Thread Michal Simek
There is no reason not to use macros which are already defined.
It is also much easier for grepping.

Signed-off-by: Michal Simek 
---

 tools/fit_image.c | 53 +
 1 file changed, 29 insertions(+), 24 deletions(-)

diff --git a/tools/fit_image.c b/tools/fit_image.c
index 3c265357ae73..4b626354fb3f 100644
--- a/tools/fit_image.c
+++ b/tools/fit_image.c
@@ -202,21 +202,22 @@ static int fit_write_images(struct image_tool_params 
*params, char *fdt)
typename = genimg_get_type_short_name(params->fit_image_type);
snprintf(str, sizeof(str), "%s-1", typename);
fdt_begin_node(fdt, str);
-   fdt_property_string(fdt, "description", params->imagename);
-   fdt_property_string(fdt, "type", typename);
-   fdt_property_string(fdt, "arch",
+   fdt_property_string(fdt, FIT_DESC_PROP, params->imagename);
+   fdt_property_string(fdt, FIT_TYPE_PROP, typename);
+   fdt_property_string(fdt, FIT_ARCH_PROP,
genimg_get_arch_short_name(params->arch));
-   fdt_property_string(fdt, "os", genimg_get_os_short_name(params->os));
-   fdt_property_string(fdt, "compression",
+   fdt_property_string(fdt, FIT_OS_PROP,
+   genimg_get_os_short_name(params->os));
+   fdt_property_string(fdt, FIT_COMP_PROP,
genimg_get_comp_short_name(params->comp));
-   fdt_property_u32(fdt, "load", params->addr);
-   fdt_property_u32(fdt, "entry", params->ep);
+   fdt_property_u32(fdt, FIT_LOAD_PROP, params->addr);
+   fdt_property_u32(fdt, FIT_ENTRY_PROP, params->ep);
 
/*
 * Put data last since it is large. SPL may only load the first part
 * of the DT, so this way it can access all the above fields.
 */
-   ret = fdt_property_file(params, fdt, "data", params->datafile);
+   ret = fdt_property_file(params, fdt, FIT_DATA_PROP, params->datafile);
if (ret)
return ret;
fdt_end_node(fdt);
@@ -230,14 +231,15 @@ static int fit_write_images(struct image_tool_params 
*params, char *fdt)
fdt_begin_node(fdt, str);
 
get_basename(str, sizeof(str), cont->fname);
-   fdt_property_string(fdt, "description", str);
-   ret = fdt_property_file(params, fdt, "data", cont->fname);
+   fdt_property_string(fdt, FIT_DESC_PROP, str);
+   ret = fdt_property_file(params, fdt, FIT_DATA_PROP,
+   cont->fname);
if (ret)
return ret;
-   fdt_property_string(fdt, "type", typename);
-   fdt_property_string(fdt, "arch",
+   fdt_property_string(fdt, FIT_TYPE_PROP, typename);
+   fdt_property_string(fdt, FIT_ARCH_PROP,
genimg_get_arch_short_name(params->arch));
-   fdt_property_string(fdt, "compression",
+   fdt_property_string(fdt, FIT_COMP_PROP,
genimg_get_comp_short_name(IH_COMP_NONE));
fdt_end_node(fdt);
}
@@ -246,10 +248,12 @@ static int fit_write_images(struct image_tool_params 
*params, char *fdt)
if (params->fit_ramdisk) {
fdt_begin_node(fdt, FIT_RAMDISK_PROP "-1");
 
-   fdt_property_string(fdt, "type", FIT_RAMDISK_PROP);
-   fdt_property_string(fdt, "os", 
genimg_get_os_short_name(params->os));
+   fdt_property_string(fdt, FIT_TYPE_PROP, FIT_RAMDISK_PROP);
+   fdt_property_string(fdt, FIT_OS_PROP,
+   genimg_get_os_short_name(params->os));
 
-   ret = fdt_property_file(params, fdt, "data", 
params->fit_ramdisk);
+   ret = fdt_property_file(params, fdt, FIT_DATA_PROP,
+   params->fit_ramdisk);
if (ret)
return ret;
 
@@ -278,7 +282,7 @@ static void fit_write_configs(struct image_tool_params 
*params, char *fdt)
int upto;
 
fdt_begin_node(fdt, "configurations");
-   fdt_property_string(fdt, "default", "conf-1");
+   fdt_property_string(fdt, FIT_DEFAULT_PROP, "conf-1");
 
upto = 0;
for (cont = params->content_head; cont; cont = cont->next) {
@@ -289,7 +293,7 @@ static void fit_write_configs(struct image_tool_params 
*params, char *fdt)
fdt_begin_node(fdt, str);
 
get_basename(str, sizeof(str), cont->fname);
-   fdt_property_string(fdt, "description", str);
+   fdt_property_string(fdt, FIT_DESC_PROP, str);
 
typename = genimg_get_type_short_name(params->fit_image_type);
snprintf(str, sizeof(str), "%s-1", typename);
@@ -329,7 +333,7 @@ static int fit_build_fdt(struct image_tool_params *params, 
char *fdt, int size)
return ret;
fdt_finish_reservema

Re: [U-Boot] [RFC PATCH 4/4] arm: zynq: spl: implement FPGA load from FIT

2018-07-20 Thread Michal Simek
On 19.7.2018 19:22, Luis Araneda wrote:
> Hi Michal,
> 
> On Thu, Jul 19, 2018 at 2:16 AM Michal Simek  wrote:
>> Also on zc706 without FULL_FIT my path in spl_load_fit_image is not
>> jumping to "if (external_data) {" branch where spl_load_fpga_image is
>> which is kind of interesting because it looks like you are going there.
> 
> To enter the path "if (external_data) {" branch where spl_load_fpga_image is}"
> you have to create the FIT image with the "-E" option, I'm creating it with:
>> ./tools/mkimage -f  -E 
> 
> I started to use the option because my initial tests weren't entering
> the path either, and I found it when analyzing the (generated)
> .u-boot.img.cmd file.
> 
> I just tested your patch with and without the "-E" option, and it
> works on both cases :)

ok.

Thanks,
Michal

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [RFC PATCH 0/4] arm: zynq: implement FPGA load from SPL

2018-07-20 Thread Michal Simek
Hi,

On 20.7.2018 01:37, Luis Araneda wrote:
> Hi Michal,
> 
> On Thu, Jul 19, 2018 at 2:23 AM Michal Simek  wrote:
>> On 18.7.2018 20:02, Luis Araneda wrote:
>>> [...]
>>> I didn't send them because just changing the defconfig isn't enough,
>>
>> It should be enough. It is configuration option and just enabling that
>> feature. You should still be able to use just u-boot.img in legacy or
>> fit format without any issue.
> 
> Ok. Should I send a patch only for the Zybo or all zynq boards? Also,
> for than one board, should I create one patch per board or only one
> big patch for all of them?

We need that functionality first but then enable it for all boards is
fine for me and via one patch.

> 
>> I think it will be good if you can look at my patch and also compare
>> boot up time when you setup compression to gzip. I expect some changes
>> in connection to this code.
>>
>> if (IS_ENABLED(CONFIG_SPL_OS_BOOT)  &&
>> IS_ENABLED(CONFIG_SPL_GZIP) &&
>> image_comp == IH_COMP_GZIP  &&
>> type == IH_TYPE_KERNEL) {
>>
>> And I would expect that copying smaller fit with unziping bitstream will
>> be faster then what you have now. Especially on boards which bigger fpga.
> 
> I made some modifications to make gzip work, and another one dirty
> (non-upstremeable) to make external data work.
> Additionally, I added time reporting on three places. The
> modifications are attached.
> 
> I tested several bitstreams, with different compression levels:
>> gzip -c -n   > 
> 
> The results, for a fit image with embedded data, are:
> file   size (bytes) time1 time2 time3
> uncompressed   2,434,112 567   597   623
> compressed -1446,028 208  1165  1190
> compressed -4407,764 205  1063  1088
> compressed -5398,346 203  1094  1119
> compressed -9376,821 200  1141  1166
> 
> The time for a fit image with external data (-E option for mkimage) is
> ~100 time units (ms?) less, and time1 remains constant at ~12 time
> units.

Can you please be more specific what time1/time2 and time3 means?

> 
> At least on my setup (Zybo Z7-20), gzip just increase the boot time.

It could be because of bitstream size is quite small for this chip.

Thanks,
Michal
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 4/4] arm: zynq: use i2c cadence DM driver

2018-07-20 Thread Michal Simek
On 9.7.2018 07:00, Luis Araneda wrote:
> Migrate most boards to the Cadence I2C driver and
> use DM functions to read the MAC address from EEPROM
> 
> Additionally, remove the legacy eeprom command from
> defconfig since it was only used to provide the functions
> to read the MAC address
> 
> Boards ZC702 and ZC706 were not migrated because they have
> I2C multiplexers and require extended validation and testing
> 
> Signed-off-by: Luis Araneda 
> ---
>  arch/arm/dts/zynq-syzygy-hub.dts  |  1 +
>  arch/arm/dts/zynq-zybo.dts| 10 ++
>  board/xilinx/zynq/board.c | 24 
>  configs/syzygy_hub_defconfig  |  5 ++---
>  configs/topic_miami_defconfig |  5 ++---
>  configs/topic_miamilite_defconfig |  5 ++---
>  configs/topic_miamiplus_defconfig |  5 ++---
>  configs/zynq_zybo_defconfig   |  6 ++
>  include/configs/syzygy_hub.h  |  2 --
>  include/configs/zynq_zybo.h   |  1 -
>  10 files changed, 41 insertions(+), 23 deletions(-)
> 
> diff --git a/arch/arm/dts/zynq-syzygy-hub.dts 
> b/arch/arm/dts/zynq-syzygy-hub.dts
> index a30d667146..d89e669b71 100644
> --- a/arch/arm/dts/zynq-syzygy-hub.dts
> +++ b/arch/arm/dts/zynq-syzygy-hub.dts
> @@ -15,6 +15,7 @@
>   aliases {
>   ethernet0 = &gem0;
>   serial0 = &uart0;
> + i2c0 = &i2c1;
>   mmc0 = &sdhci0;
>   };
>  

This can be separate patch.

> diff --git a/arch/arm/dts/zynq-zybo.dts b/arch/arm/dts/zynq-zybo.dts
> index 3844822305..b5e0f3d9b3 100644
> --- a/arch/arm/dts/zynq-zybo.dts
> +++ b/arch/arm/dts/zynq-zybo.dts
> @@ -14,6 +14,8 @@
>   ethernet0 = &gem0;
>   serial0 = &uart1;
>   spi0 = &qspi;
> + i2c0 = &i2c0;
> + i2c1 = &i2c1;
>   mmc0 = &sdhci0;
>   };
>  
> @@ -49,6 +51,14 @@
>   };
>  };
>  
> +&i2c0 {
> + status = "okay";
> +};
> +
> +&i2c1 {
> + status = "okay";
> +};
> +

IIRC zybo has no connection from PS to i2c and it is done via PL.
And deal was that only things which are in PS part should be listed in
DTS file. It means this shouldn't be here.


>  &qspi {
>   u-boot,dm-pre-reloc;
>   status = "okay";
> diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c
> index dcbf788918..5b9ee10a90 100644
> --- a/board/xilinx/zynq/board.c
> +++ b/board/xilinx/zynq/board.c
> @@ -8,6 +8,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -76,10 +77,25 @@ int board_late_init(void)
>  int zynq_board_read_rom_ethaddr(unsigned char *ethaddr)
>  {
>  #if defined(CONFIG_MAC_ADDR_IN_I2C_EEPROM)
> - if (eeprom_read(CONFIG_MAC_ADDR_I2C_EEPROM_CHIP_ADDR,
> - CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_START,
> - ethaddr, 6))
> - printf("I2C EEPROM MAC address read failed\n");
> + int ret;
> + struct udevice *bus, *dev;
> +
> + ret = uclass_get_device_by_seq(UCLASS_I2C,
> +CONFIG_MAC_ADDR_I2C_EEPROM_BUS,
> +&bus);
> + if (!ret)
> + ret = i2c_get_chip(bus,
> +CONFIG_MAC_ADDR_I2C_EEPROM_CHIP_ADDR,
> +1, &dev);
> + if (!ret)
> + ret = i2c_set_chip_offset_len(dev,
> +   
> CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_LEN);
> + if (!ret)
> + ret = dm_i2c_read(dev,
> +   CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_START,
> +   ethaddr, 6);
> + if (ret)
> + printf("I2C EEPROM MAC address read failed (%i)\n", ret);
>  #endif

In ZynqMP there is also call i2c_set_bus_num which is what you do above.

I don't think that make sense to duplicate this code in board files.
This should go to core. I think eeprom hasn't been converted to DM and
that's the thing which should happen first. Then calling sequence should
be the same in board files.


>  
>   return 0;
> diff --git a/configs/syzygy_hub_defconfig b/configs/syzygy_hub_defconfig
> index 221349ba6f..bcc3ecda49 100644
> --- a/configs/syzygy_hub_defconfig
> +++ b/configs/syzygy_hub_defconfig
> @@ -18,7 +18,6 @@ CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd"
>  CONFIG_SPL_STACK_R=y
>  CONFIG_SPL_OS_BOOT=y
>  CONFIG_SYS_PROMPT="Zynq> "
> -CONFIG_CMD_EEPROM=y

this will caused regression.

>  # CONFIG_CMD_FLASH is not set
>  CONFIG_CMD_FPGA_LOADBP=y
>  CONFIG_CMD_FPGA_LOADFS=y
> @@ -37,8 +36,8 @@ CONFIG_SPL_DM_SEQ_ALIAS=y
>  CONFIG_FPGA_XILINX=y
>  CONFIG_FPGA_ZYNQPL=y
>  CONFIG_DM_GPIO=y
> -CONFIG_SYS_I2C_ZYNQ=y
> -CONFIG_ZYNQ_I2C1=y
> +CONFIG_DM_I2C=y
> +CONFIG_SYS_I2C_CADENCE=y
>  CONFIG_MAC_ADDR_IN_I2C_EEPROM=y
>  CONFIG_MAC_ADDR_I2C_EEPROM_CHIP_ADDR=0x57
>  CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_START=0xFA
> diff --git a/configs/topic_miami_defconfig b/configs/topic_miami_defconfig
> index af5b92cd34..408a54

Re: [U-Boot] [PATCH 0/4] arm: zynq: migrate to DM I2C driver

2018-07-20 Thread Michal Simek
On 20.7.2018 08:12, Luis Araneda wrote:
> Hi Michal,
> 
> On Thu, Jul 19, 2018 at 3:28 AM Michal Simek  wrote:
>> Please take a look at
>> https://lists.denx.de/pipermail/u-boot/2016-November/274068.html which
>> was the series which should replace all these boards setting in a
>> generic way. Unfortunately I don't know why it didn't go through.
> 
> The last version of that series [1] (v6, 28 patches) has the state
> "Changes Requested" on patchwork, and it even has some TODOs. It's a
> generic way of reading a MAC address from an EEPROM with helper
> functions.
> I'm not proposing something as generic and elaborated as that series,
> but an improvement to what is used today.
> 
> I sent this series to move some legacy options to Kconfig.
> Additionally, the Zybo Z7 has its MAC address stored on an SPI FLASH,
> which will likely require a new Kconfig option (MAC_ADDR_IN_SPI_FLASH)
> eventually. Something that [1] doesn't cover (from what I read).
> 
> It just occurred to me that what I'm really doing in the fourth patch
> is reading the MAC address from a generic memory connected to I2C,
> because it's a generic memory read operation (device address, memory
> address, read operation). So I think the name of the Kconfigs could be
> CONFIG_MAC_ADDR_IN_I2C_MEMORY instead of
> CONFIG_MAC_ADDR_IN_I2C_EEPROM. It can even be more generic like
> CONFIG_MAC_ADDR_IN_I2C. What do yo think?
> 
>> And then regarding DM i2c. Driver is in the driver for a while but for
>> i2c muxes support it requires all subbusses to be listed in DTS file
>> which is not what it is common in Linux dt binding. That's why some work
>> needs to be done in this area to convert all platforms.
> 
> Yes, I realize that I2C muxes are a pending issue, but that's why I
> only migrated the boards that are not using I2C muxes. From my point
> of view, it's less work to be done when porting
> 
> Anyway, I just wanted to improve the current state of the code, I
> don't need these changes for what I'm doing. So if you like to wait
> for [1] to be merged, it's fine with me and we can drop this series,
> otherwise, please review it so I can make changes if necessary.
> 
> [1] https://lists.denx.de/pipermail/u-boot/2017-May/291401.html

I have no problem to move ZYNQ_GEM_EEPROM_ADDR to Kconfig without
changing the name.

Oliver: Any comment about your patch series?

And I would let Joe to handle that mac address reading.
That v6 series contains a lot of patches which have been acked. The
biggest problem was about sunxi which is something what can be ignored.
If Oliver doesn't want to send v7 then I would recommend you simply take
his v6 version and that patches which are required and just send them
again. I think it won't take so much time because a lot of things were
already done.

Thanks,
Michal


-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP SoCs




signature.asc
Description: OpenPGP digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 1/2] common: Log should depends on DM not be selected by DM

2018-07-20 Thread Michal Simek
Better use depends on instead of select.

Signed-off-by: Michal Simek 
---

I found this in connection to setup imply CMD_DM and it seems to not
standard that it is selecting DM which is not used anywhere else.

---
 common/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/Kconfig b/common/Kconfig
index 4c7a1a9af865..cb17911e1681 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -424,7 +424,7 @@ menu "Logging"
 
 config LOG
bool "Enable logging support"
-   select DM
+   depends on DM
help
  This enables support for logging of status and debug messages. These
  can be displayed on the console, recorded in a memory buffer, or
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 7/7] cmd: Add bind/unbind commands to bind a device to a driver from the command line

2018-07-20 Thread Michal Simek
On 17.7.2018 05:44, Simon Glass wrote:
> Hi Michal,
> 
> On 16 July 2018 at 02:33, Michal Simek  wrote:
>> On 11.7.2018 22:13, Simon Glass wrote:
>>> Hi,
>>>
>>> On 11 July 2018 at 07:40, Tom Rini  wrote:

 On Wed, Jul 11, 2018 at 03:31:39PM +0200, Michal Simek wrote:
> On 11.7.2018 14:46, Tom Rini wrote:
>> On Wed, Jul 11, 2018 at 07:57:13AM +0200, Michal Simek wrote:
>>> On 10.7.2018 18:40, Tom Rini wrote:
 On Mon, Jul 09, 2018 at 11:59:57AM -0500, Joe Hershberger wrote:
> On Mon, Jul 9, 2018 at 9:43 AM, Tom Rini  wrote:
>> On Mon, Jul 09, 2018 at 08:19:44AM +0200, Michal Simek wrote:
>>> On 30.6.2018 06:19, Simon Glass wrote:
 On 27 June 2018 at 07:13, Michal Simek  
 wrote:
> On 22.6.2018 14:25, Jean-Jacques Hiblot wrote:
>> In some cases it can be useful to be able to bind a device to a 
>> driver from
>> the command line.
>> The obvious example is for versatile devices such as USB gadget.
>> Another use case is when the devices are not yet ready at 
>> startup and
>> require some setup before the drivers are bound (ex: FPGA which 
>> bitsream is
>> fetched from a mass storage or ethernet)
>>
>> usage example:
>>
>> bind usb_dev_generic 0 usb_ether
>> unbind usb_dev_generic 0 usb_ether
>> or
>> unbind eth 1
>>
>> bind /ocp/omap_dwc3@4838/usb@4839 usb_ether
>> unbind /ocp/omap_dwc3@4838/usb@4839
>>
>> Signed-off-by: Jean-Jacques Hiblot 
>>
>> ---
>>
>> Changes in v3:
>> - factorize code based on comments from ML
>> - remove the devices before unbinding them
>> - use device_find_global_by_ofnode() to get a device by its node.
>> - Added tests
>>
>> Changes in v2:
>> - Make the bind/unbind command generic, not specific to usb 
>> device.
>> - Update the API to be able to bind/unbind based on DTS node path
>> - Add a Kconfig option to select the bind/unbind commands
>>
>>  arch/sandbox/dts/test.dts  |  11 ++
>>  cmd/Kconfig|   9 ++
>>  cmd/Makefile   |   1 +
>>  cmd/bind.c | 255 
>> +
>>  configs/sandbox_defconfig  |   1 +
>>  test/py/tests/test_bind.py | 178 +++
>>  6 files changed, 455 insertions(+)
>>  create mode 100644 cmd/bind.c
>>  create mode 100644 test/py/tests/test_bind.py

 Reviewed-by: Simon Glass 

 Nice work

 [...]

>
> I have tested bind/unbind with dwc3 on zynqmp for ethernet gadget 
> and it
> is working fine for me.
> I have also tried to use bind/unbind for gpio zynqmp driver and 
> it is
> also working fine.
>
> It means
> Tested-by: Michal Simek 
>
> I would prefer if these commands are called as dm bind and dm 
> unbind
> instead of simply bind/unbind which should also fit to dm command
> description "dm - Driver model low level access".

 Yes i can see the point. But after thinking about it, maybe it is 
 best
 as it is? After all driver model is fundamental to U-Boot and it's 
 not
 clear what else we might bind/unbind.

 I'd like to get other opinions here, too.
>>>
>>> Tom/Marek: Any opinion?
>>
>> I think dm bind/unbind makes sense, yes.  "bind" and "unbind" are 
>> pretty
>> generic terms and making it clear it's part of working "inside" of 
>> DM to
>> hook/unhook things by making it a sub-command of dm sounds good.
>> Thanks!
>
> I agree with Simon here. I think bind and unbind won't have any
> plausible other meaning in U-Boot and DM is core to U-Boot
> functionality in the new world. I think it would be OK to have "dm
> bind" alias to "bind" if that's a point of confusion, but having it
> top-level seems good to me.

 They're still very generic words for something that's part of working
 under the dm framework.  That said, looking at test/dm/cmd_dm.c and 
 that
 it's supposed to be only for test/debug type work, yes, OK, I'll change
 my mind.
>>>
>>> I would expect that almost everybody wi

Re: [U-Boot] test: Add ut_assertnull macro

2018-07-20 Thread Tom Rini
On Thu, Jun 21, 2018 at 05:47:16PM +0300, Ramon Fried wrote:

> Add ut_assertnull macro to include/test/ut.h
> For testing of functions that returns NULL on errors.
> 
> Signed-off-by: Ramon Fried 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] hush: Remove default CONFIG_SYS_PROMPT_HUSH_PS2 setting from board files

2018-07-20 Thread Tom Rini
On Fri, Jun 22, 2018 at 08:13:10AM +0200, Michal Simek wrote:

> There is no reason to define default option for this macro which is
> already done in common/cli_hush.c.
> 
>   86 #ifndef CONFIG_SYS_PROMPT_HUSH_PS2
>   87 #define CONFIG_SYS_PROMPT_HUSH_PS2  "> "
>   88 #endif
> 
> Signed-off-by: Michal Simek 
> Reviewed-by: York Sun 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] cmd: fit_image: Add default property for FIT format scripts

2018-07-20 Thread Tom Rini
On Fri, Jun 22, 2018 at 02:58:02PM +, Alex Kiernan wrote:

> When sourcing a FIT format script, if we've not been told the unit name
> to use, look for a default property at the root of /images to work out
> which unit we should use.
> 
> Signed-off-by: Alex Kiernan 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 1/4] cmd: nvedit: rename flags in do_env_default

2018-07-20 Thread Tom Rini
On Sun, Jun 24, 2018 at 07:16:54PM +0300, Yaniv Levinsky wrote:

> The naming convention for flags in nvedit.c is:
> * The hashtable flag (defined in search.h) is named "env_flag"
> * The command flag argument (defined in command.h) is named "flag"
> 
> This convention is kept in functions like do_env_print(), do_env_set()
> and do_env_delete(), but not in do_env_default().
> 
> Rename the hashtable flag in do_env_default() from "flag" to "env_flag".
> Rename the command flag in do_env_default() from "__flag" to "flag".
> 
> No functional change.
> 
> Signed-off-by: Yaniv Levinsky 
> Reviewed-by: Igor Grinberg 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 4/4] env: common: accept flags on reset to default env

2018-07-20 Thread Tom Rini
On Sun, Jun 24, 2018 at 07:16:57PM +0300, Yaniv Levinsky wrote:

> The function set_default_env() sets the hashtable flags for import_r().
> Formally set_default_env() doesn't accept flags from its callers. In
> practice the caller can (un)set the H_INTERACTIVE flag, but it has to be
> done using the first character of the function's string argument. Other
> flags like H_FORCE can't be set by the caller.
> 
> Change the function to accept flags argument. The benefits are:
> 1. The caller will have to explicitly set the H_INTERACTIVE flag,
>instead of un-setting it using a special char in a string.
> 2. Add the ability to propagate flags from the caller to himport(),
>especially the H_FORCE flag from do_env_default() in nvedit.c that
>currently gets ignored for "env default -a -f" commands.
> 3. Flags and messages will not be coupled together. A caller will be
>able to set flags without passing a string and vice versa.
> 
> Please note:
> The propagation of H_FORCE from do_env_default() does not introduce any
> functional changes, because currently himport_r() is set to destroy the
> old environment regardless if H_FORCE flag is set or not. More changes
> are needed to utilize the propagation of H_FORCE.
> 
> Signed-off-by: Yaniv Levinsky 
> Acked-by: Igor Grinberg 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] gpio: omap_gpio: Convert to auto-alloc feature when DT is supported

2018-07-20 Thread Tom Rini
On Mon, Jun 25, 2018 at 10:31:35AM -0500, Adam Ford wrote:

> The omap_gpio driver has a TODO that says when every board is converted
> to DM and DT, the omap_gpio_bind can stop using calloc and switch
> to auto-alloc.
> 
> This patch converts this driver to auto-calloc when DT is enabled.
> 
> Signed-off-by: Adam Ford 
> 
> diff --git a/drivers/gpio/omap_gpio.c b/drivers/gpio/omap_gpio.c
> index 79a975ce71..651f6994e4 100644

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v4, 1/3] x86: Remove unused _relocate arguments

2018-07-20 Thread Tom Rini
On Thu, Jun 28, 2018 at 02:49:46PM -0700, Ivan Gorinov wrote:

> EFI image handle and system table are not used in _relocate().
> 
> Signed-off-by: Ivan Gorinov 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 2/4] cmd: nvedit: propagate envflag to set_default_vars

2018-07-20 Thread Tom Rini
On Sun, Jun 24, 2018 at 07:16:55PM +0300, Yaniv Levinsky wrote:

> The env_flag in do_env_default() doesn't get propagated and therefore
> gets ignored by himport_r(). This breaks to ability to "forcibly" reset
> variables to their default values using the environment command.
> 
> Scenario example of the problem:
>   # setenv kernel uImage
>   # setenv .flags kernel:so
>   # env default -f kernel
>   ## Error: Can't overwrite "kernel"
>   himport_r: can't insert "kernel=zImage" into hash table
> 
> Change the call path so it will pass the flag correctly.
> 
> Signed-off-by: Yaniv Levinsky 
> Acked-by: Igor Grinberg 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, u-boot, 2/2] boards: amlogic: Add FriendlyElec NanoPi K2 board support

2018-07-20 Thread Tom Rini
On Mon, Jun 25, 2018 at 04:50:17PM +0200, Neil Armstrong wrote:

> From: Thomas McKahan 
> 
> This adds platform code for the FriendlyElec NanoPi K2 board based on a
> Meson GXBB (S905) SoC with the Meson GXBB configuration.
> 
> This initial submission only supports:
> - UART
> - MMC/SDCard
> - Ethernet
> - Reset Controller
> - Clock controller
> 
> Cc: Yuefei Tan 
> Signed-off-by: Thomas McKahan 
> Signed-off-by: Neil Armstrong 

Applied to u-boot/master, thanks!  But please note:
CHECK: Alignment should match open parenthesis
#277: FILE: board/amlogic/nanopi-k2/nanopi-k2.c:48:
+   len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial,
+   EFUSE_SN_SIZE);

A follow-up when you're in these files next would be appreciated,
thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,v5,3/6] dts: db410c: added smem nodes

2018-07-20 Thread Tom Rini
On Mon, Jul 02, 2018 at 02:57:57AM +0300, Ramon Fried wrote:

> Added necessary nodes for Qualcomm smem driver.
> 
> Signed-off-by: Ramon Fried 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,u-boot] boards: amlogic: Fix boards README

2018-07-20 Thread Tom Rini
On Wed, Jun 27, 2018 at 05:19:02PM +0200, Neil Armstrong wrote:

> Fix typos and update the supported devices for all Amlogic boards.
> 
> Signed-off-by: Neil Armstrong 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 06/12] board/BuR/common: fix PMIC mpu-pll setup

2018-07-20 Thread Tom Rini
On Fri, Jul 06, 2018 at 03:41:23PM +0200, Hannes Schmelzer wrote:

> If a board-code calls the  pmicsetup(u32 mpupll) with a mpupll value
> != 0 it wants to force some frequency with the value provided by mpupll.
> Setting up 1 GHz is wrong here.
> 
> Nobody did take notice about that yet, since every board calls this
> function with zero.
> 
> Signed-off-by: Hannes Schmelzer 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,v5,1/6] dm: SMEM (Shared memory) uclass

2018-07-20 Thread Tom Rini
On Mon, Jul 02, 2018 at 02:57:55AM +0300, Ramon Fried wrote:

> This is a uclass for Shared memory manager drivers.
> 
> A Shared Memory Manager driver implements an interface for allocating
> and accessing items in the memory area shared among all of the
> processors.
> 
> Signed-off-by: Ramon Fried 
> 
> Reviewed-by: Simon Glass 
> Reviewed-by: Philipp Tomsich 

Applied to u-boot/master, thanks!  But please note that the series adds
a number of checkpatch style warnings, so a follow-up to address them
all would be appreciated.

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] mmc: stm32_sdmmc2: update pwron management

2018-07-20 Thread Tom Rini
On Wed, Jun 27, 2018 at 10:49:31AM +0200, Patrice Chotard wrote:

> From: Patrick Delaunay 
> 
> Correctly manage the SDMMC reset and card cycle power
> to fully handle the power cycle added in the MMC uclass
> and avoid issue with level-shifter with some uSDCARD.
> 
> 3 states managed in driver:
>   1/ reset: SDMMC disable, signal HiZ
>   2/ power-cycle: SDMMC disable, signals drive to 0
>   3/ power-on: SDMMC enabled
> 
> Signed-off-by: Patrick Delaunay 
> Signed-off-by: Patrice Chotard 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 3/4] cmd: nvedit: set H_INTERACTIVE in do_env_default

2018-07-20 Thread Tom Rini
On Sun, Jun 24, 2018 at 07:16:56PM +0300, Yaniv Levinsky wrote:

> The function set_default_vars() in common.c adds H_INTERACTIVE to the
> h_import() flag, but the function has no way of telling if the command
> actually was user directed like this flag suggest. The flag should be
> set by the calling function do_env_default() in nvedit.c instead, where
> the command is certainty user directed.
> 
> Move the H_INTERACTIVE flag from set_default_vars() to do_env_default().
> 
> Signed-off-by: Yaniv Levinsky 
> Acked-by: Igor Grinberg 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 01/12] board/BuR: drop devicetree loading and lcd setup for linux-targets

2018-07-20 Thread Tom Rini
On Fri, Jul 06, 2018 at 03:41:18PM +0200, Hannes Schmelzer wrote:

> This patch  drops the lcd-screen setup, the summary screen and getting
> mac-addresses based on a previous loaded device-tree for linux targets.
> Selecting those linux target is simple, since we have only the brppt1.
> 
> In detail we do:
> - drop the common lcd-setup code which relys on a fdt_blob
> - drop the common dtb loading mechanism
> - drop the now obsolete CONFIG_USE_FDT from board header and whitelist.
> 
> Signed-off-by: Hannes Schmelzer 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,v5,5/6] drivers: smem: sandbox

2018-07-20 Thread Tom Rini
On Mon, Jul 02, 2018 at 02:57:59AM +0300, Ramon Fried wrote:

> Add Sandbox driver for SMEM. mostly stub operations.
> 
> Signed-off-by: Ramon Fried 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v4, 2/3] arm: Remove unused _relocate arguments

2018-07-20 Thread Tom Rini
On Thu, Jun 28, 2018 at 02:50:04PM -0700, Ivan Gorinov wrote:

> EFI image handle and system table are not used in _relocate().
> 
> Signed-off-by: Ivan Gorinov 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] power: regulator: stpmu1: add power off delay

2018-07-20 Thread Tom Rini
On Wed, Jun 27, 2018 at 11:59:47AM +0200, Patrice Chotard wrote:

> From: Christophe Kerello 
> 
> This patch adds a delay when regulators are disabled.
> This delay is set to 5 ms to cover all use cases.
> The worst use case actually seen is during a SD card power cycle.
> 
> Signed-off-by: Christophe Kerello 
> Signed-off-by: Patrice Chotard 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 05/12] board/BuR/common: remove interface Label from summary screen

2018-07-20 Thread Tom Rini
On Fri, Jul 06, 2018 at 03:41:22PM +0200, Hannes Schmelzer wrote:

> This interface names may vary over different products, to consider this
> fact we replace the interface label "IF1" and "IF2" on the summary
> screen with some more generic wording "MAC1" and "MAC2".
> 
> Signed-off-by: Hannes Schmelzer 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, u-boot, 1/2] ARM: dts: sync meson-gxbb-nanopi-k2 from Linux 4.17

2018-07-20 Thread Tom Rini
On Mon, Jun 25, 2018 at 04:50:16PM +0200, Neil Armstrong wrote:

> Get the meson-gxbb-nanopi-k2.dts file from Linux 4.17.
> 
> Signed-off-by: Neil Armstrong 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,1/1] ARM: qemu-arm: enable RTC

2018-07-20 Thread Tom Rini
On Fri, Jun 29, 2018 at 12:34:16AM +0200, Heinrich Schuchardt wrote:

> QEMU provides an emulated ARM AMBA PrimeCell PL031 RTC.
> 
> The patch sets the base address in the board include file according to the
> definition in hw/arm/virt.c of the QEMU source. It defines the Kconfig
> option for the existing driver, and enables the RTC driver in
> qemu_arm64_defconfig and qemu_arm_defconfig as well as the date command.
> 
> We need an RTC to provide the GetTime() runtime service in the UEFI
> subsystem.
> 
> Signed-off-by: Heinrich Schuchardt 
> Reviewed-by: Tuomas Tynkkynen 
> Tested-by: Tuomas Tynkkynen 
> Signed-off-by: AKASHI Takahiro 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 1/6] drivers: rtc: resolve year 2038 problem in rtc_to_tm

2018-07-20 Thread Tom Rini
On Sat, Jul 07, 2018 at 11:39:11PM +0200, Heinrich Schuchardt wrote:

> Our implementation of rtc_to_tm() cannot handle dates of more than
> 0x7fff seconds after 1970-01-01.
> 
> Adopt the Linux kernel implementation.
> 
> Signed-off-by: Heinrich Schuchardt 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] phy: Be able to get phy from PHY provider

2018-07-20 Thread Tom Rini
On Wed, Jun 27, 2018 at 11:55:42AM +0200, Patrice Chotard wrote:

> In case of phy are provided from a PHY provider nodes as following:
> 
> usbphyc: usb-phy@5a006000 {
>   compatible = "st,stm32mp1-usbphyc";
>   reg = <0x5a006000 0x1000>;
>   clocks = <&rcc_clk USBPHY_K>;
>   resets = <&rcc_rst USBPHY_R>;
>   #address-cells = <1>;
>   #size-cells = <0>;
> 
>   usbphyc_port0: usb-phy@0 {
>   reg = <0>;
>   phy-supply = <&vdd_usb>;
>   vdda1v1-supply = <®11>;
>   vdda1v8-supply = <®18>
>   #phy-cells = <0>;
>   };
> 
>   usbphyc_port1: usb-phy@1 {
>   reg = <1>;
>   phy-supply = <&vdd_usb>;
>   vdda1v1-supply = <®11>;
>   vdda1v8-supply = <®18>
>   #phy-cells = <1>;
>   };
> };
> 
> and PHY are called as following:
> 
> usbh_ehci: usbh-ehci@5800d000 {
>   compatible = "generic-ehci";
>   reg = <0x5800d000 0x1000>;
>   clocks = <&rcc_clk USBH>;
>   resets = <&rcc_rst USBH_R>;
>   interrupts = ;
>   companion = <&usbh_ohci>;
>   phys = <&usbphyc_port0>;
>   phy-names = "usb";
>   status = "okay";
> };
> 
> generic_phy_get_by_index() must be updated to first look for
> PHY phandle as previously and in case of error looks for PHY
> provider by finding the parent's current node which is the PHY
> provider.
> args (ofnode_phandle_args struct) must also be updated by inserting
> the phy index into the PHY provider as args[0].
> 
> Signed-off-by: Patrice Chotard 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,1/2] spl: nor: Add FIT support

2018-07-20 Thread Tom Rini
On Tue, Jun 26, 2018 at 10:10:03AM -0700, York Sun wrote:

> Add support of loading FIT image from NOR flash.
> 
> Signed-off-by: York Sun 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] arm/arm64: bitops: fix find_next_zero_bit to be compat with arm64

2018-07-20 Thread Tom Rini
On Thu, Jun 28, 2018 at 02:25:52PM -0500, Grygorii Strashko wrote:

> Current implementation of find_next_zero_bit() is incompatible with arm64.
> Hence fix it by using BITS_PER_LONG define instead of constants and
> use generic ffz() implementation.
> 
> Signed-off-by: Grygorii Strashko 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 02/12] board/BuR/common: drop simple-framebuffer setup

2018-07-20 Thread Tom Rini
On Fri, Jul 06, 2018 at 03:41:19PM +0200, Hannes Schmelzer wrote:

> The linux systems running on the brppt1 targets are using modern DRM
> drivers since long time ago. Further we are going to drop the LCD
> support completely on this board, so the simple-framebuffer setup
> becomes obsolete.
> 
> Signed-off-by: Hannes Schmelzer 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 07/12] board/BuR/brppt1: drop dead code (CONFIG_SPL_OS_BOOT)

2018-07-20 Thread Tom Rini
On Fri, Jul 06, 2018 at 03:41:24PM +0200, Hannes Schmelzer wrote:

> The falcon mode was never used on this board, there is also no plan to
> use it. So drop this dead code.
> 
> Signed-off-by: Hannes Schmelzer 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,v5,4/6] dts: db820c: added smem nodes

2018-07-20 Thread Tom Rini
On Mon, Jul 02, 2018 at 02:57:58AM +0300, Ramon Fried wrote:

> Added necessary nodes for Qualcomm smem driver.
> 
> Signed-off-by: Ramon Fried 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 2/2] spl: nor: Skip CONFIG_SYS_FDT_BASE if not defined

2018-07-20 Thread Tom Rini
On Tue, Jun 26, 2018 at 10:10:04AM -0700, York Sun wrote:

> If FIT image is used, CONFIG_SYS_FDT_BASE is not needed.
> 
> Signed-off-by: York Sun 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 09/12] board/BuR/brppt1: implement more flexible boot process

2018-07-20 Thread Tom Rini
On Fri, Jul 06, 2018 at 03:41:26PM +0200, Hannes Schmelzer wrote:

> With this commit we do:
> 
> - set the bootdelay in all brppt1 defconfigs to 0, this makes
> development easier, since we can break into serial console.
> 
> - move CONFIG_BOOTCOMMAND from header file to defconfig
> 
> - introduce b_mode variable for selecting the final boot-target.
> This b_mode represents the boot-switch, which can found on most b&r
> targets. On the brppt1 this boot-switch is derived from some gpio and
> the bootcounter within the RTC block, making it so possible to force
> a boot-target (as example for repair-case).
> 
> - refactor the environment for booting new flexible way
> primary we want to get some bootscr.img within the mass-storage,
> this script then loads everything needed for the boot.
> For legacy reason we implement the t30lgcy#x boot targets, booting the
> already delivered linux-images.
> 
> - make space for the cfgscr within mtdparts on brppt1_nand
> 
> Signed-off-by: Hannes Schmelzer 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v5, 2/6] soc: qualcomm: Add Shared Memory Manager driver

2018-07-20 Thread Tom Rini
On Mon, Jul 02, 2018 at 02:57:56AM +0300, Ramon Fried wrote:

> The Shared Memory Manager driver implements an interface for allocating
> and accessing items in the memory area shared among all of the
> processors in a Qualcomm platform.
> 
> Adapted from the Linux driver (4.17)
> 
> Changes from the original Linux driver:
> * Removed HW spinlock mechanism, which is irrelevant
> in U-boot particualar use case, which is just reading from the smem.
> * Adapted from Linux driver model to U-Boot's.
> 
> Cc: Bjorn Andersson 
> Signed-off-by: Ramon Fried 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,v5,6/6] test: smem: add basic smem test

2018-07-20 Thread Tom Rini
On Mon, Jul 02, 2018 at 02:58:00AM +0300, Ramon Fried wrote:

> Add basic smem sandbox testing.
> 
> Signed-off-by: Ramon Fried 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 12/12] board/BuR/brppt1: add makerule for generating production files

2018-07-20 Thread Tom Rini
On Fri, Jul 06, 2018 at 03:41:29PM +0200, Hannes Schmelzer wrote:

> Signed-off-by: Hannes Schmelzer 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 03/12] board/BuR/common: make CONFIG_LCD optional

2018-07-20 Thread Tom Rini
On Fri, Jul 06, 2018 at 03:41:20PM +0200, Hannes Schmelzer wrote:

> Since we're going to drop LCD-support on brppt1 boards, we have to make
> this stuff here optional and remove the #error path.
> 
> We also move out the ft_board_setup(...) from this #ifdef because
> there's no relationship with the LCD-code and on the other hand this is
> still needed in future even with LCD-support off.
> 
> Signed-off-by: Hannes Schmelzer 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 2/2] dm: Change CMD_DM enabling

2018-07-20 Thread Michal Simek
CMD_DM is used for debug purpose and it shouldn't be enabled by default
via Kconfig. Unfortunately this is in the tree for quite a long time
that's why solution is to use imply DM for all targets which are
enabling DM.

Signed-off-by: Michal Simek 
---

Based on this discussion:
https://lists.denx.de/pipermail/u-boot/2018-July/334952.html

Done by:
for i in `git grep "select DM" | grep -v DM_ | cut -d ':' -f 1 | sort |
uniq`; do
sed -i 's/select DM$/select DM\n\timply CMD_DM/g' $i;
done

And checked by
for i in `ls configs/*`; do
NAME=`basename $i`; echo $NAME;
make $NAME;
make savedefconfig;
cp defconfig $i;
done

---
 arch/Kconfig   |  3 +++
 arch/arm/Kconfig   | 25 +
 arch/arm/mach-at91/Kconfig |  6 ++
 arch/arm/mach-imx/mx5/Kconfig  |  2 ++
 arch/arm/mach-imx/mx6/Kconfig  | 26 ++
 arch/arm/mach-imx/mx7/Kconfig  |  5 +
 arch/arm/mach-meson/Kconfig|  2 ++
 arch/arm/mach-omap2/am33xx/Kconfig | 18 ++
 arch/arm/mach-omap2/omap3/Kconfig  | 10 ++
 arch/arm/mach-rmobile/Kconfig.32   |  8 
 arch/arm/mach-tegra/Kconfig|  1 +
 arch/microblaze/Kconfig|  1 +
 arch/mips/Kconfig  |  6 ++
 arch/powerpc/cpu/mpc83xx/Kconfig   |  1 +
 cmd/Kconfig|  1 -
 15 files changed, 114 insertions(+), 1 deletion(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index dd5a8870017f..4b1265cb5331 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -49,6 +49,7 @@ config NIOS2
select SUPPORT_OF_CONTROL
select OF_CONTROL
select DM
+   imply CMD_DM
select CPU
 
 config PPC
@@ -67,6 +68,7 @@ config SANDBOX
select BOARD_LATE_INIT
select SUPPORT_OF_CONTROL
select DM
+   imply CMD_DM
select DM_KEYBOARD
select DM_SPI_FLASH
select DM_SERIAL
@@ -102,6 +104,7 @@ config X86
select SUPPORT_OF_CONTROL
select OF_CONTROL
select DM
+   imply CMD_DM
select DM_PCI
select PCI
select TIMER
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 64d58a624182..86c01afa58a3 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -436,6 +436,7 @@ config ARCH_MVEBU
select OF_CONTROL
select OF_SEPARATE
select DM
+   imply CMD_DM
select DM_ETH
select DM_SERIAL
select DM_SPI
@@ -493,6 +494,7 @@ config TARGET_STV0991
bool "Support stv0991"
select CPU_V7A
select DM
+   imply CMD_DM
select DM_SERIAL
select DM_SPI
select DM_SPI_FLASH
@@ -528,6 +530,7 @@ config TARGET_MX35PDK
 config ARCH_BCM283X
bool "Broadcom BCM283X family"
select DM
+   imply CMD_DM
select DM_SERIAL
select DM_GPIO
select OF_CONTROL
@@ -546,6 +549,7 @@ config ARCH_BCMSTB
bool "Broadcom BCM7XXX family"
select CPU_V7A
select DM
+   imply CMD_DM
select OF_CONTROL
select OF_PRIOR_STAGE
help
@@ -600,6 +604,7 @@ config TARGET_BCMNS2
 config ARCH_EXYNOS
bool "Samsung EXYNOS"
select DM
+   imply CMD_DM
select DM_I2C
select DM_SPI_FLASH
select DM_SERIAL
@@ -613,6 +618,7 @@ config ARCH_S5PC1XX
bool "Samsung S5PC1XX"
select CPU_V7A
select DM
+   imply CMD_DM
select DM_SERIAL
select DM_GPIO
select DM_I2C
@@ -625,6 +631,7 @@ config ARCH_HIGHBANK
 config ARCH_INTEGRATOR
bool "ARM Ltd. Integrator family"
select DM
+   imply CMD_DM
select DM_SERIAL
select PL01X_SERIAL
 
@@ -659,6 +666,7 @@ config ARCH_MX8M
bool "NXP i.MX8M platform"
select ARM64
select DM
+   imply CMD_DM
select SUPPORT_SPL
 
 config ARCH_MX23
@@ -722,12 +730,14 @@ config ARCH_OWL
bool "Actions Semi OWL SoCs"
select ARM64
select DM
+   imply CMD_DM
select DM_SERIAL
select OF_CONTROL
 
 config ARCH_QEMU
bool "QEMU Virtual Platform"
select DM
+   imply CMD_DM
select DM_SERIAL
select OF_CONTROL
select PL01X_SERIAL
@@ -735,6 +745,7 @@ config ARCH_QEMU
 config ARCH_RMOBILE
bool "Renesas ARM SoCs"
select DM
+   imply CMD_DM
select DM_SERIAL
select BOARD_EARLY_INIT_F
imply FAT_WRITE
@@ -749,6 +760,7 @@ config ARCH_SNAPDRAGON
bool "Qualcomm Snapdragon SoCs"
select ARM64
select DM
+   imply CMD_DM
select DM_GPIO
select DM_SERIAL
select SPMI
@@ -761,6 +773,7 @@ config ARCH_SOCFPGA
select ARCH_MISC_INIT
select CPU_V7A if TARGET_SOCFPGA_GEN5 || TARGET_SOCFPGA_ARRIA10
select DM
+   imply CMD_DM
select DM_SERIAL
select ENABLE_ARM_SOC_BOOT0_HOOK if TARGET_SOCFPGA_GEN5 || 
TARGET_SOCFPGA_ARRIA10
  

[U-Boot] [PATCH] ARM: uniphier: enable distro boot

2018-07-20 Thread Masahiro Yamada
Switch to the distro boot for UniPhier platform.

 - Remove the environment vairalbes used to load images from raw
   block devices.

 - Keep the command to download images via tftp.  This will be
   useful to boot the kernel when no valid kernel image is ready
   yet in the file system.

 - Use root.cpio.gz instead of root.cpio.uboot because we always know
   the file size of the init ramdisk; it is loaded via either a file
   system or network.

 - Rename fit_addr_r to kernel_addr_r, which the distro command
   checks to get the load address of FIT image.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/Kconfig |  1 +
 arch/arm/mach-uniphier/board_late_init.c |  8 +--
 doc/README.uniphier  | 55 +
 include/configs/uniphier.h   | 84 +++-
 4 files changed, 100 insertions(+), 48 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 5b3746c..56956c7 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1231,6 +1231,7 @@ config ARCH_UNIPHIER
select SPL_OF_CONTROL if SPL
select SPL_PINCTRL if SPL
select SUPPORT_SPL
+   imply DISTRO_DEFAULTS
imply FAT_WRITE
help
  Support for UniPhier SoC family developed by Socionext Inc.
diff --git a/arch/arm/mach-uniphier/board_late_init.c 
b/arch/arm/mach-uniphier/board_late_init.c
index 6a99572..8ffb9a8 100644
--- a/arch/arm/mach-uniphier/board_late_init.c
+++ b/arch/arm/mach-uniphier/board_late_init.c
@@ -66,20 +66,20 @@ int board_late_init(void)
switch (uniphier_boot_device_raw()) {
case BOOT_DEVICE_MMC1:
printf("eMMC Boot");
-   env_set("bootmode", "emmcboot");
+   env_set("bootcmd", "run bootcmd_mmc0; run distro_bootcmd");
break;
case BOOT_DEVICE_NAND:
printf("NAND Boot");
-   env_set("bootmode", "nandboot");
+   env_set("bootcmd", "run bootcmd_ubifs0; run distro_bootcmd");
nand_denali_wp_disable();
break;
case BOOT_DEVICE_NOR:
printf("NOR Boot");
-   env_set("bootmode", "norboot");
+   env_set("bootcmd", "run tftpboot; run distro_bootcmd");
break;
case BOOT_DEVICE_USB:
printf("USB Boot");
-   env_set("bootmode", "usbboot");
+   env_set("bootcmd", "run bootcmd_usb0; run distro_bootcmd");
break;
default:
printf("Unknown");
diff --git a/doc/README.uniphier b/doc/README.uniphier
index 990806a..badfacd 100644
--- a/doc/README.uniphier
+++ b/doc/README.uniphier
@@ -332,6 +332,61 @@ for kernel, DTB, and Init ramdisk.
 If they are not displayed, the Verified Boot is not working.
 
 
+Deployment for Distro Boot
+--
+
+UniPhier SoC family boot the kernel in a generic manner as described in
+doc/README.distro .
+
+To boot the kernel, you need to deploy necesssary components to a file
+system on one of your block devices (eMMC, NAND, USB drive, etc.).
+
+The components depend on the kernel image format.
+
+[1] Bare images
+
+  - kernel
+  - init ramdisk
+  - device tree blob
+  - boot configuration file (extlinux.conf)
+
+Here is an exmple of the configuration file.
+
+>8
+menu title UniPhier Boot Options.
+
+timeout 50
+default UniPhier
+
+label UniPhier
+  kernel ../Image
+  initrd ../rootfs.cpio.gz
+  fdtdir ..
+>8
+
+Then, write 'Image', 'rootfs.cpio.gz', 'uniphier-ld20-ref.dtb' (DTB depends on
+your board), and 'extlinux/extlinux.conf' to the file system.
+
+[2] FIT
+
+  - FIT blob
+  - boot configuration file (extlinux.conf)
+
+>8
+menu title UniPhier Boot Options.
+
+timeout 50
+default UniPhier
+
+label UniPhier
+  kernel ../fitImage
+>8
+
+Since the init ramdisk and DTB are contained in the FIT blob,
+you do not need to describe them in the configuration file.
+Write 'fitImage' and 'extlinux/extlinux.conf' to the file system.
+
+
 UniPhier specific commands
 --
 
diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h
index b631f79..3c46a6e 100644
--- a/include/configs/uniphier.h
+++ b/include/configs/uniphier.h
@@ -10,6 +10,35 @@
 #ifndef __CONFIG_UNIPHIER_COMMON_H__
 #define __CONFIG_UNIPHIER_COMMON_H__
 
+#ifndef CONFIG_SPL_BUILD
+#include 
+
+#ifdef CONFIG_CMD_MMC
+#define BOOT_TARGET_DEVICE_MMC(func)   func(MMC, mmc, 0) func(MMC, mmc, 1)
+#else
+#define BOOT_TARGET_DEVICE_MMC(func)
+#endif
+
+#ifdef CONFIG_CMD_UBIFS
+#define BOOT_TARGET_DEVICE_UBIFS(func) func(UBIFS, ubifs, 0)
+#else
+#define BOOT_TARGET_DEVICE_UBIFS(func)
+#endif
+
+#ifdef CONFIG_CMD_USB
+#define BOOT_TARGET_DEVICE_USB(func)   func(USB, usb, 0)
+#else
+#define BOOT_TARGET_DEVICE_USB(func)
+#endif
+

Re: [U-Boot] [U-Boot, 10/12] dts: am33xx: add u-boot, dm-spl to ocp bus

2018-07-20 Thread Tom Rini
On Fri, Jul 06, 2018 at 03:41:27PM +0200, Hannes Schmelzer wrote:

> This is needed for having access to the devices below this bus, most
> important is uart and boot-device (spi, mmc, ...) in SPL stage.
> 
> Signed-off-by: Hannes Schmelzer 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v4, 3/3] riscv: Remove unused _relocate arguments

2018-07-20 Thread Tom Rini
On Thu, Jun 28, 2018 at 02:50:17PM -0700, Ivan Gorinov wrote:

> EFI image handle and system table are not used in _relocate().
> 
> Signed-off-by: Ivan Gorinov 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 08/12] board/BuR/common: refactor ft_board_setup(...)

2018-07-20 Thread Tom Rini
On Fri, Jul 06, 2018 at 03:41:25PM +0200, Hannes Schmelzer wrote:

> On other OS, not one provided by B&R, it is not guaranteed that there
> are factory-settings within a devicetree. So we must not treat the
> absence of them as error.
> Further we've the fact that on different version of the device-tree
> files there are different namings of the factory-settings, we consider
> this with searching for an alternative name.
> 
> changing things as following:
> 
> - don't treat as error if the bootloader version cannot written into
> devicetree.
> 
> - since the naming of the factory-settings are different in different
> versions of the provided device-tree we search for the alternate name
> "/fset"
> 
> Signed-off-by: Hannes Schmelzer 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,04/12] board/BuR/brppt1: drop LCD-support

2018-07-20 Thread Tom Rini
On Fri, Jul 06, 2018 at 03:41:21PM +0200, Hannes Schmelzer wrote:

> On this linux target long time ago the OS is using DRM driver for
> handling video output, the pre initialization of u-boot and the display
> summary screen is obsolete. With this patch we drop the LCD-support from
> thisd board.
> 
> Signed-off-by: Hannes Schmelzer 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 11/12] board/BuR/brppt1: convert brppt1 boards to driver model

2018-07-20 Thread Tom Rini
On Fri, Jul 06, 2018 at 03:41:28PM +0200, Hannes Schmelzer wrote:

> - add a devicetree for each variant (mmc, spi, nand)
> - drop unneeded code from board and bur/common
> - drop unneeded stuff from config header files
> - minor adaptions to be compliant with driver model (requesting gpio,..)
> - harmonize the commandset over all brppt1 targets
> 
> Signed-off-by: Hannes Schmelzer 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] common: Log should depends on DM not be selected by DM

2018-07-20 Thread Tom Rini
On Fri, Jul 20, 2018 at 02:05:06PM +0200, Michal Simek wrote:

> Better use depends on instead of select.
> 
> Signed-off-by: Michal Simek 

Reviewed-by: Tom Rini 

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] dm: Change CMD_DM enabling

2018-07-20 Thread Tom Rini
On Fri, Jul 20, 2018 at 02:05:07PM +0200, Michal Simek wrote:

> CMD_DM is used for debug purpose and it shouldn't be enabled by default
> via Kconfig. Unfortunately this is in the tree for quite a long time
> that's why solution is to use imply DM for all targets which are
> enabling DM.
> 
> Signed-off-by: Michal Simek 
> ---
> 
> Based on this discussion:
> https://lists.denx.de/pipermail/u-boot/2018-July/334952.html
> 
> Done by:
> for i in `git grep "select DM" | grep -v DM_ | cut -d ':' -f 1 | sort |
> uniq`; do
>   sed -i 's/select DM$/select DM\n\timply CMD_DM/g' $i;
> done

OK, I'm glad you did this, but now the (mostly) sorted lists are
un-sorted.  Please update to keep them alphabetically sorted, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, u-boot, 2/2] boards: amlogic: Add FriendlyElec NanoPi K2 board support

2018-07-20 Thread Neil Armstrong
Hi Tom,

On 20/07/2018 14:35, Tom Rini wrote:
> On Mon, Jun 25, 2018 at 04:50:17PM +0200, Neil Armstrong wrote:
> 
>> From: Thomas McKahan 
>>
>> This adds platform code for the FriendlyElec NanoPi K2 board based on a
>> Meson GXBB (S905) SoC with the Meson GXBB configuration.
>>
>> This initial submission only supports:
>> - UART
>> - MMC/SDCard
>> - Ethernet
>> - Reset Controller
>> - Clock controller
>>
>> Cc: Yuefei Tan 
>> Signed-off-by: Thomas McKahan 
>> Signed-off-by: Neil Armstrong 
> 
> Applied to u-boot/master, thanks!  But please note:
> CHECK: Alignment should match open parenthesis
> #277: FILE: board/amlogic/nanopi-k2/nanopi-k2.c:48:
> +   len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial,
> +   EFUSE_SN_SIZE);
> 
> A follow-up when you're in these files next would be appreciated,
> thanks!
> 


Ok, I need to do a cleanup of all these boards anyway, will fix this in the 
same time.

thanks,
Neil



signature.asc
Description: OpenPGP digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] board/imgtec/boston: Add new defconfigs to the MAINTAINERS list

2018-07-20 Thread Tom Rini
Signed-off-by: Tom Rini 
---
 board/imgtec/boston/MAINTAINERS | 4 
 1 file changed, 4 insertions(+)

diff --git a/board/imgtec/boston/MAINTAINERS b/board/imgtec/boston/MAINTAINERS
index 81f067d6907b..07f6156ffcbe 100644
--- a/board/imgtec/boston/MAINTAINERS
+++ b/board/imgtec/boston/MAINTAINERS
@@ -5,5 +5,9 @@ F:  board/imgtec/boston/
 F: include/configs/boston.h
 F: configs/boston32r2_defconfig
 F: configs/boston32r2el_defconfig
+F: configs/boston32r6_defconfig
+F: configs/boston32r6el_defconfig
 F: configs/boston64r2_defconfig
 F: configs/boston64r2el_defconfig
+F: configs/boston64r6_defconfig
+F: configs/boston64r6el_defconfig
-- 
2.7.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [RFC PATCH v3 2/2] disk: part: Remove redundant error message

2018-07-20 Thread Sam Protsenko
On Fri, Jul 20, 2018 at 1:53 AM, Tom Rini  wrote:
> On Fri, Jul 20, 2018 at 01:28:43AM +0300, Sam Protsenko wrote:
>
>> Underlying API should already print some meaningful error message, so
>> this one is just brings more noise. E.g. we can see log like this:
>>
>> MMC: no card present
>> ** Bad device mmc 0 **
>>
>> Obviously, second error message is unwanted. Let's remove it to make log
>> more short and clear.
>>
>> Signed-off-by: Sam Protsenko 
>> ---
>>  disk/part.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/disk/part.c b/disk/part.c
>> index 9266a09ec3..0762a0750f 100644
>> --- a/disk/part.c
>> +++ b/disk/part.c
>> @@ -400,7 +400,6 @@ int blk_get_device_by_str(const char *ifname, const char 
>> *dev_hwpart_str,
>>
>>   *dev_desc = get_dev_hwpart(ifname, dev, hwpart);
>>   if (!(*dev_desc) || ((*dev_desc)->type == DEV_TYPE_UNKNOWN)) {
>> - printf("** Bad device %s %s **\n", ifname, dev_hwpart_str);
>>   dev = -ENOENT;
>>   goto cleanup;
>>   }
>
> We should move this to debug() I think.
>

Yes, better to use debug() than remove it completely, thanks. So, if
there is no further objections, I'm gonna set real patch series soon.

> --
> Tom
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 0/2] env: Make environment loading log more clear

2018-07-20 Thread Sam Protsenko
This patch series intended to make boot log better. Basically here we
just remove unwanted error messages, relying on the message from most
deep API to be printed (like mmc subsystem). At the moment this looks
like most clean solution to cluttered log problem, as any other solution
will be hackish.

With this patch set applied we will see something like this:

Loading Environment from FAT... MMC: no card present
Loading Environment from MMC... OK

instead of:

Loading Environment from FAT... MMC: no card present
** Bad device mmc 0 **
Failed (-5)
Loading Environment from MMC... OK


Sam Protsenko (2):
  env: Don't print "Failed" error message
  disk: part: Remove redundant error message

 disk/part.c | 2 +-
 env/env.c   | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

-- 
2.18.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 2/2] disk: part: Don't show redundant error message

2018-07-20 Thread Sam Protsenko
Underlying API should already print some meaningful error message, so
this one is just brings more noise. E.g. we can see log like this:

MMC: no card present
** Bad device mmc 0 **

Obviously, second error message is unwanted. Let's only print it in case
when DEBUG is defined to keep log short and clear.

Signed-off-by: Sam Protsenko 
---
 disk/part.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/disk/part.c b/disk/part.c
index 9266a09ec3..9e457a6e72 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -400,7 +400,7 @@ int blk_get_device_by_str(const char *ifname, const char 
*dev_hwpart_str,
 
*dev_desc = get_dev_hwpart(ifname, dev, hwpart);
if (!(*dev_desc) || ((*dev_desc)->type == DEV_TYPE_UNKNOWN)) {
-   printf("** Bad device %s %s **\n", ifname, dev_hwpart_str);
+   debug("** Bad device %s %s **\n", ifname, dev_hwpart_str);
dev = -ENOENT;
goto cleanup;
}
-- 
2.18.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 1/2] env: Don't print "Failed" error message

2018-07-20 Thread Sam Protsenko
"Failed" error message from env_load() only clutters the log with
unnecessary details, as we already have all needed warnings by that
time. Example:

Loading Environment from FAT... MMC: no card present
** Bad device mmc 0 **
Failed (-5)

Remove this "Failed" message to keep log short and clear.

Signed-off-by: Sam Protsenko 
---
 env/env.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/env/env.c b/env/env.c
index 5c0842ac07..3ab4ec4237 100644
--- a/env/env.c
+++ b/env/env.c
@@ -196,9 +196,7 @@ int env_load(void)
 
printf("Loading Environment from %s... ", drv->name);
ret = drv->load();
-   if (ret)
-   printf("Failed (%d)\n", ret);
-   else
+   if (!ret)
printf("OK\n");
 
if (!ret)
-- 
2.18.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] configs: imx6q_logic: Cleanup ramdiskaddr and fdtaddr

2018-07-20 Thread Adam Ford
There are already definitions for ramdisk_addr_r and fdt_addr_r, so
having a duplicate copy called ramdiskaddr and fdtaddr is confusing.
This patch converts any references to ramdisk_addr_r and fdt_addr_r
and removes the duplicates.

Signed-off-by: Adam Ford 

diff --git a/include/configs/imx6_logic.h b/include/configs/imx6_logic.h
index c6a7a609be..f94e27fe09 100644
--- a/include/configs/imx6_logic.h
+++ b/include/configs/imx6_logic.h
@@ -35,10 +35,8 @@
"script=boot.scr\0" \
"image=zImage\0" \
"bootm_size=0x1000\0" \
-   "fdt_addr_r=0x1800\0" \
-   "fdt_addr=0x1800\0" \
-   "ramdisk_addr_r=0x1300\0" \
-   "ramdiskaddr=0x1300\0" \
+   "fdt_addr_r=0x1300\0" \
+   "ramdisk_addr_r=0x1400\0" \
"kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
"ramdisk_file=rootfs.cpio.uboot\0" \
"boot_fdt=try\0" \
@@ -60,25 +58,25 @@
" source\0" \
"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image};" \
" setenv kernelsize ${filesize}\0" \
-   "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
-   "loadramdisk=fatload mmc ${mmcdev}:${mmcpart} ${ramdiskaddr}" \
+   "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdt_file}\0" \
+   "loadramdisk=fatload mmc ${mmcdev}:${mmcpart} ${ramdisk_addr_r}" \
" ${ramdisk_file}; setenv ramdisksize ${filesize}\0" \
"mmcboot=echo Booting from mmc...; run mmcargs; run loadimage;" \
-   " run loadfdt; bootz ${loadaddr} - ${fdt_addr}\0" \
+   " run loadfdt; bootz ${loadaddr} - ${fdt_addr_r}\0" \
"mmcramboot=run ramargs; run loadimage;" \
" run loadfdt; run loadramdisk;" \
-   " bootz ${loadaddr} ${ramdiskaddr} ${fdt_addr}\0" \
+   " bootz ${loadaddr} ${ramdisk_addr_r} ${fdt_addr_r}\0" \
"nandboot=echo Booting from nand ...; " \
" run nandargs;" \
" nand read ${loadaddr} kernel ${kernelsize};" \
" nand read ${fdt_addr} dtb;" \
" bootz ${loadaddr} - ${fdt_addr}\0" \
"nandramboot=echo Booting RAMdisk from nand ...; " \
-   " nand read ${ramdiskaddr} fs ${ramdisksize};" \
+   " nand read ${ramdisk_addr_r} fs ${ramdisksize};" \
" nand read ${loadaddr} kernel ${kernelsize};" \
-   " nand read ${fdt_addr} dtb;" \
+   " nand read ${fdt_addr_r} dtb;" \
" run ramargs;" \
-   " bootz ${loadaddr} ${ramdiskaddr} ${fdt_addr}\0" \
+   " bootz ${loadaddr} ${ramdisk_addr_r} ${fdt_addr_r}\0" \
"netargs=setenv bootargs console=${console},${baudrate} " \
"root=/dev/nfs" \
" ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
-- 
2.17.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [RFC PATCH v3 0/2] env: Make environment loading log more clear

2018-07-20 Thread Wolfgang Denk
Dear Sam,

In message <20180719222843.28316-1-semen.protse...@linaro.org> you wrote:
>
>  1. With no "Failed" message, at some point we *can* end up with no
> error messages printed at all

That would mean that we did not check the whole call tree as needed.
It is not that complicated, or is it?

>  2. Removing some collateral error messages *may* lead to loss of useful
> debug info in other use-cases (env_load() is not only user of those
> APIs).

I dislike the "can" and "may" parts here.  If this is done
thoroughly, we should know exactly that no such damage gets done.

As I mentioend before: if we get here, somewhere an error must have
occurred.  And in the error handling an error message (one) must be
printed.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Software entities are more complex for their size  than  perhaps  any
other human construct because no two parts are alike. If they are, we
make  the  two  similar parts into a subroutine -- open or closed. In
this respect, software  systems  differ  profoundly  from  computers,
buildings, or automobiles, where repeated elements abound.
   - Fred Brooks, Jr.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] env: Don't print "Failed" error message

2018-07-20 Thread Wolfgang Denk
Dear Sam,

In message <20180720131421.7136-2-semen.protse...@linaro.org> you wrote:
>
> + if (!ret)
>   printf("OK\n");
>  
>   if (!ret)

Now we have two "if (!ret)" in sequence.  Make this one block,
please.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Commitment, n.:  Commitment can be illustrated by a breakfast
of ham and eggs. The chicken was involved, the pig was committed.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 3/4] dm: led: move default state support in led uclass

2018-07-20 Thread Tom Rini
On Fri, Jul 13, 2018 at 05:21:10PM +0200, Patrick Delaunay wrote:

> This patch save common LED property "default-state" value
> in post bind of LED uclass.
> The configuration for this default state is only performed when
> led_default_state() is called;
> It can be called in your board_init()
> or it could added in init_sequence_r[] in future.
> 
> Signed-off-by: Patrick Delaunay 
> Reviewed-by: Simon Glass 

Making the change like this breaks (and leaves broken) the default state
test in test/dm/led.c so 'make tests' fails.  Please rework the series
to include fixing the test, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 3/3] rockchip: rk3399: Add more instructions to the README

2018-07-20 Thread Ezequiel Garcia
On Wed, 2018-07-18 at 19:32 -0600, Simon Glass wrote:
> On 16 July 2018 at 13:41, Ezequiel Garcia  wrote:
> > This commit adds a content section and also instructions
> > on how to create a bootable SD/MMC device for RK3399 boards.
> > 
> > Signed-off-by: Ezequiel Garcia 
> > ---
> >  board/rockchip/evb_rk3399/README | 55 ++--
> >  1 file changed, 53 insertions(+), 2 deletions(-)
> 
> Reviewed-by: Simon Glass 
> 
> Hmm, we should convert all of rockchip to use binman I think.
> 

Yeah, that would be sweet.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 11/20] w1: enumerate sandbox driver if configured

2018-07-20 Thread Lukasz Majewski
Hi Eugen,

Thanks for (re-)bringing the One wire support to u-boot.

> Add a sandbox eeprom on the bus as a device, if sandbox driver is
> configured.
> 
> Signed-off-by: Eugen Hristev 
> ---
>  drivers/w1/w1-uclass.c | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/w1/w1-uclass.c b/drivers/w1/w1-uclass.c
> index cfddda3..e58c1ca 100644
> --- a/drivers/w1/w1-uclass.c
> +++ b/drivers/w1/w1-uclass.c
> @@ -142,6 +142,11 @@ static int w1_enumerate(struct udevice *bus)
>   }
>   }
>  
> +#ifdef CONFIG_W1_EEPROM_SANDBOX
> + /* before we are finished, add a sandbox device if we can */
> + w1_new_device(bus, W1_FAMILY_EEP_SANDBOX);
> +#endif

IMHO we shouldn't mix the sandbox code with production (on boards) code.

Maybe Simon (+CCed) could provide some more input here?

> +
>   return 0;
>  }
>  




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de


pgp7i9TL8ZQY1.pgp
Description: OpenPGP digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: mx6ul: Apply ERR011115 errata workaround

2018-07-20 Thread Sébastien Szymanski
Hi,

On 07/19/2018 01:37 PM, Marcin Niestroj wrote:
> ERR05 in IMX6UL errata says to use OCRAM memory above
> 0x908000 (instead of 0x907000) for silicon revision 1.2 shipped
> prior date code 1740.
> 
> As we cannot check affected targets in runtime, apply that
> workaround by default for all IMX6UL platforms. Leave possibility
> to disable that workaround for non-affected targets, so more OCRAM
> area can be used by SPL (e.g. for featureful SPL images).
> 
> Signed-off-by: Marcin Niestroj 
> ---
>  arch/arm/mach-imx/mx6/Kconfig |  9 +
>  include/configs/imx6_spl.h| 11 +--
>  2 files changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
> index 521fad74b5..61708a0526 100644
> --- a/arch/arm/mach-imx/mx6/Kconfig
> +++ b/arch/arm/mach-imx/mx6/Kconfig
> @@ -58,6 +58,15 @@ config MX6UL
>   select SYSCOUNTER_TIMER
>   bool
>  
> +config MX6UL_ERR05
> + bool "Workaround for ERR05 in IMX6UL Errata"
> + depends on MX6UL
> + default MX6UL
> + help
> +   Say N here if you are sure that your platform is not affected
> +   with ERR05. Doing so might be useful in case of featureful
> +   (big) SPL images.
> +
>  config MX6UL_LITESOM
>   bool
>   select MX6UL
> diff --git a/include/configs/imx6_spl.h b/include/configs/imx6_spl.h
> index 720ff045a7..42d12c7503 100644
> --- a/include/configs/imx6_spl.h
> +++ b/include/configs/imx6_spl.h
> @@ -19,16 +19,23 @@
>   *which consists of a 4K header in front of us that contains the IVT, DCD
>   *and some padding thus 'our' max size is really 0x00908000 - 0x00918000
>   *or 64KB
> + *  - Use 0x00909000 as start of OCRAM Free Area as a workaround for
> + *ERR05 in IMX6UL Errata
>   */
> +#ifdef CONFIG_MX6UL_ERR05
> +#define CONFIG_SPL_TEXT_BASE 0x00909000
> +#else
>  #define CONFIG_SPL_TEXT_BASE 0x00908000
> -#define CONFIG_SPL_MAX_SIZE  0x1
> +#endif
> +
> +#define CONFIG_SPL_MAX_SIZE  (0x00918000 - CONFIG_SPL_TEXT_BASE)
>  #define CONFIG_SPL_STACK 0x0091FFB8
>  /*
>   * Pad SPL to 68KB (4KB header + 64KB max size). This allows to write the
>   * SPL/U-Boot combination generated with u-boot-with-spl.imx directly to a
>   * boot media (given that boot media specific offset is configured properly).
>   */
> -#define CONFIG_SPL_PAD_TO0x11000
> +#define CONFIG_SPL_PAD_TO(CONFIG_SPL_MAX_SIZE + 0x1000)

I got the following error when building the u-boot-with-spl.imx file:

/home/sszy/development/armadeus-git-opos6ul/buildroot/output/host/usr/bin/arm-linux-gnueabihf-objcopy:
--pad-to: bad number: (CONFIG_SPL_MAX_SIZE + 0x1000)

Anyway, this is wrong and will break the u-boot-with-spl.imx for MMC/SD
boot device.

The default offset for the U-Boot image on MMC/SD boot device is 69KB
(see SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR) so I think CONFIG_SPL_PAD_TO
should always be 0x11000 (== 68KB).

Regards,

>  
>  /* MMC support */
>  #if defined(CONFIG_SPL_MMC_SUPPORT)
> 


-- 
Sébastien Szymanski
Software engineer, Armadeus Systems
Tel: +33 (0)9 72 29 41 44
Fax: +33 (0)9 72 28 79 26
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 04/20] W1-EEPROM: Add an W1-EEPROM uclass for 1 wire EEPROMs

2018-07-20 Thread Maxime Ripard
Hi Eugen,

Thanks for giving those patches another shot.

On Thu, Jul 19, 2018 at 12:57:52PM +0300, Eugen Hristev wrote:
> From: Maxime Ripard 
> 
> We might want to access data stored onto one wire EEPROMs.
> Create a framework to provide a consistent API.
> 
> Signed-off-by: Maxime Ripard 
> [eugen.hris...@microchip.com: reworked patch]
> Signed-off-by: Eugen Hristev 
> ---
>  drivers/Kconfig  |  2 ++
>  drivers/Makefile |  1 +
>  drivers/w1-eeprom/Kconfig| 17 +++
>  drivers/w1-eeprom/Makefile   |  2 ++
>  drivers/w1-eeprom/w1-eeprom-uclass.c | 56 
> 
>  include/dm/uclass-id.h   |  1 +
>  include/w1-eeprom.h  | 28 ++
>  7 files changed, 107 insertions(+)
>  create mode 04 drivers/w1-eeprom
>  create mode 100644 drivers/w1-eeprom/Kconfig
>  create mode 100644 drivers/w1-eeprom/Makefile
>  create mode 100644 drivers/w1-eeprom/w1-eeprom-uclass.c
>  create mode 100644 include/w1-eeprom.h

I believe that we shouldn't have a framework solely for 1-wire
EEPROMs, but for EEPROMs, connected to any bus.

The 1-Wire EEPROMs all behave pretty much the same, so we'll probably
only see a single driver within that framework. And at the same time,
we'll want to have a consistent interface to access all the EEPROMs,
no matter on which bus they sit on.

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [RFC PATCH v3 0/2] env: Make environment loading log more clear

2018-07-20 Thread Sam Protsenko
On Fri, Jul 20, 2018 at 4:27 PM, Wolfgang Denk  wrote:
> Dear Sam,
>
> In message <20180719222843.28316-1-semen.protse...@linaro.org> you wrote:
>>
>>  1. With no "Failed" message, at some point we *can* end up with no
>> error messages printed at all
>
> That would mean that we did not check the whole call tree as needed.
> It is not that complicated, or is it?
>

I've checked the error chain for FAT/MMC env load: [1]. As for the
rest of possible sources, frankly I didn't check, as I don't have such
boards at my disposal anyway, and I may not be aware of all sources we
have. That's why I've only corrected the path for loading from FAT,
which I can test and can argue it's working right. I will add the
comment in env_load() saying that error message must be printed from
underlying subsystem, and it should be exactly one error. If we catch
any related issues further, we can check it on the sport. I hope
you're ok with this approach, as fixing all possible error cases for
all possible sources in at once seems to be too complex task. And some
further messages can appear further, if someone would manage to get
such a patch merged. So let's start with clear requirement in
env_load().

[1] https://pastebin.com/q6kgpprb

>>  2. Removing some collateral error messages *may* lead to loss of useful
>> debug info in other use-cases (env_load() is not only user of those
>> APIs).
>
> I dislike the "can" and "may" parts here.  If this is done
> thoroughly, we should know exactly that no such damage gets done.
>

Agree. Also, I like Tom's suggestion to move those to debug() instead
of removing.

> As I mentioend before: if we get here, somewhere an error must have
> occurred.  And in the error handling an error message (one) must be
> printed.
>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
> Software entities are more complex for their size  than  perhaps  any
> other human construct because no two parts are alike. If they are, we
> make  the  two  similar parts into a subroutine -- open or closed. In
> this respect, software  systems  differ  profoundly  from  computers,
> buildings, or automobiles, where repeated elements abound.
>- Fred Brooks, Jr.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] env: Don't print "Failed" error message

2018-07-20 Thread Sam Protsenko
On Fri, Jul 20, 2018 at 4:29 PM, Wolfgang Denk  wrote:
> Dear Sam,
>
> In message <20180720131421.7136-2-semen.protse...@linaro.org> you wrote:
>>
>> + if (!ret)
>>   printf("OK\n");
>>
>>   if (!ret)
>
> Now we have two "if (!ret)" in sequence.  Make this one block,
> please.
>

Good point. Will do in v2, thanks.

> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
> Commitment, n.:  Commitment can be illustrated by a breakfast
> of ham and eggs. The chicken was involved, the pig was committed.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] smartweb: use SPL_TINY_MEMSET

2018-07-20 Thread Philipp Tomsich
The SPL code for smartweb is close to its limit and adding a few extra
instructions to SPL will cause it to overrun its sram allotement (thus
causing build failures).  To allow adding the 'spl_perform_fixups'
extension point to SPL, we'll enable SPL_TINY_MEMSET for smartweb.

Signed-off-by: Philipp Tomsich 
---

 configs/smartweb_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/smartweb_defconfig b/configs/smartweb_defconfig
index 1f246e3..9ae30a1 100644
--- a/configs/smartweb_defconfig
+++ b/configs/smartweb_defconfig
@@ -54,4 +54,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_MCS7830=y
+CONFIG_SPL_TINY_MEMSET=y
 # CONFIG_EFI_LOADER is not set
-- 
2.1.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 0/2] env: Make environment loading log more clear

2018-07-20 Thread Sam Protsenko
This patch series intended to make boot log better. Basically here we
just remove unwanted error messages, relying on the message from most
deep API to be printed (like mmc subsystem). At the moment this looks
like most clean solution to cluttered log problem, as any other solution
will be hackish.

With this patch set applied we will see something like this:

Loading Environment from FAT... MMC: no card present
Loading Environment from MMC... OK

instead of:

Loading Environment from FAT... MMC: no card present
** Bad device mmc 0 **
Failed (-5)
Loading Environment from MMC... OK

Sam Protsenko (2):
  env: Don't print "Failed" error message
  disk: part: Don't show redundant error message

 disk/part.c |  2 +-
 env/env.c   | 12 +++-
 2 files changed, 8 insertions(+), 6 deletions(-)

-- 
2.18.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


  1   2   >