[U-Boot] [PATCH v2 4/4] armv8: ls2088aqds : Add ds3232 node

2019-07-24 Thread Chuanhua Han
This patch adds the ds3232-rtc node under the i2c0->i2c-mux@77->i2c@0
for ls2088aqds boards.

Signed-off-by: Chuanhua Han 
---
depends on:
- http://patchwork.ozlabs.org/project/uboot/list/?series=118772
- http://patchwork.ozlabs.org/project/uboot/list/?series=117226

Changes in v2:
- No change.

 arch/arm/dts/fsl-ls2080a-qds.dts | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/arch/arm/dts/fsl-ls2080a-qds.dts b/arch/arm/dts/fsl-ls2080a-qds.dts
index 2a0a528..13461b5 100644
--- a/arch/arm/dts/fsl-ls2080a-qds.dts
+++ b/arch/arm/dts/fsl-ls2080a-qds.dts
@@ -19,6 +19,25 @@
};
 };
 
+ {
+   status = "okay";
+   pca9547@77 {
+   compatible = "nxp,pca9547";
+   reg = <0x77>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   i2c@0 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <0x00>;
+   rtc@68 {
+   compatible = "dallas,ds3232";
+   reg = <0x68>;
+   };
+   };
+   };
+};
+
  {
bus-num = <0>;
status = "okay";
-- 
2.9.5

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


[U-Boot] [PATCH v2 2/4] armv8: ls2088aqds: The ls2088aqds board supports the I2C driver model.

2019-07-24 Thread Chuanhua Han
This patch is updating ls2088aqds board init code to support DM_I2C.

Signed-off-by: Chuanhua Han 
---
depends on:
- http://patchwork.ozlabs.org/project/uboot/list/?series=118772
- http://patchwork.ozlabs.org/project/uboot/list/?series=117226

Changes in v2:
- Move the variable declaration in the middle of the code to
the beginning of the function.
- Check the return value for the API of the i2c function call.

 board/freescale/ls2080aqds/eth.c| 236 
 board/freescale/ls2080aqds/ls2080aqds.c |   8 ++
 include/configs/ls2080aqds.h|   3 +
 3 files changed, 220 insertions(+), 27 deletions(-)

diff --git a/board/freescale/ls2080aqds/eth.c b/board/freescale/ls2080aqds/eth.c
index f706fd4..710f075 100644
--- a/board/freescale/ls2080aqds/eth.c
+++ b/board/freescale/ls2080aqds/eth.c
@@ -105,9 +105,20 @@ static void sgmii_configure_repeater(int serdes_port)
uint8_t ch_b_ctl2[] = {0x81, 0x82, 0x83, 0x84};
 
int *riser_phy_addr = _riser_phy_addr[0];
+#ifdef CONFIG_DM_I2C
+   struct udevice *udev;
+#endif
 
/* Set I2c to Slot 1 */
-   i2c_write(0x77, 0, 0, , 1);
+#ifndef CONFIG_DM_I2C
+   ret = i2c_write(0x77, 0, 0, , 1);
+#else
+   ret = i2c_get_chip_for_busnum(0, 0x77, 1, );
+   if (!ret)
+   ret = dm_i2c_write(udev, 0, , 1);
+#endif
+   if (ret)
+   goto error;
 
for (dpmac = 0; dpmac < 8; dpmac++) {
/* Check the PHY status */
@@ -120,7 +131,15 @@ static void sgmii_configure_repeater(int serdes_port)
mii_bus = 1;
dpmac_id = dpmac + 9;
a = 0xb;
-   i2c_write(0x76, 0, 0, , 1);
+#ifndef CONFIG_DM_I2C
+   ret = i2c_write(0x76, 0, 0, , 1);
+#else
+   ret = i2c_get_chip_for_busnum(0, 0x76, 1, );
+   if (!ret)
+   ret = dm_i2c_write(udev, 0, , 1);
+#endif
+   if (ret)
+   goto error;
break;
}
 
@@ -153,29 +172,102 @@ static void sgmii_configure_repeater(int serdes_port)
 
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
+#ifndef CONFIG_DM_I2C
a = 0x18;
-   i2c_write(i2c_addr[dpmac], 6, 1, , 1);
+   ret = i2c_write(i2c_addr[dpmac], 6, 1, , 1);
+   if (ret)
+   goto error;
a = 0x38;
-   i2c_write(i2c_addr[dpmac], 4, 1, , 1);
+   ret = i2c_write(i2c_addr[dpmac], 4, 1, , 1);
+   if (ret)
+   goto error;
a = 0x4;
-   i2c_write(i2c_addr[dpmac], 8, 1, , 1);
+   ret = i2c_write(i2c_addr[dpmac], 8, 1, , 1);
+   if (ret)
+   goto error;
 
-   i2c_write(i2c_addr[dpmac], 0xf, 1,
- _a_eq[i], 1);
-   i2c_write(i2c_addr[dpmac], 0x11, 1,
- _a_ctl2[j], 1);
+   ret = i2c_write(i2c_addr[dpmac], 0xf,
+   1, _a_eq[i], 1);
+   if (ret)
+   goto error;
+   ret = i2c_write(i2c_addr[dpmac], 0x11,
+   1, _a_ctl2[j], 1);
+   if (ret)
+   goto error;
 
-   i2c_write(i2c_addr[dpmac], 0x16, 1,
- _b_eq[i], 1);
-   i2c_write(i2c_addr[dpmac], 0x18, 1,
- _b_ctl2[j], 1);
+   ret = i2c_write(i2c_addr[dpmac], 0x16,
+   1, _b_eq[i], 1);
+   if (ret)
+   goto error;
+   ret = i2c_write(i2c_addr[dpmac], 0x18,
+   1, _b_ctl2[j], 1);
+   if (ret)
+   goto error;
 
a = 0x14;
-   i2c_write(i2c_addr[dpmac], 0x23, 1, , 1);
+   ret = i2c_write(i2c_addr[dpmac],
+   0x23, 1, , 1);
+   if (ret)
+   goto error;
a = 

[U-Boot] [PATCH v2 3/4] configs: ls2088aqds: Enable DM support for ds3231 rtc

2019-07-24 Thread Chuanhua Han
Enable related configs on all ls2088aqds boards to support ds3231
rtc DM function.

Signed-off-by: Chuanhua Han 
---
depends on:
- http://patchwork.ozlabs.org/project/uboot/list/?series=118772
- http://patchwork.ozlabs.org/project/uboot/list/?series=117226

Changes in v2:
- No change.

 configs/ls2088aqds_tfa_defconfig | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/configs/ls2088aqds_tfa_defconfig b/configs/ls2088aqds_tfa_defconfig
index e798c59..95921b0 100644
--- a/configs/ls2088aqds_tfa_defconfig
+++ b/configs/ls2088aqds_tfa_defconfig
@@ -1,12 +1,12 @@
 CONFIG_ARM=y
 CONFIG_TARGET_LS2080AQDS=y
+CONFIG_SYS_MALLOC_F_LEN=0x6000
 CONFIG_SYS_TEXT_BASE=0x8200
 CONFIG_TFABOOT=y
 CONFIG_NR_DRAM_BANKS=3
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
-# CONFIG_SYS_MALLOC_F is not set
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
@@ -63,3 +63,11 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
+CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
+CONFIG_I2C_DEFAULT_BUS_NUMBER=0
+CONFIG_DM_GPIO=y
+CONFIG_I2C_MUX=y
+CONFIG_I2C_MUX_PCA954x=y
+CONFIG_DM_RTC=y
+CONFIG_DS3231_BUS_NUM=0
-- 
2.9.5

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


[U-Boot] [PATCH v2 1/4] rtc: ds3232/ds3231: Add support to generate 32KHz output for driver module

2019-07-24 Thread Chuanhua Han
This patch add an implementation of the rtc_enable_32khz_output() that
uses the driver model i2c APIs.

Signed-off-by: Chuanhua Han 
---
depends on:
- http://patchwork.ozlabs.org/project/uboot/list/?series=118772
- http://patchwork.ozlabs.org/project/uboot/list/?series=117226

Changes in v2:
- No change.

 drivers/rtc/Kconfig  | 10 ++
 drivers/rtc/ds3231.c | 21 +
 include/rtc.h|  6 ++
 3 files changed, 37 insertions(+)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index fd0009b..040d241 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -31,6 +31,12 @@ config TPL_DM_RTC
  drivers to perform the actual functions. See rtc.h for a
  description of the API.
 
+config RTC_ENABLE_32KHZ_OUTPUT
+   bool "Enable RTC 32Khz output"
+   help
+  Some real-time clocks support the output of 32kHz square waves (such 
as ds3231),
+  the config symbol choose Real Time Clock device 32Khz output feature.
+
 config RTC_PCF2127
bool "Enable PCF2127 driver"
depends on DM_RTC
@@ -41,6 +47,10 @@ config RTC_PCF2127
  has a selectable I2C-bus or SPI-bus, a backup battery switch-over 
circuit, a
  programmable watchdog function, a timestamp function, and many other 
features.
 
+config DS3231_BUS_NUM
+   hex "I2C bus of the DS3231 device"
+   default 0
+
 config RTC_DS1307
bool "Enable DS1307 driver"
depends on DM_RTC
diff --git a/drivers/rtc/ds3231.c b/drivers/rtc/ds3231.c
index 79b026a..dbd77a6 100644
--- a/drivers/rtc/ds3231.c
+++ b/drivers/rtc/ds3231.c
@@ -148,11 +148,13 @@ void rtc_reset (void)
 /*
  * Enable 32KHz output
  */
+#ifdef CONFIG_RTC_ENABLE_32KHZ_OUTPUT
 void rtc_enable_32khz_output(void)
 {
rtc_write(RTC_STAT_REG_ADDR,
  RTC_STAT_BIT_BB32KHZ | RTC_STAT_BIT_EN32KHZ);
 }
+#endif
 
 /*
  * Helper functions
@@ -251,6 +253,25 @@ static int ds3231_probe(struct udevice *dev)
return 0;
 }
 
+#ifdef CONFIG_RTC_ENABLE_32KHZ_OUTPUT
+void rtc_enable_32khz_output(void)
+{
+   int ret;
+   struct udevice *dev;
+
+#ifdef CONFIG_DS3231_BUS_NUM
+   ret = i2c_get_chip_for_busnum(CONFIG_DS3231_BUS_NUM,
+ CONFIG_SYS_I2C_RTC_ADDR, 1, );
+#else
+   ret = i2c_get_chip_for_busnum(0, CONFIG_SYS_I2C_RTC_ADDR, 1, );
+#endif
+   if (!ret)
+   dm_i2c_reg_write(dev, RTC_STAT_REG_ADDR,
+RTC_STAT_BIT_BB32KHZ |
+RTC_STAT_BIT_EN32KHZ);
+}
+#endif
+
 static const struct rtc_ops ds3231_rtc_ops = {
.get = ds3231_rtc_get,
.set = ds3231_rtc_set,
diff --git a/include/rtc.h b/include/rtc.h
index b255bdc..df7de09 100644
--- a/include/rtc.h
+++ b/include/rtc.h
@@ -166,11 +166,17 @@ int rtc_read32(struct udevice *dev, unsigned int reg, u32 
*valuep);
  */
 int rtc_write32(struct udevice *dev, unsigned int reg, u32 value);
 
+#ifdef CONFIG_RTC_ENABLE_32KHZ_OUTPUT
+void rtc_enable_32khz_output(void);
+#endif
+
 #else
 int rtc_get (struct rtc_time *);
 int rtc_set (struct rtc_time *);
 void rtc_reset (void);
+#ifdef CONFIG_RTC_ENABLE_32KHZ_OUTPUT
 void rtc_enable_32khz_output(void);
+#endif
 
 /**
  * rtc_read8() - Read an 8-bit register
-- 
2.9.5

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


Re: [U-Boot] [PATCH v6 2/3] fit: Support compression for non-kernel components (e.g. FDT)

2019-07-24 Thread Simon Goldschmidt
Julius Werner  schrieb am Do., 25. Juli 2019, 04:38:

> This patch adds support for compressing non-kernel image nodes in a FIT
> image (kernel nodes could already be compressed previously). This can
> reduce the size of FIT images and therefore improve boot times
> (especially when an image bundles many different kernel FDTs). The
> images will automatically be decompressed on load.
>
> This patch does not support extracting compatible strings from
> compressed FDTs, so it's not very helpful in conjunction with
> CONFIG_FIT_BEST_MATCH yet, but it can already be used in environments
> that select the configuration to load explicitly.
>
> Signed-off-by: Julius Werner 
> Reviewed-by: Simon Glass 
>

Reviewed-by: Simon Goldschmidt 

---
>  - Changes for v2:
>- Changed from only supporting compressed FDTs to supporting all
>  non-kernel image node types.
>  - Changes for v3:
>- Fixed up some debug output that was still written for v1.
>- Fixed a mistake with handling FIT_LOAD_OPTIONAL_NON_ZERO when
>  'load' was 0 (i.e. unset).
>- Added compression test case to the test_fit pytest.
>  - No changes for v4
>  - No changes for v5
>  - No changes for v6
>
>  common/image-fit.c| 86 +++
>  test/py/tests/test_fit.py | 29 +++--
>  2 files changed, 77 insertions(+), 38 deletions(-)
>
> diff --git a/common/image-fit.c b/common/image-fit.c
> index a74b44f298..c9ffc441aa 100644
> --- a/common/image-fit.c
> +++ b/common/image-fit.c
> @@ -22,6 +22,7 @@
>  DECLARE_GLOBAL_DATA_PTR;
>  #endif /* !USE_HOSTCC*/
>
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -1576,6 +1577,13 @@ int fit_conf_find_compat(const void *fit, const
> void *fdt)
>   kfdt_name);
> continue;
> }
> +
> +   if (!fit_image_check_comp(fit, kfdt_noffset,
> IH_COMP_NONE)) {
> +   debug("Can't extract compat from \"%s\"
> (compressed)\n",
> + kfdt_name);
> +   continue;
> +   }
> +
> /*
>  * Get a pointer to this configuration's fdt.
>  */
> @@ -1795,11 +1803,12 @@ int fit_image_load(bootm_headers_t *images, ulong
> addr,
> const char *fit_uname_config;
> const char *fit_base_uname_config;
> const void *fit;
> -   const void *buf;
> +   void *buf;
> +   void *loadbuf;
> size_t size;
> int type_ok, os_ok;
> -   ulong load, data, len;
> -   uint8_t os;
> +   ulong load, load_end, data, len;
> +   uint8_t os, comp;
>  #ifndef USE_HOSTCC
> uint8_t os_arch;
>  #endif
> @@ -1895,12 +1904,6 @@ int fit_image_load(bootm_headers_t *images, ulong
> addr,
> images->os.arch = os_arch;
>  #endif
>
> -   if (image_type == IH_TYPE_FLATDT &&
> -   !fit_image_check_comp(fit, noffset, IH_COMP_NONE)) {
> -   puts("FDT image is compressed");
> -   return -EPROTONOSUPPORT;
> -   }
> -
> bootstage_mark(bootstage_id + BOOTSTAGE_SUB_CHECK_ALL);
> type_ok = fit_image_check_type(fit, noffset, image_type) ||
>   fit_image_check_type(fit, noffset, IH_TYPE_FIRMWARE) ||
> @@ -1931,7 +1934,8 @@ int fit_image_load(bootm_headers_t *images, ulong
> addr,
> bootstage_mark(bootstage_id + BOOTSTAGE_SUB_CHECK_ALL_OK);
>
> /* get image data address and length */
> -   if (fit_image_get_data_and_size(fit, noffset, , )) {
> +   if (fit_image_get_data_and_size(fit, noffset,
> +   (const void **), )) {
> printf("Could not find %s subimage data!\n", prop_name);
> bootstage_error(bootstage_id + BOOTSTAGE_SUB_GET_DATA);
> return -ENOENT;
> @@ -1939,30 +1943,15 @@ int fit_image_load(bootm_headers_t *images, ulong
> addr,
>
>  #if !defined(USE_HOSTCC) && defined(CONFIG_FIT_IMAGE_POST_PROCESS)
> /* perform any post-processing on the image data */
> -   board_fit_image_post_process((void **), );
> +   board_fit_image_post_process(, );
>  #endif
>
> len = (ulong)size;
>
> -   /* verify that image data is a proper FDT blob */
> -   if (image_type == IH_TYPE_FLATDT && fdt_check_header(buf)) {
> -   puts("Subimage data is not a FDT");
> -   return -ENOEXEC;
> -   }
> -
> bootstage_mark(bootstage_id + BOOTSTAGE_SUB_GET_DATA_OK);
>
> -   /*
> -* Work-around for eldk-4.2 which gives this warning if we try to
> -* cast in the unmap_sysmem() call:
> -* warning: initialization discards qualifiers from pointer target
> type
> -*/
> -   {
> -   void *vbuf = (void *)buf;
> -
> -   data = map_to_sysmem(vbuf);
> -   }
> -
> +   data = map_to_sysmem(buf);
> +   load = data;
> if (load_op == FIT_LOAD_IGNORED) {
> 

Re: [U-Boot] [PATCH v6 1/3] common: Move bootm_decomp_image() to image.c (as image_decomp())

2019-07-24 Thread Simon Goldschmidt
Julius Werner  schrieb am Do., 25. Juli 2019, 04:38:

> Upcoming patches want to add decompression to use cases that are no
> longer directly related to booting. It makes sense to retain a single
> decompression routine, but it should no longer be in bootm.c (which is
> not compiled for all configurations). This patch moves
> bootm_decomp_image() to image.c and renames it to image_decomp() in
> preparation of those upcoming patches.
>
> Signed-off-by: Julius Werner 
>

Reviewed-by: Simon Goldschmidt 

---
>  - First version: v5
>  - Changes for v6
>- Fixed test_fit.py (had a printf() without a newline)
>
>  common/bootm.c | 148 ++---
>  common/image.c | 111 ++
>  include/bootm.h|  17 --
>  include/image.h|  17 ++
>  test/compression.c |  24 
>  5 files changed, 160 insertions(+), 157 deletions(-)
>
> diff --git a/common/bootm.c b/common/bootm.c
> index bea516025f..5509b341ff 100644
> --- a/common/bootm.c
> +++ b/common/bootm.c
> @@ -7,17 +7,12 @@
>  #ifndef USE_HOSTCC
>  #include 
>  #include 
> -#include 
>  #include 
>  #include 
>  #include 
>  #include 
>  #include 
>  #include 
> -#include 
> -#include 
> -#include 
> -#include 
>  #if defined(CONFIG_CMD_USB)
>  #include 
>  #endif
> @@ -299,23 +294,6 @@ static int bootm_find_other(cmd_tbl_t *cmdtp, int
> flag, int argc,
>  }
>  #endif /* USE_HOSTC */
>
> -/**
> - * print_decomp_msg() - Print a suitable decompression/loading message
> - *
> - * @type:  OS type (IH_OS_...)
> - * @comp_type: Compression type being used (IH_COMP_...)
> - * @is_xip:true if the load address matches the image start
> - */
> -static void print_decomp_msg(int comp_type, int type, bool is_xip)
> -{
> -   const char *name = genimg_get_type_name(type);
> -
> -   if (comp_type == IH_COMP_NONE)
> -   printf("   %s %s ... ", is_xip ? "XIP" : "Loading", name);
> -   else
> -   printf("   Uncompressing %s ... ", name);
> -}
> -
>  /**
>   * handle_decomp_error() - display a decompression error
>   *
> @@ -325,16 +303,18 @@ static void print_decomp_msg(int comp_type, int
> type, bool is_xip)
>   *
>   * @comp_type: Compression type being used (IH_COMP_...)
>   * @uncomp_size:   Number of bytes uncompressed
> - * @unc_len:   Amount of space available for decompression
> - * @ret:   Error code to report
> - * @return BOOTM_ERR_RESET, indicating that the board must be reset
> + * @ret:   errno error code received from compression library
> + * @return Appropriate BOOTM_ERR_ error code
>   */
> -static int handle_decomp_error(int comp_type, size_t uncomp_size,
> -  size_t unc_len, int ret)
> +static int handle_decomp_error(int comp_type, size_t uncomp_size, int ret)
>  {
> const char *name = genimg_get_comp_name(comp_type);
>
> -   if (uncomp_size >= unc_len)
> +   /* ENOSYS means unimplemented compression type, don't reset. */
> +   if (ret == -ENOSYS)
> +   return BOOTM_ERR_UNIMPLEMENTED;
> +
> +   if (uncomp_size >= CONFIG_SYS_BOOTM_LEN)
> printf("Image too large: increase CONFIG_SYS_BOOTM_LEN\n");
> else
> printf("%s: uncompress error %d\n", name, ret);
> @@ -352,93 +332,6 @@ static int handle_decomp_error(int comp_type, size_t
> uncomp_size,
> return BOOTM_ERR_RESET;
>  }
>
> -int bootm_decomp_image(int comp, ulong load, ulong image_start, int type,
> -  void *load_buf, void *image_buf, ulong image_len,
> -  uint unc_len, ulong *load_end)
> -{
> -   int ret = 0;
> -
> -   *load_end = load;
> -   print_decomp_msg(comp, type, load == image_start);
> -
> -   /*
> -* Load the image to the right place, decompressing if needed.
> After
> -* this, image_len will be set to the number of uncompressed bytes
> -* loaded, ret will be non-zero on error.
> -*/
> -   switch (comp) {
> -   case IH_COMP_NONE:
> -   if (load == image_start)
> -   break;
> -   if (image_len <= unc_len)
> -   memmove_wd(load_buf, image_buf, image_len,
> CHUNKSZ);
> -   else
> -   ret = 1;
> -   break;
> -#ifdef CONFIG_GZIP
> -   case IH_COMP_GZIP: {
> -   ret = gunzip(load_buf, unc_len, image_buf, _len);
> -   break;
> -   }
> -#endif /* CONFIG_GZIP */
> -#ifdef CONFIG_BZIP2
> -   case IH_COMP_BZIP2: {
> -   uint size = unc_len;
> -
> -   /*
> -* If we've got less than 4 MB of malloc() space,
> -* use slower decompression algorithm which requires
> -* at most 2300 KB of memory.
> -*/
> -   ret = BZ2_bzBuffToBuffDecompress(load_buf, ,
> -   image_buf, image_len,
> 

Re: [U-Boot] [PATCH v2 05/12] armV7R: K3: am654: Allow using SPL BSS pre-relocation

2019-07-24 Thread Lokesh Vutla
Hi Tom,

On 20/07/19 9:21 PM, Tom Rini wrote:
> On Fri, Jul 19, 2019 at 07:29:37AM +0200, Simon Goldschmidt wrote:
>> On Fri, Jul 19, 2019 at 2:29 AM Tom Rini  wrote:
>>>
>>> On Tue, Jun 04, 2019 at 05:55:48PM -0500, Andreas Dannenberg wrote:
>>>
 In order to be able to use more advanced driver functionality which often
 relies on having BSS initialized during early boot prior to relocation
 several things need to be in place:

 1) Memory needs to be available for BSS to use. For this, we locate BSS
at the top of the MCU SRAM area, with the stack starting right below
it,
 2) We need to move the initialization of BSS prior to entering
board_init_f(). We will do this with a separate commit by turning on
the respective CONFIG option.

 In this commit we also clean up the assignment of the initial SP address
 as part of the refactoring, taking into account the pre-decrement post-
 increment nature in which the SP is used on ARM.

 Signed-off-by: Andreas Dannenberg 
>>>
>>> Applied to u-boot/master, thanks!
>>
>> Wait, why has this been merged? Unfortunately, I haven't followed this 
>> series,
>> but in a discussion about a similar patch I sent [1], using BSS from
>> board_init_f
>> was turned down. And Simon Glass rather convinced me that this is the current
>> API U-Boot has (and is documented in README).
>>
>> So either we must change this API and its documentation (and I would expect 
>> the
>> author of this patch to combine the README change with the code change), or 
>> this
>> patch would have to be rejected.
>>
>> Again, I'm sorry I only see this now. In thought to remember a
>> discussion in this
>> thread, but I clearly remember that wrong...
>>
>> [1] https://patchwork.ozlabs.org/patch/1057237/
> 
> And I had missed that other thread.  Lokesh, since I think Andreas is
> out currently can you expand a little on what we can/can't do on this
> platform?  Thanks!

The reason why BSS is needed very early in this platform is for the following
reasons:
- System co-processor is the central resource manager in SoC and should be
loaded and started very early in the boot process. Without that no peripheral or
memory can be initialized. So for loading system co-processor image, we only
have limited SRAM and a peripheral initialized by ROM.
- System co-processor(DMSC) is being represented as remote-core in
Device-tree(We are strictly following DM and DT model for the entire SoC).
- Since DM is also followed by each peripheral device and remote core, DM should
be enabled very early and many peripheral drivers are dependent on BSS usage.
So, BSS has been made available very early.

Hope this is clear. Let me know if more details are required, I will be happy to
explain.

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


Re: [U-Boot] [PATCH v5 1/3] common: Move bootm_decomp_image() to image.c (as image_decomp())

2019-07-24 Thread Julius Werner
> OK, this now causes 'make tests' to fail on the FIT image tests, please
> look.  Thanks!

Whoops, sorry, should have run that again. This was just a printf()
without a newline at the end, apparently pytest really doesn't like
that. (I took out the "OK" at the end of the "Loading kernel..."
message since with this patch decompression errors are supposed to be
handled by the callers and there are separate error messages in those
anyway.)

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


[U-Boot] [PATCH v6 2/3] fit: Support compression for non-kernel components (e.g. FDT)

2019-07-24 Thread Julius Werner
This patch adds support for compressing non-kernel image nodes in a FIT
image (kernel nodes could already be compressed previously). This can
reduce the size of FIT images and therefore improve boot times
(especially when an image bundles many different kernel FDTs). The
images will automatically be decompressed on load.

This patch does not support extracting compatible strings from
compressed FDTs, so it's not very helpful in conjunction with
CONFIG_FIT_BEST_MATCH yet, but it can already be used in environments
that select the configuration to load explicitly.

Signed-off-by: Julius Werner 
Reviewed-by: Simon Glass 
---
 - Changes for v2:
   - Changed from only supporting compressed FDTs to supporting all
 non-kernel image node types.
 - Changes for v3:
   - Fixed up some debug output that was still written for v1.
   - Fixed a mistake with handling FIT_LOAD_OPTIONAL_NON_ZERO when
 'load' was 0 (i.e. unset).
   - Added compression test case to the test_fit pytest.
 - No changes for v4
 - No changes for v5
 - No changes for v6

 common/image-fit.c| 86 +++
 test/py/tests/test_fit.py | 29 +++--
 2 files changed, 77 insertions(+), 38 deletions(-)

diff --git a/common/image-fit.c b/common/image-fit.c
index a74b44f298..c9ffc441aa 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -22,6 +22,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 #endif /* !USE_HOSTCC*/
 
+#include 
 #include 
 #include 
 #include 
@@ -1576,6 +1577,13 @@ int fit_conf_find_compat(const void *fit, const void 
*fdt)
  kfdt_name);
continue;
}
+
+   if (!fit_image_check_comp(fit, kfdt_noffset, IH_COMP_NONE)) {
+   debug("Can't extract compat from \"%s\" (compressed)\n",
+ kfdt_name);
+   continue;
+   }
+
/*
 * Get a pointer to this configuration's fdt.
 */
@@ -1795,11 +1803,12 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
const char *fit_uname_config;
const char *fit_base_uname_config;
const void *fit;
-   const void *buf;
+   void *buf;
+   void *loadbuf;
size_t size;
int type_ok, os_ok;
-   ulong load, data, len;
-   uint8_t os;
+   ulong load, load_end, data, len;
+   uint8_t os, comp;
 #ifndef USE_HOSTCC
uint8_t os_arch;
 #endif
@@ -1895,12 +1904,6 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
images->os.arch = os_arch;
 #endif
 
-   if (image_type == IH_TYPE_FLATDT &&
-   !fit_image_check_comp(fit, noffset, IH_COMP_NONE)) {
-   puts("FDT image is compressed");
-   return -EPROTONOSUPPORT;
-   }
-
bootstage_mark(bootstage_id + BOOTSTAGE_SUB_CHECK_ALL);
type_ok = fit_image_check_type(fit, noffset, image_type) ||
  fit_image_check_type(fit, noffset, IH_TYPE_FIRMWARE) ||
@@ -1931,7 +1934,8 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
bootstage_mark(bootstage_id + BOOTSTAGE_SUB_CHECK_ALL_OK);
 
/* get image data address and length */
-   if (fit_image_get_data_and_size(fit, noffset, , )) {
+   if (fit_image_get_data_and_size(fit, noffset,
+   (const void **), )) {
printf("Could not find %s subimage data!\n", prop_name);
bootstage_error(bootstage_id + BOOTSTAGE_SUB_GET_DATA);
return -ENOENT;
@@ -1939,30 +1943,15 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
 
 #if !defined(USE_HOSTCC) && defined(CONFIG_FIT_IMAGE_POST_PROCESS)
/* perform any post-processing on the image data */
-   board_fit_image_post_process((void **), );
+   board_fit_image_post_process(, );
 #endif
 
len = (ulong)size;
 
-   /* verify that image data is a proper FDT blob */
-   if (image_type == IH_TYPE_FLATDT && fdt_check_header(buf)) {
-   puts("Subimage data is not a FDT");
-   return -ENOEXEC;
-   }
-
bootstage_mark(bootstage_id + BOOTSTAGE_SUB_GET_DATA_OK);
 
-   /*
-* Work-around for eldk-4.2 which gives this warning if we try to
-* cast in the unmap_sysmem() call:
-* warning: initialization discards qualifiers from pointer target type
-*/
-   {
-   void *vbuf = (void *)buf;
-
-   data = map_to_sysmem(vbuf);
-   }
-
+   data = map_to_sysmem(buf);
+   load = data;
if (load_op == FIT_LOAD_IGNORED) {
/* Don't load */
} else if (fit_image_get_load(fit, noffset, )) {
@@ -1974,8 +1963,6 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
}
} else if (load_op != FIT_LOAD_OPTIONAL_NON_ZERO || load) {
ulong image_start, image_end;
-   ulong load_end;
-   void *dst;

[U-Boot] [PATCH v6 3/3] fit: Support compat string property in configuration node

2019-07-24 Thread Julius Werner
This patch adds support for an optional optimization to compatible
string matching where the compatible string property from the root node
of the kernel FDT can be copied into the configuration node of the FIT
image. This is most useful when using compressed FDTs or when using FDT
overlays, where the traditional extraction of the compatible string from
the kernel FDT itself is not easily possible.

Signed-off-by: Julius Werner 
Reviewed-by: Simon Glass 
---
 - No changes for v2
 - No changes for v3
 - Changes for v4:
   - Added documentation for compatible string in config node.
   - Added example .its file for compressed FDT with compat string in
 config node.
 - No changes for v5
 - No changes for v6

 common/image-fit.c| 67 -
 doc/uImage.FIT/kernel_fdts_compressed.its | 73 +++
 doc/uImage.FIT/source_file_format.txt |  7 +++
 3 files changed, 119 insertions(+), 28 deletions(-)
 create mode 100644 doc/uImage.FIT/kernel_fdts_compressed.its

diff --git a/common/image-fit.c b/common/image-fit.c
index c9ffc441aa..e346fed550 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1522,6 +1522,10 @@ int fit_check_format(const void *fit)
  * compatible list, "foo,bar", matches a compatible string in the root of fdt1.
  * "bim,bam" in fdt2 matches the second string which isn't as good as fdt1.
  *
+ * As an optimization, the compatible property from the FDT's root node can be
+ * copied into the configuration node in the FIT image. This is required to
+ * match configurations with compressed FDTs.
+ *
  * returns:
  * offset to the configuration to use if one was found
  * -1 otherwise
@@ -1554,55 +1558,62 @@ int fit_conf_find_compat(const void *fit, const void 
*fdt)
for (noffset = fdt_next_node(fit, confs_noffset, );
(noffset >= 0) && (ndepth > 0);
noffset = fdt_next_node(fit, noffset, )) {
-   const void *kfdt;
+   const void *fdt;
const char *kfdt_name;
-   int kfdt_noffset;
+   int kfdt_noffset, compat_noffset;
const char *cur_fdt_compat;
int len;
-   size_t size;
+   size_t sz;
int i;
 
if (ndepth > 1)
continue;
 
-   kfdt_name = fdt_getprop(fit, noffset, "fdt", );
-   if (!kfdt_name) {
-   debug("No fdt property found.\n");
-   continue;
-   }
-   kfdt_noffset = fdt_subnode_offset(fit, images_noffset,
- kfdt_name);
-   if (kfdt_noffset < 0) {
-   debug("No image node named \"%s\" found.\n",
- kfdt_name);
-   continue;
-   }
+   /* If there's a compat property in the config node, use that. */
+   if (fdt_getprop(fit, noffset, "compatible", NULL)) {
+   fdt = fit;/* search in FIT image */
+   compat_noffset = noffset; /* search under config node */
+   } else {/* Otherwise extract it from the kernel FDT. */
+   kfdt_name = fdt_getprop(fit, noffset, "fdt", );
+   if (!kfdt_name) {
+   debug("No fdt property found.\n");
+   continue;
+   }
+   kfdt_noffset = fdt_subnode_offset(fit, images_noffset,
+ kfdt_name);
+   if (kfdt_noffset < 0) {
+   debug("No image node named \"%s\" found.\n",
+ kfdt_name);
+   continue;
+   }
 
-   if (!fit_image_check_comp(fit, kfdt_noffset, IH_COMP_NONE)) {
-   debug("Can't extract compat from \"%s\" (compressed)\n",
- kfdt_name);
-   continue;
-   }
+   if (!fit_image_check_comp(fit, kfdt_noffset,
+ IH_COMP_NONE)) {
+   debug("Can't extract compat from \"%s\" "
+ "(compressed)\n", kfdt_name);
+   continue;
+   }
 
-   /*
-* Get a pointer to this configuration's fdt.
-*/
-   if (fit_image_get_data(fit, kfdt_noffset, , )) {
-   debug("Failed to get fdt \"%s\".\n", kfdt_name);
-   continue;
+   /* search in this config's kernel FDT */
+   if (fit_image_get_data(fit, kfdt_noffset, , )) {
+   debug("Failed 

[U-Boot] [PATCH v6 0/3] fit: Image node compression

2019-07-24 Thread Julius Werner
This patch series adds compression support for non-kernel FIT image
nodes (e.g. FDTs). The first patch is a preparatory refactoring, the
second adds the compression support itself, and the third adds a new
feature to compatible string matching that allows it to be useful
with compressed FDTs.

Sandbox-tested with FIT images with and without compressed FDTs, with
and without overlays, in both compatible string matching and direct
config selection modes. Also expanded the test_fit pytest to include a
case with compressed kernel, FDT and ramdisk.

Julius Werner (3):
  common: Move bootm_decomp_image() to image.c (as image_decomp())
  fit: Support compression for non-kernel components (e.g. FDT)
  fit: Support compat string property in configuration node

- Changes for v6
  - Fixed test_fit.py (had a printf() without a newline)
- Changes for v5
  - Added first patch to support tools-only_defconfig (which doesn't
build bootm.c)
- Changes for v4
  - Added documentation
- Changes for v3
  - Added tests, fixed a few minor issues
- Changes for v2
  - Changed to support all non-kernel image types (not just FDT)

 common/bootm.c| 148 +++---
 common/image-fit.c| 143 -
 common/image.c| 111 
 doc/uImage.FIT/kernel_fdts_compressed.its |  73 +++
 doc/uImage.FIT/source_file_format.txt |   7 +
 include/bootm.h   |  17 ---
 include/image.h   |  17 +++
 test/compression.c|  24 ++--
 test/py/tests/test_fit.py |  29 -
 9 files changed, 351 insertions(+), 218 deletions(-)
 create mode 100644 doc/uImage.FIT/kernel_fdts_compressed.its

-- 
2.22.0.657.g960e92d24f-goog

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


[U-Boot] [PATCH v6 1/3] common: Move bootm_decomp_image() to image.c (as image_decomp())

2019-07-24 Thread Julius Werner
Upcoming patches want to add decompression to use cases that are no
longer directly related to booting. It makes sense to retain a single
decompression routine, but it should no longer be in bootm.c (which is
not compiled for all configurations). This patch moves
bootm_decomp_image() to image.c and renames it to image_decomp() in
preparation of those upcoming patches.

Signed-off-by: Julius Werner 
---
 - First version: v5
 - Changes for v6
   - Fixed test_fit.py (had a printf() without a newline)

 common/bootm.c | 148 ++---
 common/image.c | 111 ++
 include/bootm.h|  17 --
 include/image.h|  17 ++
 test/compression.c |  24 
 5 files changed, 160 insertions(+), 157 deletions(-)

diff --git a/common/bootm.c b/common/bootm.c
index bea516025f..5509b341ff 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -7,17 +7,12 @@
 #ifndef USE_HOSTCC
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
-#include 
 #if defined(CONFIG_CMD_USB)
 #include 
 #endif
@@ -299,23 +294,6 @@ static int bootm_find_other(cmd_tbl_t *cmdtp, int flag, 
int argc,
 }
 #endif /* USE_HOSTC */
 
-/**
- * print_decomp_msg() - Print a suitable decompression/loading message
- *
- * @type:  OS type (IH_OS_...)
- * @comp_type: Compression type being used (IH_COMP_...)
- * @is_xip:true if the load address matches the image start
- */
-static void print_decomp_msg(int comp_type, int type, bool is_xip)
-{
-   const char *name = genimg_get_type_name(type);
-
-   if (comp_type == IH_COMP_NONE)
-   printf("   %s %s ... ", is_xip ? "XIP" : "Loading", name);
-   else
-   printf("   Uncompressing %s ... ", name);
-}
-
 /**
  * handle_decomp_error() - display a decompression error
  *
@@ -325,16 +303,18 @@ static void print_decomp_msg(int comp_type, int type, 
bool is_xip)
  *
  * @comp_type: Compression type being used (IH_COMP_...)
  * @uncomp_size:   Number of bytes uncompressed
- * @unc_len:   Amount of space available for decompression
- * @ret:   Error code to report
- * @return BOOTM_ERR_RESET, indicating that the board must be reset
+ * @ret:   errno error code received from compression library
+ * @return Appropriate BOOTM_ERR_ error code
  */
-static int handle_decomp_error(int comp_type, size_t uncomp_size,
-  size_t unc_len, int ret)
+static int handle_decomp_error(int comp_type, size_t uncomp_size, int ret)
 {
const char *name = genimg_get_comp_name(comp_type);
 
-   if (uncomp_size >= unc_len)
+   /* ENOSYS means unimplemented compression type, don't reset. */
+   if (ret == -ENOSYS)
+   return BOOTM_ERR_UNIMPLEMENTED;
+
+   if (uncomp_size >= CONFIG_SYS_BOOTM_LEN)
printf("Image too large: increase CONFIG_SYS_BOOTM_LEN\n");
else
printf("%s: uncompress error %d\n", name, ret);
@@ -352,93 +332,6 @@ static int handle_decomp_error(int comp_type, size_t 
uncomp_size,
return BOOTM_ERR_RESET;
 }
 
-int bootm_decomp_image(int comp, ulong load, ulong image_start, int type,
-  void *load_buf, void *image_buf, ulong image_len,
-  uint unc_len, ulong *load_end)
-{
-   int ret = 0;
-
-   *load_end = load;
-   print_decomp_msg(comp, type, load == image_start);
-
-   /*
-* Load the image to the right place, decompressing if needed. After
-* this, image_len will be set to the number of uncompressed bytes
-* loaded, ret will be non-zero on error.
-*/
-   switch (comp) {
-   case IH_COMP_NONE:
-   if (load == image_start)
-   break;
-   if (image_len <= unc_len)
-   memmove_wd(load_buf, image_buf, image_len, CHUNKSZ);
-   else
-   ret = 1;
-   break;
-#ifdef CONFIG_GZIP
-   case IH_COMP_GZIP: {
-   ret = gunzip(load_buf, unc_len, image_buf, _len);
-   break;
-   }
-#endif /* CONFIG_GZIP */
-#ifdef CONFIG_BZIP2
-   case IH_COMP_BZIP2: {
-   uint size = unc_len;
-
-   /*
-* If we've got less than 4 MB of malloc() space,
-* use slower decompression algorithm which requires
-* at most 2300 KB of memory.
-*/
-   ret = BZ2_bzBuffToBuffDecompress(load_buf, ,
-   image_buf, image_len,
-   CONFIG_SYS_MALLOC_LEN < (4096 * 1024), 0);
-   image_len = size;
-   break;
-   }
-#endif /* CONFIG_BZIP2 */
-#ifdef CONFIG_LZMA
-   case IH_COMP_LZMA: {
-   SizeT lzma_len = unc_len;
-
-   ret = lzmaBuffToBuffDecompress(load_buf, _len,
- 

Re: [U-Boot] [PATCH v4 1/2] arm: dts: Add devicetree support for iMXQXP AI_ML board

2019-07-24 Thread Peng Fan
> Subject: Re: [U-Boot] [PATCH v4 1/2] arm: dts: Add devicetree support for
> iMXQXP AI_ML board
> 
> On Fri, 19 Jul 2019 12:27:42 +0530
> Manivannan Sadhasivam  wrote:
> 
> > Add devicetree support for iMXQXP AI_ML board from Einfochips.
> >
> > Signed-off-by: Manivannan Sadhasivam
> >  ---
> >  arch/arm/dts/Makefile  |   1 +
> >  arch/arm/dts/fsl-imx8qxp-ai_ml-u-boot.dtsi | 117 +
> >  arch/arm/dts/fsl-imx8qxp-ai_ml.dts | 181
> > + 3 files changed, 299 insertions(+)
> >  create mode 100644 arch/arm/dts/fsl-imx8qxp-ai_ml-u-boot.dtsi
> >  create mode 100644 arch/arm/dts/fsl-imx8qxp-ai_ml.dts
> >
> > diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index
> > e6680e5e98..7834a158da 100644
> > --- a/arch/arm/dts/Makefile
> > +++ b/arch/arm/dts/Makefile
> > @@ -614,6 +614,7 @@ dtb-$(CONFIG_ARCH_MX7ULP) += imx7ulp-evk.dtb
> >  dtb-$(CONFIG_ARCH_IMX8) += \
> > fsl-imx8qm-apalis.dtb \
> > fsl-imx8qm-mek.dtb \
> > +   fsl-imx8qxp-ai_ml.dtb \
> > fsl-imx8qxp-colibri.dtb \
> > fsl-imx8qxp-mek.dtb
> >
> 
> Reviewed-by: Lukasz Majewski 
> 
> Just out of curiosity - why ARM8 devices from iMX have dtb naming
> convention starting from 'fsl-' ?
> 
> With other boards we strive to have 'imx6q-'*.dts, 'imx53-'*.dts, etc?

When initially upstreaming i.MX8 to U-Boot, the dts was reused from
downstream, because Linux upstream still not have that device tree.

When Linux i.MX8 device tree stable, we need to migrate to use Linux
dts without fsl- prefix.
Currently It is under some restructure for long time and missed i.MX8QM
support.

Regards,
Peng.

> 
> > diff --git a/arch/arm/dts/fsl-imx8qxp-ai_ml-u-boot.dtsi
> > b/arch/arm/dts/fsl-imx8qxp-ai_ml-u-boot.dtsi new file mode 100644
> > index 00..3ca53bb945
> > --- /dev/null
> > +++ b/arch/arm/dts/fsl-imx8qxp-ai_ml-u-boot.dtsi
> > @@ -0,0 +1,117 @@
> > +// SPDX-License-Identifier: GPL-2.0+
> > +/*
> > + * Copyright 2019 Linaro Ltd.
> > + */
> > +
> > +&{/imx8qx-pm} {
> > +
> > +   u-boot,dm-spl;
> > +};
> > +
> > + {
> > +   u-boot,dm-spl;
> > +};
> > +
> > + {
> > +   u-boot,dm-spl;
> > +};
> > +
> > + {
> > +   u-boot,dm-spl;
> > +};
> > +
> > +_lsio {
> > +   u-boot,dm-spl;
> > +};
> > +
> > +_lsio_gpio0 {
> > +   u-boot,dm-spl;
> > +};
> > +
> > +_lsio_gpio1 {
> > +   u-boot,dm-spl;
> > +};
> > +
> > +_lsio_gpio2 {
> > +   u-boot,dm-spl;
> > +};
> > +
> > +_lsio_gpio3 {
> > +   u-boot,dm-spl;
> > +};
> > +
> > +_lsio_gpio4 {
> > +   u-boot,dm-spl;
> > +};
> > +
> > +_lsio_gpio5 {
> > +   u-boot,dm-spl;
> > +};
> > +
> > +_lsio_gpio6 {
> > +   u-boot,dm-spl;
> > +};
> > +
> > +_lsio_gpio7 {
> > +   u-boot,dm-spl;
> > +};
> > +
> > +_conn {
> > +   u-boot,dm-spl;
> > +};
> > +
> > +_conn_sdch0 {
> > +   u-boot,dm-spl;
> > +};
> > +
> > +_conn_sdch1 {
> > +   u-boot,dm-spl;
> > +};
> > +
> > +_conn_sdch2 {
> > +   u-boot,dm-spl;
> > +};
> > +
> > + {
> > +   u-boot,dm-spl;
> > +};
> > +
> > + {
> > +   u-boot,dm-spl;
> > +};
> > +
> > + {
> > +   u-boot,dm-spl;
> > +};
> > +
> > + {
> > +   u-boot,dm-spl;
> > +};
> > +
> > + {
> > +   u-boot,dm-spl;
> > +};
> > +
> > + {
> > +   u-boot,dm-spl;
> > +};
> > +
> > + {
> > +   u-boot,dm-spl;
> > +};
> > +
> > + {
> > +   u-boot,dm-spl;
> > +};
> > +
> > + {
> > +   u-boot,dm-spl;
> > +};
> > +
> > + {
> > +   u-boot,dm-spl;
> > +};
> > +
> > + {
> > +   u-boot,dm-spl;
> > +};
> > diff --git a/arch/arm/dts/fsl-imx8qxp-ai_ml.dts
> > b/arch/arm/dts/fsl-imx8qxp-ai_ml.dts new file mode 100644 index
> > 00..aa85caaff5
> > --- /dev/null
> > +++ b/arch/arm/dts/fsl-imx8qxp-ai_ml.dts
> > @@ -0,0 +1,181 @@
> > +// SPDX-License-Identifier: GPL-2.0+
> > +/*
> > + * Copyright 2018 Einfochips
> > + * Copyright 2019 Linaro Ltd.
> > + */
> > +
> > +/dts-v1/;
> > +
> > +#include "fsl-imx8qxp.dtsi"
> > +#include "fsl-imx8qxp-ai_ml-u-boot.dtsi"
> > +
> > +/ {
> > +   model = "Einfochips i.MX8QXP AI_ML";
> > +   compatible = "einfochips,imx8qxp-ai_ml", "fsl,imx8qxp";
> > +
> > +   chosen {
> > +   bootargs = "console=ttyLP2,115200
> > earlycon=lpuart32,0x5a08,115200";
> > +   stdout-path = 
> > +   };
> > +
> > +   memory@8000 {
> > +   device_type = "memory";
> > +   reg = <0x 0x8000 0 0x8000>;
> > +   };
> > +};
> > +
> > + {
> > +   pinctrl-names = "default";
> > +   pinctrl-0 = <_lpuart0>;
> > +   status = "okay";
> > +};
> > +
> > + {
> > +   pinctrl-names = "default";
> > +   pinctrl-0 = <_lpuart1>;
> > +   status = "okay";
> > +};
> > +
> > + {
> > +   pinctrl-names = "default";
> > +   pinctrl-0 = <_lpuart2>;
> > +   status = "okay";
> > +};
> > +
> > + {
> > +   pinctrl-names = "default";
> > +   pinctrl-0 = <_lpuart3>;
> > +   status = "okay";
> > +};
> > +
> > + {
> > +   pinctrl-names = "default";
> > +   pinctrl-0 = <_fec1>;
> > +   phy-mode = "rgmii";
> > +   phy-handle = <>;
> > +   fsl,ar8031-phy-fixup;
> > +   fsl,magic-packet;
> > +   phy-reset-gpios = < 14 GPIO_ACTIVE_LOW>;
> > +  

Re: [U-Boot] [PATCH v11 1/4] net: macb: Extend MACB driver for SiFive Unleashed board

2019-07-24 Thread Joe Hershberger
On Tue, Jul 23, 2019 at 11:11 PM Anup Patel  wrote:
>
> The SiFive MACB ethernet has a custom TX_CLK_SEL register to select
> different TX clock for 1000mbps vs 10/100mbps.
>
> This patch adds SiFive MACB compatible string and extends the MACB
> ethernet driver to change TX clock using TX_CLK_SEL register for
> SiFive MACB.
>
> Signed-off-by: Anup Patel 
> Reviewed-by: Bin Meng 
> Reviewed-by: Ramon Fried 

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


Re: [U-Boot] [PATCH v11 2/4] net: macb: Fix check for little-endian system in gmac_configure_dma()

2019-07-24 Thread Joe Hershberger
On Tue, Jul 23, 2019 at 11:11 PM Anup Patel  wrote:
>
> Instead of depending on CONFIG_SYS_LITTLE_ENDIAN, we check at runtime
> whether underlying system is little-endian or big-endian. This way
> we are not dependent on any U-Boot specific OR compiler specific macro
> to check system endianness.
>
> Signed-off-by: Anup Patel 
> Reviewed-by: Bin Meng 
> Reviewed-by: Ramon Fried 

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


Re: [U-Boot] [PATCHv3] ARM: zynq: Add configuration for Z-turn board

2019-07-24 Thread tossel
Hi Michal,

>
> Looks good.
>
> Applied.
> M

is there anything else preventing the merger or I just have to wait?

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


Re: [U-Boot] [PATCH v3 0/9] NXP LS1021A-TSN Board

2019-07-24 Thread Vladimir Oltean
On Wed, 24 Jul 2019 at 21:56, Joe Hershberger  wrote:
>
> On Wed, Jul 24, 2019 at 10:38 AM Vladimir Oltean  wrote:
> >
> > On Tue, 23 Jul 2019 at 10:38, Joe Hershberger  
> > wrote:
> > >
> > > On Tue, Jul 23, 2019 at 1:08 AM Vladimir Oltean  wrote:
> > > >
> > > > Hi Joe,
> > > >
> > > > On Tue, 23 Jul 2019 at 03:15, Joe Hershberger  
> > > > wrote:
> > > > >
> > > > > On Thu, Jul 18, 2019 at 4:33 PM Vladimir Oltean  
> > > > > wrote:
> > > > > >
> > > > > > This patchset adds initial support for the NXP LS1021A-TSN board,
> > > > > > an evaluation platform built in partnership with VVDN/Argonboards
> > > > > > for some IEEE 802.1 TSN features.
> > > > > >
> > > > > > It features a cleaned-up U-Boot board support taken from OpenIL,
> > > > > > as well as an eTSEC migration to DM_ETH.  I picked up Bin Meng's
> > > > > > patch that converts the LS1021A-TWR (different board, same SoC):
> > > > > > https://lists.denx.de/pipermail/u-boot/2018-May/330096.html
> > > > > > verified it on the LS1021A-TSN board I am submitting, and made a
> > > > > > few adjustments where necessary.
> > > > > >
> > > > > > TODO items:
> > > > > > - Make the eTSEC driver support fixed-link interfaces (necessary
> > > > > >   for the enet2 <-> sja1105 internal port)
> > > > > > - Add driver for SJA1105 switch
> > > > > > - Potentially migrate the eTSEC MDIO bus driver to DM_MDIO and
> > > > > >   expose the TBI PHY to mdio commands (useful for debugging),
> > > > > >   once https://lists.denx.de/pipermail/u-boot/2019-June/371563.html
> > > > > >   is merged.
> > > > >
> > > > > This series is merged at this point... are you wanting to do that
> > > > > migration now or do it sometime later?
> > > > >
> > > >
> > > > I think I would rather have these 9 patches merged first, now that
> > > > they got reviewed, instead of reworking them again.
> > >
> > > Sounds good.
> > > Thanks,
> > > -Joe
> > >
> >
> > What does this mean, that we are waiting for Prabhakar's OK? Is the
> > patchset going to get in through a single tree? Whose is it going to
> > be?
>
> Since the vast majority of the series is the Ethernet changes, I was
> planning to take it.
>

Sounds reasonable to me.

> Thanks,
> -Joe

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


Re: [U-Boot] Please pull u-boot-dm (take 2)

2019-07-24 Thread Tom Rini
On Wed, Jul 24, 2019 at 10:09:29PM +0200, Simon Goldschmidt wrote:
> Am 24.07.2019 um 22:03 schrieb Simon Glass:
> >Hi Tom,
> >
> >On Wed, 24 Jul 2019 at 10:13, Tom Rini  wrote:
> >>
> >>On Tue, Jul 23, 2019 at 08:36:58PM -0700, Simon Glass wrote:
> >>
> >>>Hi Tom,
> >>>
> >>>This includes the gitlab fix and also I updated ifwitool.c to drop the
> >>>unused inline functions.
> >>>
> >>>
> >>>The following changes since commit 
> >>>ff8c23e784f57a7098e91a200ed7f5a48612b653:
> >>>
> >>>   Merge tag 'u-boot-stm32-20190723' of
> >>>https://gitlab.denx.de/u-boot/custodians/u-boot-stm (2019-07-23
> >>>14:16:21 -0400)
> >>>
> >>>are available in the Git repository at:
> >>>
> >>>   git://git.denx.de/u-boot-dm.git tags/dm-pull-23jul19-take2
> >>>
> >>>for you to fetch changes up to 6e38047b66e37659b937cf301e0de37a90d9eaa2:
> >>>
> >>>   dm: device: make power domain calls optional (2019-07-23 20:27:58 -0700)
> >>>
> >>
> >>We're still not there yet, sorry.  Taking a look at
> >>https://gitlab.denx.de/u-boot/u-boot/-/jobs/1464 we're now running
> >>things but ifwitool is failing.  Can you please take a look?  You will
> >>need the patch I posted that brings us up to a newer image that has
> >>lzma-alone. Thanks!
> >
> >OK, this is another update that is needed to the gitlab config, this
> >time the --toolpath argument. Will send an update.
> >
> >I was rather hoping that pushing to gitlab u-boot-dm would start a
> >build but it does not, for me. I probably need to do some more
> >reading.
> >
> >BTW Is there an intent to shut down travis?
> 
> Even if everyone seems to be switching to gitlab, can we keep the travis
> config in the repository? That makes it easy for people (like me) creating a
> github clone to ensure the world keeps building after a patch.
> 
> Or is there a similar free and easy to use gitlab service comparable to
> travis?

So that's the rub.  There are free "runners" in GitLab terms for
projects but they are limited in time to I think an hour per job, so we
get back to the unmaintainable mess of splitting the build like we have
on Travis.  Anyone can use their own machine as the runner, but that may
or may not be faster or even slower than Travis is.

-- 
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] Please pull u-boot-dm (take 2)

2019-07-24 Thread Tom Rini
On Wed, Jul 24, 2019 at 01:03:20PM -0700, Simon Glass wrote:
> Hi Tom,
> 
> On Wed, 24 Jul 2019 at 10:13, Tom Rini  wrote:
> >
> > On Tue, Jul 23, 2019 at 08:36:58PM -0700, Simon Glass wrote:
> >
> > > Hi Tom,
> > >
> > > This includes the gitlab fix and also I updated ifwitool.c to drop the
> > > unused inline functions.
> > >
> > >
> > > The following changes since commit 
> > > ff8c23e784f57a7098e91a200ed7f5a48612b653:
> > >
> > >   Merge tag 'u-boot-stm32-20190723' of
> > > https://gitlab.denx.de/u-boot/custodians/u-boot-stm (2019-07-23
> > > 14:16:21 -0400)
> > >
> > > are available in the Git repository at:
> > >
> > >   git://git.denx.de/u-boot-dm.git tags/dm-pull-23jul19-take2
> > >
> > > for you to fetch changes up to 6e38047b66e37659b937cf301e0de37a90d9eaa2:
> > >
> > >   dm: device: make power domain calls optional (2019-07-23 20:27:58 -0700)
> > >
> >
> > We're still not there yet, sorry.  Taking a look at
> > https://gitlab.denx.de/u-boot/u-boot/-/jobs/1464 we're now running
> > things but ifwitool is failing.  Can you please take a look?  You will
> > need the patch I posted that brings us up to a newer image that has
> > lzma-alone. Thanks!
> 
> OK, this is another update that is needed to the gitlab config, this
> time the --toolpath argument. Will send an update.
> 
> I was rather hoping that pushing to gitlab u-boot-dm would start a
> build but it does not, for me. I probably need to do some more
> reading.

Take a look at the email I sent to the custodians list :)  You'll need
to flip a switch or two on the -dm tree for it to happen, and you can
provide more build power for just your tree in addition to the shared
runner we have currently.

> BTW Is there an intent to shut down travis?

As in remove the file?  Not immediately, no, there's still the question
of what to do about non-custodians being able to run CI before
submitting.

-- 
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] Please pull u-boot-dm (take 2)

2019-07-24 Thread Simon Goldschmidt

Am 24.07.2019 um 22:03 schrieb Simon Glass:

Hi Tom,

On Wed, 24 Jul 2019 at 10:13, Tom Rini  wrote:


On Tue, Jul 23, 2019 at 08:36:58PM -0700, Simon Glass wrote:


Hi Tom,

This includes the gitlab fix and also I updated ifwitool.c to drop the
unused inline functions.


The following changes since commit ff8c23e784f57a7098e91a200ed7f5a48612b653:

   Merge tag 'u-boot-stm32-20190723' of
https://gitlab.denx.de/u-boot/custodians/u-boot-stm (2019-07-23
14:16:21 -0400)

are available in the Git repository at:

   git://git.denx.de/u-boot-dm.git tags/dm-pull-23jul19-take2

for you to fetch changes up to 6e38047b66e37659b937cf301e0de37a90d9eaa2:

   dm: device: make power domain calls optional (2019-07-23 20:27:58 -0700)



We're still not there yet, sorry.  Taking a look at
https://gitlab.denx.de/u-boot/u-boot/-/jobs/1464 we're now running
things but ifwitool is failing.  Can you please take a look?  You will
need the patch I posted that brings us up to a newer image that has
lzma-alone. Thanks!


OK, this is another update that is needed to the gitlab config, this
time the --toolpath argument. Will send an update.

I was rather hoping that pushing to gitlab u-boot-dm would start a
build but it does not, for me. I probably need to do some more
reading.

BTW Is there an intent to shut down travis?


Even if everyone seems to be switching to gitlab, can we keep the travis 
config in the repository? That makes it easy for people (like me) 
creating a github clone to ensure the world keeps building after a patch.


Or is there a similar free and easy to use gitlab service comparable to 
travis?


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


Re: [U-Boot] [PATCH v3 1/4] treewide: Fix stale references of Android docs

2019-07-24 Thread Tom Rini
On Fri, Jul 19, 2019 at 11:26:11PM +0200, Eugeniu Rosca wrote:

> Commit 9bdf0e8fef86 ("doc: relocate/rename Android README and add BCB
> overview") left some obsolete references of Android documents/paths.
> 
> This has been pointed out by Sam (thanks!) in:
> https://patchwork.ozlabs.org/patch/1104245/#2208134
> 
> Fixes: 9bdf0e8fef86 ("doc: relocate/rename Android README and add BCB 
> overview")
> Reported-by: Sam Protsenko 
> Suggested-by: Sam Protsenko 
> Signed-off-by: Eugeniu Rosca 
> Reviewed-by: Igor Opaniuk 
> Reviewed-by: Sam Protsenko 

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] [RESEND PATCH] distro_bootcmd: refactor virtio to support PCI block devices

2019-07-24 Thread Tom Rini
On Mon, Jul 22, 2019 at 11:38:11AM +0300, David Abdurachmanov wrote:

> Starting libvirt v5.3.0 with QEMU 4.0.0 use of PCI is automatic
> and thus storage is connected via PCI, which is not visible to
> U-Boot out-of-the-box.
> 
> Refactor to do "pci enum" followed by "virtio scan" to see PCI
> connected storage, and allow bootloader to load kernel and
> initramfs images.
> 
> Tested with Fedora/RISCV using releases: libvirt 5.4.0 & 5.5.0,
> QEMU 4.0.0 and U-Boot 2019.07 RC4.
> 
> Signed-off-by: David Abdurachmanov 

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 v2] spl: sata: support U-Boot load from raw sata disk

2019-07-24 Thread Tom Rini
On Sun, Jul 14, 2019 at 05:54:21PM +0300, Baruch Siach wrote:

> Support load of the U-Boot image from raw SATA disk sector. This is
> equivalent to load from MMC raw sector.
> 
> Signed-off-by: Baruch Siach 

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 v3 3/4] cmd: bcb: Use strcmp() instead of strncmp() for string literals

2019-07-24 Thread Tom Rini
On Fri, Jul 19, 2019 at 11:26:13PM +0200, Eugeniu Rosca wrote:

> Quote from https://patchwork.ozlabs.org/patch/1104244/#2210814:
> 
>  --8<---
> strncmp() is chosen for the sake of paranoid/defensive programming.
> Indeed, strncmp() is not really needed when comparing a variable
> with a string literal. We expect strcmp() to behave safely even if the
> string variable is not NUL-terminated.
> 
> In the same scenario, Linux v5.2-rc7 uses both strcmp() and strncmp(),
> but the frequency of strcmp() is higher:
> 
> $ git --version
> git version 2.22.0
> $ (Linux 5.2-rc7) git grep -En 'strncmp\([^"]*"[[:alnum:]]+"' | wc -l
> 1066
> $ (Linux 5.2-rc7) git grep -En 'strcmp\([^"]*"[[:alnum:]]+"' | wc -l
> 1968
> 
> A quick "strcmp vs strncmp" object size test shows that strcmp()
> generates smaller memory footprint (gcc-8, x86_64):
> 
> $ (U-Boot) size cmd/bcb-strncmp.o cmd/bcb-strcmp.o
>text  data bss dec hex filename
>3373   4002048582116bd cmd/bcb-strncmp.o
>3314   400204857621682 cmd/bcb-strcmp.o
> 
> So, overall, I agree to use strcmp() whenever variables are compared
> with string literals.
>  --8<---
> 
> Fixes: db7b7a05b267 ("cmd: Add 'bcb' command to read/modify/write BCB fields")
> Reported-by: Simon Glass 
> Signed-off-by: Eugeniu Rosca 
> Reviewed-by: Sam Protsenko 
> Reviewed-by: Igor Opaniuk 

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 2/2] doc: Add the U-Boot logo to the html doc

2019-07-24 Thread Tom Rini
On Tue, Jul 16, 2019 at 09:39:20AM -0700, Bin Meng wrote:

> Now we have a logo for U-Boot, we can include it in the Sphinx
> html doc.
> 
> Signed-off-by: Bin Meng 

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 v3 4/4] cmd: bcb: Apply non-functional refinements

2019-07-24 Thread Tom Rini
On Fri, Jul 19, 2019 at 11:26:14PM +0200, Eugeniu Rosca wrote:

> These have been reported by Simon in [1] and fixed in [2].
> However, since [1] has already been pushed to u-boot/master, the
> improvements incorporated in [2] are now extracted and resubmitted.
> 
> The changes are in the area of coding style and best practices:
> * s/field/fieldp/, s/size/sizep/, to convey that the variables return
>   an output to the caller
> * s/err_1/err_read_fail/, s/err_2/err_too_small/, to be more descriptive
> * Made sure 'static int do_bcb_load' appears on the same line
> * Placed a `/*` on top of multi-line comment
> 
> [1] https://patchwork.ozlabs.org/patch/1104244/#2200259
> [2] https://patchwork.ozlabs.org/cover/1128661/
>("[v4,0/4] Add 'bcb' command to read/modify/write Android BCB")
> 
> Fixes: db7b7a05b267 ("cmd: Add 'bcb' command to read/modify/write BCB fields")
> Reported-by: Simon Glass 
> Signed-off-by: Eugeniu Rosca 
> Reviewed-by: Sam Protsenko 

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] remoteproc: Fix potential build issues with SPL remoteproc

2019-07-24 Thread Tom Rini
On Fri, Jul 19, 2019 at 10:27:56AM -0500, Suman Anna wrote:

> The rproc uclass driver can either be built with SPL_REMOTEPROC
> or REMOTEPROC, but the function prototypes in remoteproc.h are
> defined only when CONFIG_REMOTEPROC is defined. This can cause
> build issues in SPL if CONFIG_REMOTEPROC is not selected.
> 
> Fix this by replacing the existing precompiler macro usage with
> CONFIG_IS_ENABLED.
> 
> Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
> Signed-off-by: Suman Anna 
> Reviewed-by: Nishanth Menon 
> Reviewed-by: Lokesh Vutla 

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 v3 2/4] cmd: bcb: Fix duplicated handling in two case-branches

2019-07-24 Thread Tom Rini
On Fri, Jul 19, 2019 at 11:26:12PM +0200, Eugeniu Rosca wrote:

> Fix warning V1037 reported by PVS-Studio Static Analyzer:
> Two or more case-branches perform the same actions. Check lines: 49, 53
> 
> Fixes: db7b7a05b267 ("cmd: Add 'bcb' command to read/modify/write BCB fields")
> Signed-off-by: Eugeniu Rosca 
> Reviewed-by: Igor Opaniuk 
> Reviewed-by: Sam Protsenko 

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] doc: fitImage: Fix conf number incrementation

2019-07-24 Thread Tom Rini
On Wed, Jul 17, 2019 at 05:57:16PM +0200, Mickaël Tansorier wrote:

> Increment conf id to avoid to have two same conf name
> into one configuration description.
> 
> Signed-off-by: Mickaël Tansorier 

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 v2] psci: Fix warnings when compiling with W=1

2019-07-24 Thread Tom Rini
On Mon, Jul 22, 2019 at 02:19:20PM +0200, Patrick Delaunay wrote:

> This patch solves the following warnings:
> arch/arm/mach-stm32mp/psci.c:
> 
> warning: no previous prototype for ‘psci_set_state’ [-Wmissing-prototypes]
> warning: no previous prototype for ‘psci_arch_cpu_entry’ 
> [-Wmissing-prototypes]
> warning: no previous prototype for ‘psci_features’ [-Wmissing-prototypes]
> warning: no previous prototype for ‘psci_version’ [-Wmissing-prototypes]
> warning: no previous prototype for ‘psci_affinity_info’ [-Wmissing-prototypes]
> warning: no previous prototype for ‘psci_migrate_info_type’ 
> [-Wmissing-prototypes]
> warning: no previous prototype for ‘psci_cpu_on’ [-Wmissing-prototypes]
> warning: no previous prototype for ‘psci_cpu_off’ [-Wmissing-prototypes]
> warning: no previous prototype for ‘psci_system_reset’ [-Wmissing-prototypes]
> warning: no previous prototype for ‘psci_system_off’ [-Wmissing-prototypes]
> 
> Signed-off-by: Patrick Delaunay 

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/1] doc: Cope with Sphinx logging deprecations

2019-07-24 Thread Tom Rini
On Sun, Jul 14, 2019 at 10:35:45AM +0200, Heinrich Schuchardt wrote:

> From: Jonathan Corbet 
> 
> Recent versions of sphinx will emit messages like:
> 
>   doc/sphinx/kerneldoc.py:103:
>  RemovedInSphinx20Warning: app.warning() is now deprecated.
>  Use sphinx.util.logging instead.
> 
> Switch to sphinx.util.logging to make this unsightly message go away.
> Alas, that interface was only added in version 1.6, so we have to add a
> version check to keep things working with older sphinxes.
> 
> Signed-off-by: Jonathan Corbet 
> Rebased for U-Boot
> 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] [PATCH v5 6/6] env: am57xx: Implement A/B boot process

2019-07-24 Thread Tom Rini
On Fri, Jul 05, 2019 at 03:37:36PM +0300, Igor Opaniuk wrote:

> From: Ruslan Trofymenko 
> 
> Add support for A/B boot process on AM57xx based boards:
> 
>   1. Define 'slot_suffix' variable (using 'ab_select' command)
>   2. Extend 'emmc_android_boot' boot command (add commands for A/B boot
>  process)
> 
> 'ab_select' command is used to decide which slot should be used for
> booting up. A/B metadata resides in 'misc' partition.
> 
> To activate the A/B boot process, the following config options must be
> set:
> 
> CONFIG_ANDROID_AB=y
> CONFIG_CMD_AB_SELECT=y
> 
> For successful A/B boot, the corresponding A/B infrastructure must be
> involved on Android side [1] (including mounting system as root), and
> disk must be partitioned accordingly.
> 
> When A/B boot is enabled, there are some known limitations currently
> exist (not related to A/B patches, need to be implemented later):
> 
>   1. The 'Verified Boot' sequence is not supported
>   2. dev path to system partition (system_a or system_b) is passed via
>  'bootargs' as 'root=' argument like 'root=/dev/mmcblk1p12', but
>  further we'll need to rework it with respect to dm-verity
>  requirements [2]
> 
> In case when A/B partitions are not present in system (and A/B boot is
> enabled), boot up process will be terminated and next message will be
> shown:
> 
> "boot_a(b) partition not found"
> 
> [1] https://source.android.com/devices/tech/ota/ab
> [2] https://source.android.com/devices/tech/ota/ab/ab_implement#kernel
> 
> Signed-off-by: Ruslan Trofymenko 
> Signed-off-by: Igor Opaniuk 
> Signed-off-by: Sam Protsenko 
> Reviewed-by: Alistair Strachan 
> Reviewed-by: Sam Protsenko 
> 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] [PATCH v5 5/6] doc: android: Add simple guide for A/B updates

2019-07-24 Thread Tom Rini
On Fri, Jul 05, 2019 at 03:37:35PM +0300, Igor Opaniuk wrote:

> From: Ruslan Trofymenko 
> 
> Add a short documentation for A/B enablement and 'ab_select' command
> usage.
> 
> Signed-off-by: Ruslan Trofymenko 
> Signed-off-by: Igor Opaniuk 
> Signed-off-by: Sam Protsenko 
> Reviewed-by: Alistair Strachan 
> Reviewed-by: Sam Protsenko 
> 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] [PATCH] doc: fitImage: Cosmetics break lines

2019-07-24 Thread Tom Rini
On Wed, Jul 17, 2019 at 05:57:29PM +0200, Mickaël Tansorier wrote:

> Add missing newline before title and subtitle.
> 
> Signed-off-by: Mickaël Tansorier 

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 v5 1/6] disk: part: Extend API to get partition info

2019-07-24 Thread Tom Rini
On Fri, Jul 05, 2019 at 03:37:31PM +0300, Igor Opaniuk wrote:

> From: Ruslan Trofymenko 
> 
> This patch adds part_get_info_by_dev_and_name_or_num() function which
> allows us to get partition info from its number or name. Partition of
> interest is specified by string like "device_num:partition_number" or
> "device_num#partition_name".
> 
> The patch was extracted from [1].
> 
> [1] 
> https://android-review.googlesource.com/c/platform/external/u-boot/+/729880/2
> 
> Signed-off-by: Ruslan Trofymenko 
> Signed-off-by: Igor Opaniuk 
> Reviewed-by: Alistair Strachan 
> Reviewed-by: Sam Protsenko 
> 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] [PATCH v5 3/6] cmd: Add 'ab_select' command

2019-07-24 Thread Tom Rini
On Fri, Jul 05, 2019 at 03:37:33PM +0300, Igor Opaniuk wrote:

> From: Ruslan Trofymenko 
> 
> For A/B system update support the Android boot process requires to send
> 'androidboot.slot_suffix' parameter as a command line argument. This
> patch implementes 'ab_select' command which allows us to obtain current
> slot by processing the A/B metadata.
> 
> The patch was extracted from commit [1] with one modification: the
> separator for specifying the name of metadata partition was changed
> from ';' to '#', because ';' is used for commands separation.
> 
> [1] 
> https://android-review.googlesource.com/c/platform/external/u-boot/+/729880/2
> 
> Signed-off-by: Ruslan Trofymenko 
> Signed-off-by: Igor Opaniuk 
> Reviewed-by: Alistair Strachan 
> Reviewed-by: Sam Protsenko 
> 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] [PATCH 1/2] scripts/kernel-doc: update script from Linux 5.2

2019-07-24 Thread Tom Rini
On Sun, Jul 14, 2019 at 11:30:22AM +0200, Heinrich Schuchardt wrote:

> Update the script from Linux 5.2 to avoid some warnings.
> 
> 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] [PATCH v5 4/6] test/py: Add base test case for A/B updates

2019-07-24 Thread Tom Rini
On Fri, Jul 05, 2019 at 03:37:34PM +0300, Igor Opaniuk wrote:

> From: Ruslan Trofymenko 
> 
> Add sandbox test for 'ab_select' command.
> 
> Test: ./test/py/test.py --bd sandbox --build -k test_ab
> 
> Signed-off-by: Ruslan Trofymenko 
> Signed-off-by: Igor Opaniuk 
> Signed-off-by: Sam Protsenko 
> Reviewed-by: Alistair Strachan 
> Reviewed-by: Sam Protsenko 
> 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] [PATCH 2/2] scripts/kernel-doc: fix parsing of function pointers

2019-07-24 Thread Tom Rini
On Sun, Jul 14, 2019 at 11:30:23AM +0200, Heinrich Schuchardt wrote:

> kernel-doc fails to parse function definitions like the one below
> 
> efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl,
> void (EFIAPI *notify_function) (
>   struct efi_event *event,
>   void *context),
> void *notify_context, efi_guid_t *group,
> struct efi_event **event)
> {
> 
> due to the "EFIAPI" attribute preceding the function name.
> 
> cf. https://lkml.org/lkml/2018/9/3/1185
> 
> 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] [PATCH 1/2] doc: Add .gitignore for the Sphinx build output directory

2019-07-24 Thread Tom Rini
On Tue, Jul 16, 2019 at 09:39:19AM -0700, Bin Meng wrote:

> With Sphinx documentation moving from Documentation directory
> to doc directory, we missed updating .gitignore for the Sphinx
> build output directory.
> 
> Signed-off-by: Bin Meng 

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 v5 2/6] common: Implement A/B metadata

2019-07-24 Thread Tom Rini
On Fri, Jul 05, 2019 at 03:37:32PM +0300, Igor Opaniuk wrote:

> From: Ruslan Trofymenko 
> 
> This patch determines the A/B-specific bootloader message structure
> that is the basis for implementation of recovery and A/B update
> functions. A/B metadata is stored in this structure and used to decide
> which slot should we use to boot the device. Also some basic functions
> for A/B metadata manipulation are implemented (like slot selection).
> 
> The patch was extracted from commits [1], [2] with some coding style
> fixes.
> 
> [1] 
> https://android-review.googlesource.com/c/platform/external/u-boot/+/729878/2
> [2] 
> https://android-review.googlesource.com/c/platform/external/u-boot/+/729880/2
> 
> Signed-off-by: Ruslan Trofymenko 
> Signed-off-by: Igor Opaniuk 
> Reviewed-by: Sam Protsenko 
> 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] [PATCH] image: android: allow to wrap uImage into the Android boot image

2019-07-24 Thread Tom Rini
On Mon, Jun 03, 2019 at 03:38:13PM +0300, roman.stratiie...@globallogic.com 
wrote:

> From: Roman Stratiienko 
> 
> This allows to use any available compression format with Android boot image
> 
> Since not all available compression formats have a magic number we should
> explicitly specify type of compression.
> 
> For this purpose using uImage format becomes very useful, as this format is
> well-known by the community and mkimage tool is already available.
> 
> Usage example:
> mkimage -A ARM64 -T kernel -C lzma -d Image.lzma out/kernel
> 
> At this moment only -C option is handled, but specifying -A and -T options
> are recommended for compatibility reasons in the future.
> 
> Kernel that compressed with LZ4 can be already used without wrapping into
> the uImage, but I recommend wrapping it into the uImage in order to avoid
> situations when by some mistake legacy LZ4 is used, that is interpreted as
> raw Image and causes CPU to enter Exception Handler without providing any
> meaningful explanation to the user.
> 
> Signed-off-by: Roman Stratiienko 

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 v5 1/1] cmd: part: Add 'number' sub-command

2019-07-24 Thread Tom Rini
On Fri, Jun 14, 2019 at 05:01:26PM +0300, Igor Opaniuk wrote:

> From: Ruslan Trofymenko 
> 
> This sub-command serves for getting the partition index from
> partition name. Also it can be used to test the existence of specified
> partition.
> 
> Use case:
> For example, in most CI environments this U-Boot command for automatic
> testing of Linux rootfs is used:
> 
> => setenv bootpart 1:f
> 
> where 0xf is "userdata" partition. But the number of "userdata"
> partition can be changed any time, when partition table is changed.
> 
> So it would be nice to get rid of that 0xf magic number and use
> partition name instead, like this:
> 
> => part number mmc 1 userdata part_num
> => setenv bootpart 1:${part_num}
> 
> Signed-off-by: Ruslan Trofymenko 
> Signed-off-by: Igor Opaniuk 
> Reviewed-by: Alistair Strachan 
> Reviewed-by: Sam Protsenko 
> Reviewed-by: Simon Glass 
> Reviewed-by: Sam Protsenko 

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 00/50] doc: Shape into useful HTML docs

2019-07-24 Thread Tom Rini
On Thu, Jul 18, 2019 at 12:33:45AM -0700, Bin Meng wrote:

> At present there is Sphinx doc build system in U-Boot, however the
> contents are very limited, e.g.: only a few API descriptions like
> EFI, are included.
> 
> This series proposes an initial Sphinx doc layout for future extension,
> by converting some of the plain text documentation to reStructuredText
> format and add it to Sphinx TOC tree.
> 
> With this series, now we have the following major chapters in our
> U-Boot HTML doc:
> 
> - Driver Model
> - U-Boot API documentation
> - Architecture-specific doc
> - Board-specific doc
> 
> Board specific documents are put in a vendor subdirectory, just like
> what we have in /board. All x86 & RISC-V board docs are
> converted to reST. A few other board docs are converted too.
> 
> Tested by generating the HTML docs, 0 build warnings.
> 
> This patch is rebased on https://patchwork.ozlabs.org/patch/1131726/.
> 
> @Wolfgang, is it possible to host the Sphinx HTML docs on denx.de?
> 
> This series is available at u-boot-x86/doc for testing.
> 
> 
> Bin Meng (50):
>   doc: Move existing rst files into api sub-directory
>   doc: Add top-level description about U-Boot documentation
>   doc: Add driver-model to Sphinx TOC tree
>   doc: driver-model: Convert README.txt to reST
>   doc: driver-model: Convert MIGRATION.txt to reST
>   doc: driver-model: Convert fdt-fixup.txt to reST
>   doc: driver-model: Convert fs_firmware_loader.txt to reST
>   doc: driver-model: Convert i2c-howto.txt to reST
>   doc: driver-model: Convert livetree.txt to reST
>   doc: driver-model: Convert of-plat.txt to reST
>   doc: driver-model: Convert pci-info.txt to reST
>   doc: driver-model: Convert pmic-framework.txt to reST
>   doc: driver-model: Convert remoteproc-framework.txt to reST
>   doc: driver-model: Convert serial-howto.txt to reST
>   doc: driver-model: Convert spi-howto.txt to reST
>   doc: driver-model: Convert usb-info.txt to reST
>   doc: Add architecture specific info to Sphinx TOC tree
>   doc: arch: Convert README.mips to reST
>   doc: Add board specific info to Sphinx TOC tree
>   doc: board: Add Intel Crown Bay board doc
>   doc: board: Add Intel Bay Trail based board docs
>   doc: board: Add Intel Cherry Hill board doc
>   doc: board: Add Intel Cougar Canyon 2 board doc
>   doc: board: Add Intel Edison board doc
>   doc: board: Add Intel Galileo board doc
>   doc: board: Add Google Chromebook Link board doc
>   doc: board: Add Google Chromebook Samus board doc
>   doc: board: Add coreboot board doc
>   doc: board: Add QEMU x86 board doc
>   doc: board: Convert README.qemu-arm to reST
>   doc: board: Convert README.qemu-riscv to reST
>   doc: board: Convert README.qemu-mips to reST
>   doc: board: Add AndesTech ax25-ae350 board doc
>   doc: board: Convert README.ag101p to reST
>   doc: board: Convert README.sifive-fu540 to reST
>   doc: board: Convert README.sh7752evb to reST
>   doc: board: Convert README.sh7753evb to reST
>   doc: board: Convert README.at91 to reST
>   doc: board: Convert README.b4860qds to reST
>   doc: board: Convert README.zynq to reST
>   doc: arch: Convert README.x86 to reST
>   doc: arch: Convert README.arm64 to reST
>   doc: arch: Convert README.NDS32 to reST
>   doc: arch: Convert README.nios2 to reST
>   doc: arch: Convert README.ARC to reST
>   doc: arch: Convert README.m68k to reST
>   doc: arch: Convert README.sh to reST
>   doc: arch: Convert README.sandbox to reST
>   doc: arch: Convert README.xtensa to reST
>   doc: Remove README.blackfin

For the series, 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] Please pull u-boot-dm (take 2)

2019-07-24 Thread Simon Glass
Hi Tom,

On Wed, 24 Jul 2019 at 10:13, Tom Rini  wrote:
>
> On Tue, Jul 23, 2019 at 08:36:58PM -0700, Simon Glass wrote:
>
> > Hi Tom,
> >
> > This includes the gitlab fix and also I updated ifwitool.c to drop the
> > unused inline functions.
> >
> >
> > The following changes since commit ff8c23e784f57a7098e91a200ed7f5a48612b653:
> >
> >   Merge tag 'u-boot-stm32-20190723' of
> > https://gitlab.denx.de/u-boot/custodians/u-boot-stm (2019-07-23
> > 14:16:21 -0400)
> >
> > are available in the Git repository at:
> >
> >   git://git.denx.de/u-boot-dm.git tags/dm-pull-23jul19-take2
> >
> > for you to fetch changes up to 6e38047b66e37659b937cf301e0de37a90d9eaa2:
> >
> >   dm: device: make power domain calls optional (2019-07-23 20:27:58 -0700)
> >
>
> We're still not there yet, sorry.  Taking a look at
> https://gitlab.denx.de/u-boot/u-boot/-/jobs/1464 we're now running
> things but ifwitool is failing.  Can you please take a look?  You will
> need the patch I posted that brings us up to a newer image that has
> lzma-alone. Thanks!

OK, this is another update that is needed to the gitlab config, this
time the --toolpath argument. Will send an update.

I was rather hoping that pushing to gitlab u-boot-dm would start a
build but it does not, for me. I probably need to do some more
reading.

BTW Is there an intent to shut down travis?

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


[U-Boot] Please pull u-boot-dm (take 3)

2019-07-24 Thread Simon Glass
Hi Tom,

The following changes since commit ff8c23e784f57a7098e91a200ed7f5a48612b653:

  Merge tag 'u-boot-stm32-20190723' of
https://gitlab.denx.de/u-boot/custodians/u-boot-stm (2019-07-23
14:16:21 -0400)

are available in the Git repository at:

  git://git.denx.de/u-boot-dm.git tags/dm-pull-24jul19-take3

for you to fetch changes up to 44e02e39a91cd91aae5a28d90259d3a6996010bf:

  dm: device: make power domain calls optional (2019-07-24 12:54:08 -0700)


Minor driver-model fixes and tweaks
A few device-tree fixes
Binman support for extracting files from an image


Anatolij Gustschin (1):
  dm: device: make power domain calls optional

Baruch Siach (2):
  dm: uclass: fix comment copy/paste error
  buildman: fix invocation examples typos

Bin Meng (4):
  dm: timer: Skip device that does not have a valid ofnode in pre_probe()
  dm: core: Call clk_set_defaults() during probe() only for a valid ofnode
  dm: core: Set correct "status" value for a node
  dm: Fix parameter description of dev_read_name()

Marek Vasut (1):
  common: fdt_support: Add missing cpu_to_fdt32() to fdt_pci_dma_ranges()

Masahiro Yamada (1):
  fdt: make fdt_get_base_address() return OF_BAD_ADDR when "reg" not found

Sekhar Nori (1):
  clk: initialize clk->data when using default xlate

Simon Glass (68):
  x86: Add ifwitool for Intel Integrated Firmware Image
  cbfs: Add an enum and comment for the magic number
  cbfs: Rename checksum to attributes_offset
  tools: Drop duplicate raise_on_error argument
  binman: Fix comment in bsection.GetEntries()
  binman: Correct two typos in function names in ftest
  binman: Add coverage tools info for Python 3
  patman: Add a way to set the search path for tools
  binman: Add a --toolpath option to set the tool search path
  binman: Add missing comments to bsection
  binman: Add missing comments toentry
  binman: Tidy up help for --indir
  binman: Use a better error for missing Intel descriptor
  binman: Detect skipped tests
  binman: Add a function to create a sample ELF file
  binman: Add a function to decode an ELF file
  binman: Ensure that coverage has access to site packages
  binman: Assume Intel descriptor is at the start of the image
  binman: Don't assume there is an ME region
  binman: Update entry.SetOffsetSize to be optional
  binman: Allow text directly in the node
  patman: Add functions to compress and decompress data
  binman: Use the tools.Decompress method
  binman: Drop unnecessary debug handling
  binman: Use tools compression function for blob handling
  binman: Correct comment in u_boot_spl_elf
  binman: Support ELF files for TPL
  binman: Fix up the _DoTestFile() function -u argument
  binman: Allow verbosity control when running tests
  binman: Allow preserving test directories
  binman: Pass the toolpath to tests
  patman: Add a function to write ifwitool
  binman: Add a utility library for coreboot CBFS
  binman: Add support for CBFS entries
  binman: Add support for Intel IFWI entries
  binman: Pad empty areas of the CBFS with files
  binman: Add support for fixed-offset files in CBFS
  binman: Simplify the entry test
  binman: Update future features
  binman: Update help for new features
  binman: Add a convenience functions for real-DTB tests
  binman: Add an FDT map
  binman: Add an image header
  binman: Convert to use ArgumentParser
  binman: Move compression into the Entry base class
  binman: Drop an unused arg in Entry.Lookup()
  binman: Allow easy importing of entry modules
  binman: Fix up ProcessUpdateContents error and comments
  binman: Call ProcessUpdateContents() consistently
  binman: Add a return value to ProcessContentsUpdate()
  binman: Add a control for post-pack entry expansion
  binman: Allow entries to expand after packing
  binman: Allow device-tree entries to be compressed
  binman: Provide the actual data address for cbfs files
  binman: Use the cbfs memlen field only for uncompressed length
  binman: Support FDT update for CBFS
  binman: Detect bad CBFS file types
  binman: Allow listing the entries in an image
  binman: Support locating an FDT map
  binman: Support locating an image header
  binman: Support reading an image into an Image object
  binman: Convert Image to a subclass of Entry
  binman: Support listing an image
  binman: Allow for logging information to be displayed
  binman: Allow reading an entry from an image
  binman: Support reading from CBFS entries
  binman: Add an 'extract' command
  binman: Add a test for nested and aligned sections

 .gitlab-ci.yml |2 +-
 

Re: [U-Boot] [PATCH] Dockerfile: Build a copy of QEMU and install it under /opt

2019-07-24 Thread Tom Rini
On Wed, Jul 24, 2019 at 03:51:14PM -0400, Tom Rini wrote:

> In order to run our test.py suite on a number of platforms in CI we use
> QEMU.  Configure and build a copy here so that all our jobs can rely on
> it as our code is under test and not QEMU.
> 
> Signed-off-by: Tom Rini 

I looked into using the artifact method in GitLab.  The problem there is
that artifacts are stored within the job and kept.  So rather than a
stand-alone project that we can reference and pass we would build it
once per pipeline and pass it, but then store it until we purge things
later when we notice gitlab.denx.de is out of space.  Going this route I
think makes the most sense for what we do.  It does remove the ability
to roll back a single platform (or platforms) to an older QEMU but I'm
not sure that's a big deal and we COULD re-do that as needed.  Over at
https://gitlab.denx.de/u-boot/u-boot/pipelines/324 all QEMU platforms
pass again so we can use the latest version which allows evb-ast2500 to
be used.

-- 
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] gitlab-ci: Switch to a Docker image that contains a QEMU we build

2019-07-24 Thread Tom Rini
Rather than buiding QEMU for each test.py build it once in our
Dockerfile and re-use it as needed.

Signed-off-by: Tom Rini 
---
 .gitlab-ci.yml | 36 +---
 1 file changed, 5 insertions(+), 31 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e27d86f96281..e2b73c1272b5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,12 +2,12 @@
 
 # Grab our configured image.  The source for this is found at:
 # https://gitlab.denx.de/u-boot/gitlab-ci-runner
-image: trini/u-boot-gitlab-ci-runner:xenial-20190222-24April2019
+image: trini/u-boot-gitlab-ci-runner:xenial-20190720-24Jul2019-b
 
 # We run some tests in different order, to catch some failures quicker.
 stages:
-  - test.py
   - testsuites
+  - test.py
   - world build
 
 .buildman_and_testpy_template: _and_testpy_dfn
@@ -28,17 +28,9 @@ stages:
 - ( cd ~/grub2-arm; wget -O - 
http://download.opensuse.org/ports/armv7hl/distribution/leap/42.2/repo/oss/suse/armv7hl/grub2-arm-efi-2.02~beta2-87.1.armv7hl.rpm
 | rpm2cpio | cpio -di )
 - mkdir ~/grub2-arm64
 - ( cd ~/grub2-arm64; wget -O - 
http://download.opensuse.org/ports/aarch64/distribution/leap/42.2/repo/oss/suse/aarch64/grub2-arm64-efi-2.02~beta2-87.1.aarch64.rpm
 | rpm2cpio | cpio -di )
-- if [[ "${QEMU_TARGET}" != "" ]]; then
-git clone git://git.qemu.org/qemu.git /tmp/qemu;
-pushd /tmp/qemu;
-git submodule update --init dtc &&
-git checkout ${QEMU_VERSION} &&
-./configure --prefix=/tmp/qemu-install --target-list=${QEMU_TARGET} &&
-make -j$(nproc) all install;
-popd;
-  fi
+
   after_script:
-- rm -rf ~/grub2* /tmp/uboot-test-hooks /tmp/qemu /tmp/venv
+- rm -rf ~/grub2* /tmp/uboot-test-hooks /tmp/venv
   script:
 # From buildman, exit code 129 means warnings only.  If we've been asked to
 # use clang only do one configuration.
@@ -55,7 +47,7 @@ stages:
 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
 # value.
 - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD};
-  export 
PATH=/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin;
+  export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin;
   export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
   if [[ "${TEST_PY_BD}" != "" ]]; then
 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
@@ -200,8 +192,6 @@ evb-ast2500 test.py:
   variables:
 TEST_PY_BD: "evb-ast2500"
 TEST_PY_ID: "--id qemu"
-QEMU_TARGET: "arm-softmmu"
-QEMU_VERSION: "506179e42112be77bfd071f050b15762d3b2cd43"
 BUILDMAN: "^evb-ast2500$"
   <<: *buildman_and_testpy_dfn
 
@@ -217,8 +207,6 @@ vexpress_ca15_tc2 test.py:
   variables:
 TEST_PY_BD: "vexpress_ca15_tc2"
 TEST_PY_ID: "--id qemu"
-QEMU_TARGET: "arm-softmmu"
-QEMU_VERSION: "v3.0.0"
 BUILDMAN: "^vexpress_ca15_tc2$"
   <<: *buildman_and_testpy_dfn
 
@@ -227,7 +215,6 @@ vexpress_ca9x4 test.py:
   variables:
 TEST_PY_BD: "vexpress_ca9x4"
 TEST_PY_ID: "--id qemu"
-QEMU_TARGET: "arm-softmmu"
 BUILDMAN: "^vexpress_ca9x4$"
   <<: *buildman_and_testpy_dfn
 
@@ -237,7 +224,6 @@ integratorcp_cm926ejs test.py:
 TEST_PY_BD: "integratorcp_cm926ejs"
 TEST_PY_TEST_SPEC: "not sleep"
 TEST_PY_ID: "--id qemu"
-QEMU_TARGET: "arm-softmmu"
 BUILDMAN: "^integratorcp_cm926ejs$"
   <<: *buildman_and_testpy_dfn
 
@@ -246,7 +232,6 @@ qemu_arm test.py:
   variables:
 TEST_PY_BD: "qemu_arm"
 TEST_PY_TEST_SPEC: "not sleep"
-QEMU_TARGET: "arm-softmmu"
 BUILDMAN: "^qemu_arm$"
   <<: *buildman_and_testpy_dfn
 
@@ -255,7 +240,6 @@ qemu_arm64 test.py:
   variables:
 TEST_PY_BD: "qemu_arm64"
 TEST_PY_TEST_SPEC: "not sleep"
-QEMU_TARGET: "aarch64-softmmu"
 BUILDMAN: "^qemu_arm64$"
   <<: *buildman_and_testpy_dfn
 
@@ -264,7 +248,6 @@ qemu_mips test.py:
   variables:
 TEST_PY_BD: "qemu_mips"
 TEST_PY_TEST_SPEC: "not sleep"
-QEMU_TARGET: "mips-softmmu"
 BUILDMAN: "^qemu_mips$"
 TOOLCHAIN: "mips"
   <<: *buildman_and_testpy_dfn
@@ -274,7 +257,6 @@ qemu_mipsel test.py:
   variables:
 TEST_PY_BD: "qemu_mipsel"
 TEST_PY_TEST_SPEC: "not sleep"
-QEMU_TARGET: "mipsel-softmmu"
 BUILDMAN: "^qemu_mipsel$"
 TOOLCHAIN: "mips"
   <<: *buildman_and_testpy_dfn
@@ -284,7 +266,6 @@ qemu_mips64 test.py:
   variables:
 TEST_PY_BD: "qemu_mips64"
 TEST_PY_TEST_SPEC: "not sleep"
-QEMU_TARGET: "mips64-softmmu"
 BUILDMAN: "^qemu_mips64$"
 TOOLCHAIN: "mips"
   <<: *buildman_and_testpy_dfn
@@ -294,7 +275,6 @@ qemu_mips64el test.py:
   variables:
 TEST_PY_BD: "qemu_mips64el"
 TEST_PY_TEST_SPEC: "not sleep"
-QEMU_TARGET: "mips64el-softmmu"
 BUILDMAN: "^qemu_mips64el$"
 TOOLCHAIN: "mips"
   <<: *buildman_and_testpy_dfn
@@ -304,7 +284,6 @@ qemu-ppce500 test.py:
   variables:
 TEST_PY_BD: "qemu-ppce500"
 TEST_PY_TEST_SPEC: "not sleep"
-QEMU_TARGET: "ppc-softmmu"
 BUILDMAN: 

Re: [U-Boot] [PATCH] gitlab-ci: Update Docker image to xenial-20190720-24Jul2019 tag

2019-07-24 Thread Simon Glass
On Wed, 24 Jul 2019 at 08:30, Tom Rini  wrote:
>
> - Add in lzma-alone for current binman tests
> - Update to Ubuntu's xenial-20190720 tag (latest).
>
> Signed-off-by: Tom Rini 
> ---
>  .gitlab-ci.yml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH] gitlab-ci: Add pyelftools to the binman testsuite section

2019-07-24 Thread Simon Glass
On Wed, 24 Jul 2019 at 10:15, Tom Rini  wrote:
>
> We need pyelftools here to run rather than skip some tests.
>
> Signed-off-by: Tom Rini 
> ---
>  .gitlab-ci.yml | 3 +++
>  1 file changed, 3 insertions(+)

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


[U-Boot] [PATCH] Dockerfile: Build a copy of QEMU and install it under /opt

2019-07-24 Thread Tom Rini
In order to run our test.py suite on a number of platforms in CI we use
QEMU.  Configure and build a copy here so that all our jobs can rely on
it as our code is under test and not QEMU.

Signed-off-by: Tom Rini 
---
 Dockerfile | 8 
 1 file changed, 8 insertions(+)

diff --git a/Dockerfile b/Dockerfile
index b599af8af6a0..73c1b8b1e021 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -76,6 +76,14 @@ RUN apt-get update && apt-get install -y \
zip \
&& rm -rf /var/lib/apt/lists/*
 
+RUN git clone git://git.qemu.org/qemu.git /tmp/qemu && \
+   cd /tmp/qemu && \
+   git submodule update --init dtc && \
+   git checkout 506179e42112be77bfd071f050b15762d3b2cd43 && \
+   ./configure --prefix=/opt/qemu 
--target-list="aarch64-softmmu,arm-softmmu,i386-softmmu,mips-softmmu,mips64-softmmu,mips64el-softmmu,mipsel-softmmu,ppc-softmmu,x86_64-softmmu,xtensa-softmmu"
 && \
+   make -j$(nproc) all install && \
+   rm -rf /tmp/qemu
+
 # Create the buildman config file
 RUN /bin/echo -e "[toolchain]\nroot = /usr" > ~/.buildman
 RUN /bin/echo -e "kernelorg = /opt/gcc-7.3.0-nolibc/*" >> ~/.buildman
-- 
2.7.4

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


Re: [U-Boot] [PATCH] core: ofnode: do not assert if node not valid in ofnode_get_name()

2019-07-24 Thread Simon Glass
On Thu, 18 Jul 2019 at 20:24, Kever Yang  wrote:
>
> In some case with LIVE DT, some node always not valid, or not have
> a valid name, eg. blk driver add by mmc.
> Return fail instead of Assert for this kind of ofnode, and this
> help with assert happen from time to time when of_live is enabled
> and DEBUG is enabled.
>
> Signed-off-by: Kever Yang 
> ---
>
>  drivers/core/ofnode.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH 1/4] imx: add module fuse support

2019-07-24 Thread Lukasz Majewski
Hi Frieder,

> >>
> >> Is there any markings on the SoC? (like MX6ULXX) which
> >> indicates which SoC has enet and which doesn't have one?  
> 
> Yes, you can look in the datasheets. For i.MX6ULL ([1], [2]) for 
> example, there is a table in chapter 1.1, which describes the
> features for the different types and the corresponding part numbers.
> And the part numbers are printed on the chips.

Thanks for the info.

> 
> Regards,
> Frieder
> 
> [1] https://www.nxp.com/docs/en/data-sheet/IMX6ULLCEC.pdf
> [2] https://www.nxp.com/docs/en/data-sheet/IMX6ULLIEC.pdf




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-59 Fax: (+49)-8142-66989-80 Email: lu...@denx.de


pgpI8KQKm04U0.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 v2 1/3] pinctrl: nxp: DM_FLAG_PRE_RELOC by default

2019-07-24 Thread Lukasz Majewski
Hi Igor,

> From: Igor Opaniuk 
> 
> For NXP SoCs we have to set pinmux configuration ASAP (ideally
> before relocation) to get serial console working. Without this we miss
> almost the half of output (U-boot version, CPU defails, Reset cause,
> DRAM details etc.).
> 
> To achieve this we need to force appropriate pinctrl drivers to get
> probed before relocation.
> 
> Fixes: cd69e8ef9b ("colibri-imx6ull: migrate pinctrl and regulators
> to dtb/dm") Signed-off-by: Igor Opaniuk 
> ---
> 

Reviewed-by: Lukasz Majewski 

BTW: I did the same for serial_mxc.c driver:
https://gitlab.denx.de/u-boot/custodians/u-boot-imx/commit/1b8c986b684c481d2a3a87200e80421129abe32e

> v2:
> - Addressed same issue for all NXP pinctrl drivers
> 
>  drivers/pinctrl/nxp/pinctrl-imx5.c| 2 --
>  drivers/pinctrl/nxp/pinctrl-imx6.c| 2 --
>  drivers/pinctrl/nxp/pinctrl-imx7.c| 2 --
>  drivers/pinctrl/nxp/pinctrl-imx7ulp.c | 2 --
>  4 files changed, 8 deletions(-)
> 
> diff --git a/drivers/pinctrl/nxp/pinctrl-imx5.c
> b/drivers/pinctrl/nxp/pinctrl-imx5.c index 4e831b6f39..5d17380919
> 100644 --- a/drivers/pinctrl/nxp/pinctrl-imx5.c
> +++ b/drivers/pinctrl/nxp/pinctrl-imx5.c
> @@ -40,7 +40,5 @@ U_BOOT_DRIVER(imx5_pinctrl) = {
>   .remove = imx_pinctrl_remove,
>   .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
>   .ops = _pinctrl_ops,
> -#if !CONFIG_IS_ENABLED(OF_CONTROL)
>   .flags = DM_FLAG_PRE_RELOC,
> -#endif
>  };
> diff --git a/drivers/pinctrl/nxp/pinctrl-imx6.c
> b/drivers/pinctrl/nxp/pinctrl-imx6.c index 0c1e7a9c05..aafa3057ad
> 100644 --- a/drivers/pinctrl/nxp/pinctrl-imx6.c
> +++ b/drivers/pinctrl/nxp/pinctrl-imx6.c
> @@ -49,7 +49,5 @@ U_BOOT_DRIVER(imx6_pinctrl) = {
>   .remove = imx_pinctrl_remove,
>   .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
>   .ops = _pinctrl_ops,
> -#if !CONFIG_IS_ENABLED(OF_CONTROL)
>   .flags = DM_FLAG_PRE_RELOC,
> -#endif
>  };
> diff --git a/drivers/pinctrl/nxp/pinctrl-imx7.c
> b/drivers/pinctrl/nxp/pinctrl-imx7.c index 8776fd9650..769d428dda
> 100644 --- a/drivers/pinctrl/nxp/pinctrl-imx7.c
> +++ b/drivers/pinctrl/nxp/pinctrl-imx7.c
> @@ -37,7 +37,5 @@ U_BOOT_DRIVER(imx7_pinctrl) = {
>   .remove = imx_pinctrl_remove,
>   .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
>   .ops = _pinctrl_ops,
> -#if !CONFIG_IS_ENABLED(OF_CONTROL)
>   .flags = DM_FLAG_PRE_RELOC,
> -#endif
>  };
> diff --git a/drivers/pinctrl/nxp/pinctrl-imx7ulp.c
> b/drivers/pinctrl/nxp/pinctrl-imx7ulp.c index d778f82aac..598bbfaf35
> 100644 --- a/drivers/pinctrl/nxp/pinctrl-imx7ulp.c
> +++ b/drivers/pinctrl/nxp/pinctrl-imx7ulp.c
> @@ -41,7 +41,5 @@ U_BOOT_DRIVER(imx7ulp_pinctrl) = {
>   .remove = imx_pinctrl_remove,
>   .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
>   .ops = _pinctrl_ops,
> -#if !CONFIG_IS_ENABLED(OF_CONTROL)
>   .flags = DM_FLAG_PRE_RELOC,
> -#endif
>  };




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-59 Fax: (+49)-8142-66989-80 Email: lu...@denx.de


pgpQEClxDp2po.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 00/50] doc: Shape into useful HTML docs

2019-07-24 Thread Heinrich Schuchardt

On 7/24/19 4:18 PM, Tom Rini wrote:

On Wed, Jul 24, 2019 at 10:16:31PM +0800, Bin Meng wrote:

Hi Tom,

On Wed, Jul 24, 2019 at 10:14 PM Tom Rini  wrote:


On Thu, Jul 18, 2019 at 12:33:45AM -0700, Bin Meng wrote:


At present there is Sphinx doc build system in U-Boot, however the
contents are very limited, e.g.: only a few API descriptions like
EFI, are included.

This series proposes an initial Sphinx doc layout for future extension,
by converting some of the plain text documentation to reStructuredText
format and add it to Sphinx TOC tree.

With this series, now we have the following major chapters in our
U-Boot HTML doc:

- Driver Model
- U-Boot API documentation
- Architecture-specific doc
- Board-specific doc

Board specific documents are put in a vendor subdirectory, just like
what we have in /board. All x86 & RISC-V board docs are
converted to reST. A few other board docs are converted too.

Tested by generating the HTML docs, 0 build warnings.

This patch is rebased on https://patchwork.ozlabs.org/patch/1131726/.

@Wolfgang, is it possible to host the Sphinx HTML docs on denx.de?

This series is available at u-boot-x86/doc for testing.


As a follow-up, please update .gitlab-ci.yml at least to include a run
of "make htmldocs".  If we need to update the Dockerfile to include new
utils we can do that too, thanks!


Yes, but I will need some time to study GitLab's .gitlab-ci.yml :)

Could that be done later?


Yes, to be clear, I asked for a follow-up as I have this otherwise
merged locally but can't test it since make htmldocs blows up about a
lack of required tools that I don't see documented.  Once my current
pipeline finishes (of other changes) I'll push this.



Hello Tom,

the necessary packages for Ubuntu Bionic to run 'make htmldocs' are:

build-essential sphinx-doc python3-sphinx

A warning occurs requesting packages graphviz and imagemagick.

Graphviz is currently not installable via apt-get but as we currently
have no graphics in our documentation you can simply ignore the warnings.

Cf.
https://www.katrinasiegfried.com/single-post/2018/10/24/Installing-GraphViz-on-Linux-Ubuntu-1804LTS

The ReadTheDocs theme can be installed via

git clone https://github.com/readthedocs/sphinx_rtd_theme
cd sphinx_rtd_theme/
sudo apt-get install python3-setuptools
python3 setup.py install

This theme is not really needed but the output looks much nicer.

The generated documentation is available under doc/output/.

Best regards

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


[U-Boot] [PATCH] ARM: dts: imx6q-logicpd: Add imx6q-logicpd-u-boot for SPL

2019-07-24 Thread Adam Ford
The SPL device tree is missing the entires for gpio1, uart1, usdhc1 and
usdhc2.  This creates a new imx6q-logicpd-u-boot.dtsi file
which will enable these functions so SPL can properly setup UART, detect
microSD card, and startup.

Fixes: 8f4691e31a18 ("ARM: imx6q_logic: With SPL_OF_CONTROL enabled,
remove MMC init")

Signed-off-by: Adam Ford 

diff --git a/arch/arm/dts/imx6q-logicpd-u-boot.dtsi 
b/arch/arm/dts/imx6q-logicpd-u-boot.dtsi
new file mode 100644
index 00..3f91853e35
--- /dev/null
+++ b/arch/arm/dts/imx6q-logicpd-u-boot.dtsi
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Logic PD 
+ */
+
+#include "imx6qdl-u-boot.dtsi"
+
+ {
+
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   u-boot,dm-spl;
+};
+
-- 
2.17.1

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


Re: [U-Boot] [PATCH v2 00/14] ARM: davinci: driver-model improvements

2019-07-24 Thread Joe Hershberger
On Wed, Jul 24, 2019 at 3:12 AM Bartosz Golaszewski  wrote:
>
> From: Bartosz Golaszewski 
>
> The following series contains all the patches for davinci that have
> been sent to the mailing list recently rebased on top of v2019.07 and
> retested on da850-lcdk and da850-evm. I collected all the review and
> test tags too.
>
> The first patch is the emac driver conversion to driver model. Patches
> 2-5 fix build warnings due to legacy interfaces usage. Patches 6-9 add
> support for driver model to the davinci NAND driver. Patches 10-13
> enable driver-model support in SPL for davinci. Last patch enables the
> driver model for NAND in SPL.
>
> These patches (except for the last, trivial one) have spent a lot of
> time on the list and have been validated. I think they are ready to be
> picked up for upstream.
>
> v1 -> v2:
> - fixed a build error on da850_am18xx due to missing CONFIG_DM_ETH=y

Heiko, want me to take this through my tree?

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


Re: [U-Boot] [PATCH 4/4] arm: dts: Set custom names for cp110 master/slave MDIO buses

2019-07-24 Thread Joe Hershberger
On Wed, Jul 24, 2019 at 8:06 AM Alex Marginean  wrote:
>
> On 7/23/2019 8:22 PM, Nevo Hed wrote:
> > For context from upstream linux,
> > https://github.com/torvalds/linux/commit/f66b2aff46eaf0825dbe1560e28fcb845dd2a215
> >
> > I was intending to submit the parallel change here once fully tested
> > end-end on our hardware,
> > but if not too late my proposal is to name the above nodes as
> > "cpm-mdio" & "cps-mdio"
>
> I'm OK with "-mdio", I can send a v2.
> Please node that I used a property called 'device-name' rather than
> 'mdio-name', I'm not sure if you want to pick that up too or not.

Let me know when this is settled and I'll take the series.

Thanks,
-Joe

> >
> >
> > On Tue, Jul 23, 2019 at 1:03 PM Nevo Hed  wrote:
> >>
> >> Sorry for the late input
> >>
> >> The cp110s have an mdio and an xmdio so
> >> Locally I have been naming them cpm-xmdio, cpm-mdio, cps-xmdio, cps-mdio
> >>
> >> I knew the new field is coming but didn't catch that the 'dtsi's patch
> >>
> >> [also apologies if you get this a second time]
> >>
> >> On Mon, Jul 22, 2019 at 8:30 PM Joe Hershberger  
> >> wrote:
> >>>
> >>> On Wed, Jul 17, 2019 at 10:12 AM Alex Marginean
> >>>  wrote:
> 
>  Implicitly Marvell MDIO driver uses DT node names for devices, but in 
>  this
>  case that is not unique.  Set MDIO device names for master/slave to
>  cpm/cps.
> 
>  Signed-off-by: Alex Marginean 
> >>>
> >>> Acked-by: Joe Hershberger 
> >>> ___
> >>> U-Boot mailing list
> >>> U-Boot@lists.denx.de
> >>> https://lists.denx.de/listinfo/u-boot
> > ___
> > U-Boot mailing list
> > U-Boot@lists.denx.de
> > https://lists.denx.de/listinfo/u-boot
> >
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 0/9] NXP LS1021A-TSN Board

2019-07-24 Thread Joe Hershberger
On Wed, Jul 24, 2019 at 10:38 AM Vladimir Oltean  wrote:
>
> On Tue, 23 Jul 2019 at 10:38, Joe Hershberger  wrote:
> >
> > On Tue, Jul 23, 2019 at 1:08 AM Vladimir Oltean  wrote:
> > >
> > > Hi Joe,
> > >
> > > On Tue, 23 Jul 2019 at 03:15, Joe Hershberger  
> > > wrote:
> > > >
> > > > On Thu, Jul 18, 2019 at 4:33 PM Vladimir Oltean  
> > > > wrote:
> > > > >
> > > > > This patchset adds initial support for the NXP LS1021A-TSN board,
> > > > > an evaluation platform built in partnership with VVDN/Argonboards
> > > > > for some IEEE 802.1 TSN features.
> > > > >
> > > > > It features a cleaned-up U-Boot board support taken from OpenIL,
> > > > > as well as an eTSEC migration to DM_ETH.  I picked up Bin Meng's
> > > > > patch that converts the LS1021A-TWR (different board, same SoC):
> > > > > https://lists.denx.de/pipermail/u-boot/2018-May/330096.html
> > > > > verified it on the LS1021A-TSN board I am submitting, and made a
> > > > > few adjustments where necessary.
> > > > >
> > > > > TODO items:
> > > > > - Make the eTSEC driver support fixed-link interfaces (necessary
> > > > >   for the enet2 <-> sja1105 internal port)
> > > > > - Add driver for SJA1105 switch
> > > > > - Potentially migrate the eTSEC MDIO bus driver to DM_MDIO and
> > > > >   expose the TBI PHY to mdio commands (useful for debugging),
> > > > >   once https://lists.denx.de/pipermail/u-boot/2019-June/371563.html
> > > > >   is merged.
> > > >
> > > > This series is merged at this point... are you wanting to do that
> > > > migration now or do it sometime later?
> > > >
> > >
> > > I think I would rather have these 9 patches merged first, now that
> > > they got reviewed, instead of reworking them again.
> >
> > Sounds good.
> > Thanks,
> > -Joe
> >
>
> What does this mean, that we are waiting for Prabhakar's OK? Is the
> patchset going to get in through a single tree? Whose is it going to
> be?

Since the vast majority of the series is the Ethernet changes, I was
planning to take it.

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


Re: [U-Boot] [PATCH v5 1/3] common: Move bootm_decomp_image() to image.c (as image_decomp())

2019-07-24 Thread Tom Rini
On Thu, Jul 11, 2019 at 01:53:18PM -0700, Julius Werner wrote:

> Upcoming patches want to add decompression to use cases that are no
> longer directly related to booting. It makes sense to retain a single
> decompression routine, but it should no longer be in bootm.c (which is
> not compiled for all configurations). This patch moves
> bootm_decomp_image() to image.c and renames it to image_decomp() in
> preparation of those upcoming patches.
> 
> Signed-off-by: Julius Werner 
> ---
>  - First version: v5

OK, this now causes 'make tests' to fail on the FIT image tests, please
look.  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/4] imx: add module fuse support

2019-07-24 Thread Schrempf Frieder
Hi Lukasz,

On 24.07.19 14:12, Peng Fan wrote:
> Hi Lukasz,
> 
>> Subject: Re: [U-Boot] [PATCH 1/4] imx: add module fuse support
>>
>> Hi Peng,
>>
>>> Hi Lukasz,
>>>
 Subject: Re: [U-Boot] [PATCH 1/4] imx: add module fuse support

 Hi Peng,

> There are different parts from one SoC. Take i.MX6ULL for example,
> some part might not have ENET, some might have; some might not
> have USB, some might have. The information could be got from
> OCOTP, to make one image support the different parts, we need
> runtime disable linux kernel dts node and uboot driver probe if
> the corresponding module not exists in the part.

 If I understand correctly the concept is interesting to make the
 final binary smaller.
>>>
>>> No. This is to use one image to support multiple parts of a same kind
>>> SoC. So this patch will make the uboot image size larger.
>>>
>>> As described in commit log, some i.MX6UL parts not have enet, some
>>> have Enet,
>>
>> Is there any markings on the SoC? (like MX6ULXX) which indicates which
>> SoC has enet and which doesn't have one?

Yes, you can look in the datasheets. For i.MX6ULL ([1], [2]) for 
example, there is a table in chapter 1.1, which describes the features 
for the different types and the corresponding part numbers. And the part 
numbers are printed on the chips.

Regards,
Frieder

[1] https://www.nxp.com/docs/en/data-sheet/IMX6ULLCEC.pdf
[2] https://www.nxp.com/docs/en/data-sheet/IMX6ULLIEC.pdf

> 
> I do not have that marketing information. We just have the information
> that to use fuse to indicate whether the module is there.
> 
> Regards,
> Peng.
> 
>>
>>> so we need find a method to make the same image could work on the two
>>> parts, that is what this patch does.
>>
>> Ok. Thanks for explanation.
>>
>>>
>>> Thanks,
>>> Peng.
>>>

>
> Signed-off-by: Peng Fan 
> ---
>   arch/arm/include/asm/mach-imx/module_fuse.h | 127 +++
>   arch/arm/include/asm/mach-imx/sys_proto.h   |   1 +
>   arch/arm/mach-imx/Kconfig   |   7 +
>   arch/arm/mach-imx/mx6/Makefile  |   1 +
>   arch/arm/mach-imx/mx6/module_fuse.c | 322
>  5 files changed, 458 insertions(+)
>   create mode 100644
>> arch/arm/include/asm/mach-imx/module_fuse.h
>   create mode 100644 arch/arm/mach-imx/mx6/module_fuse.c
>
> diff --git a/arch/arm/include/asm/mach-imx/module_fuse.h
> b/arch/arm/include/asm/mach-imx/module_fuse.h new file mode
>> 100644
> index 00..6b93f0402e
> --- /dev/null
> +++ b/arch/arm/include/asm/mach-imx/module_fuse.h
> @@ -0,0 +1,127 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
> +/*
> + * Copyright 2019 NXP
> + */
> +
> +#ifndef __MODULE_FUSE_H__
> +#define __MODULE_FUSE_H__
> +
> +enum fuse_module_type {
> + MODULE_TSC,
> + MODULE_ADC1,
> + MODULE_ADC2,
> + MODULE_SIM1,
> + MODULE_SIM2,
> + MODULE_FLEXCAN1,
> + MODULE_FLEXCAN2,
> + MODULE_SPDIF,
> + MODULE_EIM,
> + MODULE_SD1,
> + MODULE_SD2,
> + MODULE_SD3,
> + MODULE_SD4,
> + MODULE_QSPI1,
> + MODULE_QSPI2,
> + MODULE_GPMI,
> + MODULE_APBHDMA,
> + MODULE_LCDIF,
> + MODULE_PXP,
> + MODULE_CSI,
> + MODULE_ENET1,
> + MODULE_ENET2,
> + MODULE_CAAM,
> + MODULE_USB_OTG1,
> + MODULE_USB_OTG2,
> + MODULE_SAI2,
> + MODULE_SAI3,
> + MODULE_BEE,
> + MODULE_UART1,
> + MODULE_UART2,
> + MODULE_UART3,
> + MODULE_UART4,
> + MODULE_UART5,
> + MODULE_UART6,
> + MODULE_UART7,
> + MODULE_UART8,
> + MODULE_PWM5,
> + MODULE_PWM6,
> + MODULE_PWM7,
> + MODULE_PWM8,
> + MODULE_ECSPI1,
> + MODULE_ECSPI2,
> + MODULE_ECSPI3,
> + MODULE_ECSPI4,
> + MODULE_ECSPI5,
> + MODULE_I2C1,
> + MODULE_I2C2,
> + MODULE_I2C3,
> + MODULE_I2C4,
> + MODULE_GPT1,
> + MODULE_GPT2,
> + MODULE_EPIT1,
> + MODULE_EPIT2,
> + MODULE_EPDC,
> + MODULE_ESAI,
> + MODULE_DCP,
> + MODULE_DCP_CRYPTO,
> +};
> +
> +struct fuse_entry_desc {
> + enum fuse_module_type module;
> + const char *node_path;
> + u32 fuse_word_offset;
> + u32 fuse_bit_offset;
> + u32 status;
> +};
> +
> +#if !IS_ENABLED(CONFIG_IMX_MODULE_FUSE)
> +static inline u32 check_module_fused(enum fuse_module_type
> module) {
> + return 0;
> +};
> +
> +static inline u32 esdhc_fused(u32 base_addr) {
> + return 0;
> +};
> +
> +static inline u32 ecspi_fused(u32 base_addr) {
> + return 0;
> +};
> +
> +static inline u32 uart_fused(u32 base_addr) {
> + return 0;
> +};
> +
> +static inline u32 usb_fused(u32 base_addr) {
> + return 0;
> +};
> +
> +static inline u32 qspi_fused(u32 base_addr) {
> + return 0;
> +};
> +
> +static inline u32 

Re: [U-Boot] [PATCH 3/6] timer: dw-apb: add reset handling

2019-07-24 Thread Simon Goldschmidt
On Wed, Jul 24, 2019 at 9:48 AM Marek Vasut  wrote:
>
> On 7/24/19 9:43 AM, Simon Goldschmidt wrote:
> > On Wed, Jul 24, 2019 at 9:31 AM Marek Vasut  wrote:
> >>
> >> On 7/23/19 10:27 PM, Simon Goldschmidt wrote:
> >>> To use this timer on socfpga as system tick, it needs to take itself out
> >>> of reset.
> >>>
> >>> Signed-off-by: Simon Goldschmidt 
> >>> ---
> >>>
> >>>  drivers/timer/dw-apb-timer.c | 18 +-
> >>>  1 file changed, 17 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/drivers/timer/dw-apb-timer.c b/drivers/timer/dw-apb-timer.c
> >>> index 86312b8dc7..fad22be8c9 100644
> >>> --- a/drivers/timer/dw-apb-timer.c
> >>> +++ b/drivers/timer/dw-apb-timer.c
> >>> @@ -8,6 +8,7 @@
> >>>  #include 
> >>>  #include 
> >>>  #include 
> >>> +#include 
> >>>  #include 
> >>>
> >>>  #include 
> >>> @@ -18,7 +19,8 @@
> >>>  #define DW_APB_CTRL  0x8
> >>>
> >>>  struct dw_apb_timer_priv {
> >>> - fdt_addr_t  regs;
> >>> + fdt_addr_t regs;
> >>> + struct reset_ctl_bulk resets;
> >>>  };
> >>>
> >>>  static int dw_apb_timer_get_count(struct udevice *dev, u64 *count)
> >>> @@ -42,6 +44,12 @@ static int dw_apb_timer_probe(struct udevice *dev)
> >>>   struct clk clk;
> >>>   int ret;
> >>>
> >>> + ret = reset_get_bulk(dev, >resets);
> >>> + if (ret)
> >>> + dev_warn(dev, "Can't get reset: %d\n", ret);
> >>
> >> Shouldn't this be printed by the subsystem ?
> >
> > I don't think it's printed by the subsystem. Plus I don't know if it's
> > a warning for all drivers? I also haven't really thought about that, as
> > I just copied the reset handling code from another driver...
>
> H, I guess we cannot operate without clock anyway, so it should be
> dev_err(). And I guess it's indeed not a subsystem print afterall.

Well, for gen5, it would be dev_err. I'm not sure about arria10 and
stratix10 though? I think at least stratix10 doesn't have a clock driver, yet.

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


[U-Boot] [PATCH] Drop linker-generated array creation when CONFIG_CMDLINE is disabled

2019-07-24 Thread andrej.rosano
From: Andrej Rosano 

Linker generated array entry is not needed when the command line is
disabled. Remove this code in that case.

This is required as the commit 80a48dd47e3bf3ede676fae5a630cb6c80de3e69
breaks the linking stage when CONFIG_CMDLINE=n:

..
  LDS u-boot.lds
  LD  u-boot
u-boot contains unexpected relocations: R_ARM_NONE
R_ARM_RELATIVE
make: *** [Makefile:1775: checkarmreloc] Error 1

Signed-off-by: Andrej Rosano 
---
 cmd/help.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cmd/help.c b/cmd/help.c
index fa2010c67e..a1a0b99b6f 100644
--- a/cmd/help.c
+++ b/cmd/help.c
@@ -27,6 +27,7 @@ U_BOOT_CMD(
"   - print detailed usage of 'command'"
 );
 
+#ifdef CONFIG_CMDLINE
 /* This does not use the U_BOOT_CMD macro as ? can't be used in symbol names */
 ll_entry_declare(cmd_tbl_t, question_mark, cmd) = {
"?",CONFIG_SYS_MAXARGS, cmd_always_repeatable,  do_help,
@@ -35,3 +36,4 @@ ll_entry_declare(cmd_tbl_t, question_mark, cmd) = {
""
 #endif /* CONFIG_SYS_LONGHELP */
 };
+#endif
-- 
2.22.0

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


[U-Boot] [PATCH] gitlab-ci: Add pyelftools to the binman testsuite section

2019-07-24 Thread Tom Rini
We need pyelftools here to run rather than skip some tests.

Signed-off-by: Tom Rini 
---
 .gitlab-ci.yml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e166d8f74a68..bd63708b987d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -172,6 +172,9 @@ Run binman and dtoc testsuite:
   tags: [ 'all' ]
   stage: testsuites
   script:
+- virtualenv /tmp/venv
+- . /tmp/venv/bin/activate
+- pip install pyelftools
 - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/sandbox_spl;
   ./tools/buildman/buildman -P sandbox_spl && 
  export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
-- 
2.7.4

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


Re: [U-Boot] Please pull u-boot-dm (take 2)

2019-07-24 Thread Tom Rini
On Tue, Jul 23, 2019 at 08:36:58PM -0700, Simon Glass wrote:

> Hi Tom,
> 
> This includes the gitlab fix and also I updated ifwitool.c to drop the
> unused inline functions.
> 
> 
> The following changes since commit ff8c23e784f57a7098e91a200ed7f5a48612b653:
> 
>   Merge tag 'u-boot-stm32-20190723' of
> https://gitlab.denx.de/u-boot/custodians/u-boot-stm (2019-07-23
> 14:16:21 -0400)
> 
> are available in the Git repository at:
> 
>   git://git.denx.de/u-boot-dm.git tags/dm-pull-23jul19-take2
> 
> for you to fetch changes up to 6e38047b66e37659b937cf301e0de37a90d9eaa2:
> 
>   dm: device: make power domain calls optional (2019-07-23 20:27:58 -0700)
> 

We're still not there yet, sorry.  Taking a look at
https://gitlab.denx.de/u-boot/u-boot/-/jobs/1464 we're now running
things but ifwitool is failing.  Can you please take a look?  You will
need the patch I posted that brings us up to a newer image that has
lzma-alone. 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 v3 0/9] NXP LS1021A-TSN Board

2019-07-24 Thread Vladimir Oltean
On Tue, 23 Jul 2019 at 10:38, Joe Hershberger  wrote:
>
> On Tue, Jul 23, 2019 at 1:08 AM Vladimir Oltean  wrote:
> >
> > Hi Joe,
> >
> > On Tue, 23 Jul 2019 at 03:15, Joe Hershberger  
> > wrote:
> > >
> > > On Thu, Jul 18, 2019 at 4:33 PM Vladimir Oltean  wrote:
> > > >
> > > > This patchset adds initial support for the NXP LS1021A-TSN board,
> > > > an evaluation platform built in partnership with VVDN/Argonboards
> > > > for some IEEE 802.1 TSN features.
> > > >
> > > > It features a cleaned-up U-Boot board support taken from OpenIL,
> > > > as well as an eTSEC migration to DM_ETH.  I picked up Bin Meng's
> > > > patch that converts the LS1021A-TWR (different board, same SoC):
> > > > https://lists.denx.de/pipermail/u-boot/2018-May/330096.html
> > > > verified it on the LS1021A-TSN board I am submitting, and made a
> > > > few adjustments where necessary.
> > > >
> > > > TODO items:
> > > > - Make the eTSEC driver support fixed-link interfaces (necessary
> > > >   for the enet2 <-> sja1105 internal port)
> > > > - Add driver for SJA1105 switch
> > > > - Potentially migrate the eTSEC MDIO bus driver to DM_MDIO and
> > > >   expose the TBI PHY to mdio commands (useful for debugging),
> > > >   once https://lists.denx.de/pipermail/u-boot/2019-June/371563.html
> > > >   is merged.
> > >
> > > This series is merged at this point... are you wanting to do that
> > > migration now or do it sometime later?
> > >
> >
> > I think I would rather have these 9 patches merged first, now that
> > they got reviewed, instead of reworking them again.
>
> Sounds good.
> Thanks,
> -Joe
>

What does this mean, that we are waiting for Prabhakar's OK? Is the
patchset going to get in through a single tree? Whose is it going to
be?

Thanks,
-Vladimir

> >
> > > >
> > > > Bin Meng (1):
> > > >   arm: ls1021atwr: Convert to use driver model TSEC driver
> > > >
> > > > Jianchao Wang (1):
> > > >   Add support for the NXP LS1021A-TSN board
> > > >
> > > > Vladimir Oltean (7):
> > > >   net: tsec: Refactor the readout of the tbi-handle property
> > > >   net: tsec: Fix offset of MDIO registers for DM_ETH
> > > >   net: tsec: Reverse Christmas tree notation
> > > >   net: tsec: Make errors visible
> > > >   net: tsec: Common handling of MAC station address for DM_ETH
> > > >   net: tsec: Change compatible strings to match Linux
> > > >   configs: ls1021atwr: Fix distro_bootcmd for QSPI boot
> > > >
> > > >  arch/arm/Kconfig  |  14 +
> > > >  arch/arm/cpu/armv7/ls102xa/cpu.c  |   2 +-
> > > >  arch/arm/cpu/armv7/ls102xa/fdt.c  |  10 +
> > > >  arch/arm/dts/Makefile |   2 +-
> > > >  arch/arm/dts/ls1021a-tsn.dts  |  77 ++
> > > >  arch/arm/dts/ls1021a-twr.dtsi |  32 +++
> > > >  arch/arm/dts/ls1021a.dtsi |  30 +-
> > > >  board/freescale/ls1021atsn/Kconfig|  18 ++
> > > >  board/freescale/ls1021atsn/MAINTAINERS|   8 +
> > > >  board/freescale/ls1021atsn/Makefile   |   3 +
> > > >  board/freescale/ls1021atsn/README.rst |  97 +++
> > > >  board/freescale/ls1021atsn/ls1021atsn.c   | 260 ++
> > > >  board/freescale/ls1021atsn/ls102xa_pbi.cfg|  15 +
> > > >  board/freescale/ls1021atsn/ls102xa_rcw_sd.cfg |   8 +
> > > >  board/freescale/ls1021atwr/ls1021atwr.c   |  38 ---
> > > >  configs/ls1021atsn_qspi_defconfig |  79 ++
> > > >  configs/ls1021atsn_sdcard_defconfig   |  91 ++
> > > >  configs/ls1021atwr_nor_SECURE_BOOT_defconfig  |   2 +
> > > >  configs/ls1021atwr_nor_defconfig  |   2 +
> > > >  configs/ls1021atwr_nor_lpuart_defconfig   |   2 +
> > > >  configs/ls1021atwr_qspi_defconfig |   2 +
> > > >  ...s1021atwr_sdcard_ifc_SECURE_BOOT_defconfig |   2 +
> > > >  configs/ls1021atwr_sdcard_ifc_defconfig   |   2 +
> > > >  configs/ls1021atwr_sdcard_qspi_defconfig  |   2 +
> > > >  doc/device-tree-bindings/net/fsl-tsec-phy.txt |   4 +-
> > > >  drivers/net/tsec.c|  59 ++--
> > > >  include/configs/ls1021atsn.h  | 250 +
> > > >  include/configs/ls1021atwr.h  |  30 +-
> > > >  include/tsec.h|   4 +-
> > > >  29 files changed, 1038 insertions(+), 107 deletions(-)
> > > >  create mode 100644 arch/arm/dts/ls1021a-tsn.dts
> > > >  create mode 100644 board/freescale/ls1021atsn/Kconfig
> > > >  create mode 100644 board/freescale/ls1021atsn/MAINTAINERS
> > > >  create mode 100644 board/freescale/ls1021atsn/Makefile
> > > >  create mode 100644 board/freescale/ls1021atsn/README.rst
> > > >  create mode 100644 board/freescale/ls1021atsn/ls1021atsn.c
> > > >  create mode 100644 board/freescale/ls1021atsn/ls102xa_pbi.cfg
> > > >  create mode 100644 board/freescale/ls1021atsn/ls102xa_rcw_sd.cfg
> > > >  create mode 100644 configs/ls1021atsn_qspi_defconfig
> > > >  create mode 100644 

Re: [U-Boot] [PATCH v2 3/3] ARM: dts: imx6ull-colibri: pre-reloc for uart pinmux modes

2019-07-24 Thread Fabio Estevam
On Wed, Jul 24, 2019 at 12:10 PM Igor Opaniuk  wrote:
>
> From: Igor Opaniuk 
>
> Add u-boot,dm-pre-reloc properties for uart pinmux configuration
> nodes, which enables UART as early as possible (before relocation).
>
> Without this we miss almost the half of output (U-boot version,
> CPU defails, Reset cause, DRAM details etc.).
>
> Fixes: cd69e8ef9b ("colibri-imx6ull: migrate pinctrl and regulators to 
> dtb/dm")
> Signed-off-by: Igor Opaniuk 

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


Re: [U-Boot] [PATCH v2 1/3] pinctrl: nxp: DM_FLAG_PRE_RELOC by default

2019-07-24 Thread Fabio Estevam
On Wed, Jul 24, 2019 at 12:10 PM Igor Opaniuk  wrote:
>
> From: Igor Opaniuk 
>
> For NXP SoCs we have to set pinmux configuration ASAP (ideally
> before relocation) to get serial console working. Without this we miss
> almost the half of output (U-boot version, CPU defails, Reset cause,
> DRAM details etc.).
>
> To achieve this we need to force appropriate pinctrl drivers to get
> probed before relocation.
>
> Fixes: cd69e8ef9b ("colibri-imx6ull: migrate pinctrl and regulators to 
> dtb/dm")
> Signed-off-by: Igor Opaniuk 

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


Re: [U-Boot] [PATCH v2 2/3] ARM: dts: imx6ull-colibri: change hierarchy of DTS files

2019-07-24 Thread Fabio Estevam
On Wed, Jul 24, 2019 at 12:10 PM Igor Opaniuk  wrote:
>
> From: Igor Opaniuk 
>
> Introduce imx6ull-colibri-u-boot.dtsi for u-boot specific properties to
> keep original imx6ull-colibri.dts in sync with Linux.
>
> Move all contents of imx6ull-colibri.dts to imx6ull-colibri.dtsi +
> additionally fix checkpatch warnings.
>
> Signed-off-by: Igor Opaniuk 

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


[U-Boot] [PATCH] gitlab-ci: Update Docker image to xenial-20190720-24Jul2019 tag

2019-07-24 Thread Tom Rini
- Add in lzma-alone for current binman tests
- Update to Ubuntu's xenial-20190720 tag (latest).

Signed-off-by: Tom Rini 
---
 .gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4cd657307be3..e166d8f74a68 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,7 +2,7 @@
 
 # Grab our configured image.  The source for this is found at:
 # https://gitlab.denx.de/u-boot/gitlab-ci-runner
-image: trini/u-boot-gitlab-ci-runner:xenial-20190222-24April2019
+image: trini/u-boot-gitlab-ci-runner:xenial-20190720-24Jul2019
 
 # We run some tests in different order, to catch some failures quicker.
 stages:
-- 
2.7.4

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


[U-Boot] [PATCH v2 3/3] ARM: dts: imx6ull-colibri: pre-reloc for uart pinmux modes

2019-07-24 Thread Igor Opaniuk
From: Igor Opaniuk 

Add u-boot,dm-pre-reloc properties for uart pinmux configuration
nodes, which enables UART as early as possible (before relocation).

Without this we miss almost the half of output (U-boot version,
CPU defails, Reset cause, DRAM details etc.).

Fixes: cd69e8ef9b ("colibri-imx6ull: migrate pinctrl and regulators to dtb/dm")
Signed-off-by: Igor Opaniuk 
---

 arch/arm/dts/imx6ull-colibri-u-boot.dtsi | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/dts/imx6ull-colibri-u-boot.dtsi 
b/arch/arm/dts/imx6ull-colibri-u-boot.dtsi
index 7d68fb178e..5cef4f3efc 100644
--- a/arch/arm/dts/imx6ull-colibri-u-boot.dtsi
+++ b/arch/arm/dts/imx6ull-colibri-u-boot.dtsi
@@ -2,3 +2,11 @@
 /*
  * Copyright 2019 Toradex AG
  */
+
+_uart1 {
+   u-boot,dm-pre-reloc;
+};
+
+_uart1_ctrl1 {
+   u-boot,dm-pre-reloc;
+};
-- 
2.17.1

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


[U-Boot] [PATCH v2 2/3] ARM: dts: imx6ull-colibri: change hierarchy of DTS files

2019-07-24 Thread Igor Opaniuk
From: Igor Opaniuk 

Introduce imx6ull-colibri-u-boot.dtsi for u-boot specific properties to
keep original imx6ull-colibri.dts in sync with Linux.

Move all contents of imx6ull-colibri.dts to imx6ull-colibri.dtsi +
additionally fix checkpatch warnings.

Signed-off-by: Igor Opaniuk 
---

 arch/arm/dts/imx6ull-colibri-u-boot.dtsi  |   4 +
 arch/arm/dts/imx6ull-colibri.dts  | 596 +---
 arch/arm/dts/imx6ull-colibri.dtsi | 641 ++
 board/toradex/colibri-imx6ull/MAINTAINERS |   2 +
 4 files changed, 649 insertions(+), 594 deletions(-)
 create mode 100644 arch/arm/dts/imx6ull-colibri-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6ull-colibri.dtsi

diff --git a/arch/arm/dts/imx6ull-colibri-u-boot.dtsi 
b/arch/arm/dts/imx6ull-colibri-u-boot.dtsi
new file mode 100644
index 00..7d68fb178e
--- /dev/null
+++ b/arch/arm/dts/imx6ull-colibri-u-boot.dtsi
@@ -0,0 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+/*
+ * Copyright 2019 Toradex AG
+ */
diff --git a/arch/arm/dts/imx6ull-colibri.dts b/arch/arm/dts/imx6ull-colibri.dts
index 6c847ab792..15338a1ae3 100644
--- a/arch/arm/dts/imx6ull-colibri.dts
+++ b/arch/arm/dts/imx6ull-colibri.dts
@@ -3,602 +3,10 @@
  * Copyright 2018-2019 Toradex AG
  */
 
-/dts-v1/;
-#include 
-#include "imx6ull.dtsi"
+#include "imx6ull-colibri.dtsi"
+#include "imx6ull-colibri-u-boot.dtsi"
 
 / {
model = "Toradex Colibri iMX6ULL";
compatible = "toradex,colibri-imx6ull", "fsl,imx6ull";
-
-   aliases {
-   mmc0 = 
-   usb0 =  /* required for ums */
-   };
-
-   chosen {
-   stdout-path = 
-   };
-
-   reg_module_3v3: regulator-module-3v3 {
-   compatible = "regulator-fixed";
-   regulator-always-on;
-   regulator-name = "+V3.3";
-   regulator-min-microvolt = <330>;
-   regulator-max-microvolt = <330>;
-   };
-
-   reg_module_3v3_avdd: regulator-module-3v3-avdd {
-   compatible = "regulator-fixed";
-   regulator-always-on;
-   regulator-name = "+V3.3_AVDD_AUDIO";
-   regulator-min-microvolt = <330>;
-   regulator-max-microvolt = <330>;
-   };
-
-   reg_5v0: regulator-5v0 {
-   compatible = "regulator-fixed";
-   regulator-name = "5V";
-   regulator-min-microvolt = <500>;
-   regulator-max-microvolt = <500>;
-   };
-
-   reg_sd1_vmmc: regulator-sd1-vmmc {
-   compatible = "regulator-gpio";
-   gpio = < 9 GPIO_ACTIVE_HIGH>;
-   pinctrl-names = "default";
-   pinctrl-0 = <_snvs_reg_sd>;
-   regulator-always-on;
-   regulator-name = "+V3.3_1.8_SD";
-   regulator-min-microvolt = <180>;
-   regulator-max-microvolt = <330>;
-   states = <180 0x1 330 0x0>;
-   vin-supply = <_module_3v3>;
-   };
-
-   reg_usbh_vbus: regulator-usbh-vbus {
-   compatible = "regulator-fixed";
-   pinctrl-names = "default";
-   pinctrl-0 = <_usbh_reg>;
-   regulator-name = "VCC_USB[1-4]";
-   regulator-min-microvolt = <500>;
-   regulator-max-microvolt = <500>;
-   gpio = < 2 GPIO_ACTIVE_LOW>; /* USBH_PEN */
-   vin-supply = <_5v0>;
-   };
-};
-
- {
-   num-channels = <10>;
-   vref-supply = <_module_3v3_avdd>;
-};
-
-/* Colibri SPI */
- {
-   cs-gpios = < 26 GPIO_ACTIVE_HIGH>;
-   pinctrl-names = "default";
-   pinctrl-0 = <_ecspi1 _ecspi1_cs>;
-};
-
-/* Ethernet */
- {
-   pinctrl-names = "default";
-   pinctrl-0 = <_enet2>;
-   phy-mode = "rmii";
-   phy-handle = <>;
-   status = "okay";
-
-   mdio {
-   #address-cells = <1>;
-   #size-cells = <0>;
-
-   ethphy1: ethernet-phy@2 {
-   compatible = "ethernet-phy-ieee802.3-c22";
-   max-speed = <100>;
-   reg = <2>;
-   };
-   };
-};
-
-/* NAND */
- {
-   pinctrl-names = "default";
-   pinctrl-0 = <_gpmi_nand>;
-   nand-on-flash-bbt;
-   nand-ecc-mode = "hw";
-   nand-ecc-strength = <8>;
-   nand-ecc-step-size = <512>;
-   status = "okay";
-};
-
-/*
- * I2C3_SDA/SCL on SODIMM 194/196 (e.g. RTC on carrier board)
- */
- {
-   pinctrl-names = "default", "gpio";
-   pinctrl-0 = <_i2c1>;
-   pinctrl-1 = <_i2c1_gpio>;
-   sda-gpios = < 29 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
-   scl-gpios = < 28 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
-   status = "okay";
-};
-
-/*
- * PWR_I2C: power I2C to audio codec, PMIC, temperature sensor and
- * touch screen controller
- */
- {
-   pinctrl-names = "default", "gpio";
-   pinctrl-0 = <_i2c2>;
-   pinctrl-1 = <_i2c2_gpio>;
-   

[U-Boot] [PATCH v2 1/3] pinctrl: nxp: DM_FLAG_PRE_RELOC by default

2019-07-24 Thread Igor Opaniuk
From: Igor Opaniuk 

For NXP SoCs we have to set pinmux configuration ASAP (ideally
before relocation) to get serial console working. Without this we miss
almost the half of output (U-boot version, CPU defails, Reset cause,
DRAM details etc.).

To achieve this we need to force appropriate pinctrl drivers to get
probed before relocation.

Fixes: cd69e8ef9b ("colibri-imx6ull: migrate pinctrl and regulators to dtb/dm")
Signed-off-by: Igor Opaniuk 
---

v2:
- Addressed same issue for all NXP pinctrl drivers

 drivers/pinctrl/nxp/pinctrl-imx5.c| 2 --
 drivers/pinctrl/nxp/pinctrl-imx6.c| 2 --
 drivers/pinctrl/nxp/pinctrl-imx7.c| 2 --
 drivers/pinctrl/nxp/pinctrl-imx7ulp.c | 2 --
 4 files changed, 8 deletions(-)

diff --git a/drivers/pinctrl/nxp/pinctrl-imx5.c 
b/drivers/pinctrl/nxp/pinctrl-imx5.c
index 4e831b6f39..5d17380919 100644
--- a/drivers/pinctrl/nxp/pinctrl-imx5.c
+++ b/drivers/pinctrl/nxp/pinctrl-imx5.c
@@ -40,7 +40,5 @@ U_BOOT_DRIVER(imx5_pinctrl) = {
.remove = imx_pinctrl_remove,
.priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
.ops = _pinctrl_ops,
-#if !CONFIG_IS_ENABLED(OF_CONTROL)
.flags = DM_FLAG_PRE_RELOC,
-#endif
 };
diff --git a/drivers/pinctrl/nxp/pinctrl-imx6.c 
b/drivers/pinctrl/nxp/pinctrl-imx6.c
index 0c1e7a9c05..aafa3057ad 100644
--- a/drivers/pinctrl/nxp/pinctrl-imx6.c
+++ b/drivers/pinctrl/nxp/pinctrl-imx6.c
@@ -49,7 +49,5 @@ U_BOOT_DRIVER(imx6_pinctrl) = {
.remove = imx_pinctrl_remove,
.priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
.ops = _pinctrl_ops,
-#if !CONFIG_IS_ENABLED(OF_CONTROL)
.flags = DM_FLAG_PRE_RELOC,
-#endif
 };
diff --git a/drivers/pinctrl/nxp/pinctrl-imx7.c 
b/drivers/pinctrl/nxp/pinctrl-imx7.c
index 8776fd9650..769d428dda 100644
--- a/drivers/pinctrl/nxp/pinctrl-imx7.c
+++ b/drivers/pinctrl/nxp/pinctrl-imx7.c
@@ -37,7 +37,5 @@ U_BOOT_DRIVER(imx7_pinctrl) = {
.remove = imx_pinctrl_remove,
.priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
.ops = _pinctrl_ops,
-#if !CONFIG_IS_ENABLED(OF_CONTROL)
.flags = DM_FLAG_PRE_RELOC,
-#endif
 };
diff --git a/drivers/pinctrl/nxp/pinctrl-imx7ulp.c 
b/drivers/pinctrl/nxp/pinctrl-imx7ulp.c
index d778f82aac..598bbfaf35 100644
--- a/drivers/pinctrl/nxp/pinctrl-imx7ulp.c
+++ b/drivers/pinctrl/nxp/pinctrl-imx7ulp.c
@@ -41,7 +41,5 @@ U_BOOT_DRIVER(imx7ulp_pinctrl) = {
.remove = imx_pinctrl_remove,
.priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
.ops = _pinctrl_ops,
-#if !CONFIG_IS_ENABLED(OF_CONTROL)
.flags = DM_FLAG_PRE_RELOC,
-#endif
 };
-- 
2.17.1

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


[U-Boot] [PATCH v2 0/3] imx6ull: Fix missing initial output from UART

2019-07-24 Thread Igor Opaniuk
For Colibri iMX6ULL we have to set pinmux for uart configuration ASAP
(ideally before relocation) to get serial console working. Without this
we miss almost the half of output (U-boot version, CPU defails,
Reset cause, DRAM details etc.).

To achieve this we need to force pinctrl-mx6 to get probed before
relocation and add u-boot,dm-pre-reloc properties to uart pinmux
configuration nodes. Setting pinmux configuration for UART before was done
in board_early_init_f().


Igor Opaniuk (3):
  pinctrl: nxp: DM_FLAG_PRE_RELOC by default
  ARM: dts: imx6ull-colibri: change hierarchy of DTS files
  ARM: dts: imx6ull-colibri: pre-reloc for uart pinmux modes

v2:
- Addressed comments [Fabio Estevam]

 arch/arm/dts/imx6ull-colibri-u-boot.dtsi  |  12 +
 arch/arm/dts/imx6ull-colibri.dts  | 596 +---
 arch/arm/dts/imx6ull-colibri.dtsi | 641 ++
 board/toradex/colibri-imx6ull/MAINTAINERS |   2 +
 drivers/pinctrl/nxp/pinctrl-imx5.c|   2 -
 drivers/pinctrl/nxp/pinctrl-imx6.c|   2 -
 drivers/pinctrl/nxp/pinctrl-imx7.c|   2 -
 drivers/pinctrl/nxp/pinctrl-imx7ulp.c |   2 -
 8 files changed, 657 insertions(+), 602 deletions(-)
 create mode 100644 arch/arm/dts/imx6ull-colibri-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6ull-colibri.dtsi

-- 
2.17.1

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


Re: [U-Boot] [RFC PATCH 00/11] SPL support for RISC-V

2019-07-24 Thread Auer, Lukas
Hi Bin,

On Wed, 2019-07-24 at 21:49 +0800, Bin Meng wrote:
> Hi Lukas,
> 
> On Wed, Jul 24, 2019 at 5:23 PM Auer, Lukas
>  wrote:
> > Hi Bin,
> > 
> > On Wed, 2019-07-24 at 10:55 +0800, Bin Meng wrote:
> > > Hi Lukas,
> > > 
> > > On Wed, Jul 24, 2019 at 5:34 AM Auer, Lukas
> > >  wrote:
> > > > Hi Bin,
> > > > 
> > > > On Tue, 2019-07-23 at 16:32 +0800, Bin Meng wrote:
> > > > > Hi Lukas,
> > > > > 
> > > > > On Mon, Jul 22, 2019 at 2:00 AM Lukas Auer
> > > > >  wrote:
> > > > > > This series adds support for SPL to RISC-V U-Boot. Images can be 
> > > > > > booted
> > > > > > via OpenSBI (FW_DYNAMIC firmware) or by directly jumping to them. 
> > > > > > In the
> > > > > > former case, OpenSBI and U-Boot proper are bundled as a FIT image 
> > > > > > and
> > > > > > made available to U-Boot SPL. Currently, only the QEMU board enables
> > > > > > U-Boot SPL with a dedicated configuration. It uses RAM as SPL boot
> > > > > > device.
> > > > > > 
> > > > > > On many RISC-V CPUs, the device tree is provided to U-Boot by the
> > > > > > first stage bootloader. This requires changes to U-Boot SPL 
> > > > > > (patches 1,
> > > > > > 2 and 3), which modify the behavior on other boards as well. To get
> > > > > > feedback on this, I am therefore sending this series as RFC first.
> > > > > > 
> > > > > > To test this series, OpenSBI has to be compiled first. The
> > > > > > fw_dynamic.bin binary must be copied into the U-Boot root directory.
> > > > > > Alternatively, the location of the binary can be specified with the
> > > > > > OPENSBI environment variable. U-Boot can then be build as normal 
> > > > > > using
> > > > > > the configuration qemu-riscv64_spl_defconfig for 64-bit builds or
> > > > > > qemu-riscv32_spl_defconfig for 32-bit builds. The outputs from the 
> > > > > > build
> > > > > > process are the U-Boot SPL binary (spl/u-boot-spl.bin) and the 
> > > > > > U-Boot
> > > > > > FIT image (u-boot.itb) containing U-Boot proper and OpenSBI.
> > > > > > 
> > > > > > U-Boot can be run in QEMU with the following command.
> > > > > > 
> > > > > > qemu-system-riscv64 -nographic -machine virt -kernel spl/u-boot-spl 
> > > > > > \
> > > > > > -device loader,file=u-boot.itb,addr=0x8020
> > > > > > 
> > > > > 
> > > > > Nice job done! It looks the SPL support was cleanly implemented.
> > > > > 
> > > > 
> > > > Thank you very much! :)
> > > > 
> > > > > I've tested this series, on qemu-riscv64 with UP and SMP, both work 
> > > > > fine.
> > > > > However when testing on qemu-riscv32, the U-Boot proper does not boot.
> > > > > Please have a look.
> > > > > 
> > > > > Regards,
> > > > > Bin
> > > > 
> > > > Thank you for reviewing and testing the series!
> > > > 
> > > > Do you mean that the U-Boot prompt does not appear? Testing the series
> > > 
> > > I mean U-Boot proper, the S-mode payload that SPL loads.
> > > 
> > > > on qemu-riscv32, I get the U-Boot prompt from U-Boot proper. I did not
> > > > try to boot Linux on qemu-riscv32, however. I will try that tomorrow.
> > > 
> > > After debugging myself, it turns out to be a false alarm. Sorry about 
> > > that.
> > > 
> > > I was using a 64-bit OpenSBI fw_dynamic.bin. Looks OpenSBI doc does
> > > not clearly mention how 32-bit build is to be done, and I will send a
> > > patch for that. After switching a 32-bit OpenSBI firmware now I am
> > > able to boot to 32-bit U-Boot proper.
> > > 
> > 
> > No problem. You are right, that should be stated more clearly in the
> > OpenSBI docs. Thanks for testing again!
> 
> One thing just occurred to me, is that did you try using binman to
> package SPL + OpenSBI + U-Boot proper into one image?
> 
> I am not sure whether this is the preferred way going forward, hence I
> added Simon for his comments.
> 

Yes, I did try it out, but decided not to include it in this series,
because at least for QEMU it was easier to just use the QEMU device
loader to load the FIT image into memory.

What I did was to use binman to package SPL and the U-Boot FIT image.
Information on the location of the FIT image is then available to
U-Boot SPL. This makes it possible for the SPL RAM driver to load the
FIT image without knowing where it is located beforehand, which is
really nice. I did not try to use binman to package the individual
components instead of the FIT image.

We might be able to use binman on the HiFive Unleashed board. The
bootloader already loads the complete image into memory. We would
therefore not have to include any MMC code into U-Boot SPL and could
just use the SPL RAM driver and binman to find the FIT image.

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


Re: [U-Boot] python3 support for pylibfdt

2019-07-24 Thread Simon Glass
Hi Peter,

On Wed, 24 Jul 2019 at 02:23, Peter Robinson  wrote:
>
> > > > On Tue, Jun 18, 2019 at 10:39:54AM +0100, Peter Robinson wrote:
> > > > > Hi Simon,
> > > > >
> > > > > With the EOL of python2 soon I've been looking at the Fedora U-Boot
> > > > > builds to see what it would take to move over to python3. There's a
> > > > > couple of issues building the bundled pylibfdt, the first is the
> > > > > Makefile hard codes python2, the second is that the generated
> > > > > libfdt_wrap.c doesn't seem to find the python3 version of Python.h
> > > > > (errors below).
> > > > >
> > > > > It seems upstream now supports building pylibfdt with dtc 1.5.0 but I
> > > > > couldn't quite work out how this fits into the U-Boot bundled version.
> > > > > Is there plans to be able to support pylibfdt with python3?
> > > >
> > > > Sounds like we need to run the normal kernel script to re-sync with
> > > > upstream?  Thanks!
> > >
> > > Seems reasonable, I'll keep an eye out for a patch series to test,
> > > it's quite straight forward to test from my PoV.
> >
> > It won't be any time soon, sadly.  Updating to the same dtc in the
> > kernel (so just v1.4.7+) causes both massive amount of new device tree
> > warnings as well as several fail to link due to size growth problems.
>
> For reference the kernel moved to v1.5.0-30-g702c1b6c0e73 in the 5.3
> merge window.

Also I sent a series for libfdt to reduce the size, as a first step to
syncing up U-Boot again. It needs work, but I expect to get back to it
next week.

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


[U-Boot] [PATCH v2 7/8] RPI: Add memory map for bcm2838

2019-07-24 Thread Andrei Gherzan
Define the memory map for the BCM2838 based on the dt configuration
available in the Raspberry Pi kernel fork.

Signed-off-by: Andrei Gherzan 
---
 board/raspberrypi/rpi/rpi.c | 27 ---
 1 file changed, 24 insertions(+), 3 deletions(-)

diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 6d6f1ef39a..1c4fae9166 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -249,7 +249,8 @@ static uint32_t rev_type;
 static const struct rpi_model *model;
 
 #ifdef CONFIG_ARM64
-static struct mm_region bcm2837_mem_map[] = {
+#ifndef CONFIG_BCM2838
+static struct mm_region bcm283x_mem_map[] = {
{
.virt = 0xUL,
.phys = 0xUL,
@@ -268,8 +269,28 @@ static struct mm_region bcm2837_mem_map[] = {
0,
}
 };
-
-struct mm_region *mem_map = bcm2837_mem_map;
+#else
+static struct mm_region bcm283x_mem_map[] = {
+   {
+   .virt = 0xUL,
+   .phys = 0xUL,
+   .size = 0xfe00UL,
+   .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+PTE_BLOCK_INNER_SHARE
+   }, {
+   .virt = 0xfe00UL,
+   .phys = 0xfe00UL,
+   .size = 0x0180UL,
+   .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+PTE_BLOCK_NON_SHARE |
+PTE_BLOCK_PXN | PTE_BLOCK_UXN
+   }, {
+   /* List terminator */
+   0,
+   }
+};
+#endif
+struct mm_region *mem_map = bcm283x_mem_map;
 #endif
 
 int dram_init(void)
-- 
2.22.0

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


[U-Boot] [PATCH v2 5/8] ARM: bcm283x: Include definition for additional emmc clock

2019-07-24 Thread Andrei Gherzan
This clock has a different mbox ID so have this included in the relevant
header file.

Signed-off-by: Andrei Gherzan 
---
 arch/arm/mach-bcm283x/include/mach/mbox.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-bcm283x/include/mach/mbox.h 
b/arch/arm/mach-bcm283x/include/mach/mbox.h
index e44c7577da..f2a98acddd 100644
--- a/arch/arm/mach-bcm283x/include/mach/mbox.h
+++ b/arch/arm/mach-bcm283x/include/mach/mbox.h
@@ -230,6 +230,7 @@ struct bcm2835_mbox_tag_set_power_state {
 #define BCM2835_MBOX_CLOCK_ID_SDRAM8
 #define BCM2835_MBOX_CLOCK_ID_PIXEL9
 #define BCM2835_MBOX_CLOCK_ID_PWM  10
+#define BCM2835_MBOX_CLOCK_ID_EMMC212
 
 struct bcm2835_mbox_tag_get_clock_rate {
struct bcm2835_mbox_tag_hdr tag_hdr;
-- 
2.22.0

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


[U-Boot] [PATCH v2 3/8] ARM: bcm283x: Define configs for RaspberryPi 4

2019-07-24 Thread Andrei Gherzan
Define two target configs for Raspberry Pi 4 (32 and 64bit) and the
corresponding BCM2838* configs.

Be aware of the current limitation in firmware which requires an
explicit configuration to force the arm in 64bit mode when the
respective target is used.

Signed-off-by: Andrei Gherzan 
Signed-off-by: Matthias Brugger 
---
 arch/arm/mach-bcm283x/Kconfig | 62 +++
 1 file changed, 62 insertions(+)

diff --git a/arch/arm/mach-bcm283x/Kconfig b/arch/arm/mach-bcm283x/Kconfig
index 8e69914a83..09a5b42bbb 100644
--- a/arch/arm/mach-bcm283x/Kconfig
+++ b/arch/arm/mach-bcm283x/Kconfig
@@ -26,6 +26,23 @@ config BCM2837_64B
select BCM2837
select ARM64
 
+config BCM2838
+   bool "Broadcom BCM2838 SoC support"
+   depends on ARCH_BCM283X
+
+config BCM2838_32B
+   bool "Broadcom BCM2838 SoC 32-bit support"
+   depends on ARCH_BCM283X
+   select BCM2838
+   select ARMV7_LPAE
+   select CPU_V7A
+
+config BCM2838_64B
+   bool "Broadcom BCM2838 SoC 64-bit support"
+   depends on ARCH_BCM283X
+   select BCM2838
+   select ARM64
+
 menu "Broadcom BCM283X family"
depends on ARCH_BCM283X
 
@@ -127,6 +144,50 @@ config TARGET_RPI_3
  This option creates a build targeting the ARMv8/AArch64 ISA.
select BCM2837_64B
 
+config TARGET_RPI_4_32B
+   bool "Raspberry Pi 4 32-bit build"
+   help
+ Support for all BCM2838-based Raspberry Pi variants, such as
+ the RPi 4 model B, in AArch32 (32-bit) mode.
+
+ This option assumes the VideoCore firmware is configured to use the
+ mini UART (rather than PL011) for the serial console. This is the
+ default on the RPi 4. To enable the UART console, the following non-
+ default option must be present in config.txt: enable_uart=1. This is
+ required for U-Boot to operate correctly, even if you only care
+ about the HDMI/usbkbd console.
+
+ Due to hardware incompatibilities, this can't be used with
+ BCM283/5/6/7.
+
+ This option creates a build targeting the ARMv7/AArch32 ISA.
+   select BCM2838_32B
+
+config TARGET_RPI_4
+   bool "Raspberry Pi 4 64-bit build"
+   help
+ Support for all BCM2838-based Raspberry Pi variants, such as
+ the RPi 4 model B, in AArch64 (64-bit) mode.
+
+ This option assumes the VideoCore firmware is configured to use the
+ mini UART (rather than PL011) for the serial console. This is the
+ default on the RPi 4. To enable the UART console, the following non-
+ default option must be present in config.txt: enable_uart=1. This is
+ required for U-Boot to operate correctly, even if you only care
+ about the HDMI/usbkbd console.
+
+ Due to hardware incompatibilities, this can't be used with
+ BCM283/5/6/7.
+
+ Also, due to a bug in firmware, switching to 64bit mode doesn't
+ happen automatically based on the kernel's image filename. See
+ https://github.com/raspberrypi/firmware/issues/1193 for more details.
+ Until that is resolved, the configuration (config.txt) needs to
+ explicitly set: arm_64bit=1.
+
+ This option creates a build targeting the ARMv8/AArch64 ISA.
+   select BCM2838_64B
+
 endchoice
 
 config SYS_BOARD
@@ -145,5 +206,6 @@ config BCM283x_BASE
hex
default "0x2000" if BCM2835
default "0x3f00" if BCM2836 || BCM2837
+   default "0xfe00" if BCM2838
 
 endmenu
-- 
2.22.0

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


[U-Boot] [PATCH v2 6/8] mmc: bcm283x: Add support for bcm2711 device in bcm2835_sdhci

2019-07-24 Thread Andrei Gherzan
From: Matthias Brugger 

The bcm2711 has two emmc controllers. The difference is the clocks
they use. Add support for the second emmc controller.

Signed-off-by: Matthias Brugger 
Signed-off-by: Andrei Gherzan 
---
 drivers/mmc/bcm2835_sdhci.c | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/bcm2835_sdhci.c b/drivers/mmc/bcm2835_sdhci.c
index 08bddd410e..e68dec3be7 100644
--- a/drivers/mmc/bcm2835_sdhci.c
+++ b/drivers/mmc/bcm2835_sdhci.c
@@ -178,12 +178,13 @@ static int bcm2835_sdhci_probe(struct udevice *dev)
fdt_addr_t base;
int emmc_freq;
int ret;
+   int clock_id = (int)dev_get_driver_data(dev);
 
base = devfdt_get_addr(dev);
if (base == FDT_ADDR_T_NONE)
return -EINVAL;
 
-   ret = bcm2835_get_mmc_clock(BCM2835_MBOX_CLOCK_ID_EMMC);
+   ret = bcm2835_get_mmc_clock(clock_id);
if (ret < 0) {
debug("%s: Failed to set MMC clock (err=%d)\n", __func__, ret);
return ret;
@@ -228,7 +229,14 @@ static int bcm2835_sdhci_probe(struct udevice *dev)
 }
 
 static const struct udevice_id bcm2835_sdhci_match[] = {
-   { .compatible = "brcm,bcm2835-sdhci" },
+   {
+   .compatible = "brcm,bcm2835-sdhci",
+   .data = BCM2835_MBOX_CLOCK_ID_EMMC
+   },
+   {
+   .compatible = "brcm,bcm2711-emmc2",
+   .data = BCM2835_MBOX_CLOCK_ID_EMMC2
+   },
{ /* sentinel */ }
 };
 
-- 
2.22.0

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


[U-Boot] [PATCH v2 1/8] RPI: Add defconfigs for rpi4 (32/64)

2019-07-24 Thread Andrei Gherzan
This defines a minimum defconfig for each of the two Raspberry Pi 4
variants. One notable difference is that we don't have a embedded dt for
this board given that the fw supplies us with one which we can reuse.
Furthermore, the ram size is not queryable through mbox interface as the
maximum reported size is 1G. The fw patches the dt with the right
memory configuration and uboot uses it as it is. We avoid u-boot
touching this configuration by making sure CONFIG_ARCH_FIXUP_FDT_MEMORY
is deactivated.

Signed-off-by: Andrei Gherzan 
---
 configs/rpi_4_32b_defconfig | 33 +
 configs/rpi_4_defconfig | 33 +
 2 files changed, 66 insertions(+)
 create mode 100644 configs/rpi_4_32b_defconfig
 create mode 100644 configs/rpi_4_defconfig

diff --git a/configs/rpi_4_32b_defconfig b/configs/rpi_4_32b_defconfig
new file mode 100644
index 00..a31a617a5f
--- /dev/null
+++ b/configs/rpi_4_32b_defconfig
@@ -0,0 +1,33 @@
+CONFIG_ARM=y
+CONFIG_ARCH_BCM283X=y
+CONFIG_SYS_TEXT_BASE=0x8000
+CONFIG_TARGET_RPI_4_32B=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_NR_DRAM_BANKS=1
+# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
+CONFIG_OF_BOARD=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_MISC_INIT_R=y
+# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_SYS_PROMPT="U-Boot> "
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_FS_UUID=y
+CONFIG_ENV_FAT_INTERFACE="mmc"
+CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_DM_KEYBOARD=y
+CONFIG_DM_MMC=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_BCM2835=y
+CONFIG_PINCTRL=y
+# CONFIG_PINCTRL_GENERIC is not set
+# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
+CONFIG_DM_VIDEO=y
+CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_CONSOLE_SCROLL_LINES=10
+CONFIG_PHYS_TO_BUS=y
+CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/configs/rpi_4_defconfig b/configs/rpi_4_defconfig
new file mode 100644
index 00..da8c960a2a
--- /dev/null
+++ b/configs/rpi_4_defconfig
@@ -0,0 +1,33 @@
+CONFIG_ARM=y
+CONFIG_ARCH_BCM283X=y
+CONFIG_SYS_TEXT_BASE=0x0008
+CONFIG_TARGET_RPI_4=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_NR_DRAM_BANKS=1
+# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
+CONFIG_OF_BOARD=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_MISC_INIT_R=y
+# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_SYS_PROMPT="U-Boot> "
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_FS_UUID=y
+CONFIG_ENV_FAT_INTERFACE="mmc"
+CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_DM_KEYBOARD=y
+CONFIG_DM_MMC=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_BCM2835=y
+CONFIG_PINCTRL=y
+# CONFIG_PINCTRL_GENERIC is not set
+# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
+CONFIG_DM_VIDEO=y
+CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_CONSOLE_SCROLL_LINES=10
+CONFIG_PHYS_TO_BUS=y
+CONFIG_OF_LIBFDT_OVERLAY=y
-- 
2.22.0

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


[U-Boot] [PATCH v2 2/8] ARM: bcm283x: Add BCM283x_BASE define

2019-07-24 Thread Andrei Gherzan
From: Matthias Brugger 

Devices of bcm283x have different base address, depending if they are on
bcm2835 or bcm2836/7. Use BCM283x_BASE depending on the SoC you want to
build and only add the offset in the header files.

Signed-off-by: Matthias Brugger 
Signed-off-by: Andrei Gherzan 
---
 arch/arm/mach-bcm283x/Kconfig  | 5 +
 arch/arm/mach-bcm283x/include/mach/mbox.h  | 6 +-
 arch/arm/mach-bcm283x/include/mach/sdhci.h | 6 +-
 arch/arm/mach-bcm283x/include/mach/timer.h | 6 +-
 arch/arm/mach-bcm283x/include/mach/wdog.h  | 6 +-
 5 files changed, 9 insertions(+), 20 deletions(-)

diff --git a/arch/arm/mach-bcm283x/Kconfig b/arch/arm/mach-bcm283x/Kconfig
index 3eb5a9a897..8e69914a83 100644
--- a/arch/arm/mach-bcm283x/Kconfig
+++ b/arch/arm/mach-bcm283x/Kconfig
@@ -141,4 +141,9 @@ config SYS_SOC
 config SYS_CONFIG_NAME
default "rpi"
 
+config BCM283x_BASE
+   hex
+   default "0x2000" if BCM2835
+   default "0x3f00" if BCM2836 || BCM2837
+
 endmenu
diff --git a/arch/arm/mach-bcm283x/include/mach/mbox.h 
b/arch/arm/mach-bcm283x/include/mach/mbox.h
index e3a893e49c..e44c7577da 100644
--- a/arch/arm/mach-bcm283x/include/mach/mbox.h
+++ b/arch/arm/mach-bcm283x/include/mach/mbox.h
@@ -37,11 +37,7 @@
 
 /* Raw mailbox HW */
 
-#ifndef CONFIG_BCM2835
-#define BCM2835_MBOX_PHYSADDR  0x3f00b880
-#else
-#define BCM2835_MBOX_PHYSADDR  0x2000b880
-#endif
+#define BCM2835_MBOX_PHYSADDR  (CONFIG_BCM283x_BASE + 0xb880)
 
 struct bcm2835_mbox_regs {
u32 read;
diff --git a/arch/arm/mach-bcm283x/include/mach/sdhci.h 
b/arch/arm/mach-bcm283x/include/mach/sdhci.h
index 5cb6ec3340..b443c379d8 100644
--- a/arch/arm/mach-bcm283x/include/mach/sdhci.h
+++ b/arch/arm/mach-bcm283x/include/mach/sdhci.h
@@ -6,11 +6,7 @@
 #ifndef _BCM2835_SDHCI_H_
 #define _BCM2835_SDHCI_H_
 
-#ifndef CONFIG_BCM2835
-#define BCM2835_SDHCI_BASE 0x3f30
-#else
-#define BCM2835_SDHCI_BASE 0x2030
-#endif
+#define BCM2835_SDHCI_BASE (CONFIG_BCM283x_BASE + 0x0030)
 
 int bcm2835_sdhci_init(u32 regbase, u32 emmc_freq);
 
diff --git a/arch/arm/mach-bcm283x/include/mach/timer.h 
b/arch/arm/mach-bcm283x/include/mach/timer.h
index 56b0c356bb..014355e759 100644
--- a/arch/arm/mach-bcm283x/include/mach/timer.h
+++ b/arch/arm/mach-bcm283x/include/mach/timer.h
@@ -6,11 +6,7 @@
 #ifndef _BCM2835_TIMER_H
 #define _BCM2835_TIMER_H
 
-#ifndef CONFIG_BCM2835
-#define BCM2835_TIMER_PHYSADDR 0x3f003000
-#else
-#define BCM2835_TIMER_PHYSADDR 0x20003000
-#endif
+#define BCM2835_TIMER_PHYSADDR (CONFIG_BCM283x_BASE + 0x3000)
 
 #define BCM2835_TIMER_CS_M3(1 << 3)
 #define BCM2835_TIMER_CS_M2(1 << 2)
diff --git a/arch/arm/mach-bcm283x/include/mach/wdog.h 
b/arch/arm/mach-bcm283x/include/mach/wdog.h
index 99c88e5df7..8292b3cf1f 100644
--- a/arch/arm/mach-bcm283x/include/mach/wdog.h
+++ b/arch/arm/mach-bcm283x/include/mach/wdog.h
@@ -6,11 +6,7 @@
 #ifndef _BCM2835_WDOG_H
 #define _BCM2835_WDOG_H
 
-#ifndef CONFIG_BCM2835
-#define BCM2835_WDOG_PHYSADDR  0x3f10
-#else
-#define BCM2835_WDOG_PHYSADDR  0x2010
-#endif
+#define BCM2835_WDOG_PHYSADDR  (CONFIG_BCM283x_BASE + 0x0010)
 
 struct bcm2835_wdog_regs {
u32 unknown0[7];
-- 
2.22.0

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


[U-Boot] [PATCH v2 8/8] git-mailrc: Add rpi and bcm283x maintainer

2019-07-24 Thread Andrei Gherzan
Signed-off-by: Andrei Gherzan 
---
 doc/git-mailrc | 4 
 1 file changed, 4 insertions(+)

diff --git a/doc/git-mailrc b/doc/git-mailrc
index a63b76befc..68110e1963 100644
--- a/doc/git-mailrc
+++ b/doc/git-mailrc
@@ -35,6 +35,7 @@ alias mariosix   Mario Six 
 alias masahiro   Masahiro Yamada 
 alias mateuszMateusz Kulikowski 
 alias maxime Maxime Ripard 
+alias mbrugger   Matthias Brugger 
 alias monstr Michal Simek 
 alias prom   Minkyu Kang 
 alias ptomsich   Philipp Tomsich 
@@ -74,6 +75,9 @@ alias uniphier   uboot, masahiro
 alias zynq   uboot, monstr
 alias rockchip   uboot, sjg, kevery, ptomsich
 
+alias bcm283xuboot,mbrugger
+alias rpiuboot,mbrugger
+
 alias m68k   uboot, alisonwang, angelo_ts
 alias coldfire   m68k
 
-- 
2.22.0

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


[U-Boot] [PATCH v2 4/8] RPI: Add entry for Raspberry Pi 4 model B

2019-07-24 Thread Andrei Gherzan
The Raspebrry Pi 4 uses the new revision code scheme as documented by
the foundation. This change adds an entry for this board as well.

Signed-off-by: Andrei Gherzan 
---
 board/raspberrypi/rpi/rpi.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 617c892dde..6d6f1ef39a 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -148,6 +148,11 @@ static const struct rpi_model rpi_models_new_scheme[] = {
DTB_DIR "bcm2837-rpi-cm3.dtb",
false,
},
+   [0x11] = {
+   "4 Model B",
+   DTB_DIR "bcm2711-rpi-4-b.dtb",
+   true,
+   },
 };
 
 static const struct rpi_model rpi_models_old_scheme[] = {
-- 
2.22.0

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


[U-Boot] [PATCH v2 0/8] Raspberry Pi 32/64 support

2019-07-24 Thread Andrei Gherzan
Changes for v2:
   - Removed patches that are not needed anymore due to firmware update
   - Removed usage of embedded dtb as opposed to reusing the loaded dtb
 by the firmware
   - Removed known unsupported/not applicable peripherals (i.e USB) from
 defconfigs
   - Make sure the memory/reg is left untouched as configured by the
 firmware

Andrei Gherzan (6):
  RPI: Add defconfigs for rpi4 (32/64)
  ARM: bcm283x: Define configs for RaspberryPi 4
  RPI: Add entry for Raspberry Pi 4 model B
  ARM: bcm283x: Include definition for additional emmc clock
  RPI: Add memory map for bcm2838
  git-mailrc: Add rpi and bcm283x maintainer

Matthias Brugger (2):
  ARM: bcm283x: Add BCM283x_BASE define
  mmc: bcm283x: Add support for bcm2711 device in bcm2835_sdhci

 arch/arm/mach-bcm283x/Kconfig  | 67 ++
 arch/arm/mach-bcm283x/include/mach/mbox.h  |  7 +--
 arch/arm/mach-bcm283x/include/mach/sdhci.h |  6 +-
 arch/arm/mach-bcm283x/include/mach/timer.h |  6 +-
 arch/arm/mach-bcm283x/include/mach/wdog.h  |  6 +-
 board/raspberrypi/rpi/rpi.c| 32 ++-
 configs/rpi_4_32b_defconfig| 33 +++
 configs/rpi_4_defconfig| 33 +++
 doc/git-mailrc |  4 ++
 drivers/mmc/bcm2835_sdhci.c| 12 +++-
 10 files changed, 181 insertions(+), 25 deletions(-)
 create mode 100644 configs/rpi_4_32b_defconfig
 create mode 100644 configs/rpi_4_defconfig

-- 
2.22.0

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


Re: [U-Boot] [PATCH 00/50] doc: Shape into useful HTML docs

2019-07-24 Thread Tom Rini
On Wed, Jul 24, 2019 at 10:16:31PM +0800, Bin Meng wrote:
> Hi Tom,
> 
> On Wed, Jul 24, 2019 at 10:14 PM Tom Rini  wrote:
> >
> > On Thu, Jul 18, 2019 at 12:33:45AM -0700, Bin Meng wrote:
> >
> > > At present there is Sphinx doc build system in U-Boot, however the
> > > contents are very limited, e.g.: only a few API descriptions like
> > > EFI, are included.
> > >
> > > This series proposes an initial Sphinx doc layout for future extension,
> > > by converting some of the plain text documentation to reStructuredText
> > > format and add it to Sphinx TOC tree.
> > >
> > > With this series, now we have the following major chapters in our
> > > U-Boot HTML doc:
> > >
> > > - Driver Model
> > > - U-Boot API documentation
> > > - Architecture-specific doc
> > > - Board-specific doc
> > >
> > > Board specific documents are put in a vendor subdirectory, just like
> > > what we have in /board. All x86 & RISC-V board docs are
> > > converted to reST. A few other board docs are converted too.
> > >
> > > Tested by generating the HTML docs, 0 build warnings.
> > >
> > > This patch is rebased on https://patchwork.ozlabs.org/patch/1131726/.
> > >
> > > @Wolfgang, is it possible to host the Sphinx HTML docs on denx.de?
> > >
> > > This series is available at u-boot-x86/doc for testing.
> >
> > As a follow-up, please update .gitlab-ci.yml at least to include a run
> > of "make htmldocs".  If we need to update the Dockerfile to include new
> > utils we can do that too, thanks!
> 
> Yes, but I will need some time to study GitLab's .gitlab-ci.yml :)
> 
> Could that be done later?

Yes, to be clear, I asked for a follow-up as I have this otherwise
merged locally but can't test it since make htmldocs blows up about a
lack of required tools that I don't see documented.  Once my current
pipeline finishes (of other changes) I'll push this.

-- 
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 00/50] doc: Shape into useful HTML docs

2019-07-24 Thread Bin Meng
Hi Tom,

On Wed, Jul 24, 2019 at 10:14 PM Tom Rini  wrote:
>
> On Thu, Jul 18, 2019 at 12:33:45AM -0700, Bin Meng wrote:
>
> > At present there is Sphinx doc build system in U-Boot, however the
> > contents are very limited, e.g.: only a few API descriptions like
> > EFI, are included.
> >
> > This series proposes an initial Sphinx doc layout for future extension,
> > by converting some of the plain text documentation to reStructuredText
> > format and add it to Sphinx TOC tree.
> >
> > With this series, now we have the following major chapters in our
> > U-Boot HTML doc:
> >
> > - Driver Model
> > - U-Boot API documentation
> > - Architecture-specific doc
> > - Board-specific doc
> >
> > Board specific documents are put in a vendor subdirectory, just like
> > what we have in /board. All x86 & RISC-V board docs are
> > converted to reST. A few other board docs are converted too.
> >
> > Tested by generating the HTML docs, 0 build warnings.
> >
> > This patch is rebased on https://patchwork.ozlabs.org/patch/1131726/.
> >
> > @Wolfgang, is it possible to host the Sphinx HTML docs on denx.de?
> >
> > This series is available at u-boot-x86/doc for testing.
>
> As a follow-up, please update .gitlab-ci.yml at least to include a run
> of "make htmldocs".  If we need to update the Dockerfile to include new
> utils we can do that too, thanks!

Yes, but I will need some time to study GitLab's .gitlab-ci.yml :)

Could that be done later?

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


[U-Boot] [PATCH v3] imx: add u-boot-nand.imx target

2019-07-24 Thread Igor Opaniuk
From: Igor Opaniuk 

Add an additional target which prepends the u-boot.imx image with
0x400 padding bytes. On Vybrid and i.MX 7, i.MX6ULL this is required
for NAND boot devices. The configuration CONFIG_IMX_NAND enables this
image for a board.

Signed-off-by: Stefan Agner 
Signed-off-by: Igor Opaniuk 
---

v3:
- fixed depedency of Ksymbol

v2:
- addressed Jagan's comment

 Kconfig| 1 +
 Makefile   | 3 +++
 arch/arm/mach-imx/Makefile | 7 +++
 3 files changed, 11 insertions(+)

diff --git a/Kconfig b/Kconfig
index d2eb744e70..c9473e00a9 100644
--- a/Kconfig
+++ b/Kconfig
@@ -253,6 +253,7 @@ config BUILD_TARGET
default "u-boot.itb" if SPL_LOAD_FIT && (ROCKCHIP_RK3399 || ARCH_SUNXI)
default "u-boot.kwb" if KIRKWOOD
default "u-boot-with-spl.bin" if ARCH_AT91 && SPL_NAND_SUPPORT
+   default "u-boot-nand.imx" if (ARCH_MX6 || ARCH_MX7) && NAND_BOOT
help
  Some SoCs need special image types (e.g. U-Boot binary
  with a special header) as build targets. By defining
diff --git a/Makefile b/Makefile
index 73fdf70cdd..287b74dd50 100644
--- a/Makefile
+++ b/Makefile
@@ -1106,6 +1106,9 @@ endif
 %.vyb: %.imx
$(Q)$(MAKE) $(build)=arch/arm/cpu/armv7/vf610 $@
 
+u-boot-nand.imx: u-boot.imx
+   $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
+
 quiet_cmd_copy = COPY$@
   cmd_copy = cp $< $@
 
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 898478fc4a..365a5951f1 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -112,6 +112,13 @@ u-boot.imx: MKIMAGEOUTPUT = u-boot.imx.log
 u-boot.imx: u-boot.bin u-boot.cfgout $(PLUGIN).bin FORCE
$(call if_changed,mkimage)
 
+ifeq ($(CONFIG_NAND_BOOT),y)
+cmd_u-boot-nand_imx = (dd bs=1024 count=1 if=/dev/zero 2>/dev/null) | \
+   cat - $< > $@
+u-boot-nand.imx: u-boot.imx FORCE
+   $(call if_changed,u-boot-nand_imx)
+endif
+
 ifeq ($(CONFIG_MULTI_DTB_FIT),y)
 MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \
-T $(IMAGE_TYPE) -e $(CONFIG_SYS_TEXT_BASE)
-- 
2.17.1

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


Re: [U-Boot] [PATCH 00/50] doc: Shape into useful HTML docs

2019-07-24 Thread Tom Rini
On Thu, Jul 18, 2019 at 12:33:45AM -0700, Bin Meng wrote:

> At present there is Sphinx doc build system in U-Boot, however the
> contents are very limited, e.g.: only a few API descriptions like
> EFI, are included.
> 
> This series proposes an initial Sphinx doc layout for future extension,
> by converting some of the plain text documentation to reStructuredText
> format and add it to Sphinx TOC tree.
> 
> With this series, now we have the following major chapters in our
> U-Boot HTML doc:
> 
> - Driver Model
> - U-Boot API documentation
> - Architecture-specific doc
> - Board-specific doc
> 
> Board specific documents are put in a vendor subdirectory, just like
> what we have in /board. All x86 & RISC-V board docs are
> converted to reST. A few other board docs are converted too.
> 
> Tested by generating the HTML docs, 0 build warnings.
> 
> This patch is rebased on https://patchwork.ozlabs.org/patch/1131726/.
> 
> @Wolfgang, is it possible to host the Sphinx HTML docs on denx.de?
> 
> This series is available at u-boot-x86/doc for testing.

As a follow-up, please update .gitlab-ci.yml at least to include a run
of "make htmldocs".  If we need to update the Dockerfile to include new
utils we can do that too, 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 v1 1/2] pinctrl: nxp: mx6: DM_FLAG_PRE_RELOC by default

2019-07-24 Thread Fabio Estevam
Hi Igor,

On Wed, Jul 24, 2019 at 10:58 AM Igor Opaniuk  wrote:

> I'm currently in the middle of preparing v2, just wanted to know if you do 
> agree
> with this point and in general have any additional suggestions regarding this?

My only suggestion is to do a single patch that touches all the
drivers/pinctrl/nxp/ drivers, not ony the mx6 one.

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


Re: [U-Boot] [PATCH v1 1/2] pinctrl: nxp: mx6: DM_FLAG_PRE_RELOC by default

2019-07-24 Thread Igor Opaniuk
Hi Fabio,

On Tue, Jul 16, 2019 at 3:44 PM Igor Opaniuk  wrote:
>
> Hi Fabio,
>
> On Mon, Jul 15, 2019 at 10:10 PM Fabio Estevam  wrote:
> >
> > Hi Igor,
> >
> > On Mon, Jul 15, 2019 at 11:20 AM Igor Opaniuk  
> > wrote:
> > >
> > > From: Igor Opaniuk 
> > >
> > > For Colibri iMX6ULL we have to set pinmux configuration ASAP (ideally
> > > before relocation) to get serial console working. Without this we miss
> > > almost the half of output (U-boot version, CPU defails, Reset cause,
> > > DRAM details etc.).
> > >
> > > To achieve this we need to force pinctrl-mx6 to get probed before
> > > relocation. Setting pinmux configuration for UART before was done
> > > in board_early_init_f().
> > >
> > > Fixes: cd69e8ef9b ("colibri-imx6ull: migrate pinctrl and regulators to 
> > > dtb/dm")
> > > Signed-off-by: Igor Opaniuk 
> > > ---
> > >
> > >  drivers/pinctrl/nxp/pinctrl-imx6.c | 2 --
> > >  1 file changed, 2 deletions(-)
> > >
> > > diff --git a/drivers/pinctrl/nxp/pinctrl-imx6.c 
> > > b/drivers/pinctrl/nxp/pinctrl-imx6.c
> > > index 0c1e7a9c05..aafa3057ad 100644
> > > --- a/drivers/pinctrl/nxp/pinctrl-imx6.c
> > > +++ b/drivers/pinctrl/nxp/pinctrl-imx6.c
> > > @@ -49,7 +49,5 @@ U_BOOT_DRIVER(imx6_pinctrl) = {
> > > .remove = imx_pinctrl_remove,
> > > .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
> > > .ops = _pinctrl_ops,
> > > -#if !CONFIG_IS_ENABLED(OF_CONTROL)
> > > .flags = DM_FLAG_PRE_RELOC,
> > > -#endif
> >
> > It seems that this is not i.MX6 specific (maybe not even i.MX
> > specific. I noticed this issue on i.MX7 too).
>
> Right. Currently there are no any output issues on
> Colibri iMX7 because board_early_init_f() does apply initial
> pinmux configuration for uart [1].
>
> >
> > Could this be handled in the drivers/pinctrl core instead?
> >
> > Just wanted to see if we can get a more generic solution for this issue.
> >
> > Thanks
>
> AFAIK, DM_FLAG_PRE_RELOC flag can be set for a driver,
> not for the whole uclass (but I might be mistaken). Also taking
> into account memory limitations (small malloc pool etc) before
> U-boot is relocated, I would force driver to be bounded only
> in the cases when it's really vital (like this particular case
> with serial console issue).
I'm currently in the middle of preparing v2, just wanted to know if you do agree
with this point and in general have any additional suggestions regarding this?

>
> Thanks!
>
> [1] board/toradex/colibri_imx7/colibri_imx7.c
>
> --
> Best regards - Freundliche Grüsse - Meilleures salutations
>
> Igor Opaniuk
>
> mailto: igor.opan...@gmail.com
> skype: igor.opanyuk
> +380 (93) 836 40 67
> http://ua.linkedin.com/in/iopaniuk

Thanks

-- 
Best regards - Freundliche Grüsse - Meilleures salutations

Senior Development Engineer,
Igor Opaniuk

Toradex AG
Altsagenstrasse 5 | 6048 Horw/Luzern | Switzerland | T: +41 41 500 48
00 (main line)
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [RFC PATCH 00/11] SPL support for RISC-V

2019-07-24 Thread Bin Meng
Hi Lukas,

On Wed, Jul 24, 2019 at 5:23 PM Auer, Lukas
 wrote:
>
> Hi Bin,
>
> On Wed, 2019-07-24 at 10:55 +0800, Bin Meng wrote:
> > Hi Lukas,
> >
> > On Wed, Jul 24, 2019 at 5:34 AM Auer, Lukas
> >  wrote:
> > > Hi Bin,
> > >
> > > On Tue, 2019-07-23 at 16:32 +0800, Bin Meng wrote:
> > > > Hi Lukas,
> > > >
> > > > On Mon, Jul 22, 2019 at 2:00 AM Lukas Auer
> > > >  wrote:
> > > > > This series adds support for SPL to RISC-V U-Boot. Images can be 
> > > > > booted
> > > > > via OpenSBI (FW_DYNAMIC firmware) or by directly jumping to them. In 
> > > > > the
> > > > > former case, OpenSBI and U-Boot proper are bundled as a FIT image and
> > > > > made available to U-Boot SPL. Currently, only the QEMU board enables
> > > > > U-Boot SPL with a dedicated configuration. It uses RAM as SPL boot
> > > > > device.
> > > > >
> > > > > On many RISC-V CPUs, the device tree is provided to U-Boot by the
> > > > > first stage bootloader. This requires changes to U-Boot SPL (patches 
> > > > > 1,
> > > > > 2 and 3), which modify the behavior on other boards as well. To get
> > > > > feedback on this, I am therefore sending this series as RFC first.
> > > > >
> > > > > To test this series, OpenSBI has to be compiled first. The
> > > > > fw_dynamic.bin binary must be copied into the U-Boot root directory.
> > > > > Alternatively, the location of the binary can be specified with the
> > > > > OPENSBI environment variable. U-Boot can then be build as normal using
> > > > > the configuration qemu-riscv64_spl_defconfig for 64-bit builds or
> > > > > qemu-riscv32_spl_defconfig for 32-bit builds. The outputs from the 
> > > > > build
> > > > > process are the U-Boot SPL binary (spl/u-boot-spl.bin) and the U-Boot
> > > > > FIT image (u-boot.itb) containing U-Boot proper and OpenSBI.
> > > > >
> > > > > U-Boot can be run in QEMU with the following command.
> > > > >
> > > > > qemu-system-riscv64 -nographic -machine virt -kernel spl/u-boot-spl \
> > > > > -device loader,file=u-boot.itb,addr=0x8020
> > > > >
> > > >
> > > > Nice job done! It looks the SPL support was cleanly implemented.
> > > >
> > >
> > > Thank you very much! :)
> > >
> > > > I've tested this series, on qemu-riscv64 with UP and SMP, both work 
> > > > fine.
> > > > However when testing on qemu-riscv32, the U-Boot proper does not boot.
> > > > Please have a look.
> > > >
> > > > Regards,
> > > > Bin
> > >
> > > Thank you for reviewing and testing the series!
> > >
> > > Do you mean that the U-Boot prompt does not appear? Testing the series
> >
> > I mean U-Boot proper, the S-mode payload that SPL loads.
> >
> > > on qemu-riscv32, I get the U-Boot prompt from U-Boot proper. I did not
> > > try to boot Linux on qemu-riscv32, however. I will try that tomorrow.
> >
> > After debugging myself, it turns out to be a false alarm. Sorry about that.
> >
> > I was using a 64-bit OpenSBI fw_dynamic.bin. Looks OpenSBI doc does
> > not clearly mention how 32-bit build is to be done, and I will send a
> > patch for that. After switching a 32-bit OpenSBI firmware now I am
> > able to boot to 32-bit U-Boot proper.
> >
>
> No problem. You are right, that should be stated more clearly in the
> OpenSBI docs. Thanks for testing again!

One thing just occurred to me, is that did you try using binman to
package SPL + OpenSBI + U-Boot proper into one image?

I am not sure whether this is the preferred way going forward, hence I
added Simon for his comments.

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


[U-Boot] (Offlist) Re: U-Boot/EBBR plugfest at ELC-EU?

2019-07-24 Thread Daniel Kiper
On Mon, Jul 08, 2019 at 01:27:11PM +, Steve McIntyre wrote:
> On Mon, Jul 08, 2019 at 11:18:56AM +0100, Leif Lindholm wrote:
> >On Mon, Jul 08, 2019 at 12:13:07PM +0200, Daniel Kiper wrote:
> >> > I don't know yet - UEFI Asia plugfest date hasn't been decided yet,
> >> > and is likely to end up around the same time. And actually another
> >> > unrelated event too.
> >> >
> >> > Certainly, Lyon is a quite convenient train journey from here :)
> >> >
> >> > But I'm also happy to look into GRUB issues on 32-bit systems remotely
> >> > if someone could point me at them.
> >>
> >> I am not planning to be at ELC-E but I can help remotely if it is
> >> needed. However, there is another option. There is pretty good chance
> >> that I will get a MC slot at LPC. I am looking for people who want to
> >> talk. The overall plan is to devote this MC for boot stuff with focus
> >> on security. So, this maybe good place to discuss this. However, I am
> >> not ARM expert, so, I would like to see Leif and/or Alex or somebody
> >> else familiar with ARM stuff there too.
> >
> >If I can get a ticket, I'm already intending to attend plumbers.
> >
> >Registered on the waiting list.

Folks, our LPC MC was accepted:
  
https://linuxplumbersconf.org/event/4/page/34-accepted-microconferences#security
  
https://www.linuxplumbersconf.org/blog/2019/system-boot-and-security-microconference-accepted-into-2019-linux-plumbers-conference/

If you want to discuss something there please put a topic proposal on
LPC site. CfP closes on 2nd of August. If you need a pass or invite an
expert drop me a line.

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


[U-Boot] [PATCH v2] imx: add u-boot-nand.imx target

2019-07-24 Thread Igor Opaniuk
From: Igor Opaniuk 

Add an additional target which prepends the u-boot.imx image with
0x400 padding bytes. On Vybrid and i.MX 7, i.MX6ULL this is required
for NAND boot devices. The configuration CONFIG_IMX_NAND enables this
image for a board.

Signed-off-by: Stefan Agner 
Signed-off-by: Igor Opaniuk 
---

v2:
 - Addressed Jagan's comment

 Kconfig| 1 +
 Makefile   | 3 +++
 arch/arm/mach-imx/Makefile | 7 +++
 3 files changed, 11 insertions(+)

diff --git a/Kconfig b/Kconfig
index d2eb744e70..a791f58801 100644
--- a/Kconfig
+++ b/Kconfig
@@ -253,6 +253,7 @@ config BUILD_TARGET
default "u-boot.itb" if SPL_LOAD_FIT && (ROCKCHIP_RK3399 || ARCH_SUNXI)
default "u-boot.kwb" if KIRKWOOD
default "u-boot-with-spl.bin" if ARCH_AT91 && SPL_NAND_SUPPORT
+   default "u-boot-nand.imx" if (ARCH_MX6 || ARCH_MX7) || NAND_BOOT
help
  Some SoCs need special image types (e.g. U-Boot binary
  with a special header) as build targets. By defining
diff --git a/Makefile b/Makefile
index 73fdf70cdd..287b74dd50 100644
--- a/Makefile
+++ b/Makefile
@@ -1106,6 +1106,9 @@ endif
 %.vyb: %.imx
$(Q)$(MAKE) $(build)=arch/arm/cpu/armv7/vf610 $@
 
+u-boot-nand.imx: u-boot.imx
+   $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
+
 quiet_cmd_copy = COPY$@
   cmd_copy = cp $< $@
 
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 898478fc4a..365a5951f1 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -112,6 +112,13 @@ u-boot.imx: MKIMAGEOUTPUT = u-boot.imx.log
 u-boot.imx: u-boot.bin u-boot.cfgout $(PLUGIN).bin FORCE
$(call if_changed,mkimage)
 
+ifeq ($(CONFIG_NAND_BOOT),y)
+cmd_u-boot-nand_imx = (dd bs=1024 count=1 if=/dev/zero 2>/dev/null) | \
+   cat - $< > $@
+u-boot-nand.imx: u-boot.imx FORCE
+   $(call if_changed,u-boot-nand_imx)
+endif
+
 ifeq ($(CONFIG_MULTI_DTB_FIT),y)
 MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \
-T $(IMAGE_TYPE) -e $(CONFIG_SYS_TEXT_BASE)
-- 
2.17.1

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


Re: [U-Boot] Pull request for UEFI sub-system for v2019.10-rc1 (2)

2019-07-24 Thread Tom Rini
On Wed, Jul 17, 2019 at 06:20:09PM +0200, Heinrich Schuchardt wrote:

> The following changes since commit 9c94e0a64490b90d48995a8230499167c0bdca68:
> 
>   Merge branch 'master' of git://git.denx.de/u-boot-net (2019-07-15
> 18:56:24 -0400)
> 
> are available in the Git repository at:
> 
>   https://gitlab.denx.de/u-boot/custodians/u-boot-efi.git
> tags/efi-2019-10-rc1-2
> 
> for you to fetch changes up to f62be16ddb76a32e6315bb9517b49e639726e1fa:
> 
>   efi_loader: unaligned access in efi_file_from_path() (2019-07-16
> 22:17:23 +)
> 

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] drivers: net: fsl_enetc: add support for SGMII 2500

2019-07-24 Thread Alex Marginean

On 7/23/2019 2:34 AM, Joe Hershberger wrote:

On Mon, Jul 15, 2019 at 3:49 AM Alex Marginean  wrote:


SGMII 2500 as supported on NXP SoCs requires AN to be disabled, handle
this case in the enetc sgmii init code.

Signed-off-by: Alex Marginean 


In the future, please make sure to mention any dependencies on
outstanding patches.

Acked-by: Joe Hershberger 



Sorry about that, it does depend on this patch set:
https://patchwork.ozlabs.org/project/uboot/list/?series=117513

Thank you!
Alex

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


Re: [U-Boot] [PATCH 4/4] arm: dts: Set custom names for cp110 master/slave MDIO buses

2019-07-24 Thread Alex Marginean

On 7/23/2019 8:22 PM, Nevo Hed wrote:

For context from upstream linux,
https://github.com/torvalds/linux/commit/f66b2aff46eaf0825dbe1560e28fcb845dd2a215

I was intending to submit the parallel change here once fully tested
end-end on our hardware,
but if not too late my proposal is to name the above nodes as
"cpm-mdio" & "cps-mdio"


I'm OK with "-mdio", I can send a v2.
Please node that I used a property called 'device-name' rather than
'mdio-name', I'm not sure if you want to pick that up too or not.

Thanks!
Alex




On Tue, Jul 23, 2019 at 1:03 PM Nevo Hed  wrote:


Sorry for the late input

The cp110s have an mdio and an xmdio so
Locally I have been naming them cpm-xmdio, cpm-mdio, cps-xmdio, cps-mdio

I knew the new field is coming but didn't catch that the 'dtsi's patch

[also apologies if you get this a second time]

On Mon, Jul 22, 2019 at 8:30 PM Joe Hershberger  wrote:


On Wed, Jul 17, 2019 at 10:12 AM Alex Marginean
 wrote:


Implicitly Marvell MDIO driver uses DT node names for devices, but in this
case that is not unique.  Set MDIO device names for master/slave to
cpm/cps.

Signed-off-by: Alex Marginean 


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

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



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


Re: [U-Boot] [PATCH v3 3/3] board: puma: Use rockchip_* helpers to setup cpuid and macaddr【请注意,邮件由u-boot-boun...@lists.denx.de代发】 setup cpuid and macaddr

2019-07-24 Thread Kever Yang

Hi Rohan,

On 2019/7/24 下午7:09, Rohan Garg wrote:

We should use the shared helpers to setup the necessary parts

Signed-off-by: Rohan Garg 
---

  .../puma_rk3399/puma-rk3399.c | 108 +++---
  1 file changed, 18 insertions(+), 90 deletions(-)

diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c 
b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
index 251cd2d566..fb6c7c1f0a 100644
--- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c
+++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
@@ -17,6 +17,7 @@
  #include 
  #include 
  #include 
+#include 
  #include 
  #include 
  #include 
@@ -36,94 +37,6 @@ int board_init(void)
return 0;
  }
  
-static void setup_macaddr(void)

-{
-#if CONFIG_IS_ENABLED(CMD_NET)
-   int ret;
-   const char *cpuid = env_get("cpuid#");
-   u8 hash[SHA256_SUM_LEN];
-   int size = sizeof(hash);
-   u8 mac_addr[6];
-
-   /* Only generate a MAC address, if none is set in the environment */
-   if (env_get("ethaddr"))
-   return;
-
-   if (!cpuid) {
-   debug("%s: could not retrieve 'cpuid#'\n", __func__);
-   return;
-   }
-
-   ret = hash_block("sha256", (void *)cpuid, strlen(cpuid), hash, );
-   if (ret) {
-   debug("%s: failed to calculate SHA256\n", __func__);
-   return;
-   }
-
-   /* Copy 6 bytes of the hash to base the MAC address on */
-   memcpy(mac_addr, hash, 6);
-
-   /* Make this a valid MAC address and set it */
-   mac_addr[0] &= 0xfe;  /* clear multicast bit */
-   mac_addr[0] |= 0x02;  /* set local assignment bit (IEEE802) */
-   eth_env_set_enetaddr("ethaddr", mac_addr);
-#endif
-}
-
-static void setup_serial(void)
-{
-#if CONFIG_IS_ENABLED(ROCKCHIP_EFUSE)
-   const u32 cpuid_offset = 0x7;
-   const u32 cpuid_length = 0x10;
-
-   struct udevice *dev;
-   int ret, i;
-   u8 cpuid[cpuid_length];
-   u8 low[cpuid_length/2], high[cpuid_length/2];
-   char cpuid_str[cpuid_length * 2 + 1];
-   u64 serialno;
-   char serialno_str[17];
-
-   /* retrieve the device */
-   ret = uclass_get_device_by_driver(UCLASS_MISC,
- DM_GET_DRIVER(rockchip_efuse), );
-   if (ret) {
-   debug("%s: could not find efuse device\n", __func__);
-   return;
-   }
-
-   /* read the cpu_id range from the efuses */
-   ret = misc_read(dev, cpuid_offset, , sizeof(cpuid));
-   if (ret) {
-   debug("%s: reading cpuid from the efuses failed\n",
- __func__);
-   return;
-   }
-
-   memset(cpuid_str, 0, sizeof(cpuid_str));
-   for (i = 0; i < 16; i++)
-   sprintf(_str[i * 2], "%02x", cpuid[i]);
-
-   debug("cpuid: %s\n", cpuid_str);
-
-   /*
-* Mix the cpuid bytes using the same rules as in
-*   ${linux}/drivers/soc/rockchip/rockchip-cpuinfo.c
-*/
-   for (i = 0; i < 8; i++) {
-   low[i] = cpuid[1 + (i << 1)];
-   high[i] = cpuid[i << 1];
-   }
-
-   serialno = crc32_no_comp(0, low, 8);
-   serialno |= (u64)crc32_no_comp(serialno, high, 8) << 32;
-   snprintf(serialno_str, sizeof(serialno_str), "%016llx", serialno);
-
-   env_set("cpuid#", cpuid_str);
-   env_set("serial#", serialno_str);
-#endif
-}
-
  static void setup_iodomain(void)
  {
const u32 GRF_IO_VSEL_GPIO4CD_SHIFT = 3;
@@ -213,8 +126,23 @@ static int setup_boottargets(void)
  
  int misc_init_r(void)



After misc_init_r has add into rk3399_board, then this misc_init_r() 
here will be multi-defined?


In this case, maybe we need to remove the misc_init_r() from 
rk3399_board.c first? :(



Thanks,

- Kever


  {
-   setup_serial();
-   setup_macaddr();
+   const u32 cpuid_offset = 0x7;
+   const u32 cpuid_length = 0x10;
+   u8 cpuid[cpuid_length];
+   int ret;
+
+   ret = rockchip_cpuid_from_efuse(cpuid_offset, cpuid_length, cpuid);
+   if (ret)
+   return ret;
+
+   ret = rockchip_cpuid_set(cpuid, cpuid_length);
+   if (ret)
+   return ret;
+
+   ret = rockchip_setup_macaddr();
+   if (ret)
+   return ret;
+
setup_iodomain();
setup_boottargets();
  



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


Re: [U-Boot] [PATCH] board_r: re-order the board_early_init_r()

2019-07-24 Thread Kever Yang


On 2019/7/24 下午6:22, Simon Goldschmidt wrote:

On Wed, Jul 24, 2019 at 12:01 PM Kever Yang  wrote:

The board_early_init_r() suppose to be called before board_init(),
then the board callback functions in board_r will be:
- board_early_init_r()
- board_init()
- board_late_init()

Searching through the code, elixir.bootlin.com gives me 52 definitions
of board_early_init_r(). Does this patch break any of those boards
when it changes the order of those calls?


I do have check some of the implement and most of them should be OK, but 
to be honest,


I'm don't have any of those boards, and not sure if this break any of 
them, and I'm not sure


if people using this interface have notice it's after the board_init().

When I try to use this board_early_init_r(), I thought this is before 
board_init(), but it actually


after the board_init(), that make people confusing.

I think the _early_ one should be at the first, isn't it?

Thanks,
- Kever


Regards,
Simon


Signed-off-by: Kever Yang 
---

  common/board_r.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/board_r.c b/common/board_r.c
index abc31b17b8..c5e33c4654 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -681,6 +681,9 @@ static init_fnc_t init_sequence_r[] = {
  #ifdef CONFIG_DM
 initr_dm,
  #endif
+#if defined(CONFIG_BOARD_EARLY_INIT_R)
+   board_early_init_r,
+#endif
  #if defined(CONFIG_ARM) || defined(CONFIG_NDS32) || defined(CONFIG_RISCV) || \
 defined(CONFIG_SANDBOX)
 board_init, /* Setup chipselects */
@@ -712,9 +715,6 @@ static init_fnc_t init_sequence_r[] = {
  #endif
  #ifdef CONFIG_ADDR_MAP
 initr_addr_map,
-#endif
-#if defined(CONFIG_BOARD_EARLY_INIT_R)
-   board_early_init_r,
  #endif
 INIT_FUNC_WATCHDOG_RESET
  #ifdef CONFIG_POST
--
2.17.1




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


Re: [U-Boot] [PATCH v1] colibri_imx7: boot kernel in secure mode

2019-07-24 Thread Igor Opaniuk
Hi Stefan

On Wed, Jul 24, 2019 at 2:32 PM Stefan Agner  wrote:
>
> On 2019-07-03 15:50, Igor Opaniuk wrote:
> > From: Igor Opaniuk 
> >
> > NXP downstream kernel uses legacy method to enable other cores,
> > which requires kernel to run in a security mode (althought upstream kernel
> > uses PSCI for this).
> >
> > As we're using NXP kernel in our BSPs, lets enable this by default.
>
> I think I mentioned it internally, but just to be clear: I do not agree
> with this patch.
>
> Upstream U-Boot should be able to boot upstream Linux. I'd rather prefer
> to carry that patch in our downstream fork (or set the bootm_boot_mode
> environment in our boot script).

Totally agree with you here,
BTW, seems that Stefano has applied by mistake to u-boot-imx
fcc79eee14("colibri_imx7_emmc: enable CONFIG_ARMV7_BOOT_SEC_DEFAULT"),
although I've asked to ignore it.

Probably will send another patch that reverts this.

>
> --
> Stefan
>
> >
> > Signed-off-by: Igor Opaniuk 
> > ---
> >
> >  include/configs/colibri_imx7.h | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/configs/colibri_imx7.h b/include/configs/colibri_imx7.h
> > index 40173b18fa..5408577661 100644
> > --- a/include/configs/colibri_imx7.h
> > +++ b/include/configs/colibri_imx7.h
> > @@ -164,7 +164,8 @@
> >   "${board}/flash_blk.img && source ${loadaddr}\0" \
> >   "setup=setenv setupargs " \
> >   "console=tty1 console=${console}" \
> > - ",${baudrate}n8 ${memargs} consoleblank=0\0" \
> > + ",${baudrate}n8 ${memargs} consoleblank=0; " \
> > + "setenv bootm_boot_mode sec\0" \
> >   "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" 
> > \
> >   "setusbupdate=usb start && setenv interface usb && " \
> >   "fatload ${interface} 0:1 ${loadaddr} " \



-- 
Best regards - Freundliche Grüsse - Meilleures salutations

Igor Opaniuk

mailto: igor.opan...@gmail.com
skype: igor.opanyuk
+380 (93) 836 40 67
http://ua.linkedin.com/in/iopaniuk
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


  1   2   >