Re: [U-Boot] [PATCH] spl: Add full fitImage support

2018-05-13 Thread Marek Vasut
On 05/14/2018 12:02 AM, Simon Glass wrote:
> On 13 May 2018 at 08:23, Marek Vasut  wrote:
>> Add support for loading U-Boot and optionally FDT from a fitImage
>> in SPL by using the full fitImage support from U-Boot. While we do
>> have limited SPL loading support in SPL with a small footprint, it
>> is missing a lot of important features, like checking signatures.
>> This support has all the fitImage features, while the footprint is
>> obviously larger.
>>
>> Signed-off-by: Marek Vasut 
>> Cc: Pantelis Antoniou 
>> Cc: Simon Glass 
>> ---
>> V2: - Drop blank line below spl_load_fit_image()
>> - Explicitly enable image verification if available
>> ---
>>  Kconfig  | 11 +
>>  common/spl/spl.c | 74 
>> 
>>  2 files changed, 85 insertions(+)
>>
> 
> Reviewed-by: Simon Glass 
> 
> Can you add this to the FIT tests?

Yeah, do you have some pointers for me ?

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


Re: [U-Boot] [GIT] Pull request: u-boot-dfu (13.05.2018)

2018-05-13 Thread Marek Vasut
On 05/13/2018 09:24 PM, Lukasz Majewski wrote:
> Dear Marek,
> 
> 
> Travis CI:
> https://travis-ci.org/lmajewski/u-boot-dfu/builds/378387230
> 
> The following changes since commit
> 62d77cea31216cad526e5f45c88e8377efc6fcae:
> 
>   mmc: Improve tinification (2018-05-13 07:57:32 -0400)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-dfu.git 
> 
> for you to fetch changes up to 8780dca82fa6c5dbf264acf78140d39d8ed4acc2:
> 
>   gadget: f_thor: update to support more than 4GB file as thor 5.0
>   (2018-05-13 17:07:06 +0200)

Applied, thanks

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


Re: [U-Boot] [PATCH v2 4/6] scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987

2018-05-13 Thread Eugeniu Rosca
Hi Simon,

On Mon, May 14, 2018 at 08:00:40AM +1000, Simon Glass wrote:
> Hi,
> 
> On 13 May 2018 at 03:13, Eugeniu Rosca  wrote:
> > From: Rob Herring 
> >
> > This adds the following commits from upstream:
> >
> > aadd0b65c987 checks: centralize printing of property names in failure 
> > messages
> > 88960e398907 checks: centralize printing of node path in check_msg
> > f1879e1a50eb Add limited read-only support for older (V2 and V3) device 
> > tree to libfdt.
> > 37dea76e9700 srcpos: drop special handling of tab
> > 65893da4aee0 libfdt: overlay: Add missing license
> > 962a45ca034d Avoid installing pylibfdt when dependencies are missing
> > cd6ea1b2bea6 Makefile: Split INSTALL out into 
> > INSTALL_{PROGRAM,LIB,DATA,SCRIPT}
> > 51b3a16338df Makefile.tests: Add LIBDL make(1) variable for portability sake
> > 333d533a8f4d Attempt to auto-detect stat(1) being used if not given proper 
> > invocation
> > e54388015af1 dtc: Bump version to v1.4.6
> > a1fe86f380cb fdtoverlay: Switch from using alloca to malloc
> > c8d5472de3ff tests: Improve compatibility with other platforms
> > c81d389a10cc checks: add chosen node checks
> > e671852042a7 checks: add aliases node checks
> > d0c44ebe3f42 checks: check for #{size,address}-cells without child nodes
> > 18a3d84bb802 checks: add string list check for *-names properties
> > 8fe94fd6f19f checks: add string list check
> > 6c5730819604 checks: add a string check for 'label' property
> > a384191eba09 checks: fix sound-dai phandle with arg property check
> > b260c4f610c0 Fix ambiguous grammar for devicetree rule
> > fe667e382bac tests: Add some basic tests for the pci_bridge checks
> > 7975f6422260 Fix widespread incorrect use of strneq(), replace with new 
> > strprefixeq()
> > fca296445eab Add strstarts() helper function
> > cc392f089007 tests: Check non-matching cases for fdt_node_check_compatible()
> > bba26a5291c8 livetree: avoid assertion of orphan phandles with overlays
> > c8f8194d76cc implement strnlen for systems that need it
> > c8b38f65fdec libfdt: Remove leading underscores from identifiers
> > 3b62fdaebfe5 Remove leading underscores from identifiers
> > 2d45d1c5c65e Replace FDT_VERSION() with stringify()
> > 2e6fe5a107b5 Fix some errors in comments
> > b0ae9e4b0ceb tests: Correct warning in sw_tree1.c
> >
> > Commit c8b38f65fdec upstream ("libfdt: Remove leading underscores from
> > identifiers") changed the multiple inclusion define protection, so the
> > kernel's libfdt_env.h needs the corresponding update.
> >
> > Signed-off-by: Rob Herring 
> > [ Linux commit: 9130ba884640328bb78aaa4840e5ddf06ccafb1c ]
> > [erosca: - Fixup conflicts in include/linux/libfdt_env.h caused by 
> > v2018.03-rc4
> >commit b08c8c487083 ("libfdt: move headers to 
> >and ")
> >  - Fix build errors in lib/libfdt/fdt_ro.c, tools/libfdt/fdt_rw.c 
> > by:
> >- s/_fdt_mem_rsv/fdt_mem_rsv_/
> >- s/_fdt_offset_ptr/fdt_offset_ptr_/
> >- s/_fdt_check_node_offset/fdt_check_node_offset_/
> >- s/_fdt_check_prop_offset/fdt_check_prop_offset_/
> >- s/_fdt_find_add_string/fdt_find_add_string_/]
> > Signed-off-by: Eugeniu Rosca 
> > ---
> >
> > v1-v2:
> > * Newly pushed
> >
> >  include/linux/libfdt_env.h   |   6 +-
> >  lib/libfdt/fdt_ro.c  |  18 +-
> >  scripts/dtc/checks.c | 439 ++-
> >  scripts/dtc/dtc-parser.y |  17 +-
> >  scripts/dtc/dtc.c|   7 +-
> >  scripts/dtc/dtc.h|  11 +-
> >  scripts/dtc/flattree.c   |   2 +-
> >  scripts/dtc/libfdt/fdt.c |  13 +-
> >  scripts/dtc/libfdt/fdt.h |   6 +-
> >  scripts/dtc/libfdt/fdt_overlay.c |  51 
> >  scripts/dtc/libfdt/fdt_ro.c  | 132 ++--
> >  scripts/dtc/libfdt/fdt_rw.c  |  90 +++---
> >  scripts/dtc/libfdt/fdt_sw.c  |  24 +-
> >  scripts/dtc/libfdt/fdt_wip.c |  10 +-
> >  scripts/dtc/libfdt/libfdt.h  |  37 +--
> >  scripts/dtc/libfdt/libfdt_env.h  |  33 +-
> >  scripts/dtc/libfdt/libfdt_internal.h |  32 +-
> >  scripts/dtc/livetree.c   |  10 +-
> >  scripts/dtc/srcpos.c |   5 -
> >  scripts/dtc/srcpos.h |   6 +-
> >  scripts/dtc/util.h   |   9 +-
> >  scripts/dtc/version_gen.h|   2 +-
> >  tools/libfdt/fdt_rw.c|   2 +-
> >  23 files changed, 632 insertions(+), 330 deletions(-)
> 
> Can you please check that this does not adversely impact code size?

Sure. Here are the sizes before and after this patch (sandbox):

1. ELF size comparison shows 96 bytes increase
$ du -b u-boot.before u-boot.after
  8055864   u-boot.before
  8055960   u-boot.after

2. BIN size comparison shows no change
$ du -b u-boot.bin.before u-boot.bin.after
  3377256   u-boot.bin.before
  3377256   u-boot.bin.after

3. "size" tool gives more details about ELF file size increase

Re: [U-Boot] [PATCH v2 08/11] sandbox: Enable support for MC34708 PMIC in DTS

2018-05-13 Thread Simon Glass
On 7 May 2018 at 06:26, Lukasz Majewski  wrote:
> This commit also provides the default values of the emulated MC34708 PMIC
> internal registers content.
>
> Signed-off-by: Lukasz Majewski 
>
> ---
>
> Changes in v2:
> - New patch
>
>  arch/sandbox/dts/sandbox.dts   |  4 
>  arch/sandbox/dts/sandbox64.dts |  4 
>  arch/sandbox/dts/sandbox_pmic.dtsi | 33 +
>  arch/sandbox/dts/test.dts  |  4 
>  4 files changed, 45 insertions(+)

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


Re: [U-Boot] [PATCH v2 09/11] sandbox: Enable MC34708 PMIC support

2018-05-13 Thread Simon Glass
On 7 May 2018 at 06:26, Lukasz Majewski  wrote:
> This MC34708 PMIC is somewhat special - it used single transfers (R/W) with
> 3 bytes size - up till now u-boot's PMICs only used 1 byte.

U-Boot's

>
> Signed-off-by: Lukasz Majewski 
>
> ---
>
> Changes in v2:
> - New patch
>
>  configs/sandbox_defconfig | 1 +
>  1 file changed, 1 insertion(+)

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


Re: [U-Boot] [PATCH] spl: Add full fitImage support

2018-05-13 Thread Simon Glass
On 13 May 2018 at 08:23, Marek Vasut  wrote:
> Add support for loading U-Boot and optionally FDT from a fitImage
> in SPL by using the full fitImage support from U-Boot. While we do
> have limited SPL loading support in SPL with a small footprint, it
> is missing a lot of important features, like checking signatures.
> This support has all the fitImage features, while the footprint is
> obviously larger.
>
> Signed-off-by: Marek Vasut 
> Cc: Pantelis Antoniou 
> Cc: Simon Glass 
> ---
> V2: - Drop blank line below spl_load_fit_image()
> - Explicitly enable image verification if available
> ---
>  Kconfig  | 11 +
>  common/spl/spl.c | 74 
> 
>  2 files changed, 85 insertions(+)
>

Reviewed-by: Simon Glass 

Can you add this to the FIT tests?
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 10/11] sandbox: tests: Exclude common test code (pmic_get) in test/dm/pmic.c

2018-05-13 Thread Simon Glass
On 7 May 2018 at 06:26, Lukasz Majewski  wrote:
> The common code can be excluded to be reused by tests for other PMIC.
>
> Signed-off-by: Lukasz Majewski 
>
> ---
>
> Changes in v2:
> - New patch
>
>  test/dm/pmic.c | 12 ++--
>  1 file changed, 10 insertions(+), 2 deletions(-)

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


Re: [U-Boot] [PATCH v2 05/11] pmic: dm: Add support for MC34708 for PMIC DM

2018-05-13 Thread Simon Glass
Hi Lukasz,

On 7 May 2018 at 06:26, Lukasz Majewski  wrote:
> This patch adds support for MC34708 PMIC, to be used with driver model
> (DM).
>
> Signed-off-by: Lukasz Majewski 
>
> ---
>
> Changes in v2:
> - Support for uclass private data with trasfer length
>
>  drivers/power/pmic/Kconfig   |   7 +++
>  drivers/power/pmic/Makefile  |   1 +
>  drivers/power/pmic/mc34708.c | 101 
> +++
>  3 files changed, 109 insertions(+)
>  create mode 100644 drivers/power/pmic/mc34708.c
>
> diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig
> index 40ab9f7fa5..d504c28b77 100644
> --- a/drivers/power/pmic/Kconfig
> +++ b/drivers/power/pmic/Kconfig
> @@ -69,6 +69,13 @@ config DM_PMIC_MAX8998
> This config enables implementation of driver-model pmic uclass 
> features
> for PMIC MAX8998. The driver implements read/write operations.
>
> +config DM_PMIC_MC34708
> +   bool "Enable Driver Model for PMIC MC34708"
> +   depends on DM_PMIC
> +   help
> +This config enables implementation of driver-model pmic uclass 
> features
> +for PMIC MC34708. The driver implements read/write operations.
> +
>  config PMIC_MAX8997
> bool "Enable Driver Model for PMIC MAX8997"
> depends on DM_PMIC
> diff --git a/drivers/power/pmic/Makefile b/drivers/power/pmic/Makefile
> index ad32068b3a..418b5e7aee 100644
> --- a/drivers/power/pmic/Makefile
> +++ b/drivers/power/pmic/Makefile
> @@ -8,6 +8,7 @@
>  obj-$(CONFIG_DM_PMIC) += pmic-uclass.o
>  obj-$(CONFIG_DM_PMIC_MAX77686) += max77686.o
>  obj-$(CONFIG_DM_PMIC_MAX8998) += max8998.o
> +obj-$(CONFIG_DM_PMIC_MC34708) += mc34708.o
>  obj-$(CONFIG_$(SPL_)DM_PMIC_PFUZE100) += pfuze100.o
>  obj-$(CONFIG_PMIC_S2MPS11) += s2mps11.o
>  obj-$(CONFIG_DM_PMIC_SANDBOX) += sandbox.o i2c_pmic_emul.o
> diff --git a/drivers/power/pmic/mc34708.c b/drivers/power/pmic/mc34708.c
> new file mode 100644
> index 00..d9d1a41802
> --- /dev/null
> +++ b/drivers/power/pmic/mc34708.c
> @@ -0,0 +1,101 @@
> +/*
> + * Copyright (C) 2018
> + * Lukasz Majewski, DENX Software Engineering, lu...@denx.de
> + *
> + * SPDX-License-Identifier:GPL-2.0+
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 

should be at end

> +#include 

should be above i2c.h

> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +static int mc34708_reg_count(struct udevice *dev)
> +{
> +   return PMIC_NUM_OF_REGS;
> +}
> +
> +static int mc34708_write(struct udevice *dev, uint reg, const u8 *buff,
> +int len)
> +{
> +   u8 buf[3] = { 0 };
> +   int ret;
> +
> +   if (len != MC34708_TRANSFER_SIZE)
> +   return -EINVAL;
> +
> +   buf[0] = buff[2];
> +   buf[1] = buff[1];
> +   buf[2] = buff[0];

What is going on here? It deserves a comment at least.

> +
> +   ret = dm_i2c_write(dev, reg, buf, len);
> +   if (ret)
> +   printf("write error to device: %p register: %#x!", dev, reg);
> +
> +   return ret;
> +}
> +

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


Re: [U-Boot] [PATCH 2/3] fit: Add empty fit_print_contents() and fit_image_print()

2018-05-13 Thread Simon Glass
On 13 May 2018 at 08:22, Marek Vasut  wrote:
> These functions may be needed in SPL, so add empty variants of them
> if CONFIG_SPL_FIT_PRINT is disabled.
>
> Signed-off-by: Marek Vasut 
> Cc: Pantelis Antoniou 
> Cc: Simon Glass 
> ---
>  common/image-fit.c | 4 +++-
>  1 file changed, 3 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/3] fit: Fix CONFIG_FIT_SPL_PRINT

2018-05-13 Thread Simon Glass
On 13 May 2018 at 08:22, Marek Vasut  wrote:
> Rename CONFIG_FIT_SPL_PRINT to CONFIG_SPL_FIT_PRINT and add Kconfig
> entry for it.
>
> Signed-off-by: Marek Vasut 
> Cc: Pantelis Antoniou 
> Cc: Simon Glass 
> ---
>  Kconfig| 6 ++
>  README | 2 +-
>  common/image-fit.c | 4 ++--
>  3 files changed, 9 insertions(+), 3 deletions(-)
>

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


Re: [U-Boot] [PATCH v2 11/11] sandbox: tests: Add tests for mc34708 PMIC device

2018-05-13 Thread Simon Glass
On 7 May 2018 at 06:26, Lukasz Majewski  wrote:
> Following tests has been added for mc34708 device:
>
> - get_test for mc34708 PMIC
> - Check if proper number of registers is read
> - Check if default (emulated via i2c device) value is properly read
> - Check if value write/read operation is correct
> - Perform tests to check if pmic_clrsetbits() is working correctly
>
> Signed-off-by: Lukasz Majewski 
>
> ---
>
> Changes in v2:
> - New patch
>
>  test/dm/pmic.c | 56 
>  1 file changed, 56 insertions(+)

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


Re: [U-Boot] [PATCH 3/3] fit: Add standalone image type handling

2018-05-13 Thread Simon Glass
On 13 May 2018 at 08:22, Marek Vasut  wrote:
> Just add IH_TYPE_STANDALONE to fit_get_image_type_property().
>
> Signed-off-by: Marek Vasut 
> Cc: Pantelis Antoniou 
> Cc: Simon Glass 
> ---
>  common/image-fit.c | 2 ++
>  include/image.h| 1 +
>  2 files changed, 3 insertions(+)
>

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


Re: [U-Boot] [PATCH v3 3/3] net: designware: Add reset ctrl to driver

2018-05-13 Thread Simon Glass
On 8 May 2018 at 13:19, Ley Foon Tan  wrote:
> Add code to reset all reset signals as in Ethernet DT node. A reset property 
> is an optional feature,
> so only print out a warning and do not fail if a reset property is not 
> present.
>
> If a reset property is discovered, then use it to deassert, thus bringing the
> IP out of reset.
>
> Signed-off-by: Ley Foon Tan 
> ---
>  drivers/net/designware.c |8 
>  1 files changed, 8 insertions(+), 0 deletions(-)

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


Re: [U-Boot] [PATCH v2 07/11] sandbox: Rewrite i2c_pmic_emul.c to support PMIC with 3 bytes transmission

2018-05-13 Thread Simon Glass
Hi Lukasz,

On 7 May 2018 at 06:26, Lukasz Majewski  wrote:
> This change enables support for MC34708 PMIC in sandbox. Now we can
> emulate the I2C transfers larger than 1 byte.
>
> Notable changes for this driver:
>
> - From now on the register number is not equal to index in the buffer,
>   which emulates the PMIC registers
>
> - The PMIC register's pool is now dynamically allocated up till
>   64 regs * 3 bytes each = 192 B
>
> Signed-off-by: Lukasz Majewski 
>
> ---
>
> Changes in v2:
> - New patch
>
>  drivers/power/pmic/i2c_pmic_emul.c | 45 
> ++
>  1 file changed, 31 insertions(+), 14 deletions(-)

Reviewed-by: Simon Glass 

Comments below

>
> diff --git a/drivers/power/pmic/i2c_pmic_emul.c 
> b/drivers/power/pmic/i2c_pmic_emul.c
> index c58ebb8825..6f227a92f3 100644
> --- a/drivers/power/pmic/i2c_pmic_emul.c
> +++ b/drivers/power/pmic/i2c_pmic_emul.c
> @@ -19,8 +19,11 @@
>   * @reg:PMICs registers array
>   */
>  struct sandbox_i2c_pmic_plat_data {
> -   u8 rw_reg;
> -   u8 reg[SANDBOX_PMIC_REG_COUNT];
> +   u8 rw_reg, rw_idx;
> +   u8 reg_count;
> +   u8 trans_len;
> +   u8 buf_size;
> +   u8 *reg;
>  };
>
>  static int sandbox_i2c_pmic_read_data(struct udevice *emul, uchar chip,
> @@ -28,16 +31,16 @@ static int sandbox_i2c_pmic_read_data(struct udevice 
> *emul, uchar chip,
>  {
> struct sandbox_i2c_pmic_plat_data *plat = dev_get_platdata(emul);
>
> -   if (plat->rw_reg + len > SANDBOX_PMIC_REG_COUNT) {
> +   if (plat->rw_idx + len > plat->buf_size) {
> pr_err("Request exceeds PMIC register range! Max register: 
> %#x",
> - SANDBOX_PMIC_REG_COUNT);
> + plat->reg_count);
> return -EFAULT;
> }
>
> -   debug("Read PMIC: %#x at register: %#x count: %d\n",
> - (unsigned)chip & 0xff, plat->rw_reg, len);
> +   debug("Read PMIC: %#x at register: %#x idx: %#x count: %d\n",
> + (unsigned int)chip & 0xff, plat->rw_reg, plat->rw_idx, len);
>
> -   memcpy(buffer, &plat->reg[plat->rw_reg], len);
> +   memcpy(buffer, plat->reg + plat->rw_idx, len);

Why change this?

>
> return 0;
>  }
> @@ -54,9 +57,10 @@ static int sandbox_i2c_pmic_write_data(struct udevice 
> *emul, uchar chip,
>
> /* Set PMIC register for I/O */
> plat->rw_reg = *buffer;
> +   plat->rw_idx = plat->rw_reg * plat->trans_len;
>
> -   debug("Write PMIC: %#x at register: %#x count: %d\n",
> - (unsigned)chip & 0xff, plat->rw_reg, len);
> +   debug("Write PMIC: %#x at register: %#x idx: %#x count: %d\n",
> + (unsigned int)chip & 0xff, plat->rw_reg, plat->rw_idx, len);
>
> /* For read operation, set (write) only chip reg */
> if (next_is_read)
> @@ -65,12 +69,12 @@ static int sandbox_i2c_pmic_write_data(struct udevice 
> *emul, uchar chip,
> buffer++;
> len--;
>
> -   if (plat->rw_reg + len > SANDBOX_PMIC_REG_COUNT) {
> +   if (plat->rw_idx + len > plat->buf_size) {
> pr_err("Request exceeds PMIC register range! Max register: 
> %#x",
> - SANDBOX_PMIC_REG_COUNT);
> + plat->reg_count);
> }
>
> -   memcpy(&plat->reg[plat->rw_reg], buffer, len);
> +   memcpy(plat->reg + plat->rw_idx, buffer, len);

and this?

>
> return 0;
>  }
> @@ -101,20 +105,33 @@ static int sandbox_i2c_pmic_xfer(struct udevice *emul, 
> struct i2c_msg *msg,
>  static int sandbox_i2c_pmic_ofdata_to_platdata(struct udevice *emul)
>  {
> struct sandbox_i2c_pmic_plat_data *plat = dev_get_platdata(emul);
> +   struct udevice *pmic_dev = dev_get_parent(emul);
> +   struct dm_pmic_info *pmic_info = dev_get_uclass_priv(pmic_dev);
> const u8 *reg_defaults;
>
> debug("%s:%d Setting PMIC default registers\n", __func__, __LINE__);
> +   plat->reg_count = pmic_reg_count(pmic_dev);
> +   plat->trans_len = pmic_info->trans_len;
> +   plat->buf_size = plat->reg_count * plat->trans_len;
> +
> +   plat->reg = calloc(1, plat->buf_size);
> +   if (!plat->reg) {
> +   pr_err("Canot allocate memory (%d B) for PMIC I2C 
> emulation!\n",
> +  plat->buf_size);

debug()

> +   return -ENOMEM;
> +   }
>
> reg_defaults = dev_read_u8_array_ptr(emul, "reg-defaults",
> -SANDBOX_PMIC_REG_COUNT);
> +plat->buf_size);
>
> if (!reg_defaults) {
> pr_err("Property \"reg-defaults\" not found for device: %s!",
>   emul->name);
> +   free(plat->reg);
> return -EINVAL;
> }
>
> -   memcpy(&plat->reg, reg_defaults, SANDBOX_PMIC_REG_COUNT);
> +   memcpy(plat->reg, reg_defaults, plat->buf_size);
>
> return 0;
>  }
> --
> 2.11.0
>

Regards,
Simon
___

Re: [U-Boot] [PATCH v2] timer: Add Cadence TTC timer counter support

2018-05-13 Thread Simon Glass
On 10 May 2018 at 18:24, Michal Simek  wrote:
> This driver was tested on Xilinx ZynqMP SoC.
>
> Signed-off-by: Michal Simek 
> ---
>
> Changes in v2:
> - Remove tabs from U_BOOT_DRIVER
>
>  MAINTAINERS |  1 +
>  drivers/timer/Kconfig   |  7 +++
>  drivers/timer/Makefile  |  1 +
>  drivers/timer/cadence-ttc.c | 91 +
>  4 files changed, 100 insertions(+)
>  create mode 100644 drivers/timer/cadence-ttc.c

Reviewed-by: Simon Glass 

But please see below.

[...]

> +static int cadence_ttc_ofdata_to_platdata(struct udevice *dev)
> +{
> +   struct cadence_ttc_priv *priv = dev_get_priv(dev);
> +
> +   priv->regs = map_physmem(devfdt_get_addr(dev),
> +sizeof(struct cadence_ttc_regs), 
> MAP_NOCACHE);

Please use dev_read_addr() and other live-tree functions.

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


Re: [U-Boot] [PATCH v3 1/3] mmc: dwmmc: socfpga: Add reset ctrl to driver

2018-05-13 Thread Simon Glass
On 8 May 2018 at 13:19, Ley Foon Tan  wrote:
> Add code to reset all reset signals as in mmc DT node. A reset property is an 
> optional feature,
> so only print out a warning and do not fail if a reset property is not 
> present.
>
> If a reset property is discovered, then use it to deassert, thus bringing the
> IP out of reset.
>
> Signed-off-by: Ley Foon Tan 
> ---
>  drivers/mmc/socfpga_dw_mmc.c |   17 +
>  1 files changed, 17 insertions(+), 0 deletions(-)

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


Re: [U-Boot] [PATCH 7/7] serial: serial_msm: added pinmux & config

2018-05-13 Thread Simon Glass
On 12 May 2018 at 20:15, Ramon Fried  wrote:
> Serial port configuration was missing from previous implementation.
> It only worked because it was preconfigured by LK.
> This patch configures the uart for 115200 8N1.
> It also configures the pin mux for uart pins using DT bindings.
>
> Signed-off-by: Ramon Fried 
> ---
>  drivers/serial/serial_msm.c | 24 ++--
>  1 file changed, 18 insertions(+), 6 deletions(-)

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


Re: [U-Boot] [PATCH v2 06/11] pmic: Rewrite the pmic command to not only work with single byte transmission

2018-05-13 Thread Simon Glass
On 7 May 2018 at 06:26, Lukasz Majewski  wrote:
> Up till now it was only possible to use 'pmic' command with a single byte
> transmission.
> The pmic_read|write functions has been replaced with ones, which don't need
> the transmission length as a parameter.
>
> Due to that it is possible now to read data from PMICs transmitting more
> data than 1 byte at once (e.g. mc34708)
>
> Signed-off-by: Lukasz Majewski 
>
> ---
>
> Changes in v2:
> - New patch
>
>  cmd/pmic.c | 31 +++
>  1 file changed, 19 insertions(+), 12 deletions(-)

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


Re: [U-Boot] [PATCH v2 6/6] sandbox: dts: test: Fix wrong aliases property names

2018-05-13 Thread Simon Glass
On 13 May 2018 at 03:13, Eugeniu Rosca  wrote:
> After importing v4.17-rc1 Linux commit 9130ba884640 ("scripts/dtc:
> Update to upstream version v1.4.6-9-gaadd0b65c987"), sandbox build
> reports below warnings:
>
> arch/sandbox/dts/test.dtb: Warning (alias_paths): /aliases: aliases property 
> name must include only lowercase and '-'
> arch/sandbox/dts/test.dtb: Warning (alias_paths): /aliases: aliases property 
> name must include only lowercase and '-'
> arch/sandbox/dts/test.dtb: Warning (alias_paths): /aliases: aliases property 
> name must include only lowercase and '-'
> arch/sandbox/dts/test.dtb: Warning (alias_paths): /aliases: aliases property 
> name must include only lowercase and '-'
>
> Silent them.
>
> Fixes: e8d5291824e2 ("core: ofnode: Fix translation for #size-cells == 0")
> Signed-off-by: Eugeniu Rosca 
> ---
>
> v1->v2:
> * Newly pushed
>
>  arch/sandbox/dts/test.dts | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)

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


Re: [U-Boot] [PATCH v2 04/11] pmic: dm: Rewrite pmic_reg_{read|write|clrsetbits} to support 3 bytes transmissions

2018-05-13 Thread Simon Glass
Hi Lukasz,

On 7 May 2018 at 06:26, Lukasz Majewski  wrote:
> This commit provides support for transmissions larger than 1 byte for
> PMIC devices used with DM (e.g. MC34708 from NXP).
>
> Signed-off-by: Lukasz Majewski 
>
> ---
>
> Changes in v2:
> - pmic_reg_* fixes to use uclass private structure
>
>  drivers/power/pmic/pmic-uclass.c | 44 
> +---
>  1 file changed, 32 insertions(+), 12 deletions(-)
>

Reviewed-by: Simon Glass 

with comments below

> diff --git a/drivers/power/pmic/pmic-uclass.c 
> b/drivers/power/pmic/pmic-uclass.c
> index 88669533bd..c149b84a68 100644
> --- a/drivers/power/pmic/pmic-uclass.c
> +++ b/drivers/power/pmic/pmic-uclass.c
> @@ -131,23 +131,36 @@ int pmic_write(struct udevice *dev, uint reg, const 
> uint8_t *buffer, int len)
>
>  int pmic_reg_read(struct udevice *dev, uint reg)
>  {
> -   u8 byte;
> +   struct dm_pmic_info *pmic_info = dev_get_uclass_priv(dev);
> +   int tx_num = pmic_info->trans_len;

Can you use trans_len instead of tx_num, which is confusing?

> +   u32 val = 0;
> int ret;
>
> -   debug("%s: reg=%x", __func__, reg);
> -   ret = pmic_read(dev, reg, &byte, 1);
> -   debug(", value=%x, ret=%d\n", byte, ret);
> +   if (tx_num < 1 || tx_num > sizeof(val)) {
> +   printf("Wrong transmission size [%d]\n", tx_num);

debug()

> +   return -EINVAL;
> +   }
> +
> +   debug("%s: reg=%x tx_num:%d", __func__, reg, tx_num);
> +   ret = pmic_read(dev, reg, (uint8_t *)&val, tx_num);

This is assuming little-endian, isn't it? I think you need to build up
the number in a loop 8 bits at a time, or use some sort of unaligned
function.

> +   debug(", value=%x, ret=%d\n", val, ret);
>
> -   return ret ? ret : byte;
> +   return ret ? ret : val;
>  }
>
>  int pmic_reg_write(struct udevice *dev, uint reg, uint value)
>  {
> -   u8 byte = value;
> +   struct dm_pmic_info *pmic_info = dev_get_uclass_priv(dev);
> +   int tx_num = pmic_info->trans_len;
> int ret;
>
> -   debug("%s: reg=%x, value=%x", __func__, reg, value);
> -   ret = pmic_write(dev, reg, &byte, 1);
> +   if (tx_num < 1 || tx_num > sizeof(value)) {
> +   printf("Wrong transmission size [%d]\n", tx_num);
> +   return -EINVAL;
> +   }
> +
> +   debug("%s: reg=%x, value=%x tx_num:%d", __func__, reg, value, tx_num);
> +   ret = pmic_write(dev, reg, (uint8_t *)&value, tx_num);
> debug(", ret=%d\n", ret);
>
> return ret;
> @@ -155,15 +168,22 @@ int pmic_reg_write(struct udevice *dev, uint reg, uint 
> value)
>
>  int pmic_clrsetbits(struct udevice *dev, uint reg, uint clr, uint set)
>  {
> -   u8 byte;
> +   struct dm_pmic_info *pmic_info = dev_get_uclass_priv(dev);
> +   int tx_num = pmic_info->trans_len;
> +   u32 val = 0;
> int ret;
>
> -   ret = pmic_reg_read(dev, reg);
> +   if (tx_num < 1 || tx_num > sizeof(val)) {
> +   printf("Wrong transmission size [%d]\n", tx_num);
> +   return -EINVAL;
> +   }
> +
> +   ret = pmic_read(dev, reg, (uint8_t *)&val, tx_num);
> if (ret < 0)
> return ret;
> -   byte = (ret & ~clr) | set;
>
> -   return pmic_reg_write(dev, reg, byte);
> +   val = (val & ~clr) | set;
> +   return pmic_write(dev, reg, (uint8_t *)&val, tx_num);
>  }
>
>  static int pmic_pre_probe(struct udevice *dev)
> --
> 2.11.0
>

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


Re: [U-Boot] [PATCH v2 02/11] pmic: fsl: Define number of bytes sent at once by MC34708 PMIC

2018-05-13 Thread Simon Glass
On 7 May 2018 at 06:25, Lukasz Majewski  wrote:
> This patch adds definition of the number of bytes sent at once by the
> MC34708 PMIC.
>
> Signed-off-by: Lukasz Majewski 
>
> ---
>
> Changes in v2:
> - None
>
>  include/fsl_pmic.h | 1 +
>  1 file changed, 1 insertion(+)

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


Re: [U-Boot] [PATCH v2 4/6] scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987

2018-05-13 Thread Simon Glass
Hi,

On 13 May 2018 at 03:13, Eugeniu Rosca  wrote:
> From: Rob Herring 
>
> This adds the following commits from upstream:
>
> aadd0b65c987 checks: centralize printing of property names in failure messages
> 88960e398907 checks: centralize printing of node path in check_msg
> f1879e1a50eb Add limited read-only support for older (V2 and V3) device tree 
> to libfdt.
> 37dea76e9700 srcpos: drop special handling of tab
> 65893da4aee0 libfdt: overlay: Add missing license
> 962a45ca034d Avoid installing pylibfdt when dependencies are missing
> cd6ea1b2bea6 Makefile: Split INSTALL out into 
> INSTALL_{PROGRAM,LIB,DATA,SCRIPT}
> 51b3a16338df Makefile.tests: Add LIBDL make(1) variable for portability sake
> 333d533a8f4d Attempt to auto-detect stat(1) being used if not given proper 
> invocation
> e54388015af1 dtc: Bump version to v1.4.6
> a1fe86f380cb fdtoverlay: Switch from using alloca to malloc
> c8d5472de3ff tests: Improve compatibility with other platforms
> c81d389a10cc checks: add chosen node checks
> e671852042a7 checks: add aliases node checks
> d0c44ebe3f42 checks: check for #{size,address}-cells without child nodes
> 18a3d84bb802 checks: add string list check for *-names properties
> 8fe94fd6f19f checks: add string list check
> 6c5730819604 checks: add a string check for 'label' property
> a384191eba09 checks: fix sound-dai phandle with arg property check
> b260c4f610c0 Fix ambiguous grammar for devicetree rule
> fe667e382bac tests: Add some basic tests for the pci_bridge checks
> 7975f6422260 Fix widespread incorrect use of strneq(), replace with new 
> strprefixeq()
> fca296445eab Add strstarts() helper function
> cc392f089007 tests: Check non-matching cases for fdt_node_check_compatible()
> bba26a5291c8 livetree: avoid assertion of orphan phandles with overlays
> c8f8194d76cc implement strnlen for systems that need it
> c8b38f65fdec libfdt: Remove leading underscores from identifiers
> 3b62fdaebfe5 Remove leading underscores from identifiers
> 2d45d1c5c65e Replace FDT_VERSION() with stringify()
> 2e6fe5a107b5 Fix some errors in comments
> b0ae9e4b0ceb tests: Correct warning in sw_tree1.c
>
> Commit c8b38f65fdec upstream ("libfdt: Remove leading underscores from
> identifiers") changed the multiple inclusion define protection, so the
> kernel's libfdt_env.h needs the corresponding update.
>
> Signed-off-by: Rob Herring 
> [ Linux commit: 9130ba884640328bb78aaa4840e5ddf06ccafb1c ]
> [erosca: - Fixup conflicts in include/linux/libfdt_env.h caused by 
> v2018.03-rc4
>commit b08c8c487083 ("libfdt: move headers to 
>and ")
>  - Fix build errors in lib/libfdt/fdt_ro.c, tools/libfdt/fdt_rw.c by:
>- s/_fdt_mem_rsv/fdt_mem_rsv_/
>- s/_fdt_offset_ptr/fdt_offset_ptr_/
>- s/_fdt_check_node_offset/fdt_check_node_offset_/
>- s/_fdt_check_prop_offset/fdt_check_prop_offset_/
>- s/_fdt_find_add_string/fdt_find_add_string_/]
> Signed-off-by: Eugeniu Rosca 
> ---
>
> v1-v2:
> * Newly pushed
>
>  include/linux/libfdt_env.h   |   6 +-
>  lib/libfdt/fdt_ro.c  |  18 +-
>  scripts/dtc/checks.c | 439 ++-
>  scripts/dtc/dtc-parser.y |  17 +-
>  scripts/dtc/dtc.c|   7 +-
>  scripts/dtc/dtc.h|  11 +-
>  scripts/dtc/flattree.c   |   2 +-
>  scripts/dtc/libfdt/fdt.c |  13 +-
>  scripts/dtc/libfdt/fdt.h |   6 +-
>  scripts/dtc/libfdt/fdt_overlay.c |  51 
>  scripts/dtc/libfdt/fdt_ro.c  | 132 ++--
>  scripts/dtc/libfdt/fdt_rw.c  |  90 +++---
>  scripts/dtc/libfdt/fdt_sw.c  |  24 +-
>  scripts/dtc/libfdt/fdt_wip.c |  10 +-
>  scripts/dtc/libfdt/libfdt.h  |  37 +--
>  scripts/dtc/libfdt/libfdt_env.h  |  33 +-
>  scripts/dtc/libfdt/libfdt_internal.h |  32 +-
>  scripts/dtc/livetree.c   |  10 +-
>  scripts/dtc/srcpos.c |   5 -
>  scripts/dtc/srcpos.h |   6 +-
>  scripts/dtc/util.h   |   9 +-
>  scripts/dtc/version_gen.h|   2 +-
>  tools/libfdt/fdt_rw.c|   2 +-
>  23 files changed, 632 insertions(+), 330 deletions(-)

Can you please check that this does not adversely impact code size?

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


Re: [U-Boot] [PATCH v2 3/6] scripts/dtc: Update to upstream version v1.4.5-6-gc1e55a5513e9

2018-05-13 Thread Simon Glass
On 13 May 2018 at 03:13, Eugeniu Rosca  wrote:
> From: Rob Herring 
>
> Pickup the fix for handling unresolved phandles in overlays.
>
> This adds the following commits from upstream:
>
> c1e55a5513e9 checks: fix handling of unresolved phandles for dts plugins
> f8872e29ce06 tests: Avoid 64-bit arithmetic in assembler
> 48c91c08bcfa libfdt: add stringlist functions to linker script
>
> Signed-off-by: Rob Herring 
> [ Linux commit: e45fe7f788dd1395befe5639149ad8dacfbd94ab ]
> Signed-off-by: Eugeniu Rosca 
> ---
>
> v1->v2:
> * Newly pushed
>
>  scripts/dtc/checks.c  | 9 +
>  scripts/dtc/version_gen.h | 2 +-
>  2 files changed, 10 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 3/7] serial: serial_msm: initialize uart only before relocation

2018-05-13 Thread Simon Glass
On 12 May 2018 at 20:15, Ramon Fried  wrote:
> The uart is already initialized prior to relocation,
> reinitialization after relocation is unnecessary.
>
> Signed-off-by: Ramon Fried 
> ---
>  drivers/serial/serial_msm.c | 4 
>  1 file changed, 4 insertions(+)

Reviewed-by: Simon Glass 

But please just use one set of brackets.

>
> diff --git a/drivers/serial/serial_msm.c b/drivers/serial/serial_msm.c
> index 250e48c996..22301c0e37 100644
> --- a/drivers/serial/serial_msm.c
> +++ b/drivers/serial/serial_msm.c
> @@ -183,6 +183,10 @@ static int msm_serial_probe(struct udevice *dev)
>  {
> struct msm_serial_data *priv = dev_get_priv(dev);
>
> +   /* No need to reinitialize the UART after relocation */
> +   if ((gd->flags & GD_FLG_RELOC))
> +   return 0;
> +
> if (msm_uart_clk_init(dev))
> return -EINVAL;
>
> --
> 2.14.1
>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 5/7] mach-snapdragon: Introduce pinctrl driver

2018-05-13 Thread Simon Glass
Hi Ramon,

On 12 May 2018 at 20:15, Ramon Fried  wrote:
> This patch adds pinmux and pinctrl driver for TLMM
> subsystem in snapdragon chipsets.
> Currently, supporting only 8016, but implementation is
> generic and 8096 can be added easily.
>
> Driver is using the generic dt-bindings and doesn't
> introduce any new bindings (yet).
>
> Signed-off-by: Ramon Fried 
> ---
>  arch/arm/mach-snapdragon/Makefile|   2 +
>  arch/arm/mach-snapdragon/pinctrl-apq8016.c   | 162 
> +++
>  arch/arm/mach-snapdragon/pinctrl-snapdragon.c| 118 +
>  arch/arm/mach-snapdragon/pinctrl-snapdragon.h|  21 +++
>  configs/dragonboard410c_defconfig|   5 +
>  include/dt-bindings/pinctrl/pinctrl-snapdragon.h |  22 +++
>  6 files changed, 330 insertions(+)
>  create mode 100644 arch/arm/mach-snapdragon/pinctrl-apq8016.c
>  create mode 100644 arch/arm/mach-snapdragon/pinctrl-snapdragon.c
>  create mode 100644 arch/arm/mach-snapdragon/pinctrl-snapdragon.h
>  create mode 100644 include/dt-bindings/pinctrl/pinctrl-snapdragon.h
>
> diff --git a/arch/arm/mach-snapdragon/Makefile 
> b/arch/arm/mach-snapdragon/Makefile
> index 1c23dc52cf..1d35fea912 100644
> --- a/arch/arm/mach-snapdragon/Makefile
> +++ b/arch/arm/mach-snapdragon/Makefile
> @@ -6,4 +6,6 @@ obj-$(CONFIG_TARGET_DRAGONBOARD820C) += clock-apq8096.o
>  obj-$(CONFIG_TARGET_DRAGONBOARD820C) += sysmap-apq8096.o
>  obj-$(CONFIG_TARGET_DRAGONBOARD410C) += clock-apq8016.o
>  obj-$(CONFIG_TARGET_DRAGONBOARD410C) += sysmap-apq8016.o
> +obj-$(CONFIG_TARGET_DRAGONBOARD410C) += pinctrl-apq8016.o
> +obj-$(CONFIG_TARGET_DRAGONBOARD410C) += pinctrl-snapdragon.o
>  obj-y += clock-snapdragon.o
> diff --git a/arch/arm/mach-snapdragon/pinctrl-apq8016.c 
> b/arch/arm/mach-snapdragon/pinctrl-apq8016.c
> new file mode 100644
> index 00..8e57e2338c
> --- /dev/null
> +++ b/arch/arm/mach-snapdragon/pinctrl-apq8016.c
> @@ -0,0 +1,162 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Qualcomm APQ8016 pinctrl
> + *
> + * (C) Copyright 2018 Ramon Fried 
> + *
> + */
> +
> +#include "pinctrl-snapdragon.h"
> +#include 
> +
> +const char * const msm_pinctrl_pins[] = {
> +   "GPIO_0",
> +   "GPIO_1",
> +   "GPIO_2",
> +   "GPIO_3",
> +   "GPIO_4",
> +   "GPIO_5",
> +   "GPIO_6",
> +   "GPIO_7",

This seems inefficient. Could you not sprintf() the name for most of
these values?

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


Re: [U-Boot] [PATCH v2 03/11] pmic: Add support for setting transmission length in uclass private data

2018-05-13 Thread Simon Glass
On 7 May 2018 at 06:26, Lukasz Majewski  wrote:
> The struct dm_pmic_info's trans_len field stores the number of types to
> be transmitted per PMIC transfer.
>
> Signed-off-by: Lukasz Majewski 
>
> ---
>
> Changes in v2:
> - New patch
>
>  drivers/power/pmic/pmic-uclass.c | 10 ++
>  include/power/pmic.h |  4 
>  2 files changed, 14 insertions(+)
>

Reviewed-by: Simon Glass 

Please see below.

> diff --git a/drivers/power/pmic/pmic-uclass.c 
> b/drivers/power/pmic/pmic-uclass.c
> index 5e8f6d6190..88669533bd 100644
> --- a/drivers/power/pmic/pmic-uclass.c
> +++ b/drivers/power/pmic/pmic-uclass.c
> @@ -166,7 +166,17 @@ int pmic_clrsetbits(struct udevice *dev, uint reg, uint 
> clr, uint set)
> return pmic_reg_write(dev, reg, byte);
>  }
>
> +static int pmic_pre_probe(struct udevice *dev)
> +{
> +   struct dm_pmic_info *pmic_info = dev_get_uclass_priv(dev);
> +
> +   pmic_info->trans_len = 1;
> +   return 0;
> +}
> +
>  UCLASS_DRIVER(pmic) = {
> .id = UCLASS_PMIC,
> .name   = "pmic",
> +   .pre_probe  = pmic_pre_probe,
> +   .per_device_auto_alloc_size = sizeof(struct dm_pmic_info),
>  };
> diff --git a/include/power/pmic.h b/include/power/pmic.h
> index f2fe537fb7..0791c6aa2c 100644
> --- a/include/power/pmic.h
> +++ b/include/power/pmic.h
> @@ -298,6 +298,10 @@ int pmic_reg_write(struct udevice *dev, uint reg, uint 
> value);
>   */
>  int pmic_clrsetbits(struct udevice *dev, uint reg, uint clr, uint set);
>
> +struct dm_pmic_info {
> +   uint trans_len;

Please add a comment for this. Also, how about uc_pmic_priv since this
is device-specific private information owned by the uclass.

> +};
> +
>  #endif /* CONFIG_DM_PMIC */
>
>  #ifdef CONFIG_POWER
> --
> 2.11.0
>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/7] db820c: set clk node to be probed before relocation

2018-05-13 Thread Simon Glass
Hi Ramon,

On 12 May 2018 at 20:15, Ramon Fried  wrote:
> The clock and serial nodes are needed before relocation.
> This patch ensures that the msm-serial driver will probe
> and provide uart output before relocation.
>
> Signed-off-by: Ramon Fried 
> ---
>  arch/arm/dts/dragonboard820c-uboot.dtsi | 14 ++
>  1 file changed, 14 insertions(+)
>
> diff --git a/arch/arm/dts/dragonboard820c-uboot.dtsi 
> b/arch/arm/dts/dragonboard820c-uboot.dtsi
> index 88312b3fa1..81df788fca 100644
> --- a/arch/arm/dts/dragonboard820c-uboot.dtsi
> +++ b/arch/arm/dts/dragonboard820c-uboot.dtsi
> @@ -5,6 +5,20 @@
>   * (C) Copyright 2017 Jorge Ramirez-Ortiz 
>   */
>
> +/ {
> +   soc {
> +   u-boot,dm-pre-reloc;
> +
> +   clock-controller@30 {

This line and a few below it should be indented one more stop.

> +   u-boot,dm-pre-reloc;
> +   };
> +
> +   serial@75b {
> +   u-boot,dm-pre-reloc;
> +   };
> +   };
> +};
> +
>  &pm8994_pon {
> key_vol_down {
> gpios = <&pm8994_pon 1 0>;
> --
> 2.14.1
>

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


Re: [U-Boot] [PATCH 6/7] db410: added pinctrl node and serial bindings

2018-05-13 Thread Simon Glass
On 12 May 2018 at 20:15, Ramon Fried  wrote:
> Added TLMM pinctrl node for pin muxing & config.
> Additionally, added a serial node for uart.
>
> Signed-off-by: Ramon Fried 
> ---
>  arch/arm/dts/dragonboard410c.dts | 14 ++
>  1 file changed, 14 insertions(+)
>

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


Re: [U-Boot] [PATCH 2/7] serial: serial_msm: fail probe if settings clocks fails

2018-05-13 Thread Simon Glass
Hi Ramon,

On 12 May 2018 at 20:15, Ramon Fried  wrote:
> Failure to set the clocks will causes data abort exception when
> trying to write to AHB uart registers.
> This patch ensures that we don't touch these registers if clock
> setting failed.
>
> Signed-off-by: Ramon Fried 
> ---
>  drivers/serial/serial_msm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/serial/serial_msm.c b/drivers/serial/serial_msm.c
> index 119e6b9846..250e48c996 100644
> --- a/drivers/serial/serial_msm.c
> +++ b/drivers/serial/serial_msm.c
> @@ -183,8 +183,8 @@ static int msm_serial_probe(struct udevice *dev)
>  {
> struct msm_serial_data *priv = dev_get_priv(dev);
>
> -   msm_uart_clk_init(dev); /* Ignore return value and hope clock was
> - properly initialized by earlier loaders */
> +   if (msm_uart_clk_init(dev))
> +   return -EINVAL;

Would it not be better to return the error that msm_uart_clk_init()
returns, rather than -EINVAL?
>
> if (readl(priv->base + UARTDM_SR) & UARTDM_SR_UART_OVERRUN)
> writel(UARTDM_CR_CMD_RESET_ERR, priv->base + UARTDM_CR);
> --
> 2.14.1
>

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


Re: [U-Boot] net: [PATCH v10 3/3] Adding wget

2018-05-13 Thread Simon Glass
Hi,

On 14 May 2018 at 07:05, Duncan Hare  wrote:
>
>
>
> 
>>>
>>>Please setup a test that can run in an environment without the
>>>Internet. That is critical for unit tests.
>>>
>>>Hand tests for Internet usage and the environmental effects are great,
>>>but that can't be what we include in the auto tests for repeat-ability
>>>reasons. Simon is asking for a separate type of test.
>
> Is the test environment another patch in the series or an addition to the
> wget patch?

I suggest a separate patch.

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


Re: [U-Boot] net: [PATCH v10 3/3] Adding wget

2018-05-13 Thread Duncan Hare
 

>>
>>Please setup a test that can run in an environment without the
>>Internet. That is critical for unit tests.
>>
>>Hand tests for Internet usage and the environmental effects are great,
>>but that can't be what we include in the auto tests for repeat-ability
>>reasons. Simon is asking for a separate type of test.

Is the test environment another patch in the series or an addition to the wget 
patch?
Thanks Duncan


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


Re: [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4

2018-05-13 Thread Eugeniu Rosca
On Sun, May 13, 2018 at 10:52:07PM +0900, Masahiro Yamada wrote:
> 2018-05-13 4:17 GMT+09:00 Eugeniu Rosca :
> > I wonder if Kconfig could avoid printing whitespace in command line
> > user dialogs. Then maybe those space characters could be removed from
> > the "*xpected_stdout" files.
> 
> 
> 'make config' display a space at the end of line
> when prompting user input.
> 
> This makes the input readable, like follows:
> 
> *
> * Linux/x86 4.17.0-rc4 Kernel Configuration
> *
> 64-bit kernel (64BIT) [Y/n/?] y
> *
> * General setup
> *
> Cross-compiler tool prefix (CROSS_COMPILE) []
> Compile also drivers which will not load (COMPILE_TEST) [N/y/?] y
> 
> 
> 
> I think you are suggesting to remove a space, like follows:
> 
> *
> * Linux/x86 4.17.0-rc4 Kernel Configuration
> *
> 64-bit kernel (64BIT) [Y/n/?]y
> *
> * General setup
> *
> Cross-compiler tool prefix (CROSS_COMPILE) []
> Compile also drivers which will not load (COMPILE_TEST) [N/y/?]y
> 
> 
> I believe we should not do this
> just for unit-testing.

Chopped output will hurt user experience, so I agree it's not a solution
to eliminate trailing whitespace in predefined stdout files for pytest.

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


[U-Boot] [GIT] Pull request: u-boot-dfu (13.05.2018)

2018-05-13 Thread Lukasz Majewski
Dear Marek,


Travis CI:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/378387230

The following changes since commit
62d77cea31216cad526e5f45c88e8377efc6fcae:

  mmc: Improve tinification (2018-05-13 07:57:32 -0400)

are available in the git repository at:

  git://git.denx.de/u-boot-dfu.git 

for you to fetch changes up to 8780dca82fa6c5dbf264acf78140d39d8ed4acc2:

  gadget: f_thor: update to support more than 4GB file as thor 5.0
  (2018-05-13 17:07:06 +0200)


Seung-Woo Kim (2):
  gadget: f_thor: fix filename overflow
  gadget: f_thor: update to support more than 4GB file as thor 5.0

 drivers/usb/gadget/f_thor.c | 13 +
 drivers/usb/gadget/f_thor.h |  2 +-
 2 files changed, 10 insertions(+), 5 deletions(-)



Best regards,

Lukasz Majewski

--

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


pgplzJaFH3kp2.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] net: include/phy.h: add new mode for internal phy

2018-05-13 Thread Marek Vasut
On 05/11/2018 11:51 AM, Kunihiko Hayashi wrote:
> Add the new mode to indicate a built-in PHY.
> This will be used by UniPhier AVE ethernet driver.

Hi, Hayashi-san,

CC Joe on network stuff.

Reviewed-by: Marek Vasut 

> Signed-off-by: Kunihiko Hayashi 
> ---
>  include/phy.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/phy.h b/include/phy.h
> index 0543ec1..d0f60d1 100644
> --- a/include/phy.h
> +++ b/include/phy.h
> @@ -66,6 +66,7 @@ typedef enum {
>   PHY_INTERFACE_MODE_XAUI,
>   PHY_INTERFACE_MODE_RXAUI,
>   PHY_INTERFACE_MODE_SFI,
> + PHY_INTERFACE_MODE_INTERNAL,
>   PHY_INTERFACE_MODE_NONE,/* Must be last */
>  
>   PHY_INTERFACE_MODE_COUNT,
> @@ -88,6 +89,7 @@ static const char *phy_interface_strings[] = {
>   [PHY_INTERFACE_MODE_XAUI]   = "xaui",
>   [PHY_INTERFACE_MODE_RXAUI]  = "rxaui",
>   [PHY_INTERFACE_MODE_SFI]= "sfi",
> + [PHY_INTERFACE_MODE_INTERNAL]   = "internal",
>   [PHY_INTERFACE_MODE_NONE]   = "",
>  };
>  
> 


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


Re: [U-Boot] [PATCH 3/3] fpga: zynqmp: Fix the nonsecure bitstream loading issue

2018-05-13 Thread Marek Vasut
On 03/28/2018 04:30 PM, Michal Simek wrote:
> From: Siva Durga Prasad Paladugu 
> 
> Xilfpga library expects the size of bitstream in a pointer
> but currenly we are passing the size as a value. This patch
> fixes this issue.

This breaks fpga loadb on zynqmp with FSBL 0.3 for me, so please revert.
The commit message is not clear on what the "issue" is or whether the
FSBL version has any relevance or whether the ABI changed somewhere in
the xilinx blobs, but it is clear reverting this patch fixes an issue
for me.

> Signed-off-by: Siva Durga Prasad Paladugu 
> Signed-off-by: Nava kishore Manne 
> Signed-off-by: Michal Simek 
> ---
> 
>  drivers/fpga/zynqmppl.c | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/fpga/zynqmppl.c b/drivers/fpga/zynqmppl.c
> index aae0efc7348e..43e8b2520e35 100644
> --- a/drivers/fpga/zynqmppl.c
> +++ b/drivers/fpga/zynqmppl.c
> @@ -11,6 +11,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #define DUMMY_WORD   0x
>  
> @@ -195,6 +196,7 @@ static int zynqmp_validate_bitstream(xilinx_desc *desc, 
> const void *buf,
>  static int zynqmp_load(xilinx_desc *desc, const void *buf, size_t bsize,
>bitstream_type bstype)
>  {
> + ALLOC_CACHE_ALIGN_BUFFER(u32, bsizeptr, 1);
>   u32 swap;
>   ulong bin_buf;
>   int ret;
> @@ -205,15 +207,17 @@ static int zynqmp_load(xilinx_desc *desc, const void 
> *buf, size_t bsize,
>   return FPGA_FAIL;
>  
>   bin_buf = zynqmp_align_dma_buffer((u32 *)buf, bsize, swap);
> + bsizeptr = (u32 *)&bsize;
>  
>   debug("%s called!\n", __func__);
>   flush_dcache_range(bin_buf, bin_buf + bsize);
> + flush_dcache_range((ulong)bsizeptr, (ulong)bsizeptr + sizeof(size_t));

This will trigger unaligned cache flush warning, FYI. And the buffer is
u32, while here you use size_t.

>   buf_lo = (u32)bin_buf;
>   buf_hi = upper_32_bits(bin_buf);
>   bstype |= BIT(ZYNQMP_FPGA_BIT_NS);
> - ret = invoke_smc(ZYNQMP_SIP_SVC_PM_FPGA_LOAD, buf_lo, buf_hi, bsize,
> -  bstype, ret_payload);
> + ret = invoke_smc(ZYNQMP_SIP_SVC_PM_FPGA_LOAD, buf_lo, buf_hi,
> +  (u32)(uintptr_t)bsizeptr, bstype, ret_payload);
>   if (ret)
>   debug("PL FPGA LOAD fail\n");
>  
> 


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


Re: [U-Boot] [PATCH v2] board: sun50i: Add Amarula A64 Relic initial support

2018-05-13 Thread Marek Vasut
On 05/11/2018 07:47 AM, Jagan Teki wrote:
> Amarula A64 Relic is A64 based IoT device, which support
> - Allwinner A64 Cortex-A53
> - Mali-400MP2 GPU
> - AXP803 PMIC
> - 1GB DDR3 RAM
> - 8GB eMMC
> - AP6330 Wifi/BLE
> - MIPI-DSI
> - CSI: OV5640 sensor
> - USB OTG
> - 12V DC power supply
> 
> Signed-off-by: Jagan Teki 
> ---
> Changes for v2:
> - Rename dts name to sun50i-a64-relic.dts which is simple to use
> - Rename defconfig to a64_relic_defconfig
> - Use licence year as 2018
> 
> Note:
> Maxime, I saw your previous comments about CONFIG_CMD_USB_MASS_STORAGE
> defining in defconfig, may I know why we can't enable it in defconfig file?

We can IMO

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


Re: [U-Boot] [PATCH] ext4fs: Add ext4 extent tree cache

2018-05-13 Thread Marek Vasut
On 05/11/2018 07:53 PM, Evan Thompson wrote:
> On Fri, May 11, 2018 at 10:18 AM, Tom Rini  wrote:
>> On Fri, May 11, 2018 at 10:14:38AM -0700, Evan Thompson wrote:
>>> On Thu, May 10, 2018 at 3:02 PM, Tom Rini  wrote:
 On Mon, Mar 26, 2018 at 04:05:24PM -0700, evan.g.thomp...@gmail.com wrote:

> +
> +#ifndef CONFIG_EXT4_EXTENT_CACHE_SIZE
> +#define CONFIG_EXT4_EXTENT_CACHE_SIZE 5
> +#endif

 This needs to be done in Kconfig.
>>>
>>> Ok, I'll fix that.
>>>
 Also, is there any sort of testing we could add to
 test/fs/fs-test.sh for this code?  Thanks!
>>>
>>> I can't think of a straightforward way, as this patch just provides a
>>> speedup for certain cases. The functionality of reading / writing
>>> files is unchanged.
>>
>> OK.  And the test suite passes as well as before, yes?
> 
> Yes, I'm seeing the same passes and fails as before.

btw doesn't CONFIG_BLOCK_CACHE offer similar service, but for everyone
and on block level ? I recall looking for ext4 fs speed up , but then
ultimately used CONFIG_BLOCK_CACHE which did it for me.

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


Re: [U-Boot] [PATCH] bootcount: Add bootcount command

2018-05-13 Thread Lukasz Majewski
On Sat, 12 May 2018 05:49:47 +
Alex Kiernan  wrote:

> Add a command to manipulate the bootcounter. This is useful if you can
> run device recovery from inside U-Boot and need to reset the
> bootcounter after executing that process as part of altbootcmd.
> 
> Signed-off-by: Alex Kiernan 
> ---
> 
>  cmd/Kconfig |  7 +++
>  cmd/Makefile|  1 +
>  cmd/bootcount.c | 61
> + 3 files
> changed, 69 insertions(+) create mode 100644 cmd/bootcount.c
> 
> diff --git a/cmd/Kconfig b/cmd/Kconfig
> index eb14e08..825d4ad 100644
> --- a/cmd/Kconfig
> +++ b/cmd/Kconfig
> @@ -1218,6 +1218,13 @@ config CMD_BMP
> the image into RAM, then using this command to look at it
> or display it.
>  
> +config CMD_BOOTCOUNT
> + bool "bootcount"
> + depends on BOOTCOUNT_LIMIT
> + help
> +   Enable the bootcount command, which allows interrogation
> and
> +   reset of the bootcounter.
> +
>  config CMD_BSP
>   bool "Enable board-specific commands"
>   help
> diff --git a/cmd/Makefile b/cmd/Makefile
> index 0d7322e..c05dc2b 100644
> --- a/cmd/Makefile
> +++ b/cmd/Makefile
> @@ -22,6 +22,7 @@ obj-$(CONFIG_CMD_BEDBUG) += bedbug.o
>  obj-$(CONFIG_CMD_BINOP) += binop.o
>  obj-$(CONFIG_CMD_BLOCK_CACHE) += blkcache.o
>  obj-$(CONFIG_CMD_BMP) += bmp.o
> +obj-$(CONFIG_CMD_BOOTCOUNT) += bootcount.o
>  obj-$(CONFIG_CMD_BOOTEFI) += bootefi.o
>  obj-$(CONFIG_CMD_BOOTMENU) += bootmenu.o
>  obj-$(CONFIG_CMD_BOOTSTAGE) += bootstage.o
> diff --git a/cmd/bootcount.c b/cmd/bootcount.c
> new file mode 100644
> index 000..c358418
> --- /dev/null
> +++ b/cmd/bootcount.c
> @@ -0,0 +1,61 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +
> +#include 
> +#include 
> +#include 
> +
> +static int do_bootcount_print(cmd_tbl_t *cmdtp, int flag, int argc,
> +   char * const argv[])
> +{
> + printf("%lu\n", bootcount_load());
> + return CMD_RET_SUCCESS;
> +}
> +
> +static int do_bootcount_reset(cmd_tbl_t *cmdtp, int flag, int argc,
> +   char * const argv[])
> +{
> + /*
> +  * note that we're explicitly not resetting the environment
> +  * variable, so you still have the old bootcounter available
> +  */
> + bootcount_store(0);
> + return CMD_RET_SUCCESS;
> +}
> +
> +static cmd_tbl_t bootcount_sub[] = {
> + U_BOOT_CMD_MKENT(print, 1, 1, do_bootcount_print, "", ""),
> + U_BOOT_CMD_MKENT(reset, 1, 1, do_bootcount_reset, "", ""),
> +};
> +
> +static int do_bootcount(cmd_tbl_t *cmdtp, int flag, int argc,
> + char * const argv[])
> +{
> + cmd_tbl_t *cp;
> +
> + if (argc < 2)
> + return CMD_RET_USAGE;
> +
> + /* drop initial "bootcount" arg */
> + argc--;
> + argv++;
> +
> + cp = find_cmd_tbl(argv[0], bootcount_sub,
> ARRAY_SIZE(bootcount_sub));
> + if (cp)
> + return cp->cmd(cmdtp, flag, argc, argv);
> +
> + return CMD_RET_USAGE;
> +}
> +
> +#if CONFIG_IS_ENABLED(SYS_LONGHELP)
> +static char bootcount_help_text[] =
> + "print - print current bootcounter\n"
> + "reset - reset the bootcounter"
> + ;
> +#endif
> +
> +U_BOOT_CMD(bootcount, 2, 1, do_bootcount,
> +"bootcount",
> +#if CONFIG_IS_ENABLED(SYS_LONGHELP)
> +bootcount_help_text
> +#endif
> +);

Reviewed-by: Lukasz Majewski 


Best regards,

Lukasz Majewski

--

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


pgp3SOA0dKfTj.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/1] arm: print instructions pointed to by pc

2018-05-13 Thread Marek Vasut
On 05/13/2018 02:22 PM, Tuomas Tynkkynen wrote:
> Hi,
> 
> On Thu, 10 May 2018 16:38:30 +0200
> Heinrich Schuchardt  wrote:
> 
>> If an exception occurs in a loaded image and the relocation offset is
>> unknown, it is helful to know the instructions pointed to by the
>> program counter. This patch adds the missing output.
>>
>> A possible output is:
>> *pc: fb de f7 e7 1e ff 2f e1 01 00 50 e3 f0 4d 2d e9 01 80 a0 e1
>>
>> The output can be disassembled with
>> xxd -pc -r - > a.out
>> $(CROSS_COMPILE)objdump -D -marm -b binary a.out
>>
>> Signed-off-by: Heinrich Schuchardt 
>> ---
>> v2
>>  print bytes not halfwords
> 
> Note that Linux already comes with a scripts/decodecode tool where you paste 
> the
> output of an Oops and it disassembles the "Code: " line from the dump. So I'd
> vote for importing scripts/decodecode from Linux and making U-Boot's output
> compatible with Linux.

Sounds good.

btw if you get exception because the memory at PC is inaccessible, this
will trigger a double-fault I think.

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


Re: [U-Boot] [PATCH] mx6: remove duplicated BOUNCE_BUFFER defines

2018-05-13 Thread Lukasz Majewski
Hi Peter,

> The mx6_common.h file already defines BOUNCE_BUFFER so no need to
> definit it again in specific configs.
> 
> Signed-off-by: Peter Robinson 
> ---
>  include/configs/advantech_dms-ba16.h | 1 -
>  include/configs/apalis_imx6.h| 1 -
>  include/configs/colibri_imx6.h   | 1 -
>  include/configs/dh_imx6.h| 1 -
>  include/configs/ge_bx50v3.h  | 1 -
>  include/configs/kp_imx6q_tpc.h   | 2 --
>  6 files changed, 7 deletions(-)
> 
> diff --git a/include/configs/advantech_dms-ba16.h
> b/include/configs/advantech_dms-ba16.h index a6e99192ba..8e33d38f97
> 100644 --- a/include/configs/advantech_dms-ba16.h
> +++ b/include/configs/advantech_dms-ba16.h
> @@ -45,7 +45,6 @@
>  /* MMC Configs */
>  #define CONFIG_FSL_USDHC
>  #define CONFIG_SYS_FSL_ESDHC_ADDR  0
> -#define CONFIG_BOUNCE_BUFFER
>  
>  /* USB Configs */
>  #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
> diff --git a/include/configs/apalis_imx6.h
> b/include/configs/apalis_imx6.h index 00255c80d6..7225c03ac5 100644
> --- a/include/configs/apalis_imx6.h
> +++ b/include/configs/apalis_imx6.h
> @@ -56,7 +56,6 @@
>  #define CONFIG_SYS_FSL_USDHC_NUM 3
>  
>  #define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */
> -#define CONFIG_BOUNCE_BUFFER
>  
>  /*
>   * SATA Configs
> diff --git a/include/configs/colibri_imx6.h
> b/include/configs/colibri_imx6.h index 49ec0bf108..7e3463e184 100644
> --- a/include/configs/colibri_imx6.h
> +++ b/include/configs/colibri_imx6.h
> @@ -54,7 +54,6 @@
>  #define CONFIG_SYS_FSL_USDHC_NUM 2
>  
>  #define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */
> -#define CONFIG_BOUNCE_BUFFER
>  
>  /* Network */
>  #define CONFIG_FEC_MXC
> diff --git a/include/configs/dh_imx6.h b/include/configs/dh_imx6.h
> index 24b35161b6..3e0ac15229 100644
> --- a/include/configs/dh_imx6.h
> +++ b/include/configs/dh_imx6.h
> @@ -33,7 +33,6 @@
>  #define CONFIG_INITRD_TAG
>  #define CONFIG_REVISION_TAG
>  
> -#define CONFIG_BOUNCE_BUFFER
>  #define CONFIG_BZIP2
>  
>  /* Size of malloc() pool */
> diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h
> index 32631a20c3..424c0dd1d0 100644
> --- a/include/configs/ge_bx50v3.h
> +++ b/include/configs/ge_bx50v3.h
> @@ -62,7 +62,6 @@
>  /* MMC Configs */
>  #define CONFIG_FSL_USDHC
>  #define CONFIG_SYS_FSL_ESDHC_ADDR  0
> -#define CONFIG_BOUNCE_BUFFER
>  
>  /* USB Configs */
>  #ifdef CONFIG_USB
> diff --git a/include/configs/kp_imx6q_tpc.h
> b/include/configs/kp_imx6q_tpc.h index d243fc675f..bf3cc174cd 100644
> --- a/include/configs/kp_imx6q_tpc.h
> +++ b/include/configs/kp_imx6q_tpc.h
> @@ -21,8 +21,6 @@
>  #define CONFIG_INITRD_TAG
>  #define CONFIG_REVISION_TAG
>  
> -#define CONFIG_BOUNCE_BUFFER
> -
>  /* Size of malloc() pool */
>  #define CONFIG_SYS_MALLOC_LEN(4 * SZ_1M)
>  

Acked-by: Lukasz Majewski 


Best regards,

Lukasz Majewski

--

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


pgpFGYWbg5s0o.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/6] kconfig: re-sync with Linux 4.17-rc4

2018-05-13 Thread Masahiro Yamada
2018-05-13 4:17 GMT+09:00 Eugeniu Rosca :
>
> Hello Petr,
>
> On Sat, May 12, 2018 at 08:25:56PM +0200, Petr Vorel wrote:
>> Hi Eugeniu,
>>
>> > My testing was limited to:
>> > - make defconfig all
>> > - make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- r8a7795_ulcb_defconfig all
>> > - comparing .config before and after the re-sync
>> > - running the newly imported Kconfig unit tests as seen below:
>>
>> I tested whole patch-set with the other options:
>> make config
>> make defconfig
>> make menuconfig
>> make xconfig
>> make gconfig
>> make oldconfig
>>
>> > Reviewed-by: Masahiro Yamada 
>> > Signed-off-by: Eugeniu Rosca 
>> Tested-by: Petr Vorel 
>
> Many thanks for testing!
>
>>
>> > $ make testconfig
>>
>> > = test session starts 
>> > =
>> > scripts/kconfig/tests/auto_submenu/__init__.py::test PASSED [  
>> > 7%]
>> > scripts/kconfig/tests/choice/__init__.py::test_oldask0 PASSED   [ 
>> > 14%]
>> > scripts/kconfig/tests/choice/__init__.py::test_oldask1 PASSED   [ 
>> > 21%]
>> > scripts/kconfig/tests/choice/__init__.py::test_allyes PASSED[ 
>> > 28%]
>> > scripts/kconfig/tests/choice/__init__.py::test_allmod PASSED[ 
>> > 35%]
>> > scripts/kconfig/tests/choice/__init__.py::test_allno PASSED [ 
>> > 42%]
>> > scripts/kconfig/tests/choice/__init__.py::test_alldef PASSED[ 
>> > 50%]
>> > scripts/kconfig/tests/choice_value_with_m_dep/__init__.py::test PASSED  [ 
>> > 57%]
>> > scripts/kconfig/tests/err_recursive_inc/__init__.py::test PASSED[ 
>> > 64%]
>> > scripts/kconfig/tests/inter_choice/__init__.py::test PASSED [ 
>> > 71%]
>> > scripts/kconfig/tests/new_choice_with_dep/__init__.py::test PASSED  [ 
>> > 78%]
>> > scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py::test PASSED[ 
>> > 85%]
>> > scripts/kconfig/tests/rand_nested_choice/__init__.py::test PASSED   [ 
>> > 92%]
>> > scripts/kconfig/tests/warn_recursive_dep/__init__.py::test PASSED   
>> > [100%]
>> > == 14 passed in 0.34 seconds 
>> > ==
>>
>> When applied all 6 patches, I got several errors (see bellow).
>> I tested in on 2 distros (Debian unstable and openSUSE Tumbleweed).
>> The code I applied is here, did I make error when applying patches?
>> https://github.com/pevik/u-boot/tree/eugeniu/kconfig.v2
>
> I checked your branch and got some interesting conclusions.
> Here is the diff between my and your version of commit ("kconfig:
> re-sync with Linux 4.17-rc4"):
>
> $ git diff  
>  scripts/kconfig/tests/auto_submenu/expected_stdout| 14 +++---
>  scripts/kconfig/tests/choice/oldask0_expected_stdout  | 14 +++---
>  scripts/kconfig/tests/choice/oldask1_expected_stdout  | 12 ++--
>  scripts/kconfig/tests/new_choice_with_dep/expected_stdout |  4 ++--
>  4 files changed, 22 insertions(+), 22 deletions(-)
>
> Here is the same diff ignoring whitespace:
>
> $ git diff -w  
>  scripts/kconfig/tests/auto_submenu/expected_stdout| 0
>  scripts/kconfig/tests/choice/oldask0_expected_stdout  | 0
>  scripts/kconfig/tests/choice/oldask1_expected_stdout  | 0
>  scripts/kconfig/tests/new_choice_with_dep/expected_stdout | 0
>  4 files changed, 0 insertions(+), 0 deletions(-)
>
> So, it seems like all the trailing white-space from above files
> disappeared on your branch, after applying the patches from the
> email client (who did this?...).
>
> I didn't expect that trailing white-space to be of any value for the
> test results, but it turns out it is! With the whitespace removed, I can
> also reproduce the failures of "make testconfig".

Right.
Whitespaces are precious in the expected_stdout files.
Do not rip them off.



> I am not familiar with pytest, but, based on what we see here, it looks
> like every single character stored in *xpected_stdout files (including
> whitespace at the end of lines) matters for the test to pass.
>
> I wonder if Kconfig could avoid printing whitespace in command line
> user dialogs. Then maybe those space characters could be removed from
> the "*xpected_stdout" files.


'make config' display a space at the end of line
when prompting user input.

This makes the input readable, like follows:

*
* Linux/x86 4.17.0-rc4 Kernel Configuration
*
64-bit kernel (64BIT) [Y/n/?] y
*
* General setup
*
Cross-compiler tool prefix (CROSS_COMPILE) []
Compile also drivers which will not load (COMPILE_TEST) [N/y/?] y



I think you are suggesting to remove a space, like follows:

*
* Linux/x86 4.17.0-rc4 Kernel Configuration
*
64-bit kernel (64BIT) [Y/n/?]y
*
* General setup
*
Cross-compiler tool prefix (CROSS_COMPILE) []
Compile also drivers which will not load (COMPILE_TEST) [N/y/?]y




I believe we should not do this
just for unit-testing.





> Masahiro?
>
> Thanks again!
>
> Best regards,
> Eugeniu.
> ___
> U-Boot mailing 

Re: [U-Boot] [PATCH v2 1/1] arm: print instructions pointed to by pc

2018-05-13 Thread Tuomas Tynkkynen
Hi,

On Thu, 10 May 2018 16:38:30 +0200
Heinrich Schuchardt  wrote:

> If an exception occurs in a loaded image and the relocation offset is
> unknown, it is helful to know the instructions pointed to by the
> program counter. This patch adds the missing output.
> 
> A possible output is:
> *pc: fb de f7 e7 1e ff 2f e1 01 00 50 e3 f0 4d 2d e9 01 80 a0 e1
> 
> The output can be disassembled with
> xxd -pc -r - > a.out
> $(CROSS_COMPILE)objdump -D -marm -b binary a.out
> 
> Signed-off-by: Heinrich Schuchardt 
> ---
> v2
>   print bytes not halfwords

Note that Linux already comes with a scripts/decodecode tool where you paste the
output of an Oops and it disassembles the "Code: " line from the dump. So I'd
vote for importing scripts/decodecode from Linux and making U-Boot's output
compatible with Linux.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] mmc: Improve tinification

2018-05-13 Thread Tom Rini
On Sun, Apr 15, 2018 at 12:37:11AM +0200, Marek Vasut wrote:

> From: Marek Vasut 
> 
> Drop all the extra content from the MMC core, so that tiny MMC support
> is really tiny, no fancy anything. That means the tiny MMC support does
> only 1-bit transfers at default speed settings. Moreover, this patch
> drops duplicate instance of struct mmc mmc_static, which wasted about
> 360 bytes. Furthermore, since MMC tiny supports only one controller
> at all times, get rid of mallocating the ext csd backup and replace
> it with static array. All in all, this patch saves ~4 kiB of bloat
> from the MMC core, which on platforms with severe limitations can be
> beneficial.
> 
> Signed-off-by: Marek Vasut 
> Cc: Jaehoon Chung 
> Cc: Tom Rini 

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] Support for the Raspberry Pi 3B+?

2018-05-13 Thread Peter Robinson
On Sat, May 12, 2018 at 8:50 PM, Qwerty Chouskie
 wrote:
> The defconfig for the 3 seems to work fine, except that for some reason
> Ethernet doesn't work (from what I understand, it is on the USB bus, though
> u-boot doesn't detect it?
>
> A quick google found some (maybe) useful files (e.g. the DTS) here:
> https://www.spinics.net/lists/arm-kernel/msg646251.html
>
> It would be nice to have an explicit defconfig for the 3B+ for peace of
> mind, even if it is basically the same as the 3.

With the 2018.05 release works with the 3B and 3B+ without issue
including usb/network. I've found trhe USB to be a little unstable if
it had a number of devices plugged in but overall it all works just
fine, I think another config would just add confusion.

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