Re: [U-Boot] [PATCH v5 05/16] arm: socfpga: Add A10 macros

2017-04-16 Thread Ley Foon Tan
On Fri, Apr 14, 2017 at 6:20 PM, Marek Vasut  wrote:
> On 04/13/2017 07:41 PM, Ley Foon Tan wrote:
>> Add i2c, timer and other A10 macros.
>
> What's NOC anyway ?
Network on chip.
>
>> Signed-off-by: Ley Foon Tan 
>> ---
>>  arch/arm/mach-socfpga/include/mach/base_addr_a10.h | 8 +++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/mach-socfpga/include/mach/base_addr_a10.h 
>> b/arch/arm/mach-socfpga/include/mach/base_addr_a10.h
>> index a7056d4..448fbdc 100644
>> --- a/arch/arm/mach-socfpga/include/mach/base_addr_a10.h
>> +++ b/arch/arm/mach-socfpga/include/mach/base_addr_a10.h
>> @@ -1,5 +1,5 @@
>>  /*
>> - * Copyright (C) 2014 Altera Corporation 
>> + * Copyright (C) 2014-2017 Altera Corporation 
>>   *
>>   * SPDX-License-Identifier:  GPL-2.0+
>>   */
>> @@ -29,14 +29,20 @@
>>  #define SOCFPGA_MPUL2_ADDRESS0xf000
>>  #define SOCFPGA_I2C0_ADDRESS 0xffc02200
>>  #define SOCFPGA_I2C1_ADDRESS 0xffc02300
>> +#define SOCFPGA_I2C2_ADDRESS 0xffc02400
>> +#define SOCFPGA_I2C3_ADDRESS 0xffc02500
>> +#define SOCFPGA_I2C4_ADDRESS 0xffc02600
>>
>>  #define SOCFPGA_ECC_OCRAM_ADDRESS0xff8c3000
>>  #define SOCFPGA_UART0_ADDRESS0xffc02000
>>  #define SOCFPGA_OSC1TIMER0_ADDRESS   0xffd0
>> +#define SOCFPGA_OSC1TIMER1_ADDRESS   0xffd00100
>>  #define SOCFPGA_CLKMGR_ADDRESS   0xffd04000
>>  #define SOCFPGA_RSTMGR_ADDRESS   0xffd05000
>>
>>  #define SOCFPGA_SDR_ADDRESS  0xffcfb000
>> +#define SOCFPGA_NOC_L4_PRIV_FLT_OFST 0xffd11000
>> +#define SOCFPGA_NOC_FW_H2F_SCR_OFST  0xffd13500
>
> Keep the list sorted by address at least :)
Okay.
>
>>  #define SOCFPGA_SDR_SCHEDULER_ADDRESS0xffd12400
>>  #define SOCFPGA_SDR_FIREWALL_OCRAM_ADDRESS   0xffd13200
>>  #define SOCFPGA_SDR_FIREWALL_MPU_FPGA_ADDRESS0xffd13300
>>
Regards
Ley Foon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v5 14/16] arm: socfpga: Add config and defconfig for Arria 10

2017-04-16 Thread Ley Foon Tan
On Fri, Apr 14, 2017 at 6:25 PM, Marek Vasut  wrote:
> On 04/13/2017 07:41 PM, Ley Foon Tan wrote:
>> Add config and defconfig for the Arria10 and update socfpga_common.h.
>>
>> Signed-off-by: Tien Fong Chee 
>> Signed-off-by: Ley Foon Tan 
>
> [...]
>
>> @@ -298,7 +306,10 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
>>   */
>>  #define CONFIG_SPL_FRAMEWORK
>>  #define CONFIG_SPL_TEXT_BASE CONFIG_SYS_INIT_RAM_ADDR
>> -#define CONFIG_SPL_MAX_SIZE  (64 * 1024)
>> +#define CONFIG_SPL_MAX_SIZE  CONFIG_SYS_INIT_RAM_SIZE
>> +#if defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
>> +#define CONFIG_SPL_BOARD_INIT
>
> This should be in Kconfig and selected by arch/arm/mach-socfpga/Kconfig
> entry for A10
We can't use Kconfig method for CONFIG_SPL_BOARD_INIT, it is not a
Kconfig parameter now.

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


Re: [U-Boot] [PATCH] video: Remove dependecy of I2C_EDID

2017-04-16 Thread Simon Glass
Hi,

On 9 April 2017 at 15:30, Jernej Škrabec  wrote:
> Hi,
>
> Dne nedelja, 09. april 2017 ob 21:28:47 CEST je Simon Glass napisal(a):
>> Hi,
>>
>> On 28 March 2017 at 16:39, Jernej Skrabec  wrote:
>> > I2C_EDID currently selects DM_I2C. However, it is not needed. I2C_EDID
>> > is used for building edid.c, which doesn't even use I2C bus, and by I2C
>> > command, which knows how to use DM and old style I2C interface, so it is
>> > not directly affected by this removal.
>> >
>> > Furthermore, this selection can generate warning if DM display driver
>> > is used on platform which doesn't implement DM I2C driver (for example,
>> > sunxi platform with upcoming DM video & display driver).
>> >
>> > Patch was tested with rockchip and sunxi boards and successfully
>> > compiled exynos and tegra targets. They are the only consumers of
>> > CONFIG_DISPLAY option, which is the only one which selects I2C_EDID.
>> >
>> > Signed-off-by: Jernej Skrabec 
>> > ---
>> >
>> >  cmd/i2c.c | 10 ++
>> >  drivers/video/Kconfig |  1 -
>> >  2 files changed, 6 insertions(+), 5 deletions(-)
>> >
>> > diff --git a/cmd/i2c.c b/cmd/i2c.c
>> > index 473153fbd4..7b6306e525 100644
>> > --- a/cmd/i2c.c
>> > +++ b/cmd/i2c.c
>> > @@ -1630,7 +1630,8 @@ static int do_sdram (cmd_tbl_t * cmdtp, int flag,
>> > int argc, char * const argv[])>
>> >   * Syntax:
>> >   * i2c edid {i2c_chip}
>> >   */
>> >
>> > -#if defined(CONFIG_I2C_EDID)
>> > +#if defined(CONFIG_I2C_EDID) && \
>> > +   (defined(CONFIG_SYS_I2C) || defined(CONFIG_DM_I2C))
>>
>> The correct solution here I think is to convert sunxi to DM_I2C. We
>> should not be adding new features to the old code.
>
> With the "old code" you referring to i2c command? Actually, I'm not sure if
> "i2c edid" command can be useful on most platforms. I know that rk3288 has
> multiplexed I2C controller pins with HDMI DDC pins, where this make sense. But
> for example on sunxi, in order to be useful, it would mean that dw_hdmi driver
> has to register DDC as I2C driver.
>
> I'm also not sure why "i2c edid" code knows how to use old and DM I2C
> interface when it is surrounded by a symbol, which always selects DM_I2C.
> Well, in sunxi case, that actually prevents build failure, but still produces
> unwanted warning.
>
> Otherwise I agree that converting sunxi to DM_I2C should be done and patch for
> that already exists, but it was not merged yet:
> https://patchwork.ozlabs.org/patch/734375/

Sounds good. Let's get that merged and then we don't need to worry
about the legacy I2C.

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


Re: [U-Boot] [PATCH] power: regulator: pwm: support pwm polarity setting

2017-04-16 Thread Simon Glass
Hi Elaine,

On 9 April 2017 at 20:09, Elaine Zhang  wrote:
>
>
> On 04/10/2017 03:28 AM, Simon Glass wrote:
>>
>> Hi,
>>
>> On 7 April 2017 at 05:02, Kever Yang  wrote:
>>>
>>> The latest kernel PWM drivers enable the polarity settings. When system
>>> run from U-Boot to kerenl, if there are differences in polarity set or
>>> duty cycle, the PMW will re-init:
>>>close -> set polarity and duty cycle -> enable the PWM.
>>> The power supply controled by pwm regulator may have voltage shaking,
>>> which lead to the system not stable.
>>>
>>> Signed-off-by: Kever Yang 
>>> ---
>>>
>>>   drivers/power/regulator/pwm_regulator.c | 12 ++--
>>>   drivers/pwm/pwm-uclass.c| 10 ++
>>>   drivers/pwm/rk_pwm.c| 17 -
>>>   include/pwm.h   |  9 +
>>>   4 files changed, 45 insertions(+), 3 deletions(-)
>>
>>
>> If the generic uclass change and the rk change can be separated, it is
>> good to do it.
>>
>> Also we should have a test for pwm (test/dm/pwm.c). Are you able to do
>> that? If not I could give it a try.
>
> we have no plan to do it.

I've created something simple here. You can base your next series on
u-boot-dm/pwm-working.

http://patchwork.ozlabs.org/patch/751254/

>>
>>
>>>
>>> diff --git a/drivers/power/regulator/pwm_regulator.c
>>> b/drivers/power/regulator/pwm_regulator.c
>>> index 4875238..f8a6712 100644
>>> --- a/drivers/power/regulator/pwm_regulator.c
>>> +++ b/drivers/power/regulator/pwm_regulator.c
>>> @@ -24,6 +24,8 @@ struct pwm_regulator_info {
>>>  int pwm_id;
>>>  /* the period of one PWM cycle */
>>>  int period_ns;
>>> +   /* the polarity of one PWM */
>>> +   int polarity;
>>
>>
>> Can you update the comment to indicate what the values mean? E.g. is 0
>> the normal polarity and 1 inverted?
>
> 0 : normal polarity
> 1 : inverted polarity
> I will update the comment next version.
>>
>>
>>>  struct udevice *pwm;
>>>  /* initialize voltage of regulator */
>>>  unsigned int init_voltage;
>>> @@ -49,7 +51,7 @@ static int pwm_voltage_to_duty_cycle_percentage(struct
>>> udevice *dev, int req_uV)
>>>  int max_uV = priv->max_voltage;
>>>  int diff = max_uV - min_uV;
>>>
>>> -   return 100 - (((req_uV * 100) - (min_uV * 100)) / diff);
>>> +   return ((req_uV * 100) - (min_uV * 100)) / diff;
>>>   }
>>>
>>>   static int pwm_regulator_get_voltage(struct udevice *dev)
>>> @@ -67,6 +69,12 @@ static int pwm_regulator_set_voltage(struct udevice
>>> *dev, int uvolt)
>>>
>>>  duty_cycle = pwm_voltage_to_duty_cycle_percentage(dev, uvolt);
>>>
>>> +   ret = pwm_set_init(priv->pwm, priv->pwm_id, priv->polarity);
>>
>>
>> I wonder if it would be better to combine the polarity into the
>> pwm_set_config() call? Then we can do everything in one call. If not
>> then I think pwm_set_invert() would be a better name.
>
> The polarity set only once, so we set it in pwm_set_init() call.
> Using pwm_set_invert, of course, is also possible.

OK, so that's why it should a separate call. Seems OK to me.

>
>>
>>> +   if (ret) {
>>> +   dev_err(dev, "Failed to init PWM\n");
>>> +   return ret;
>>> +   }
>>> +
>>>  ret = pwm_set_config(priv->pwm, priv->pwm_id,
>>>  (priv->period_ns / 100) * duty_cycle,
>>> priv->period_ns);
>>>  if (ret) {
>>> @@ -97,9 +105,9 @@ static int pwm_regulator_ofdata_to_platdata(struct
>>> udevice *dev)
>>>  debug("%s: Cannot get PWM phandle: ret=%d\n", __func__,
>>> ret);
>>>  return ret;
>>>  }
>>> -   /* TODO: pwm_id here from device tree if needed */
>>>
>>>  priv->period_ns = args.args[1];
>>> +   priv->polarity = args.args[2];
>>
>>
>> Does this mean that the binding has this argument and we have been
>> ignoring it?
>>
>> Can you bring in the DT binding file from Linux to U-Boot also?

Did you see this one?

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


[U-Boot] [PATCH] dm: sandbox: pwm: Add a basic pwm test

2017-04-16 Thread Simon Glass
Unfortunately a test for the PWM uclass was not included when it was
submitted. This was noticed when trying to add more functionality:

   http://patchwork.ozlabs.org/patch/748172/

Add a simple test to get us started.

Signed-off-by: Simon Glass 
---

 arch/sandbox/dts/test.dts   |  8 +
 configs/sandbox_defconfig   |  2 ++
 configs/sandbox_noblk_defconfig |  2 ++
 configs/sandbox_spl_defconfig   |  2 ++
 drivers/pwm/Kconfig |  8 +
 drivers/pwm/Makefile|  1 +
 drivers/pwm/sandbox_pwm.c   | 75 +
 test/dm/Makefile|  1 +
 test/dm/pwm.c   | 32 ++
 9 files changed, 131 insertions(+)
 create mode 100644 drivers/pwm/sandbox_pwm.c
 create mode 100644 test/dm/pwm.c

diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index fff175d1b7..50bcdebf74 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -272,6 +272,14 @@
power-domains = < 2>;
};
 
+   pwm {
+   compatible = "sandbox,pwm";
+   };
+
+   pwm2 {
+   compatible = "sandbox,pwm";
+   };
+
ram {
compatible = "sandbox,ram";
};
diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig
index 7f3f5ac809..cdd76eb7a6 100644
--- a/configs/sandbox_defconfig
+++ b/configs/sandbox_defconfig
@@ -172,3 +172,5 @@ CONFIG_UNIT_TEST=y
 CONFIG_UT_TIME=y
 CONFIG_UT_DM=y
 CONFIG_UT_ENV=y
+CONFIG_DM_PWM=y
+CONFIG_PWM_SANDBOX=y
diff --git a/configs/sandbox_noblk_defconfig b/configs/sandbox_noblk_defconfig
index 3f8e70d523..6a48d81198 100644
--- a/configs/sandbox_noblk_defconfig
+++ b/configs/sandbox_noblk_defconfig
@@ -174,3 +174,5 @@ CONFIG_UNIT_TEST=y
 CONFIG_UT_TIME=y
 CONFIG_UT_DM=y
 CONFIG_UT_ENV=y
+CONFIG_DM_PWM=y
+CONFIG_PWM_SANDBOX=y
diff --git a/configs/sandbox_spl_defconfig b/configs/sandbox_spl_defconfig
index ade67143b1..9d3e38b7b4 100644
--- a/configs/sandbox_spl_defconfig
+++ b/configs/sandbox_spl_defconfig
@@ -178,3 +178,5 @@ CONFIG_UNIT_TEST=y
 CONFIG_UT_TIME=y
 CONFIG_UT_DM=y
 CONFIG_UT_ENV=y
+CONFIG_DM_PWM=y
+CONFIG_PWM_SANDBOX=y
diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
index 37ea2b88ea..e827558052 100644
--- a/drivers/pwm/Kconfig
+++ b/drivers/pwm/Kconfig
@@ -27,6 +27,14 @@ config PWM_ROCKCHIP
  Various options provided in the hardware (such as capture mode and
  continuous/single-shot) are not supported by the driver.
 
+config PWM_SANDBOX
+   bool "Enable support for the sandbox PWM"
+   help
+ This is a sandbox PWM used for testing. It provides 3 channels and
+ records the settings passed into it, but otherwise does nothing
+ useful. The PWM can be enabled but is not connected to any outputs
+ so this is not very useful.
+
 config PWM_TEGRA
bool "Enable support for the Tegra PWM"
depends on DM_PWM
diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile
index b037130385..29d59916cb 100644
--- a/drivers/pwm/Makefile
+++ b/drivers/pwm/Makefile
@@ -15,4 +15,5 @@ obj-$(CONFIG_DM_PWM)  += pwm-uclass.o
 obj-$(CONFIG_PWM_EXYNOS)   += exynos_pwm.o
 obj-$(CONFIG_PWM_IMX)  += pwm-imx.o pwm-imx-util.o
 obj-$(CONFIG_PWM_ROCKCHIP) += rk_pwm.o
+obj-$(CONFIG_PWM_SANDBOX)  += sandbox_pwm.o
 obj-$(CONFIG_PWM_TEGRA)+= tegra_pwm.o
diff --git a/drivers/pwm/sandbox_pwm.c b/drivers/pwm/sandbox_pwm.c
new file mode 100644
index 00..c2ce974dde
--- /dev/null
+++ b/drivers/pwm/sandbox_pwm.c
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2015 Google, Inc
+ * Written by Simon Glass 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+enum {
+   NUM_CHANNELS= 3,
+};
+
+struct sandbox_pwm_chan {
+   uint period_ns;
+   uint duty_ns;
+   bool enable;
+};
+
+struct sandbox_pwm_priv {
+   struct sandbox_pwm_chan chan[NUM_CHANNELS];
+};
+
+static int sandbox_pwm_set_config(struct udevice *dev, uint channel,
+ uint period_ns, uint duty_ns)
+{
+   struct sandbox_pwm_priv *priv = dev_get_priv(dev);
+   struct sandbox_pwm_chan *chan;
+
+   if (channel >= NUM_CHANNELS)
+   return -ENOSPC;
+   chan = >chan[channel];
+   chan->period_ns = period_ns;
+   chan->duty_ns = duty_ns;
+
+   return 0;
+}
+
+static int sandbox_pwm_set_enable(struct udevice *dev, uint channel,
+ bool enable)
+{
+   struct sandbox_pwm_priv *priv = dev_get_priv(dev);
+   struct sandbox_pwm_chan *chan;
+
+   if (channel >= NUM_CHANNELS)
+   return -ENOSPC;
+   chan = >chan[channel];
+   chan->enable = enable;
+
+   return 0;
+}
+
+static const struct pwm_ops sandbox_pwm_ops = {
+   .set_config = sandbox_pwm_set_config,
+   .set_enable = 

[U-Boot] U-boot-sunxi status?

2017-04-16 Thread Chen-Yu Tsai
Hi,

(Resent from my main email address.)

What's the current status of u-boot-sunxi? There are still some
patch series floating around. Some of them have been around for
a while now, listed here in no particular order:

  - sunxi: Add support for R40 SoC v2 (by Chen-Yu Tsai)
  - sunxi: Remove SYS_EXTRA_OPTIONS v3 (by Mylene Josserand)
  - sunxi: video: Add support for HDMI output on A64/H3/H5 v3 (by
Jernej Skrabec)
  - Allwinner V3s and Lichee Pi Zero support (w/o SPL) v5 (by Icenowy Zheng)
  - Allwinner DesignWare-like DRAM controllers refactor v1 (by Icenowy Zheng)
  - Various DM related patch series from Philipp Tomsich

Also sunxi related but probably not going through u-boot-sunxi:

  - SPL: extend FIT loading support v3 (by Andre Przywara)
  - Retrieve MAC address from EEPROM v5 (by Olliver Schinagl)

Some of these series have been fully reviewed, others only partially.
I'm sure there are more out there, but I don't track U-boot patches
as closely as kernel patches. So how can we help getting all these
things ready and merged?

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


Re: [U-Boot] [PATCH 1/2] cmd: remove Blackfin specific commands

2017-04-16 Thread Masahiro Yamada
2017-04-17 4:32 GMT+09:00 Simon Glass :
> On 13 April 2017 at 19:54, Masahiro Yamada
>  wrote:
>> These commands have no user since commit ea3310e8aafa ("Blackfin:
>> Remove").
>>
>> Signed-off-by: Masahiro Yamada 
>> ---
>>
>>  cmd/Makefile |   6 --
>>  cmd/bootldr.c| 170 -
>>  cmd/cplbinfo.c   |  60 ---
>>  cmd/ldrinfo.c| 192 --
>>  cmd/otp.c| 228 
>> ---
>>  cmd/softswitch.c |  41 --
>>  cmd/spibootldr.c |  37 -
>>  7 files changed, 734 deletions(-)
>>  delete mode 100644 cmd/bootldr.c
>>  delete mode 100644 cmd/cplbinfo.c
>>  delete mode 100644 cmd/ldrinfo.c
>>  delete mode 100644 cmd/otp.c
>>  delete mode 100644 cmd/softswitch.c
>>  delete mode 100644 cmd/spibootldr.c
>
> Reviewed-by: Simon Glass 


If the subject of 2/2 is fixed-up
(http://patchwork.ozlabs.org/patch/750694/),
please do so for this as well.




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


Re: [U-Boot] [PATCH v2 3/3] sysreset: psci: support system reset in a generic way with PSCI

2017-04-16 Thread Masahiro Yamada
Hi Simon,


2017-04-17 4:31 GMT+09:00 Simon Glass :
> Hi Masahiro,
>
> On 12 April 2017 at 20:39, Masahiro Yamada
>  wrote:
>> If the system is running PSCI firmware, the System Reset function
>> (func ID: 0x8009) is supposed to be handled by PSCI, that is,
>> the SoC/board specific reset implementation should be moved to PSCI.
>> U-Boot should call the PSCI service according to the arm-smccc
>> manner.
>>
>> The arm-smccc is supported on ARMv7 or later.  Especially, ARMv8
>> generation SoCs are likely to run ARM Trusted Firmware BL31.  In
>> this case, U-Boot is a non-secure world boot loader, so it should
>> not be able to reset the system directly.
>>
>> Signed-off-by: Masahiro Yamada 
>> ---
>>
>> Changes in v2: None
>>
>>  arch/arm/Kconfig   |  1 +
>>  drivers/Kconfig|  2 +
>>  drivers/Makefile   |  5 +-
>>  drivers/firmware/Kconfig   |  6 +++
>>  drivers/firmware/Makefile  |  2 +
>>  drivers/firmware/firmware-uclass.c | 11 +
>>  drivers/firmware/psci.c| 94 
>> ++
>>  drivers/sysreset/Kconfig   | 10 
>>  drivers/sysreset/Makefile  |  1 +
>>  drivers/sysreset/sysreset_psci.c   | 41 +
>>  include/dm/uclass-id.h |  1 +
>>  include/linux/psci.h   | 13 ++
>>  12 files changed, 185 insertions(+), 2 deletions(-)
>>  create mode 100644 drivers/firmware/Kconfig
>>  create mode 100644 drivers/firmware/Makefile
>>  create mode 100644 drivers/firmware/firmware-uclass.c
>>  create mode 100644 drivers/firmware/psci.c
>>  create mode 100644 drivers/sysreset/sysreset_psci.c
>
> Reviewed-by: Simon Glass 
>
> It is not clear what the firmware uclass is for. Also there are no
> operations. How about adding a header file with at least a comment in
> it?


Actually, the firmware uclass does not provide
any generalized operation, but in the DM framework,
a driver must belong to some uclass.


I thought about this a bit, then
another idea is perhaps to re-use UCLASS_MISC
instead of adding a new opaque uclass.
We can use misc_ioctl() for PSCI call.




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


[U-Boot] [PATCH 08/19] fdt: Build the new python libfdt module

2017-04-16 Thread Simon Glass
Build the upstream python libfdt module. At present the legacy module is
still built and is the one that it used. Future work will switch this
over.

Signed-off-by: Simon Glass 
---

 tools/Makefile | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/tools/Makefile b/tools/Makefile
index cd08d3b33b..65d3fb911a 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -63,6 +63,11 @@ FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := common/image-sig.o
 LIBFDT_CSRCS := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c  \
fdt_empty_tree.c fdt_addresses.c fdt_overlay.c \
fdt_region.c
+
+libfdt_tree := $(srctree)/lib/libfdt
+
+LIBFDT_SRCS := $(addprefix $(libfdt_tree)/, $(LIBFDT_CSRCS))
+LIBFDT_SWIG := $(addprefix $(libfdt_tree)/, pylibfdt/libfdt.i)
 LIBFDT_OBJS := $(addprefix lib/libfdt/, $(patsubst %.c, %.o, $(LIBFDT_CSRCS)))
 
 RSA_OBJS-$(CONFIG_FIT_SIGNATURE) := $(addprefix lib/rsa/, \
@@ -114,6 +119,15 @@ mkimage-objs   := $(dumpimage-mkimage-objs) mkimage.o
 fit_info-objs   := $(dumpimage-mkimage-objs) fit_info.o
 fit_check_sign-objs   := $(dumpimage-mkimage-objs) fit_check_sign.o
 
+tools/_libfdt.so: $(LIBFDT_SRCS) $(LIBFDT_SWIG)
+   LDFLAGS="$(HOSTLDFLAGS)" CFLAGS= VERSION=u-boot-$(UBOOTVERSION) \
+   CPPFLAGS="$(_hostc_flags)" OBJDIR=tools \
+   SOURCES="$(LIBFDT_SRCS) $(LIBFDT_SWIG)" \
+   SWIG_OPTS="-I$(srctree)/lib/libfdt -I$(srctree)/lib" \
+   $(libfdt_tree)/pylibfdt/setup.py --quiet build_ext --inplace
+   mv $(libfdt_tree)/pylibfdt/libfdt.py tools/.
+   rm $(libfdt_tree)/pylibfdt/libfdt_wrap.c
+
 # Build a libfdt Python module if swig is available
 # Use 'sudo apt-get install swig libpython-dev' to enable this
 hostprogs-y += \
@@ -219,6 +233,10 @@ clean-dirs := lib common
 
 always := $(hostprogs-y)
 
+# Build a libfdt Python module if swig is available
+# Use 'sudo apt-get install swig libpython-dev' to enable this
+always += $(if $(shell which swig 2> /dev/null),_libfdt.so)
+
 # Generated LCD/video logo
 LOGO_H = $(objtree)/include/bmp_logo.h
 LOGO_DATA_H = $(objtree)/include/bmp_logo_data.h
-- 
2.12.2.762.g0e3151a226-goog

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


[U-Boot] [PATCH 18/19] binman: Rename fdt variable to dtb

2017-04-16 Thread Simon Glass
Since fdt is the name of a module, use a different name for variables to
avoid a conflict.

Signed-off-by: Simon Glass 
---

 tools/binman/control.py | 10 +-
 tools/binman/etype/u_boot_dtb_with_ucode.py |  9 -
 tools/binman/func_test.py   |  4 ++--
 3 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/tools/binman/control.py b/tools/binman/control.py
index e90967807c..42d75efbcd 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -40,15 +40,15 @@ def _ReadImageDesc(binman_node):
 images['image'] = Image('image', binman_node)
 return images
 
-def _FindBinmanNode(fdt):
+def _FindBinmanNode(dtb):
 """Find the 'binman' node in the device tree
 
 Args:
-fdt: Fdt object to scan
+dtb: Fdt object to scan
 Returns:
 Node object of /binman node, or None if not found
 """
-for node in fdt.GetRoot().subnodes:
+for node in dtb.GetRoot().subnodes:
 if node.name == 'binman':
 return node
 return None
@@ -92,8 +92,8 @@ def Binman(options, args):
 try:
 tools.SetInputDirs(options.indir)
 tools.PrepareOutputDir(options.outdir, options.preserve)
-fdt = fdt_select.FdtScan(dtb_fname)
-node = _FindBinmanNode(fdt)
+dtb = fdt.FdtScan(dtb_fname)
+node = _FindBinmanNode(dtb)
 if not node:
 raise ValueError("Device tree '%s' does not have a 'binman' "
  "node" % dtb_fname)
diff --git a/tools/binman/etype/u_boot_dtb_with_ucode.py 
b/tools/binman/etype/u_boot_dtb_with_ucode.py
index 95405c6473..01ee36fb0d 100644
--- a/tools/binman/etype/u_boot_dtb_with_ucode.py
+++ b/tools/binman/etype/u_boot_dtb_with_ucode.py
@@ -44,9 +44,8 @@ class Entry_u_boot_dtb_with_ucode(Entry_blob):
 fd.write(self.data)
 
 # Remove the microcode
-fdt = fdt_select.FdtScan(fname)
-fdt.Scan()
-ucode = fdt.GetNode('/microcode')
+dtb = fdt.FdtScan(fname)
+ucode = dtb.GetNode('/microcode')
 if not ucode:
 raise self.Raise("No /microcode node found in '%s'" % fname)
 
@@ -64,8 +63,8 @@ class Entry_u_boot_dtb_with_ucode(Entry_blob):
 self.ucode_offset = data_prop.GetOffset() + 12
 self.ucode_size = len(data_prop.bytes)
 if self.collate:
-fdt.Pack()
-fdt.Flush()
+dtb.Pack()
+dtb.Flush()
 
 # Make this file the contents of this entry
 self._pathname = fname
diff --git a/tools/binman/func_test.py b/tools/binman/func_test.py
index 7328d03b5c..8960e23f2c 100644
--- a/tools/binman/func_test.py
+++ b/tools/binman/func_test.py
@@ -658,8 +658,8 @@ class TestFunctional(unittest.TestCase):
 fname = tools.GetOutputFilename('test.dtb')
 with open(fname, 'wb') as fd:
 fd.write(second)
-fdt = fdt_select.FdtScan(fname)
-ucode = fdt.GetNode('/microcode')
+dtb = fdt.FdtScan(fname)
+ucode = dtb.GetNode('/microcode')
 self.assertTrue(ucode)
 for node in ucode.subnodes:
 self.assertFalse(node.props.get('data'))
-- 
2.12.2.762.g0e3151a226-goog

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


[U-Boot] [PATCH 11/19] fdt: Support use of the new python libfdt library

2017-04-16 Thread Simon Glass
Use the new library if available, while retaining backwards compatibility
with the old library for now.

Signed-off-by: Simon Glass 
---

 tools/Makefile   |  4 +++-
 tools/binman/binman.py   |  3 +++
 tools/dtoc/fdt.py|  1 +
 tools/dtoc/fdt_normal.py | 35 ++-
 4 files changed, 33 insertions(+), 10 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 65d3fb911a..3ffd3eeca9 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -120,7 +120,9 @@ fit_info-objs   := $(dumpimage-mkimage-objs) fit_info.o
 fit_check_sign-objs   := $(dumpimage-mkimage-objs) fit_check_sign.o
 
 tools/_libfdt.so: $(LIBFDT_SRCS) $(LIBFDT_SWIG)
-   LDFLAGS="$(HOSTLDFLAGS)" CFLAGS= VERSION=u-boot-$(UBOOTVERSION) \
+   unset CC; \
+   unset CROSS_COMPILE; \
+   LDFLAGS="$(HOSTLDFLAGS)" CFLAGS= VERSION="u-boot-$(UBOOTVERSION)" \
CPPFLAGS="$(_hostc_flags)" OBJDIR=tools \
SOURCES="$(LIBFDT_SRCS) $(LIBFDT_SWIG)" \
SWIG_OPTS="-I$(srctree)/lib/libfdt -I$(srctree)/lib" \
diff --git a/tools/binman/binman.py b/tools/binman/binman.py
index 857d698b4c..95d3a048d8 100755
--- a/tools/binman/binman.py
+++ b/tools/binman/binman.py
@@ -21,6 +21,9 @@ sys.path.append(os.path.join(our_path, '../patman'))
 sys.path.append(os.path.join(our_path, '../dtoc'))
 sys.path.append(os.path.join(our_path, '../'))
 
+# Bring in the libfdt module
+sys.path.append('tools')
+
 # Also allow entry-type modules to be brought in from the etype directory.
 sys.path.append(os.path.join(our_path, 'etype'))
 
diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py
index 816fdbe525..c40b9b6bab 100644
--- a/tools/dtoc/fdt.py
+++ b/tools/dtoc/fdt.py
@@ -96,6 +96,7 @@ class PropBase:
 TYPE_INT: a byte-swapped integer stored as a 4-byte string
 TYPE_BYTE: a byte stored as a single-byte string
 """
+bytes = str(bytes)
 size = len(bytes)
 strings = bytes.split('\0')
 is_string = True
diff --git a/tools/dtoc/fdt_normal.py b/tools/dtoc/fdt_normal.py
index 17b0a9a726..e793f49fa8 100644
--- a/tools/dtoc/fdt_normal.py
+++ b/tools/dtoc/fdt_normal.py
@@ -12,7 +12,13 @@ import sys
 import fdt
 from fdt import Fdt, NodeBase, PropBase
 import fdt_util
-import libfdt_legacy as libfdt
+try:
+import libfdt
+legacy = False
+except ImportError:
+import libfdt_legacy as libfdt
+legacy = True
+
 
 # This deals with a device tree, presenting it as a list of Node and Prop
 # objects, representing nodes and properties, respectively.
@@ -36,7 +42,7 @@ class Prop(PropBase):
 """
 def __init__(self, node, offset, name, bytes):
 PropBase.__init__(self, node, offset, name)
-self.bytes = bytes
+self.bytes = str(bytes)
 if not bytes:
 self.type = fdt.TYPE_BOOL
 self.value = True
@@ -86,7 +92,10 @@ class Node(NodeBase):
 offset = libfdt.fdt_first_subnode(self._fdt.GetFdt(), self.Offset())
 while offset >= 0:
 sep = '' if self.path[-1] == '/' else '/'
-name = libfdt.Name(self._fdt.GetFdt(), offset)
+if legacy:
+name = libfdt.Name(self._fdt.GetFdt(), offset)
+else:
+name = self._fdt._fdt_obj.get_name(offset)
 path = self.path + sep + name
 node = Node(self._fdt, offset, name, path)
 self.subnodes.append(node)
@@ -139,6 +148,8 @@ class FdtNormal(Fdt):
 
 with open(self._fname) as fd:
 self._fdt = bytearray(fd.read())
+if not legacy:
+self._fdt_obj = libfdt.Fdt(self._fdt)
 
 def GetFdt(self):
 """Get the contents of the FDT
@@ -175,12 +186,18 @@ class FdtNormal(Fdt):
 props_dict = {}
 poffset = libfdt.fdt_first_property_offset(self._fdt, node._offset)
 while poffset >= 0:
-dprop, plen = libfdt.fdt_get_property_by_offset(self._fdt, poffset)
-prop = Prop(node, poffset, libfdt.String(self._fdt, dprop.nameoff),
-libfdt.Data(dprop))
-props_dict[prop.name] = prop
-
-poffset = libfdt.fdt_next_property_offset(self._fdt, poffset)
+if legacy:
+dprop, plen = libfdt.fdt_get_property_by_offset(self._fdt,
+poffset)
+prop = Prop(node, poffset,
+libfdt.String(self._fdt, dprop.nameoff),
+libfdt.Data(dprop))
+else:
+p = self._fdt_obj.get_property_by_offset(poffset)
+prop = Prop(node, poffset, p.name, p.value)
+props_dict[prop.name] = prop
+
+poffset = libfdt.fdt_next_property_offset(self._fdt, poffset)
 return props_dict
 
 def Invalidate(self):
-- 
2.12.2.762.g0e3151a226-goog


[U-Boot] [PATCH 15/19] fdt: Drop fdt_fallback library

2017-04-16 Thread Simon Glass
Drop this now-unused library and associated tests.

Signed-off-by: Simon Glass 
---

 tools/binman/fdt_test.py   |  10 ---
 tools/binman/func_test.py  |  42 ---
 tools/dtoc/fdt.py  |   4 +-
 tools/dtoc/fdt_fallback.py | 181 -
 tools/dtoc/fdt_select.py   |  24 +-
 5 files changed, 18 insertions(+), 243 deletions(-)
 delete mode 100644 tools/dtoc/fdt_fallback.py

diff --git a/tools/binman/fdt_test.py b/tools/binman/fdt_test.py
index 65fb947386..df2b0a6af7 100644
--- a/tools/binman/fdt_test.py
+++ b/tools/binman/fdt_test.py
@@ -82,13 +82,3 @@ class TestFdt(unittest.TestCase):
 self.assertEquals(list, type(prop.value))
 self.assertEquals(3, len(prop.value))
 self.assertEquals(['another', 'multi-word', 'message'], prop.value)
-
-def testFdtFallback(self):
-fname = self.GetCompiled('34_x86_ucode.dts')
-dt = FdtScan(fname, True)
-dt.GetProp('/microcode/update@0', 'data')
-self.assertEqual('fred',
-dt.GetProp('/microcode/update@0', 'none', default='fred'))
-self.assertEqual('12345678 12345679',
-dt.GetProp('/microcode/update@0', 'data', typespec='x'))
-self._DeleteProp(dt)
diff --git a/tools/binman/func_test.py b/tools/binman/func_test.py
index 740fa9e4e2..7328d03b5c 100644
--- a/tools/binman/func_test.py
+++ b/tools/binman/func_test.py
@@ -683,7 +683,7 @@ class TestFunctional(unittest.TestCase):
 self.assertEqual('nodtb with microcode' + pos_and_size +
  ' somewhere in here', first)
 
-def _RunPackUbootSingleMicrocode(self, collate):
+def _RunPackUbootSingleMicrocode(self):
 """Test that x86 microcode can be handled correctly
 
 We expect to see the following in the image, in order:
@@ -695,8 +695,6 @@ class TestFunctional(unittest.TestCase):
 # We need the libfdt library to run this test since only that allows
 # finding the offset of a property. This is required by
 # Entry_u_boot_dtb_with_ucode.ObtainContents().
-if not fdt_select.have_libfdt:
-return
 data = self._DoReadFile('35_x86_single_ucode.dts', True)
 
 second = data[len(U_BOOT_NODTB_DATA):]
@@ -705,34 +703,22 @@ class TestFunctional(unittest.TestCase):
 third = second[fdt_len:]
 second = second[:fdt_len]
 
-if not collate:
-ucode_data = struct.pack('>2L', 0x12345678, 0x12345679)
-self.assertIn(ucode_data, second)
-ucode_pos = second.find(ucode_data) + len(U_BOOT_NODTB_DATA)
+ucode_data = struct.pack('>2L', 0x12345678, 0x12345679)
+self.assertIn(ucode_data, second)
+ucode_pos = second.find(ucode_data) + len(U_BOOT_NODTB_DATA)
 
-# Check that the microcode pointer was inserted. It should match 
the
-# expected position and size
-pos_and_size = struct.pack('<2L', 0xfe00 + ucode_pos,
-len(ucode_data))
-first = data[:len(U_BOOT_NODTB_DATA)]
-self.assertEqual('nodtb with microcode' + pos_and_size +
-' somewhere in here', first)
+# Check that the microcode pointer was inserted. It should match the
+# expected position and size
+pos_and_size = struct.pack('<2L', 0xfe00 + ucode_pos,
+   len(ucode_data))
+first = data[:len(U_BOOT_NODTB_DATA)]
+self.assertEqual('nodtb with microcode' + pos_and_size +
+ ' somewhere in here', first)
 
 def testPackUbootSingleMicrocode(self):
 """Test that x86 microcode can be handled correctly with fdt_normal.
 """
-self._RunPackUbootSingleMicrocode(False)
-
-def testPackUbootSingleMicrocodeFallback(self):
-"""Test that x86 microcode can be handled correctly with fdt_fallback.
-
-This only supports collating the microcode.
-"""
-try:
-old_val = fdt_select.UseFallback(True)
-self._RunPackUbootSingleMicrocode(True)
-finally:
-fdt_select.UseFallback(old_val)
+self._RunPackUbootSingleMicrocode()
 
 def testUBootImg(self):
 """Test that u-boot.img can be put in a file"""
@@ -763,14 +749,12 @@ class TestFunctional(unittest.TestCase):
 def testMicrocodeWithoutPtrInElf(self):
 """Test that a U-Boot binary without the microcode symbol is 
detected"""
 # ELF file without a '_dt_ucode_base_size' symbol
-if not fdt_select.have_libfdt:
-return
 try:
 with open(self.TestFile('u_boot_no_ucode_ptr')) as fd:
 TestFunctional._MakeInputFile('u-boot', fd.read())
 
 with self.assertRaises(ValueError) as e:
-self._RunPackUbootSingleMicrocode(False)
+self._RunPackUbootSingleMicrocode()
 

[U-Boot] [PATCH 13/19] fdt: Stop building the old python libfdt module

2017-04-16 Thread Simon Glass
This is no-longer needed, so stop building it.

Signed-off-by: Simon Glass 
---

 lib/libfdt/libfdt_legacy.swig | 112 --
 lib/libfdt/setup.py   |  38 --
 tools/Makefile|  18 ---
 3 files changed, 168 deletions(-)
 delete mode 100644 lib/libfdt/libfdt_legacy.swig
 delete mode 100644 lib/libfdt/setup.py

diff --git a/lib/libfdt/libfdt_legacy.swig b/lib/libfdt/libfdt_legacy.swig
deleted file mode 100644
index 9880dd998e..00
--- a/lib/libfdt/libfdt_legacy.swig
+++ /dev/null
@@ -1,112 +0,0 @@
-%module libfdt_legacy
-
-%{
-#define SWIG_FILE_WITH_INIT
-#include "libfdt.h"
-%}
-
-%pythoncode %{
-def Raise(errnum):
-raise ValueError('Error %s' % fdt_strerror(errnum))
-
-def Name(fdt, offset):
-name, len = fdt_get_name(fdt, offset)
-return name
-
-def String(fdt, offset):
-offset = fdt32_to_cpu(offset)
-name = fdt_string(fdt, offset)
-return name
-
-def swap32(x):
-return (((x << 24) & 0xFF00) |
-((x <<  8) & 0x00FF) |
-((x >>  8) & 0xFF00) |
-((x >> 24) & 0x00FF))
-
-def fdt32_to_cpu(x):
-return swap32(x)
-
-def Data(prop):
-set_prop(prop)
-return get_prop_data()
-%}
-
-%include "typemaps.i"
-%include "cstring.i"
-
-%typemap(in) void* = char*;
-
-typedef int fdt32_t;
-
-struct fdt_property {
-fdt32_t tag;
-fdt32_t len;
-fdt32_t nameoff;
-char data[0];
-};
-
-/*
- * This is a work-around since I'm not sure of a better way to copy out the
- * contents of a string. This is used in dtoc/GetProps(). The intent is to
- * pass in a pointer to a property and access the data field at the end of
- * it. Ideally the Data() function above would be able to do this directly,
- * but I'm not sure how to do that.
- */
-#pragma SWIG nowarn=454
-%inline %{
-static struct fdt_property *cur_prop;
-
-void set_prop(struct fdt_property *prop) {
-cur_prop = prop;
-}
-%}
-
-%cstring_output_allocate_size(char **s, int *sz, free(*$1));
-%inline %{
-void get_prop_data(char **s, int *sz) {
-*sz = fdt32_to_cpu(cur_prop->len);
-*s = (char *)malloc(*sz);
-if (!*s)
-*sz = 0;
-else
-memcpy(*s, cur_prop + 1, *sz);
-}
-%}
-
-%typemap(in) (const void *) {
-  if (!PyByteArray_Check($input)) {
-SWIG_exception_fail(SWIG_TypeError, "in method '" "$symname" "', argument "
-   "$argnum"" of type '" "$type""'");
-  }
-  $1 = (void *) PyByteArray_AsString($input);
-}
-
-const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen);
-int fdt_path_offset(const void *fdt, const char *path);
-int fdt_first_property_offset(const void *fdt, int nodeoffset);
-int fdt_next_property_offset(const void *fdt, int offset);
-const char *fdt_strerror(int errval);
-const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
-  int offset,
-  int *OUTPUT);
-const char *fdt_get_name(const void *fdt, int nodeoffset, int *OUTPUT);
-const char *fdt_string(const void *fdt, int stroffset);
-int fdt_first_subnode(const void *fdt, int offset);
-int fdt_next_subnode(const void *fdt, int offset);
-
-%typemap(in) (void *) {
-  if (!PyByteArray_Check($input)) {
-SWIG_exception_fail(SWIG_TypeError, "in method '" "$symname" "', argument "
-   "$argnum"" of type '" "$type""'");
-  }
-  $1 = PyByteArray_AsString($input);
-}
-
-int fdt_delprop(void *fdt, int nodeoffset, const char *name);
-
-const char *fdt_strerror(int errval);
-int fdt_pack(void *fdt);
-
-int fdt_totalsize(const void *fdt);
-int fdt_off_dt_struct(const void *fdt);
diff --git a/lib/libfdt/setup.py b/lib/libfdt/setup.py
deleted file mode 100644
index fc881351c6..00
--- a/lib/libfdt/setup.py
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env python
-
-"""
-setup.py file for SWIG libfdt
-"""
-
-from distutils.core import setup, Extension
-import os
-import sys
-
-# Don't cross-compile - always use the host compiler.
-del os.environ['CROSS_COMPILE']
-del os.environ['CC']
-
-progname = sys.argv[0]
-cflags = sys.argv[1]
-files = sys.argv[2:]
-
-if cflags:
-cflags = [flag for flag in cflags.split(' ') if flag]
-else:
-cflags = None
-
-libfdt_module = Extension(
-'_libfdt_legacy',
-sources = files,
-extra_compile_args =  cflags
-)
-
-sys.argv = [progname, '--quiet', 'build_ext', '--inplace', '--force']
-
-setup (name = 'libfdt_legaacy',
-   version = '0.1',
-   author  = "SWIG Docs",
-   description = """Simple swig libfdt from docs""",
-   ext_modules = [libfdt_module],
-   py_modules = ["libfdt_legacy"],
-   )
diff --git a/tools/Makefile b/tools/Makefile
index 3ffd3eeca9..fb91b5247b 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -130,24 +130,6 @@ tools/_libfdt.so: $(LIBFDT_SRCS) 

Re: [U-Boot] [PATCH 2/2] drivers: remove Blackfin specific drivers

2017-04-16 Thread Masahiro Yamada
2017-04-17 4:32 GMT+09:00 Simon Glass :
> On 13 April 2017 at 19:55, Masahiro Yamada
>  wrote:
>> These drivers have no user since commit ea3310e8aafa ("Blackfin:
>> Remove").
>
> nit: Blackfin-specific
>
> (in subject)


If there is no more comment,
can Tom fix up the subject?






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



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


[U-Boot] [PATCH 19/19] fdt: Drop fdt_select.py

2017-04-16 Thread Simon Glass
This file was used to select between the normal and fallback libfdt
implementations. Now that we only have one, it is not needed.

Drop it and fix up all users.

Signed-off-by: Simon Glass 
---

 tools/binman/control.py |  2 +-
 tools/binman/etype/u_boot_dtb_with_ucode.py |  2 +-
 tools/binman/fdt_test.py|  2 +-
 tools/binman/func_test.py   |  2 +-
 tools/dtoc/dtoc.py  |  3 +--
 tools/dtoc/fdt.py   | 10 --
 tools/dtoc/fdt_select.py| 16 
 7 files changed, 13 insertions(+), 24 deletions(-)
 delete mode 100644 tools/dtoc/fdt_select.py

diff --git a/tools/binman/control.py b/tools/binman/control.py
index 42d75efbcd..e9d48df030 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -12,7 +12,7 @@ import sys
 import tools
 
 import command
-import fdt_select
+import fdt
 import fdt_util
 from image import Image
 import tout
diff --git a/tools/binman/etype/u_boot_dtb_with_ucode.py 
b/tools/binman/etype/u_boot_dtb_with_ucode.py
index 01ee36fb0d..a384a759c4 100644
--- a/tools/binman/etype/u_boot_dtb_with_ucode.py
+++ b/tools/binman/etype/u_boot_dtb_with_ucode.py
@@ -6,7 +6,7 @@
 # Entry-type module for U-Boot device tree with the microcode removed
 #
 
-import fdt_select
+import fdt
 from entry import Entry
 from blob import Entry_blob
 import tools
diff --git a/tools/binman/fdt_test.py b/tools/binman/fdt_test.py
index df2b0a6af7..249a9ea388 100644
--- a/tools/binman/fdt_test.py
+++ b/tools/binman/fdt_test.py
@@ -12,7 +12,7 @@ import tempfile
 import unittest
 
 import fdt
-from fdt_select import FdtScan
+from fdt import FdtScan
 import fdt_util
 import tools
 
diff --git a/tools/binman/func_test.py b/tools/binman/func_test.py
index 8960e23f2c..8b4db41659 100644
--- a/tools/binman/func_test.py
+++ b/tools/binman/func_test.py
@@ -21,7 +21,7 @@ import cmdline
 import command
 import control
 import entry
-import fdt_select
+import fdt
 import fdt_util
 import tools
 import tout
diff --git a/tools/dtoc/dtoc.py b/tools/dtoc/dtoc.py
index afc5171c2a..4b10e5e0f0 100755
--- a/tools/dtoc/dtoc.py
+++ b/tools/dtoc/dtoc.py
@@ -17,7 +17,6 @@ our_path = os.path.dirname(os.path.realpath(__file__))
 sys.path.append(os.path.join(our_path, '../patman'))
 
 import fdt
-import fdt_select
 import fdt_util
 
 # When we see these properties we ignore them - i.e. do not create a structure 
member
@@ -170,7 +169,7 @@ class DtbPlatdata:
 Once this is done, self.fdt.GetRoot() can be called to obtain the
 device tree root node, and progress from there.
 """
-self.fdt = fdt_select.FdtScan(self._dtb_fname)
+self.fdt = fdt.FdtScan(self._dtb_fname)
 
 def ScanNode(self, root):
 for node in root.subnodes:
diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py
index bff31d1c92..63a32ea2d7 100644
--- a/tools/dtoc/fdt.py
+++ b/tools/dtoc/fdt.py
@@ -14,8 +14,8 @@ import libfdt
 
 # This deals with a device tree, presenting it as an assortment of Node and
 # Prop objects, representing nodes and properties, respectively. This file
-# contains the base classes and defines the high-level API. See fdt_select.py
-# for how to create an Fdt object.
+# contains the base classes and defines the high-level API. You can use
+# FdtScan() as a convenience function to create and scan an Fdt.
 
 # This implementation uses a libfdt Python library to access the device tree,
 # so it is fairly efficient.
@@ -400,3 +400,9 @@ class Fdt:
 """
 node = Node(fdt, offset, name, path)
 return node
+
+def FdtScan(fname):
+"""Returns a new Fdt object from the implementation we are using"""
+dtb = Fdt(fname)
+dtb.Scan()
+return dtb
diff --git a/tools/dtoc/fdt_select.py b/tools/dtoc/fdt_select.py
deleted file mode 100644
index d6337ea227..00
--- a/tools/dtoc/fdt_select.py
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright (C) 2016 Google, Inc
-# Written by Simon Glass 
-#
-# SPDX-License-Identifier:  GPL-2.0+
-#
-
-# Bring in the normal fdt library (which relies on libfdt)
-import fdt
-
-def FdtScan(fname):
-"""Returns a new Fdt object from the implementation we are using"""
-dtb = fdt.Fdt(fname)
-dtb.Scan()
-return dtb
-- 
2.12.2.762.g0e3151a226-goog

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


[U-Boot] [PATCH 09/19] fdt: Update fdt_test to use 'dt' instead of 'fdt'

2017-04-16 Thread Simon Glass
Since fdt is a module it conflicts with this variable name and prevents it
being used in tests. Rename the variable.

Signed-off-by: Simon Glass 
---

 tools/binman/fdt_test.py | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/tools/binman/fdt_test.py b/tools/binman/fdt_test.py
index 1d9494e52f..12edeaba6c 100644
--- a/tools/binman/fdt_test.py
+++ b/tools/binman/fdt_test.py
@@ -28,21 +28,21 @@ class TestFdt(unittest.TestCase):
 def GetCompiled(self, fname):
 return fdt_util.EnsureCompiled(self.TestFile(fname))
 
-def _DeleteProp(self, fdt):
-node = fdt.GetNode('/microcode/update@0')
+def _DeleteProp(self, dt):
+node = dt.GetNode('/microcode/update@0')
 node.DeleteProp('data')
 
 def testFdtNormal(self):
 fname = self.GetCompiled('34_x86_ucode.dts')
-fdt = FdtScan(fname)
-self._DeleteProp(fdt)
+dt = FdtScan(fname)
+self._DeleteProp(dt)
 
 def testFdtFallback(self):
 fname = self.GetCompiled('34_x86_ucode.dts')
-fdt = FdtScan(fname, True)
-fdt.GetProp('/microcode/update@0', 'data')
+dt = FdtScan(fname, True)
+dt.GetProp('/microcode/update@0', 'data')
 self.assertEqual('fred',
-fdt.GetProp('/microcode/update@0', 'none', default='fred'))
+dt.GetProp('/microcode/update@0', 'none', default='fred'))
 self.assertEqual('12345678 12345679',
-fdt.GetProp('/microcode/update@0', 'data', typespec='x'))
-self._DeleteProp(fdt)
+dt.GetProp('/microcode/update@0', 'data', typespec='x'))
+self._DeleteProp(dt)
-- 
2.12.2.762.g0e3151a226-goog

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


[U-Boot] [PATCH 10/19] fdt: dtoc: Add a full set of property tests

2017-04-16 Thread Simon Glass
The tests don't currently cover all the different property types. Add a
new test which checks each property type in turn, to make sure each has
the correct type and value.

Signed-off-by: Simon Glass 
---

 tools/binman/fdt_test.py   | 46 ++
 tools/binman/test/45_prop_test.dts | 23 +++
 2 files changed, 69 insertions(+)
 create mode 100644 tools/binman/test/45_prop_test.dts

diff --git a/tools/binman/fdt_test.py b/tools/binman/fdt_test.py
index 12edeaba6c..65fb947386 100644
--- a/tools/binman/fdt_test.py
+++ b/tools/binman/fdt_test.py
@@ -11,6 +11,7 @@ import sys
 import tempfile
 import unittest
 
+import fdt
 from fdt_select import FdtScan
 import fdt_util
 import tools
@@ -37,6 +38,51 @@ class TestFdt(unittest.TestCase):
 dt = FdtScan(fname)
 self._DeleteProp(dt)
 
+def testFdtNormalProp(self):
+fname = self.GetCompiled('45_prop_test.dts')
+dt = FdtScan(fname)
+node = dt.GetNode('/binman/intel-me')
+self.assertEquals('intel-me', node.name)
+val = fdt_util.GetString(node, 'filename')
+self.assertEquals(str, type(val))
+self.assertEquals('me.bin', val)
+
+prop = node.props['intval']
+self.assertEquals(fdt.TYPE_INT, prop.type)
+self.assertEquals(3, fdt_util.GetInt(node, 'intval'))
+
+prop = node.props['intarray']
+self.assertEquals(fdt.TYPE_INT, prop.type)
+self.assertEquals(list, type(prop.value))
+self.assertEquals(2, len(prop.value))
+self.assertEquals([5, 6],
+  [fdt_util.fdt32_to_cpu(val) for val in prop.value])
+
+prop = node.props['byteval']
+self.assertEquals(fdt.TYPE_BYTE, prop.type)
+self.assertEquals(chr(8), prop.value)
+
+prop = node.props['bytearray']
+self.assertEquals(fdt.TYPE_BYTE, prop.type)
+self.assertEquals(list, type(prop.value))
+self.assertEquals(str, type(prop.value[0]))
+self.assertEquals(3, len(prop.value))
+self.assertEquals([chr(1), '#', '4'], prop.value)
+
+prop = node.props['longbytearray']
+self.assertEquals(fdt.TYPE_INT, prop.type)
+self.assertEquals(0x090a0b0c, fdt_util.GetInt(node, 'longbytearray'))
+
+prop = node.props['stringval']
+self.assertEquals(fdt.TYPE_STRING, prop.type)
+self.assertEquals('message2', fdt_util.GetString(node, 'stringval'))
+
+prop = node.props['stringarray']
+self.assertEquals(fdt.TYPE_STRING, prop.type)
+self.assertEquals(list, type(prop.value))
+self.assertEquals(3, len(prop.value))
+self.assertEquals(['another', 'multi-word', 'message'], prop.value)
+
 def testFdtFallback(self):
 fname = self.GetCompiled('34_x86_ucode.dts')
 dt = FdtScan(fname, True)
diff --git a/tools/binman/test/45_prop_test.dts 
b/tools/binman/test/45_prop_test.dts
new file mode 100644
index 00..d22e460d29
--- /dev/null
+++ b/tools/binman/test/45_prop_test.dts
@@ -0,0 +1,23 @@
+/dts-v1/;
+
+/ {
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   binman {
+   sort-by-pos;
+   end-at-4gb;
+   size = <16>;
+   intel-me {
+   filename = "me.bin";
+   pos-unset;
+   intval = <3>;
+   intarray = <5 6>;
+   byteval = [08];
+   bytearray = [01 23 34];
+   longbytearray = [09 0a 0b 0c];
+   stringval = "message2";
+   stringarray = "another", "multi-word", "message";
+   };
+   };
+};
-- 
2.12.2.762.g0e3151a226-goog

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


[U-Boot] [PATCH 07/19] fdt: Rename existing python libfdt module

2017-04-16 Thread Simon Glass
Now that this module has been accepted upstream we should stop using the
local U-Boot one. In preparation for this, rename it to indicate it is for
legacy use.

Signed-off-by: Simon Glass 
---

 lib/libfdt/{libfdt.swig => libfdt_legacy.swig} |  3 +--
 lib/libfdt/setup.py|  6 +++---
 tools/Makefile | 11 ++-
 tools/dtoc/fdt_normal.py   |  2 +-
 4 files changed, 11 insertions(+), 11 deletions(-)
 rename lib/libfdt/{libfdt.swig => libfdt_legacy.swig} (98%)

diff --git a/lib/libfdt/libfdt.swig b/lib/libfdt/libfdt_legacy.swig
similarity index 98%
rename from lib/libfdt/libfdt.swig
rename to lib/libfdt/libfdt_legacy.swig
index b24c72b1a2..9880dd998e 100644
--- a/lib/libfdt/libfdt.swig
+++ b/lib/libfdt/libfdt_legacy.swig
@@ -1,5 +1,4 @@
-/* File: libfdt.i */
-%module libfdt
+%module libfdt_legacy
 
 %{
 #define SWIG_FILE_WITH_INIT
diff --git a/lib/libfdt/setup.py b/lib/libfdt/setup.py
index 845a0c2b10..fc881351c6 100644
--- a/lib/libfdt/setup.py
+++ b/lib/libfdt/setup.py
@@ -22,17 +22,17 @@ else:
 cflags = None
 
 libfdt_module = Extension(
-'_libfdt',
+'_libfdt_legacy',
 sources = files,
 extra_compile_args =  cflags
 )
 
 sys.argv = [progname, '--quiet', 'build_ext', '--inplace', '--force']
 
-setup (name = 'libfdt',
+setup (name = 'libfdt_legaacy',
version = '0.1',
author  = "SWIG Docs",
description = """Simple swig libfdt from docs""",
ext_modules = [libfdt_module],
-   py_modules = ["libfdt"],
+   py_modules = ["libfdt_legacy"],
)
diff --git a/tools/Makefile b/tools/Makefile
index dadc75b912..cd08d3b33b 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -117,16 +117,17 @@ fit_check_sign-objs   := $(dumpimage-mkimage-objs) 
fit_check_sign.o
 # Build a libfdt Python module if swig is available
 # Use 'sudo apt-get install swig libpython-dev' to enable this
 hostprogs-y += \
-   $(if $(shell which swig 2> /dev/null),_libfdt.so)
-_libfdt.so-sharedobjs += $(LIBFDT_OBJS)
+   $(if $(shell which swig 2> /dev/null),_libfdt_legacy.so)
+_libfdt_legacy.so-sharedobjs += $(LIBFDT_OBJS)
 libfdt:
 
-tools/_libfdt.so: $(patsubst %.o,%.c,$(LIBFDT_OBJS)) tools/libfdt_wrap.c
+tools/_libfdt_legacy.so: $(patsubst %.o,%.c,$(LIBFDT_OBJS)) \
+   tools/libfdt_legacy_wrap.c
LDFLAGS="$(HOSTLDFLAGS)" CFLAGS= ${PYTHON} 
$(srctree)/lib/libfdt/setup.py \
"$(_hostc_flags)" $^
-   mv _libfdt.so $@
+   mv _libfdt_legacy.so $@
 
-tools/libfdt_wrap.c: $(srctree)/lib/libfdt/libfdt.swig
+tools/libfdt_legacy_wrap.c: $(srctree)/lib/libfdt/libfdt_legacy.swig
swig -python -o $@ $<
 
 # TODO(s...@chromium.org): Is this correct on Mac OS?
diff --git a/tools/dtoc/fdt_normal.py b/tools/dtoc/fdt_normal.py
index cce5c06d8c..17b0a9a726 100644
--- a/tools/dtoc/fdt_normal.py
+++ b/tools/dtoc/fdt_normal.py
@@ -12,7 +12,7 @@ import sys
 import fdt
 from fdt import Fdt, NodeBase, PropBase
 import fdt_util
-import libfdt
+import libfdt_legacy as libfdt
 
 # This deals with a device tree, presenting it as a list of Node and Prop
 # objects, representing nodes and properties, respectively.
-- 
2.12.2.762.g0e3151a226-goog

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


[U-Boot] [PATCH 03/19] fdt: Use SPDX format for licenses in the libfdt headers

2017-04-16 Thread Simon Glass
These should follow the UBoot standard. Update them.

Signed-off-by: Simon Glass 
---

 include/fdt.h| 46 +-
 include/libfdt.h | 46 +-
 2 files changed, 2 insertions(+), 90 deletions(-)

diff --git a/include/fdt.h b/include/fdt.h
index 526aedb515..3134d78332 100644
--- a/include/fdt.h
+++ b/include/fdt.h
@@ -5,51 +5,7 @@
  * Copyright (C) 2006 David Gibson, IBM Corporation.
  * Copyright 2012 Kim Phillips, Freescale Semiconductor.
  *
- * libfdt is dual licensed: you can use it either under the terms of
- * the GPL, or the BSD license, at your option.
- *
- *  a) This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
- *
- * Alternatively,
- *
- *  b) Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- *
- * 1. Redistributions of source code must retain the above
- *copyright notice, this list of conditions and the following
- *disclaimer.
- * 2. Redistributions in binary form must reproduce the above
- *copyright notice, this list of conditions and the following
- *disclaimer in the documentation and/or other materials
- *provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * SPDX-License-Identifier: GPL-2.0+ BSD-2-Clause
  */
 
 #ifndef __ASSEMBLY__
diff --git a/include/libfdt.h b/include/libfdt.h
index e2bc2e00c1..6d33065e80 100644
--- a/include/libfdt.h
+++ b/include/libfdt.h
@@ -4,51 +4,7 @@
  * libfdt - Flat Device Tree manipulation
  * Copyright (C) 2006 David Gibson, IBM Corporation.
  *
- * libfdt is dual licensed: you can use it either under the terms of
- * the GPL, or the BSD license, at your option.
- *
- *  a) This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
- *
- * Alternatively,
- *
- *  b) Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- *
- * 1. Redistributions of source code must retain the above
- *copyright notice, this list of conditions and the following
- *disclaimer.
- * 2. Redistributions in binary form must reproduce the above
- *copyright notice, this list of conditions and the following
- *disclaimer in the documentation and/or other materials
- *provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A 

[U-Boot] [PATCH 16/19] binman: Drop a special case related to fdt_fallback

2017-04-16 Thread Simon Glass
Previously we were sometimes forced to collate x86 microcode due to not
having access to the offset of each individual piece. Now that we never
use fdt_fallback, we don't have this problem. Drop this special case from
the code.

Signed-off-by: Simon Glass 
---

 tools/binman/etype/u_boot_dtb_with_ucode.py | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/tools/binman/etype/u_boot_dtb_with_ucode.py 
b/tools/binman/etype/u_boot_dtb_with_ucode.py
index fc02c67c14..95405c6473 100644
--- a/tools/binman/etype/u_boot_dtb_with_ucode.py
+++ b/tools/binman/etype/u_boot_dtb_with_ucode.py
@@ -57,17 +57,12 @@ class Entry_u_boot_dtb_with_ucode(Entry_blob):
 data_prop = node.props.get('data')
 if data_prop:
 self.ucode_data += ''.join(data_prop.bytes)
-if not self.collate:
-poffset = data_prop.GetOffset()
-if poffset is None:
-# We cannot obtain a property offset. Collate instead.
-self.collate = True
-else:
-# Find the offset in the device tree of the ucode data
-self.ucode_offset = poffset + 12
-self.ucode_size = len(data_prop.bytes)
 if self.collate:
 prop = node.DeleteProp('data')
+else:
+# Find the offset in the device tree of the ucode data
+self.ucode_offset = data_prop.GetOffset() + 12
+self.ucode_size = len(data_prop.bytes)
 if self.collate:
 fdt.Pack()
 fdt.Flush()
-- 
2.12.2.762.g0e3151a226-goog

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


[U-Boot] [PATCH 05/19] fdt: Allow swig options to be provided by Makefile

2017-04-16 Thread Simon Glass
U-Boot needs to provide some swig include directories. Add this feature.

Signed-off-by: Simon Glass 
---

 lib/libfdt/pylibfdt/setup.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libfdt/pylibfdt/setup.py b/lib/libfdt/pylibfdt/setup.py
index 38a844cb6d..daf1089425 100755
--- a/lib/libfdt/pylibfdt/setup.py
+++ b/lib/libfdt/pylibfdt/setup.py
@@ -97,12 +97,12 @@ files = os.environ.get('SOURCES', '').split()
 cflags = os.environ.get('CPPFLAGS', '').split()
 objdir = os.environ.get('OBJDIR')
 version = os.environ.get('VERSION')
-swig_opts = []
+swig_opts = os.environ.get('SWIG_OPTS', '').split()
 
 # If we were called directly rather than through our Makefile (which is often
 # the case with Python module installation), read the settings from the
 # Makefile.
-if not all((version, files, cflags, objdir)):
+if not all((swig_opts, version, files, cflags, objdir)):
 swig_opts, version, files, cflags, objdir = GetEnvFromMakefiles()
 
 libfdt_module = Extension(
-- 
2.12.2.762.g0e3151a226-goog

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


[U-Boot] [PATCH 06/19] fdt: Add all source files to the libfdt build

2017-04-16 Thread Simon Glass
At present only a subset of source files are build. Add the rest and
refactor this so that a source file list is available also. This will be
used in later commit.

Signed-off-by: Simon Glass 
---

 tools/Makefile | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 2fc4a583d4..dadc75b912 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -60,9 +60,11 @@ hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info fit_check_sign
 
 FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := common/image-sig.o
 # Flattened device tree objects
-LIBFDT_OBJS := $(addprefix lib/libfdt/, \
-   fdt.o fdt_ro.o fdt_rw.o fdt_strerror.o fdt_wip.o \
-   fdt_region.o fdt_sw.o)
+LIBFDT_CSRCS := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c  \
+   fdt_empty_tree.c fdt_addresses.c fdt_overlay.c \
+   fdt_region.c
+LIBFDT_OBJS := $(addprefix lib/libfdt/, $(patsubst %.c, %.o, $(LIBFDT_CSRCS)))
+
 RSA_OBJS-$(CONFIG_FIT_SIGNATURE) := $(addprefix lib/rsa/, \
rsa-sign.o rsa-verify.o rsa-checksum.o \
rsa-mod-exp.o)
-- 
2.12.2.762.g0e3151a226-goog

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


[U-Boot] [PATCH 14/19] fdt: Drop use of the legacy libfdt python module

2017-04-16 Thread Simon Glass
Now that this is no-longer available, stop looking for it. The new module
will be used if available.

Signed-off-by: Simon Glass 
---

 tools/dtoc/fdt_normal.py | 32 
 1 file changed, 8 insertions(+), 24 deletions(-)

diff --git a/tools/dtoc/fdt_normal.py b/tools/dtoc/fdt_normal.py
index e793f49fa8..a0e58a4464 100644
--- a/tools/dtoc/fdt_normal.py
+++ b/tools/dtoc/fdt_normal.py
@@ -12,12 +12,7 @@ import sys
 import fdt
 from fdt import Fdt, NodeBase, PropBase
 import fdt_util
-try:
-import libfdt
-legacy = False
-except ImportError:
-import libfdt_legacy as libfdt
-legacy = True
+import libfdt
 
 
 # This deals with a device tree, presenting it as a list of Node and Prop
@@ -92,10 +87,7 @@ class Node(NodeBase):
 offset = libfdt.fdt_first_subnode(self._fdt.GetFdt(), self.Offset())
 while offset >= 0:
 sep = '' if self.path[-1] == '/' else '/'
-if legacy:
-name = libfdt.Name(self._fdt.GetFdt(), offset)
-else:
-name = self._fdt._fdt_obj.get_name(offset)
+name = self._fdt._fdt_obj.get_name(offset)
 path = self.path + sep + name
 node = Node(self._fdt, offset, name, path)
 self.subnodes.append(node)
@@ -148,8 +140,7 @@ class FdtNormal(Fdt):
 
 with open(self._fname) as fd:
 self._fdt = bytearray(fd.read())
-if not legacy:
-self._fdt_obj = libfdt.Fdt(self._fdt)
+self._fdt_obj = libfdt.Fdt(self._fdt)
 
 def GetFdt(self):
 """Get the contents of the FDT
@@ -186,18 +177,11 @@ class FdtNormal(Fdt):
 props_dict = {}
 poffset = libfdt.fdt_first_property_offset(self._fdt, node._offset)
 while poffset >= 0:
-if legacy:
-dprop, plen = libfdt.fdt_get_property_by_offset(self._fdt,
-poffset)
-prop = Prop(node, poffset,
-libfdt.String(self._fdt, dprop.nameoff),
-libfdt.Data(dprop))
-else:
-p = self._fdt_obj.get_property_by_offset(poffset)
-prop = Prop(node, poffset, p.name, p.value)
-props_dict[prop.name] = prop
-
-poffset = libfdt.fdt_next_property_offset(self._fdt, poffset)
+p = self._fdt_obj.get_property_by_offset(poffset)
+prop = Prop(node, poffset, p.name, p.value)
+props_dict[prop.name] = prop
+
+poffset = libfdt.fdt_next_property_offset(self._fdt, poffset)
 return props_dict
 
 def Invalidate(self):
-- 
2.12.2.762.g0e3151a226-goog

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


[U-Boot] [PATCH 17/19] fdt: Merge fdt_normal with its base class

2017-04-16 Thread Simon Glass
Since we only have one Fdt implementation now we don't need to have a base
class. Merge the implementation and the base class together.

Signed-off-by: Simon Glass 
---

 tools/dtoc/fdt.py| 176 +++-
 tools/dtoc/fdt_normal.py | 226 ---
 tools/dtoc/fdt_select.py |   8 +-
 3 files changed, 157 insertions(+), 253 deletions(-)
 delete mode 100644 tools/dtoc/fdt_normal.py

diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py
index dedd3d7501..bff31d1c92 100644
--- a/tools/dtoc/fdt.py
+++ b/tools/dtoc/fdt.py
@@ -10,12 +10,15 @@ import struct
 import sys
 
 import fdt_util
+import libfdt
 
 # This deals with a device tree, presenting it as an assortment of Node and
 # Prop objects, representing nodes and properties, respectively. This file
-# contains the base classes and defines the high-level API. Most of the
-# implementation is in the FdtNormal subclass. See fdt_select.py for how to
-# create an Fdt object.
+# contains the base classes and defines the high-level API. See fdt_select.py
+# for how to create an Fdt object.
+
+# This implementation uses a libfdt Python library to access the device tree,
+# so it is fairly efficient.
 
 # A list of types we support
 (TYPE_BYTE, TYPE_INT, TYPE_STRING, TYPE_BOOL) = range(4)
@@ -25,7 +28,7 @@ def CheckErr(errnum, msg):
 raise ValueError('Error %d: %s: %s' %
 (errnum, libfdt.fdt_strerror(errnum), msg))
 
-class PropBase:
+class Prop:
 """A device tree property
 
 Properties:
@@ -34,11 +37,17 @@ class PropBase:
 bytes
 type: Value type
 """
-def __init__(self, node, offset, name):
+def __init__(self, node, offset, name, bytes):
 self._node = node
 self._offset = offset
 self.name = name
 self.value = None
+self.bytes = str(bytes)
+if not bytes:
+self.type = TYPE_BOOL
+self.value = True
+return
+self.type, self.value = self.BytesToValue(bytes)
 
 def GetPhandle(self):
 """Get a (single) phandle value from a property
@@ -148,15 +157,12 @@ class PropBase:
 def GetOffset(self):
 """Get the offset of a property
 
-This can be implemented by subclasses.
-
 Returns:
-The offset of the property (struct fdt_property) within the
-file, or None if not known.
+The offset of the property (struct fdt_property) within the file
 """
-return None
+return self._node._fdt.GetStructOffset(self._offset)
 
-class NodeBase:
+class Node:
 """A device tree node
 
 Properties:
@@ -189,25 +195,65 @@ class NodeBase:
 return subnode
 return None
 
+def Offset(self):
+"""Returns the offset of a node, after checking the cache
+
+This should be used instead of self._offset directly, to ensure that
+the cache does not contain invalid offsets.
+"""
+self._fdt.CheckCache()
+return self._offset
+
 def Scan(self):
-"""Scan the subnodes of a node
+"""Scan a node's properties and subnodes
+
+This fills in the props and subnodes properties, recursively
+searching into subnodes so that the entire tree is built.
+"""
+self.props = self._fdt.GetProps(self)
+
+offset = libfdt.fdt_first_subnode(self._fdt.GetFdt(), self.Offset())
+while offset >= 0:
+sep = '' if self.path[-1] == '/' else '/'
+name = self._fdt._fdt_obj.get_name(offset)
+path = self.path + sep + name
+node = Node(self._fdt, offset, name, path)
+self.subnodes.append(node)
 
-This should be implemented by subclasses
+node.Scan()
+offset = libfdt.fdt_next_subnode(self._fdt.GetFdt(), offset)
+
+def Refresh(self, my_offset):
+"""Fix up the _offset for each node, recursively
+
+Note: This does not take account of property offsets - these will not
+be updated.
 """
-raise NotImplementedError()
+if self._offset != my_offset:
+#print '%s: %d -> %d\n' % (self.path, self._offset, my_offset)
+self._offset = my_offset
+offset = libfdt.fdt_first_subnode(self._fdt.GetFdt(), self._offset)
+for subnode in self.subnodes:
+subnode.Refresh(offset)
+offset = libfdt.fdt_next_subnode(self._fdt.GetFdt(), offset)
 
 def DeleteProp(self, prop_name):
 """Delete a property of a node
 
-This should be implemented by subclasses
+The property is deleted and the offset cache is invalidated.
 
 Args:
 prop_name: Name of the property to delete
+Raises:
+ValueError if the property does not exist
 """
-raise NotImplementedError()
+CheckErr(libfdt.fdt_delprop(self._fdt.GetFdt(), self.Offset(), 

[U-Boot] [PATCH 12/19] fdt: Makefile: Build python libfdt library if needed

2017-04-16 Thread Simon Glass
This is needed by binman and dtoc, so if those are being used, check that
the library is present and complain if not.

This means that the fallback library (which uses fdtget) will not be used
anymore and swig will need to be installed to use binman / dtoc.

This affects any board which uses binman (currently sunxi and x86) or dtoc
(anything that uses CONFIG_SPL_OF_PLATDATA, currently some rockchip
boards).

Signed-off-by: Simon Glass 
---

 Makefile | 16 ++--
 scripts/Makefile.spl | 17 +
 2 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 8d4e6050b3..7bedc0f167 100644
--- a/Makefile
+++ b/Makefile
@@ -1094,7 +1094,7 @@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \
 
 u-boot.rom: u-boot-x86-16bit.bin u-boot.bin \
$(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \
-   $(if $(CONFIG_HAVE_REFCODE),refcode.bin) FORCE
+   $(if $(CONFIG_HAVE_REFCODE),refcode.bin) checkbinman FORCE
$(call if_changed,binman)
 
 OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec
@@ -1103,7 +1103,8 @@ u-boot-x86-16bit.bin: u-boot FORCE
 endif
 
 ifneq ($(CONFIG_ARCH_SUNXI),)
-u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE
+u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb \
+   checkbinman FORCE
$(call if_changed,binman)
 endif
 
@@ -1332,6 +1333,17 @@ $(version_h): include/config/uboot.release FORCE
 $(timestamp_h): $(srctree)/Makefile FORCE
$(call filechk,timestamp.h)
 
+checkbinman: tools
+   @if ! ( echo 'import libfdt' | ( PYTHONPATH=tools python )); then \
+   echo '*** binman needs the Python libfdt library. Either '; \
+   echo '*** install it on your system, or try:'; \
+   echo '***'; \
+   echo '*** sudo apt-get install swig libpython-dev'; \
+   echo '***'; \
+   echo '*** to have U-Boot build its own version.'; \
+   false; \
+   fi
+
 # ---
 quiet_cmd_cpp_lds = LDS $@
 cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) \
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index eb24292fec..92ff2ff831 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -257,14 +257,12 @@ PHONY += dts_dir
 dts_dir:
$(shell [ -d $(obj)/dts ] || mkdir -p $(obj)/dts)
 
-include/generated/dt-structs.h: $(obj)/$(SPL_BIN).dtb dts_dir dtoc
+include/generated/dt-structs.h: $(obj)/$(SPL_BIN).dtb dts_dir checkdtoc
$(call if_changed,dtoch)
 
-$(obj)/dts/dt-platdata.c: $(obj)/$(SPL_BIN).dtb dts_dir dtoc
+$(obj)/dts/dt-platdata.c: $(obj)/$(SPL_BIN).dtb dts_dir checkdtoc
$(call if_changed,dtocc)
 
-dtoc: #$(objtree)/tools/_libfdt.so
-
 ifdef CONFIG_SAMSUNG
 ifdef CONFIG_VAR_SIZE_SPL
 VAR_SIZE_PARAM = --vs
@@ -356,6 +354,17 @@ ifneq ($(cmd_files),)
   include $(cmd_files)
 endif
 
+checkdtoc: tools
+   @if ! ( echo 'import libfdt' | ( PYTHONPATH=tools python )); then \
+   echo '*** dtoc needs the Python libfdt library. Either '; \
+   echo '*** install it on your system, or try:'; \
+   echo '***'; \
+   echo '*** sudo apt-get install swig libpython-dev'; \
+   echo '***'; \
+   echo '*** to have U-Boot build its own version.'; \
+   false; \
+   fi
+
 PHONY += FORCE
 FORCE:
 
-- 
2.12.2.762.g0e3151a226-goog

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


[U-Boot] [PATCH 02/19] fdt: Correct cast for sandbox in fdtdec_setup_memory_size()

2017-04-16 Thread Simon Glass
This gives a warning with some native compilers:

lib/fdtdec.c:1203:8: warning: format ‘%llx’ expects argument of type
   ‘long long unsigned int’, but argument 3 has type
   ‘long unsigned int’ [-Wformat=]

Fix it with a cast.

Signed-off-by: Simon Glass 
---

 lib/fdtdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 94372cc6cd..6f2588c0c4 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -1200,7 +1200,8 @@ int fdtdec_setup_memory_size(void)
}
 
gd->ram_size = (phys_size_t)(res.end - res.start + 1);
-   debug("%s: Initial DRAM size %llx\n", __func__, (u64)gd->ram_size);
+   debug("%s: Initial DRAM size %llx\n", __func__,
+ (unsigned long long)gd->ram_size);
 
return 0;
 }
-- 
2.12.2.762.g0e3151a226-goog

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


[U-Boot] [PATCH 00/19] fdt: Move to the new upstream pylibfdt library

2017-04-16 Thread Simon Glass
Python libfdt bindings have recently been accepted upstream. While the
internals have changed a fair bit most of the API remains the same. Still,
a few functions are different from how they are used in U-Boot so changes
are needed to make this work.

At present in U-Boot there are two libraries for accessing a device tree
file:

- FdtNormal which uses U-Boot's own Python bindings
- FdtFallback which uses the fdtget command-line utility

The latter is not a great solution: it is fairly slow since the DT is
re-read for every access and it cannot provide DT offsets or packing of
the DT.

In addition, U-Boot now builds the libfdt module if swig is available,
meaning that the fallback module is not used in that case.

Finally, at some point in the future distributions may start packaging the
libfdt Python module and it will be available without U-Boot needing to
build it itself.

Therefore it seems like a good idea to take this opportunity to drop the
fallback module and just require that the Python libfdt bindings be
present (at least if need by the build).

The bindings are needed in two situations:
- When dtoc is used to convert a device tree into C code. This is enabled
by CONFIG_SPL_OF_PLATDATA
- When binman is used to produce a firmware image. This is used on all x86
and sunxi boards at present

This series:
- Plumbs in building the Python libfdt module to the U-Boot build system
- Ensures that the module is always built if needed, print an error if
swig is not available (and thus the module cannot be built)
- Allows use of a libfdt.py module already installed on the machine
- Drops the FdtFallback support
- Moves fdt.h and libfdt.h into lib/libfdt to aid with syncing with
upstream, building the Python bindings and to keep the code together
- Merges Fdt and FdtNormal to simplify the code
- Adjusts the Fdt library to work with the new libfdt module
- Adds a few more tests to check access to properties in the DT
- Adjusts binman and dtoc to work with the new approach

It should be possible to easily sync libfdt's Python bindings with U-Boot
in the future, as development there proceeds.


Simon Glass (19):
  pci: Correct cast for sandbox
  fdt: Correct cast for sandbox in fdtdec_setup_memory_size()
  fdt: Use SPDX format for licenses in the libfdt headers
  fdt: Move header files into lib/libfdt
  fdt: Allow swig options to be provided by Makefile
  fdt: Add all source files to the libfdt build
  fdt: Rename existing python libfdt module
  fdt: Build the new python libfdt module
  fdt: Update fdt_test to use 'dt' instead of 'fdt'
  fdt: dtoc: Add a full set of property tests
  fdt: Support use of the new python libfdt library
  fdt: Makefile: Build python libfdt library if needed
  fdt: Stop building the old python libfdt module
  fdt: Drop use of the legacy libfdt python module
  fdt: Drop fdt_fallback library
  binman: Drop a special case related to fdt_fallback
  fdt: Merge fdt_normal with its base class
  binman: Rename fdt variable to dtb
  fdt: Drop fdt_select.py

 Makefile|   16 +-
 cmd/pci.c   |3 +-
 include/fdt.h   |  112 +-
 include/libfdt.h| 2138 +-
 lib/fdtdec.c|3 +-
 lib/libfdt/fdt.h|   67 +
 lib/libfdt/libfdt.h | 2144 +++
 lib/libfdt/libfdt.swig  |  113 --
 lib/libfdt/pylibfdt/setup.py|4 +-
 lib/libfdt/setup.py |   38 -
 scripts/Makefile.spl|   17 +-
 tools/Makefile  |   43 +-
 tools/binman/binman.py  |3 +
 tools/binman/control.py |   12 +-
 tools/binman/etype/u_boot_dtb_with_ucode.py |   24 +-
 tools/binman/fdt_test.py|   64 +-
 tools/binman/func_test.py   |   48 +-
 tools/binman/test/45_prop_test.dts  |   23 +
 tools/dtoc/dtoc.py  |3 +-
 tools/dtoc/fdt.py   |  183 ++-
 tools/dtoc/fdt_fallback.py  |  181 ---
 tools/dtoc/fdt_normal.py|  225 ---
 tools/dtoc/fdt_select.py|   36 -
 23 files changed, 2539 insertions(+), 2961 deletions(-)
 create mode 100644 lib/libfdt/fdt.h
 create mode 100644 lib/libfdt/libfdt.h
 delete mode 100644 lib/libfdt/libfdt.swig
 delete mode 100644 lib/libfdt/setup.py
 create mode 100644 tools/binman/test/45_prop_test.dts
 delete mode 100644 tools/dtoc/fdt_fallback.py
 delete mode 100644 tools/dtoc/fdt_normal.py
 delete mode 100644 tools/dtoc/fdt_select.py

-- 
2.12.2.762.g0e3151a226-goog

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


[U-Boot] [PATCH 01/19] pci: Correct cast for sandbox

2017-04-16 Thread Simon Glass
This gives a warning with some native compilers:

cmd/pci.c:152:11: warning: format ‘%llx’ expects argument of type
   ‘long long unsigned int’, but argument 3 has type
   ‘u64 {aka long unsigned int}’ [-Wformat=]

Fix it with a cast.

Signed-off-by: Simon Glass 
---

 cmd/pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cmd/pci.c b/cmd/pci.c
index 41b4fffcf9..fe27b4f761 100644
--- a/cmd/pci.c
+++ b/cmd/pci.c
@@ -150,7 +150,8 @@ int pci_bar_show(struct udevice *dev)
if ((!is_64 && size_low) || (is_64 && size)) {
size = ~size + 1;
printf(" %d   %#016llx  %#016llx  %d %s   %s\n",
-  bar_id, base, size, is_64 ? 64 : 32,
+  bar_id, (unsigned long long)base,
+  (unsigned long long)size, is_64 ? 64 : 32,
   is_io ? "I/O" : "MEM",
   prefetchable ? "Prefetchable" : "");
}
-- 
2.12.2.762.g0e3151a226-goog

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


Re: [U-Boot] [PATCH v5 00/16] Add Intel Arria 10 SoC support

2017-04-16 Thread Ley Foon Tan
On Thu, Apr 13, 2017 at 10:38 PM, Luc Verhaegen  wrote:
> On Fri, Apr 14, 2017 at 01:41:09AM +0800, Ley Foon Tan wrote:
>>
>
> This is what the mail header says:
>
> Received: by lists.denx.de (Postfix, from userid 105)
> id CF30DC21C35; Thu, 13 Apr 2017 09:41:37 + (UTC)
>
> Add 8h, and you're still on thursday the 13th, but at 17:41.
>
> Please fix your systems clock and use ntp.
>
My system clock is correct. I think it is due to our mail server is at
US timezone.


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


Re: [U-Boot] [PATCH 2/2] Enable PXE boot on meson-gxbb.

2017-04-16 Thread Andreas Färber
Am 17.04.2017 um 00:01 schrieb Vagrant Cascadian:
> Enable distro_bootcmd PXE functions on meson-gxbb systems.
> 
> While DHCP boot is already supported, the format is fairly u-boot
> specific, while PXE boot supports the widely used syslinux style boot
> configuration format.
> 
> Signed-off-by: Vagrant Cascadian 
> ---
> 
>  include/configs/meson-gxbb-common.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/configs/meson-gxbb-common.h 
> b/include/configs/meson-gxbb-common.h
> index c3229ea2cf..0339feaed9 100644
> --- a/include/configs/meson-gxbb-common.h
> +++ b/include/configs/meson-gxbb-common.h
> @@ -41,6 +41,7 @@
>  #define BOOT_TARGET_DEVICES(func) \
>   func(MMC, mmc, 0) \
>   func(MMC, mmc, 1) \
> + func(PXE, pxe, na) \
>   func(DHCP, dhcp, na)
>  
>  #include 

This should go after DHCP as discussed a while ago.
PXE has a lengthy list of fallbacks and I fail to see what is U-Boot
specific about DHCP.

Regards,
Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] Enable MMC boot on meson-gxbb.

2017-04-16 Thread Andreas Färber
Am 17.04.2017 um 00:01 schrieb Vagrant Cascadian:
> This enables booting from microSD and eMMC on odroid-c2 by using the
> distro_bootcmd MMC functions.
> 
> Signed-off-by: Vagrant Cascadian 
> ---
> 
>  include/configs/meson-gxbb-common.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/configs/meson-gxbb-common.h 
> b/include/configs/meson-gxbb-common.h
> index cc2b5b61d4..c3229ea2cf 100644
> --- a/include/configs/meson-gxbb-common.h
> +++ b/include/configs/meson-gxbb-common.h
> @@ -39,6 +39,8 @@
>  #include 
>  
>  #define BOOT_TARGET_DEVICES(func) \
> + func(MMC, mmc, 0) \
> + func(MMC, mmc, 1) \
>   func(DHCP, dhcp, na)
>  
>  #include 

There is already a different patch doing this, and by now adds mmc2 as
well. Please review the pending patches.

Thanks,
Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 2/2] Enable PXE boot on meson-gxbb.

2017-04-16 Thread Vagrant Cascadian
Enable distro_bootcmd PXE functions on meson-gxbb systems.

While DHCP boot is already supported, the format is fairly u-boot
specific, while PXE boot supports the widely used syslinux style boot
configuration format.

Signed-off-by: Vagrant Cascadian 
---

 include/configs/meson-gxbb-common.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/meson-gxbb-common.h 
b/include/configs/meson-gxbb-common.h
index c3229ea2cf..0339feaed9 100644
--- a/include/configs/meson-gxbb-common.h
+++ b/include/configs/meson-gxbb-common.h
@@ -41,6 +41,7 @@
 #define BOOT_TARGET_DEVICES(func) \
func(MMC, mmc, 0) \
func(MMC, mmc, 1) \
+   func(PXE, pxe, na) \
func(DHCP, dhcp, na)
 
 #include 
-- 
2.11.0

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


[U-Boot] [PATCH 1/2] Enable MMC boot on meson-gxbb.

2017-04-16 Thread Vagrant Cascadian
This enables booting from microSD and eMMC on odroid-c2 by using the
distro_bootcmd MMC functions.

Signed-off-by: Vagrant Cascadian 
---

 include/configs/meson-gxbb-common.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/meson-gxbb-common.h 
b/include/configs/meson-gxbb-common.h
index cc2b5b61d4..c3229ea2cf 100644
--- a/include/configs/meson-gxbb-common.h
+++ b/include/configs/meson-gxbb-common.h
@@ -39,6 +39,8 @@
 #include 
 
 #define BOOT_TARGET_DEVICES(func) \
+   func(MMC, mmc, 0) \
+   func(MMC, mmc, 1) \
func(DHCP, dhcp, na)
 
 #include 
-- 
2.11.0

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


[U-Boot] [PATCH 0/2] Enable MMC and PXE boot on meson-gxbb systems.

2017-04-16 Thread Vagrant Cascadian

The first patch enables MMC boot support, and the second enables PXE
boot support.


Vagrant Cascadian (2):
  Enable MMC boot on meson-gxbb.
  Enable PXE boot on meson-gxbb.

 include/configs/meson-gxbb-common.h | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.11.0

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


Re: [U-Boot] [PATCH v7 1/4] arm: dts: update Meson GXBB / Odroid-C2 DT with latest Linux version

2017-04-16 Thread Andreas Färber
Am 16.04.2017 um 21:33 schrieb Simon Glass:
> On 14 April 2017 at 04:27, Heinrich Schuchardt  wrote:
>> As a prerequisite for adding a Meson GX MMC driver update the
>> Meson GXBB / Odroid-C2 device tree in Uboot with the latest
> 
> U-Boot
> 
>> version from Linux.
> 
> It's a good idea to indicate which version (or commit) of Linux

... which I believe I had already pointed out in an earlier version. :(

But another version is merged already.

Regards,
Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] Set ramdisk_addr_r to a higher address location on meson-gxbb.

2017-04-16 Thread Vagrant Cascadian
On 2017-04-12, Vagrant Cascadian wrote:
> On 2017-04-12, Andreas Färber wrote:
>> Am 12.04.2017 um 23:28 schrieb Vagrant Cascadian:
>>> Set ramdisk_addr_r to 0x2000, otherwise it may conflict with
>>> kernel_addr_r location (0x0108) with a moderately large kernel.
> ...
>>> diff --git a/include/configs/meson-gxbb-common.h 
>>> b/include/configs/meson-gxbb-common.h
>>> index cc2b5b61d4..32602cb7c2 100644
>>> --- a/include/configs/meson-gxbb-common.h
>>> +++ b/include/configs/meson-gxbb-common.h
>>> @@ -48,7 +48,7 @@
>>> "scriptaddr=0x1f00\0" \
>>> "kernel_addr_r=0x0108\0" \
>>> "pxefile_addr_r=0x0108\0" \
>>> -   "ramdisk_addr_r=0x1000\0" \
>>> +   "ramdisk_addr_r=0x2000\0" \
>>
>> So that's at 512 MiB. Have you checked for any S905 devices (e.g., TV
>> boxes) with little RAM?
>
> I didn't. I just picked a value out of the air and tried it. :)

The other option is to lower the kernel_addr_r and fdt_addr_r locations,
but I'm not sure how much lower they can get, if at all.


> I just now tested with 0x1200 and it worked, where 0x1000
> consistantly failed.

After some more experimenting, with ramdisk_addr_r=0x1010 it still
fails to load, with ramdisk_addr_r=0x1020 it works, at least with
the current kernel I'm testing with:

=> setenv ramdisk_addr_r 0x1010
=> boot
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
2177 bytes read in 16 ms (132.8 KiB/s)
## Executing script at 1f00
14819840 bytes read in 737 ms (19.2 MiB/s)
16119 bytes read in 38 ms (414.1 KiB/s)
17551127 bytes read in 873 ms (19.2 MiB/s)
Booting Debian 4.11.0-rc6+ from mmc 0:1...
## Flattened Device Tree blob at 0100
   Booting using the fdt blob at 0x100
   Loading Ramdisk to 7ce9c000, end 7df58f17 ... OK
   Loading Device Tree to 7ce95000, end 7ce9bef6 ... OK

Starting kernel ...

And then it just hangs.

The kernel image I'm booting is almost 15MB, uncompressed. I'm guessing
if "booti" would support compressed kernels, this would allieviate the
problem, but it will take some time before that's common (on Debian, at
least).


live well,
  vagrant


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 02/14] sysreset: add syscon-reboot driver

2017-04-16 Thread Simon Glass
Hi Alvaro,

On 15 April 2017 at 16:03, Álvaro Fernández Rojas  wrote:
> Add a new sysreset driver based on linux/drivers/power/reset/syscon-reboot.c,
> which provides a generic driver for platforms that only require writing a mask
> to a regmap offset.
>
> Signed-off-by: Álvaro Fernández Rojas 
> ---
>  v2: no changes
>
>  drivers/sysreset/Kconfig   |  8 +
>  drivers/sysreset/Makefile  |  1 +
>  drivers/sysreset/sysreset_syscon.c | 60 
> ++
>  3 files changed, 69 insertions(+)
>  create mode 100644 drivers/sysreset/sysreset_syscon.c
>
> diff --git a/drivers/sysreset/Kconfig b/drivers/sysreset/Kconfig
> index 05a37b9..0946c9d 100644
> --- a/drivers/sysreset/Kconfig
> +++ b/drivers/sysreset/Kconfig
> @@ -13,4 +13,12 @@ config SYSRESET
>   to effect a reset. The uclass will try all available drivers when
>   reset_walk() is called.
>
> +config SYSRESET_SYSCON
> +   bool "Enable support for mfd syscon reboot driver"
> +   depends on SYSRESET
> +   select REGMAP
> +   select SYSCON
> +   help
> + Description here.

Yes please!

> +
>  endmenu
> diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile
> index 49b8bb6..1205f47 100644
> --- a/drivers/sysreset/Makefile
> +++ b/drivers/sysreset/Makefile
> @@ -18,3 +18,4 @@ obj-$(CONFIG_ARCH_SNAPDRAGON) += sysreset_snapdragon.o
>  obj-$(CONFIG_ARCH_STI) += sysreset_sti.o
>  obj-$(CONFIG_TARGET_XTFPGA) += sysreset_xtfpga.o
>  obj-$(CONFIG_ARCH_ASPEED) += sysreset_ast.o
> +obj-$(CONFIG_SYSRESET_SYSCON) += sysreset_syscon.o
> diff --git a/drivers/sysreset/sysreset_syscon.c 
> b/drivers/sysreset/sysreset_syscon.c
> new file mode 100644
> index 000..61aeb1d
> --- /dev/null
> +++ b/drivers/sysreset/sysreset_syscon.c
> @@ -0,0 +1,60 @@
> +/*
> + * Copyright (C) 2017 Álvaro Fernández Rojas 
> + *
> + * Derived from linux/drivers/power/reset/syscon-reboot.c:
> + * Copyright (C) 2013, Applied Micro Circuits Corporation
> + * Author: Feng Kan 
> + *
> + * SPDX-License-Identifier:GPL-2.0+
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 

this should go at the end

> +#include 
> +#include 
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +static int syscon_reboot_request(struct udevice *dev, enum sysreset_t type)
> +{
> +   struct udevice *syscon;
> +   struct regmap *regmap;
> +   unsigned int offset, mask;
> +   int err;
> +
> +   err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev,
> +  "regmap", );
> +   if (err) {
> +   error("unable to find syscon device\n");
> +   return err;
> +   }
> +
> +   regmap = syscon_get_regmap(syscon);
> +   if (!regmap) {
> +   error("unable to find regmap\n");
> +   return -ENODEV;
> +   }
> +
> +   offset = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev), "offset", 
> 0);
> +   mask = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev), "mask", 0);

You should do this in ofdata_to_platdata() or probe() and store it in
a local struct


> +
> +   return regmap_write(regmap, offset, mask);

Check error here, and either return -EINPROGRESS or some other error

> +}
> +
> +static struct sysreset_ops syscon_reboot_ops = {
> +   .request= syscon_reboot_request,
> +};
> +
> +static const struct udevice_id syscon_reboot_ids[] = {
> +   { .compatible = "syscon-reboot" },
> +   { /* sentinel */ }
> +};
> +
> +U_BOOT_DRIVER(syscon_reboot) = {
> +   .name   = "syscon_reboot",
> +   .id = UCLASS_SYSRESET,
> +   .of_match   = syscon_reboot_ids,
> +   .ops= _reboot_ops,
> +};
> --
> 2.1.4
>

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


Re: [U-Boot] [PATCH] rockchip: rk3399: defconfig: add CONFIG_OF_EMBED support

2017-04-16 Thread Simon Glass
Hi Kever,

On 14 April 2017 at 01:59, Kever Yang  wrote:
> Hi Simon,
>
>
> On 04/11/2017 09:55 PM, Simon Glass wrote:
>>
>> Hi Kever,
>>
>> On 9 April 2017 at 20:36, Kever Yang  wrote:
>>>
>>> Hi Simon,
>>>
>>>
>>> On 04/10/2017 03:28 AM, Simon Glass wrote:

 Hi Kever,

 On 7 April 2017 at 04:35, Kever Yang  wrote:
>
> Need to enablt CONFIG_OF_EMBED if we use separate uboot and dtb
> in FIT image for SPL loading.
>
 Can you please explain that a bit more? We shouldn't OF_EMBED in
 production code, only for debug/test.
>>>
>>>
>>> When I test with latest code for SPL loading FIT which u-boot and dtb
>>> are separate, the U-Boot code can not find its dtb file.
>>> This issue is not happen when I test with code older than v2017.03,
>>> and with CONFIG_OF_EMBED, U-Boot can find dtb with latest code.
>>>
>>> Maybe I need to do some debugging for root cause, please ignore this
>>> patch if this is not correct.
>>
>> Yes this needs to be figured out. If you have the debug UART enabled
>> you should be able to add debugging to fdtdec_setup() to see what is
>> happening. Perhaps the DT is not word-aligned?
>
>
> I find the root cause.
> I try to truncate the input image like uboot-no-dtb.bin and u-boot.dtb to
> block size 512, so the SPL get the image size is 512 aligned,
> but the fdtdec_setup() using the end of image address &_end which is not
> 512 aligned, and can not find available dtb.
>
> I want to make the mkimage output header and input image aligned to
> 512 to reduce no necessary copy.

I still don't really understand this. Can you not use u-boot.bin which
includes both U-Boot and the DT? Then only the alignment of the whole
file matters.

Instead of truncating you should pad - otherwise you lose data. But I
suspect I just misunderstand what you mean.

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


Re: [U-Boot] [PATCH 4/5] rockchip: clk: rk3288: add ciu_clk entry for eMMC/SDMMC/SDIO

2017-04-16 Thread Simon Glass
On 16 April 2017 at 03:44, Ziyuan Xu  wrote:
> The genunie bus clock is sclk_x for eMMC/SDMMC/SDIO, add support for
> it.
>
> Signed-off-by: Ziyuan Xu 
> ---
>
>  drivers/clk/rockchip/clk_rk3288.c | 12 
>  1 file changed, 12 insertions(+)

Acked-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] board: at91sam9263ek: Enable early debug UART

2017-04-16 Thread Simon Glass
On 13 April 2017 at 21:07, Wenyou Yang  wrote:
> Enable the early debug UART to debug problems when an ICE or other
> debug mechanism is not available.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v3:
>  - Rebase on the master branch (22e10be45) of u-boot-dm git tree.
>  - Update the cover-letter
>
> Changes in v2:
>  - Add [PATCH]: board: at91sam9263ek: Enable early debug UART.
>  - Move out [PATCH] ARM: dts: at91: add dts files for at91sam9263ek.
>
>  board/atmel/at91sam9263ek/at91sam9263ek.c | 13 +
>  configs/at91sam9263ek_dataflash_cs0_defconfig |  6 ++
>  configs/at91sam9263ek_dataflash_defconfig |  6 ++
>  configs/at91sam9263ek_nandflash_defconfig |  6 ++
>  configs/at91sam9263ek_norflash_boot_defconfig |  6 ++
>  configs/at91sam9263ek_norflash_defconfig  |  6 ++
>  6 files changed, 43 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/2] rockchip: dts: add rk3399-firefly dts

2017-04-16 Thread Simon Glass
On 12 April 2017 at 03:49, Kever Yang  wrote:
> Firefly-rk3399 is a bord from T-Firefly, you can find detail about
> it here:
> http://en.t-firefly.com/en/firenow/Firefly_RK3399/
>
> This patch add basic node for the board and make it able to bring
> up.
>
> Peripheral/interfaces on board:
> - usb hub which connect to ehci controller;
> - UART2 debug
> - eMMC
> - PCIe
> - USB 3.0 HOST, type-C port
> - sdio, sd-card
> - HDMI
> - Ethernet
> - OPTICAL
> - WiFi/BT
> - MIPI CSI/DSI
> - IR
> - EDP/DP
>
> Signed-off-by: Kever Yang 
> ---
>
>  arch/arm/dts/Makefile   |   1 +
>  arch/arm/dts/rk3399-firefly.dts | 684 
> 
>  2 files changed, 685 insertions(+)
>  create mode 100644 arch/arm/dts/rk3399-firefly.dts

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


Re: [U-Boot] [PATCH v1] i2c: sunxi: add device-model support for i2c

2017-04-16 Thread Simon Glass
Hi,

On 1 March 2017 at 14:34, Philipp Tomsich
 wrote:
> The I2C block in sunxi (Allwinner SoCs) is based on Designware and uses
> the same driver as the Marvell Orion 5x and Kirkwood families.
>
> This change adds a compatible id matching the binding for sunxi
> devices, supports configuring the clocks and to release the module
> reset on sunxi platforms as directed by the device tree.
>
> As we enable DT control of this driver, we need to make sure the
> common config header (sunxi-common.h) does try to turn on support for
> the legacy I2C support.
>
> Signed-off-by: Philipp Tomsich 
> ---
>  drivers/i2c/mvtwsi.c   | 42 
> ++
>  include/configs/sunxi-common.h |  9 ++---
>  2 files changed, 48 insertions(+), 3 deletions(-)

Instead of the #ifdefs can you just rely on the header files doing the
right thing?

>
> diff --git a/drivers/i2c/mvtwsi.c b/drivers/i2c/mvtwsi.c
> index 648a96e..475131b 100644
> --- a/drivers/i2c/mvtwsi.c
> +++ b/drivers/i2c/mvtwsi.c
> @@ -16,6 +16,12 @@
>  #ifdef CONFIG_DM_I2C
>  #include 
>  #endif

Please don't put #ifdefs around header file inclusions.

> +#if defined(CONFIG_CLK)
> +#include 
> +#endif
> +#if defined(CONFIG_DM_RESET)
> +#include 
> +#endif
>
>  DECLARE_GLOBAL_DATA_PTR;
>
> @@ -36,6 +42,12 @@ DECLARE_GLOBAL_DATA_PTR;
>  #endif
>  #endif /* CONFIG_DM_I2C */
>
> +/* On SUNXI, we get CONFIG_SYS_TCLK from this include, so we want to
> +   always have it. */
> +#if defined(CONFIG_DM_I2C) && defined(CONFIG_ARCH_SUNXI)
> +#include 
> +#endif
> +
>  /*
>   * TWSI register structure
>   */
> @@ -81,6 +93,14 @@ struct mvtwsi_i2c_dev {
> uint speed;
> /* The current length of a clock period (depending on speed) */
> uint tick;
> +#if defined(CONFIG_DM_RESET)
> +   bool reset_valid;
> +   struct reset_ctl reset;
> +#endif
> +#if defined(CONFIG_CLK)
> +   bool clk_gate_valid;
> +   struct clk clk_gate;
> +#endif
>  };
>  #endif /* CONFIG_DM_I2C */
>
> @@ -781,6 +801,14 @@ static int mvtwsi_i2c_ofdata_to_platdata(struct udevice 
> *bus)
>"u-boot,i2c-slave-addr", 0x0);
> dev->speed = fdtdec_get_int(gd->fdt_blob, dev_of_offset(bus),
> "clock-frequency", 10);
> +#if defined(CONFIG_DM_RESET)
> +   if (reset_get_by_index(bus, 0, >reset) == 0)
> +   dev->reset_valid = true;
> +#endif
> +#if defined(CONFIG_CLK)
> +   if (clk_get_by_index(bus, 0, >clk_gate) == 0)
> +   dev->clk_gate_valid = true;
> +#endif
> return 0;
>  }
>
> @@ -789,6 +817,17 @@ static int mvtwsi_i2c_probe(struct udevice *bus)
> struct mvtwsi_i2c_dev *dev = dev_get_priv(bus);
> uint actual_speed;
>
> +#if defined(CONFIG_DM_RESET)
> +   /* Enable the controller */
> +   if (dev->reset_valid)
> +   reset_deassert(>reset);
> +#endif
> +#if defined(CONFIG_CLK)
> +   /* Open the clock-gate */
> +   if (dev->clk_gate_valid)
> +   clk_enable(>clk_gate);
> +#endif
> +
> __twsi_i2c_init(dev->base, dev->speed, dev->slaveadd, _speed);
> dev->speed = actual_speed;
> dev->tick = calc_tick(dev->speed);
> @@ -831,6 +870,9 @@ static const struct dm_i2c_ops mvtwsi_i2c_ops = {
>  static const struct udevice_id mvtwsi_i2c_ids[] = {
> { .compatible = "marvell,mv64xxx-i2c", },
> { .compatible = "marvell,mv78230-i2c", },
> +#if defined(CONFIG_ARCH_SUNXI)
> +   { .compatible = "allwinner,sun6i-a31-i2c", },
> +#endif
> { /* sentinel */ }
>  };
>
> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
> index 4f566fa..aaab809 100644
> --- a/include/configs/sunxi-common.h
> +++ b/include/configs/sunxi-common.h
> @@ -262,11 +262,14 @@
>  defined CONFIG_SY8106A_POWER
>  #endif
>
> -#if defined CONFIG_I2C0_ENABLE || defined CONFIG_I2C1_ENABLE || \
> -defined CONFIG_I2C2_ENABLE || defined CONFIG_I2C3_ENABLE || \
> -defined CONFIG_I2C4_ENABLE || defined CONFIG_R_I2C_ENABLE
> +#if !defined(CONFIG_DM_I2C) && \
> +   (defined CONFIG_I2C0_ENABLE || defined CONFIG_I2C1_ENABLE ||\
> +defined CONFIG_I2C2_ENABLE || defined CONFIG_I2C3_ENABLE ||\
> +defined CONFIG_I2C4_ENABLE || defined CONFIG_R_I2C_ENABLE)
>  #define CONFIG_SYS_I2C
> +#if !defined(CONFIG_SYS_I2C_MVTWSI)
>  #define CONFIG_SYS_I2C_MVTWSI
> +#endif
>  #define CONFIG_SYS_I2C_SPEED   40
>  #define CONFIG_SYS_I2C_SLAVE   0x7f
>  #endif
> --
> 1.9.1
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://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 2/2] drivers: omap_hsmmc: move to DM_MMC_OPS

2017-04-16 Thread Simon Glass
On 14 April 2017 at 11:50, Jean-Jacques Hiblot  wrote:
> Signed-off-by: Jean-Jacques Hiblot 
> ---
>  drivers/mmc/Kconfig  |  1 +
>  drivers/mmc/omap_hsmmc.c | 39 ---
>  2 files changed, 33 insertions(+), 7 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 v5 02/16] disk: part: refactor part_print_efi to prepare GPT over MTD

2017-04-16 Thread Simon Glass
On 13 April 2017 at 03:52, Patrick Delaunay  wrote:
> split part_print_efi : create sub-functions part_print_gpt()
>
> Signed-off-by: Patrick Delaunay 
> Reviewed-by: Christophe KERELLO 
> ---
>
> Changes in v5: None
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
>
>  disk/part_efi.c | 55 ++-
>  1 file changed, 30 insertions(+), 25 deletions(-)

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


Re: [U-Boot] [U-Boot PATCH V2 0/9] introduce Rockchip rockusb

2017-04-16 Thread Simon Glass
Hi Eddie,

On 16 April 2017 at 09:54, Eddie Cai  wrote:
> rockusb is a protocol run between host pc and device. it help people get 
> device
> info, flash image to device. this patch implement rockusb on device side.
>
> Eddie Cai (9):
>   usb: ums: split macro and data struct in storage_common.c
>   usb: ums: split macro and data struct in f_mass_storage.c
>   usb: ums: merge storage_common.c into f_mass_storage.c
>   usb: ums: remove static declaration of some ums functions
>   usb: ums: add functions to set and get usb interface descriptor
>   usb: ums: add do_extra_command
>   cmd: add rockusb command
>   rockchip: config: enable rockusb support on rk3288 based board
>   rockusb: add a simple readme
>
>  cmd/Kconfig|   5 +
>  cmd/Makefile   |   1 +
>  cmd/rockusb.c  | 383 
> +
>  configs/evb-rk3288_defconfig   |   2 +
>  configs/fennec-rk3288_defconfig|   1 +
>  configs/firefly-rk3288_defconfig   |   1 +
>  configs/miqi-rk3288_defconfig  |   1 +
>  configs/popmetal-rk3288_defconfig  |   1 +
>  configs/rock2_defconfig|   2 +
>  configs/sandbox_defconfig  |   1 +
>  configs/tinker-rk3288_defconfig|   1 +
>  doc/README.rockusb |  35 ++
>  drivers/usb/gadget/f_mass_storage.c| 356 +--
>  .../storage_common.c => include/f_mass_storage.h   | 296 +---
>  14 files changed, 775 insertions(+), 311 deletions(-)
>  create mode 100644 cmd/rockusb.c
>  create mode 100644 doc/README.rockusb
>  rename drivers/usb/gadget/storage_common.c => include/f_mass_storage.h (65%)
>
> --
> 2.10.2
>

Can you please send a new version with change logs in each patch?

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


Re: [U-Boot] [PATCH v5 16/16] sandbox: GPT over MTD test

2017-04-16 Thread Simon Glass
On 13 April 2017 at 03:52, Patrick Delaunay  wrote:
> activate needed feature in sandbox to allow test GPT over MTD
> - EFI_PARTITION_MTD
> - SPI_FLASH_MTD
> - CMD_MTDPARTS
> - MTD_PARTITIONS
> - MTD_DEVICE
>
> activate 2 features usefull for test
> - RANDOM_UUID
> - PARTITION_TYPE_GUID
>
> Signed-off-by: Patrick Delaunay 
> ---
>
> Changes in v5: None
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
>
>  configs/sandbox_defconfig | 3 +++
>  include/configs/sandbox.h | 6 ++
>  2 files changed, 9 insertions(+)

Reviewed-by: Simon Glass 

Where is the actual test?
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/1] tools/env: avoid memory leak in fw_setenv

2017-04-16 Thread Simon Glass
On 15 April 2017 at 05:05, Heinrich Schuchardt  wrote:
> If realloc fails we should release the old buffer.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
> v2:
>   Initial mail was garbled.
> ---
>  tools/env/fw_env.c | 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


Re: [U-Boot] [RFC 1/1] omap3: incorrect logical check in do_emif4_init

2017-04-16 Thread Simon Glass
On 15 April 2017 at 08:11, Heinrich Schuchardt  wrote:
> ((readl(_base->sdram_iodft_tlgc) & (1<<10)) == 0x01)
> is always false.
> This does not match the comment
> /*Wait till that bit clears*/
>
> The problem was indicated by cppcheck.
>
> I do not have the hardware to test if the code change below
> leads to a correct system behavior.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
>  arch/arm/mach-omap2/omap3/emif4.c | 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] [U-Boot, v7, 3/4] Enable new Meson GX MMC driver in Odroid C2 defconfig.

2017-04-16 Thread Simon Glass
On 14 April 2017 at 04:27, Heinrich Schuchardt  wrote:
> This patch is based on
> [U-Boot,v6,3/3] odroid-c2: enable new Meson GX MMC driver in board defconfig
> by Heiner Kallweit 
>
> CC: Heiner Kallweit 
> Signed-off-by: Heinrich Schuchardt 
> ---
> v7:
> - made applicable to current U-boot master
> v6:
> - no changes
> ---
>  configs/odroid-c2_defconfig | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass 

>
> diff --git a/configs/odroid-c2_defconfig b/configs/odroid-c2_defconfig
> index 2cf5011..00da76e 100644
> --- a/configs/odroid-c2_defconfig
> +++ b/configs/odroid-c2_defconfig
> @@ -14,7 +14,10 @@ CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-odroidc2"
>  # CONFIG_CMD_SETEXPR is not set
>  CONFIG_OF_CONTROL=y
>  CONFIG_NET_RANDOM_ETHADDR=y
> -# CONFIG_MMC is not set
> +CONFIG_MMC=y
> +CONFIG_DM_MMC=y

This should be the default anyway now.

> +CONFIG_MMC_MESON_GX=y
> +CONFIG_CMD_MMC=y
>  CONFIG_DM_ETH=y
>  CONFIG_ETH_DESIGNWARE=y
>  CONFIG_PINCTRL=y
> --
> 2.1.4
>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [RESEND PATCH] rockchip: reserve memory for rk3399 ATF data

2017-04-16 Thread Simon Glass
On 14 April 2017 at 05:03, Kever Yang  wrote:
> There are 3 region used by rk3399 ATF:
> - bl31 code, locate at 0x1;
> - cortex-m0 code and data, locate at 0xff8c;
> - bl31 data, locate at 0xff8c1000 ~ 0xff8c4000;
>
> SPL_TEXT_BASE starts from 0xff8c2000, we need to reserve memory
> for ATF data, or else there will have memory corrupt after SPL
> load ATF image.
>
> More detail about cortex-M0 code in ATF:
> https://github.com/ARM-software/arm-trusted-firmware/commit/
> 8382e17c4c6bffd15119dfce1ee4372e3c1a7890
>
> Signed-off-by: Kever Yang 
> ---
>
>  arch/arm/include/asm/arch-rockchip/boot0.h | 4 
>  1 file changed, 4 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] board: at91sam9n12ek: Enable early debug UART

2017-04-16 Thread Simon Glass
On 13 April 2017 at 20:16, Wenyou Yang  wrote:
> Enable the early debug UART to debug problems when an ICE or other
> debug mechanism is not available.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v3:
>  - Rebase on the master branch (22e10be45) of u-boot-dm git tree.
>  - Update the cover-letter.
>
> Changes in v2:
>  - Use CONFIG_DEBUG_UART_CLOCK as the input clock for the early
>debug UART.
>  - Move out [PATCH 1/4] ARM: dts: at91: add dts files for at91sam9n12ek.
>
>  board/atmel/at91sam9n12ek/at91sam9n12ek.c | 13 +
>  configs/at91sam9n12ek_mmc_defconfig   |  6 ++
>  configs/at91sam9n12ek_nandflash_defconfig |  6 ++
>  configs/at91sam9n12ek_spiflash_defconfig  |  6 ++
>  4 files changed, 31 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 1/3] configs: at91sam9rlek: Update for DT and DM support

2017-04-16 Thread Simon Glass
On 13 April 2017 at 20:49, Wenyou Yang  wrote:
> Update the configuration files to support the device tree and driver
> model. The device clock and pins configuration are handled by the
> clock and the pinctrl drivers respectively.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v3: None
> Changes in v2:
>  - Add converting UART to support DM_SERIAL and used in the
>board_init_f stage.
>  - Remove unused LED feature.
>  - Improve the commit log.
>
>  board/atmel/at91sam9rlek/Makefile|  2 +-
>  configs/at91sam9rlek_dataflash_defconfig | 16 +++-
>  configs/at91sam9rlek_mmc_defconfig   | 16 +++-
>  configs/at91sam9rlek_nandflash_defconfig | 16 +++-
>  include/configs/at91sam9rlek.h   | 22 +-
>  5 files changed, 47 insertions(+), 25 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] drivers/crypto/fsl: remove redundant logical contraint

2017-04-16 Thread Simon Glass
On 15 April 2017 at 08:37, Heinrich Schuchardt  wrote:
> 'A || (!A && B)' is equivalent to 'A || B'.
> Let's reduce the complexity of the statement in start_jr0().
>
> The problem was indicated by cppcheck.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
>  drivers/crypto/fsl/jr.c | 3 +--
>  1 file changed, 1 insertion(+), 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 v3 19/19] sunxi: update Pine64 README

2017-04-16 Thread Simon Glass
On 31 March 2017 at 16:31, Andre Przywara  wrote:
> With the DRAM init code and the SPL's ability to load the ATF binary as
> well, we can now officially get rid of the boot0 boot method, which
> involed a closed-source proprietary blob to be used.
> Rework the Pine64 README file to document how to build the firmware.
>
> Signed-off-by: Andre Przywara 
> ---
>  board/sunxi/README.pine64 | 177 
> ++
>  1 file changed, 115 insertions(+), 62 deletions(-)

Change log?

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


Re: [U-Boot] [PATCH] mkimage: rockchip: add support for rk3328

2017-04-16 Thread Simon Glass
On 14 April 2017 at 00:55, Kever Yang  wrote:
> Add support for rk3328 package header in mkimage tool.
>
> Signed-off-by: Kever Yang 
> ---
>
>  tools/rkcommon.c | 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 2/2] drivers: remove Blackfin specific drivers

2017-04-16 Thread Simon Glass
On 13 April 2017 at 19:55, Masahiro Yamada
 wrote:
> These drivers have no user since commit ea3310e8aafa ("Blackfin:
> Remove").

nit: Blackfin-specific

(in subject)

>
> Signed-off-by: Masahiro Yamada 
> ---
>
>  drivers/block/Makefile   |1 -
>  drivers/block/pata_bfin.c| 1209 
> --
>  drivers/block/pata_bfin.h|  170 --
>  drivers/mmc/Makefile |1 -
>  drivers/mmc/bfin_sdh.c   |  306 ---
>  drivers/mtd/nand/Makefile|1 -
>  drivers/mtd/nand/bfin_nand.c |  394 --
>  drivers/net/Makefile |1 -
>  drivers/net/bfin_mac.c   |  519 --
>  drivers/net/bfin_mac.h   |   65 ---
>  drivers/rtc/Makefile |1 -
>  drivers/rtc/bfin_rtc.c   |  121 -
>  drivers/watchdog/Makefile|1 -
>  drivers/watchdog/bfin_wdt.c  |   27 -
>  14 files changed, 2817 deletions(-)
>  delete mode 100644 drivers/block/pata_bfin.c
>  delete mode 100644 drivers/block/pata_bfin.h
>  delete mode 100644 drivers/mmc/bfin_sdh.c
>  delete mode 100644 drivers/mtd/nand/bfin_nand.c
>  delete mode 100644 drivers/net/bfin_mac.c
>  delete mode 100644 drivers/net/bfin_mac.h
>  delete mode 100644 drivers/rtc/bfin_rtc.c
>  delete mode 100644 drivers/watchdog/bfin_wdt.c

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/2] include: config: am335x: disable DM_MMC_OPS if DM_MMC is disabled

2017-04-16 Thread Simon Glass
Hi,

On 14 April 2017 at 11:50, Jean-Jacques Hiblot  wrote:
> Signed-off-by: Jean-Jacques Hiblot 
> ---
>  include/configs/am335x_evm.h | 1 +
>  include/configs/am335x_shc.h | 1 +
>  include/configs/chiliboard.h | 1 +
>  3 files changed, 3 insertions(+)

Reviewed-by: Simon Glass 

This seems unfortunate. Is there not enough space in SPL?
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 3/5] rockchip: clk: rk3188: add ciu_clk entry for eMMC/SDMMC/SDIO

2017-04-16 Thread Simon Glass
On 16 April 2017 at 03:44, Ziyuan Xu  wrote:
> The genunie bus clock is sclk_x for eMMC/SDMMC/SDIO, add support for
> it.
>
> Signed-off-by: Ziyuan Xu 
> ---
>
>  drivers/clk/rockchip/clk_rk3188.c | 12 
>  1 file changed, 12 insertions(+)

Acked-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] ARM: dts: at91: Add dts files for at91sam9263ek

2017-04-16 Thread Simon Glass
On 13 April 2017 at 19:11, Wenyou Yang  wrote:
> The device tree source files of at91sam9263ek boards are copied from
> the Linux v4.10, do the changes as below.
>  - Add the reg property for the pinctrl node.
>  - Move the gpio (pioA, pioB, pioC, pioD, pioE) nodes as the pinctrl's
>slibling nodes, instead of the child nodes.
>  - Add the "u-boot,dm-pre-reloc" property for the dbgu node are used
>in board_init_f stage.
>  - Fix the compilation warnings.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v2:
>  - Rebase on the master branch (22e10be45) of u-boot-dm git tree.
>
>  arch/arm/dts/Makefile  |   2 +
>  arch/arm/dts/at91sam9263.dtsi  | 198 +++
>  arch/arm/dts/at91sam9263ek.dts | 229 
> +
>  3 files changed, 340 insertions(+), 89 deletions(-)
>  create mode 100644 arch/arm/dts/at91sam9263ek.dts

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


Re: [U-Boot] [PATCH v5 07/16] disk: part: add support of GPT partitioning over MTD

2017-04-16 Thread Simon Glass
On 13 April 2017 at 03:52, Patrick Delaunay  wrote:
> Signed-off-by: Patrick Delaunay 
> Reviewed-by: Christophe KERELLO 
> ---
>
> Changes in v5:
> - solve warning and error
>   (dont' include linux/mtd/mtd.h in part.h)
>
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
>
>  disk/Kconfig|  17 ++
>  disk/Makefile   |   1 +
>  disk/part_efi_mtd.c | 457 
> 
>  doc/README.gpt.mtd  | 189 ++
>  include/part.h  |  15 +-
>  5 files changed, 677 insertions(+), 2 deletions(-)
>  create mode 100644 disk/part_efi_mtd.c
>  create mode 100644 doc/README.gpt.mtd
>

Reviewed-by: Simon Glass 

Please can you add function comments for your static and exported functions.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/3] configs: at91sam9263ek: Update for DT and DM support

2017-04-16 Thread Simon Glass
On 13 April 2017 at 21:07, Wenyou Yang  wrote:
> Update the configuration files to support the device tree and driver
> model. The device clock and pins configuration are handled by the
> clock and the pinctrl drivers respectively.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v3: None
> Changes in v2:
>  - Add converting UART to support DM_SERIAL and used in the
>board_init_f stage.
>  - Remove unused LED feature.
>  - Improve the commit log.
>
>  board/atmel/at91sam9263ek/Makefile|  2 +-
>  configs/at91sam9263ek_dataflash_cs0_defconfig | 18 +-
>  configs/at91sam9263ek_dataflash_defconfig | 18 +-
>  configs/at91sam9263ek_nandflash_defconfig | 18 +-
>  configs/at91sam9263ek_norflash_boot_defconfig | 18 +-
>  configs/at91sam9263ek_norflash_defconfig  | 18 +-
>  include/configs/at91sam9263ek.h   | 24 +---
>  7 files changed, 87 insertions(+), 29 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 3/3] board: at91sam9m10g45ek: Enable early debug UART

2017-04-16 Thread Simon Glass
On 12 April 2017 at 03:03, Wenyou Yang  wrote:
> Enable the early debug UART to debug problems when an ICE or other
> debug mechanism is not available.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v2:
>  - Move out [PATCH] ARM: dts: at91: Add dts files for at91sam9m10g45ek.
>  - Add [PATCH] board: at91sam9m10g45ek: Enable early debug UART
>
>  board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c | 13 +
>  configs/at91sam9m10g45ek_mmc_defconfig  |  6 ++
>  configs/at91sam9m10g45ek_nandflash_defconfig|  6 ++
>  3 files changed, 25 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 5/6] ARM: dts: at91: Add dts files for at91sam9rlek

2017-04-16 Thread Simon Glass
On 13 April 2017 at 19:11, Wenyou Yang  wrote:
> The device tree source files of at91sam9rlek boards are copied from
> the Linux v4.10, do the changes as below.
>  - Add the reg property for the pinctrl node.
>  - Move the gpio (pioA, pioB, pioC, pioD) nodes as the pinctrl's
>slibling nodes, instead of the child nodes.
>  - Add the "u-boot,dm-pre-reloc" property for the dbgu node are used
>in board_init_f stage.
>  - Fix the compilation warnings.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v2: None
>
>  arch/arm/dts/Makefile |2 +
>  arch/arm/dts/at91sam9rl.dtsi  | 1139 
> +
>  arch/arm/dts/at91sam9rlek.dts |  239 +
>  3 files changed, 1380 insertions(+)
>  create mode 100644 arch/arm/dts/at91sam9rl.dtsi
>  create mode 100644 arch/arm/dts/at91sam9rlek.dts

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 1/3] configs: at91sam9n12ek: Update for DT and DM support

2017-04-16 Thread Simon Glass
On 13 April 2017 at 20:16, Wenyou Yang  wrote:
> Update the configuration files to support the device tree and driver
> model. The device clock and pins configuration are handled by the
> clock and the pinctrl drivers respectively.
>
> Because the limitation of internal SRAM size, the SPL with driver
> model can't be supported, disable the SPL option.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v3: None
> Changes in v2:
>  - Remain the SPI speed macros.
>  - Disable the SPL option for the nand config.
>  - Add support of Atmel uart be used in the board_init_f stage.
>  - Improve the commit log.
>
>  board/atmel/at91sam9n12ek/at91sam9n12ek.c |  2 ++
>  configs/at91sam9n12ek_mmc_defconfig   | 19 ++-
>  configs/at91sam9n12ek_nandflash_defconfig | 25 ++---
>  configs/at91sam9n12ek_spiflash_defconfig  | 26 ++
>  include/configs/at91sam9n12ek.h   | 19 +--
>  5 files changed, 57 insertions(+), 34 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 2/3] board: at91sam9n12ek: Clean up code

2017-04-16 Thread Simon Glass
On 12 April 2017 at 03:08, Wenyou Yang  wrote:
> Since the introduction of the pinctrl and clk driver and the device
> tree files, remove unneeded related code from the board file.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v2: None
>
>  board/atmel/at91sam9n12ek/at91sam9n12ek.c | 53 
> ---
>  1 file changed, 53 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 v4 1/3] configs: at91sam9260ek/9g20ek: Update for DT and DM

2017-04-16 Thread Simon Glass
On 13 April 2017 at 20:32, Wenyou Yang  wrote:
> Update the configuration files to support the device tree and driver
> model. The device clock and pins configuration are handled by the
> clock and the pinctrl drivers respectively.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v4: None
> Changes in v3:
>  - Add the support of Atmel uart device be used in the
>board_init_f stage.
>  - Remove unused LED feature.
>  - Improve the commit log.
>
> Changes in v2:
>  - Add missing conversion default config files for at91sam9xeek.
>  - Improve the commit log.
>
>  board/atmel/at91sam9260ek/Makefile |  2 +-
>  configs/at91sam9260ek_dataflash_cs0_defconfig  | 15 -
>  configs/at91sam9260ek_dataflash_cs1_defconfig  | 15 -
>  configs/at91sam9260ek_nandflash_defconfig  | 15 -
>  configs/at91sam9g20ek_2mmc_defconfig   | 18 +++-
>  configs/at91sam9g20ek_2mmc_nandflash_defconfig | 18 +++-
>  configs/at91sam9g20ek_dataflash_cs0_defconfig  | 15 -
>  configs/at91sam9g20ek_dataflash_cs1_defconfig  | 15 -
>  configs/at91sam9g20ek_nandflash_defconfig  | 15 -
>  configs/at91sam9xeek_dataflash_cs0_defconfig   | 15 -
>  configs/at91sam9xeek_dataflash_cs1_defconfig   | 15 -
>  configs/at91sam9xeek_nandflash_defconfig   | 15 -
>  include/configs/at91sam9260ek.h| 29 
> ++
>  13 files changed, 163 insertions(+), 39 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 3/3] board: at91sam9n12ek: Enable early debug UART

2017-04-16 Thread Simon Glass
On 12 April 2017 at 03:08, Wenyou Yang  wrote:
> Enable the early debug UART to debug problems when an ICE or other
> debug mechanism is not available.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v2:
>  - Use CONFIG_DEBUG_UART_CLOCK as the input clock for the early
>debug UART.
>  - Move out [PATCH 1/4] ARM: dts: at91: add dts files for at91sam9n12ek.
>
>  board/atmel/at91sam9n12ek/at91sam9n12ek.c | 13 +
>  configs/at91sam9n12ek_mmc_defconfig   |  6 ++
>  configs/at91sam9n12ek_nandflash_defconfig |  6 ++
>  configs/at91sam9n12ek_spiflash_defconfig  |  6 ++
>  4 files changed, 31 insertions(+)

Reviewed-by: Simon Glass 

Suggestion below.

> diff --git a/board/atmel/at91sam9n12ek/at91sam9n12ek.c 
> b/board/atmel/at91sam9n12ek/at91sam9n12ek.c
> index 02b7790627..1105428986 100644
> --- a/board/atmel/at91sam9n12ek/at91sam9n12ek.c
> +++ b/board/atmel/at91sam9n12ek/at91sam9n12ek.c
> @@ -13,6 +13,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -162,10 +163,22 @@ void at91sam9n12ek_usb_hw_init(void)
>  }
>  #endif
>
> +#ifdef CONFIG_DEBUG_UART_BOARD_INIT
> +void board_debug_uart_init(void)

Perhaps this could become a common function across AT91?

> +{
> +   at91_seriald_hw_init();
> +}
> +#endif
> +
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 2/3] board: at91sam9n12ek: Clean up code

2017-04-16 Thread Simon Glass
On 13 April 2017 at 20:16, Wenyou Yang  wrote:
> Since the introduction of the pinctrl and clk driver and the device
> tree files, remove unneeded related code from the board file.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v3: None
> Changes in v2: None
>
>  board/atmel/at91sam9n12ek/at91sam9n12ek.c | 53 
> ---
>  1 file changed, 53 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/14] cpu: add CPU driver for Broadcom MIPS SoCs

2017-04-16 Thread Simon Glass
On 15 April 2017 at 16:03, Álvaro Fernández Rojas  wrote:
> Signed-off-by: Álvaro Fernández Rojas 
> ---
>  v2: Introduce changes suggested by Daniel Schwierzeck:
>   - Split BMIPS support patches.
>   - Get register base from DT.
>
>  drivers/cpu/Makefile|   2 +
>  drivers/cpu/bmips_cpu.c | 271 
> 
>  2 files changed, 273 insertions(+)
>  create mode 100644 drivers/cpu/bmips_cpu.c
>

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/5] mmc: dw_mmc: rockchip: select proper card clock

2017-04-16 Thread Simon Glass
On 16 April 2017 at 03:44, Ziyuan Xu  wrote:
> As you know, biu_clk is used for AMBA AHB/APB interface, ciu_clk is
> used for communication between host and card devices. The real bus clock
> is ciu, so let's rectify it.
>
> Signed-off-by: Ziyuan Xu 
> ---
>
>  drivers/mmc/rockchip_dw_mmc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

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


Re: [U-Boot] [PATCH v3 2/3] board: at91sam9260ek: Clean up code

2017-04-16 Thread Simon Glass
On 12 April 2017 at 03:14, Wenyou Yang  wrote:
> Since the introduction of the pinctrl and clk drivers and the
> device tree files, remove unneeded hard coded related code from
> the board file.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v3: None
> Changes in v2: None
>
>  board/atmel/at91sam9260ek/at91sam9260ek.c | 74 
> ---
>  1 file changed, 74 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/14] serial: add serial driver for BCM6345

2017-04-16 Thread Simon Glass
On 15 April 2017 at 16:03, Álvaro Fernández Rojas  wrote:
> It is based on linux/drivers/tty/serial/bcm63xx_uart.c
>
> Signed-off-by: Álvaro Fernández Rojas 
> ---
>  v2: Introduce changes suggested by Daniel Schwierzeck:
>   - Remove unneeded defines.
>   - Fix incorrect multi-line comment.
>
>  drivers/serial/Kconfig  |  14 +++
>  drivers/serial/Makefile |   1 +
>  drivers/serial/serial_bcm6345.c | 267 
> 
>  3 files changed, 282 insertions(+)
>  create mode 100644 drivers/serial/serial_bcm6345.c

Reviewed-by: Simon Glass 

IMO the raw read/write are ugly. It is better to use clrsetbits etc.
than lots of read/write calls. Also we tend to use C structs to access
registers although that is not required now.

I cannot see a lot of point in trying to make it look like the Linux
driver. Is that driver changing rapidly and hard to track?
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] rockchip: reserve memory for rk3399 ATF data

2017-04-16 Thread Simon Glass
Hi Philipp,

On 14 April 2017 at 04:51, Dr. Philipp Tomsich
 wrote:
> Kever,
>
> Do we really need to change the SPL layout (i.e. BL2) for this?
>
> The SPL code should remain independent of later stages. This change would tie 
> the
> U-Boot SPL (BL2) to a specific implementation/memory layout of the later BL31 
> stage.
> It should rather remain the responsibility of the BL31 stage to properly 
> relocate itself
> as needed upon startup...
>
> Our (yet unreleased) development tree (for ATF) uses a much less intrusive 
> approach
> to achieve the same result (using the knowledge that the ATF will not return 
> to SPL and
> thus allowing the ATF to overwrite memory areas previously used by SPL):
> 1.  ATF (BL31), the M0-firmware and the second-stage U-Boot are loaded as
> separate firmware blobs into DRAM using Andre's FIT image loader 
> patches
> 2.  SPL transfers control to ATF (with a vendor-specific parameter 
> payload, which
> contains the location of the M0 firmware in DRAM)
> 3.  ATF installs the M0 firmware into its final location
>
> Note that we’ve split the M0 firmware off the ATF build (and into a separate 
> repository),
> as we’d otherwise end up with ELF files that has data/code/etc in the first 
> MB of the
> address space and the M0 binary at 0xff8c — if you convert such an ELF to 
> a binary,
> you’d end up with a file size of approx. 4GB.  In other words: we don’t 
> include the M0
> binary into the ATF, but load it separately through the FIT image loader...
>
> I’ll try to get our Cortex-M0 and ATF repositories pushed to our public GIT 
> by early
> next week, so you can review…
>

So should we take this patch in the meantime, or is it a backwards step?

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


Re: [U-Boot] [PATCH v4 3/3] board: at91sam9260ek/9g20ek: Enable early debug UART

2017-04-16 Thread Simon Glass
On 13 April 2017 at 20:32, Wenyou Yang  wrote:
> Enable the early debug UART to debug problems when an ICE or other
> debug mechanism is not available.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v4:
>  - Rebase on the master branch (22e10be45) of u-boot-dm git tree.
>  - Update the cover-letter.
>
> Changes in v3:
>  - Move out [PATCH 1/3] ARM: dts: at91: add dts file for 
> at91sam9g20/at91sam9260.
>  - Add [PATCH]: board: at91sam9260ek/9g20ek: Enable early debug UART.
>
> Changes in v2: None
>
>  board/atmel/at91sam9260ek/at91sam9260ek.c  | 13 +
>  configs/at91sam9260ek_dataflash_cs0_defconfig  |  6 ++
>  configs/at91sam9260ek_dataflash_cs1_defconfig  |  6 ++
>  configs/at91sam9260ek_nandflash_defconfig  |  6 ++
>  configs/at91sam9g20ek_2mmc_defconfig   |  6 ++
>  configs/at91sam9g20ek_2mmc_nandflash_defconfig |  6 ++
>  configs/at91sam9g20ek_dataflash_cs0_defconfig  |  6 ++
>  configs/at91sam9g20ek_dataflash_cs1_defconfig  |  6 ++
>  configs/at91sam9g20ek_nandflash_defconfig  |  6 ++
>  configs/at91sam9xeek_dataflash_cs0_defconfig   |  6 ++
>  configs/at91sam9xeek_dataflash_cs1_defconfig   |  6 ++
>  configs/at91sam9xeek_nandflash_defconfig   |  6 ++
>  12 files changed, 79 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 1/2] cmd: remove Blackfin specific commands

2017-04-16 Thread Simon Glass
On 13 April 2017 at 19:54, Masahiro Yamada
 wrote:
> These commands have no user since commit ea3310e8aafa ("Blackfin:
> Remove").
>
> Signed-off-by: Masahiro Yamada 
> ---
>
>  cmd/Makefile |   6 --
>  cmd/bootldr.c| 170 -
>  cmd/cplbinfo.c   |  60 ---
>  cmd/ldrinfo.c| 192 --
>  cmd/otp.c| 228 
> ---
>  cmd/softswitch.c |  41 --
>  cmd/spibootldr.c |  37 -
>  7 files changed, 734 deletions(-)
>  delete mode 100644 cmd/bootldr.c
>  delete mode 100644 cmd/cplbinfo.c
>  delete mode 100644 cmd/ldrinfo.c
>  delete mode 100644 cmd/otp.c
>  delete mode 100644 cmd/softswitch.c
>  delete mode 100644 cmd/spibootldr.c

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


Re: [U-Boot] [PATCH v7 2/3] mmc: meson: add MMC driver for Meson GX (S905)

2017-04-16 Thread Simon Glass
Hi Alex,

On 16 April 2017 at 04:08, Alexander Graf  wrote:
>
>
> On 16.04.17 04:09, Heinrich Schuchardt wrote:
>>
>> On 04/15/2017 11:51 PM, Andreas Färber wrote:
>>>
>>> Am 15.04.2017 um 23:16 schrieb Andreas Färber:

 Am 15.04.2017 um 23:04 schrieb Alexander Graf:
>>
>> Am 15.04.2017 um 22:34 schrieb Andreas Färber :
>>>
>>> Am 15.04.2017 um 20:27 schrieb Alexander Graf:

 On 15.04.17 20:18, Heiner Kallweit wrote:
>
> Am 15.04.2017 um 17:05 schrieb Andreas Färber:
> But for the Vega S95 Telos I needed to disable the first of three
> MMC
> nodes (SDIO) - otherwise U-Boot would happily iterate over them for
> distro boot with Heinrich's patch, but GRUB would come up with no
> disks,
> so that booting failed. I'm not yet sure why, maybe it's a
> UEFI-side
> problem in that it is the first MMC device that is absent rather
> than
> the last one?
>
 I don't own this device so I can just provide a guess.
 Based on DT the device ordering most likely is:
 mmc0: SDIO
 mmc1: SD
 mmc2: eMMC
>>
>> [...]
>>>
>>> If grub comes up, distro boot has successfully found the target
>>> binary
>>> and executed it. For some reason, grub can not find its boot origin
>>> though.
>>>
>>> Andreas, please add debug prints like the ones below and check that
>>> the
>>> device names match:
>>
>>
>> U-Boot 2017.05-rc1-00318-g082535f-dirty (Apr 15 2017 - 22:29:17 +0200)
>> vega-s95
>>
>> DRAM:  2 GiB
>> MMC:   mmc@7: 0, mmc@72000: 1, mmc@74000: 2
>> Using default environment
>>
>> In:serial@4c0
>> Out:   serial@4c0
>> Err:   serial@4c0
>> Net:   eth0: ethernet@c941
>> Hit any key to stop autoboot:  0
>> mmc_init: -95, time 1806
>> MMC Device 0 not found
>> no mmc device at slot 0
>> switch to partitions #0, OK
>> mmc1 is current device
>> Scanning mmc 1:1...
>> Setting boot device name to '//boot/dtb/amlogic/meson-gxbb-v'
>> 20335 bytes read in 43 ms (460.9 KiB/s)
>> Found EFI removable media binary efi/boot/bootaa64.efi
>> Setting boot device name to '/efi/boot/bootaa64.efi'
>> reading efi/boot/bootaa64.efi
>> 129024 bytes read in 13 ms (9.5 MiB/s)
>> ## Starting EFI application at 0108 ...
>> mmc_init: -95, time 1807
>> Found 0 disks
>
>
> That looks like efi_disk didn't manage to enumerate any devices?


 Apparently. The last line comes from
 lib/efi_loader_efi_disk:efi_disk_register(), and CONFIG_BLK=y. As you
 can see, there is not a single "Scanning disk" line, so I guess we do
 not iterate over uclass devices properly?

 On the Odroid-C2 I get this:

 Scanning disk m...@72000.blk...
 Card did not respond to voltage select!
 mmc_init: -95, time 9
 Found 1 disks

 Therefore my guess that it matters at what point in time - before or
 after the disk we want - the error accessing an MMC device happens.
>>>
>>>
>>> For comparison, Vega S95 with first MMC node disabled in DT:
>>>
>>> Scanning disk m...@72000.blk...
>>> Adding disk device 'm...@72000.blk'
>>> ** First descriptor is NOT a primary desc on 1:1 **
>>> Scanning disk m...@74000.blk...
>>> Adding disk device 'm...@74000.blk'
>>> Found 2 disks
>>>
>>> Regards,
>>> Andreas
>>>
>> By adding sd_mmc_a to the odroid-c2.dts I was able to reproduce the
>> problem on the Odroid C2.
>>
>> While booting from SD card via booti still worked
>> bootefi would not find any block device:
>>
>> => bootefi hello
>> ## Starting EFI application at 0100 ...
>> WARNING: Invalid device tree, expect boot to fail
>> efi_add_memory_map: 0x7cf53000 0x1 2 yes
>> uclass_find_device_by_seq: 0 -1
>> uclass_find_device_by_seq: 0 0
>>- -1 -1
>>- -1 -1
>>- -1 -1
>>- not found
>> set_state_simple op missing
>> blk_get_device: if_type=6, devnum=0: m...@7.blk, 6, 0
>> mmc_init: -95, time 1807
>> Found 0 disks
>> efi_add_memory_map: 0x7cf52000 0x1 6 yes
>> do_bootefi_exec:234 Jumping to 0x7cf53148
>> EFI: Entry efi_cout_output_string(7ff94b38, 7cf53280)
>> Hello, world!
>> EFI: Entry efi_exit(7ffa4598, 0, 0, )
>> ## Application terminated, r = 0
>>
>> In the debug output you can see that after trying non-existant
>> m...@7.blk no further devices are scanned. m...@72000.blk which has
>> the SD card is not enumerated.
>
>
> To me that looks like something wrong with DM code, as there is no explicit
> abort condition in efi_disk_register() for the CONFIG_BLK case. Let's CC
> Simon and ask for help :).

Reviewed-by: Simon Glass 

Do you have a board that uses CONFIG_BLK?

Or could we enhance my helloworld test to check the test? I really
don't like having to run grub to 

Re: [U-Boot] [PATCH v3 1/3] configs: at91sam9m10g45ek: Update to support DM/DT

2017-04-16 Thread Simon Glass
On 13 April 2017 at 19:59, Wenyou Yang  wrote:
> Update the configuration files to support the device tree and driver
> model. The device clock and pins configuration are handled by the
> clock and the pinctrl drivers respectively.
>
> Because the limitation of internal SRAM size, the SPL with driver
> model can't be supported, disable the SPL option.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v3: None
> Changes in v2:
>  - Add the support of Atmel uart device be used in the
>board_init_f stage.
>  - Remove unused LED feature.
>  - Disable the SPL options.
>
>  board/atmel/at91sam9m10g45ek/Makefile|  2 +-
>  configs/at91sam9m10g45ek_mmc_defconfig   | 28 ++-
>  configs/at91sam9m10g45ek_nandflash_defconfig | 26 ++---
>  include/configs/at91sam9m10g45ek.h   | 29 
> +---
>  4 files changed, 40 insertions(+), 45 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 1/6] ARM: dts: at91: Add dts files for at91sam9x5ek

2017-04-16 Thread Simon Glass
On 13 April 2017 at 19:11, Wenyou Yang  wrote:
> The device tree source files of at91sam9x5ek board are copied from
> the Linux v4.10, do the changes below.
>  - Add the reg property for the pinctrl node.
>  - Move the gpio (pioA, pioB, pioC ...) nodes as the pinctrl's
>slibling nodes, instead of the child nodes.
>  - Add the "u-boot,dm-pre-reloc" property to determine which nodes
>are used by the board_init_f stage.
>  - Change the compatible of the spi flash to "spi-flash".
>  - Add the spi0 aliases.
>  - Fix the compilation warnings.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v2: None
>
>  arch/arm/dts/Makefile   |7 +
>  arch/arm/dts/at91sam9g15.dtsi   |   29 +
>  arch/arm/dts/at91sam9g15ek.dts  |   26 +
>  arch/arm/dts/at91sam9g25.dtsi   |   31 +
>  arch/arm/dts/at91sam9g25ek.dts  |   69 ++
>  arch/arm/dts/at91sam9g35.dtsi   |   30 +
>  arch/arm/dts/at91sam9g35ek.dts  |   31 +
>  arch/arm/dts/at91sam9x25.dtsi   |   32 +
>  arch/arm/dts/at91sam9x25ek.dts  |   30 +
>  arch/arm/dts/at91sam9x35.dtsi   |   31 +
>  arch/arm/dts/at91sam9x35ek.dts  |   30 +
>  arch/arm/dts/at91sam9x5.dtsi| 1302 
> +++
>  arch/arm/dts/at91sam9x5_can.dtsi|   71 ++
>  arch/arm/dts/at91sam9x5_isi.dtsi|   72 ++
>  arch/arm/dts/at91sam9x5_lcd.dtsi|  146 
>  arch/arm/dts/at91sam9x5_macb0.dtsi  |   67 ++
>  arch/arm/dts/at91sam9x5_macb1.dtsi  |   55 ++
>  arch/arm/dts/at91sam9x5_usart3.dtsi |   69 ++
>  arch/arm/dts/at91sam9x5cm.dtsi  |  100 +++
>  arch/arm/dts/at91sam9x5dm.dtsi  |   66 ++
>  arch/arm/dts/at91sam9x5ek.dtsi  |  167 +
>  21 files changed, 2461 insertions(+)
>  create mode 100644 arch/arm/dts/at91sam9g15.dtsi
>  create mode 100644 arch/arm/dts/at91sam9g15ek.dts
>  create mode 100644 arch/arm/dts/at91sam9g25.dtsi
>  create mode 100644 arch/arm/dts/at91sam9g25ek.dts
>  create mode 100644 arch/arm/dts/at91sam9g35.dtsi
>  create mode 100644 arch/arm/dts/at91sam9g35ek.dts
>  create mode 100644 arch/arm/dts/at91sam9x25.dtsi
>  create mode 100644 arch/arm/dts/at91sam9x25ek.dts
>  create mode 100644 arch/arm/dts/at91sam9x35.dtsi
>  create mode 100644 arch/arm/dts/at91sam9x35ek.dts
>  create mode 100644 arch/arm/dts/at91sam9x5.dtsi
>  create mode 100644 arch/arm/dts/at91sam9x5_can.dtsi
>  create mode 100644 arch/arm/dts/at91sam9x5_isi.dtsi
>  create mode 100644 arch/arm/dts/at91sam9x5_lcd.dtsi
>  create mode 100644 arch/arm/dts/at91sam9x5_macb0.dtsi
>  create mode 100644 arch/arm/dts/at91sam9x5_macb1.dtsi
>  create mode 100644 arch/arm/dts/at91sam9x5_usart3.dtsi
>  create mode 100644 arch/arm/dts/at91sam9x5cm.dtsi
>  create mode 100644 arch/arm/dts/at91sam9x5dm.dtsi
>  create mode 100644 arch/arm/dts/at91sam9x5ek.dtsi
>

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


Re: [U-Boot] [PATCH v4 2/3] board: at91sam9260ek: Clean up code

2017-04-16 Thread Simon Glass
On 13 April 2017 at 20:32, Wenyou Yang  wrote:
> Since the introduction of the pinctrl and clk drivers and the
> device tree files, remove unneeded hard coded related code from
> the board file.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
>
>  board/atmel/at91sam9260ek/at91sam9260ek.c | 74 
> ---
>  1 file changed, 74 deletions(-)

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


Re: [U-Boot] rockchip: rk3288: grf: FIX the correct gmac tx_delay shift

2017-04-16 Thread Simon Glass
On 14 April 2017 at 03:24, Dr. Philipp Tomsich
 wrote:
>
>> On 14 Apr 2017, at 11:02, David Wu  wrote:
>>
>> If the tx_delay is not enabled, the RGMII/1000M can't work.
>>
>> Signed-off-by: David Wu 
>> ---
>> arch/arm/include/asm/arch-rockchip/grf_rk3288.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/include/asm/arch-rockchip/grf_rk3288.h 
>> b/arch/arm/include/asm/arch-rockchip/grf_rk3288.h
>> index 1a7c819..6e5a947 100644
>> --- a/arch/arm/include/asm/arch-rockchip/grf_rk3288.h
>> +++ b/arch/arm/include/asm/arch-rockchip/grf_rk3288.h
>> @@ -813,7 +813,7 @@ enum {
>>   (1 << RK3288_TXCLK_DLY_ENA_GMAC_SHIFT),
>>   RK3288_TXCLK_DLY_ENA_GMAC_DISABLE = 0,
>>   RK3288_TXCLK_DLY_ENA_GMAC_ENABLE =
>> - (1 << RK3288_RXCLK_DLY_ENA_GMAC_SHIFT),
>> + (1 << RK3288_TXCLK_DLY_ENA_GMAC_SHIFT),
>>
>>   RK3288_CLK_RX_DL_CFG_GMAC_SHIFT = 0x7,
>>   RK3288_CLK_RX_DL_CFG_GMAC_MASK =
>> --
>> 1.9.1
>>
>
> Reviewed-by: Philipp Tomsich 
>
>

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


Re: [U-Boot] [PATCH v2 1/1] meson: gxbb: change ramdisk_addr_r

2017-04-16 Thread Simon Glass
On 14 April 2017 at 12:04, Heinrich Schuchardt  wrote:
> 0x1000 is the start of a 2 MiB area used by the
> ARM Trusted Firmware (BL31).
>
> See
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/arch/arm64/boot/dts/amlogic/meson-gx.dtsi?id=refs/tags/v4.10.10
>
> So we should not load the ramdisk here.
>
> The legacy Ubuntu image for the Odroid C2 comes with the
> following line in boot.ini:
> setenv initrd_loadaddr "0x1300"
>
> See
> http://odroid.in/ubuntu_16.04lts/ubuntu64-16.04-minimal-odroid-c2-20160815.img.xz
> http://deb.odroid.in/c2/pool/main/u/u-boot/u-boot_20170226-752a100-8_arm64.deb
>
> So let's use the same address.
>
> With the patch booting Linux with booti succeeds on an Odroid C2,
> without the patch Linux hangs.
>
> Cc: Andreas Färber 
> Signed-off-by: Heinrich Schuchardt 
> ---
> v2:
>   Title and commit message changed to reflect that this patch
>   applies to all Meson GXBB systems.
> v1:
>   Initial patch
>   [PATCH 1/1] odroid-c2: change ramdisk_addr_r
>   https://lists.denx.de/pipermail/u-boot/2017-April/287373.html
> ---
>  include/configs/meson-gxbb-common.h | 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 v2 03/14] MIPS: allow using generic sysreset drivers

2017-04-16 Thread Simon Glass
On 15 April 2017 at 16:03, Álvaro Fernández Rojas  wrote:
> Avoid duplicating do_reset definition if SYSRESET is enabled for MIPS
>
> Signed-off-by: Álvaro Fernández Rojas 
> ---
>  v2: no changes
>
>  arch/mips/cpu/cpu.c | 2 ++
>  1 file changed, 2 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 v5 11/16] cmd: gpt: update write command to support GPT over MTD

2017-04-16 Thread Simon Glass
On 13 April 2017 at 03:52, Patrick Delaunay  wrote:
> support gpt write for MTD device
>> gpt write nand 0
>> gpt write nor 0
>
> And verify is not yet supported for MTD device
>
> Signed-off-by: Patrick Delaunay 
> Reviewed-by: Christophe KERELLO 
> ---
>
> Changes in v5: None
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
>
>  cmd/gpt.c | 71 
> +++
>  1 file changed, 67 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 v5 03/16] disk: part: refactor part_get_info_efi to prepare GPT over MTD

2017-04-16 Thread Simon Glass
On 13 April 2017 at 03:52, Patrick Delaunay  wrote:
> create sub-functions part_get_disk_info()
>
> Signed-off-by: Patrick Delaunay 
> Reviewed-by: Christophe KERELLO 
> ---
>
> Changes in v5: None
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
>
>  disk/part_efi.c | 49 +++--
>  1 file changed, 27 insertions(+), 22 deletions(-)

Reviewed-by: Simon Glass 

Would be useful to add comments for the functions you create.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 06/14] ram: add RAM driver for Broadcom MIPS SoCs

2017-04-16 Thread Simon Glass
On 15 April 2017 at 16:03, Álvaro Fernández Rojas  wrote:
> Signed-off-by: Álvaro Fernández Rojas 
> ---
>  v2: Introduce changes suggested by Daniel Schwierzeck:
>   - Split BMIPS support patches.
>
>  drivers/ram/Makefile|   2 +
>  drivers/ram/bmips_ram.c | 126 
> 
>  2 files changed, 128 insertions(+)
>  create mode 100644 drivers/ram/bmips_ram.c

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] board: at91sam9m10g45ek: Enable early debug UART

2017-04-16 Thread Simon Glass
On 13 April 2017 at 19:59, Wenyou Yang  wrote:
> Enable the early debug UART to debug problems when an ICE or other
> debug mechanism is not available.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v3:
>  - Rebase on the master branch (22e10be45) of u-boot-dm git tree.
>  - Update the cover-letter.
>
> Changes in v2:
>  - Move out [PATCH] ARM: dts: at91: Add dts files for at91sam9m10g45ek.
>  - Add [PATCH] board: at91sam9m10g45ek: Enable early debug UART
>
>  board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c | 13 +
>  configs/at91sam9m10g45ek_mmc_defconfig  |  6 ++
>  configs/at91sam9m10g45ek_nandflash_defconfig|  6 ++
>  3 files changed, 25 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 08/12] gpio: 74x164: make oe-pins optional

2017-04-16 Thread Simon Glass
On 13 April 2017 at 00:09, Peng Fan  wrote:
> Make oe-pins optional because some boards have fixed it to enable.
>
> Signed-off-by: Peng Fan 
> Cc: Simon Glass 
> Cc: Stefano Babic 
> ---
>
> V2:
>  None
>
>  drivers/gpio/74x164_gpio.c | 3 +--
>  1 file changed, 1 insertion(+), 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 v7 1/4] arm: dts: update Meson GXBB / Odroid-C2 DT with latest Linux version

2017-04-16 Thread Simon Glass
On 14 April 2017 at 04:27, Heinrich Schuchardt  wrote:
> As a prerequisite for adding a Meson GX MMC driver update the
> Meson GXBB / Odroid-C2 device tree in Uboot with the latest

U-Boot

> version from Linux.

It's a good idea to indicate which version (or commit) of Linux

>
> Signed-off-by: Neil Armstrong 
> Signed-off-by: Carlo Caione 
> Signed-off-by: Andreas Färber 
> Signed-off-by: Heiner Kallweit 
> Tested-by: Heinrich Schuchardt 
> Signed-off-by: Heinrich Schuchardt 
> ---
> v7:
> - no changes
> v6:
> - changed prefix in subject
> v5:
> - no changes
> v4:
> - Added SoB of original authors
> ---
>  arch/arm/dts/meson-gx.dtsi  | 447 
>  arch/arm/dts/meson-gxbb-odroidc2.dts| 147 ++-
>  arch/arm/dts/meson-gxbb.dtsi| 718 
> 
>  include/dt-bindings/clock/gxbb-aoclkc.h |  66 +++
>  include/dt-bindings/clock/gxbb-clkc.h   |  34 ++
>  include/dt-bindings/reset/gxbb-aoclkc.h |  66 +++
>  6 files changed, 1203 insertions(+), 275 deletions(-)
>  create mode 100644 arch/arm/dts/meson-gx.dtsi
>  create mode 100644 include/dt-bindings/clock/gxbb-aoclkc.h
>  create mode 100644 include/dt-bindings/clock/gxbb-clkc.h
>  create mode 100644 include/dt-bindings/reset/gxbb-aoclkc.h

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 3/3] board: at91sam9263ek: Enable early debug UART

2017-04-16 Thread Simon Glass
On 12 April 2017 at 03:23, Wenyou Yang  wrote:
> Enable the early debug UART to debug problems when an ICE or other
> debug mechanism is not available.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v2:
>  - Add [PATCH]: board: at91sam9263ek: Enable early debug UART.
>  - Move out [PATCH] ARM: dts: at91: add dts files for at91sam9263ek.
>
>  board/atmel/at91sam9263ek/at91sam9263ek.c | 13 +
>  configs/at91sam9263ek_dataflash_cs0_defconfig |  6 ++
>  configs/at91sam9263ek_dataflash_defconfig |  6 ++
>  configs/at91sam9263ek_nandflash_defconfig |  6 ++
>  configs/at91sam9263ek_norflash_boot_defconfig |  6 ++
>  configs/at91sam9263ek_norflash_defconfig  |  6 ++
>  6 files changed, 43 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 01/14] cmd: cpu: fix NULL cpu feature prints

2017-04-16 Thread Simon Glass
On 15 April 2017 at 16:03, Álvaro Fernández Rojas  wrote:
> Commit 740d5d3 added two new features but only one feature name,
> which results in NULL prints when device_id feature is selected.
>
> Before:
> HG556a # cpu detail
>  -1: cpu@0  BCM6358A1
> ID = 0, freq = 300 MHz: L1 cache, MMU, NULL
> Device ID 0x2a010
>  -1: cpu@1  BCM6358A1
> ID = 1, freq = 300 MHz: L1 cache, MMU, NULL
> Device ID 0x2a010
> After:
> HG556a # cpu detail
>  -1: cpu@0  BCM6358A1
> ID = 0, freq = 300 MHz: L1 cache, MMU, Device ID
> Device ID 0x2a010
>  -1: cpu@1  BCM6358A1
> ID = 1, freq = 300 MHz: L1 cache, MMU, Device ID
> Device ID 0x2a010
>
> Signed-off-by: Álvaro Fernández Rojas 
> ---
>  v2: Introduce changes suggested by Daniel Schwierzeck:
>   - Add the missing name instead of checking for null names.
>
>  cmd/cpu.c | 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 5/5] rockchip: clk: rk3328: add ciu_clk entry for eMMC/SDMMC

2017-04-16 Thread Simon Glass
On 16 April 2017 at 03:44, Ziyuan Xu  wrote:
> The genunie bus clock is sclk_x for eMMC/SDMMC, add support for it.
>
> Signed-off-by: Ziyuan Xu 
> ---
>
>  drivers/clk/rockchip/clk_rk3328.c | 8 
>  1 file changed, 8 insertions(+)

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


Re: [U-Boot] [PATCH v5 05/16] disk: part: compute partition_entry_lba

2017-04-16 Thread Simon Glass
On 13 April 2017 at 03:52, Patrick Delaunay  wrote:
> the value for partition_entry_lba of secondary GPT (last usable lba + 1)
> is not correct with MTD support as last usable LBA need to be erase size
> aligned
>
> The correct location of partition entry is always recomputed with
> the formula :
> partition_entry_lba =
>alternate_lba -
>num_pte * sizeof_partition_entry / lba_size
>
> Signed-off-by: Patrick Delaunay 
> Reviewed-by: Christophe KERELLO 
> ---
> the device mapping is
>
> 1/ for block case:
>
>   last_usable_lba -> partition_entry_lba - 1
>   partition_entry_lba ->  PTE table (num * sizeof(PTE))
>   alternate_lba   ->  secondary GPT
>   -> end of device
>
> 2/ for MTD case : end of the last good block
>
>   -
>
>   last_usable_lba -> last good erase block - 1
>   -erase BLOCK aligned
>   XX  -> skipped LBA for MTD case
>   partition_entry_lba ->  PTE table (num * sizeof(PTE))
>   alternate_lba   ->  secondary GPT
>   -erase BLOCK aligned
>   x skipping bad block
>   ->end of device
>
> Changes in v5: None
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
>
>  disk/part_efi.c | 10 +-
>  1 file changed, 5 insertions(+), 5 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 3/6] ARM: dts: at91: Add dts files for at91sam9m10g45ek

2017-04-16 Thread Simon Glass
On 13 April 2017 at 19:11, Wenyou Yang  wrote:
> The device tree source files of at91sam9m10g45ek boards are copied
> from the Linux v4.10, do the changes as below.
>  - Add the reg property for the pinctrl node.
>  - Move the gpio (pioA, pioB, pioC, pioD, pioE) nodes as the pinctrl's
>slibling nodes, instead of the child nodes.
>  - Add the "u-boot,dm-pre-reloc" property to determine which nodes
>are used by the board_init_f stage.
>  - Fix the compilation warnings.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v2: None
>
>  arch/arm/dts/Makefile |   2 +
>  arch/arm/dts/at91sam9g45.dtsi | 218 ---
>  arch/arm/dts/at91sam9m10g45ek.dts | 359 
> ++
>  3 files changed, 474 insertions(+), 105 deletions(-)
>  create mode 100644 arch/arm/dts/at91sam9m10g45ek.dts

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


Re: [U-Boot] [PATCH] rockchip: rk3399: use actual dram size

2017-04-16 Thread Simon Glass
On 12 April 2017 at 04:38, Kever Yang  wrote:
> Since our sdram driver is ready, we can use the actual size
> instead of hard code.
>
> Signed-off-by: Kever Yang 
> ---
>
>  arch/arm/mach-rockchip/rk3399/sdram_rk3399.c |  8 
>  board/rockchip/evb_rk3399/evb-rk3399.c   | 19 ++-
>  2 files changed, 22 insertions(+), 5 deletions(-)
>

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


Re: [U-Boot] [PATCH v2 1/3] configs: at91sam9n12ek: Update for DT and DM support

2017-04-16 Thread Simon Glass
On 12 April 2017 at 03:08, Wenyou Yang  wrote:
> Update the configuration files to support the device tree and driver
> model. The device clock and pins configuration are handled by the
> clock and the pinctrl drivers respectively.
>
> Because the limitation of internal SRAM size, the SPL with driver
> model can't be supported, disable the SPL option.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v2:
>  - Remain the SPI speed macros.
>  - Disable the SPL option for the nand config.
>  - Add support of Atmel uart be used in the board_init_f stage.
>  - Improve the commit log.
>
>  board/atmel/at91sam9n12ek/at91sam9n12ek.c |  2 ++
>  configs/at91sam9n12ek_mmc_defconfig   | 19 ++-
>  configs/at91sam9n12ek_nandflash_defconfig | 25 ++---
>  configs/at91sam9n12ek_spiflash_defconfig  | 26 ++
>  include/configs/at91sam9n12ek.h   | 19 +--
>  5 files changed, 57 insertions(+), 34 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 v5 10/16] cmd: gpt: add print_gpt_info_err

2017-04-16 Thread Simon Glass
On 13 April 2017 at 03:52, Patrick Delaunay  wrote:

Commit message here

> Signed-off-by: Patrick Delaunay 
> Reviewed-by: Christophe KERELLO 
> ---
>
> Changes in v5: None
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
>
>  cmd/gpt.c | 23 ---
>  1 file changed, 12 insertions(+), 11 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 v3 2/3] board: at91sam9263ek: Clean up code

2017-04-16 Thread Simon Glass
On 13 April 2017 at 21:07, Wenyou Yang  wrote:
> Because the introduction of the pinctrl and clk drivers and the
> device tree files, remove unneeded hard coded related code from
> the board file.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v3: None
> Changes in v2: None
>
>  board/atmel/at91sam9263ek/at91sam9263ek.c | 59 
> ---
>  1 file changed, 59 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 v3 2/3] board: at91sam9rlek: Clean up code

2017-04-16 Thread Simon Glass
On 13 April 2017 at 20:49, Wenyou Yang  wrote:
> Since the introduction of the pinctrl and clk drivers and the
> device tree files, remove unneeded hard coded related code from
> the board file.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v3: None
> Changes in v2: None
>
>  board/atmel/at91sam9rlek/at91sam9rlek.c | 19 ---
>  1 file changed, 19 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 2/3] board: at91sam9m10g45ek: Clean up code

2017-04-16 Thread Simon Glass
On 12 April 2017 at 03:03, Wenyou Yang  wrote:
> Since the introduction of the pinctrl and clk drivers and the
> device tree files, remove unneeded hard coded related code from
> the board file.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v2: None
>
>  board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c | 102 
> 
>  1 file changed, 102 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 2/6] ARM: dts: at91: Add dts files for at91sam9n12ek

2017-04-16 Thread Simon Glass
On 13 April 2017 at 19:11, Wenyou Yang  wrote:
> The device tree source files of at91sam9n12ek boards are copied from
> the Linux v4.10, do the changes as below.
>  - Add the reg property for the pinctrl node.
>  - Move the gpio (pioA, pioB, pioC, pioD) nodes as the pinctrl's
>slibling nodes, instead of the child nodes.
>  - Change the compatible of the spi flash to "spi-flash".
>  - Add the spi0 aliases.
>  - Fix the pinctrl-names of mmc0 node.
>  - Add the "u-boot,dm-pre-reloc" property to determine which nodes
>are used by the board_init_f stage.
>  - Fix the compilation warnings.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v2: None
>
>  arch/arm/dts/Makefile  |2 +
>  arch/arm/dts/at91sam9n12.dtsi  | 1064 
> 
>  arch/arm/dts/at91sam9n12ek.dts |  265 ++
>  3 files changed, 1331 insertions(+)
>  create mode 100644 arch/arm/dts/at91sam9n12.dtsi
>  create mode 100644 arch/arm/dts/at91sam9n12ek.dts

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


  1   2   >