Re: [U-Boot] [BUG] Build failure conga-qeval20-qa3-e3845

2019-07-28 Thread Bin Meng
+Stefan

Hi Heinrich,

On Sun, Jul 28, 2019 at 2:32 PM Heinrich Schuchardt  wrote:
>
>
> Hello Tom,
>
> origin/master commit bfe28bc70fc8b192878d6e8b7f7db344091643cf fails to
> build conga-qeval20-qa3-e3845 on Debian Buster:
>

I cannot reproduce it. Did you set CONFIG_BUILD_ROM = y?

> binman: Filename 'descriptor.bin' not found in input path
> (.,.,./board/congatec/conga-qeval20-qa3-e3845)
> (cwd='/home/user/workspace/u-boot')
> make: *** [Makefile:1415: u-boot.rom] Error 1
>
> The only descriptor.bin file I can find is
> ./tools/binman/test/descriptor.bin
>
> https://gitlab.denx.de/u-boot/custodians/u-boot-efi/-/jobs/2155 has a
> different error for the same board:
>
> +Compiler aborting due to parser-detected syntax error(s)
> +board/congatec/conga-qeval20-qa3-e3845/dsdt.asl.tmp731:
> +Error6126 - syntax error, unexpected $end and premature End-Of-File
> +
> +make[2]: *** [board/congatec/conga-qeval20-qa3-e3845/dsdt.c] Error 255
> +make[1]: *** [board/congatec/conga-qeval20-qa3-e3845] Error 2
> +make: *** [sub-make] Error 2
>

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


Re: [U-Boot] [PATCH 1/1] efi_loader: re-enable GRUB workaround on 32bit ARM

2019-07-28 Thread Heinrich Schuchardt
On 7/27/19 11:58 AM, Alexander Graf wrote:
>
> On 27.07.19 10:02, Heinrich Schuchardt wrote:
>> GRUB on ARM 32bit prior to version 2.04 lacks proper handling of caches.
>> In U-Boot v2019.04 a workaround for this was inadvertently removed.
>>
>> The workaround is currently also needed for booting on systems with
>> caches
>> that cannot be managed via CP15 (e.g. with an i.MX6 CPU).
>>
>> Re-enable the workaround and make it customizable.
>>
>> Fixes: f69d63fae281 ("efi_loader: use efi_start_image() for bootefi")
>> Signed-off-by: Heinrich Schuchardt 
>> ---
>>   lib/efi_loader/Kconfig    |  8 
>>   lib/efi_loader/efi_boottime.c | 28 +---
>>   2 files changed, 21 insertions(+), 15 deletions(-)
>>
>> diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
>> index a7f2c68fa9..c7027a9676 100644
>> --- a/lib/efi_loader/Kconfig
>> +++ b/lib/efi_loader/Kconfig
>> @@ -107,4 +107,12 @@ config EFI_HAVE_RUNTIME_RESET
>>   default y
>>   depends on ARCH_BCM283X || FSL_LAYERSCAPE || PSCI_RESET ||
>> SYSRESET_X86
>>
>> +config EFI_GRUB_ARM32_WORKAROUND
>> +    bool "Workaround for GRUB on 32bit ARM"
>> +    default y
>> +    depends on ARM && !ARM64
>> +    help
>> +  GRUB prior to version 2.04 requires U-Boot to disable caches. This
>> +  workaround currently is also needed on systems with caches that
>> +  cannot be managed via CP15.
>>   endif
>> diff --git a/lib/efi_loader/efi_boottime.c
>> b/lib/efi_loader/efi_boottime.c
>> index 4f6e8d1679..f75ca1a67c 100644
>> --- a/lib/efi_loader/efi_boottime.c
>> +++ b/lib/efi_loader/efi_boottime.c
>> @@ -39,14 +39,6 @@ LIST_HEAD(efi_register_notify_events);
>>   /* Handle of the currently executing image */
>>   static efi_handle_t current_image;
>>
>> -/*
>> - * If we're running on nasty systems (32bit ARM booting into non-EFI
>> Linux)
>> - * we need to do trickery with caches. Since we don't want to break
>> the EFI
>> - * aware boot path, only apply hacks when loading exiting directly
>> (breaking
>> - * direct Linux EFI booting along the way - oh well).
>> - */
>> -static bool efi_is_direct_boot = true;
>
>
> By removing the toggling, you now couple a U-Boot configuration variant
> to a specific grub version. New grub versions will run Linux using the
> EFI stub. So enabling CONFIG_EFI_GRUB_ARM32_WORKAROUND means only old
> versions work, but new grub versions break.

No, the Wandboard boots fine with GRUB 2.04 and Linux 4.19.55. Do you
have any negative test results?

>
> We really should treat this like any other erratum and make it as
> runtime detected as possible, so that we don't block people from making
> forward progress towards a the "sane" boot path.

It is not possible to determine at runtime which assumptions a loaded
EFI binary makes about the cache. Your original logic counting the
number of StartImage() invocations cannot detect this. This is why I
added a customizing option.

>
> Btw, has there been any solution for the non-CP15 caches? They would
> still be broken with this applied, as payloads can rely on CP15 caches
> enabled (for unaligned accesses), but non-CP15 caches disabled, right?

No, this will need future work. With CONFIG_EFI_GRUB_ARM32_WORKAROUND=y
all caches are disabled.

On i.MX6 CONFIG_SYS_L2CACHE_OFF=y selectively disables the non-CP15
cache. So here CONFIG_EFI_GRUB_ARM32_WORKAROUND=n and
CONFIG_SYS_L2CACHE_OFF=y result in compliance with the UEFI spec.

Best regards

Heinrich

>
>
> Thanks,
>
> Alex
>
>
>> -
>>   #ifdef CONFIG_ARM
>>   /*
>>    * The "gd" pointer lives in a register on ARM and AArch64 that we
>> declare
>> @@ -1911,13 +1903,21 @@ error:
>>    */
>>   static void efi_exit_caches(void)
>>   {
>> -#if defined(CONFIG_ARM) && !defined(CONFIG_ARM64)
>> +#if defined(CONFIG_EFI_GRUB_ARM32_WORKAROUND)
>>   /*
>> - * Grub on 32bit ARM needs to have caches disabled before jumping
>> into
>> - * a zImage, but does not know of all cache layers. Give it a hand.
>> + * Boooting Linux via GRUB prior to version 2.04 fails on 32bit
>> ARM if
>> + * caches are enabled.
>> + *
>> + * TODO:
>> + * According to the UEFI spec caches that can be managed via CP15
>> + * operations should be enabled. Caches requiring platform
>> information
>> + * to manage should be disabled. This should not happen in
>> + * ExitBootServices() but before invoking any UEFI binary is
>> invoked.
>> + *
>> + * We want to keep the current workaround while GRUB prior to
>> version
>> + * 2.04 is still in use.
>>    */
>> -    if (efi_is_direct_boot)
>> -    cleanup_before_linux();
>> +    cleanup_before_linux();
>>   #endif
>>   }
>>
>> @@ -2893,8 +2893,6 @@ efi_status_t EFIAPI efi_start_image(efi_handle_t
>> image_handle,
>>   if (ret != EFI_SUCCESS)
>>   return EFI_EXIT(EFI_INVALID_PARAMETER);
>>
>> -    efi_is_direct_boot = false;
>> -
>>   image_obj->exit_data_size = exit_data_size;
>>   image_obj->exit_data = exit_dat

Re: [U-Boot] [BUG] Build failure conga-qeval20-qa3-e3845

2019-07-28 Thread Heinrich Schuchardt
On 7/28/19 9:41 AM, Bin Meng wrote:
> +Stefan
>
> Hi Heinrich,
>
> On Sun, Jul 28, 2019 at 2:32 PM Heinrich Schuchardt  
> wrote:
>>
>>
>> Hello Tom,
>>
>> origin/master commit bfe28bc70fc8b192878d6e8b7f7db344091643cf fails to
>> build conga-qeval20-qa3-e3845 on Debian Buster:
>>
>
> I cannot reproduce it. Did you set CONFIG_BUILD_ROM = y?

My expectation is that if I call 'make
conga-qeval20-qa3-e3845_defconfig' it sets all necessary configuration
options to build successfully. This defconfig results in

# CONFIG_BUILD_ROM is not set

Setting CONFIG_BUILD_ROM=y does not solve the problem.

Did you delete all *.bin files before testing? 'make mrproper' does not
delete *.bin from the build path. Shouldn't it remove generated *.bin?

Best regards

Heinrich

>
>> binman: Filename 'descriptor.bin' not found in input path
>> (.,.,./board/congatec/conga-qeval20-qa3-e3845)
>> (cwd='/home/user/workspace/u-boot')
>> make: *** [Makefile:1415: u-boot.rom] Error 1
>>
>> The only descriptor.bin file I can find is
>> ./tools/binman/test/descriptor.bin
>>
>> https://gitlab.denx.de/u-boot/custodians/u-boot-efi/-/jobs/2155 has a
>> different error for the same board:
>>
>> +Compiler aborting due to parser-detected syntax error(s)
>> +board/congatec/conga-qeval20-qa3-e3845/dsdt.asl.tmp731:
>> +Error6126 - syntax error, unexpected $end and premature End-Of-File
>> +
>> +make[2]: *** [board/congatec/conga-qeval20-qa3-e3845/dsdt.c] Error 255
>> +make[1]: *** [board/congatec/conga-qeval20-qa3-e3845] Error 2
>> +make: *** [sub-make] Error 2
>>
>
> Regards,
> Bin
>

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


Re: [U-Boot] [BUG] Build failure conga-qeval20-qa3-e3845

2019-07-28 Thread Bin Meng
On Sun, Jul 28, 2019 at 4:33 PM Heinrich Schuchardt  wrote:
>
> On 7/28/19 9:41 AM, Bin Meng wrote:
> > +Stefan
> >
> > Hi Heinrich,
> >
> > On Sun, Jul 28, 2019 at 2:32 PM Heinrich Schuchardt  
> > wrote:
> >>
> >>
> >> Hello Tom,
> >>
> >> origin/master commit bfe28bc70fc8b192878d6e8b7f7db344091643cf fails to
> >> build conga-qeval20-qa3-e3845 on Debian Buster:
> >>
> >
> > I cannot reproduce it. Did you set CONFIG_BUILD_ROM = y?
>
> My expectation is that if I call 'make
> conga-qeval20-qa3-e3845_defconfig' it sets all necessary configuration
> options to build successfully. This defconfig results in
>
> # CONFIG_BUILD_ROM is not set
>

Sorry I was not clear. CONFIG_BUILD_ROM should not be set. When it is
unset, it does not touch descriptor.bin. I thought you previously had
it enabled hence binman tried to find descriptor.bin.

> Setting CONFIG_BUILD_ROM=y does not solve the problem.
>
> Did you delete all *.bin files before testing? 'make mrproper' does not
> delete *.bin from the build path. Shouldn't it remove generated *.bin?
>

*.bin in the board directory is kept there because it's not generated
during U-Boot build.

I still cannot reproduce this. Not sure what's wrong.

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


Re: [U-Boot] [BUG] Build failure conga-qeval20-qa3-e3845

2019-07-28 Thread Heinrich Schuchardt
On 7/28/19 10:56 AM, Bin Meng wrote:
> On Sun, Jul 28, 2019 at 4:33 PM Heinrich Schuchardt  
> wrote:
>>
>> On 7/28/19 9:41 AM, Bin Meng wrote:
>>> +Stefan
>>>
>>> Hi Heinrich,
>>>
>>> On Sun, Jul 28, 2019 at 2:32 PM Heinrich Schuchardt  
>>> wrote:


 Hello Tom,

 origin/master commit bfe28bc70fc8b192878d6e8b7f7db344091643cf fails to
 build conga-qeval20-qa3-e3845 on Debian Buster:

>>>
>>> I cannot reproduce it. Did you set CONFIG_BUILD_ROM = y?
>>
>> My expectation is that if I call 'make
>> conga-qeval20-qa3-e3845_defconfig' it sets all necessary configuration
>> options to build successfully. This defconfig results in
>>
>> # CONFIG_BUILD_ROM is not set
>>
>
> Sorry I was not clear. CONFIG_BUILD_ROM should not be set. When it is
> unset, it does not touch descriptor.bin. I thought you previously had
> it enabled hence binman tried to find descriptor.bin.
>
>> Setting CONFIG_BUILD_ROM=y does not solve the problem.
>>
>> Did you delete all *.bin files before testing? 'make mrproper' does not
>> delete *.bin from the build path. Shouldn't it remove generated *.bin?
>>
>
> *.bin in the board directory is kept there because it's not generated
> during U-Boot build.
>
> I still cannot reproduce this. Not sure what's wrong.

In my .bashrc I had export BUILD_ROM=y. In earlier releases
qemu-x86_defconfig needed this. If I unset this variable the build works
on my local system. Thanks for the hint.

This still leaves me with the question what is broken on Gitlab (Travis
CI ran fine).

Best regards

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


Re: [U-Boot] [BUG] Build failure conga-qeval20-qa3-e3845

2019-07-28 Thread Bin Meng
On Sun, Jul 28, 2019 at 5:08 PM Heinrich Schuchardt  wrote:
>
> On 7/28/19 10:56 AM, Bin Meng wrote:
> > On Sun, Jul 28, 2019 at 4:33 PM Heinrich Schuchardt  
> > wrote:
> >>
> >> On 7/28/19 9:41 AM, Bin Meng wrote:
> >>> +Stefan
> >>>
> >>> Hi Heinrich,
> >>>
> >>> On Sun, Jul 28, 2019 at 2:32 PM Heinrich Schuchardt  
> >>> wrote:
> 
> 
>  Hello Tom,
> 
>  origin/master commit bfe28bc70fc8b192878d6e8b7f7db344091643cf fails to
>  build conga-qeval20-qa3-e3845 on Debian Buster:
> 
> >>>
> >>> I cannot reproduce it. Did you set CONFIG_BUILD_ROM = y?
> >>
> >> My expectation is that if I call 'make
> >> conga-qeval20-qa3-e3845_defconfig' it sets all necessary configuration
> >> options to build successfully. This defconfig results in
> >>
> >> # CONFIG_BUILD_ROM is not set
> >>
> >
> > Sorry I was not clear. CONFIG_BUILD_ROM should not be set. When it is
> > unset, it does not touch descriptor.bin. I thought you previously had
> > it enabled hence binman tried to find descriptor.bin.
> >
> >> Setting CONFIG_BUILD_ROM=y does not solve the problem.
> >>
> >> Did you delete all *.bin files before testing? 'make mrproper' does not
> >> delete *.bin from the build path. Shouldn't it remove generated *.bin?
> >>
> >
> > *.bin in the board directory is kept there because it's not generated
> > during U-Boot build.
> >
> > I still cannot reproduce this. Not sure what's wrong.
>
> In my .bashrc I had export BUILD_ROM=y. In earlier releases
> qemu-x86_defconfig needed this. If I unset this variable the build works
> on my local system. Thanks for the hint.
>

Good to hear.

> This still leaves me with the question what is broken on Gitlab (Travis
> CI ran fine).
>

I tried to look at the Gitlab log but when I opened
https://gitlab.denx.de/u-boot/custodians/u-boot-efi/-/jobs/2155, it
gave me 404.

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


[U-Boot] buildman rockchip

2019-07-28 Thread Kever Yang

Hi Simon,

    When I'm using the buildman for rockchip platform, it's always 
build only 20 boards,


and many boards are not build, there are 38 boards with its defconfig in 
configs/ dir,


could you help to check what's missing?


See build log:

https://travis-ci.org/keveryang/u-boot/jobs/564525467


Thanks,

- Kever



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


[U-Boot] [PATCH v2] x86: ich-spi: Convert driver to spi-mem ops

2019-07-28 Thread Bin Meng
From: Bernhard Messerklinger 

With the introduction of the new spi-mem model operations changed
slightly. The new spi-mem operations make things a bit easier to
handle for ich-spi flash interface. This patch converts the ich-spi
driver by using spi-mem operations.

Signed-off-by: Bernhard Messerklinger 
Reviewed-by: Bin Meng 
Tested-by: Bin Meng 
[bmeng: make 2 routines static; update commit message a little bit]
Signed-off-by: Bin Meng 

---

Changes in v2:
- make 2 routines static; update commit message a little bit

 drivers/spi/ich.c | 252 --
 drivers/spi/ich.h |   9 +-
 2 files changed, 97 insertions(+), 164 deletions(-)

diff --git a/drivers/spi/ich.c b/drivers/spi/ich.c
index 03531a8..c1ab880 100644
--- a/drivers/spi/ich.c
+++ b/drivers/spi/ich.c
@@ -14,6 +14,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include "ich.h"
 
@@ -171,18 +173,6 @@ static int ich_init_controller(struct udevice *dev,
return 0;
 }
 
-static inline void spi_use_out(struct spi_trans *trans, unsigned bytes)
-{
-   trans->out += bytes;
-   trans->bytesout -= bytes;
-}
-
-static inline void spi_use_in(struct spi_trans *trans, unsigned bytes)
-{
-   trans->in += bytes;
-   trans->bytesin -= bytes;
-}
-
 static void spi_lock_down(struct ich_spi_platdata *plat, void *sbase)
 {
if (plat->ich_version == ICHV_7) {
@@ -213,47 +203,12 @@ static bool spi_lock_status(struct ich_spi_platdata 
*plat, void *sbase)
return lock != 0;
 }
 
-static void spi_setup_type(struct spi_trans *trans, int data_bytes)
-{
-   trans->type = 0xFF;
-
-   /* Try to guess spi type from read/write sizes */
-   if (trans->bytesin == 0) {
-   if (trans->bytesout + data_bytes > 4)
-   /*
-* If bytesin = 0 and bytesout > 4, we presume this is
-* a write data operation, which is accompanied by an
-* address.
-*/
-   trans->type = SPI_OPCODE_TYPE_WRITE_WITH_ADDRESS;
-   else
-   trans->type = SPI_OPCODE_TYPE_WRITE_NO_ADDRESS;
-   return;
-   }
-
-   if (trans->bytesout == 1) { /* and bytesin is > 0 */
-   trans->type = SPI_OPCODE_TYPE_READ_NO_ADDRESS;
-   return;
-   }
-
-   if (trans->bytesout == 4)   /* and bytesin is > 0 */
-   trans->type = SPI_OPCODE_TYPE_READ_WITH_ADDRESS;
-
-   /* Fast read command is called with 5 bytes instead of 4 */
-   if (trans->out[0] == SPI_OPCODE_FAST_READ && trans->bytesout == 5) {
-   trans->type = SPI_OPCODE_TYPE_READ_WITH_ADDRESS;
-   --trans->bytesout;
-   }
-}
-
 static int spi_setup_opcode(struct ich_spi_priv *ctlr, struct spi_trans *trans,
bool lock)
 {
uint16_t optypes;
uint8_t opmenu[ctlr->menubytes];
 
-   trans->opcode = trans->out[0];
-   spi_use_out(trans, 1);
if (!lock) {
/* The lock is off, so just use index 0. */
ich_writeb(ctlr, trans->opcode, ctlr->opmenu);
@@ -300,26 +255,6 @@ static int spi_setup_opcode(struct ich_spi_priv *ctlr, 
struct spi_trans *trans,
}
 }
 
-static int spi_setup_offset(struct spi_trans *trans)
-{
-   /* Separate the SPI address and data */
-   switch (trans->type) {
-   case SPI_OPCODE_TYPE_READ_NO_ADDRESS:
-   case SPI_OPCODE_TYPE_WRITE_NO_ADDRESS:
-   return 0;
-   case SPI_OPCODE_TYPE_READ_WITH_ADDRESS:
-   case SPI_OPCODE_TYPE_WRITE_WITH_ADDRESS:
-   trans->offset = ((uint32_t)trans->out[0] << 16) |
-   ((uint32_t)trans->out[1] << 8) |
-   ((uint32_t)trans->out[2] << 0);
-   spi_use_out(trans, 3);
-   return 1;
-   default:
-   printf("Unrecognized SPI transaction type %#x\n", trans->type);
-   return -EPROTO;
-   }
-}
-
 /*
  * Wait for up to 6s til status register bit(s) turn 1 (in case wait_til_set
  * below is true) or 0. In case the wait was for the bit(s) to set - write
@@ -350,7 +285,7 @@ static int ich_status_poll(struct ich_spi_priv *ctlr, u16 
bitmask,
return -ETIMEDOUT;
 }
 
-void ich_spi_config_opcode(struct udevice *dev)
+static void ich_spi_config_opcode(struct udevice *dev)
 {
struct ich_spi_priv *ctlr = dev_get_priv(dev);
 
@@ -365,73 +300,35 @@ void ich_spi_config_opcode(struct udevice *dev)
ich_writel(ctlr, SPI_OPMENU_UPPER, ctlr->opmenu + sizeof(u32));
 }
 
-static int ich_spi_xfer(struct udevice *dev, unsigned int bitlen,
-   const void *dout, void *din, unsigned long flags)
+static int ich_spi_exec_op(struct spi_slave *slave, const struct spi_mem_op 
*op)
 {
-   struct udevice *bus = dev_get_parent(dev);
+   struct udevice *bus = dev_get_parent(slave->dev);
  

Re: [U-Boot] [BUG] Build failure conga-qeval20-qa3-e3845

2019-07-28 Thread Bin Meng
On Sun, Jul 28, 2019 at 5:52 PM Heinrich Schuchardt  wrote:
>
> On 7/28/19 11:35 AM, Bin Meng wrote:
> > On Sun, Jul 28, 2019 at 5:08 PM Heinrich Schuchardt  
> > wrote:
> >>
> >> On 7/28/19 10:56 AM, Bin Meng wrote:
> >>> On Sun, Jul 28, 2019 at 4:33 PM Heinrich Schuchardt  
> >>> wrote:
> 
>  On 7/28/19 9:41 AM, Bin Meng wrote:
> > +Stefan
> >
> > Hi Heinrich,
> >
> > On Sun, Jul 28, 2019 at 2:32 PM Heinrich Schuchardt 
> >  wrote:
> >>
> >>
> >> Hello Tom,
> >>
> >> origin/master commit bfe28bc70fc8b192878d6e8b7f7db344091643cf fails to
> >> build conga-qeval20-qa3-e3845 on Debian Buster:
> >>
> >
> > I cannot reproduce it. Did you set CONFIG_BUILD_ROM = y?
> 
>  My expectation is that if I call 'make
>  conga-qeval20-qa3-e3845_defconfig' it sets all necessary configuration
>  options to build successfully. This defconfig results in
> 
>  # CONFIG_BUILD_ROM is not set
> 
> >>>
> >>> Sorry I was not clear. CONFIG_BUILD_ROM should not be set. When it is
> >>> unset, it does not touch descriptor.bin. I thought you previously had
> >>> it enabled hence binman tried to find descriptor.bin.
> >>>
>  Setting CONFIG_BUILD_ROM=y does not solve the problem.
> 
>  Did you delete all *.bin files before testing? 'make mrproper' does not
>  delete *.bin from the build path. Shouldn't it remove generated *.bin?
> 
> >>>
> >>> *.bin in the board directory is kept there because it's not generated
> >>> during U-Boot build.
> >>>
> >>> I still cannot reproduce this. Not sure what's wrong.
> >>
> >> In my .bashrc I had export BUILD_ROM=y. In earlier releases
> >> qemu-x86_defconfig needed this. If I unset this variable the build works
> >> on my local system. Thanks for the hint.
> >>
> >
> > Good to hear.
> >
> >> This still leaves me with the question what is broken on Gitlab (Travis
> >> CI ran fine).
> >>
> >
> > I tried to look at the Gitlab log but when I opened
> > https://gitlab.denx.de/u-boot/custodians/u-boot-efi/-/jobs/2155, it
> > gave me 404.
>
> To me was shown only when logged on.
>

I have been logged on but still cannot see that. I suspect that's
because I am not a member of the u-boot-efi git repo.

> I append the log below.
>
> Best regards
>
> Heinrich
>
>
>
> U-Boot
> Custodians
> EFI U-Boot Custodian TreeEFI U-Boot Custodian Tree
> Jobs
> #2155
>
> failed Job #2155 triggered 11 hours ago by Heinrich Schuchardt's avatar
> Heinrich Schuchardt
>
>
> Running with gitlab-runner 12.0.1 (0e5417a3)
>   on konsulko-bootbake G37FKVsV
> Using Docker executor with image
> trini/u-boot-gitlab-ci-runner:xenial-20190720-24Jul2019 ...
> Pulling docker image
> trini/u-boot-gitlab-ci-runner:xenial-20190720-24Jul2019 ...
> Using docker image
> sha256:5b1c8d4e86ff4494305883637941b882b324282a91d57d6157d1140e7a67d9d3
> for trini/u-boot-gitlab-ci-runner:xenial-20190720-24Jul2019 ...
> Running on runner-G37FKVsV-project-553-concurrent-0 via bootbake...
> Fetching changes...
> Reinitialized existing Git repository in
> /builds/u-boot/custodians/u-boot-efi/.git/
> Checking out 5bab6711 as efi-2019-10...
> Removing boards.cfg
> Removing tools/binman/cbfs_util.pyc
> Removing tools/binman/cmdline.pyc
> Removing tools/binman/control.pyc
> Removing tools/binman/elf.pyc
> Removing tools/binman/entry.pyc
> Removing tools/binman/etype/__init__.pyc
> Removing tools/binman/etype/blob.pyc
> Removing tools/binman/etype/blob_dtb.pyc
> Removing tools/binman/etype/fdtmap.pyc
> Removing tools/binman/etype/image_header.pyc
> Removing tools/binman/etype/powerpc_mpc85xx_bootpg_resetvec.pyc
> Removing tools/binman/etype/section.pyc
> Removing tools/binman/etype/u_boot_dtb_with_ucode.pyc
> Removing tools/binman/etype/u_boot_with_ucode_ptr.pyc
> Removing tools/binman/image.pyc
> Removing tools/binman/state.pyc
> Removing tools/buildman/board.pyc
> Removing tools/buildman/bsettings.pyc
> Removing tools/buildman/builder.pyc
> Removing tools/buildman/builderthread.pyc
> Removing tools/buildman/cmdline.pyc
> Removing tools/buildman/control.pyc
> Removing tools/buildman/kconfiglib.pyc
> Removing tools/buildman/toolchain.pyc
> Removing tools/concurrencytest/concurrencytest.pyc
> Removing tools/dtoc/fdt.pyc
> Removing tools/dtoc/fdt_util.pyc
> Removing tools/patman/checkpatch.pyc
> Removing tools/patman/command.pyc
> Removing tools/patman/commit.pyc
> Removing tools/patman/cros_subprocess.pyc
> Removing tools/patman/get_maintainer.pyc
> Removing tools/patman/gitutil.pyc
> Removing tools/patman/patchstream.pyc
> Removing tools/patman/series.pyc
> Removing tools/patman/settings.pyc
> Removing tools/patman/terminal.pyc
> Removing tools/patman/test_util.pyc
> Removing tools/patman/tools.pyc
> Removing tools/patman/tout.pyc
>
> Skipping Git submodules setup
> $ ret=0; ./tools/buildman/buildman -P -E -x arm,powerpc || ret=$?; if [[
> $ret -ne 0 && $ret -ne 129 ]]; then ./tools/buildman/buildman -sdeP;
> exit $ret; fi;
> Buildin

Re: [U-Boot] [BUG] Build failure conga-qeval20-qa3-e3845

2019-07-28 Thread Tom Rini
On Sun, Jul 28, 2019 at 03:41:17PM +0800, Bin Meng wrote:
> +Stefan
> 
> Hi Heinrich,
> 
> On Sun, Jul 28, 2019 at 2:32 PM Heinrich Schuchardt  
> wrote:
> >
> >
> > Hello Tom,
> >
> > origin/master commit bfe28bc70fc8b192878d6e8b7f7db344091643cf fails to
> > build conga-qeval20-qa3-e3845 on Debian Buster:
> >
> 
> I cannot reproduce it. Did you set CONFIG_BUILD_ROM = y?
> 
> > binman: Filename 'descriptor.bin' not found in input path
> > (.,.,./board/congatec/conga-qeval20-qa3-e3845)
> > (cwd='/home/user/workspace/u-boot')
> > make: *** [Makefile:1415: u-boot.rom] Error 1
> >
> > The only descriptor.bin file I can find is
> > ./tools/binman/test/descriptor.bin
> >
> > https://gitlab.denx.de/u-boot/custodians/u-boot-efi/-/jobs/2155 has a
> > different error for the same board:
> >
> > +Compiler aborting due to parser-detected syntax error(s)
> > +board/congatec/conga-qeval20-qa3-e3845/dsdt.asl.tmp731:
> > +Error6126 - syntax error, unexpected $end and premature End-Of-File
> > +
> > +make[2]: *** [board/congatec/conga-qeval20-qa3-e3845/dsdt.c] Error 255
> > +make[1]: *** [board/congatec/conga-qeval20-qa3-e3845] Error 2
> > +make: *** [sub-make] Error 2

Yes, this is a build race that we see rarely on Travis and more
frequently on GitLab due to the faster machines.

-- 
Tom


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


Re: [U-Boot] [BUG] Build failure conga-qeval20-qa3-e3845

2019-07-28 Thread Bin Meng
On Sun, Jul 28, 2019 at 8:02 PM Tom Rini  wrote:
>
> On Sun, Jul 28, 2019 at 03:41:17PM +0800, Bin Meng wrote:
> > +Stefan
> >
> > Hi Heinrich,
> >
> > On Sun, Jul 28, 2019 at 2:32 PM Heinrich Schuchardt  
> > wrote:
> > >
> > >
> > > Hello Tom,
> > >
> > > origin/master commit bfe28bc70fc8b192878d6e8b7f7db344091643cf fails to
> > > build conga-qeval20-qa3-e3845 on Debian Buster:
> > >
> >
> > I cannot reproduce it. Did you set CONFIG_BUILD_ROM = y?
> >
> > > binman: Filename 'descriptor.bin' not found in input path
> > > (.,.,./board/congatec/conga-qeval20-qa3-e3845)
> > > (cwd='/home/user/workspace/u-boot')
> > > make: *** [Makefile:1415: u-boot.rom] Error 1
> > >
> > > The only descriptor.bin file I can find is
> > > ./tools/binman/test/descriptor.bin
> > >
> > > https://gitlab.denx.de/u-boot/custodians/u-boot-efi/-/jobs/2155 has a
> > > different error for the same board:
> > >
> > > +Compiler aborting due to parser-detected syntax error(s)
> > > +board/congatec/conga-qeval20-qa3-e3845/dsdt.asl.tmp731:
> > > +Error6126 - syntax error, unexpected $end and premature End-Of-File
> > > +
> > > +make[2]: *** [board/congatec/conga-qeval20-qa3-e3845/dsdt.c] Error 255
> > > +make[1]: *** [board/congatec/conga-qeval20-qa3-e3845] Error 2
> > > +make: *** [sub-make] Error 2
>
> Yes, this is a build race that we see rarely on Travis and more
> frequently on GitLab due to the faster machines.

OK, so I suspect the "build race" problem is with
conga-qeval20-qa3-e3845 that has 2 defconfigs, and both are trying to
build ASL files.

However in my local buildman testing I never met this. My local build
server is very fast, for sure it is faster than travis build machine.

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


Re: [U-Boot] [PATCH v6 5/8] x86: slimbootloader: Set TSC information for tsc_timer

2019-07-28 Thread Park, Aiden
Hi Andy,

> -Original Message-
> From: Andy Shevchenko [mailto:andy.shevche...@gmail.com]
> Sent: Saturday, July 27, 2019 6:06 AM
> To: Park, Aiden 
> Cc: Bin Meng ; U-Boot Mailing List  b...@lists.denx.de>; Simon Glass 
> Subject: Re: [PATCH v6 5/8] x86: slimbootloader: Set TSC information for
> tsc_timer
> 
> On Fri, Jul 26, 2019 at 3:50 PM Park, Aiden  wrote:
> > > On Fri, Jul 26, 2019 at 10:00 AM Park, Aiden  wrote:
> > > >
> > > > Slim Bootloader already calibrated TSC and provides it to U-Boot.
> > > > Therefore, U-Boot does not have to re-calibrate TSC.
> > > > Configuring tsc_base and clock_rate makes x86 tsc_timer driver
> > > > bypass TSC calibration and use the provided TSC frequency.
> > > > - Get TSC frequency from performance info hob
> > > > - Set tsc_base and clock_rate for tsc_timer driver
> > >
> > > I'm still not convinced to have this. As kernel followed by U-Boot
> > > we thrust hardware more than something else.
> > > One more layer in between is usually an additional point to be 
> > > error-prone.
> > >
> > > So, if something we may get directly from hardware, I consider
> > > better to get it from there.
> > >
> > > Of course, data structures can be left for sake of self-documentation.
> > >
> > Basically, Providing known information to a payload is Slim Bootloader
> > architecture concept. Slim Bootloader does initialize chipset and
> > hardware as much as it can, and provides useful information to a
> > payload in HOBs to minimize hardware re-initialization in a payload,
> > make it generic and make it light-weight.
> >
> > TSC frequency is specific to CPU or chipset, and the way to get exact
> > TSC frequency also varies depending on CPU.
> > ex) checking cpuid, platform info MSR, perf MSR for LFM/HFM/Turbo Mode,
> or FSB.
> > All these consideration has already done in Slim Bootloader on each CPUs.
> >
> > I think that U-Boot tsc_timer also considers this case, and that's why
> > tsc_timer skips calibration in its probing time if tsc_base and
> > clock_rate are already configured.
> >
> > Kernel uses many timers like TSC, APIC timer, 8254 timer, HPET and so on.
> > I also understand kernel trusts hardware and re-calibrate them because
> > all these timers may not be properly configured in boot firmware stage.
> > But, HOB information including TSC must be trusted between Slim
> > Bootloader and its payload(U-Boot) in Slim Bootloader architecture.
> 
> Okay, I didn't remember if this is described in documentation.
> If it's not, please, add a section and put there somelike you expleined to me 
> here.
> 
Thanks for your understanding. Let me add more description in documentation.

> --
> With Best Regards,
> Andy Shevchenko

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


Re: [U-Boot] [BUG] Build failure conga-qeval20-qa3-e3845

2019-07-28 Thread Tom Rini
On Sun, Jul 28, 2019 at 08:13:12PM +0800, Bin Meng wrote:
> On Sun, Jul 28, 2019 at 8:02 PM Tom Rini  wrote:
> >
> > On Sun, Jul 28, 2019 at 03:41:17PM +0800, Bin Meng wrote:
> > > +Stefan
> > >
> > > Hi Heinrich,
> > >
> > > On Sun, Jul 28, 2019 at 2:32 PM Heinrich Schuchardt  
> > > wrote:
> > > >
> > > >
> > > > Hello Tom,
> > > >
> > > > origin/master commit bfe28bc70fc8b192878d6e8b7f7db344091643cf fails to
> > > > build conga-qeval20-qa3-e3845 on Debian Buster:
> > > >
> > >
> > > I cannot reproduce it. Did you set CONFIG_BUILD_ROM = y?
> > >
> > > > binman: Filename 'descriptor.bin' not found in input path
> > > > (.,.,./board/congatec/conga-qeval20-qa3-e3845)
> > > > (cwd='/home/user/workspace/u-boot')
> > > > make: *** [Makefile:1415: u-boot.rom] Error 1
> > > >
> > > > The only descriptor.bin file I can find is
> > > > ./tools/binman/test/descriptor.bin
> > > >
> > > > https://gitlab.denx.de/u-boot/custodians/u-boot-efi/-/jobs/2155 has a
> > > > different error for the same board:
> > > >
> > > > +Compiler aborting due to parser-detected syntax error(s)
> > > > +board/congatec/conga-qeval20-qa3-e3845/dsdt.asl.tmp731:
> > > > +Error6126 - syntax error, unexpected $end and premature End-Of-File
> > > > +
> > > > +make[2]: *** [board/congatec/conga-qeval20-qa3-e3845/dsdt.c] Error 255
> > > > +make[1]: *** [board/congatec/conga-qeval20-qa3-e3845] Error 2
> > > > +make: *** [sub-make] Error 2
> >
> > Yes, this is a build race that we see rarely on Travis and more
> > frequently on GitLab due to the faster machines.
> 
> OK, so I suspect the "build race" problem is with
> conga-qeval20-qa3-e3845 that has 2 defconfigs, and both are trying to
> build ASL files.
> 
> However in my local buildman testing I never met this. My local build
> server is very fast, for sure it is faster than travis build machine.

Yes, something like that sounds likely.  It is a race and we've had it
for a long while.  If we're generating files in the source tree rather
than output directory we're going to hit a problem like this.

-- 
Tom


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


[U-Boot] [PATCH 00/39] env: common: Remove environment definitions from common.h

2019-07-28 Thread Simon Glass
At present common.h has a lot of uncommon declarations in it. Many of
these would be better placed elsewhere, in header files more related to
their purpose. In particular the environnment functions should move to
the environment headers. This should reduce the overall amount of code
compiled and the length of time taken to build U-Boot.

This series splits the current environment.h file into:

   env.h   common definitions widely used in U-Boot; and
   env_internal.h  features internal to the environment drivers, etc.

Most files can then include just env.h which is fairly small and does not
have any CONFIG magic.

At the same time some dead code was noticed in common.h so this series
removes some of this.

After this series common.h is down to about 400 lines. For reference it
was about 1000 lines up until 3 years ago.


Simon Glass (39):
  common: Move gzip functions into a new gzip header
  common: Drop the dpram_... functions
  common: Move lcd_setmem() to lcd.h
  common: Remove video_setmem()
  env: Create a new file for environment functions
  env: Move get_env_id() to env.h
  env: Move env_get_f() to env.h
  env: Move env_init() to env.h
  env: Move env_relocate() to env.h
  env: Move envmatch() to env.h
  env: Move env_set_hex() to env.h
  env: Move env_set_ulong() to env.h
  env: Move env_get_ulong() to env.h
  env: Move env_get_yesno() to env.h
  env: Move env_get_hex() to env.h
  env: Move env_set() to env.h
  env: Move env_get() to env.h
  env: Move eth_env_get/set_enetaddr() to env.h
  env: Move uncommon functions to env.h
  env: Move set_default_vars to env.h
  env: Move env_load/save functions to env.h
  env: Move env import/export functions to env.h
  env: Drop env_crc_update()
  env: Move get/set_default_env() to env.h
  env: Move env_get_char() to env.h
  env: Move env_reloc() to env.h
  env: Rename environment to embedded_environment
  env: Move env_valid to env.h
  env: Move callback definitions to env.h
  env: Drop the ENTRY typdef
  env: Drop _ENTRY
  env: Rename the redundancy flags
  env: Drop the ACTION typedef
  env: Drop the double underscores in search.h
  env: Move TOTAL_MALLOC_LEN to environment.h
  env: Drop environment.h header file where not needed
  env: Rename environment.h to env_internal.h
  Drop PCMCIA
  common: Add a note about the effort to reduce common.h

 README|   2 +-
 api/api.c |   7 +-
 arch/arm/cpu/arm926ejs/spear/spr_misc.c   |   2 +-
 arch/arm/cpu/armv7/vf610/generic.c|   1 +
 arch/arm/cpu/armv8/fsl-layerscape/cpu.c   |   3 +-
 arch/arm/cpu/armv8/fsl-layerscape/soc.c   |   3 +-
 arch/arm/cpu/armv8/fsl-layerscape/spl.c   |   1 +
 arch/arm/lib/bootm.c  |   1 +
 arch/arm/mach-davinci/misc.c  |   2 +-
 arch/arm/mach-imx/cmd_dek.c   |   1 -
 arch/arm/mach-imx/mx6/opos6ul.c   |   4 +-
 arch/arm/mach-imx/mx7/soc.c   |   1 +
 arch/arm/mach-imx/video.c |   1 +
 arch/arm/mach-kirkwood/cpu.c  |   1 +
 arch/arm/mach-meson/board-common.c|   2 +-
 arch/arm/mach-omap2/boot-common.c |   1 -
 arch/arm/mach-omap2/omap3/clock.c |   1 -
 arch/arm/mach-omap2/utils.c   |   2 +-
 arch/arm/mach-rmobile/cpu_info.c  |   1 +
 arch/arm/mach-rockchip/rk3288-board.c |   1 +
 arch/arm/mach-socfpga/misc_gen5.c |   1 +
 arch/arm/mach-socfpga/misc_s10.c  |   1 +
 arch/arm/mach-stm32mp/cpu.c   |   2 +-
 arch/arm/mach-tegra/board2.c  |   1 +
 arch/arm/mach-tegra/cboot.c   |   2 +-
 arch/arm/mach-uniphier/board_late_init.c  |   1 +
 arch/arm/mach-uniphier/mmc-first-dev.c|   1 +
 arch/m68k/lib/bootm.c |   2 +-
 arch/microblaze/lib/bootm.c   |   1 +
 arch/mips/lib/bootm.c |   1 +
 arch/nds32/include/asm/u-boot.h   |   1 -
 arch/nds32/lib/bootm.c|   1 +
 arch/powerpc/cpu/mpc85xx/cpu_init.c   |   1 +
 arch/powerpc/cpu/mpc85xx/fdt.c|   2 +-
 arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c |   1 +
 arch/powerpc/cpu/mpc85xx/mp.c |   2 +
 arch/powerpc/lib/bootm.c  |   2 +-
 arch/riscv/include/asm/u-boot.h   |   1 -
 arch/x86/cpu/qemu/e820.c  |   1 +
 arch/x86/lib/zimage.c |   1 +
 arch/xtensa/lib/bootm.c   |   1 +
 board/Arcturus/ucp1020/cmd_arc.c  |   2 +-
 board/Arcturus/ucp1020/spl.c  |   3 +-
 board/Arcturus/ucp1020/ucp1020.c  |   1 +
 board/BuR/brppt1/board.c  |   1 +
 board/BuR/brxre1/board.c  |   1 +
 board/BuR/common/br_resetc.c  |   1 +
 board/BuR/common/common.c |   1

[U-Boot] [PATCH 01/39] common: Move gzip functions into a new gzip header

2019-07-28 Thread Simon Glass
As part of the effort to remove things from common.h, create a new header
for the gzip functions. Move the function declarations to it and add
missing documentation.

Signed-off-by: Simon Glass 
---

 board/menlo/m53menlo/m53menlo.c |   1 +
 cmd/bmp.c   |   8 +--
 cmd/config.c|   1 +
 cmd/fpga.c  |   1 +
 cmd/license.c   |   1 +
 cmd/unzip.c |   1 +
 cmd/ximg.c  |   1 +
 common/bootm.c  |   1 +
 common/spl/spl_fit.c|   1 +
 common/spl/spl_ymodem.c |   1 +
 drivers/video/cfb_console.c |   1 +
 fs/ubifs/ubifs.c|   1 +
 include/common.h|  52 
 include/gzip.h  | 103 
 lib/fdtdec.c|   1 +
 lib/gunzip.c|   5 +-
 lib/gzip.c  |   1 +
 test/compression.c  |   1 +
 18 files changed, 124 insertions(+), 58 deletions(-)
 create mode 100644 include/gzip.h

diff --git a/board/menlo/m53menlo/m53menlo.c b/board/menlo/m53menlo/m53menlo.c
index f2227f6992..a63af5fae0 100644
--- a/board/menlo/m53menlo/m53menlo.c
+++ b/board/menlo/m53menlo/m53menlo.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/cmd/bmp.c b/cmd/bmp.c
index 00f0256a30..d2a39f677f 100644
--- a/cmd/bmp.c
+++ b/cmd/bmp.c
@@ -9,16 +9,16 @@
  */
 
 #include 
-#include 
-#include 
-#include 
 #include 
 #include 
-#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 static int bmp_info (ulong addr);
 
diff --git a/cmd/config.c b/cmd/config.c
index fcc9116a49..d2810d573b 100644
--- a/cmd/config.c
+++ b/cmd/config.c
@@ -5,6 +5,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 #include "config_data_gz.h"
diff --git a/cmd/fpga.c b/cmd/fpga.c
index bc48abdd6d..aacf09f002 100644
--- a/cmd/fpga.c
+++ b/cmd/fpga.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 static long do_fpga_get_device(char *arg)
diff --git a/cmd/license.c b/cmd/license.c
index 1c0794f095..c5b04c331b 100644
--- a/cmd/license.c
+++ b/cmd/license.c
@@ -6,6 +6,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 #include "license_data_gz.h"
diff --git a/cmd/unzip.c b/cmd/unzip.c
index 6c0f97cb4b..8474d9becf 100644
--- a/cmd/unzip.c
+++ b/cmd/unzip.c
@@ -6,6 +6,7 @@
 
 #include 
 #include 
+#include 
 
 static int do_unzip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
diff --git a/cmd/ximg.c b/cmd/ximg.c
index 9e53cc4557..920a80edc8 100644
--- a/cmd/ximg.c
+++ b/cmd/ximg.c
@@ -13,6 +13,7 @@
  */
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/common/bootm.c b/common/bootm.c
index bea516025f..2cd47f96c8 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 969f7775c1..2e2e09eafb 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -7,6 +7,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/common/spl/spl_ymodem.c b/common/spl/spl_ymodem.c
index fa539ecd7a..20f4260062 100644
--- a/common/spl/spl_ymodem.c
+++ b/common/spl/spl_ymodem.c
@@ -9,6 +9,7 @@
  * Matt Porter 
  */
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 636c3e8c18..ac02921d46 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -66,6 +66,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index d5101d3c45..72e8a24d3b 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -12,6 +12,7 @@
  */
 
 #include 
+#include 
 #include 
 #include "ubifs.h"
 #include 
diff --git a/include/common.h b/include/common.h
index 2c21dee850..d337f68bc4 100644
--- a/include/common.h
+++ b/include/common.h
@@ -428,51 +428,6 @@ void   wait_ticks(unsigned long);
 ulong  usec2ticks(unsigned long usec);
 ulong  ticks2usec(unsigned long ticks);
 
-/* lib/gunzip.c */
-int gzip_parse_header(const unsigned char *src, unsigned long len);
-int gunzip(void *, int, unsigned char *, unsigned long *);
-int zunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp,
-   int stoponerr, int offset);
-
-/**
- * gzwrite progress indicators: defined weak to allow board-specific
- * overrides:
- *
- * gzwrite_progress_init called on startup
- * gzwrite_progress called during decompress/write loop
- * gzwrite_progress_finish called at end of loop to
- * indicate success (retcode=0) or failure
- */
-void gzwrite_progress_init(u64 expected_size);
-
-void gzwrite_progress(int iteration,
-u64 by

[U-Boot] [PATCH 02/39] common: Drop the dpram_... functions

2019-07-28 Thread Simon Glass
These declarations are not used anymore, so drop them.

Signed-off-by: Simon Glass 
---

 include/common.h | 5 -
 1 file changed, 5 deletions(-)

diff --git a/include/common.h b/include/common.h
index d337f68bc4..df589163e5 100644
--- a/include/common.h
+++ b/include/common.h
@@ -379,11 +379,6 @@ void   enable_interrupts  (void);
 intdisable_interrupts (void);
 
 /* $(CPU)/.../commproc.c */
-intdpram_init (void);
-uint   dpram_base(void);
-uint   dpram_base_align(uint align);
-uint   dpram_alloc(uint size);
-uint   dpram_alloc_align(uint size,uint align);
 void   bootcount_store (ulong);
 ulong  bootcount_load (void);
 
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 03/39] common: Move lcd_setmem() to lcd.h

2019-07-28 Thread Simon Glass
This function relates to lcd.h and is about to become obsolete with the
driver-model conversion. Move it out of common.h

Signed-off-by: Simon Glass 
---

 common/board_f.c | 1 +
 include/common.h | 3 ---
 include/lcd.h| 1 +
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/common/board_f.c b/common/board_f.c
index 4760d728f3..ed3cf6afbe 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/common.h b/include/common.h
index df589163e5..e96dc7ebc6 100644
--- a/include/common.h
+++ b/include/common.h
@@ -385,9 +385,6 @@ ulong   bootcount_load (void);
 /* $(CPU)/.../ */
 void mii_init (void);
 
-/* $(CPU)/.../lcd.c */
-ulong  lcd_setmem (ulong);
-
 /* $(CPU)/.../video.c */
 ulong  video_setmem (ulong);
 
diff --git a/include/lcd.h b/include/lcd.h
index cb6b6a4d12..9a4c0da5ba 100644
--- a/include/lcd.h
+++ b/include/lcd.h
@@ -30,6 +30,7 @@ extern struct vidinfo panel_info;
 void lcd_ctrl_init(void *lcdbase);
 void lcd_enable(void);
 void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue);
+ulong lcd_setmem(ulong addr);
 
 /**
  * Set whether we need to flush the dcache when changing the LCD image. This
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 07/39] env: Move env_get_f() to env.h

2019-07-28 Thread Simon Glass
Move this function over to the new header file.

Signed-off-by: Simon Glass 
---

 arch/arm/cpu/armv8/fsl-layerscape/cpu.c   |  1 +
 arch/powerpc/cpu/mpc85xx/cpu_init.c   |  1 +
 arch/powerpc/cpu/mpc85xx/fdt.c|  1 +
 arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c |  1 +
 board/esd/meesc/meesc.c   |  1 +
 board/freescale/b4860qds/b4860qds.c   |  1 +
 board/freescale/mpc837xerdb/mpc837xerdb.c |  1 +
 board/liebherr/mccmon6/mccmon6.c  |  1 +
 board/micronas/vct/vct.c  |  1 +
 board/socrates/socrates.c |  1 +
 board/st/stm32mp1/stm32mp1.c  |  1 +
 board/xes/common/board.c  |  1 +
 cmd/mtdparts.c|  1 +
 drivers/ddr/fsl/fsl_ddr_gen4.c|  1 +
 drivers/ddr/fsl/interactive.c |  1 +
 drivers/ddr/fsl/options.c |  1 +
 drivers/mtd/cfi_flash.c   |  1 +
 drivers/mtd/mtd_uboot.c   |  1 +
 drivers/net/fm/b4860.c|  1 +
 include/common.h  | 12 
 include/env.h | 12 
 post/post.c   |  1 +
 22 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c 
b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
index edb9c96658..9577ada113 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
@@ -5,6 +5,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c 
b/arch/powerpc/cpu/mpc85xx/cpu_init.c
index cbcd62e19a..cac9280790 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
@@ -10,6 +10,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/arch/powerpc/cpu/mpc85xx/fdt.c b/arch/powerpc/cpu/mpc85xx/fdt.c
index 20ecca605f..d17c382cc9 100644
--- a/arch/powerpc/cpu/mpc85xx/fdt.c
+++ b/arch/powerpc/cpu/mpc85xx/fdt.c
@@ -7,6 +7,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c 
b/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
index 2fab9aaff4..fcfa730233 100644
--- a/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
+++ b/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
@@ -4,6 +4,7 @@
  */
 
 #include 
+#include 
 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
 #include 
 #endif
diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index 29b6341132..b0d2f7b6f8 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -10,6 +10,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/freescale/b4860qds/b4860qds.c 
b/board/freescale/b4860qds/b4860qds.c
index 9eed95b656..33cd4b4964 100644
--- a/board/freescale/b4860qds/b4860qds.c
+++ b/board/freescale/b4860qds/b4860qds.c
@@ -5,6 +5,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/freescale/mpc837xerdb/mpc837xerdb.c 
b/board/freescale/mpc837xerdb/mpc837xerdb.c
index 18f396aac8..4ad62bcf1d 100644
--- a/board/freescale/mpc837xerdb/mpc837xerdb.c
+++ b/board/freescale/mpc837xerdb/mpc837xerdb.c
@@ -6,6 +6,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/liebherr/mccmon6/mccmon6.c b/board/liebherr/mccmon6/mccmon6.c
index 0e069a7755..7d2751ab03 100644
--- a/board/liebherr/mccmon6/mccmon6.c
+++ b/board/liebherr/mccmon6/mccmon6.c
@@ -5,6 +5,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/micronas/vct/vct.c b/board/micronas/vct/vct.c
index af3f11e8ac..e73d16db3e 100644
--- a/board/micronas/vct/vct.c
+++ b/board/micronas/vct/vct.c
@@ -7,6 +7,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include "vct.h"
diff --git a/board/socrates/socrates.c b/board/socrates/socrates.c
index ff465a8ef2..da9ae5bebb 100644
--- a/board/socrates/socrates.c
+++ b/board/socrates/socrates.c
@@ -11,6 +11,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
index b99c6c08a3..1f9251d7a0 100644
--- a/board/st/stm32mp1/stm32mp1.c
+++ b/board/st/stm32mp1/stm32mp1.c
@@ -8,6 +8,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/xes/common/board.c b/board/xes/common/board.c
index 66467c6485..43575bc302 100644
--- a/board/xes/common/board.c
+++ b/board/xes/common/board.c
@@ -4,6 +4,7 @@
  */
 
 #include 
+#include 
 #include "fsl_8xxx_misc.h"
 
 int checkboard(void)
diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c
index f7ed1a0779..46155cabf6 100644
--- a/cmd/mtdparts.c
+++ b/cmd/mtdparts.c
@@ -72,6 +72,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/ddr/fsl/fsl_ddr_gen4.c b/drivers/ddr/fsl/fsl_ddr_gen4.c
index 30f786

[U-Boot] [PATCH 09/39] env: Move env_relocate() to env.h

2019-07-28 Thread Simon Glass
Move env_relocate() over to the new header file.

Signed-off-by: Simon Glass 
---

 common/board_r.c | 1 +
 env/common.c | 1 +
 include/common.h | 1 -
 include/env.h| 8 
 4 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/common/board_r.c b/common/board_r.c
index abc31b17b8..b0ab56faf1 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/env/common.c b/env/common.c
index bd340fe9d5..1fbc4a874d 100644
--- a/env/common.c
+++ b/env/common.c
@@ -9,6 +9,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/common.h b/include/common.h
index 55cbe1f97d..cb6b584b70 100644
--- a/include/common.h
+++ b/include/common.h
@@ -146,7 +146,6 @@ int do_fat_fsload(cmd_tbl_t *, int, int, char * const []);
 int do_ext2load(cmd_tbl_t *, int, int, char * const []);
 
 /* common/cmd_nvedit.c */
-void   env_relocate (void);
 intenvmatch (uchar *, int);
 
 /**
diff --git a/include/env.h b/include/env.h
index 5d205ef02d..72980962bf 100644
--- a/include/env.h
+++ b/include/env.h
@@ -31,6 +31,14 @@ int env_get_id(void);
  */
 int env_init(void);
 
+/**
+ * env_relocate() - Set up the post-relocation environment
+ *
+ * This loads the environment into RAM so that it can be modified. This is
+ * called after relocation, before the environment is used
+ */
+void env_relocate(void);
+
 /**
  * env_get_f() - Look up the value of an environment variable (early)
  *
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 15/39] env: Move env_get_hex() to env.h

2019-07-28 Thread Simon Glass
Move env_get_hex() over to the new header file.

Signed-off-by: Simon Glass 
---

 arch/x86/lib/zimage.c |  1 +
 cmd/elf.c |  1 +
 common/image-fdt.c|  1 +
 include/common.h  | 12 
 include/env.h | 12 
 5 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c
index 230b38e938..6a6258a505 100644
--- a/arch/x86/lib/zimage.c
+++ b/arch/x86/lib/zimage.c
@@ -13,6 +13,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/cmd/elf.c b/cmd/elf.c
index d883be4193..5e5cf47cf8 100644
--- a/cmd/elf.c
+++ b/cmd/elf.c
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/common/image-fdt.c b/common/image-fdt.c
index e70da3dcb3..4247dcee0c 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/common.h b/include/common.h
index 83050073bf..8d8bbc4da3 100644
--- a/include/common.h
+++ b/include/common.h
@@ -157,18 +157,6 @@ int do_ext2load(cmd_tbl_t *, int, int, char * const []);
  */
 char *env_get(const char *varname);
 
-/**
- * env_get_hex() - Return an environment variable as a hex value
- *
- * Decode an environment as a hex number (it may or may not have a 0x
- * prefix). If the environment variable cannot be found, or does not start
- * with hex digits, the default value is returned.
- *
- * @varname:   Variable to decode
- * @default_val:   Value to return on error
- */
-ulong env_get_hex(const char *varname, ulong default_val);
-
 /**
  * env_set() - set an environment variable
  *
diff --git a/include/env.h b/include/env.h
index d7190da335..dd063feb39 100644
--- a/include/env.h
+++ b/include/env.h
@@ -93,6 +93,18 @@ ulong env_get_ulong(const char *name, int base, ulong 
default_val);
  */
 int env_set_ulong(const char *varname, ulong value);
 
+/**
+ * env_get_hex() - Return an environment variable as a hex value
+ *
+ * Decode an environment as a hex number (it may or may not have a 0x
+ * prefix). If the environment variable cannot be found, or does not start
+ * with hex digits, the default value is returned.
+ *
+ * @varname:   Variable to decode
+ * @default_val:   Value to return on error
+ */
+ulong env_get_hex(const char *varname, ulong default_val);
+
 /**
  * env_set_hex() - set an environment variable to a hex value
  *
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 14/39] env: Move env_get_yesno() to env.h

2019-07-28 Thread Simon Glass
Move env_get_yesno() over to the new header file.

Signed-off-by: Simon Glass 
---

 arch/powerpc/cpu/mpc85xx/mp.c   | 1 +
 board/gateworks/gw_ventana/gw_ventana_spl.c | 1 +
 cmd/source.c| 1 +
 include/common.h| 6 --
 include/env.h   | 8 
 5 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/mp.c b/arch/powerpc/cpu/mpc85xx/mp.c
index b0aa72ed6e..119d4b3510 100644
--- a/arch/powerpc/cpu/mpc85xx/mp.c
+++ b/arch/powerpc/cpu/mpc85xx/mp.c
@@ -4,6 +4,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/gateworks/gw_ventana/gw_ventana_spl.c 
b/board/gateworks/gw_ventana/gw_ventana_spl.c
index 740fc57b91..6886ff9b33 100644
--- a/board/gateworks/gw_ventana/gw_ventana_spl.c
+++ b/board/gateworks/gw_ventana/gw_ventana_spl.c
@@ -5,6 +5,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/cmd/source.c b/cmd/source.c
index 1a9a71aa37..3a51ebf0b6 100644
--- a/cmd/source.c
+++ b/cmd/source.c
@@ -16,6 +16,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/common.h b/include/common.h
index 48f443e851..83050073bf 100644
--- a/include/common.h
+++ b/include/common.h
@@ -169,12 +169,6 @@ char *env_get(const char *varname);
  */
 ulong env_get_hex(const char *varname, ulong default_val);
 
-/*
- * Read an environment variable as a boolean
- * Return -1 if variable does not exist (default to true)
- */
-int env_get_yesno(const char *var);
-
 /**
  * env_set() - set an environment variable
  *
diff --git a/include/env.h b/include/env.h
index 9124718f2d..d7190da335 100644
--- a/include/env.h
+++ b/include/env.h
@@ -63,6 +63,14 @@ int env_match(unsigned char *name, int index);
  */
 int env_get_f(const char *name, char *buf, unsigned int len);
 
+/**
+ * env_get_yesno() - Read an environment variable as a boolean
+ *
+ * @return 1 if yes/true (Y/y/T/t), -1 if variable does not exist (i.e. default
+ * to true), 0 if otherwise
+ */
+int env_get_yesno(const char *var);
+
 /**
  * env_get_ulong() - Return an environment variable as an integer value
  *
-- 
2.22.0.709.g102302147b-goog

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


Re: [U-Boot] [PATCH 0/4] Make some changes to SDP

2019-07-28 Thread Angus Ainslie

Hi Sherry,

On 2019-07-17 18:40, sherry sun wrote:

From: Sherry Sun 

This patchset adds:
1. Add usb_gadget_initialize() and usb_gadget_release() to initialize 
and

release UDC during sdp download.
2. Add high speed endpoint descriptor for sdp.
3. Add a macro definition--CONFIG_SDP_LOADADDR as default sdp load
address while SDP_WRITE and SDP_JUMP command addr is zero.

Sherry Sun (4):
  imx: spl: Change USB boot device type
  SDP: use CONFIG_SDP_LOADADDR as default load address
  SDP: fix wrong usb request size and add high speed endpoint 
descriptor

  SDP: Call usb_gadget_initialize and usb_gadget_release to support UDC


These changes look like like they target SDP on imx8. For imx8mq is this 
all that is required to get SDP working with uuu or are there additional 
changes required ?


Thanks
Angus



 arch/arm/mach-imx/spl.c|  2 +-
 common/spl/spl_sdp.c   |  4 
 drivers/usb/gadget/Kconfig |  4 
 drivers/usb/gadget/f_sdp.c | 39 +-
 4 files changed, 43 insertions(+), 6 deletions(-)

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


[U-Boot] [PATCH 18/39] env: Move eth_env_get/set_enetaddr() to env.h

2019-07-28 Thread Simon Glass
Move these two functions over to the new header file.

Signed-off-by: Simon Glass 
---

 include/env.h | 18 ++
 include/environment.h |  2 --
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/include/env.h b/include/env.h
index 297fd7a071..2e9a850284 100644
--- a/include/env.h
+++ b/include/env.h
@@ -164,4 +164,22 @@ static inline int env_set_addr(const char *varname, const 
void *addr)
 int env_complete(char *var, int maxv, char *cmdv[], int maxsz, char *buf,
 bool dollar_comp);
 
+/**
+ * eth_env_get_enetaddr() - Get an ethernet address from the environmnet
+ *
+ * @name: Environment variable to get (e.g. "ethaddr")
+ * @enetaddr: Place to put MAC address (6 bytes)
+ * @return 0 if OK, 1 on error
+ */
+int eth_env_get_enetaddr(const char *name, uint8_t *enetaddr);
+
+/**
+ * eth_env_set_enetaddr() - Set an ethernet address in the environmnet
+ *
+ * @name: Environment variable to set (e.g. "ethaddr")
+ * @enetaddr: Pointer to MAC address to put into the variable (6 bytes)
+ * @return 0 if OK, 1 on error
+ */
+int eth_env_set_enetaddr(const char *name, const uint8_t *enetaddr);
+
 #endif
diff --git a/include/environment.h b/include/environment.h
index de67cf4f0e..77915f459e 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -326,8 +326,6 @@ int env_erase(void);
 void env_fix_drivers(void);
 
 void eth_parse_enetaddr(const char *addr, uint8_t *enetaddr);
-int eth_env_get_enetaddr(const char *name, uint8_t *enetaddr);
-int eth_env_set_enetaddr(const char *name, const uint8_t *enetaddr);
 
 #endif /* DO_DEPS_ONLY */
 
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 16/39] env: Move env_set() to env.h

2019-07-28 Thread Simon Glass
Move env_set() over to the new header file.

Signed-off-by: Simon Glass 
---

 arch/arm/cpu/arm926ejs/spear/spr_misc.c   |  1 +
 arch/arm/cpu/armv7/vf610/generic.c|  1 +
 arch/arm/cpu/armv8/fsl-layerscape/soc.c   |  1 +
 arch/arm/mach-davinci/misc.c  |  1 +
 arch/arm/mach-imx/mx6/opos6ul.c   |  1 +
 arch/arm/mach-imx/mx7/soc.c   |  1 +
 arch/arm/mach-meson/board-common.c|  1 +
 arch/arm/mach-omap2/utils.c   |  1 +
 arch/arm/mach-rmobile/cpu_info.c  |  1 +
 arch/arm/mach-rockchip/rk3288-board.c |  1 +
 arch/arm/mach-socfpga/misc_gen5.c |  1 +
 arch/arm/mach-socfpga/misc_s10.c  |  1 +
 arch/arm/mach-stm32mp/cpu.c   |  1 +
 arch/arm/mach-tegra/board2.c  |  1 +
 board/Arcturus/ucp1020/cmd_arc.c  |  1 +
 board/Arcturus/ucp1020/ucp1020.c  |  1 +
 board/CZ.NIC/turris_mox/turris_mox.c  |  1 +
 board/LaCie/net2big_v2/net2big_v2.c   |  1 +
 board/LaCie/netspace_v2/netspace_v2.c |  1 +
 board/Synology/ds414/cmd_syno.c   |  1 +
 board/alliedtelesis/x530/x530.c   |  1 +
 board/amazon/kc1/kc1.c|  1 +
 board/amlogic/p200/p200.c |  1 +
 board/amlogic/p201/p201.c |  1 +
 board/amlogic/p212/p212.c |  1 +
 board/amlogic/q200/q200.c |  1 +
 board/aristainetos/aristainetos-v2.c  |  1 +
 board/armltd/integrator/integrator.c  |  1 +
 board/atmel/common/board.c|  1 +
 board/atmel/common/mac_eeprom.c   |  1 +
 board/atmel/sama5d3xek/sama5d3xek.c   |  1 +
 board/bachmann/ot1200/ot1200.c|  1 +
 board/bosch/shc/board.c   |  1 +
 board/buffalo/lsxl/lsxl.c |  1 +
 board/cadence/xtfpga/xtfpga.c |  1 +
 board/ccv/xpress/xpress.c |  1 +
 board/compulab/cl-som-imx7/cl-som-imx7.c  |  1 +
 board/compulab/cm_fx6/cm_fx6.c|  1 +
 board/compulab/cm_t335/cm_t335.c  |  1 +
 board/compulab/cm_t35/cm_t35.c|  1 +
 board/compulab/cm_t54/cm_t54.c|  1 +
 board/congatec/cgtqmx6eval/cgtqmx6eval.c  |  1 +
 board/cssi/MCR3000/MCR3000.c  |  1 +
 board/davinci/da8xxevm/da850evm.c |  1 +
 board/davinci/da8xxevm/omapl138_lcdk.c|  1 +
 board/dhelectronics/dh_imx6/dh_imx6.c |  1 +
 board/eets/pdu001/board.c |  1 +
 board/el/el6x/el6x.c  |  1 +
 board/freescale/common/cmd_esbc_validate.c|  1 +
 board/freescale/common/fsl_chain_of_trust.c   |  1 +
 board/freescale/common/sys_eeprom.c   |  1 +
 board/freescale/imx8mq_evk/imx8mq_evk.c   |  1 +
 board/freescale/imx8qm_mek/imx8qm_mek.c   |  1 +
 board/freescale/imx8qxp_mek/imx8qxp_mek.c |  1 +
 board/freescale/ls2080ardb/ls2080ardb.c   |  1 +
 board/freescale/mpc8323erdb/mpc8323erdb.c |  1 +
 board/freescale/mx53loco/mx53loco.c   |  1 +
 board/freescale/mx6sabreauto/mx6sabreauto.c   |  1 +
 board/freescale/mx6sabresd/mx6sabresd.c   |  1 +
 board/freescale/mx6sxsabresd/mx6sxsabresd.c   |  1 +
 board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c |  1 +
 board/freescale/mx6ullevk/mx6ullevk.c |  1 +
 board/gardena/smart-gateway-at91sam/board.c   |  1 +
 board/gardena/smart-gateway-mt7688/board.c|  1 +
 board/gateworks/gw_ventana/gw_ventana.c   |  1 +
 board/ge/bx50v3/bx50v3.c  |  1 +
 board/ge/common/ge_common.c   |  1 +
 board/ge/mx53ppd/mx53ppd.c|  1 +
 board/grinn/chiliboard/board.c|  1 +
 board/gumstix/pepper/board.c  |  1 +
 board/highbank/highbank.c |  1 +
 board/intel/edison/edison.c   |  1 +
 board/isee/igep003x/board.c   |  1 +
 board/isee/igep00x0/igep00x0.c|  1 +
 board/k+p/kp_imx53/kp_id_rev.c|  1 +
 board/k+p/kp_imx53/kp_imx53.c |  1 +
 board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c |  1 +
 board/keymile/common/common.c |  1 +
 board/keymile/common/ivm.c|  1 +
 board/keymile/km83xx/km83xx.c |  1 +
 board/keymile/km_arm/km_arm.c |  1 +
 board/keymile/kmp204x/kmp204x.c   |  1 +
 board/kosagi/novena/novena.c  |  1 +
 board/laird/wb50n/wb50n.c |  1 +
 board/lg/sniper/sniper.c

[U-Boot] [PATCH 17/39] env: Move env_get() to env.h

2019-07-28 Thread Simon Glass
Move env_get() over to the new header file.

Signed-off-by: Simon Glass 
---

 arch/arm/lib/bootm.c |  1 +
 arch/arm/mach-imx/video.c|  1 +
 arch/arm/mach-kirkwood/cpu.c |  1 +
 arch/m68k/lib/bootm.c|  1 +
 arch/microblaze/lib/bootm.c  |  1 +
 arch/nds32/lib/bootm.c   |  1 +
 arch/powerpc/cpu/mpc85xx/mp.c|  1 +
 arch/powerpc/lib/bootm.c |  1 +
 arch/xtensa/lib/bootm.c  |  1 +
 board/BuS/eb_cpu5282/eb_cpu5282.c|  1 +
 board/CarMediaLab/flea3/flea3.c  |  1 +
 board/bluegiga/apx4devkit/apx4devkit.c   |  1 +
 board/bluewater/gurnard/gurnard.c|  1 +
 board/broadcom/bcm23550_w1d/bcm23550_w1d.c   |  1 +
 board/broadcom/bcm28155_ap/bcm28155_ap.c |  1 +
 board/compulab/common/omap3_display.c|  1 +
 board/freescale/bsc9131rdb/bsc9131rdb.c  |  1 +
 board/freescale/bsc9132qds/bsc9132qds.c  |  1 +
 board/freescale/c29xpcie/c29xpcie.c  |  1 +
 board/freescale/common/vid.c |  1 +
 board/freescale/corenet_ds/corenet_ds.c  |  1 +
 board/freescale/ls1088a/eth_ls1088aqds.c |  1 +
 board/freescale/ls1088a/ls1088a.c|  1 +
 board/freescale/ls2080aqds/eth.c |  1 +
 board/freescale/ls2080aqds/ls2080aqds.c  |  1 +
 board/freescale/lx2160a/eth_lx2160aqds.c |  1 +
 board/freescale/mpc837xemds/pci.c|  1 +
 board/freescale/mpc8572ds/mpc8572ds.c|  1 +
 board/freescale/mx51evk/mx51evk_video.c  |  1 +
 board/freescale/mx53loco/mx53loco_video.c|  1 +
 board/freescale/p1010rdb/p1010rdb.c  |  1 +
 board/freescale/p1022ds/p1022ds.c|  1 +
 board/freescale/p1023rdb/p1023rdb.c  |  1 +
 board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c  |  1 +
 board/freescale/p1_twr/p1_twr.c  |  1 +
 board/freescale/p2041rdb/p2041rdb.c  |  1 +
 board/freescale/t102xqds/t102xqds.c  |  1 +
 board/freescale/t102xrdb/t102xrdb.c  |  1 +
 board/freescale/t1040qds/t1040qds.c  |  1 +
 board/freescale/t104xrdb/t104xrdb.c  |  1 +
 board/freescale/t208xqds/t208xqds.c  |  1 +
 board/freescale/t208xrdb/t208xrdb.c  |  1 +
 board/freescale/t4qds/t4240emu.c |  1 +
 board/freescale/t4qds/t4240qds.c |  1 +
 board/freescale/t4rdb/t4240rdb.c |  1 +
 board/gateworks/gw_ventana/common.c  |  1 +
 board/gdsys/a38x/keyprogram.c|  1 +
 board/gdsys/mpc8308/hrcon.c  |  1 +
 board/gdsys/mpc8308/strider.c|  1 +
 board/gdsys/p1022/controlcenterd.c   |  1 +
 board/hisilicon/poplar/poplar.c  |  1 +
 board/menlo/m53menlo/m53menlo.c  |  1 +
 board/nvidia/p2371-2180/p2371-2180.c |  1 +
 board/nvidia/p2771-/p2771-.c |  1 +
 board/renesas/alt/alt.c  |  1 +
 board/renesas/gose/gose.c|  1 +
 board/renesas/koelsch/koelsch.c  |  1 +
 board/renesas/lager/lager.c  |  1 +
 board/renesas/porter/porter.c|  1 +
 board/renesas/silk/silk.c|  1 +
 board/renesas/stout/stout.c  |  1 +
 board/samsung/common/exynos5-dt.c|  1 +
 board/samsung/odroid/odroid.c|  1 +
 board/siemens/common/board.c |  1 +
 board/ti/ks2_evm/board.c |  1 +
 board/toradex/common/tdx-cfg-block.c |  1 +
 board/varisys/cyrus/cyrus.c  |  1 +
 board/work-microwave/work_92105/work_92105_display.c |  1 +
 cmd/bdinfo.c |  1 +
 cmd/bootefi.c|  1 +
 cmd/bootm.c  |  1 +
 cmd/bootmenu.c   |  1 +
 cmd/fpga.c   |  1 +
 cmd/itest.c  |  1 +
 cmd/mvebu/bubt.c |  1 +
 common/bootretry.c   |  1 +
 common/cli.c |  1 +
 common/cli_simple.c  |  1 +
 common/fdt_support.c |  1 +
 common/image.c   |  1 +
 common/spl/spl_ext.c

[U-Boot] [PATCH 04/39] common: Remove video_setmem()

2019-07-28 Thread Simon Glass
This function is no-longer defined in U-Boot. Drop the declaration from
common.h

Signed-off-by: Simon Glass 
---

 common/board_f.c | 7 ---
 include/common.h | 3 ---
 2 files changed, 10 deletions(-)

diff --git a/common/board_f.c b/common/board_f.c
index ed3cf6afbe..7d656fae6a 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -426,13 +426,6 @@ static int reserve_video(void)
gd->relocaddr = lcd_setmem(gd->relocaddr);
gd->fb_base = gd->relocaddr;
 #  endif /* CONFIG_FB_ADDR */
-#elif defined(CONFIG_VIDEO) && \
-   (!defined(CONFIG_PPC)) && \
-   !defined(CONFIG_ARM) && !defined(CONFIG_X86) && \
-   !defined(CONFIG_M68K)
-   /* reserve memory for video display (always full pages) */
-   gd->relocaddr = video_setmem(gd->relocaddr);
-   gd->fb_base = gd->relocaddr;
 #endif
 
return 0;
diff --git a/include/common.h b/include/common.h
index e96dc7ebc6..4d0dd3f1b7 100644
--- a/include/common.h
+++ b/include/common.h
@@ -385,9 +385,6 @@ ulong   bootcount_load (void);
 /* $(CPU)/.../ */
 void mii_init (void);
 
-/* $(CPU)/.../video.c */
-ulong  video_setmem (ulong);
-
 /* arch/$(ARCH)/lib/cache.c */
 void   enable_caches(void);
 void   flush_cache   (unsigned long, unsigned long);
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 10/39] env: Move envmatch() to env.h

2019-07-28 Thread Simon Glass
Move envmatch() over to the new header file. Also rename it to env_match()
to better line up with other functions.

Signed-off-by: Simon Glass 
---

 cmd/nvedit.c| 12 ++--
 examples/api/glue.c |  3 ++-
 include/common.h|  3 ---
 include/env.h   | 11 +++
 4 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 4f3edab8b9..751b77d0e9 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -709,7 +709,7 @@ int env_get_f(const char *name, char *buf, unsigned len)
return -1;
}
 
-   val = envmatch((uchar *)name, i);
+   val = env_match((uchar *)name, i);
if (val < 0)
continue;
 
@@ -785,15 +785,7 @@ U_BOOT_CMD(
 #endif
 #endif /* CONFIG_SPL_BUILD */
 
-
-/*
- * Match a name / name=value pair
- *
- * s1 is either a simple 'name', or a 'name=value' pair.
- * i2 is the environment index for a 'name2=value2' pair.
- * If the names match, return the index for the value2, else -1.
- */
-int envmatch(uchar *s1, int i2)
+int env_match(uchar *s1, int i2)
 {
if (s1 == NULL)
return -1;
diff --git a/examples/api/glue.c b/examples/api/glue.c
index 9c8ed8d11c..4086616a94 100644
--- a/examples/api/glue.c
+++ b/examples/api/glue.c
@@ -4,6 +4,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 
@@ -365,7 +366,7 @@ const char * ub_env_enum(const char *last)
 
/*
 * It's OK to pass only the name piece as last (and not the whole
-* 'name=val' string), since the API_ENUM_ENV call uses envmatch()
+* 'name=val' string), since the API_ENUM_ENV call uses env_match()
 * internally, which handles such case
 */
if (!syscall(API_ENV_ENUM, NULL, last, &env))
diff --git a/include/common.h b/include/common.h
index cb6b584b70..26ec18ded4 100644
--- a/include/common.h
+++ b/include/common.h
@@ -145,9 +145,6 @@ int do_fat_fsload(cmd_tbl_t *, int, int, char * const []);
 /* common/cmd_ext2.c */
 int do_ext2load(cmd_tbl_t *, int, int, char * const []);
 
-/* common/cmd_nvedit.c */
-intenvmatch (uchar *, int);
-
 /**
  * env_get() - Look up the value of an environment variable
  *
diff --git a/include/env.h b/include/env.h
index 72980962bf..bf34ac3f86 100644
--- a/include/env.h
+++ b/include/env.h
@@ -39,6 +39,17 @@ int env_init(void);
  */
 void env_relocate(void);
 
+/**
+ * env_match() - Match a name / name=value pair
+ *
+ * This is used prior to relocation for finding envrionment variables
+ *
+ * @name: A simple 'name', or a 'name=value' pair.
+ * @index: The environment index for a 'name2=value2' pair.
+ * @return index for the value if the names match, else -1.
+ */
+int env_match(unsigned char *name, int index);
+
 /**
  * env_get_f() - Look up the value of an environment variable (early)
  *
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 24/39] env: Move get/set_default_env() to env.h

2019-07-28 Thread Simon Glass
Move these functions to the new header file and rename set_default_env()
to env_set_default() so that it has a consistent env_ prefix.

Signed-off-by: Simon Glass 
---

 arch/arm/mach-imx/mx6/opos6ul.c |  2 +-
 board/phytec/pcm052/pcm052.c|  2 +-
 cmd/nvedit.c|  2 +-
 common/board_r.c|  2 +-
 common/spl/spl_dfu.c|  2 +-
 env/common.c| 14 +++---
 env/ext4.c  |  3 ++-
 env/fat.c   |  3 ++-
 env/mmc.c   |  5 +++--
 env/nand.c  |  7 ---
 env/sata.c  |  3 ++-
 env/sf.c| 11 ++-
 env/ubi.c   |  7 ---
 include/env.h   | 11 +++
 include/environment.h   |  6 --
 15 files changed, 46 insertions(+), 34 deletions(-)

diff --git a/arch/arm/mach-imx/mx6/opos6ul.c b/arch/arm/mach-imx/mx6/opos6ul.c
index 8b921a7d37..183a0c961c 100644
--- a/arch/arm/mach-imx/mx6/opos6ul.c
+++ b/arch/arm/mach-imx/mx6/opos6ul.c
@@ -128,7 +128,7 @@ int board_late_init(void)
 
/* In bootstrap don't use the env vars */
if (((reg & 0x300) >> 24) == 0x1) {
-   set_default_env(NULL, 0);
+   env_set_default(NULL, 0);
env_set("preboot", "");
}
 
diff --git a/board/phytec/pcm052/pcm052.c b/board/phytec/pcm052/pcm052.c
index dffd03786d..2417111765 100644
--- a/board/phytec/pcm052/pcm052.c
+++ b/board/phytec/pcm052/pcm052.c
@@ -377,7 +377,7 @@ int board_late_init(void)
if ((reg & SRC_SBMR1_BOOTCFG1_SDMMC) &&
!(reg & SRC_SBMR1_BOOTCFG1_MMC)) {
printf("-- SD card boot ---\n");
-   set_default_env("!LVFBootloader", 0);
+   env_set_default("!LVFBootloader", 0);
env_set("bootcmd",
"run prepare_install_bk4r1_envs; run install_bk4r1rs");
}
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 390d040de3..52ffa15fad 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -826,7 +826,7 @@ static int do_env_default(cmd_tbl_t *cmdtp, int flag,
debug("Final value for argc=%d\n", argc);
if (all && (argc == 0)) {
/* Reset the whole environment */
-   set_default_env("## Resetting to default environment\n",
+   env_set_default("## Resetting to default environment\n",
env_flag);
return 0;
}
diff --git a/common/board_r.c b/common/board_r.c
index b0ab56faf1..adaadb5f1c 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -448,7 +448,7 @@ static int initr_env(void)
if (should_load_env())
env_relocate();
else
-   set_default_env(NULL, 0);
+   env_set_default(NULL, 0);
 #ifdef CONFIG_OF_CONTROL
env_set_hex("fdtcontroladdr",
(unsigned long)map_to_sysmem(gd->fdt_blob));
diff --git a/common/spl/spl_dfu.c b/common/spl/spl_dfu.c
index a05b867567..3f54ae0260 100644
--- a/common/spl/spl_dfu.c
+++ b/common/spl/spl_dfu.c
@@ -39,7 +39,7 @@ int spl_dfu_cmd(int usbctrl, char *dfu_alt_info, char 
*interface, char *devstr)
int ret;
 
/* set default environment */
-   set_default_env(NULL, 0);
+   env_set_default(NULL, 0);
str_env = env_get(dfu_alt_info);
if (!str_env) {
pr_err("\"%s\" env variable not defined!\n", dfu_alt_info);
diff --git a/env/common.c b/env/common.c
index db2a033f68..1d9d0f934d 100644
--- a/env/common.c
+++ b/env/common.c
@@ -62,7 +62,7 @@ char *env_get_default(const char *name)
return ret_val;
 }
 
-void set_default_env(const char *s, int flags)
+void env_set_default(const char *s, int flags)
 {
if (sizeof(default_environment) > ENV_SIZE) {
puts("*** Error - default environment is too large\n\n");
@@ -118,7 +118,7 @@ int env_import(const char *buf, int check)
memcpy(&crc, &ep->crc, sizeof(crc));
 
if (crc32(0, ep->data, ENV_SIZE) != crc) {
-   set_default_env("bad CRC", 0);
+   env_set_default("bad CRC", 0);
return -ENOMSG; /* needed for env_load() */
}
}
@@ -131,7 +131,7 @@ int env_import(const char *buf, int check)
 
pr_err("Cannot import environment: errno = %d\n", errno);
 
-   set_default_env("import failed", 0);
+   env_set_default("import failed", 0);
 
return -EIO;
 }
@@ -156,7 +156,7 @@ int env_import_redund(const char *buf1, int buf1_read_fail,
}
 
if (buf1_read_fail && buf2_read_fail) {
-   set_default_env("bad env area", 0);
+   env_set_default("bad env area", 0);
return -EIO;
} else if (!buf1_read_fail && buf2_read_fail) {
gd->env_valid = ENV_VALID;
@@ -172,7 +172,7 @@ int env_import_redund(const char *buf1, int buf1

[U-Boot] [PATCH 29/39] env: Move callback definitions to env.h

2019-07-28 Thread Simon Glass
These definitions are effectively part of the 'public' API of the
environment implementation since they do not require access to any
internal variables. Move them to the env.h header.

Signed-off-by: Simon Glass 
---

 include/env.h  | 34 ++
 include/env_callback.h | 23 ---
 include/search.h   |  6 --
 3 files changed, 34 insertions(+), 29 deletions(-)

diff --git a/include/env.h b/include/env.h
index 93a4c3ed6b..3dbdf276cd 100644
--- a/include/env.h
+++ b/include/env.h
@@ -21,6 +21,40 @@ enum env_valid {
ENV_REDUND, /* Redundant environment is valid */
 };
 
+/** enum env_op - environment callback operation */
+enum env_op {
+   env_op_create,
+   env_op_delete,
+   env_op_overwrite,
+};
+
+/** struct env_clbk_tbl - declares a new callback */
+struct env_clbk_tbl {
+   const char *name;   /* Callback name */
+   int (*callback)(const char *name, const char *value, enum env_op op,
+   int flags);
+};
+
+/*
+ * Define a callback that can be associated with variables.
+ * when associated through the ".callbacks" environment variable, the callback
+ * will be executed any time the variable is inserted, overwritten, or deleted.
+ *
+ * For SPL these are silently dropped to reduce code size, since environment
+ * callbacks are not supported with SPL.
+ */
+#ifdef CONFIG_SPL_BUILD
+#define U_BOOT_ENV_CALLBACK(name, callback) \
+   static inline __maybe_unused void _u_boot_env_noop_##name(void) \
+   { \
+   (void)callback; \
+   }
+#else
+#define U_BOOT_ENV_CALLBACK(name, callback) \
+   ll_entry_declare(struct env_clbk_tbl, name, env_clbk) = \
+   {#name, callback}
+#endif
+
 /**
  * env_get_id() - Gets a sequence number for the environment
  *
diff --git a/include/env_callback.h b/include/env_callback.h
index 507a52e13c..3d30a33f5b 100644
--- a/include/env_callback.h
+++ b/include/env_callback.h
@@ -72,29 +72,6 @@
"serial#:serialno," \
CONFIG_ENV_CALLBACK_LIST_STATIC
 
-struct env_clbk_tbl {
-   const char *name;   /* Callback name */
-   int (*callback)(const char *name, const char *value, enum env_op op,
-   int flags);
-};
-
 void env_callback_init(ENTRY *var_entry);
 
-/*
- * Define a callback that can be associated with variables.
- * when associated through the ".callbacks" environment variable, the callback
- * will be executed any time the variable is inserted, overwritten, or deleted.
- */
-#ifdef CONFIG_SPL_BUILD
-#define U_BOOT_ENV_CALLBACK(name, callback) \
-   static inline __maybe_unused void _u_boot_env_noop_##name(void) \
-   { \
-   (void)callback; \
-   }
-#else
-#define U_BOOT_ENV_CALLBACK(name, callback) \
-   ll_entry_declare(struct env_clbk_tbl, name, env_clbk) = \
-   {#name, callback}
-#endif
-
 #endif /* __ENV_CALLBACK_H__ */
diff --git a/include/search.h b/include/search.h
index 9750336b5e..f9fb29fdf9 100644
--- a/include/search.h
+++ b/include/search.h
@@ -19,12 +19,6 @@
 
 #define __set_errno(val) do { errno = val; } while (0)
 
-enum env_op {
-   env_op_create,
-   env_op_delete,
-   env_op_overwrite,
-};
-
 /* Action which shall be performed in the call to hsearch.  */
 typedef enum {
FIND,
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 13/39] env: Move env_get_ulong() to env.h

2019-07-28 Thread Simon Glass
Move env_get_ulong() over to the new header file.

Signed-off-by: Simon Glass 
---

 board/BuR/brxre1/board.c  |  1 +
 board/gdsys/p1022/controlcenterd-id.c |  1 +
 board/synopsys/hsdk/env-lib.c |  1 +
 board/ti/ks2_evm/board_k2g.c  |  1 +
 board/toradex/colibri_imx6/colibri_imx6.c |  1 +
 include/common.h  | 13 -
 include/env.h | 13 +
 lib/fdtdec.c  |  1 +
 net/bootp.c   |  1 +
 9 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/board/BuR/brxre1/board.c b/board/BuR/brxre1/board.c
index 0d1c6c4720..873208c668 100644
--- a/board/BuR/brxre1/board.c
+++ b/board/BuR/brxre1/board.c
@@ -9,6 +9,7 @@
  *
  */
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/gdsys/p1022/controlcenterd-id.c 
b/board/gdsys/p1022/controlcenterd-id.c
index 6ac956caca..43f5404231 100644
--- a/board/gdsys/p1022/controlcenterd-id.c
+++ b/board/gdsys/p1022/controlcenterd-id.c
@@ -12,6 +12,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/synopsys/hsdk/env-lib.c b/board/synopsys/hsdk/env-lib.c
index 66e4581fae..f443c21e6d 100644
--- a/board/synopsys/hsdk/env-lib.c
+++ b/board/synopsys/hsdk/env-lib.c
@@ -5,6 +5,7 @@
  */
 
 #include "env-lib.h"
+#include 
 
 #define MAX_CMD_LEN25
 
diff --git a/board/ti/ks2_evm/board_k2g.c b/board/ti/ks2_evm/board_k2g.c
index 6d0fc21c67..4ff9a44b37 100644
--- a/board/ti/ks2_evm/board_k2g.c
+++ b/board/ti/ks2_evm/board_k2g.c
@@ -6,6 +6,7 @@
  * Texas Instruments Incorporated, 
  */
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/toradex/colibri_imx6/colibri_imx6.c 
b/board/toradex/colibri_imx6/colibri_imx6.c
index 6417ba4980..f657db87d8 100644
--- a/board/toradex/colibri_imx6/colibri_imx6.c
+++ b/board/toradex/colibri_imx6/colibri_imx6.c
@@ -8,6 +8,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
diff --git a/include/common.h b/include/common.h
index 283cb23fd1..48f443e851 100644
--- a/include/common.h
+++ b/include/common.h
@@ -157,19 +157,6 @@ int do_ext2load(cmd_tbl_t *, int, int, char * const []);
  */
 char *env_get(const char *varname);
 
-/**
- * env_get_ulong() - Return an environment variable as an integer value
- *
- * Most U-Boot environment variables store hex values. For those which store
- * (e.g.) base-10 integers, this function can be used to read the value.
- *
- * @name:  Variable to look up
- * @base:  Base to use (e.g. 10 for base 10, 2 for binary)
- * @default_val: Default value to return if no value is found
- * @return the value found, or @default_val if none
- */
-ulong env_get_ulong(const char *name, int base, ulong default_val);
-
 /**
  * env_get_hex() - Return an environment variable as a hex value
  *
diff --git a/include/env.h b/include/env.h
index 8898b78b8e..9124718f2d 100644
--- a/include/env.h
+++ b/include/env.h
@@ -63,6 +63,19 @@ int env_match(unsigned char *name, int index);
  */
 int env_get_f(const char *name, char *buf, unsigned int len);
 
+/**
+ * env_get_ulong() - Return an environment variable as an integer value
+ *
+ * Most U-Boot environment variables store hex values. For those which store
+ * (e.g.) base-10 integers, this function can be used to read the value.
+ *
+ * @name:  Variable to look up
+ * @base:  Base to use (e.g. 10 for base 10, 2 for binary)
+ * @default_val: Default value to return if no value is found
+ * @return the value found, or @default_val if none
+ */
+ulong env_get_ulong(const char *name, int base, ulong default_val);
+
 /**
  * env_set_ulong() - set an environment variable to an integer
  *
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 464de5b3b5..ef5e54875c 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -8,6 +8,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/net/bootp.c b/net/bootp.c
index 9a2b512e4a..505489140e 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -10,6 +10,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 39/39] common: Add a note about the effort to reduce common.h

2019-07-28 Thread Simon Glass
This file has quite a lot of general definitions and include files. Add a
note about our intent to remove more of this.

The file should ultimately include the configuration and perhaps a very
other very common things used by most U-Boot files.

Signed-off-by: Simon Glass 
---

 include/common.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/include/common.h b/include/common.h
index 2645ac9615..d8f302ea92 100644
--- a/include/common.h
+++ b/include/common.h
@@ -1,5 +1,11 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
+ * Common header file for U-Boot
+ *
+ * This file still includes quite a bit of stuff that should be in separate
+ * headers like command.h, cpu.h and timer.h. Please think before adding more
+ * things. Patches to remove things are welcome.
+ *
  * (C) Copyright 2000-2009
  * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
  */
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 22/39] env: Move env import/export functions to env.h

2019-07-28 Thread Simon Glass
Move these functions to the new header file.

Signed-off-by: Simon Glass 
---

 include/env.h | 38 ++
 include/environment.h | 12 
 2 files changed, 38 insertions(+), 12 deletions(-)

diff --git a/include/env.h b/include/env.h
index 2ba345fc4a..d6718fdf99 100644
--- a/include/env.h
+++ b/include/env.h
@@ -12,6 +12,8 @@
 #include 
 #include 
 
+struct environment_s;
+
 /**
  * env_get_id() - Gets a sequence number for the environment
  *
@@ -230,4 +232,40 @@ int env_save(void);
  */
 int env_erase(void);
 
+/**
+ * env_import() - Import from a binary representation into hash table
+ *
+ * This imports the environment from a buffer. THe format for each variable is
+ * var=value\0 with a double \0 at the end of the buffer.
+ *
+ * @buf: Buffer containing the environment (struct environemnt_s *)
+ * @check: non-zero to check the CRC at the start of the environment, 0 to
+ * ignore it
+ * @return 0 if imported successfully, -ENOMSG if the CRC was bad, -EIO if
+ * something else went wrong
+ */
+int env_import(const char *buf, int check);
+
+/**
+ * env_export() - Export the environment to a buffer
+ *
+ * Export from hash table into binary representation
+ *
+ * @env_out: Buffer to contain the environment (must be large enough!)
+ * @return 0 if OK, 1 on error
+ */
+int env_export(struct environment_s *env_out);
+
+/**
+ * env_import_redund() - Select and import one of two redundant environments
+ *
+ * @buf1: First environment (struct environemnt_s *)
+ * @buf1_read_fail: 0 if buf1 is valid, non-zero if invalid
+ * @buf2: Second environment (struct environemnt_s *)
+ * @buf2_read_fail: 0 if buf2 is valid, non-zero if invalid
+ * @return 0 if OK, -EIO if no environment is valid, -ENOMSG if the CRC was bad
+ */
+int env_import_redund(const char *buf1, int buf1_read_fail,
+ const char *buf2, int buf2_read_fail);
+
 #endif
diff --git a/include/environment.h b/include/environment.h
index b921b8f28e..c740d5a216 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -274,18 +274,6 @@ char *env_get_default(const char *name);
 /* [re]set to the default environment */
 void set_default_env(const char *s, int flags);
 
-/* Import from binary representation into hash table */
-int env_import(const char *buf, int check);
-
-/* Export from hash table into binary representation */
-int env_export(env_t *env_out);
-
-#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT
-/* Select and import one of two redundant environments */
-int env_import_redund(const char *buf1, int buf1_status,
- const char *buf2, int buf2_status);
-#endif
-
 /**
  * env_get_char() - Get a character from the early environment
  *
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 20/39] env: Move set_default_vars to env.h

2019-07-28 Thread Simon Glass
Move this function to the new header file and rename it so it has an env_
prefix.

Signed-off-by: Simon Glass 
---

 cmd/nvedit.c  |  2 +-
 env/common.c  |  2 +-
 include/env.h | 11 +++
 include/environment.h |  3 ---
 4 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 751b77d0e9..390d040de3 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -832,7 +832,7 @@ static int do_env_default(cmd_tbl_t *cmdtp, int flag,
}
if (!all && (argc > 0)) {
/* Reset individual variables */
-   set_default_vars(argc, argv, env_flag);
+   env_set_default_vars(argc, argv, env_flag);
return 0;
}
 
diff --git a/env/common.c b/env/common.c
index 1fbc4a874d..db2a033f68 100644
--- a/env/common.c
+++ b/env/common.c
@@ -92,7 +92,7 @@ void set_default_env(const char *s, int flags)
 
 
 /* [re]set individual variables to their value in the default environment */
-int set_default_vars(int nvars, char * const vars[], int flags)
+int env_set_default_vars(int nvars, char * const vars[], int flags)
 {
/*
 * Special use-case: import from default environment
diff --git a/include/env.h b/include/env.h
index 924b327c44..5c01cd3d6d 100644
--- a/include/env.h
+++ b/include/env.h
@@ -198,4 +198,15 @@ void eth_parse_enetaddr(const char *addr, uint8_t 
*enetaddr);
  */
 void env_fix_drivers(void);
 
+/**
+ * env_set_default_vars() - reset variables to their default value
+ *
+ * This resets individual variables to their value in the default environment
+ *
+ * @nvars: Number of variables to set/reset
+ * @vars: List of variables to set/reset
+ * @flags: Flags controlling matching (H_... - see search.h)
+ */
+int env_set_default_vars(int nvars, char *const vars[], int flags);
+
 #endif
diff --git a/include/environment.h b/include/environment.h
index 7be1ef98ad..97d4886599 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -274,9 +274,6 @@ char *env_get_default(const char *name);
 /* [re]set to the default environment */
 void set_default_env(const char *s, int flags);
 
-/* [re]set individual variables to their value in the default environment */
-int set_default_vars(int nvars, char * const vars[], int flags);
-
 /* Import from binary representation into hash table */
 int env_import(const char *buf, int check);
 
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 08/39] env: Move env_init() to env.h

2019-07-28 Thread Simon Glass
Move env_init() over to the new header file.

Signed-off-by: Simon Glass 
---

 arch/arm/cpu/armv8/fsl-layerscape/spl.c |  1 +
 arch/mips/lib/bootm.c   |  1 +
 board/Arcturus/ucp1020/spl.c|  1 +
 board/birdland/bav335x/board.c  |  1 +
 board/freescale/b4860qds/spl.c  |  1 +
 board/freescale/p1010rdb/spl.c  |  1 +
 board/freescale/p1022ds/spl.c   |  1 +
 board/freescale/p1_p2_rdb_pc/spl.c  |  1 +
 board/gateworks/gw_ventana/gw_ventana_spl.c |  1 +
 board/liebherr/display5/spl.c   |  1 +
 board/tcl/sl50/board.c  |  1 +
 board/ti/am335x/board.c |  1 +
 board/ti/am57xx/board.c |  1 +
 board/ti/dra7xx/evm.c   |  1 +
 common/board_f.c|  1 +
 common/spl/spl_net.c|  1 +
 env/env.c   |  1 +
 include/common.h|  1 -
 include/env.h   | 10 ++
 19 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/spl.c 
b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
index 3e53084b21..8f199b 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/spl.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
@@ -4,6 +4,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
index 6a462f3e5a..8c0d7672f2 100644
--- a/arch/mips/lib/bootm.c
+++ b/arch/mips/lib/bootm.c
@@ -5,6 +5,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/Arcturus/ucp1020/spl.c b/board/Arcturus/ucp1020/spl.c
index 451a9d78bb..f3b7d99878 100644
--- a/board/Arcturus/ucp1020/spl.c
+++ b/board/Arcturus/ucp1020/spl.c
@@ -9,6 +9,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/birdland/bav335x/board.c b/board/birdland/bav335x/board.c
index b95186026f..b0339ad8f0 100644
--- a/board/birdland/bav335x/board.c
+++ b/board/birdland/bav335x/board.c
@@ -8,6 +8,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/freescale/b4860qds/spl.c b/board/freescale/b4860qds/spl.c
index 887fa04627..d9aa57f41c 100644
--- a/board/freescale/b4860qds/spl.c
+++ b/board/freescale/b4860qds/spl.c
@@ -4,6 +4,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/freescale/p1010rdb/spl.c b/board/freescale/p1010rdb/spl.c
index e07640a0ed..95f8b5837d 100644
--- a/board/freescale/p1010rdb/spl.c
+++ b/board/freescale/p1010rdb/spl.c
@@ -4,6 +4,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/freescale/p1022ds/spl.c b/board/freescale/p1022ds/spl.c
index cfdd9fc9c9..92fd199876 100644
--- a/board/freescale/p1022ds/spl.c
+++ b/board/freescale/p1022ds/spl.c
@@ -5,6 +5,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/freescale/p1_p2_rdb_pc/spl.c 
b/board/freescale/p1_p2_rdb_pc/spl.c
index 48ab271fb2..9d7b5eff6f 100644
--- a/board/freescale/p1_p2_rdb_pc/spl.c
+++ b/board/freescale/p1_p2_rdb_pc/spl.c
@@ -5,6 +5,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/gateworks/gw_ventana/gw_ventana_spl.c 
b/board/gateworks/gw_ventana/gw_ventana_spl.c
index eaf7aa9eca..740fc57b91 100644
--- a/board/gateworks/gw_ventana/gw_ventana_spl.c
+++ b/board/gateworks/gw_ventana/gw_ventana_spl.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/liebherr/display5/spl.c b/board/liebherr/display5/spl.c
index 27f843ec45..d92760b487 100644
--- a/board/liebherr/display5/spl.c
+++ b/board/liebherr/display5/spl.c
@@ -5,6 +5,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/tcl/sl50/board.c b/board/tcl/sl50/board.c
index 6bb6482dd0..8ddbee5436 100644
--- a/board/tcl/sl50/board.c
+++ b/board/tcl/sl50/board.c
@@ -8,6 +8,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index 2c32b92d94..58d09f7c20 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -9,6 +9,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c
index 1a903f13a6..0dacfd4327 100644
--- a/board/ti/am57xx/board.c
+++ b/board/ti/am57xx/board.c
@@ -8,6 +8,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c
index 179adc2fff..97eef65d51 100644
--- a/board/ti/dra7xx/evm.c
+++ b/board/ti/dra7xx/evm.c
@@ -10,6 +10,7 @@
  * Steve Sakoman  
  */
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/common/board_f.c b/common/board_f.c
index 7d656fae6a..18937bf6f5 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -14,6 +14,7 @@
 #includ

[U-Boot] [PATCH 06/39] env: Move get_env_id() to env.h

2019-07-28 Thread Simon Glass
Move this function over to the new header file. Also rename it to have an
env_ prefix like the other functions.

Signed-off-by: Simon Glass 
---

 cmd/nvedit.c |  5 +++--
 drivers/net/netconsole.c |  5 +++--
 include/common.h |  2 --
 include/env.h| 10 ++
 net/eth_common.c |  3 ++-
 5 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 46b1e60f0a..4f3edab8b9 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -69,14 +70,14 @@ NAND|NVRAM|ONENAND|SATA|SPI_FLASH|REMOTE|UBI} or 
CONFIG_ENV_IS_NOWHERE
 
 /*
  * This variable is incremented on each do_env_set(), so it can
- * be used via get_env_id() as an indication, if the environment
+ * be used via env_get_id() as an indication, if the environment
  * has changed or not. So it is possible to reread an environment
  * variable only if the environment was changed ... done so for
  * example in NetInitLoop()
  */
 static int env_id = 1;
 
-int get_env_id(void)
+int env_get_id(void)
 {
return env_id;
 }
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index ce5a15ef57..73005ff94d 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -6,6 +6,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -55,7 +56,7 @@ static int is_broadcast(struct in_addr ip)
static struct in_addr netmask;
static struct in_addr our_ip;
static int env_changed_id;
-   int env_id = get_env_id();
+   int env_id = env_get_id();
 
/* update only when the environment has changed */
if (env_changed_id != env_id) {
@@ -75,7 +76,7 @@ static int refresh_settings_from_env(void)
 {
const char *p;
static int env_changed_id;
-   int env_id = get_env_id();
+   int env_id = env_get_id();
 
/* update only when the environment has changed */
if (env_changed_id != env_id) {
diff --git a/include/common.h b/include/common.h
index 6b890470c1..997da857b2 100644
--- a/include/common.h
+++ b/include/common.h
@@ -247,8 +247,6 @@ static inline int env_set_addr(const char *varname, const 
void *addr)
return env_set_hex(varname, (ulong)addr);
 }
 
-int get_env_id (void);
-
 void   pci_init_board(void);
 
 /* common/exports.c */
diff --git a/include/env.h b/include/env.h
index 157ee9b724..b82d80de17 100644
--- a/include/env.h
+++ b/include/env.h
@@ -11,6 +11,16 @@
 
 #include 
 
+/**
+ * env_get_id() - Gets a sequence number for the environment
+ *
+ * This value increments every time the environment changes, so can be used an
+ * an indication of this
+ *
+ * @return environment ID
+ */
+int env_get_id(void);
+
 /**
  * env_complete() - return an auto-complete for environment variables
  *
diff --git a/net/eth_common.c b/net/eth_common.c
index 63f9379eec..dcc59186d8 100644
--- a/net/eth_common.c
+++ b/net/eth_common.c
@@ -7,6 +7,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -110,7 +111,7 @@ void eth_set_current(void)
static int  env_changed_id;
int env_id;
 
-   env_id = get_env_id();
+   env_id = env_get_id();
if ((act == NULL) || (env_changed_id != env_id)) {
act = env_get("ethact");
env_changed_id = env_id;
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 05/39] env: Create a new file for environment functions

2019-07-28 Thread Simon Glass
At present we have environment.h but this file includes all the
environment-related header files as well as internals such as
default_environment.

It seems desirable to have a new header to hold the commonly used
environment functions, so that most files can avoid including all of this
unnecessary stuff.

Create a new env.h header and move one function over to it.

Signed-off-by: Simon Glass 
---

 common/command.c |  1 +
 include/common.h |  4 
 include/env.h| 28 
 3 files changed, 29 insertions(+), 4 deletions(-)
 create mode 100644 include/env.h

diff --git a/common/command.c b/common/command.c
index db25bf54e0..4b887a267f 100644
--- a/common/command.c
+++ b/common/command.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 /*
diff --git a/include/common.h b/include/common.h
index 4d0dd3f1b7..6b890470c1 100644
--- a/include/common.h
+++ b/include/common.h
@@ -247,10 +247,6 @@ static inline int env_set_addr(const char *varname, const 
void *addr)
return env_set_hex(varname, (ulong)addr);
 }
 
-#ifdef CONFIG_AUTO_COMPLETE
-int env_complete(char *var, int maxv, char *cmdv[], int maxsz, char *buf,
-bool dollar_comp);
-#endif
 int get_env_id (void);
 
 void   pci_init_board(void);
diff --git a/include/env.h b/include/env.h
new file mode 100644
index 00..157ee9b724
--- /dev/null
+++ b/include/env.h
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Common environment functions
+ *
+ * (C) Copyright 2000-2009
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ */
+
+#ifndef __ENV_H
+#define __ENV_H
+
+#include 
+
+/**
+ * env_complete() - return an auto-complete for environment variables
+ *
+ * @var: partial name to auto-complete
+ * @maxv: Maximum number of matches to return
+ * @cmdv: Returns a list of possible matches
+ * @maxsz: Size of buffer to use for matches
+ * @buf: Buffer to use for matches
+ * @dollar_comp: non-zero to wrap each match in ${...}
+ * @return number of matches found (in @cmdv)
+ */
+int env_complete(char *var, int maxv, char *cmdv[], int maxsz, char *buf,
+bool dollar_comp);
+
+#endif
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 35/39] env: Move TOTAL_MALLOC_LEN to environment.h

2019-07-28 Thread Simon Glass
This declaration is only used in three files. Although it relates to
malloc() it is actually only used during malloc() init. It uses CONFIG
options including CONFIG_ENV_ADDR which are defined only in environment.h
so this header must be included anyway, for TOTAL_MALLOC_LEN to be
correct.

Nove it to environment.h to simplify the common file.

Signed-off-by: Simon Glass 
---

 arch/x86/cpu/qemu/e820.c |  1 +
 include/common.h | 10 --
 include/environment.h| 14 ++
 3 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/arch/x86/cpu/qemu/e820.c b/arch/x86/cpu/qemu/e820.c
index 0a690fde68..7b3bc7db5e 100644
--- a/arch/x86/cpu/qemu/e820.c
+++ b/arch/x86/cpu/qemu/e820.c
@@ -4,6 +4,7 @@
  */
 
 #include 
+#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/include/common.h b/include/common.h
index 70f40daa9e..34ae514805 100644
--- a/include/common.h
+++ b/include/common.h
@@ -45,16 +45,6 @@ typedef void (interrupt_handler_t)(void *);
 #include  /* boot information for Linux kernel */
 #include/* global data used for startup functions */
 
-#if defined(CONFIG_ENV_IS_EMBEDDED)
-#define TOTAL_MALLOC_LEN   CONFIG_SYS_MALLOC_LEN
-#elif ( ((CONFIG_ENV_ADDR+CONFIG_ENV_SIZE) < CONFIG_SYS_MONITOR_BASE) || \
-   (CONFIG_ENV_ADDR >= (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)) 
) || \
-  defined(CONFIG_ENV_IS_IN_NVRAM)
-#defineTOTAL_MALLOC_LEN(CONFIG_SYS_MALLOC_LEN + 
CONFIG_ENV_SIZE)
-#else
-#defineTOTAL_MALLOC_LENCONFIG_SYS_MALLOC_LEN
-#endif
-
 /* startup functions, used in:
  * common/board_f.c
  * common/init/board_init.c
diff --git a/include/environment.h b/include/environment.h
index 70ee0fdb19..cc8c0546c2 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -141,6 +141,20 @@ extern unsigned long nand_env_oob_offset;
 
 #define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE)
 
+/*
+ * If the environment is in RAM, allocate extra space for it in the malloc
+ * region.
+ */
+#if defined(CONFIG_ENV_IS_EMBEDDED)
+#define TOTAL_MALLOC_LEN   CONFIG_SYS_MALLOC_LEN
+#elif (CONFIG_ENV_ADDR + CONFIG_ENV_SIZE < CONFIG_SYS_MONITOR_BASE) || \
+  (CONFIG_ENV_ADDR >= CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) || 
\
+  defined(CONFIG_ENV_IS_IN_NVRAM)
+#defineTOTAL_MALLOC_LEN(CONFIG_SYS_MALLOC_LEN + 
CONFIG_ENV_SIZE)
+#else
+#defineTOTAL_MALLOC_LENCONFIG_SYS_MALLOC_LEN
+#endif
+
 typedef struct environment_s {
uint32_tcrc;/* CRC32 over data bytes*/
 #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 12/39] env: Move env_set_ulong() to env.h

2019-07-28 Thread Simon Glass
Move env_set_ulong() over to the new header file.

Signed-off-by: Simon Glass 
---

 arch/arm/mach-uniphier/mmc-first-dev.c   | 1 +
 board/BuR/brppt1/board.c | 1 +
 board/BuR/common/br_resetc.c | 1 +
 board/CZ.NIC/turris_omnia/turris_omnia.c | 1 +
 board/engicam/common/board.c | 1 +
 board/gdsys/mpc8308/gazerbeam.c  | 1 +
 board/grinn/liteboard/board.c| 1 +
 board/imgtec/ci20/ci20.c | 1 +
 board/synopsys/hsdk/hsdk.c   | 1 +
 board/warp7/warp7.c  | 1 +
 cmd/tpm-common.c | 1 +
 drivers/bootcount/bootcount_env.c| 1 +
 drivers/scsi/scsi.c  | 1 +
 include/bootcount.h  | 1 +
 include/common.h | 9 -
 include/env.h| 9 +
 16 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-uniphier/mmc-first-dev.c 
b/arch/arm/mach-uniphier/mmc-first-dev.c
index 2f1c109b9e..149e662070 100644
--- a/arch/arm/mach-uniphier/mmc-first-dev.c
+++ b/arch/arm/mach-uniphier/mmc-first-dev.c
@@ -5,6 +5,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/board/BuR/brppt1/board.c b/board/BuR/brppt1/board.c
index b8ab19c0e7..ef4f5c9501 100644
--- a/board/BuR/brppt1/board.c
+++ b/board/BuR/brppt1/board.c
@@ -10,6 +10,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/BuR/common/br_resetc.c b/board/BuR/common/br_resetc.c
index c8cc73ab14..c0e7fb65b2 100644
--- a/board/BuR/common/br_resetc.c
+++ b/board/BuR/common/br_resetc.c
@@ -6,6 +6,7 @@
  * B&R Industrial Automation GmbH - http://www.br-automation.com/ *
  */
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c 
b/board/CZ.NIC/turris_omnia/turris_omnia.c
index 5f6ea35e5f..418657c2d5 100644
--- a/board/CZ.NIC/turris_omnia/turris_omnia.c
+++ b/board/CZ.NIC/turris_omnia/turris_omnia.c
@@ -8,6 +8,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/engicam/common/board.c b/board/engicam/common/board.c
index 7486f0ac2d..0880647183 100644
--- a/board/engicam/common/board.c
+++ b/board/engicam/common/board.c
@@ -6,6 +6,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/gdsys/mpc8308/gazerbeam.c b/board/gdsys/mpc8308/gazerbeam.c
index cd621744d2..ddd6ee8953 100644
--- a/board/gdsys/mpc8308/gazerbeam.c
+++ b/board/gdsys/mpc8308/gazerbeam.c
@@ -8,6 +8,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/grinn/liteboard/board.c b/board/grinn/liteboard/board.c
index 1491b8c3d4..1558ea4b84 100644
--- a/board/grinn/liteboard/board.c
+++ b/board/grinn/liteboard/board.c
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/imgtec/ci20/ci20.c b/board/imgtec/ci20/ci20.c
index 9811ef559f..f72a660581 100644
--- a/board/imgtec/ci20/ci20.c
+++ b/board/imgtec/ci20/ci20.c
@@ -7,6 +7,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/synopsys/hsdk/hsdk.c b/board/synopsys/hsdk/hsdk.c
index ac4d980c49..8a7642a0aa 100644
--- a/board/synopsys/hsdk/hsdk.c
+++ b/board/synopsys/hsdk/hsdk.c
@@ -6,6 +6,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c
index 134a6c99d7..39ae982257 100644
--- a/board/warp7/warp7.c
+++ b/board/warp7/warp7.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/cmd/tpm-common.c b/cmd/tpm-common.c
index 89f2aa001b..38900fb159 100644
--- a/cmd/tpm-common.c
+++ b/cmd/tpm-common.c
@@ -6,6 +6,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/bootcount/bootcount_env.c 
b/drivers/bootcount/bootcount_env.c
index 9084ca8a6e..50e0857b3b 100644
--- a/drivers/bootcount/bootcount_env.c
+++ b/drivers/bootcount/bootcount_env.c
@@ -5,6 +5,7 @@
  */
 
 #include 
+#include 
 #include 
 
 void bootcount_store(ulong a)
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 75900d8228..48cb2a2818 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -6,6 +6,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/bootcount.h b/include/bootcount.h
index daee84316c..8fa8cf8218 100644
--- a/include/bootcount.h
+++ b/include/bootcount.h
@@ -9,6 +9,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef CONFIG_DM_BOOTCOUNT
 
diff --git a/include/common.h b/include/common.h
index 100eac6e5e..283cb23fd1 100644
--- a/include/common.h
+++ b/include/common.h
@@ -200,15 +200,6 @@ int env_get_yesno(const char *var);
  */
 int env_set(const char *varname, const char *value);
 
-/**
- * env_set_ulong() - set an environment variable to an integer
- *
- * @varname: Variable to adjust
- * @value: Value to set for the 

[U-Boot] [PATCH 30/39] env: Drop the ENTRY typdef

2019-07-28 Thread Simon Glass
U-Boot is not supposed to use typedef for structs anymore. Also this name
is the same as the ENTRY() macro used in assembler files, and 'entry'
itself is widely used in U-Boot (>8k matches).

Drop the typedef and rename the struct to env_entry to reduce confusion.

Signed-off-by: Simon Glass 
---

 api/api.c  |  2 +-
 cmd/nvedit.c   | 12 +--
 drivers/tee/sandbox.c  |  2 +-
 env/callback.c |  6 +++---
 env/common.c   |  2 +-
 env/flags.c| 10 +-
 include/env_callback.h |  2 +-
 include/env_flags.h|  6 +++---
 include/search.h   | 24 +++---
 lib/hashtable.c| 45 +-
 test/env/hashtable.c   | 12 +--
 11 files changed, 62 insertions(+), 61 deletions(-)

diff --git a/api/api.c b/api/api.c
index 8a41b7cce7..a0fc62ca9e 100644
--- a/api/api.c
+++ b/api/api.c
@@ -497,7 +497,7 @@ static int API_env_enum(va_list ap)
 {
int i, buflen;
char *last, **next, *s;
-   ENTRY *match, search;
+   struct env_entry *match, search;
static char *var;
 
last = (char *)va_arg(ap, unsigned long);
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 52ffa15fad..7908d6cf0c 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -94,7 +94,7 @@ static int env_print(char *name, int flag)
ssize_t len;
 
if (name) { /* print a single name */
-   ENTRY e, *ep;
+   struct env_entry e, *ep;
 
e.key = name;
e.data = NULL;
@@ -225,7 +225,7 @@ static int _do_env_set(int flag, int argc, char * const 
argv[], int env_flag)
 {
int   i, len;
char  *name, *value, *s;
-   ENTRY e, *ep;
+   struct env_entry e, *ep;
 
debug("Initial value for argc=%d\n", argc);
 
@@ -485,7 +485,7 @@ static int print_static_binding(const char *var_name, const 
char *callback_name,
return 0;
 }
 
-static int print_active_callback(ENTRY *entry)
+static int print_active_callback(struct env_entry *entry)
 {
struct env_clbk_tbl *clbkp;
int i;
@@ -566,7 +566,7 @@ static int print_static_flags(const char *var_name, const 
char *flags,
return 0;
 }
 
-static int print_active_flags(ENTRY *entry)
+static int print_active_flags(struct env_entry *entry)
 {
enum env_flags_vartype type;
enum env_flags_varaccess access;
@@ -674,7 +674,7 @@ static int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc,
 char *env_get(const char *name)
 {
if (gd->flags & GD_FLG_ENV_READY) { /* after import into hashtable */
-   ENTRY e, *ep;
+   struct env_entry e, *ep;
 
WATCHDOG_RESET();
 
@@ -1274,7 +1274,7 @@ static int do_env_info(cmd_tbl_t *cmdtp, int flag,
 static int do_env_exists(cmd_tbl_t *cmdtp, int flag, int argc,
   char * const argv[])
 {
-   ENTRY e, *ep;
+   struct env_entry e, *ep;
 
if (argc < 2)
return CMD_RET_USAGE;
diff --git a/drivers/tee/sandbox.c b/drivers/tee/sandbox.c
index 2f3355c7b7..4bbcf74967 100644
--- a/drivers/tee/sandbox.c
+++ b/drivers/tee/sandbox.c
@@ -79,7 +79,7 @@ static u32 ta_avb_invoke_func(struct udevice *dev, u32 func, 
uint num_params,
  struct tee_param *params)
 {
struct sandbox_tee_state *state = dev_get_priv(dev);
-   ENTRY e, *ep;
+   struct env_entry e, *ep;
char *name;
u32 res;
uint slot;
diff --git a/env/callback.c b/env/callback.c
index 95be80d454..d539da93aa 100644
--- a/env/callback.c
+++ b/env/callback.c
@@ -43,7 +43,7 @@ static const char *callback_list;
  * This is called specifically when the variable did not exist in the hash
  * previously, so the blanket update did not find this variable.
  */
-void env_callback_init(ENTRY *var_entry)
+void env_callback_init(struct env_entry *var_entry)
 {
const char *var_name = var_entry->key;
char callback_name[256] = "";
@@ -80,7 +80,7 @@ void env_callback_init(ENTRY *var_entry)
  * Called on each existing env var prior to the blanket update since removing
  * a callback association should remove its callback.
  */
-static int clear_callback(ENTRY *entry)
+static int clear_callback(struct env_entry *entry)
 {
entry->callback = NULL;
 
@@ -92,7 +92,7 @@ static int clear_callback(ENTRY *entry)
  */
 static int set_callback(const char *name, const char *value, void *priv)
 {
-   ENTRY e, *ep;
+   struct env_entry e, *ep;
struct env_clbk_tbl *clbkp;
 
e.key   = name;
diff --git a/env/common.c b/env/common.c
index 1d9d0f934d..474ea2280b 100644
--- a/env/common.c
+++ b/env/common.c
@@ -250,7 +250,7 @@ void env_relocate(void)
 int env_complete(char *var, int maxv, char *cmdv[], int bufsz, char *buf,
 bool dollar_comp)
 {
-   ENTRY *match;
+   struct env_entry *match;
int found, idx;
 
if (dollar_comp) {
diff --git a/env/flags.c b/env/flags.c

[U-Boot] [PATCH 11/39] env: Move env_set_hex() to env.h

2019-07-28 Thread Simon Glass
Move env_set_hex() over to the new header file along with env_set_addr()
which uses it.

Signed-off-by: Simon Glass 
---

 api/api.c   |  1 +
 arch/arm/mach-tegra/cboot.c |  1 +
 arch/arm/mach-uniphier/board_late_init.c|  1 +
 board/BuR/common/common.c   |  1 +
 board/boundary/nitrogen6x/nitrogen6x.c  |  1 +
 board/broadcom/bcmstb/bcmstb.c  |  1 +
 board/emulation/qemu-riscv/qemu-riscv.c |  1 +
 board/freescale/qemu-ppce500/qemu-ppce500.c |  1 +
 board/raspberrypi/rpi/rpi.c |  1 +
 board/sunxi/board.c |  1 +
 board/xilinx/zynqmp/cmds.c  |  1 +
 cmd/cbfs.c  |  1 +
 cmd/cramfs.c|  1 +
 cmd/fdt.c   |  1 +
 cmd/jffs2.c |  1 +
 cmd/load.c  |  1 +
 cmd/lzmadec.c   |  1 +
 cmd/nand.c  |  1 +
 cmd/reiser.c|  1 +
 cmd/setexpr.c   |  1 +
 cmd/spl.c   |  1 +
 cmd/tpm-v1.c|  1 +
 cmd/trace.c |  1 +
 cmd/ubi.c   |  1 +
 cmd/unzip.c |  1 +
 cmd/ximg.c  |  1 +
 cmd/zfs.c   |  1 +
 cmd/zip.c   |  1 +
 common/autoboot.c   |  1 +
 common/bootm.c  |  1 +
 common/bootm_os.c   |  1 +
 drivers/fastboot/fb_command.c   |  1 +
 drivers/net/fm/fm.c |  1 +
 drivers/usb/gadget/f_sdp.c  |  1 +
 fs/fs.c |  1 +
 fs/ubifs/ubifs.c|  1 +
 include/common.h| 21 
 include/env.h   | 22 +
 net/net.c   |  1 +
 39 files changed, 59 insertions(+), 21 deletions(-)

diff --git a/api/api.c b/api/api.c
index 9f03f1a35b..8a41b7cce7 100644
--- a/api/api.c
+++ b/api/api.c
@@ -8,6 +8,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/arch/arm/mach-tegra/cboot.c b/arch/arm/mach-tegra/cboot.c
index a829ef794f..bd4f33686d 100644
--- a/arch/arm/mach-tegra/cboot.c
+++ b/arch/arm/mach-tegra/cboot.c
@@ -4,6 +4,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/arch/arm/mach-uniphier/board_late_init.c 
b/arch/arm/mach-uniphier/board_late_init.c
index 3180b24330..14b61fc7df 100644
--- a/arch/arm/mach-uniphier/board_late_init.c
+++ b/arch/arm/mach-uniphier/board_late_init.c
@@ -6,6 +6,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c
index 89087d7dba..148fc9075e 100644
--- a/board/BuR/common/common.c
+++ b/board/BuR/common/common.c
@@ -10,6 +10,7 @@
  */
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/boundary/nitrogen6x/nitrogen6x.c 
b/board/boundary/nitrogen6x/nitrogen6x.c
index 867eade4bd..26af3f7102 100644
--- a/board/boundary/nitrogen6x/nitrogen6x.c
+++ b/board/boundary/nitrogen6x/nitrogen6x.c
@@ -5,6 +5,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/broadcom/bcmstb/bcmstb.c b/board/broadcom/bcmstb/bcmstb.c
index 7f8e0f951d..5fc2c0591b 100644
--- a/board/broadcom/bcmstb/bcmstb.c
+++ b/board/broadcom/bcmstb/bcmstb.c
@@ -8,6 +8,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/emulation/qemu-riscv/qemu-riscv.c 
b/board/emulation/qemu-riscv/qemu-riscv.c
index d6167aaef1..49e304f7eb 100644
--- a/board/emulation/qemu-riscv/qemu-riscv.c
+++ b/board/emulation/qemu-riscv/qemu-riscv.c
@@ -5,6 +5,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/freescale/qemu-ppce500/qemu-ppce500.c 
b/board/freescale/qemu-ppce500/qemu-ppce500.c
index 42a6b5427a..fb36d8366c 100644
--- a/board/freescale/qemu-ppce500/qemu-ppce500.c
+++ b/board/freescale/qemu-ppce500/qemu-ppce500.c
@@ -5,6 +5,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 617c892dde..104589bff1 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -6,6 +6,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 98bc3cd0c1..bb425cbf66 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -12,6 +12,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/xilinx/zynqmp/cmds.c b/board

[U-Boot] [PATCH 34/39] env: Drop the double underscores in search.h

2019-07-28 Thread Simon Glass
There doesn't seem to be any good reason for using __ in the arguments in
this header file. A double underscore is usually reserved for compiler
features.

Drop these and remove the unnecessary 'extern' as well.

Signed-off-by: Simon Glass 
---

 include/search.h | 52 ++--
 1 file changed, 24 insertions(+), 28 deletions(-)

diff --git a/include/search.h b/include/search.h
index fa7758480b..f85d81b779 100644
--- a/include/search.h
+++ b/include/search.h
@@ -17,7 +17,7 @@
 #include 
 #include 
 
-#define __set_errno(val) do { errno = val; } while (0)
+#define set_errno(val) do { errno = val; } while (0)
 
 /* enum env_action: action which shall be performed in the call to hsearch */
 enum env_action {
@@ -47,58 +47,54 @@ struct hsearch_data {
unsigned int filled;
 /*
  * Callback function which will check whether the given change for variable
- * "__item" to "newval" may be applied or not, and possibly apply such change.
+ * "item" to "newval" may be applied or not, and possibly apply such change.
  * When (flag & H_FORCE) is set, it shall not print out any error message and
  * shall force overwriting of write-once variables.
  * Must return 0 for approval, 1 for denial.
  */
-   int (*change_ok)(const struct env_entry *__item, const char *newval,
+   int (*change_ok)(const struct env_entry *item, const char *newval,
 enum env_op, int flag);
 };
 
-/* Create a new hash table which will contain at most "__nel" elements.  */
-extern int hcreate_r(size_t __nel, struct hsearch_data *__htab);
+/* Create a new hash table which will contain at most "nel" elements.  */
+int hcreate_r(size_t nel, struct hsearch_data *htab);
 
 /* Destroy current internal hash table.  */
-extern void hdestroy_r(struct hsearch_data *__htab);
+void hdestroy_r(struct hsearch_data *htab);
 
 /*
- * Search for entry matching __item.key in internal hash table.  If
- * __action is `ENVA_FIND' return found entry or signal error by returning
- * NULL.  If __action is `ENVA_ENTER' replace existing data (if any) with
- * __item.data.
+ * Search for entry matching item.key in internal hash table.  If
+ * action is `ENVA_FIND' return found entry or signal error by returning
+ * NULL.  If action is `ENVA_ENTER' replace existing data (if any) with
+ * item.data.
  * */
-extern int hsearch_r(struct env_entry __item, enum env_action __action,
-struct env_entry **__retval, struct hsearch_data *__htab,
-int __flag);
+int hsearch_r(struct env_entry item, enum env_action action,
+ struct env_entry **retval, struct hsearch_data *htab, int flag);
 
 /*
- * Search for an entry matching "__match".  Otherwise, Same semantics
+ * Search for an entry matching "match".  Otherwise, Same semantics
  * as hsearch_r().
  */
-extern int hmatch_r(const char *__match, int __last_idx,
-   struct env_entry **__retval, struct hsearch_data *__htab);
+int hmatch_r(const char *match, int last_idx, struct env_entry **retval,
+struct hsearch_data *htab);
 
-/* Search and delete entry matching "__key" in internal hash table. */
-extern int hdelete_r(const char *__key, struct hsearch_data *__htab,
-int __flag);
+/* Search and delete entry matching "key" in internal hash table. */
+int hdelete_r(const char *key, struct hsearch_data *htab, int flag);
 
-extern ssize_t hexport_r(struct hsearch_data *__htab,
-const char __sep, int __flag, char **__resp, size_t __size,
-int argc, char * const argv[]);
+ssize_t hexport_r(struct hsearch_data *htab, const char sep, int flag,
+ char **resp, size_t size, int argc, char * const argv[]);
 
 /*
  * nvars: length of vars array
  * vars: array of strings (variable names) to import (nvars == 0 means all)
  */
-extern int himport_r(struct hsearch_data *__htab,
-const char *__env, size_t __size, const char __sep,
-int __flag, int __crlf_is_lf, int nvars,
-char * const vars[]);
+int himport_r(struct hsearch_data *htab, const char *env, size_t size,
+ const char sep, int flag, int crlf_is_lf, int nvars,
+ char * const vars[]);
 
 /* Walk the whole table calling the callback on each element */
-extern int hwalk_r(struct hsearch_data *__htab,
-  int (*callback)(struct env_entry *entry));
+int hwalk_r(struct hsearch_data *htab,
+   int (*callback)(struct env_entry *entry));
 
 /* Flags for himport_r(), hexport_r(), hdelete_r(), and hsearch_r() */
 #define H_NOCLEAR  (1 << 0) /* do not clear hash table before importing */
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 28/39] env: Move env_valid to env.h

2019-07-28 Thread Simon Glass
This enum is somewhat widely used to determine if the environment is valid
or not. Move it to the common environment header file.

Signed-off-by: Simon Glass 
---

 env/flash.c   | 1 +
 env/nowhere.c | 1 +
 include/env.h | 9 -
 include/environment.h | 7 ---
 4 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/env/flash.c b/env/flash.c
index a26d94309d..7a73466cf2 100644
--- a/env/flash.c
+++ b/env/flash.c
@@ -11,6 +11,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/env/nowhere.c b/env/nowhere.c
index ea6c32eb3b..7db4eec845 100644
--- a/env/nowhere.c
+++ b/env/nowhere.c
@@ -9,6 +9,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/include/env.h b/include/env.h
index 82214d973e..93a4c3ed6b 100644
--- a/include/env.h
+++ b/include/env.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * Common environment functions
+ * Common environment functions and definitions
  *
  * (C) Copyright 2000-2009
  * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
@@ -14,6 +14,13 @@
 
 struct environment_s;
 
+/* Value for environment validity */
+enum env_valid {
+   ENV_INVALID,/* No valid environment */
+   ENV_VALID,  /* First or only environment is valid */
+   ENV_REDUND, /* Redundant environment is valid */
+};
+
 /**
  * env_get_id() - Gets a sequence number for the environment
  *
diff --git a/include/environment.h b/include/environment.h
index 44a527e1fa..c3e8d7840a 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -165,13 +165,6 @@ extern const unsigned char default_environment[];
 #include 
 #include 
 
-/* Value for environment validity */
-enum env_valid {
-   ENV_INVALID,/* No valid environment */
-   ENV_VALID,  /* First or only environment is valid */
-   ENV_REDUND, /* Redundant environment is valid */
-};
-
 enum env_location {
ENVL_UNKNOWN,
ENVL_EEPROM,
-- 
2.22.0.709.g102302147b-goog

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


Re: [U-Boot] [BUG] Build failure conga-qeval20-qa3-e3845

2019-07-28 Thread Bin Meng
On Sun, Jul 28, 2019 at 10:03 PM Tom Rini  wrote:
>
> On Sun, Jul 28, 2019 at 08:13:12PM +0800, Bin Meng wrote:
> > On Sun, Jul 28, 2019 at 8:02 PM Tom Rini  wrote:
> > >
> > > On Sun, Jul 28, 2019 at 03:41:17PM +0800, Bin Meng wrote:
> > > > +Stefan
> > > >
> > > > Hi Heinrich,
> > > >
> > > > On Sun, Jul 28, 2019 at 2:32 PM Heinrich Schuchardt 
> > > >  wrote:
> > > > >
> > > > >
> > > > > Hello Tom,
> > > > >
> > > > > origin/master commit bfe28bc70fc8b192878d6e8b7f7db344091643cf fails to
> > > > > build conga-qeval20-qa3-e3845 on Debian Buster:
> > > > >
> > > >
> > > > I cannot reproduce it. Did you set CONFIG_BUILD_ROM = y?
> > > >
> > > > > binman: Filename 'descriptor.bin' not found in input path
> > > > > (.,.,./board/congatec/conga-qeval20-qa3-e3845)
> > > > > (cwd='/home/user/workspace/u-boot')
> > > > > make: *** [Makefile:1415: u-boot.rom] Error 1
> > > > >
> > > > > The only descriptor.bin file I can find is
> > > > > ./tools/binman/test/descriptor.bin
> > > > >
> > > > > https://gitlab.denx.de/u-boot/custodians/u-boot-efi/-/jobs/2155 has a
> > > > > different error for the same board:
> > > > >
> > > > > +Compiler aborting due to parser-detected syntax error(s)
> > > > > +board/congatec/conga-qeval20-qa3-e3845/dsdt.asl.tmp731:
> > > > > +Error6126 - syntax error, unexpected $end and premature 
> > > > > End-Of-File
> > > > > +
> > > > > +make[2]: *** [board/congatec/conga-qeval20-qa3-e3845/dsdt.c] Error 
> > > > > 255
> > > > > +make[1]: *** [board/congatec/conga-qeval20-qa3-e3845] Error 2
> > > > > +make: *** [sub-make] Error 2
> > >
> > > Yes, this is a build race that we see rarely on Travis and more
> > > frequently on GitLab due to the faster machines.
> >
> > OK, so I suspect the "build race" problem is with
> > conga-qeval20-qa3-e3845 that has 2 defconfigs, and both are trying to
> > build ASL files.
> >
> > However in my local buildman testing I never met this. My local build
> > server is very fast, for sure it is faster than travis build machine.
>
> Yes, something like that sounds likely.  It is a race and we've had it
> for a long while.  If we're generating files in the source tree rather
> than output directory we're going to hit a problem like this.

Then I believe this patch can solve this issue.
http://patchwork.ozlabs.org/patch/1130552/

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


[U-Boot] [PATCH 27/39] env: Rename environment to embedded_environment

2019-07-28 Thread Simon Glass
The name 'environment' is widely used in U-Boot so is not a very useful
name of a variable. Rename it to better indicate its purpose.

Signed-off-by: Simon Glass 
---

 env/flash.c   | 2 +-
 include/env_default.h | 2 +-
 include/environment.h | 2 +-
 tools/envcrc.c| 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/env/flash.c b/env/flash.c
index dca6567a09..a26d94309d 100644
--- a/env/flash.c
+++ b/env/flash.c
@@ -47,7 +47,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #if defined(CONFIG_ENV_ADDR_REDUND) && defined(CMD_SAVEENV) || \
!defined(CONFIG_ENV_ADDR_REDUND) && defined(INITENV)
 #ifdef ENV_IS_EMBEDDED
-static env_t *env_ptr = &environment;
+static env_t *env_ptr = &embedded_environment;
 #else /* ! ENV_IS_EMBEDDED */
 
 static env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR;
diff --git a/include/env_default.h b/include/env_default.h
index 86b639d3e2..56a8bae39a 100644
--- a/include/env_default.h
+++ b/include/env_default.h
@@ -10,7 +10,7 @@
 #include 
 
 #ifdef DEFAULT_ENV_INSTANCE_EMBEDDED
-env_t environment __UBOOT_ENV_SECTION__(environment) = {
+env_t embedded_environment __UBOOT_ENV_SECTION__(environment) = {
ENV_CRC,/* CRC Sum */
 #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT
1,  /* Flags: valid */
diff --git a/include/environment.h b/include/environment.h
index d23b92833e..44a527e1fa 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -153,7 +153,7 @@ typedef struct environment_s {
 } env_t;
 
 #ifdef ENV_IS_EMBEDDED
-extern env_t environment;
+extern env_t embedded_environment;
 #endif /* ENV_IS_EMBEDDED */
 
 extern const unsigned char default_environment[];
diff --git a/tools/envcrc.c b/tools/envcrc.c
index 505949289f..7eb7246d45 100644
--- a/tools/envcrc.c
+++ b/tools/envcrc.c
@@ -61,7 +61,7 @@
 #ifdef CONFIG_BUILD_ENVCRC
 # include 
 extern unsigned int env_size;
-extern env_t environment;
+extern env_t embedded_environment;
 #endif /* CONFIG_BUILD_ENVCRC */
 
 extern uint32_t crc32 (uint32_t, const unsigned char *, unsigned int);
@@ -71,7 +71,7 @@ int main (int argc, char **argv)
 #ifdef CONFIG_BUILD_ENVCRC
unsigned char pad = 0x00;
uint32_t crc;
-   unsigned char *envptr = (unsigned char *)&environment,
+   unsigned char *envptr = (unsigned char *)&embedded_environment,
*dataptr = envptr + ENV_HEADER_SIZE;
unsigned int datasize = ENV_SIZE;
unsigned int eoe;
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 23/39] env: Drop env_crc_update()

2019-07-28 Thread Simon Glass
This function is not defined or used in U-Boot. Drop it.

Signed-off-by: Simon Glass 
---

 include/environment.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/include/environment.h b/include/environment.h
index c740d5a216..27c0fee65f 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -265,9 +265,6 @@ struct env_driver {
 
 extern struct hsearch_data env_htab;
 
-/* Function that updates CRC of the enironment */
-void env_crc_update(void);
-
 /* Look up the variable from the default environment */
 char *env_get_default(const char *name);
 
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 37/39] env: Rename environment.h to env_internal.h

2019-07-28 Thread Simon Glass
This file contains lots of internal details about the environment. Most
code can include env.h instead, calling the functions there as needed.

Rename this file and add a comment at the top to indicate its internal
nature.

Signed-off-by: Simon Glass 
---

 api/api.c  |  2 +-
 arch/arm/cpu/armv8/fsl-layerscape/cpu.c|  2 +-
 arch/arm/cpu/armv8/fsl-layerscape/soc.c|  2 +-
 arch/x86/cpu/qemu/e820.c   |  2 +-
 board/Arcturus/ucp1020/spl.c   |  2 +-
 board/birdland/bav335x/board.c |  2 +-
 board/bosch/guardian/board.c   |  2 +-
 board/bosch/shc/board.c|  2 +-
 board/buffalo/lsxl/lsxl.c  |  2 +-
 board/freescale/b4860qds/spl.c |  2 +-
 board/freescale/c29xpcie/spl.c |  2 +-
 board/freescale/ls1012afrdm/ls1012afrdm.c  |  2 +-
 board/freescale/ls1012aqds/ls1012aqds.c|  2 +-
 board/freescale/ls1012ardb/ls1012ardb.c|  2 +-
 board/freescale/ls1028a/ls1028a.c  |  2 +-
 board/freescale/ls1088a/ls1088a.c  |  2 +-
 board/freescale/ls2080a/ls2080a.c  |  2 +-
 board/freescale/ls2080aqds/ls2080aqds.c|  2 +-
 board/freescale/ls2080ardb/ls2080ardb.c|  2 +-
 board/freescale/lx2160a/lx2160a.c  |  2 +-
 board/freescale/p1010rdb/spl.c |  2 +-
 board/freescale/p1022ds/spl.c  |  2 +-
 board/freescale/p1_p2_rdb_pc/spl.c |  2 +-
 board/freescale/t102xqds/spl.c |  2 +-
 board/freescale/t102xrdb/spl.c |  2 +-
 board/freescale/t104xrdb/spl.c |  2 +-
 board/freescale/t208xqds/spl.c |  2 +-
 board/freescale/t208xrdb/spl.c |  2 +-
 board/freescale/t4qds/spl.c|  2 +-
 board/freescale/t4rdb/spl.c|  2 +-
 board/gardena/smart-gateway-mt7688/board.c |  2 +-
 board/renesas/alt/alt.c|  2 +-
 board/renesas/gose/gose.c  |  2 +-
 board/renesas/koelsch/koelsch.c|  2 +-
 board/renesas/lager/lager.c|  2 +-
 board/renesas/porter/porter.c  |  2 +-
 board/renesas/silk/silk.c  |  2 +-
 board/renesas/stout/stout.c|  2 +-
 board/st/stm32mp1/stm32mp1.c   |  2 +-
 board/sunxi/board.c|  2 +-
 board/tcl/sl50/board.c |  2 +-
 board/ti/am335x/board.c|  2 +-
 cmd/nvedit.c   |  2 +-
 common/board_f.c   |  2 +-
 common/board_r.c   |  2 +-
 common/console.c   |  2 +-
 drivers/mtd/cfi_flash.c|  2 +-
 drivers/serial/serial-uclass.c |  2 +-
 drivers/serial/serial.c|  2 +-
 env/callback.c |  2 +-
 env/common.c   |  2 +-
 env/eeprom.c   |  2 +-
 env/embedded.c |  2 +-
 env/env.c  |  2 +-
 env/ext4.c |  2 +-
 env/fat.c  |  2 +-
 env/flags.c|  2 +-
 env/flash.c|  2 +-
 env/mmc.c  |  2 +-
 env/nand.c |  2 +-
 env/nowhere.c  |  2 +-
 env/nvram.c|  2 +-
 env/onenand.c  |  2 +-
 env/remote.c   |  2 +-
 env/sata.c |  2 +-
 env/sf.c   |  2 +-
 env/ubi.c  |  2 +-
 include/common.h   |  2 +-
 include/{environment.h => env_internal.h}  | 14 +++---
 lib/efi_loader/efi_variable.c  |  2 +-
 net/net.c  |  2 +-
 tools/envcrc.c |  2 +-
 72 files changed, 82 insertions(+), 74 deletions(-)
 rename include/{environment.h => env_internal.h} (93%)

diff --git a/api/api.c b/api/api.c
index 5e7c8149bf..bcbd8ede81 100644
--- a/api/api.c
+++ b/api/api.c
@@ -10,7 +10,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c 
b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
index 9577ada113..26f4fdacdb 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
@@ -33,7 +33,7 @@
 #include 
 
 #ifdef CONFIG_TFABOOT
-#include 
+#include 
 #ifdef CONFIG_CHAIN_OF_TRUST
 #include 
 #endif
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/soc.c 
b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
index 00c705f74e..ca8005992a 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/soc.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
@@ -27,7 +27,7 @@
 #endif
 #include 
 #ifdef CONFIG_TFABOOT
-#include 
+#include 
 DECLARE_GLOBAL_DATA_

[U-Boot] [PATCH 33/39] env: Drop the ACTION typedef

2019-07-28 Thread Simon Glass
Avoid using a typedef here which is unnecessary. Add an 'env_' prefix to
both the enum and its members to make it clear that these are related to
the environment.

Add an ENV prefix to these two flags so that it is clear what they relate
too. Also move them to env.h since they are part of the public API. Use an
enum rather than a #define to tie them together.

Signed-off-by: Simon Glass 
---

 api/api.c |  2 +-
 cmd/nvedit.c  |  8 
 drivers/tee/sandbox.c |  6 +++---
 env/callback.c|  2 +-
 env/flags.c   |  2 +-
 include/search.h  | 16 
 lib/hashtable.c   | 18 +-
 test/env/hashtable.c  |  8 
 8 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/api/api.c b/api/api.c
index a0fc62ca9e..5e7c8149bf 100644
--- a/api/api.c
+++ b/api/api.c
@@ -514,7 +514,7 @@ static int API_env_enum(va_list ap)
if (s != NULL)
*s = 0;
search.key = var;
-   i = hsearch_r(search, FIND, &match, &env_htab, 0);
+   i = hsearch_r(search, ENVA_FIND, &match, &env_htab, 0);
if (i == 0) {
i = API_EINVAL;
goto done;
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index d6a86abb03..3d244951b0 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -98,7 +98,7 @@ static int env_print(char *name, int flag)
 
e.key = name;
e.data = NULL;
-   hsearch_r(e, FIND, &ep, &env_htab, flag);
+   hsearch_r(e, ENVA_FIND, &ep, &env_htab, flag);
if (ep == NULL)
return 0;
len = printf("%s=%s\n", ep->key, ep->data);
@@ -288,7 +288,7 @@ static int _do_env_set(int flag, int argc, char * const 
argv[], int env_flag)
 
e.key   = name;
e.data  = value;
-   hsearch_r(e, ENTER, &ep, &env_htab, env_flag);
+   hsearch_r(e, ENVA_ENTER, &ep, &env_htab, env_flag);
free(value);
if (!ep) {
printf("## Error inserting \"%s\" variable, errno=%d\n",
@@ -680,7 +680,7 @@ char *env_get(const char *name)
 
e.key   = name;
e.data  = NULL;
-   hsearch_r(e, FIND, &ep, &env_htab, 0);
+   hsearch_r(e, ENVA_FIND, &ep, &env_htab, 0);
 
return ep ? ep->data : NULL;
}
@@ -1281,7 +1281,7 @@ static int do_env_exists(cmd_tbl_t *cmdtp, int flag, int 
argc,
 
e.key = argv[1];
e.data = NULL;
-   hsearch_r(e, FIND, &ep, &env_htab, 0);
+   hsearch_r(e, ENVA_FIND, &ep, &env_htab, 0);
 
return (ep == NULL) ? 1 : 0;
 }
diff --git a/drivers/tee/sandbox.c b/drivers/tee/sandbox.c
index 4bbcf74967..0561957067 100644
--- a/drivers/tee/sandbox.c
+++ b/drivers/tee/sandbox.c
@@ -174,7 +174,7 @@ static u32 ta_avb_invoke_func(struct udevice *dev, u32 
func, uint num_params,
 
e.key = name;
e.data = NULL;
-   hsearch_r(e, FIND, &ep, &state->pstorage_htab, 0);
+   hsearch_r(e, ENVA_FIND, &ep, &state->pstorage_htab, 0);
if (!ep)
return TEE_ERROR_ITEM_NOT_FOUND;
 
@@ -198,13 +198,13 @@ static u32 ta_avb_invoke_func(struct udevice *dev, u32 
func, uint num_params,
 
e.key = name;
e.data = NULL;
-   hsearch_r(e, FIND, &ep, &state->pstorage_htab, 0);
+   hsearch_r(e, ENVA_FIND, &ep, &state->pstorage_htab, 0);
if (ep)
hdelete_r(e.key, &state->pstorage_htab, 0);
 
e.key = name;
e.data = value;
-   hsearch_r(e, ENTER, &ep, &state->pstorage_htab, 0);
+   hsearch_r(e, ENVA_ENTER, &ep, &state->pstorage_htab, 0);
if (!ep)
return TEE_ERROR_OUT_OF_MEMORY;
 
diff --git a/env/callback.c b/env/callback.c
index d539da93aa..9bfa744921 100644
--- a/env/callback.c
+++ b/env/callback.c
@@ -98,7 +98,7 @@ static int set_callback(const char *name, const char *value, 
void *priv)
e.key   = name;
e.data  = NULL;
e.callback = NULL;
-   hsearch_r(e, FIND, &ep, &env_htab, 0);
+   hsearch_r(e, ENVA_FIND, &ep, &env_htab, 0);
 
/* does the env variable actually exist? */
if (ep != NULL) {
diff --git a/env/flags.c b/env/flags.c
index fdbad7bf33..388c2f184b 100644
--- a/env/flags.c
+++ b/env/flags.c
@@ -458,7 +458,7 @@ static int set_flags(const char *name, const char *value, 
void *priv)
e.key   = name;
e.data  = NULL;
e.callback = NULL;
-   hsearch_r(e, FIND, &ep, &env_htab, 0);
+   hsearch_r(e, ENVA_FIND, &ep, &env_htab, 0);
 
/* does the env variable actually exist? */
if (ep != NULL) {
diff --git a/include/search.h b/include/search.h
index c99648f80b..fa7758480b 100644
--- a/include/search.h
+++ b/include/search.h
@@ -19,11 +19,11 @@
 
 #define __set_errno(val) do

[U-Boot] [PATCH 38/39] Drop PCMCIA

2019-07-28 Thread Simon Glass
This is no-longer used in U-Boot and has not been converted to driver
model. Drop it.

Signed-off-by: Simon Glass 
---

 README  |   2 +-
 cmd/Kconfig |   8 -
 cmd/Makefile|   1 -
 cmd/ide.c   |   4 -
 cmd/pcmcia.c| 341 
 common/board_r.c|  12 --
 doc/README.marubun-pcmcia   |  65 --
 doc/README.ne2000   |  11 --
 drivers/Kconfig |   2 -
 drivers/Makefile|   1 -
 drivers/net/ne2000_base.c   |  10 -
 drivers/pcmcia/Kconfig  |   0
 drivers/pcmcia/Makefile |   6 -
 drivers/pcmcia/marubun_pcmcia.c |  99 --
 include/common.h|   2 -
 include/pcmcia.h| 137 -
 include/pcmcia/yenta.h  | 156 ---
 scripts/config_whitelist.txt|   6 -
 18 files changed, 1 insertion(+), 862 deletions(-)
 delete mode 100644 cmd/pcmcia.c
 delete mode 100644 doc/README.marubun-pcmcia
 delete mode 100644 drivers/pcmcia/Kconfig
 delete mode 100644 drivers/pcmcia/Makefile
 delete mode 100644 drivers/pcmcia/marubun_pcmcia.c
 delete mode 100644 include/pcmcia.h
 delete mode 100644 include/pcmcia/yenta.h

diff --git a/README b/README
index 8f816ad2af..3a862ba440 100644
--- a/README
+++ b/README
@@ -83,7 +83,7 @@ Where we come from:
   * Provide extended interface to Linux boot loader
   * S-Record download
   * network boot
-  * PCMCIA / CompactFlash / ATA disk / SCSI ... boot
+  * ATA disk / SCSI ... boot
 - create ARMBoot project (http://sourceforge.net/projects/armboot)
 - add other CPU families (starting with ARM)
 - create U-Boot project (http://sourceforge.net/projects/u-boot)
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 9e66cc110d..0834ae0734 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1002,14 +1002,6 @@ config CMD_PCI
  peripherals. Sub-commands allow bus enumeration, displaying and
  changing configuration space and a few other features.
 
-config CMD_PCMCIA
-   bool "pinit - Set up PCMCIA device"
-   help
- Provides a means to initialise a PCMCIA (Personal Computer Memory
- Card International Association) device. This is an old standard from
- about 1990. These devices are typically removable memory or network
- cards using a standard 68-pin connector.
-
 config CMD_PINMUX
bool "pinmux - show pins muxing"
default y if PINCTRL
diff --git a/cmd/Makefile b/cmd/Makefile
index 43a6b0ee21..58827b5679 100644
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -106,7 +106,6 @@ obj-$(CONFIG_CMD_PART) += part.o
 ifdef CONFIG_PCI
 obj-$(CONFIG_CMD_PCI) += pci.o
 endif
-obj-$(CONFIG_CMD_PCMCIA) += pcmcia.o
 obj-$(CONFIG_CMD_PINMUX) += pinmux.o
 obj-$(CONFIG_CMD_PXE) += pxe.o
 obj-$(CONFIG_CMD_WOL) += wol.o
diff --git a/cmd/ide.c b/cmd/ide.c
index 1c58efc55a..2f93ba7904 100644
--- a/cmd/ide.c
+++ b/cmd/ide.c
@@ -17,10 +17,6 @@
 #include 
 #include 
 
-#if defined(CONFIG_IDE_PCMCIA)
-# include 
-#endif
-
 #include 
 #include 
 
diff --git a/cmd/pcmcia.c b/cmd/pcmcia.c
deleted file mode 100644
index 3b7537b105..00
--- a/cmd/pcmcia.c
+++ /dev/null
@@ -1,341 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2000-2006
- * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
- *
- 
- *
- * Lots of code copied from:
- *
- * m8xx_pcmcia.c - Linux PCMCIA socket driver for the mpc8xx series.
- * (C) 1999-2000 Magnus Damm 
- *
- * "The ExCA standard specifies that socket controllers should provide
- * two IO and five memory windows per socket, which can be independently
- * configured and positioned in the host address space and mapped to
- * arbitrary segments of card address space. " - David A Hinds. 1999
- *
- * This controller does _not_ meet the ExCA standard.
- *
- * m8xx pcmcia controller brief info:
- * + 8 windows (attrib, mem, i/o)
- * + up to two slots (SLOT_A and SLOT_B)
- * + inputpins, outputpins, event and mask registers.
- * - no offset register. sigh.
- *
- * Because of the lacking offset register we must map the whole card.
- * We assign each memory window PCMCIA_MEM_WIN_SIZE address space.
- * Make sure there is (PCMCIA_MEM_WIN_SIZE * PCMCIA_MEM_WIN_NO
- * * PCMCIA_SOCKETS_NO) bytes at PCMCIA_MEM_WIN_BASE.
- * The i/o windows are dynamically allocated at PCMCIA_IO_WIN_BASE.
- * They are maximum 64KByte each...
- */
-
-/* #define DEBUG   1   */
-
-/*
- * PCMCIA support
- */
-#include 
-#include 
-#include 
-#include 
-#include 
-
-/*  */
-
-#if defined(CONFIG_CMD_PCMCIA)
-
-extern int pcmcia_on (void);
-extern int pcmcia_off (void);
-
-int do_pinit (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-   int rcode = 0;
-
-   if (argc != 2) {
-   printf ("Usage: pinit {on | off}\n");
- 

[U-Boot] [PATCH 19/39] env: Move uncommon functions to env.h

2019-07-28 Thread Simon Glass
Move eth_parse_enetaddr() and env_fix_drivers() over to the new header
file.

Signed-off-by: Simon Glass 
---

 cmd/ethsw.c   |  1 +
 include/env.h | 16 
 include/environment.h |  7 ---
 3 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/cmd/ethsw.c b/cmd/ethsw.c
index 473324f878..0b57a69f2f 100644
--- a/cmd/ethsw.c
+++ b/cmd/ethsw.c
@@ -7,6 +7,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/env.h b/include/env.h
index 2e9a850284..924b327c44 100644
--- a/include/env.h
+++ b/include/env.h
@@ -182,4 +182,20 @@ int eth_env_get_enetaddr(const char *name, uint8_t 
*enetaddr);
  */
 int eth_env_set_enetaddr(const char *name, const uint8_t *enetaddr);
 
+/**
+ * eth_parse_enetaddr() - Parse a MAC address
+ *
+ * Convert a string MAC address
+ *
+ * @addr: MAC address in aa:bb:cc:dd:ee:ff format, where each part is a 2-digit
+ * hex value
+ * @enetaddr: Place to put MAC address (6 bytes)
+ */
+void eth_parse_enetaddr(const char *addr, uint8_t *enetaddr);
+
+/**
+ * env_fix_drivers() - Updates envdriver as per relocation
+ */
+void env_fix_drivers(void);
+
 #endif
diff --git a/include/environment.h b/include/environment.h
index 77915f459e..7be1ef98ad 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -320,13 +320,6 @@ int env_save(void);
  */
 int env_erase(void);
 
-/**
- * env_fix_drivers() - Updates envdriver as per relocation
- */
-void env_fix_drivers(void);
-
-void eth_parse_enetaddr(const char *addr, uint8_t *enetaddr);
-
 #endif /* DO_DEPS_ONLY */
 
 #endif /* _ENVIRONMENT_H_ */
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 31/39] env: Drop _ENTRY

2019-07-28 Thread Simon Glass
This typedef does not need to be defined in the search.h header since it
is only used in one file (hashtable.c). Remove it from the header and
change it to a struct.

Signed-off-by: Simon Glass 
---

 include/search.h | 2 +-
 lib/hashtable.c  | 7 ---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/search.h b/include/search.h
index efa8bcbef6..c99648f80b 100644
--- a/include/search.h
+++ b/include/search.h
@@ -42,7 +42,7 @@ struct env_entry {
 
 /* Data type for reentrant functions.  */
 struct hsearch_data {
-   struct _ENTRY *table;
+   struct env_entry_node *table;
unsigned int size;
unsigned int filled;
 /*
diff --git a/lib/hashtable.c b/lib/hashtable.c
index c77b68f4e6..1093d8adaa 100644
--- a/lib/hashtable.c
+++ b/lib/hashtable.c
@@ -59,10 +59,10 @@
  * which describes the current status.
  */
 
-typedef struct _ENTRY {
+struct env_entry_node {
int used;
struct env_entry entry;
-} _ENTRY;
+};
 
 
 static void _hdelete(const char *key, struct hsearch_data *htab,
@@ -120,7 +120,8 @@ int hcreate_r(size_t nel, struct hsearch_data *htab)
htab->filled = 0;
 
/* allocate memory and zero out */
-   htab->table = (_ENTRY *) calloc(htab->size + 1, sizeof(_ENTRY));
+   htab->table = (struct env_entry_node *)calloc(htab->size + 1,
+   sizeof(struct env_entry_node));
if (htab->table == NULL)
return 0;
 
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 21/39] env: Move env_load/save functions to env.h

2019-07-28 Thread Simon Glass
Move these function to the new header file.

Signed-off-by: Simon Glass 
---

 include/env.h | 21 +
 include/environment.h | 21 -
 2 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/include/env.h b/include/env.h
index 5c01cd3d6d..2ba345fc4a 100644
--- a/include/env.h
+++ b/include/env.h
@@ -209,4 +209,25 @@ void env_fix_drivers(void);
  */
 int env_set_default_vars(int nvars, char *const vars[], int flags);
 
+/**
+ * env_load() - Load the environment from storage
+ *
+ * @return 0 if OK, -ve on error
+ */
+int env_load(void);
+
+/**
+ * env_save() - Save the environment to storage
+ *
+ * @return 0 if OK, -ve on error
+ */
+int env_save(void);
+
+/**
+ * env_erase() - Erase the environment on storage
+ *
+ * @return 0 if OK, -ve on error
+ */
+int env_erase(void);
+
 #endif
diff --git a/include/environment.h b/include/environment.h
index 97d4886599..b921b8f28e 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -296,27 +296,6 @@ int env_import_redund(const char *buf1, int buf1_status,
  */
 int env_get_char(int index);
 
-/**
- * env_load() - Load the environment from storage
- *
- * @return 0 if OK, -ve on error
- */
-int env_load(void);
-
-/**
- * env_save() - Save the environment to storage
- *
- * @return 0 if OK, -ve on error
- */
-int env_save(void);
-
-/**
- * env_erase() - Erase the environment on storage
- *
- * @return 0 if OK, -ve on error
- */
-int env_erase(void);
-
 #endif /* DO_DEPS_ONLY */
 
 #endif /* _ENVIRONMENT_H_ */
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 26/39] env: Move env_reloc() to env.h

2019-07-28 Thread Simon Glass
Move env_reloc() over to the new header file.

Signed-off-by: Simon Glass 
---

 include/env.h | 7 +++
 include/environment.h | 4 
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/env.h b/include/env.h
index 827d96cc86..82214d973e 100644
--- a/include/env.h
+++ b/include/env.h
@@ -289,4 +289,11 @@ void env_set_default(const char *s, int flags);
  */
 int env_get_char(int index);
 
+/**
+ * env_reloc() - Relocate the 'env' sub-commands
+ *
+ * This is used for those unfortunate archs with crappy toolchains
+ */
+void env_reloc(void);
+
 #endif
diff --git a/include/environment.h b/include/environment.h
index ea45b57628..d23b92833e 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -158,10 +158,6 @@ extern env_t environment;
 
 extern const unsigned char default_environment[];
 
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
-extern void env_reloc(void);
-#endif
-
 #ifndef DO_DEPS_ONLY
 
 #include 
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] [PATCH 36/39] env: Drop environment.h header file where not needed

2019-07-28 Thread Simon Glass
This header file is now only used by files that access internal
environment features. Drop it from various places where it is not needed.

Signed-off-by: Simon Glass 
---

 arch/arm/cpu/arm926ejs/spear/spr_misc.c   | 1 -
 arch/arm/mach-davinci/misc.c  | 1 -
 arch/arm/mach-imx/cmd_dek.c   | 1 -
 arch/arm/mach-imx/mx6/opos6ul.c   | 1 -
 arch/arm/mach-meson/board-common.c| 1 -
 arch/arm/mach-omap2/boot-common.c | 1 -
 arch/arm/mach-omap2/omap3/clock.c | 1 -
 arch/arm/mach-omap2/utils.c   | 1 -
 arch/arm/mach-stm32mp/cpu.c   | 1 -
 arch/arm/mach-tegra/cboot.c   | 1 -
 arch/m68k/lib/bootm.c | 1 -
 arch/nds32/include/asm/u-boot.h   | 1 -
 arch/powerpc/cpu/mpc85xx/fdt.c| 1 -
 arch/powerpc/lib/bootm.c  | 1 -
 arch/riscv/include/asm/u-boot.h   | 1 -
 board/Arcturus/ucp1020/cmd_arc.c  | 1 -
 board/CZ.NIC/turris_mox/turris_mox.c  | 1 -
 board/CZ.NIC/turris_omnia/turris_omnia.c  | 1 -
 board/LaCie/net2big_v2/net2big_v2.c   | 1 -
 board/LaCie/netspace_v2/netspace_v2.c | 1 -
 board/amlogic/p200/p200.c | 1 -
 board/amlogic/p201/p201.c | 1 -
 board/amlogic/p212/p212.c | 1 -
 board/amlogic/q200/q200.c | 1 -
 board/amlogic/s400/s400.c | 1 -
 board/amlogic/u200/u200.c | 1 -
 board/armadeus/apf27/apf27.c  | 1 -
 board/atmel/common/mac_eeprom.c   | 1 -
 board/birdland/bav335x/board.c| 1 -
 board/bosch/guardian/board.c  | 1 -
 board/bosch/shc/board.c   | 1 -
 board/compulab/cl-som-imx7/cl-som-imx7.c  | 1 -
 board/compulab/cm_fx6/cm_fx6.c| 1 -
 board/compulab/cm_t335/cm_t335.c  | 1 -
 board/compulab/cm_t35/cm_t35.c| 1 -
 board/compulab/cm_t54/cm_t54.c| 1 -
 board/davinci/da8xxevm/da850evm.c | 1 -
 board/dhelectronics/dh_imx6/dh_imx6.c | 1 -
 board/eets/pdu001/board.c | 1 -
 board/freescale/imx8qm_mek/imx8qm_mek.c   | 1 -
 board/freescale/imx8qxp_mek/imx8qxp_mek.c | 1 -
 board/gateworks/gw_ventana/gw_ventana.c   | 1 -
 board/gateworks/gw_ventana/gw_ventana_spl.c   | 1 -
 board/ge/mx53ppd/mx53ppd.c| 1 -
 board/grinn/chiliboard/board.c| 1 -
 board/gumstix/pepper/board.c  | 1 -
 board/imgtec/ci20/ci20.c  | 1 -
 board/intel/edison/edison.c   | 1 -
 board/isee/igep003x/board.c   | 1 -
 board/k+p/kp_imx53/kp_id_rev.c| 1 -
 board/kosagi/novena/novena.c  | 1 -
 board/liebherr/display5/display5.c| 1 -
 board/liebherr/display5/spl.c | 1 -
 board/logicpd/zoom1/zoom1.c   | 1 -
 board/mscc/ocelot/ocelot.c| 1 -
 board/nvidia/p2371-2180/p2371-2180.c  | 1 -
 board/nvidia/p2771-/p2771-.c  | 1 -
 board/phytec/pcm051/board.c   | 1 -
 board/phytec/pcm052/pcm052.c  | 1 -
 board/phytec/phycore_rk3288/phycore-rk3288.c  | 1 -
 board/qualcomm/dragonboard410c/dragonboard410c.c  | 1 -
 board/raspberrypi/rpi/rpi.c   | 1 -
 board/renesas/blanche/blanche.c   | 1 -
 board/renesas/sh7752evb/sh7752evb.c   | 1 -
 board/renesas/sh7753evb/sh7753evb.c   | 1 -
 board/renesas/sh7757lcr/sh7757lcr.c   | 1 -
 board/rockchip/tinker_rk3288/tinker-rk3288.c  | 1 -
 board/samtec/vining_fpga/socfpga.c| 1 -
 board/siemens/common/factoryset.c | 1 -
 board/siemens/pxm2/board.c| 1 -
 board/siemens/taurus/taurus.c | 1 -
 board/silica/pengwyn/board.c  | 1 -
 board/softing/vining_2000/vining_2000.c   | 1 -
 board/tcl/sl50/board.c| 1 -
 board/technologic/ts4800/ts4800.c | 1 -
 board/theobroma-systems/puma_rk3399/puma-rk3399.c | 1 -
 board/ti/am335x/board.c   | 1 -
 board/ti/am43xx/board.c   | 1 -
 board/ti/am57xx/board.c   | 1 -
 board/ti/dra7xx/evm.c | 1 -
 board/ti/ti814x/evm.c | 1 -
 board/ti/ti816x/evm.c | 1 -
 board/timll/devkit8000/devkit8000.c   | 1 -
 board/toradex/apalis-imx8/apalis-imx8.c   | 1 -
 board/toradex/apalis_imx6/apalis_imx6.

[U-Boot] [PATCH 32/39] env: Rename the redundancy flags

2019-07-28 Thread Simon Glass
Add an ENV prefix to these two flags so that it is clear what they relate
to. Also move them to env.h since they are part of the public API. Use an
enum rather than a #define to tie them together.

Signed-off-by: Simon Glass 
---

 cmd/nvedit.c  |  2 +-
 env/eeprom.c  | 10 ++
 env/flash.c   | 18 ++
 env/sf.c  |  6 ++
 include/env.h |  6 ++
 include/environment.h |  5 +
 tools/env/fw_env.c| 23 +--
 7 files changed, 39 insertions(+), 31 deletions(-)

diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 7908d6cf0c..d6a86abb03 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -1014,7 +1014,7 @@ NXTARG:   ;
envp->crc = crc32(0, envp->data,
size ? size - offsetof(env_t, data) : ENV_SIZE);
 #ifdef CONFIG_ENV_ADDR_REDUND
-   envp->flags = ACTIVE_FLAG;
+   envp->flags = ENVF_REDUND_ACTIVE;
 #endif
}
env_set_hex("filesize", len + offsetof(env_t, data));
diff --git a/env/eeprom.c b/env/eeprom.c
index 8d82cf892c..0c30ca459c 100644
--- a/env/eeprom.c
+++ b/env/eeprom.c
@@ -132,9 +132,11 @@ static int env_eeprom_load(void)
gd->env_valid = ENV_REDUND;
} else {
/* both ok - check serial */
-   if (flags[0] == ACTIVE_FLAG && flags[1] == OBSOLETE_FLAG)
+   if (flags[0] == ENVF_REDUND_ACTIVE &&
+   flags[1] == ENVF_REDUND_OBSOLETE)
gd->env_valid = ENV_VALID;
-   else if (flags[0] == OBSOLETE_FLAG && flags[1] == ACTIVE_FLAG)
+   else if (flags[0] == ENVF_REDUND_OBSOLETE &&
+flags[1] == ENVF_REDUND_ACTIVE)
gd->env_valid = ENV_REDUND;
else if (flags[0] == 0xFF && flags[1] == 0)
gd->env_valid = ENV_REDUND;
@@ -194,7 +196,7 @@ static int env_eeprom_save(void)
unsigned int off= CONFIG_ENV_OFFSET;
 #ifdef CONFIG_ENV_OFFSET_REDUND
unsigned int off_red= CONFIG_ENV_OFFSET_REDUND;
-   char flag_obsolete  = OBSOLETE_FLAG;
+   char flag_obsolete  = ENVF_REDUND_OBSOLETE;
 #endif
 
rc = env_export(&env_new);
@@ -207,7 +209,7 @@ static int env_eeprom_save(void)
off_red = CONFIG_ENV_OFFSET;
}
 
-   env_new.flags = ACTIVE_FLAG;
+   env_new.flags = ENVF_REDUND_ACTIVE;
 #endif
 
rc = eeprom_bus_write(CONFIG_SYS_DEF_EEPROM_ADDR,
diff --git a/env/flash.c b/env/flash.c
index 7a73466cf2..9566dd7f05 100644
--- a/env/flash.c
+++ b/env/flash.c
@@ -95,10 +95,12 @@ static int env_flash_init(void)
} else if (!crc1_ok && !crc2_ok) {
gd->env_addr= addr_default;
gd->env_valid   = ENV_INVALID;
-   } else if (flag1 == ACTIVE_FLAG && flag2 == OBSOLETE_FLAG) {
+   } else if (flag1 == ENVF_REDUND_ACTIVE &&
+  flag2 == ENVF_REDUND_OBSOLETE) {
gd->env_addr= addr1;
gd->env_valid   = ENV_VALID;
-   } else if (flag1 == OBSOLETE_FLAG && flag2 == ACTIVE_FLAG) {
+   } else if (flag1 == ENVF_REDUND_OBSOLETE &&
+  flag2 == ENVF_REDUND_ACTIVE) {
gd->env_addr= addr2;
gd->env_valid   = ENV_VALID;
} else if (flag1 == flag2) {
@@ -121,7 +123,7 @@ static int env_flash_save(void)
 {
env_t   env_new;
char*saved_data = NULL;
-   charflag = OBSOLETE_FLAG, new_flag = ACTIVE_FLAG;
+   charflag = ENVF_REDUND_OBSOLETE, new_flag = ENVF_REDUND_ACTIVE;
int rc = 1;
 #if CONFIG_ENV_SECT_SIZE > CONFIG_ENV_SIZE
ulong   up_data = 0;
@@ -322,9 +324,9 @@ static int env_flash_load(void)
end_addr_new = ltmp;
}
 
-   if (flash_addr_new->flags != OBSOLETE_FLAG &&
+   if (flash_addr_new->flags != ENVF_REDUND_OBSOLETE &&
crc32(0, flash_addr_new->data, ENV_SIZE) == flash_addr_new->crc) {
-   char flag = OBSOLETE_FLAG;
+   char flag = ENVF_REDUND_OBSOLETE;
 
gd->env_valid = ENV_REDUND;
flash_sect_protect(0, (ulong)flash_addr_new, end_addr_new);
@@ -334,9 +336,9 @@ static int env_flash_load(void)
flash_sect_protect(1, (ulong)flash_addr_new, end_addr_new);
}
 
-   if (flash_addr->flags != ACTIVE_FLAG &&
-   (flash_addr->flags & ACTIVE_FLAG) == ACTIVE_FLAG) {
-   char flag = ACTIVE_FLAG;
+   if (flash_addr->flags != ENVF_REDUND_ACTIVE &&
+   (flash_addr->flags & ENVF_REDUND_ACTIVE) == ENVF_REDUND_ACTIVE) {
+   char flag = ENVF_REDUND_ACTIVE;
 
gd->env_valid = ENV_REDUND;
flash_sect_protect(0, (ulong)flash_addr, end_addr);
diff --git a/env/sf.c b/env/sf.c
index 5531293e05..ae4136926b 100644
--- a/env/sf.c
+++ b/env/sf.c
@@ -30,8 +30,6 @@ static ulong env_offset   = CONFIG_ENV_OFFSE

Re: [U-Boot] buildman rockchip

2019-07-28 Thread Simon Glass
HI Kever,

On Sun, 28 Jul 2019 at 05:14, Kever Yang  wrote:
>
> Hi Simon,
>
>  When I'm using the buildman for rockchip platform, it's always
> build only 20 boards,
>
> and many boards are not build, there are 38 boards with its defconfig in
> configs/ dir,
>
> could you help to check what's missing?

I think I commented on this at the time of the patches to move away
from arch-rockchip. There are now separate arch directories for each
soc. Most of them don't mention rockchip at all. See boards.cfg for
the resulting output.

>
>
> See build log:
>
> https://travis-ci.org/keveryang/u-boot/jobs/564525467
>
>
> Thanks,
>
> - Kever
>

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


[U-Boot] [PATCH 25/39] env: Move env_get_char() to env.h

2019-07-28 Thread Simon Glass
Move env_get_char() over to the new header file.

Signed-off-by: Simon Glass 
---

 include/env.h | 10 ++
 include/environment.h | 10 --
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/env.h b/include/env.h
index 15a0906847..827d96cc86 100644
--- a/include/env.h
+++ b/include/env.h
@@ -279,4 +279,14 @@ char *env_get_default(const char *name);
 /* [re]set to the default environment */
 void env_set_default(const char *s, int flags);
 
+/**
+ * env_get_char() - Get a character from the early environment
+ *
+ * This reads from the pre-relocation environment
+ *
+ * @index: Index of character to read (0 = first)
+ * @return character read, or -ve on error
+ */
+int env_get_char(int index);
+
 #endif
diff --git a/include/environment.h b/include/environment.h
index ef391cc21a..ea45b57628 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -265,16 +265,6 @@ struct env_driver {
 
 extern struct hsearch_data env_htab;
 
-/**
- * env_get_char() - Get a character from the early environment
- *
- * This reads from the pre-relocation environment
- *
- * @index: Index of character to read (0 = first)
- * @return character read, or -ve on error
- */
-int env_get_char(int index);
-
 #endif /* DO_DEPS_ONLY */
 
 #endif /* _ENVIRONMENT_H_ */
-- 
2.22.0.709.g102302147b-goog

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


Re: [U-Boot] [BUG] Build failure conga-qeval20-qa3-e3845

2019-07-28 Thread Heinrich Schuchardt
On 7/28/19 2:00 PM, Bin Meng wrote:
> On Sun, Jul 28, 2019 at 5:52 PM Heinrich Schuchardt  
> wrote:
>>
>> On 7/28/19 11:35 AM, Bin Meng wrote:
>>> On Sun, Jul 28, 2019 at 5:08 PM Heinrich Schuchardt  
>>> wrote:

>>
>> Skipping Git submodules setup
>> $ ret=0; ./tools/buildman/buildman -P -E -x arm,powerpc || ret=$?; if [[
>> $ret -ne 0 && $ret -ne 129 ]]; then ./tools/buildman/buildman -sdeP;
>> exit $ret; fi;
>> Building current source for 167 boards (24 threads, 1 job per thread)
>>
>> Starting build...
>> 000 /167(starting)
>>
>>
>> 100 /1671:06:16  : vct_platinumavc
>>
>>x86:  +   conga-qeval20-qa3-e3845-internal-uart
>> +Compiler aborting due to parser-detected syntax error(s)
>> +board/congatec/conga-qeval20-qa3-e3845/dsdt.asl.tmp731:
>
> This is weird. What IASL version did that use?
>
> I am using:
>
> $ iasl -v
>
> Intel ACPI Component Architecture
> ASL+ Optimizing Compiler version 20160108-64
> Copyright (c) 2000 - 2016 Intel Corporation

Tom's Dockerimage is on Ubuntu 16.04. That gives us
https://packages.ubuntu.com/de/xenial/iasl.

Intel ACPI Component Architecture
ASL+ Optimizing Compiler version 20160108-64
Copyright (c) 2000 - 2016 Intel Corporation

As Tom already wrote the problem is not with iasl but possibly with
incorrect dependencies in the Makefile.

Best regards

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


Re: [U-Boot] [BUG] Build failure conga-qeval20-qa3-e3845

2019-07-28 Thread Tom Rini
On Sun, Jul 28, 2019 at 10:10:34PM +0800, Bin Meng wrote:
> On Sun, Jul 28, 2019 at 10:03 PM Tom Rini  wrote:
> >
> > On Sun, Jul 28, 2019 at 08:13:12PM +0800, Bin Meng wrote:
> > > On Sun, Jul 28, 2019 at 8:02 PM Tom Rini  wrote:
> > > >
> > > > On Sun, Jul 28, 2019 at 03:41:17PM +0800, Bin Meng wrote:
> > > > > +Stefan
> > > > >
> > > > > Hi Heinrich,
> > > > >
> > > > > On Sun, Jul 28, 2019 at 2:32 PM Heinrich Schuchardt 
> > > > >  wrote:
> > > > > >
> > > > > >
> > > > > > Hello Tom,
> > > > > >
> > > > > > origin/master commit bfe28bc70fc8b192878d6e8b7f7db344091643cf fails 
> > > > > > to
> > > > > > build conga-qeval20-qa3-e3845 on Debian Buster:
> > > > > >
> > > > >
> > > > > I cannot reproduce it. Did you set CONFIG_BUILD_ROM = y?
> > > > >
> > > > > > binman: Filename 'descriptor.bin' not found in input path
> > > > > > (.,.,./board/congatec/conga-qeval20-qa3-e3845)
> > > > > > (cwd='/home/user/workspace/u-boot')
> > > > > > make: *** [Makefile:1415: u-boot.rom] Error 1
> > > > > >
> > > > > > The only descriptor.bin file I can find is
> > > > > > ./tools/binman/test/descriptor.bin
> > > > > >
> > > > > > https://gitlab.denx.de/u-boot/custodians/u-boot-efi/-/jobs/2155 has 
> > > > > > a
> > > > > > different error for the same board:
> > > > > >
> > > > > > +Compiler aborting due to parser-detected syntax error(s)
> > > > > > +board/congatec/conga-qeval20-qa3-e3845/dsdt.asl.tmp731:
> > > > > > +Error6126 - syntax error, unexpected $end and premature 
> > > > > > End-Of-File
> > > > > > +
> > > > > > +make[2]: *** [board/congatec/conga-qeval20-qa3-e3845/dsdt.c] Error 
> > > > > > 255
> > > > > > +make[1]: *** [board/congatec/conga-qeval20-qa3-e3845] Error 2
> > > > > > +make: *** [sub-make] Error 2
> > > >
> > > > Yes, this is a build race that we see rarely on Travis and more
> > > > frequently on GitLab due to the faster machines.
> > >
> > > OK, so I suspect the "build race" problem is with
> > > conga-qeval20-qa3-e3845 that has 2 defconfigs, and both are trying to
> > > build ASL files.
> > >
> > > However in my local buildman testing I never met this. My local build
> > > server is very fast, for sure it is faster than travis build machine.
> >
> > Yes, something like that sounds likely.  It is a race and we've had it
> > for a long while.  If we're generating files in the source tree rather
> > than output directory we're going to hit a problem like this.
> 
> Then I believe this patch can solve this issue.
> http://patchwork.ozlabs.org/patch/1130552/

Likely, but then we also need to update the .gitignore file I think.

-- 
Tom


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


[U-Boot] [PATCH] x86: qemu: Fix non-working ramboot and nfsboot environment variables

2019-07-28 Thread Bin Meng
With qemu-x86 starting to use config_distro_bootcmd, the pre-defined
ramboot and nfsboot commands do not work any more. This is caused by
undefined environment variable 'ramdiskaddr' that was previously set
in CONFIG_EXTRA_ENV_SETTINGS but later CONFIG_EXTRA_ENV_SETTINGS was
redefined for distro boot.

Update the x86 generic CONFIG_EXTRA_ENV_SETTINGS to consider distro
boot, and remove the one in qemu-x86.h.

Signed-off-by: Bin Meng 
---

 include/configs/qemu-x86.h   | 10 --
 include/configs/x86-common.h | 21 ++---
 2 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/include/configs/qemu-x86.h b/include/configs/qemu-x86.h
index 097ed41..c557420 100644
--- a/include/configs/qemu-x86.h
+++ b/include/configs/qemu-x86.h
@@ -27,16 +27,6 @@
 
 #define CONFIG_PREBOOT "pci enum"
 
-#undef CONFIG_EXTRA_ENV_SETTINGS
-#define CONFIG_EXTRA_ENV_SETTINGS \
-   CONFIG_STD_DEVICES_SETTINGS \
-   "scriptaddr=0x700\0" \
-   "kernel_addr_r=0x100\0" \
-   "ramdisk_addr_r=0x400\0" \
-   "consoledev=ttyS0\0" \
-   CONFIG_OTHBOOTARGS \
-   BOOTENV
-
 #define CONFIG_SYS_MONITOR_LEN (1 << 20)
 
 #define CONFIG_STD_DEVICES_SETTINGS"stdin=serial,i8042-kbd\0" \
diff --git a/include/configs/x86-common.h b/include/configs/x86-common.h
index 7fcf76a..4227d93 100644
--- a/include/configs/x86-common.h
+++ b/include/configs/x86-common.h
@@ -106,30 +106,37 @@
 #define CONFIG_OTHBOOTARGS "othbootargs=acpi=off\0"
 #endif
 
+#ifndef CONFIG_DISTRO_DEFAULTS
+#define BOOTENV
+#endif
+
 #define CONFIG_EXTRA_ENV_SETTINGS  \
CONFIG_STD_DEVICES_SETTINGS \
"pciconfighost=1\0" \
"netdev=eth0\0" \
"consoledev=ttyS0\0"\
CONFIG_OTHBOOTARGS  \
-   "ramdiskaddr=0x400\0"   \
-   "ramdiskfile=initramfs.gz\0"
+   "scriptaddr=0x700\0"\
+   "kernel_addr_r=0x100\0" \
+   "ramdisk_addr_r=0x400\0"\
+   "ramdiskfile=initramfs.gz\0"\
+   BOOTENV
 
 #define CONFIG_RAMBOOTCOMMAND  \
"setenv bootargs root=/dev/ram rw " \
"ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
"console=$consoledev,$baudrate $othbootargs;"   \
-   "tftpboot $loadaddr $bootfile;" \
-   "tftpboot $ramdiskaddr $ramdiskfile;"   \
-   "zboot $loadaddr 0 $ramdiskaddr $filesize"
+   "tftpboot $kernel_addr_r $bootfile;"\
+   "tftpboot $ramdisk_addr_r $ramdiskfile;"\
+   "zboot $kernel_addr_r 0 $ramdisk_addr_r $filesize"
 
 #define CONFIG_NFSBOOTCOMMAND  \
"setenv bootargs root=/dev/nfs rw " \
"nfsroot=$serverip:$rootpath "  \
"ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
"console=$consoledev,$baudrate $othbootargs;"   \
-   "tftpboot $loadaddr $bootfile;" \
-   "zboot $loadaddr"
+   "tftpboot $kernel_addr_r $bootfile;"\
+   "zboot $kernel_addr_r"
 
 
 #endif /* __CONFIG_H */
-- 
2.7.4

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


Re: [U-Boot] buildman rockchip

2019-07-28 Thread Simon Glass
Hi Kever,

On Sun, 28 Jul 2019 at 08:12, Simon Glass  wrote:
>
> HI Kever,
>
> On Sun, 28 Jul 2019 at 05:14, Kever Yang  wrote:
> >
> > Hi Simon,
> >
> >  When I'm using the buildman for rockchip platform, it's always
> > build only 20 boards,
> >
> > and many boards are not build, there are 38 boards with its defconfig in
> > configs/ dir,
> >
> > could you help to check what's missing?
>
> I think I commented on this at the time of the patches to move away
> from arch-rockchip. There are now separate arch directories for each
> soc. Most of them don't mention rockchip at all. See boards.cfg for
> the resulting output.
>
> >
> >
> > See build log:
> >
> > https://travis-ci.org/keveryang/u-boot/jobs/564525467

One more thing...to check what builds will be built try -nv :

buildman -nv rockchip

This will list the boards. You could use 'rk' instead of 'rockchip', perhaps?

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


[U-Boot] [PATCH v2 01/11] fdtdec: make CONFIG_OF_PRIOR_STAGE available in SPL

2019-07-28 Thread Lukas Auer
The current preprocessor logic prevents CONFIG_OF_PRIOR_STAGE from being
used in U-Boot SPL. Change the logic to also make it available in U-Boot
SPL.

Signed-off-by: Lukas Auer 
Reviewed-by: Bin Meng 
Tested-by: Bin Meng 
---

Changes in v2: None

 include/fdtdec.h | 2 +-
 lib/fdtdec.c | 6 ++
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index e6c22dd5cd..635f53083b 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -54,7 +54,7 @@ struct bd_info;
 #define SPL_BUILD  0
 #endif
 
-#if CONFIG_IS_ENABLED(OF_PRIOR_STAGE)
+#ifdef CONFIG_OF_PRIOR_STAGE
 extern phys_addr_t prior_stage_fdt_address;
 #endif
 
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 3ee786b579..569ffd5987 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -1533,16 +1533,14 @@ int fdtdec_setup(void)
puts("Failed to read control FDT\n");
return -1;
}
+# elif defined(CONFIG_OF_PRIOR_STAGE)
+   gd->fdt_blob = (void *)prior_stage_fdt_address;
 # endif
 # ifndef CONFIG_SPL_BUILD
/* Allow the early environment to override the fdt address */
-#  if CONFIG_IS_ENABLED(OF_PRIOR_STAGE)
-   gd->fdt_blob = (void *)prior_stage_fdt_address;
-#  else
gd->fdt_blob = map_sysmem
(env_get_ulong("fdtcontroladdr", 16,
   (unsigned long)map_to_sysmem(gd->fdt_blob)), 0);
-#  endif
 # endif
 
 # if CONFIG_IS_ENABLED(MULTI_DTB_FIT)
-- 
2.21.0

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


[U-Boot] [PATCH v2 02/11] Makefile: support building SPL FIT images without device trees

2019-07-28 Thread Lukas Auer
When building a U-Boot FIT image, the device trees specified by the
board are unconditionally built for inclusion in the FIT image. However,
not all device tree providers, such as CONFIG_OF_PRIOR_STAGE, require a
device tree to be built and bundled with the U-Boot binary. They rely on
other mechanisms to provide the device tree to U-Boot. Compilation on
boards with these device tree providers fails, because they do not
specify a device tree.

Change the makefile rules to conditionally build the device trees if
either CONFIG_OF_SEPARATE or CONFIG_OF_EMBED is selected as device tree
provider.

Signed-off-by: Lukas Auer 
Reviewed-by: Bin Meng 
Tested-by: Bin Meng 
---

Changes in v2: None

 Makefile | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 704579bec1..84678b2c47 100644
--- a/Makefile
+++ b/Makefile
@@ -1263,7 +1263,9 @@ MKIMAGEFLAGS_u-boot.pbl = -n 
$(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \
-R $(srctree)/$(CONFIG_SYS_FSL_PBL_PBI:"%"=%) -T pblimage
 
 u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl u-boot-ivt.img: \
-   $(if $(CONFIG_SPL_LOAD_FIT),u-boot-nodtb.bin 
dts/dt.dtb,u-boot.bin) FORCE
+   $(if $(CONFIG_SPL_LOAD_FIT),u-boot-nodtb.bin \
+   $(if 
$(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED),dts/dt.dtb) \
+   ,u-boot.bin) FORCE
$(call if_changed,mkimage)
$(BOARD_SIZE_CHECK)
 
@@ -1273,7 +1275,9 @@ else
 MKIMAGEFLAGS_u-boot.itb = -E
 endif
 
-u-boot.itb: u-boot-nodtb.bin dts/dt.dtb $(U_BOOT_ITS) FORCE
+u-boot.itb: u-boot-nodtb.bin \
+   $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED),dts/dt.dtb) \
+   $(U_BOOT_ITS) FORCE
$(call if_changed,mkfitimage)
$(BOARD_SIZE_CHECK)
 
-- 
2.21.0

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


[U-Boot] [PATCH v2 06/11] riscv: add SPL support

2019-07-28 Thread Lukas Auer
U-Boot SPL on the generic RISC-V CPU supports two boot flows, directly
jumping to the image and via OpenSBI firmware. In the first case, both
U-Boot SPL and proper must be compiled to run in the same privilege
mode. Using OpenSBI firmware, U-Boot SPL must be compiled for machine
mode and U-Boot proper for supervisor mode.

To be able to use SPL, boards have to provide a supported SPL boot
device.

Signed-off-by: Lukas Auer 
Reviewed-by: Bin Meng 
Tested-by: Bin Meng 
---

Changes in v2: None

 arch/Kconfig   |  6 +++
 arch/riscv/Kconfig |  3 ++
 arch/riscv/cpu/generic/Kconfig |  3 ++
 arch/riscv/cpu/start.S | 23 +-
 arch/riscv/cpu/u-boot-spl.lds  | 82 ++
 arch/riscv/include/asm/spl.h   | 31 +
 arch/riscv/lib/Makefile|  1 +
 arch/riscv/lib/spl.c   | 48 
 8 files changed, 196 insertions(+), 1 deletion(-)
 create mode 100644 arch/riscv/cpu/u-boot-spl.lds
 create mode 100644 arch/riscv/include/asm/spl.h
 create mode 100644 arch/riscv/lib/spl.c

diff --git a/arch/Kconfig b/arch/Kconfig
index 949eb28dfa..8350d9b1ea 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -76,6 +76,12 @@ config RISCV
imply MTD
imply TIMER
imply CMD_DM
+   imply SPL_DM
+   imply SPL_OF_CONTROL
+   imply SPL_LIBCOMMON_SUPPORT
+   imply SPL_LIBGENERIC_SUPPORT
+   imply SPL_SERIAL_SUPPORT
+   imply SPL_TIMER
 
 config SANDBOX
bool "Sandbox"
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index b8d01ba8e1..01975d7c60 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -226,4 +226,7 @@ config STACK_SIZE_SHIFT
int
default 13
 
+config SPL_LDSCRIPT
+   default "arch/riscv/cpu/u-boot-spl.lds"
+
 endmenu
diff --git a/arch/riscv/cpu/generic/Kconfig b/arch/riscv/cpu/generic/Kconfig
index b7552f539f..b2cb155d6d 100644
--- a/arch/riscv/cpu/generic/Kconfig
+++ b/arch/riscv/cpu/generic/Kconfig
@@ -10,3 +10,6 @@ config GENERIC_RISCV
imply RISCV_TIMER
imply SIFIVE_CLINT if (RISCV_MMODE || SPL_RISCV_MMODE)
imply CMD_CPU
+   imply SPL_CPU_SUPPORT
+   imply SPL_OPENSBI
+   imply SPL_LOAD_FIT
diff --git a/arch/riscv/cpu/start.S b/arch/riscv/cpu/start.S
index 08b9812c4d..e053197645 100644
--- a/arch/riscv/cpu/start.S
+++ b/arch/riscv/cpu/start.S
@@ -76,7 +76,11 @@ _start:
  */
 call_board_init_f:
li  t0, -16
+#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_STACK)
+   li  t1, CONFIG_SPL_STACK
+#else
li  t1, CONFIG_SYS_INIT_SP_ADDR
+#endif
and sp, t1, t0  /* force 16 byte alignment */
 
 call_board_init_f_0:
@@ -160,7 +164,24 @@ wait_for_gd_init:
 
mv  a0, zero/* a0 <-- boot_flags = 0 */
la  t5, board_init_f
-   jr  t5  /* jump to board_init_f() */
+   jalrt5  /* jump to board_init_f() */
+
+#ifdef CONFIG_SPL_BUILD
+spl_clear_bss:
+   la  t0, __bss_start
+   la  t1, __bss_end
+   beq t0, t1, spl_call_board_init_r
+
+spl_clear_bss_loop:
+   SREGzero, 0(t0)
+   addit0, t0, REGBYTES
+   bne t0, t1, spl_clear_bss_loop
+
+spl_call_board_init_r:
+   mv  a0, zero
+   mv  a1, zero
+   jal board_init_r
+#endif
 
 /*
  * void relocate_code (addr_sp, gd, addr_moni)
diff --git a/arch/riscv/cpu/u-boot-spl.lds b/arch/riscv/cpu/u-boot-spl.lds
new file mode 100644
index 00..32255d58de
--- /dev/null
+++ b/arch/riscv/cpu/u-boot-spl.lds
@@ -0,0 +1,82 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Based on arch/riscv/cpu/u-boot.lds, which is
+ * Copyright (C) 2017 Andes Technology Corporation
+ * Rick Chen, Andes Technology Corporation 
+ *
+ * and arch/mips/cpu/u-boot-spl.lds.
+ */
+MEMORY { .spl_mem : ORIGIN = IMAGE_TEXT_BASE, LENGTH = IMAGE_MAX_SIZE }
+MEMORY { .bss_mem : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \
+   LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
+
+OUTPUT_ARCH("riscv")
+ENTRY(_start)
+
+SECTIONS
+{
+   . = ALIGN(4);
+   .text : {
+   arch/riscv/cpu/start.o  (.text)
+   *(.text*)
+   } > .spl_mem
+
+   . = ALIGN(4);
+   .rodata : {
+   *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
+   } > .spl_mem
+
+   . = ALIGN(4);
+   .data : {
+   *(.data*)
+   } > .spl_mem
+   . = ALIGN(4);
+
+   .got : {
+   __got_start = .;
+   *(.got.plt) *(.got)
+   __got_end = .;
+   } > .spl_mem
+
+   . = ALIGN(4);
+
+   .u_boot_list : {
+   KEEP(*(SORT(.u_boot_list*)));
+   } > .spl_mem
+
+   . = ALIGN(4);
+
+   .binman_sym_table : {
+   __binman_sym_start = .;
+   KEEP(*(SORT(.binman_sym*)));
+   __binman_sym_end = .;
+   } > .spl_mem
+
+   . = ALIGN(4);
+
+   /DISCARD/ : { *(.rela.plt*) }
+ 

[U-Boot] [PATCH v2 09/11] riscv: set default FIT generator script and build target for SPL builds

2019-07-28 Thread Lukas Auer
Now that we have a generic FIT generator script for RISC-V, set it as
the default. To also build the FIT image by default, set the default
build target to "u-boot.itb" if CONFIG_SPL_LOAD_FIT is enabled.

Signed-off-by: Lukas Auer 
Reviewed-by: Bin Meng 
Tested-by: Bin Meng 
---

Changes in v2: None

 Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Kconfig b/Kconfig
index d2eb744e70..a78dd59a79 100644
--- a/Kconfig
+++ b/Kconfig
@@ -250,7 +250,8 @@ config BUILD_TARGET
default "u-boot-with-spl.sfp" if TARGET_SOCFPGA_GEN5
default "u-boot-spl.kwb" if ARCH_MVEBU && SPL
default "u-boot-elf.srec" if RCAR_GEN3
-   default "u-boot.itb" if SPL_LOAD_FIT && (ROCKCHIP_RK3399 || ARCH_SUNXI)
+   default "u-boot.itb" if SPL_LOAD_FIT && (ROCKCHIP_RK3399 || \
+   ARCH_SUNXI || RISCV)
default "u-boot.kwb" if KIRKWOOD
default "u-boot-with-spl.bin" if ARCH_AT91 && SPL_NAND_SUPPORT
help
@@ -463,6 +464,7 @@ config SPL_FIT_GENERATOR
depends on SPL_FIT
default "board/sunxi/mksunxi_fit_atf.sh" if SPL_LOAD_FIT && ARCH_SUNXI
default "arch/arm/mach-rockchip/make_fit_atf.py" if SPL_LOAD_FIT && 
ARCH_ROCKCHIP
+   default "arch/riscv/lib/mkimage_fit_opensbi.sh" if SPL_LOAD_FIT && RISCV
help
  Specifies a (platform specific) script file to generate the FIT
  source file used to build the U-Boot FIT image file. This gets
-- 
2.21.0

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


[U-Boot] [PATCH v2 07/11] riscv: support SPL stack and global data relocation

2019-07-28 Thread Lukas Auer
To support relocation of the stack and global data on RISC-V, the
secondary harts must be notified of the change using IPIs. We can reuse
the hart relocation code for this purpose. It uses global data to store
the new stack pointer and global data pointer for the secondary harts.
This means that we cannot update the global data pointer of the main
hart in spl_relocate_stack_gd(), because the secondary harts have not
yet been relocated at this point. It is updated after the secondary
harts have been notified.

Signed-off-by: Lukas Auer 
Reviewed-by: Bin Meng 
Tested-by: Bin Meng 
---

Changes in v2: None

 arch/riscv/cpu/start.S | 35 ++-
 common/spl/spl.c   |  2 +-
 2 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/arch/riscv/cpu/start.S b/arch/riscv/cpu/start.S
index e053197645..e8c65c887a 100644
--- a/arch/riscv/cpu/start.S
+++ b/arch/riscv/cpu/start.S
@@ -170,13 +170,46 @@ wait_for_gd_init:
 spl_clear_bss:
la  t0, __bss_start
la  t1, __bss_end
-   beq t0, t1, spl_call_board_init_r
+   beq t0, t1, spl_stack_gd_setup
 
 spl_clear_bss_loop:
SREGzero, 0(t0)
addit0, t0, REGBYTES
bne t0, t1, spl_clear_bss_loop
 
+spl_stack_gd_setup:
+   jal spl_relocate_stack_gd
+
+   /* skip setup if we did not relocate */
+   beqza0, spl_call_board_init_r
+   mv  s0, a0
+
+   /* setup stack on main hart */
+#ifdef CONFIG_SMP
+   /* tp: hart id */
+   sllit0, tp, CONFIG_STACK_SIZE_SHIFT
+   sub sp, s0, t0
+#else
+   mv  sp, s0
+#endif
+
+   /* set new stack and global data pointer on secondary harts */
+spl_secondary_hart_stack_gd_setup:
+   la  a0, secondary_hart_relocate
+   mv  a1, s0
+   mv  a2, s0
+   jal smp_call_function
+
+   /* hang if relocation of secondary harts has failed */
+   beqza0, 1f
+   mv  a1, a0
+   la  a0, secondary_harts_relocation_error
+   jal printf
+   jal hang
+
+   /* set new global data pointer on main hart */
+1: mv  gp, s0
+
 spl_call_board_init_r:
mv  a0, zero
mv  a1, zero
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 1ed4741bdc..834f39908b 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -756,7 +756,7 @@ ulong spl_relocate_stack_gd(void)
 #if CONFIG_IS_ENABLED(DM)
dm_fixup_for_gd_move(new_gd);
 #endif
-#if !defined(CONFIG_ARM)
+#if !defined(CONFIG_ARM) && !defined(CONFIG_RISCV)
gd = new_gd;
 #endif
return ptr;
-- 
2.21.0

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


[U-Boot] [PATCH v2 04/11] riscv: add run mode configuration for SPL

2019-07-28 Thread Lukas Auer
U-Boot SPL can be run in a different privilege mode from U-Boot proper.
Add new configuration entries for SPL to allow the run mode to be
configured independently of U-Boot proper.

Extend all uses of the CONFIG_RISCV_SMODE and CONFIG_RISCV_MMODE
configuration symbols to also cover the SPL equivalents. Ensure that
files compatible with only one privilege mode are not included in builds
targeting an incompatible privilege mode.

Signed-off-by: Lukas Auer 
Reviewed-by: Bin Meng 
Tested-by: Bin Meng 
---

Changes in v2: None

 arch/riscv/Kconfig| 33 ++-
 arch/riscv/cpu/ax25/Kconfig   |  6 +++---
 arch/riscv/cpu/cpu.c  |  6 +++---
 arch/riscv/cpu/generic/Kconfig|  2 +-
 arch/riscv/cpu/start.S|  6 +++---
 arch/riscv/include/asm/encoding.h |  2 +-
 arch/riscv/lib/Makefile   |  7 +--
 7 files changed, 44 insertions(+), 18 deletions(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 8cfc7d0faa..b8d01ba8e1 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -113,6 +113,23 @@ config RISCV_SMODE
 
 endchoice
 
+choice
+   prompt "SPL Run Mode"
+   default SPL_RISCV_MMODE
+   depends on SPL
+
+config SPL_RISCV_MMODE
+   bool "Machine"
+   help
+ Choose this option to build U-Boot SPL for RISC-V M-Mode.
+
+config SPL_RISCV_SMODE
+   bool "Supervisor"
+   help
+ Choose this option to build U-Boot SPL for RISC-V S-Mode.
+
+endchoice
+
 config RISCV_ISA_C
bool "Emit compressed instructions"
default y
@@ -132,34 +149,40 @@ config 64BIT
 
 config SIFIVE_CLINT
bool
-   depends on RISCV_MMODE
+   depends on RISCV_MMODE || SPL_RISCV_MMODE
select REGMAP
select SYSCON
+   select SPL_REGMAP if SPL
+   select SPL_SYSCON if SPL
help
  The SiFive CLINT block holds memory-mapped control and status 
registers
  associated with software and timer interrupts.
 
 config ANDES_PLIC
bool
-   depends on RISCV_MMODE
+   depends on RISCV_MMODE || SPL_RISCV_MMODE
select REGMAP
select SYSCON
+   select SPL_REGMAP if SPL
+   select SPL_SYSCON if SPL
help
  The Andes PLIC block holds memory-mapped claim and pending registers
  associated with software interrupt.
 
 config ANDES_PLMT
bool
-   depends on RISCV_MMODE
+   depends on RISCV_MMODE || SPL_RISCV_MMODE
select REGMAP
select SYSCON
+   select SPL_REGMAP if SPL
+   select SPL_SYSCON if SPL
help
  The Andes PLMT block holds memory-mapped mtime register
  associated with timer tick.
 
 config RISCV_RDTIME
bool
-   default y if RISCV_SMODE
+   default y if RISCV_SMODE || SPL_RISCV_SMODE
help
  The provides the riscv_get_time() API that is implemented using the
  standard rdtime instruction. This is the case for S-mode U-Boot, and
@@ -189,7 +212,7 @@ config NR_CPUS
 
 config SBI_IPI
bool
-   default y if RISCV_SMODE
+   default y if RISCV_SMODE || SPL_RISCV_SMODE
depends on SMP
 
 config XIP
diff --git a/arch/riscv/cpu/ax25/Kconfig b/arch/riscv/cpu/ax25/Kconfig
index 6b4b92e692..f4b59cb71d 100644
--- a/arch/riscv/cpu/ax25/Kconfig
+++ b/arch/riscv/cpu/ax25/Kconfig
@@ -4,8 +4,8 @@ config RISCV_NDS
imply CPU
imply CPU_RISCV
imply RISCV_TIMER
-   imply ANDES_PLIC if RISCV_MMODE
-   imply ANDES_PLMT if RISCV_MMODE
+   imply ANDES_PLIC if (RISCV_MMODE || SPL_RISCV_MMODE)
+   imply ANDES_PLMT if (RISCV_MMODE || SPL_RISCV_MMODE)
help
  Run U-Boot on AndeStar V5 platforms and use some specific features
  which are provided by Andes Technology AndeStar V5 families.
@@ -14,7 +14,7 @@ if RISCV_NDS
 
 config RISCV_NDS_CACHE
bool "AndeStar V5 families specific cache support"
-   depends on RISCV_MMODE
+   depends on RISCV_MMODE || SPL_RISCV_MMODE
help
  Provide Andes Technology AndeStar V5 families specific cache support.
 
diff --git a/arch/riscv/cpu/cpu.c b/arch/riscv/cpu/cpu.c
index e9a8b437ed..ecf682c290 100644
--- a/arch/riscv/cpu/cpu.c
+++ b/arch/riscv/cpu/cpu.c
@@ -47,13 +47,13 @@ static inline bool supports_extension(char ext)
 
return false;
 #else  /* !CONFIG_CPU */
-#ifdef CONFIG_RISCV_MMODE
+#if CONFIG_IS_ENABLED(RISCV_MMODE)
return csr_read(misa) & (1 << (ext - 'a'));
-#else  /* !CONFIG_RISCV_MMODE */
+#else  /* !CONFIG_IS_ENABLED(RISCV_MMODE) */
 #warning "There is no way to determine the available extensions in S-mode."
 #warning "Please convert your board to use the RISC-V CPU driver."
return false;
-#endif /* CONFIG_RISCV_MMODE */
+#endif /* CONFIG_IS_ENABLED(RISCV_MMODE) */
 #endif /* CONFIG_CPU */
 }
 
diff --git a/arch/riscv/cpu/generic/Kconfig b/arch/riscv/cpu/generic/Kconfig
index 1d6ab5032d..b7552f539f 100644
--- a/arch/riscv/cpu/generic/Kconfig
+++ b/ar

[U-Boot] [PATCH v2 10/11] riscv: qemu: add SPL configuration

2019-07-28 Thread Lukas Auer
Add two new configurations (qemu-riscv{32,64}_spl_defconfig) with SPL
enabled for RISC-V QEMU. QEMU does not require SPL to run U-Boot. The
configurations are meant to help the development of SPL on RISC-V.

The configurations enable RAM as the only SPL boot device. Images must
be loaded at address 0x8020. In the default boot flow, U-Boot SPL
starts in machine mode, loads the OpenSBI FW_DYNAMIC firmware and U-Boot
proper from the supplied FIT image, and starts OpenSBI. U-Boot proper is
then started in supervisor mode by OpenSBI.

Signed-off-by: Lukas Auer 
Reviewed-by: Bin Meng 
Tested-by: Bin Meng 
---

Changes in v2: None

 board/emulation/qemu-riscv/Kconfig  | 10 ++
 board/emulation/qemu-riscv/MAINTAINERS  |  2 ++
 board/emulation/qemu-riscv/qemu-riscv.c | 17 +
 configs/qemu-riscv32_spl_defconfig  | 11 +++
 configs/qemu-riscv64_spl_defconfig  | 12 
 include/configs/qemu-riscv.h| 14 ++
 6 files changed, 66 insertions(+)
 create mode 100644 configs/qemu-riscv32_spl_defconfig
 create mode 100644 configs/qemu-riscv64_spl_defconfig

diff --git a/board/emulation/qemu-riscv/Kconfig 
b/board/emulation/qemu-riscv/Kconfig
index 6cc7c31dc6..1928d6dda0 100644
--- a/board/emulation/qemu-riscv/Kconfig
+++ b/board/emulation/qemu-riscv/Kconfig
@@ -13,13 +13,21 @@ config SYS_CONFIG_NAME
default "qemu-riscv"
 
 config SYS_TEXT_BASE
+   default 0x8120 if SPL
default 0x8000 if !RISCV_SMODE
default 0x8020 if RISCV_SMODE && ARCH_RV64I
default 0x8040 if RISCV_SMODE && ARCH_RV32I
 
+config SPL_TEXT_BASE
+   default 0x8000
+
+config SPL_OPENSBI_LOAD_ADDR
+   default 0x8100
+
 config BOARD_SPECIFIC_OPTIONS # dummy
def_bool y
select GENERIC_RISCV
+   select SUPPORT_SPL
imply SYS_NS16550
imply VIRTIO_MMIO
imply VIRTIO_NET
@@ -43,5 +51,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
imply CMD_PCI
imply E1000
imply NVME
+   imply SPL_RAM_SUPPORT
+   imply SPL_RAM_DEVICE
 
 endif
diff --git a/board/emulation/qemu-riscv/MAINTAINERS 
b/board/emulation/qemu-riscv/MAINTAINERS
index c701c83d77..78969ed6bd 100644
--- a/board/emulation/qemu-riscv/MAINTAINERS
+++ b/board/emulation/qemu-riscv/MAINTAINERS
@@ -5,5 +5,7 @@ F:  board/emulation/qemu-riscv/
 F: include/configs/qemu-riscv.h
 F: configs/qemu-riscv32_defconfig
 F: configs/qemu-riscv32_smode_defconfig
+F: configs/qemu-riscv32_spl_defconfig
 F: configs/qemu-riscv64_defconfig
 F: configs/qemu-riscv64_smode_defconfig
+F: configs/qemu-riscv64_spl_defconfig
diff --git a/board/emulation/qemu-riscv/qemu-riscv.c 
b/board/emulation/qemu-riscv/qemu-riscv.c
index d6167aaef1..e04bd3001c 100644
--- a/board/emulation/qemu-riscv/qemu-riscv.c
+++ b/board/emulation/qemu-riscv/qemu-riscv.c
@@ -6,6 +6,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -87,3 +88,19 @@ int ft_board_setup(void *blob, bd_t *bd)
 
return 0;
 }
+
+#ifdef CONFIG_SPL
+u32 spl_boot_device(void)
+{
+   /* RISC-V QEMU only supports RAM as SPL boot device */
+   return BOOT_DEVICE_RAM;
+}
+#endif
+
+#ifdef CONFIG_SPL_LOAD_FIT
+int board_fit_config_name_match(const char *name)
+{
+   /* boot using first FIT config */
+   return 0;
+}
+#endif
diff --git a/configs/qemu-riscv32_spl_defconfig 
b/configs/qemu-riscv32_spl_defconfig
new file mode 100644
index 00..78e755b36a
--- /dev/null
+++ b/configs/qemu-riscv32_spl_defconfig
@@ -0,0 +1,11 @@
+CONFIG_RISCV=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_SPL=y
+CONFIG_TARGET_QEMU_VIRT=y
+CONFIG_RISCV_SMODE=y
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_FIT=y
+CONFIG_DISPLAY_CPUINFO=y
+CONFIG_DISPLAY_BOARDINFO=y
+# CONFIG_CMD_MII is not set
+CONFIG_OF_PRIOR_STAGE=y
diff --git a/configs/qemu-riscv64_spl_defconfig 
b/configs/qemu-riscv64_spl_defconfig
new file mode 100644
index 00..a3f5e29d58
--- /dev/null
+++ b/configs/qemu-riscv64_spl_defconfig
@@ -0,0 +1,12 @@
+CONFIG_RISCV=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_SPL=y
+CONFIG_TARGET_QEMU_VIRT=y
+CONFIG_ARCH_RV64I=y
+CONFIG_RISCV_SMODE=y
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_FIT=y
+CONFIG_DISPLAY_CPUINFO=y
+CONFIG_DISPLAY_BOARDINFO=y
+# CONFIG_CMD_MII is not set
+CONFIG_OF_PRIOR_STAGE=y
diff --git a/include/configs/qemu-riscv.h b/include/configs/qemu-riscv.h
index df22f780b0..69aa82d36a 100644
--- a/include/configs/qemu-riscv.h
+++ b/include/configs/qemu-riscv.h
@@ -8,6 +8,18 @@
 
 #include 
 
+#ifdef CONFIG_SPL
+
+#define CONFIG_SPL_MAX_SIZE0x0010
+#define CONFIG_SPL_BSS_START_ADDR  0x8400
+#define CONFIG_SPL_BSS_MAX_SIZE0x0010
+#define CONFIG_SYS_SPL_MALLOC_START0x8410
+#define CONFIG_SYS_SPL_MALLOC_SIZE 0x0010
+
+#define CONFIG_SPL_LOAD_FIT_ADDRESS0x8020
+
+#endif
+
 #define CONFIG_SYS_SDRAM_BASE  0x8000
 #define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_SDRAM_BASE + SZ

[U-Boot] [PATCH v2 11/11] doc: update QEMU RISC-V documentation

2019-07-28 Thread Lukas Auer
The available defconfigs for RISC-V QEMU have changed. We now have
configurations to compile U-Boot to run in supervisor mode and for
U-Boot SPL. Update the QEMU RISC-V documentation to reflect these
changes.

Signed-off-by: Lukas Auer 
Reviewed-by: Bin Meng 
Tested-by: Bin Meng 
---

Changes in v2:
- Rebase on master and format documentation as reStructuredText

 doc/board/emulation/qemu-riscv.rst | 60 +-
 1 file changed, 59 insertions(+), 1 deletion(-)

diff --git a/doc/board/emulation/qemu-riscv.rst 
b/doc/board/emulation/qemu-riscv.rst
index 214833496b..9472a6f812 100644
--- a/doc/board/emulation/qemu-riscv.rst
+++ b/doc/board/emulation/qemu-riscv.rst
@@ -6,7 +6,8 @@ QEMU RISC-V
 
 QEMU for RISC-V supports a special 'virt' machine designed for emulation and
 virtualization purposes. This document describes how to run U-Boot under it.
-Both 32-bit 64-bit targets are supported.
+Both 32-bit and 64-bit targets are supported, running in either machine or
+supervisor mode.
 
 The QEMU virt machine models a generic RISC-V virtual machine with support for
 the VirtIO standard networking and block storage devices. It has CLINT, PLIC,
@@ -28,6 +29,11 @@ Set the CROSS_COMPILE environment variable as usual, and run:
 make qemu-riscv64_defconfig
 make
 
+This will compile U-Boot for machine mode. To build supervisor mode binaries,
+use the configurations qemu-riscv32_smode_defconfig and
+qemu-riscv64_smode_defconfig instead. Note that U-Boot running in supervisor
+mode requires a supervisor binary interface (SBI), such as RISC-V OpenSBI.
+
 Running U-Boot
 --
 The minimal QEMU command line to get U-Boot up and running is:
@@ -46,4 +52,56 @@ parameter. For example, '-m 2G' creates 2GiB memory for the 
target,
 and the memory node in the embedded DTB created by QEMU reflects
 the new setting.
 
+For instructions on how to run U-Boot in supervisor mode on QEMU
+with OpenSBI, see the documentation available with OpenSBI:
+https://github.com/riscv/opensbi/blob/master/docs/platform/qemu_virt.md
+
 These have been tested in QEMU 3.0.0.
+
+Running U-Boot SPL
+--
+In the default SPL configuration, U-Boot SPL starts in machine mode. U-Boot
+proper and OpenSBI (FW_DYNAMIC firmware) are bundled as FIT image and made
+available to U-Boot SPL. Both are then loaded by U-Boot SPL and the location
+of U-Boot proper is passed to OpenSBI. After initialization, U-Boot proper is
+started in supervisor mode by OpenSBI.
+
+OpenSBI must be compiled before compiling U-Boot. Clone the OpenSBI repository
+and run the following command.
+
+.. code-block:: console
+
+git clone https://github.com/riscv/opensbi.git
+cd opensbi
+make PLATFORM=qemu/virt
+
+See the OpenSBI documentation for full details:
+https://github.com/riscv/opensbi/blob/master/docs/platform/qemu_virt.md
+
+To make the FW_DYNAMIC binary 
(build/platform/qemu/virt/firmware/fw_dynamic.bin)
+available to U-Boot, either copy it into the U-Boot root directory or specify
+its location with the OPENSBI environment variable. Afterwards, compile U-Boot
+with the following commands.
+
+- For 32-bit RISC-V::
+
+make qemu-riscv32_spl_defconfig
+make
+
+- For 64-bit RISC-V::
+
+make qemu-riscv64_spl_defconfig
+make
+
+The minimal QEMU commands to run U-Boot SPL in both 32-bit and 64-bit
+configurations are:
+
+- For 32-bit RISC-V::
+
+qemu-system-riscv32 -nographic -machine virt -kernel spl/u-boot-spl \
+-device loader,file=u-boot.itb,addr=0x8020
+
+- For 64-bit RISC-V::
+
+qemu-system-riscv64 -nographic -machine virt -kernel spl/u-boot-spl \
+-device loader,file=u-boot.itb,addr=0x8020
-- 
2.21.0

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


[U-Boot] [PATCH v2 03/11] spl: fit: use U-Boot device tree when FIT image has no device tree

2019-07-28 Thread Lukas Auer
As part of the SPL FIT boot flow, the device tree is appended to U-Boot
proper. The device tree is used to record information on the loadables
to make them available to the SPL framework and U-Boot proper. Depending
on the U-Boot device tree provider, the FIT image might not include a
device tree. Information on the loadables is missing in this case.

When booting via firmware bundled with the FIT image, U-Boot SPL loads
the firmware binary and U-Boot proper before starting the firmware. The
firmware, in turn, is responsible for starting U-Boot proper.
Information on the memory location of the U-Boot proper loadable must be
available to the SPL framework so that it can be passed to the firmware
binary. To support this use case when no device tree is found in the FIT
image, fall back to the U-Boot device tree in this situation.

At the same time, update the comment to remove the note that the
destination address must be aligned to ARCH_DMA_MINALIGN. Alignment is
only required as an intermediate step when reading external data. This
is automatically handled by spl_fit_append_fdt(). After reading the
external data, it is copied to the specified address, which does not
have to be aligned to ARCH_DMA_MINALIGN.

Signed-off-by: Lukas Auer 
Reviewed-by: Bin Meng 
Tested-by: Bin Meng 
---

Changes in v2: None

 common/spl/spl_fit.c | 37 -
 1 file changed, 24 insertions(+), 13 deletions(-)

diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 969f7775c1..0bfb91d686 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -11,6 +11,8 @@
 #include 
 #include 
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifndef CONFIG_SYS_BOOTM_LEN
 #define CONFIG_SYS_BOOTM_LEN   (64 << 20)
 #endif
@@ -278,25 +280,34 @@ static int spl_fit_append_fdt(struct spl_image_info 
*spl_image,
  void *fit, int images, ulong base_offset)
 {
struct spl_image_info image_info;
-   int node, ret;
+   int node, ret = 0;
+
+   /*
+* Use the address following the image as target address for the
+* device tree.
+*/
+   image_info.load_addr = spl_image->load_addr + spl_image->size;
 
/* Figure out which device tree the board wants to use */
node = spl_fit_get_image_node(fit, images, FIT_FDT_PROP, 0);
if (node < 0) {
debug("%s: cannot find FDT node\n", __func__);
-   return node;
-   }
-
-   /*
-* Read the device tree and place it after the image.
-* Align the destination address to ARCH_DMA_MINALIGN.
-*/
-   image_info.load_addr = spl_image->load_addr + spl_image->size;
-   ret = spl_load_fit_image(info, sector, fit, base_offset, node,
-&image_info);
 
-   if (ret < 0)
-   return ret;
+   /*
+* U-Boot did not find a device tree inside the FIT image. Use
+* the U-Boot device tree instead.
+*/
+   if (gd->fdt_blob)
+   memcpy((void *)image_info.load_addr, gd->fdt_blob,
+  fdt_totalsize(gd->fdt_blob));
+   else
+   return node;
+   } else {
+   ret = spl_load_fit_image(info, sector, fit, base_offset, node,
+&image_info);
+   if (ret < 0)
+   return ret;
+   }
 
/* Make the load-address of the FDT available for the SPL framework */
spl_image->fdt_addr = (void *)image_info.load_addr;
-- 
2.21.0

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


[U-Boot] [PATCH v2 08/11] riscv: add a generic FIT generator script

2019-07-28 Thread Lukas Auer
Add a generic FIT generator script for RISC-V to generate images
containing U-Boot, OpenSBI FW_DYNAMIC firmware, and optionally one or
more device trees. The location of the OpenSBI firmware binary can be
specified with the OPENSBI environment variable. By default, it is
assumed to be "fw_dynamic.bin" and located in the U-Boot top-level.
Device trees are passed as arguments to the generator script. A separate
configuration entry is created for each device tree.

The load addresses of U-Boot and OpenSBI are parsed from the U-Boot
configuration. They can be overwritten with the UBOOT_LOAD_ADDR and
OPENSBI_LOAD_ADDR environment variables.

The script is based on the i.MX (arch/arm/mach-imx/mkimage_fit_atf.sh)
and Allwinner sunxi (board/sunxi/mksunxi_fit_atf.sh) FIT generator
scripts.

Signed-off-by: Lukas Auer 
Reviewed-by: Bin Meng 
Tested-by: Bin Meng 
---

Changes in v2: None

 arch/riscv/lib/mkimage_fit_opensbi.sh | 100 ++
 1 file changed, 100 insertions(+)
 create mode 100755 arch/riscv/lib/mkimage_fit_opensbi.sh

diff --git a/arch/riscv/lib/mkimage_fit_opensbi.sh 
b/arch/riscv/lib/mkimage_fit_opensbi.sh
new file mode 100755
index 00..d6f95e5bfd
--- /dev/null
+++ b/arch/riscv/lib/mkimage_fit_opensbi.sh
@@ -0,0 +1,100 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0+
+#
+# script to generate FIT image source for RISC-V boards with OpenSBI
+# and, optionally, multiple device trees (given on the command line).
+#
+# usage: $0 [ [&2
+   OPENSBI=/dev/null
+fi
+
+cat << __HEADER_EOF
+/dts-v1/;
+
+/ {
+   description = "Configuration to load OpenSBI before U-Boot";
+
+   images {
+   uboot {
+   description = "U-Boot";
+   data = /incbin/("u-boot-nodtb.bin");
+   type = "standalone";
+   os = "U-Boot";
+   arch = "riscv";
+   compression = "none";
+   load = <$UBOOT_LOAD_ADDR>;
+   };
+   opensbi {
+   description = "RISC-V OpenSBI";
+   data = /incbin/("$OPENSBI");
+   type = "firmware";
+   os = "opensbi";
+   arch = "riscv";
+   compression = "none";
+   load = <$OPENSBI_LOAD_ADDR>;
+   entry = <$OPENSBI_LOAD_ADDR>;
+   };
+__HEADER_EOF
+
+cnt=1
+for dtname in $*
+do
+   cat << __FDT_IMAGE_EOF
+   fdt_$cnt {
+   description = "$(basename $dtname .dtb)";
+   data = /incbin/("$dtname");
+   type = "flat_dt";
+   compression = "none";
+   };
+__FDT_IMAGE_EOF
+cnt=$((cnt+1))
+done
+
+cat << __CONF_HEADER_EOF
+   };
+   configurations {
+   default = "config_1";
+
+__CONF_HEADER_EOF
+
+if [ $# -eq 0 ]; then
+cat << __CONF_SECTION_EOF
+   config_1 {
+   description = "U-Boot FIT";
+   firmware = "opensbi";
+   loadables = "uboot";
+   };
+__CONF_SECTION_EOF
+else
+cnt=1
+for dtname in $*
+do
+cat << __CONF_SECTION_EOF
+   config_$cnt {
+   description = "$(basename $dtname .dtb)";
+   firmware = "opensbi";
+   loadables = "uboot";
+   fdt = "fdt_$cnt";
+   };
+__CONF_SECTION_EOF
+cnt=$((cnt+1))
+done
+fi
+
+cat << __ITS_EOF
+   };
+};
+__ITS_EOF
-- 
2.21.0

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


[U-Boot] [PATCH v2 00/11] SPL support for RISC-V

2019-07-28 Thread Lukas Auer
This series adds support for SPL to RISC-V U-Boot. Images can be booted
via OpenSBI (FW_DYNAMIC firmware) or by directly jumping to them. In the
former case, OpenSBI and U-Boot proper are bundled as a FIT image and
made available to U-Boot SPL. Currently, only the QEMU board enables
U-Boot SPL with a dedicated configuration. It uses RAM as SPL boot
device.

On many RISC-V CPUs, the device tree is provided to U-Boot by the
first stage bootloader. This requires changes to U-Boot SPL (patches 1,
2 and 3), which modify the behavior on other boards as well.

To test this series, OpenSBI has to be compiled first. The
fw_dynamic.bin binary must be copied into the U-Boot root directory.
Alternatively, the location of the binary can be specified with the
OPENSBI environment variable. U-Boot can then be build as normal using
the configuration qemu-riscv64_spl_defconfig for 64-bit builds or
qemu-riscv32_spl_defconfig for 32-bit builds. The outputs from the build
process are the U-Boot SPL binary (spl/u-boot-spl.bin) and the U-Boot
FIT image (u-boot.itb) containing U-Boot proper and OpenSBI.

U-Boot can be run in QEMU with the following command.

qemu-system-riscv64 -nographic -machine virt -kernel spl/u-boot-spl \
-device loader,file=u-boot.itb,addr=0x8020

Changes in v2:
- Rebase on master and format documentation as reStructuredText

Lukas Auer (11):
  fdtdec: make CONFIG_OF_PRIOR_STAGE available in SPL
  Makefile: support building SPL FIT images without device trees
  spl: fit: use U-Boot device tree when FIT image has no device tree
  riscv: add run mode configuration for SPL
  spl: support booting via RISC-V OpenSBI
  riscv: add SPL support
  riscv: support SPL stack and global data relocation
  riscv: add a generic FIT generator script
  riscv: set default FIT generator script and build target for SPL
builds
  riscv: qemu: add SPL configuration
  doc: update QEMU RISC-V documentation

 Kconfig |   4 +-
 Makefile|   8 +-
 arch/Kconfig|   6 ++
 arch/riscv/Kconfig  |  36 +++--
 arch/riscv/cpu/ax25/Kconfig |   6 +-
 arch/riscv/cpu/cpu.c|   6 +-
 arch/riscv/cpu/generic/Kconfig  |   5 +-
 arch/riscv/cpu/start.S  |  62 ++-
 arch/riscv/cpu/u-boot-spl.lds   |  82 +++
 arch/riscv/include/asm/encoding.h   |   2 +-
 arch/riscv/include/asm/spl.h|  31 
 arch/riscv/lib/Makefile |   8 +-
 arch/riscv/lib/mkimage_fit_opensbi.sh   | 100 
 arch/riscv/lib/spl.c|  48 
 board/emulation/qemu-riscv/Kconfig  |  10 +++
 board/emulation/qemu-riscv/MAINTAINERS  |   2 +
 board/emulation/qemu-riscv/qemu-riscv.c |  17 
 common/image.c  |   1 +
 common/spl/Kconfig  |  17 
 common/spl/Makefile |   1 +
 common/spl/spl.c|   8 +-
 common/spl/spl_fit.c|  37 ++---
 common/spl/spl_opensbi.c|  85 
 configs/qemu-riscv32_spl_defconfig  |  11 +++
 configs/qemu-riscv64_spl_defconfig  |  12 +++
 doc/board/emulation/qemu-riscv.rst  |  60 +-
 include/configs/qemu-riscv.h|  14 
 include/fdtdec.h|   2 +-
 include/image.h |   1 +
 include/opensbi.h   |  40 ++
 include/spl.h   |   5 ++
 lib/fdtdec.c|   6 +-
 32 files changed, 691 insertions(+), 42 deletions(-)
 create mode 100644 arch/riscv/cpu/u-boot-spl.lds
 create mode 100644 arch/riscv/include/asm/spl.h
 create mode 100755 arch/riscv/lib/mkimage_fit_opensbi.sh
 create mode 100644 arch/riscv/lib/spl.c
 create mode 100644 common/spl/spl_opensbi.c
 create mode 100644 configs/qemu-riscv32_spl_defconfig
 create mode 100644 configs/qemu-riscv64_spl_defconfig
 create mode 100644 include/opensbi.h

-- 
2.21.0

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


[U-Boot] [PATCH v2 05/11] spl: support booting via RISC-V OpenSBI

2019-07-28 Thread Lukas Auer
RISC-V OpenSBI is an open-source implementation of the RISC-V Supervisor
Binary Interface (SBI) specification. It is required by Linux and U-Boot
running in supervisor mode. This patch adds support for booting via the
OpenSBI FW_DYNAMIC firmware.

In this configuration, U-Boot SPL starts in machine mode. After loading
OpenSBI and U-Boot proper, it will start OpenSBI. All necessary
parameters are generated by U-Boot SPL and passed to OpenSBI. U-Boot
proper is started in supervisor mode by OpenSBI. Support for OpenSBI is
enabled with CONFIG_SPL_OPENSBI. An additional configuration entry,
CONFIG_SPL_OPENSBI_LOAD_ADDR, is used to specify the load address of the
OpenSBI firmware binary. It is not used directly in U-Boot and instead
is intended to make the value available to scripts such as FIT
configuration generators.

The header file include/opensbi.h is based on header files from the
OpenSBI project. They are recent, as of commit bae54f764570 ("firmware:
Add fw_dynamic firmware").

Signed-off-by: Lukas Auer 
Reviewed-by: Bin Meng 
Tested-by: Bin Meng 
---

Changes in v2: None

 common/image.c   |  1 +
 common/spl/Kconfig   | 17 
 common/spl/Makefile  |  1 +
 common/spl/spl.c |  6 +++
 common/spl/spl_opensbi.c | 85 
 include/image.h  |  1 +
 include/opensbi.h| 40 +++
 include/spl.h|  5 +++
 8 files changed, 156 insertions(+)
 create mode 100644 common/spl/spl_opensbi.c
 create mode 100644 include/opensbi.h

diff --git a/common/image.c b/common/image.c
index 9f9538fac2..7c7353a989 100644
--- a/common/image.c
+++ b/common/image.c
@@ -125,6 +125,7 @@ static const table_entry_t uimage_os[] = {
 #if defined(CONFIG_BOOTM_OPENRTOS) || defined(USE_HOSTCC)
{   IH_OS_OPENRTOS, "openrtos", "OpenRTOS", },
 #endif
+   {   IH_OS_OPENSBI,  "opensbi",  "RISC-V OpenSBI",   },
 
{   -1, "", "", },
 };
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 5d6da5db89..939c8517cd 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -1126,6 +1126,23 @@ config SPL_OPTEE
  OP-TEE is an open source Trusted OS  which is loaded by SPL.
  More detail at: https://github.com/OP-TEE/optee_os
 
+config SPL_OPENSBI
+   bool "Support RISC-V OpenSBI"
+   depends on RISCV && SPL_RISCV_MMODE && RISCV_SMODE
+   help
+ OpenSBI is an open-source implementation of the RISC-V Supervisor 
Binary
+ Interface (SBI) specification. U-Boot supports the OpenSBI FW_DYNAMIC
+ firmware. It is loaded and started by U-Boot SPL.
+
+ More details are available at https://github.com/riscv/opensbi and
+ https://github.com/riscv/riscv-sbi-doc
+
+config SPL_OPENSBI_LOAD_ADDR
+   hex "OpenSBI load address"
+   depends on SPL_OPENSBI
+   help
+ Load address of the OpenSBI binary.
+
 config TPL
bool
depends on SUPPORT_TPL
diff --git a/common/spl/Makefile b/common/spl/Makefile
index d28de692dd..5ce6f4ae48 100644
--- a/common/spl/Makefile
+++ b/common/spl/Makefile
@@ -22,6 +22,7 @@ obj-$(CONFIG_$(SPL_TPL_)NET_SUPPORT) += spl_net.o
 obj-$(CONFIG_$(SPL_TPL_)MMC_SUPPORT) += spl_mmc.o
 obj-$(CONFIG_$(SPL_TPL_)ATF) += spl_atf.o
 obj-$(CONFIG_$(SPL_TPL_)OPTEE) += spl_optee.o
+obj-$(CONFIG_$(SPL_TPL_)OPENSBI) += spl_opensbi.o
 obj-$(CONFIG_$(SPL_TPL_)USB_STORAGE) += spl_usb.o
 obj-$(CONFIG_$(SPL_TPL_)FS_FAT) += spl_fat.o
 obj-$(CONFIG_$(SPL_TPL_)FS_EXT4) += spl_ext.o
diff --git a/common/spl/spl.c b/common/spl/spl.c
index d5e3f680f4..1ed4741bdc 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -659,6 +659,12 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
(void *)spl_image.entry_point);
break;
 #endif
+#if CONFIG_IS_ENABLED(OPENSBI)
+   case IH_OS_OPENSBI:
+   debug("Jumping to U-Boot via RISC-V OpenSBI\n");
+   spl_invoke_opensbi(&spl_image);
+   break;
+#endif
 #ifdef CONFIG_SPL_OS_BOOT
case IH_OS_LINUX:
debug("Jumping to Linux\n");
diff --git a/common/spl/spl_opensbi.c b/common/spl/spl_opensbi.c
new file mode 100644
index 00..a6b4480ed2
--- /dev/null
+++ b/common/spl/spl_opensbi.c
@@ -0,0 +1,85 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Fraunhofer AISEC,
+ * Lukas Auer 
+ *
+ * Based on common/spl/spl_atf.c
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+struct fw_dynamic_info opensbi_info;
+
+static int spl_opensbi_find_uboot_node(void *blob, int *uboot_node)
+{
+   int fit_images_node, node;
+   const char *fit_os;
+
+   fit_images_node = fdt_path_offset(blob, "/fit-images");
+   if (fit_images_node < 0)
+   return -ENODEV;
+
+   fdt_for_each_subnode(node, blob, fit_images_node) {
+   fit_os = fdt_getprop(blob, node

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

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

Hi Tom,

could you pick up the rest of the patches? They've been on the list
for several weeks now.

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


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

2019-07-28 Thread Tom Rini
On Sun, Jul 28, 2019 at 06:46:57PM +0200, Bartosz Golaszewski wrote:
> śr., 24 lip 2019 o 21:06 Joe Hershberger  napisał(a):
> >
> > On Wed, Jul 24, 2019 at 3:12 AM Bartosz Golaszewski  wrote:
> > >
> > > From: Bartosz Golaszewski 
> > >
> > > The following series contains all the patches for davinci that have
> > > been sent to the mailing list recently rebased on top of v2019.07 and
> > > retested on da850-lcdk and da850-evm. I collected all the review and
> > > test tags too.
> > >
> > > The first patch is the emac driver conversion to driver model. Patches
> > > 2-5 fix build warnings due to legacy interfaces usage. Patches 6-9 add
> > > support for driver model to the davinci NAND driver. Patches 10-13
> > > enable driver-model support in SPL for davinci. Last patch enables the
> > > driver model for NAND in SPL.
> > >
> > > These patches (except for the last, trivial one) have spent a lot of
> > > time on the list and have been validated. I think they are ready to be
> > > picked up for upstream.
> > >
> > > v1 -> v2:
> > > - fixed a build error on da850_am18xx due to missing CONFIG_DM_ETH=y
> >
> > Heiko, want me to take this through my tree?
> >
> > Thanks,
> > -Joe
> 
> Hi Tom,
> 
> could you pick up the rest of the patches? They've been on the list
> for several weeks now.

I thought Joe picked it all up, please repost whatever is missing,
thanks.

-- 
Tom


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


[U-Boot] [PATCH v3] x86: Avoid writing temporary asl files into the source tree

2019-07-28 Thread Simon Glass
At present the iasl tool (Intel ACPI (Advanced Configuration and Power
Interface) Source Language Compiler) is called in such a way that it uses
the source directory for its temporary files.

This means we end up with these files when building x86 boards:

   board/dfi/dfi-bt700/dsdt.aml
   board/dfi/dfi-bt700/dsdt.asl.tmp

Update the code to put temporary files in the target directory instead.

The iasl tool is quite confusing since it generates files with different
extensions and does not allow these to be individually specified. Add some
documentation to help with this.

Signed-off-by: Simon Glass 
---

Changes in v3:
- Use dsdt.asl.tmp as the temporary file again
- Add ASL_TMP for the temporary file
- Add some comments to make it clear what iasl does

Changes in v2:
- Use dsdt.tmp.c as the temporary filename instead of dsdt.c.tmp
- Remove this file with distclean

 Makefile |  1 +
 scripts/Makefile.lib | 17 ++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 704579bec1..6a147badae 100644
--- a/Makefile
+++ b/Makefile
@@ -1846,6 +1846,7 @@ clean: $(clean-dirs)
-o -name '*.symtypes' -o -name 'modules.order' \
-o -name modules.builtin -o -name '.tmp_*.o.*' \
-o -name 'dsdt.aml' -o -name 'dsdt.asl.tmp' -o -name 'dsdt.c' \
+   -o -name 'dsdt.hex' \
-o -name '*.efi' -o -name '*.gcno' -o -name '*.so' \) \
-type f -print | xargs rm -f \
bl31.c bl31.elf bl31_*.bin image.map
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index de67677f61..7a3b51d61b 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -395,11 +395,22 @@ $(obj)/%_efi.so: $(obj)/%.o $(obj)/efi_crt0.o 
$(obj)/efi_reloc.o $(obj)/efi_free
 
 # ACPI
 # ---
+#
+# This first sends the file (typically dsdt.asl) through the preprocessor
+# resolve includes and any CONFIG options used. This produces dsdt.asl.tmp
+# which is pure ASL code.  The Intel ASL (ACPI (Advanced Configuration and 
Power
+# Interface) Source Language compiler (iasl) then converts this ASL code into a
+# C file containing the hex data to build into U_Boot. This file is called
+# dsdt.hex (despite us setting the prefix to .../dsdt.asl.tmp) so must be
+# renamed to dsdt.c for consumption by the build system.
+ASL_TMP = $(patsubst %.c,%.asl.tmp,$@)
+
 quiet_cmd_acpi_c_asl= ASL $<
 cmd_acpi_c_asl= \
-   $(CPP) -x assembler-with-cpp -D__ASSEMBLY__ -P $(UBOOTINCLUDE) -o 
$<.tmp $<; \
-   iasl -p $< -tc $<.tmp $(if $(KBUILD_VERBOSE:1=), >/dev/null) && \
-   mv $(patsubst %.asl,%.hex,$<) $@
+   $(CPP) -x assembler-with-cpp -D__ASSEMBLY__ -P $(UBOOTINCLUDE) \
+   -o $(ASL_TMP) $< && \
+   iasl -p $@ -tc $(ASL_TMP) $(if $(KBUILD_VERBOSE:1=), >/dev/null) && \
+   mv $(patsubst %.c,%.hex,$@) $@
 
 $(obj)/dsdt.c:$(src)/dsdt.asl
$(call cmd,acpi_c_asl)
-- 
2.22.0.709.g102302147b-goog

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


[U-Boot] make all fails at bad mtune value

2019-07-28 Thread Quiet Mouse
chris@chris-hp-laptop:~/u-boot$ make all
scripts/kconfig/conf  --syncconfig Kconfig
  CHK include/config.h
  UPD include/config.h
  CFG u-boot.cfg
  GEN include/autoconf.mk
  GEN include/autoconf.mk.dep
  CFG spl/u-boot.cfg
  GEN spl/include/autoconf.mk
  CHK include/config/uboot.release
  UPD include/config/uboot.release
  CHK include/generated/version_autogenerated.h
  UPD include/generated/version_autogenerated.h
  CHK include/generated/timestamp_autogenerated.h
  UPD include/generated/timestamp_autogenerated.h
  CC  lib/asm-offsets.s
cc1: error: bad value (‘generic-armv7-a’) for ‘-mtune=’ switch
cc1: note: valid arguments to ‘-mtune=’ switch are: nocona core2 nehalem
corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell
core-avx2 broadwell skylake skylake-avx512 bonnell atom silvermont slm knl
intel x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4
nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx
amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 btver1 btver2 generic
Kbuild:43: recipe for target 'lib/asm-offsets.s' failed
make[1]: *** [lib/asm-offsets.s] Error 1
Makefile:1651: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2

I am wondering where the value 'generic-armv7-a' is and if I need to give
it the value 'generic' ?
I had previously ran the command:
chris@chris-hp-laptop:~/u-boot$ make orangepi_zero_defconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  YACCscripts/kconfig/zconf.tab.c
  LEX scripts/kconfig/zconf.lex.cchris@chris-hp-laptop:~/u-boot$ make
orangepi_zero_defconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  YACCscripts/kconfig/zconf.tab.c
  LEX scripts/kconfig/zconf.lex.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#chris@chris-hp-laptop:~/u-boot$ make orangepi_zero_defconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  YACCscripts/kconfig/zconf.tab.c
  LEX scripts/kconfig/zconf.lex.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#chris@chris-hp-laptop:~/u-boot$ make orangepi_zero_defconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  YACCscripts/kconfig/zconf.tab.c
  LEX scripts/kconfig/zconf.lex.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#



  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] Pull request v2: u-boot-spi/master

2019-07-28 Thread Tom Rini
On Thu, Jul 25, 2019 at 06:55:01PM +0530, Jagan Teki wrote:

> Hi Tom,
> 
> Please pull this PR.
> 
> Changes for v2:
> - include MediaTek MT7629 spi driver patches
> 
> Summary:
> - fix for fsl_qspi read timeout (Thomas)
> - spi-mem read data size fix (Ye Li)
> - SiFive SPI driver, mmc_spi flags (Bhargav, Anup)
> - Micron spi-nor parts (Ashish)
> - MT7629 spi-mem driver(Weijie)
> 
> The following changes since commit 0e80dda32c8d724c2a98dbbfb2f1e59762788f15:
> 
>   Merge branch 'master' of 
> https://gitlab.denx.de/u-boot/custodians/u-boot-sunxi (2019-07-16 11:19:31 
> -0400)
> 
> are available in the Git repository at:
> 
>   https://gitlab.denx.de/u-boot/custodians/u-boot-spi master
> 
> for you to fetch changes up to 1f174689c13a257e3b149d4550805a85bdaf27c3:
> 
>   spi: Drop obsolete mtk_qspi driver references (2019-07-25 18:52:20 +0530)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [GIT PULL] Pull request: u-boot-imx u -boot-imx-20190719

2019-07-28 Thread Tom Rini
On Sat, Jul 27, 2019 at 02:21:48PM +0200, Stefano Babic wrote:

> Hi Tom,
> 
> please pull from u-boot-imx, thanks !
> 
> 
> The following changes since commit 0de815356474912ef5bef9a69f0327a5a93bb2c2:
> 
>   Merge branch '2019-07-17-master-imports' (2019-07-18 11:31:37 -0400)
> 
> are available in the Git repository at:
> 
>   https://gitlab.denx.de/u-boot/custodians/u-boot-imx.git
> tags/u-boot-imx-20190719
> 
> for you to fetch changes up to 4a6f5b4f56b8bc6f36736fc0a07c5c4f9069e69b:
> 
>   ARM: imx6: DHCOM i.MX6 PDK: Switch to DM for I2C (2019-07-19 20:32:24
> +0200)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 3/9] firmware: ti_sci: Add a command for releasing all exclusive devices

2019-07-28 Thread Tom Rini
On Fri, Jun 07, 2019 at 07:24:41PM +0530, Lokesh Vutla wrote:

> Any host while requesting for a device can request for its exclusive
> access. If an exclusive permission is obtained then it is the host's
> responsibility to release the device before the software entity on
> the host completes its execution. Else any other host's request for
> the device will be nacked. So add a command that releases all the
> exclusive devices that is acquired by the current host. This should
> be used with utmost care and can be called only at the end of the
> execution.
> 
> Signed-off-by: Lokesh Vutla 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 1/9] firmware: ti_sci: Allow for device shared and exclusive requests

2019-07-28 Thread Tom Rini
On Fri, Jun 07, 2019 at 07:24:39PM +0530, Lokesh Vutla wrote:

> Sysfw provides an option for requesting exclusive access for a
> device using the flags MSG_FLAG_DEVICE_EXCLUSIVE. If this flag is
> not used, the device is meant to be shared across hosts. Once a device
> is requested from a host with this flag set, any request to this
> device from a different host will be nacked by sysfw. Current tisci
> driver enables this flag for every device requests. But this may not
> be true for all the devices. So provide a separate commands in driver
> for exclusive and shared device requests.
> 
> Signed-off-by: Lokesh Vutla 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 2/9] firmware: ti_sci: Add processor shutdown API method

2019-07-28 Thread Tom Rini
On Fri, Jun 07, 2019 at 07:24:40PM +0530, Lokesh Vutla wrote:

> From: Andreas Dannenberg 
> 
> Add and expose a new processor shutdown API that wraps the two TISCI
> messages involved in initiating a core shutdown. The API will first
> queue a message to have the DMSC wait for a certain processor boot
> status to happen followed by a message to trigger the actual shutdown-
> with both messages being sent without waiting or requesting for a
> response. Note that the processor shutdown API call will need to be
> followed up by user software placing the respective core into either
> WFE or WFI mode.
> 
> Signed-off-by: Andreas Dannenberg 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 8/9] power: domain: ti_sci_power_domains: Add support for exclusive and shared access

2019-07-28 Thread Tom Rini
On Fri, Jun 07, 2019 at 07:24:46PM +0530, Lokesh Vutla wrote:

> TISCI protocol supports for enabling the device either with exclusive
> permissions for the requesting host or with sharing across the hosts.
> There are certain devices which are exclusive to Linux context and
> there are certain devices that are shared across different host contexts.
> So add support for getting this information from DT by increasing
> the power-domain cells to 2.
> 
> For keeping the DT backward compatibility intact, defaulting the
> device permissions to set the exclusive flag set. In this case the
> power-domain-cells is 1.
> 
> Signed-off-by: Lokesh Vutla 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 4/9] armv7R: K3: am654: Shut down R5 core after ATF startup on A53

2019-07-28 Thread Tom Rini
On Fri, Jun 07, 2019 at 07:24:42PM +0530, Lokesh Vutla wrote:

> From: Andreas Dannenberg 
> 
> Rather than simply parking the R5 core in WFE after starting up ATF
> on A53 instead use SYSFW API to properly shut down the R5 CPU cores
> as well as associated timer resources that were pre-allocated. This
> allows software further downstream to properly and gracefully bring
> the R5 cores back online if desired.
> 
> Signed-off-by: Andreas Dannenberg 
> Signed-off-by: Lokesh Vutla 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 9/9] arm: dts: k3-am654: Update power-domains property for each node

2019-07-28 Thread Tom Rini
On Fri, Jun 07, 2019 at 07:24:47PM +0530, Lokesh Vutla wrote:

> Update the power-domain-cells to 2 and add the permissions
> to each node. Mark the following nodes accessed by r5 as shared:
> - DDR node
> - main uart 0
> 
> Signed-off-by: Lokesh Vutla 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v2 1/5] cmd: remoteproc: Add support for initializing devices individually

2019-07-28 Thread Tom Rini
On Fri, Jun 07, 2019 at 07:25:55PM +0530, Lokesh Vutla wrote:

> 'rproc init' does the probe and initialization of all the available
> remoteproc devices in the system. This doesn't allow the flexibility
> to initialize the remote cores needed as per use case. In order
> to provide flexibility, update 'rproc init' command to accept one
> more parameter with rproc id which when passed initializes only
> that specific core. If no id is passed, command will initializes
> all the cores which is compatible with the existing behaviour.
> 
> Signed-off-by: Lokesh Vutla 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 5/9] armv7R: k3: Release all the exclusive devices

2019-07-28 Thread Tom Rini
On Fri, Jun 07, 2019 at 07:24:43PM +0530, Lokesh Vutla wrote:

> Release all the exclusive devices held by SPL.
> 
> Signed-off-by: Lokesh Vutla 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 04/16] armv7R: K3: j721e: Store boot index from ROM

2019-07-28 Thread Tom Rini
On Thu, Jun 13, 2019 at 10:29:45AM +0530, Lokesh Vutla wrote:

> From: Andreas Dannenberg 
> 
> Obtain the boot index as left behind by the device boot ROM and store
> it in scratch pad SRAM for later use before it may get overwritten.
> 
> Signed-off-by: Andreas Dannenberg 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH] ARM: am3517-evm: Remove manual ethernet reset code

2019-07-28 Thread Tom Rini
On Sun, Jun 23, 2019 at 12:42:14AM -0500, Adam Ford wrote:

> The reset line going to the ethernet controller is controlled
> by a global reset controlling multiple peripherals.  There
> is no need to manually invoke the reset.
> 
> Signed-off-by: Adam Ford 
> 
> diff --git a/board/logicpd/am3517evm/am3517evm.c 
> b/board/logicpd/am3517evm/am3517evm.c
> index 10031a4801..e799f80d81 100644

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 03/16] armv7R: K3: j721e: Unlock all applicable control MMR registers

2019-07-28 Thread Tom Rini
On Thu, Jun 13, 2019 at 10:29:44AM +0530, Lokesh Vutla wrote:

> From: Andreas Dannenberg 
> 
> To access various control MMR functionality the registers need to
> be unlocked. Do that for all control MMR regions in the MCU and MAIN
> domains. We may want to go back later and limit the unlocking that's
> being done.
> 
> Signed-off-by: Andreas Dannenberg 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 6/9] power-domain: Add private data to power domain

2019-07-28 Thread Tom Rini
On Fri, Jun 07, 2019 at 07:24:44PM +0530, Lokesh Vutla wrote:

> Certain drivers want to attach private data corresponding to each
> power domain. This data might be specific be to the drvier. So add
> a priv entry into the power_domain structure.
> 
> Signed-off-by: Lokesh Vutla 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 11/16] dt-bindings: pinctrl: k3: Introduce pinmux definitions for J721E

2019-07-28 Thread Tom Rini
On Thu, Jun 13, 2019 at 10:29:52AM +0530, Lokesh Vutla wrote:

> Add pinctrl macros for J721E SoC. These macro definitions are
> similar to that of AM6, but adding new definitions to avoid
> any naming confusions in the soc dts files.
> 
> Signed-off-by: Lokesh Vutla 
> Signed-off-by: Andreas Dannenberg 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 7/9] dt-bindings: ti_sci_pm_domains: Add support for exclusive and shared access

2019-07-28 Thread Tom Rini
On Fri, Jun 07, 2019 at 07:24:45PM +0530, Lokesh Vutla wrote:

> TISCI protocol supports for enabling the device either with exclusive
> permissions for the requesting host or with sharing across the hosts.
> There are certain devices which are exclusive to Linux context and
> there are certain devices that are shared across different host contexts.
> So add support for getting this information from DT by increasing
> the power-domain cells to 2.
> 
> Signed-off-by: Lokesh Vutla 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 14/16] arm: dts: k3-j721e: Add r5 specific dt support

2019-07-28 Thread Tom Rini
On Thu, Jun 13, 2019 at 10:29:55AM +0530, Lokesh Vutla wrote:

> Add initial support for dt that runs on r5.
> 
> Signed-off-by: Lokesh Vutla 
> Signed-off-by: Andreas Dannenberg 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 04/16] armv7R: K3: j721e: Store boot index from ROM

2019-07-28 Thread Tom Rini
On Thu, Jun 13, 2019 at 10:29:45AM +0530, Lokesh Vutla wrote:

> From: Andreas Dannenberg 
> 
> Obtain the boot index as left behind by the device boot ROM and store
> it in scratch pad SRAM for later use before it may get overwritten.
> 
> Signed-off-by: Andreas Dannenberg 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 02/16] armv7R: K3: j721e: Add support for boot device detection

2019-07-28 Thread Tom Rini
On Thu, Jun 13, 2019 at 10:29:43AM +0530, Lokesh Vutla wrote:

> J721E allows for booting from primary or backup boot media.
> Both media can be chosen individually based on switch settings.
> ROM looks for a valid image in primary boot media, if not found
> then looks in backup boot media. In order to pass this boot media
> information to boot loader, ROM stores a value at a particular
> address. Add support for reading this information and determining
> the boot media correctly.
> 
> Signed-off-by: Lokesh Vutla 
> Signed-off-by: Andreas Dannenberg 
> Signed-off-by: Faiz Abbas 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 07/16] armv8: K3: j721e: Add custom MMU support

2019-07-28 Thread Tom Rini
On Thu, Jun 13, 2019 at 10:29:48AM +0530, Lokesh Vutla wrote:

> From: Suman Anna 
> 
> The A72 U-Boot code loads and boots a number of remote processors
> including the C71x DSP, both the C66_0 and C66_1 DSPs, and the various
> Main R5FSS Cores. Change the memory attributes for the DDR regions used
> by the remote processors so that the cores can see and execute the
> proper code.
> 
> A separate table based on the current AM65x table is added for J721E SoCs,
> since the number of remote processors and their DDR usage will be different
> between the two SoC families.
> 
> Signed-off-by: Suman Anna 
> Signed-off-by: Lokesh Vutla 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 13/16] arm: dts: k3-j721e: Add initial support for common processor board

2019-07-28 Thread Tom Rini
On Thu, Jun 13, 2019 at 10:29:54AM +0530, Lokesh Vutla wrote:

> Common Processor board is the baseboard that has most of the actual 
> connectors,
> power supply etc. A SOM (System on Module) is plugged on to the common
> processor board and this contains the SoC, PMIC, DDR and basic highspeed
> components necessary for functionality. Add initial dt support for this
> common processor board.
> 
> Signed-off-by: Lokesh Vutla 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH] ARM: dts: Logic PD SOM-LV and Torpedo Boards: Resync DTS

2019-07-28 Thread Tom Rini
On Mon, Jul 15, 2019 at 02:07:52PM -0500, Adam Ford wrote:

> Re-sync all Logic PD OMAP35 and AM/DM37 boards with Kernel
> 5.2.1
> 
> Signed-off-by: Adam Ford 
> 
> diff --git a/arch/arm/dts/logicpd-som-lv-35xx-devkit.dts 
> b/arch/arm/dts/logicpd-som-lv-35xx-devkit.dts
> index 32d0dc371f..f7a841a288 100644

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 15/16] configs: j721e_evm_r5: Add initial support

2019-07-28 Thread Tom Rini
On Thu, Jun 13, 2019 at 10:29:56AM +0530, Lokesh Vutla wrote:

> Add initial defconfig support for J721e that runs on R5.
> 
> Signed-off-by: Lokesh Vutla 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 16/16] configs: j721e_evm_a72: Add initial support

2019-07-28 Thread Tom Rini
On Thu, Jun 13, 2019 at 10:29:57AM +0530, Lokesh Vutla wrote:

> Add initial defconfig support for J721e that runs on A72.
> 
> Signed-off-by: Lokesh Vutla 

Applied to u-boot/master, thanks!

-- 
Tom


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


  1   2   >