Re: [U-Boot] [U-Boot, 1/2] arm: lpc32xx: add CONFIG_ARCH_LPC32XX build option

2018-10-20 Thread Tom Rini
On Mon, Sep 17, 2018 at 09:43:03PM +0300, Vladimir Zapolskiy wrote:

> The explicit arch specific build symbol allows to group supported
> boards, generalize common config options and it will serve as
> a dependency for platform only drivers.
> 
> Two related board defconfigs are resynced after the change.
> 
> Signed-off-by: Vladimir Zapolskiy 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 2/2] work_92105: remove unused CONFIG_SPL_NAND_BOOT configuration option

2018-10-20 Thread Tom Rini
On Mon, Sep 17, 2018 at 09:56:37PM +0300, Vladimir Zapolskiy wrote:

> The option is unused, SPL image gets a wanted boot device by standard
> spl_boot_device() call.
> 
> Signed-off-by: Vladimir Zapolskiy 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 1/2] work_92105: remove unused CONFIG_LPC32XX_SPL configuration option

2018-10-20 Thread Tom Rini
On Mon, Sep 17, 2018 at 09:56:36PM +0300, Vladimir Zapolskiy wrote:

> The CONFIG_LPC32XX_SPL option from board include file has never been
> used, it is safe to remove it.
> 
> Signed-off-by: Vladimir Zapolskiy 

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] travis: Add sandbox/clang-7 support

2018-10-20 Thread Tom Rini
On Sun, Oct 07, 2018 at 02:20:30PM -0400, Tom Rini wrote:

> To make testing with clang support easier, add sandbox/clang-7
> combination to our testing matrix.  To facilitate this, switch to using
> the "sources" method that the travis.yml file supports to list
> additional repositories and add the official one for llvm-7.  Due to
> buildman not supporting using clang at this time add logic to manually
> build a single sandbox configuration in the expected output directory so
> that we can still invoke all of our tests.
> 
> Cc: Simon Glass 
> Signed-off-by: Tom Rini 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] arm: lpc32xx: remove phantom CONFIG_LPC32XX_SDRAM_ config option

2018-10-20 Thread Tom Rini
On Mon, Sep 17, 2018 at 10:03:27PM +0300, Vladimir Zapolskiy wrote:

> The option has never existed and config whitelist script accumulates
> it from a comment block, wipe it out from the source code.
> 
> Signed-off-by: Vladimir Zapolskiy 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 2/2] travis: Switch to i386 version toolchain for x86

2018-10-20 Thread Tom Rini
On Mon, Oct 08, 2018 at 04:53:54PM -0700, Bin Meng wrote:

> Currently this uses x86_64 version toolchain for x86 build in
> travis-ci. Change it to i386 version to avoid updating the
> buildman toolchain path every time when the toolchain version
> number is changed, eg: from 7.3.0 to 8.1.0.
> 
> Signed-off-by: Bin Meng 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 2/2] Makefile: add LPC32xx precondition for building platform images

2018-10-20 Thread Tom Rini
On Mon, Sep 17, 2018 at 09:43:04PM +0300, Vladimir Zapolskiy wrote:

> To prevent accidental build failures the change converts a number of
> NXP LPC32xx specific image targets to be conditionally dependent on
> target build configuration. The wrapped image targets always contain
> a U-Boot SPL binary and the images are supposed to be directly flashed
> on a NAND flash device for read access by LPC32xx NAND MLC controller.
> 
> Signed-off-by: Vladimir Zapolskiy 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] ARM: mach-omap2: Kconfig: Make SYS_MPUCLK dependent on AM33XX

2018-10-20 Thread Tom Rini
On Sun, Oct 07, 2018 at 09:58:25AM -0500, Adam Ford wrote:

> This value is unly used in arch/arm/mach-omap2/am33xx/
> clock_am33xx.c, so let's make it dependent on AM33XX since
> that is the only way this file gets compiled into the code
> according to the Makefile.
> 
> Signed-off-by: Adam Ford 
> Reviewed-by: Tom Rini 
> 
> diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
> index 76a19064c9..d494356d00 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] Convert CONFIG_FLASH_CFI_DRIVER et al to Kconfig

2018-10-20 Thread Tom Rini
On Sun, Oct 14, 2018 at 03:10:50PM -0500, Adam Ford wrote:

> This converts the following to Kconfig:
>CONFIG_FLASH_CFI_DRIVER
>CONFIG_SYS_FLASH_USE_BUFFER_WRITE
>CONFIG_FLASH_CFI_MTD
>CONFIG_SYS_FLASH_PROTECTION
>CONFIG_SYS_FLASH_CFI
> 
> Signed-off-by: Adam Ford 
> 
> diff --git a/arch/arm/include/asm/arch-lpc32xx/config.h 
> b/arch/arm/include/asm/arch-lpc32xx/config.h
> index f7a698e72d..471a336f13 100644

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot,1/1] common: command: fix typo

2018-10-20 Thread Tom Rini
On Fri, Oct 12, 2018 at 11:23:04AM +0200, Heinrich Schuchardt wrote:

> %s/CMD_RET_SUCCESX/CMD_RET_SUCCESS/g
> 
> Signed-off-by: Heinrich Schuchardt 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot,1/2] travis: Remove or32 toolchain info

2018-10-20 Thread Tom Rini
On Mon, Oct 08, 2018 at 04:53:53PM -0700, Bin Meng wrote:

> or32 is not supported by U-Boot anymore.
> 
> Signed-off-by: Bin Meng 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] bootcount: Make bootcount magic configurable

2018-10-20 Thread Tom Rini
On Thu, Oct 11, 2018 at 12:13:54AM +0200, Marek Vasut wrote:

> Add new Kconfig option, SYS_BOOTCOUNT_MAGIC, to select the boot
> counter magic word. This can be useful ie. in case the entire
> boot counter register is not usable.
> 
> Signed-off-by: Marek Vasut 
> Cc: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


[U-Boot] Pull request: u-boot-staging

2018-10-20 Thread Anatolij Gustschin
Hi Tom,

please pull some synxi PWM driver bugfixes:

The following changes since commit e3beca3a2fe172ca707a0e70310f9f7ebd3b3f0f:

  Merge tag 'signed-efi-2018.11' of git://github.com/agraf/u-boot (2018-10-17 
07:20:52 -0400)

are available in the Git repository at:

  git://git.denx.de/u-boot-staging.git ag...@denx.de

for you to fetch changes up to a1f95bf1a87c5e4f9fe37b02bc1e34cccd3893b5:

  pwm: sunxi: choose best prescaler to improve PWM resolution (2018-10-18 
23:05:00 +0200)


Vasily Khoruzhick (3):
  pwm: sunxi: fix off-by-one that prevented PWM to use prescaler bypass
  pwm: sunxi: use new prescaler when configuring PWM
  pwm: sunxi: choose best prescaler to improve PWM resolution

 drivers/pwm/sunxi_pwm.c | 32 +++-
 1 file changed, 19 insertions(+), 13 deletions(-)

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


Re: [U-Boot] Pull request: u-boot-staging

2018-10-20 Thread Tom Rini
On Sat, Oct 20, 2018 at 09:35:56PM +0200, Anatolij Gustschin wrote:
> Hi Tom,
> 
> please pull some synxi PWM driver bugfixes:
> 
> The following changes since commit e3beca3a2fe172ca707a0e70310f9f7ebd3b3f0f:
> 
>   Merge tag 'signed-efi-2018.11' of git://github.com/agraf/u-boot (2018-10-17 
> 07:20:52 -0400)
> 
> are available in the Git repository at:
> 
>   git://git.denx.de/u-boot-staging.git ag...@denx.de
> 
> for you to fetch changes up to a1f95bf1a87c5e4f9fe37b02bc1e34cccd3893b5:
> 
>   pwm: sunxi: choose best prescaler to improve PWM resolution (2018-10-18 
> 23:05:00 +0200)
> 
> 
> Vasily Khoruzhick (3):
>   pwm: sunxi: fix off-by-one that prevented PWM to use prescaler bypass
>   pwm: sunxi: use new prescaler when configuring PWM
>   pwm: sunxi: choose best prescaler to improve PWM resolution
> 
>  drivers/pwm/sunxi_pwm.c | 32 +++-
>  1 file changed, 19 insertions(+), 13 deletions(-)

These all look like things that should go via the sunxi tree, and Jagan
is fairly active.  I'm curious, why did you pick these up presently?
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 0/3] efi_loader: fix simple network protocol

2018-10-20 Thread Heinrich Schuchardt
We should not call eth_rx() before the network interface is initialized.
The services of the simple network protocol should check the state of
the network adapter.

Provide a correctly aligned transmit buffer not depending on
CONFIG_EFI_LOADER_BOUNCE_BUFFER.

Correct the unit test.

Add and correct comments.

Without this patch i.mx6 system Wandboard Quad rev B1 fails to execute
bootefi selftest.

---
v3:
split the patch into a series
v2:
match EFI_ENTRY() and EFI_EXIT() in efi_network_timer_notify()
update comments
---

Heinrich Schuchardt (3):
  efi_selftest: fix simple network protocol test
  efi_loader: correctly aligned transmit buffer
  efi_loader: fix simple network protocol

 lib/efi_loader/efi_net.c| 415 +++-
 lib/efi_selftest/efi_selftest_snp.c |  16 +-
 2 files changed, 357 insertions(+), 74 deletions(-)

-- 
2.19.0

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


[U-Boot] [PATCH v3 3/3] efi_loader: fix simple network protocol

2018-10-20 Thread Heinrich Schuchardt
We should not call eth_rx() before the network interface is initialized.
The services of the simple network protocol should check the state of
the network adapter.

Add and correct comments.

Without this patch i.mx6 system Wandboard Quad rev B1 fails to execute
bootefi selftest.

Signed-off-by: Heinrich Schuchardt 
---
v3:
split the patch into a series
v2:
match EFI_ENTRY() and EFI_EXIT() in efi_network_timer_notify()
update comments
---
 lib/efi_loader/efi_net.c | 391 +--
 1 file changed, 332 insertions(+), 59 deletions(-)

diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c
index 9987aba1b9..c4b1e6e1d9 100644
--- a/lib/efi_loader/efi_net.c
+++ b/lib/efi_loader/efi_net.c
@@ -43,22 +43,68 @@ struct efi_net_obj {
struct efi_pxe_mode pxe_mode;
 };
 
+/*
+ * efi_net_start() - start the network interface
+ *
+ * This function implements the Start service of the
+ * EFI_SIMPLE_NETWORK_PROTOCOL. See the Unified Extensible Firmware Interface
+ * (UEFI) specification for details.
+ *
+ * @this:  pointer to the protocol instance
+ * Return: status code
+ */
 static efi_status_t EFIAPI efi_net_start(struct efi_simple_network *this)
 {
+   efi_status_t ret = EFI_SUCCESS;
+
EFI_ENTRY("%p", this);
 
-   return EFI_EXIT(EFI_SUCCESS);
+   /* Check parameters */
+   if (!this) {
+   ret = EFI_INVALID_PARAMETER;
+   goto out;
+   }
+
+   if (this->mode->state != EFI_NETWORK_STOPPED)
+   ret = EFI_ALREADY_STARTED;
+   else
+   this->mode->state = EFI_NETWORK_STARTED;
+out:
+   return EFI_EXIT(ret);
 }
 
+/*
+ * efi_net_stop() - stop the network interface
+ *
+ * This function implements the Stop service of the
+ * EFI_SIMPLE_NETWORK_PROTOCOL. See the Unified Extensible Firmware Interface
+ * (UEFI) specification for details.
+ *
+ * @this:  pointer to the protocol instance
+ * Return: status code
+ */
 static efi_status_t EFIAPI efi_net_stop(struct efi_simple_network *this)
 {
+   efi_status_t ret = EFI_SUCCESS;
+
EFI_ENTRY("%p", this);
 
-   return EFI_EXIT(EFI_SUCCESS);
+   /* Check parameters */
+   if (!this) {
+   ret = EFI_INVALID_PARAMETER;
+   goto out;
+   }
+
+   if (this->mode->state == EFI_NETWORK_STOPPED)
+   ret = EFI_NOT_STARTED;
+   else
+   this->mode->state = EFI_NETWORK_STOPPED;
+out:
+   return EFI_EXIT(ret);
 }
 
 /*
- * Initialize network adapter and allocate transmit and receive buffers.
+ * efi_net_initialize() - initialize the network interface
  *
  * This function implements the Initialize service of the
  * EFI_SIMPLE_NETWORK_PROTOCOL. See the Unified Extensible Firmware Interface
@@ -67,7 +113,7 @@ static efi_status_t EFIAPI efi_net_stop(struct 
efi_simple_network *this)
  * @this:  pointer to the protocol instance
  * @extra_rx:  extra receive buffer to be allocated
  * @extra_tx:  extra transmit buffer to be allocated
- * @return:status code
+ * Return: status code
  */
 static efi_status_t EFIAPI efi_net_initialize(struct efi_simple_network *this,
  ulong extra_rx, ulong extra_tx)
@@ -77,9 +123,10 @@ static efi_status_t EFIAPI efi_net_initialize(struct 
efi_simple_network *this,
 
EFI_ENTRY("%p, %lx, %lx", this, extra_rx, extra_tx);
 
+   /* Check parameters */
if (!this) {
r = EFI_INVALID_PARAMETER;
-   goto error;
+   goto out;
}
 
/* Setup packet buffers */
@@ -92,32 +139,83 @@ static efi_status_t EFIAPI efi_net_initialize(struct 
efi_simple_network *this,
ret = eth_init();
if (ret < 0) {
eth_halt();
+   this->mode->state = EFI_NETWORK_STOPPED;
r = EFI_DEVICE_ERROR;
+   goto out;
+   } else {
+   this->mode->state = EFI_NETWORK_INITIALIZED;
}
-
-error:
+out:
return EFI_EXIT(r);
 }
 
+/*
+ * efi_net_reset() - reinitialize the network interface
+ *
+ * This function implements the Reset service of the
+ * EFI_SIMPLE_NETWORK_PROTOCOL. See the Unified Extensible Firmware Interface
+ * (UEFI) specification for details.
+ *
+ * @this:  pointer to the protocol instance
+ * @extended_verification: execute exhaustive verification
+ * Return: status code
+ */
 static efi_status_t EFIAPI efi_net_reset(struct efi_simple_network *this,
 int extended_verification)
 {
EFI_ENTRY("%p, %x", this, extended_verification);
 
-   return EFI_EXIT(EFI_SUCCESS);
+   return EFI_EXIT(EFI_CALL(efi_net_initialize(this, 0, 0)));
 }
 
+/*
+ * efi_net_shutdown() - shut down the network interface
+ *
+ * This function implements the Shutdown service of the
+ * EFI_SIMPLE_NETWORK_PROTOCOL. See the Unified Extensible Firmware

[U-Boot] [PATCH v3 2/3] efi_loader: correctly aligned transmit buffer

2018-10-20 Thread Heinrich Schuchardt
Provide a correctly aligned transmit buffer not depending on
CONFIG_EFI_LOADER_BOUNCE_BUFFER.

Signed-off-by: Heinrich Schuchardt 
---
v3:
split the patch into a series
---
 lib/efi_loader/efi_net.c | 32 +---
 1 file changed, 21 insertions(+), 11 deletions(-)

diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c
index a64c603ed3..9987aba1b9 100644
--- a/lib/efi_loader/efi_net.c
+++ b/lib/efi_loader/efi_net.c
@@ -14,6 +14,8 @@ static const efi_guid_t efi_pxe_guid = EFI_PXE_GUID;
 static struct efi_pxe_packet *dhcp_ack;
 static bool new_rx_packet;
 static void *new_tx_packet;
+static void *transmit_buffer;
+
 /*
  * The notification function of this event is called in every timer cycle
  * to check if a new network packet has been received.
@@ -198,13 +200,11 @@ static efi_status_t EFIAPI efi_net_transmit(struct 
efi_simple_network *this,
return EFI_EXIT(EFI_INVALID_PARAMETER);
}
 
-#ifdef CONFIG_EFI_LOADER_BOUNCE_BUFFER
-   /* Ethernet packets always fit, just bounce */
-   memcpy(efi_bounce_buffer, buffer, buffer_size);
-   net_send_packet(efi_bounce_buffer, buffer_size);
-#else
-   net_send_packet(buffer, buffer_size);
-#endif
+   /* Ensure that the packet fits into the buffer */
+   if (buffer_size > PKTSIZE_ALIGN)
+   return EFI_EXIT(EFI_INVALID_PARAMETER);
+   memcpy(transmit_buffer, buffer, buffer_size);
+   net_send_packet(transmit_buffer, buffer_size);
 
new_tx_packet = buffer;
 
@@ -325,10 +325,15 @@ efi_status_t efi_net_register(void)
 
/* We only expose the "active" network device, so one is enough */
netobj = calloc(1, sizeof(*netobj));
-   if (!netobj) {
-   printf("ERROR: Out of memory\n");
-   return EFI_OUT_OF_RESOURCES;
-   }
+   if (!netobj)
+   goto out_of_resources;
+
+   /* Allocate an aligned transmit buffer */
+   transmit_buffer = calloc(1, PKTSIZE_ALIGN + ARCH_DMA_MINALIGN);
+   if (!transmit_buffer)
+   goto out_of_resources;
+   transmit_buffer = (void *)ALIGN((uintptr_t)transmit_buffer,
+   ARCH_DMA_MINALIGN);
 
/* Hook net up to the device list */
efi_add_handle(&netobj->header);
@@ -408,4 +413,9 @@ efi_status_t efi_net_register(void)
 failure_to_add_protocol:
printf("ERROR: Failure to add protocol\n");
return r;
+out_of_resources:
+   free(netobj);
+   /* free(transmit_buffer) not needed yet */
+   printf("ERROR: Out of memory\n");
+   return EFI_OUT_OF_RESOURCES;
 }
-- 
2.19.0

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


[U-Boot] [PATCH v3 1/3] efi_selftest: fix simple network protocol test

2018-10-20 Thread Heinrich Schuchardt
To use the simple network protocol we have to call the start service first
and the initialize service second.

Signed-off-by: Heinrich Schuchardt 
---
v3:
split the patch into a series
---
 lib/efi_selftest/efi_selftest_snp.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/efi_selftest/efi_selftest_snp.c 
b/lib/efi_selftest/efi_selftest_snp.c
index 09bd53da82..e10a34ba64 100644
--- a/lib/efi_selftest/efi_selftest_snp.c
+++ b/lib/efi_selftest/efi_selftest_snp.c
@@ -103,7 +103,7 @@ static efi_status_t send_dhcp_discover(void)
struct dhcp p = {};
 
/*
-* Fill ethernet header
+* Fill Ethernet header
 */
boottime->copy_mem(p.eth_hdr.et_dest, (void *)BROADCAST_MAC, ARP_HLEN);
boottime->copy_mem(p.eth_hdr.et_src, &net->mode->current_address,
@@ -229,19 +229,19 @@ static int setup(const efi_handle_t handle,
return EFI_ST_FAILURE;
}
/*
-* Initialize network adapter.
+* Start network adapter.
 */
-   ret = net->initialize(net, 0, 0);
-   if (ret != EFI_SUCCESS) {
-   efi_st_error("Failed to initialize network adapter\n");
+   ret = net->start(net);
+   if (ret != EFI_SUCCESS && ret != EFI_ALREADY_STARTED) {
+   efi_st_error("Failed to start network adapter\n");
return EFI_ST_FAILURE;
}
/*
-* Start network adapter.
+* Initialize network adapter.
 */
-   ret = net->start(net);
+   ret = net->initialize(net, 0, 0);
if (ret != EFI_SUCCESS) {
-   efi_st_error("Failed to start network adapter\n");
+   efi_st_error("Failed to initialize network adapter\n");
return EFI_ST_FAILURE;
}
return EFI_ST_SUCCESS;
-- 
2.19.0

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


Re: [U-Boot] Pull request: u-boot-staging

2018-10-20 Thread Anatolij Gustschin
On Sat, 20 Oct 2018 15:43:48 -0400
Tom Rini tr...@konsulko.com wrote:
...
> These all look like things that should go via the sunxi tree, and Jagan
> is fairly active.  I'm curious, why did you pick these up presently?

I got this series on Tuesday and then also got Acked-by and Tested-by
stating that is fixes LCD backlight issues on pinebook. Jagan didn't
respond yet, so I intervened. I'm fine if Jagan takes them via sunxi tree.

Thanks,

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