Re: [U-Boot] [PULL] u-boot-usb/master

2019-08-10 Thread Tom Rini
On Sat, Aug 10, 2019 at 03:33:44PM +0200, Marek Vasut wrote:

> The following changes since commit 2e8fef747bf773691d174b2b8120d7aa6c637bcf:
> 
>   test/py: avb: Move AVB test to android dir (2019-08-07 23:15:13 -0400)
> 
> are available in the Git repository at:
> 
>   git://git.denx.de/u-boot-usb.git master
> 
> for you to fetch changes up to 29a81142be960a07761f50ccae6cde766e3696d9:
> 
>   fastboot: Remove "bootloader-version" variable (2019-08-08 11:35:02 +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] Please pull u-boot-x86

2019-08-10 Thread Tom Rini
On Sat, Aug 10, 2019 at 07:35:32AM +0800, Bin Meng wrote:

> Hi Tom,
> 
> This PR includes the following changes to x86:
> - Enable SD slot on Intel Edison
> - Populate CSRT ACPI table for shared DMA controller on Intel Tangier
> - Convert Intel ICH-SPI driver to use new spi-mem ops
> - Enable config_distro_bootcmd for QEMU x86
> - Support U-Boot as a payload for Intel Slim Bootloader
> - Avoid writing temporary asl files into the source tree which fixes
> the parallel build issue occasionally seen
> 
> The following changes since commit fef408679b2f634ebfd6298d9fc99db99e60fb1d:
> 
>   Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell
> (2019-08-08 09:19:08 -0400)
> 
> are available in the git repository at:
> 
>   https://gitlab.denx.de/u-boot/custodians/u-boot-x86.git
> 
> for you to fetch changes up to dbaec467671fd5b56cf380121340844863f5472d:
> 
>   x86: Skip setting up MTRRs in slimbootloader (2019-08-09 22:24:02 +0800)
> 

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] [PULL] u-boot-sh/master

2019-08-10 Thread Tom Rini
On Sat, Aug 10, 2019 at 11:35:32PM +0200, Marek Vasut wrote:

> The following changes since commit 163bc1e4da425015000dd3f8f128aec994da9586:
> 
>   Merge tag 'mmc-8-9' of
> https://gitlab.denx.de/u-boot/custodians/u-boot-mmc (2019-08-09 07:29:54
> -0400)
> 
> are available in the Git repository at:
> 
>   git://git.denx.de/u-boot-sh.git master
> 
> for you to fetch changes up to 3ebb91914f4831df4db42675c4dd1f9a0b7548c7:
> 
>   ARM: renesas: Add R8A77980 V3H Condor board code (2019-08-09 23:15:01
> +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] Pull request, u-boot-tegra/master

2019-08-10 Thread Tom Rini
On Fri, Aug 09, 2019 at 10:21:02AM -0700, Tom Warren wrote:

> Tom,
> 
> Please pull u-boot-tegra/master into U-Boot/master. Thanks!
> 
> All Tegra builds are OK on my system, and Igor has verified the Apalis
> patches.
> 
> The following changes since commit 163bc1e4da425015000dd3f8f128aec994da9586:
> 
>   Merge tag 'mmc-8-9' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmc
> (2019-08-09 07:29:54 -0400)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-tegra.git master
> 
> for you to fetch changes up to bd20266d1923f1230ed15020fbb12aa56f3f46b7:
> 
>   apalis-tk1: configs: remove legacy usbboot command (2019-08-09 10:01:35
> -0700)
> 

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] u-boot-sh/master

2019-08-10 Thread Marek Vasut
The following changes since commit 163bc1e4da425015000dd3f8f128aec994da9586:

  Merge tag 'mmc-8-9' of
https://gitlab.denx.de/u-boot/custodians/u-boot-mmc (2019-08-09 07:29:54
-0400)

are available in the Git repository at:

  git://git.denx.de/u-boot-sh.git master

for you to fetch changes up to 3ebb91914f4831df4db42675c4dd1f9a0b7548c7:

  ARM: renesas: Add R8A77980 V3H Condor board code (2019-08-09 23:15:01
+0200)


Marek Vasut (7):
  net: sh_eth: Add R8A77980 V3H gether support
  net: sh_eth: Fix 64bit build warnings
  pinctrl: renesas: Add R8A77980 V3H PFC tables
  clk: renesas: Add R8A77980 V3H clock tables
  ARM: dts: renesas: Add R8A77980 V3H DTs and headers
  ARM: renesas: Add R8A77980 V3H platform code
  ARM: renesas: Add R8A77980 V3H Condor board code

 arch/arm/dts/Makefile |1 +
 arch/arm/dts/r8a77980-condor-u-boot.dts   |   34 ++
 arch/arm/dts/r8a77980-condor.dts  |  292 +++
 arch/arm/dts/r8a77980-u-boot.dtsi |   24 ++
 arch/arm/dts/r8a77980.dtsi| 1605
++
 arch/arm/mach-rmobile/Kconfig.64  |   12 +
 arch/arm/mach-rmobile/cpu_info.c  |1 +
 arch/arm/mach-rmobile/include/mach/rmobile.h  |1 +
 board/renesas/condor/Kconfig  |   15 +
 board/renesas/condor/MAINTAINERS  |6 +
 board/renesas/condor/Makefile |   13 +
 board/renesas/condor/condor.c |   55 +++
 configs/r8a77980_condor_defconfig |   69 
 drivers/clk/renesas/Kconfig   |6 +
 drivers/clk/renesas/Makefile  |1 +
 drivers/clk/renesas/r8a77980-cpg-mssr.c   |  255 +
 drivers/net/sh_eth.c  |   39 +-
 drivers/net/sh_eth.h  |   14 +-
 drivers/pinctrl/renesas/Kconfig   |   10 +
 drivers/pinctrl/renesas/Makefile  |1 +
 drivers/pinctrl/renesas/pfc-r8a77980.c| 2897

 drivers/pinctrl/renesas/pfc.c |   11 +
 drivers/pinctrl/renesas/sh_pfc.h  |1 +
 include/configs/condor.h  |   41 ++
 include/dt-bindings/clock/r8a77980-cpg-mssr.h |   51 +++
 include/dt-bindings/power/r8a77980-sysc.h |   43 +++
 26 files changed, 5477 insertions(+), 21 deletions(-)
 create mode 100644 arch/arm/dts/r8a77980-condor-u-boot.dts
 create mode 100644 arch/arm/dts/r8a77980-condor.dts
 create mode 100644 arch/arm/dts/r8a77980-u-boot.dtsi
 create mode 100644 arch/arm/dts/r8a77980.dtsi
 create mode 100644 board/renesas/condor/Kconfig
 create mode 100644 board/renesas/condor/MAINTAINERS
 create mode 100644 board/renesas/condor/Makefile
 create mode 100644 board/renesas/condor/condor.c
 create mode 100644 configs/r8a77980_condor_defconfig
 create mode 100644 drivers/clk/renesas/r8a77980-cpg-mssr.c
 create mode 100644 drivers/pinctrl/renesas/pfc-r8a77980.c
 create mode 100644 include/configs/condor.h
 create mode 100644 include/dt-bindings/clock/r8a77980-cpg-mssr.h
 create mode 100644 include/dt-bindings/power/r8a77980-sysc.h

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


[U-Boot] [PULL] u-boot-usb/master

2019-08-10 Thread Marek Vasut
The following changes since commit 2e8fef747bf773691d174b2b8120d7aa6c637bcf:

  test/py: avb: Move AVB test to android dir (2019-08-07 23:15:13 -0400)

are available in the Git repository at:

  git://git.denx.de/u-boot-usb.git master

for you to fetch changes up to 29a81142be960a07761f50ccae6cde766e3696d9:

  fastboot: Remove "bootloader-version" variable (2019-08-08 11:35:02 +0200)


Adam Ford (3):
  phy: Add support for phy-da8xx-usb
  usb: musb-new: Add support for da8xx-musb
  ARM: da850-evm: Enable the USB PHY and MUSB Driver

Heiko Schocher (5):
  usb, ohci-hdc: fix warning 'ohci_pci_ids' defined but not used
  usb, ohci: fix ohci swap register access
  usb, ohci-hcd: set OHCI_USE_NPS if DM_PCI
  usb, ohci: add warning if none on pci found
  usb, ohci, pci: add DM support for PCI-based OHCI USB controller

Marek Szyprowski (1):
  thor: fix crash after usb initialization failure

Ralph Siemsen (1):
  usb: gadget: f_dfu.c: fix memory leak

Sam Protsenko (3):
  fastboot: Remove "slot-suffixes" variable
  fastboot: getvar: Add "is-userspace" variable
  fastboot: Remove "bootloader-version" variable

 cmd/thordown.c|   6 ++-
 configs/da850evm_defconfig|   5 +++
 configs/da850evm_direct_nor_defconfig |   5 +++
 configs/da850evm_nand_defconfig   |   5 +++
 doc/android/fastboot.txt  |   6 +--
 drivers/fastboot/fb_getvar.c  |  27 ++--
 drivers/phy/Kconfig   |   6 +++
 drivers/phy/Makefile  |   1 +
 drivers/phy/phy-da8xx-usb.c   |  64 
 drivers/usb/gadget/f_dfu.c|   1 +
 drivers/usb/host/Kconfig  |   7 +++
 drivers/usb/host/Makefile |   1 +
 drivers/usb/host/ohci-hcd.c   |  12 --
 drivers/usb/host/ohci-pci.c   |  52 ++
 drivers/usb/host/ohci.h   |   4 +-
 drivers/usb/musb-new/Kconfig  |   8 
 drivers/usb/musb-new/Makefile |   1 +
 drivers/usb/musb-new/da8xx.c  | 350
+
 18 files changed, 537 insertions(+), 24 deletions(-)
 create mode 100644 drivers/phy/phy-da8xx-usb.c
 create mode 100644 drivers/usb/host/ohci-pci.c
 create mode 100644 drivers/usb/musb-new/da8xx.c
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 22/22] imx: Add i.MX8MM EVK board support.

2019-08-10 Thread Lukasz Majewski
Hi Peng,

I think that I've made a review to the code adding some i.MX8 board in
the past, but I do see that those comments were not applied:

1. The DDR4 configuration code as a very large table of magic numbers
(but there is a commented out CONFIG_ to train the DDR4 in .h
file.

2. Not using fitImage in U-Boot proper (which is fairly easy to adapt).

3. Not using pinmux and DTS to setup pins for UART, WDT, etc in U-Boot
proper (SPL can be left with legacy code).

4. The eMMC has some hacks which are not DT/DTS compliant.

More detailed comments you will find in the message below.



> Add board and SoC dts
> Add ddr training code
> support SD/MMC/GPIO/PINCTRL/UART
> 
> Signed-off-by: Peng Fan 
> ---
>  arch/arm/dts/Makefile  |3 +-
>  arch/arm/dts/imx8mm-evk-u-boot.dtsi|   92 ++
>  arch/arm/dts/imx8mm-evk.dts|  235 
>  arch/arm/mach-imx/imx8m/Kconfig|7 +
>  board/freescale/imx8mm_evk/Kconfig |   12 +
>  board/freescale/imx8mm_evk/MAINTAINERS |6 +
>  board/freescale/imx8mm_evk/Makefile|   12 +
>  board/freescale/imx8mm_evk/imx8mm_evk.c|   90 ++
>  board/freescale/imx8mm_evk/lpddr4_timing.c | 1980
>  board/freescale/imx8mm_evk/spl.c
>   |  102 ++ configs/imx8mm_evk_defconfig   |   70 +
>  include/configs/imx8mm_evk.h   |  164 +++
>  12 files changed, 2772 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/dts/imx8mm-evk-u-boot.dtsi
>  create mode 100644 arch/arm/dts/imx8mm-evk.dts
>  create mode 100644 board/freescale/imx8mm_evk/Kconfig
>  create mode 100644 board/freescale/imx8mm_evk/MAINTAINERS
>  create mode 100644 board/freescale/imx8mm_evk/Makefile
>  create mode 100644 board/freescale/imx8mm_evk/imx8mm_evk.c
>  create mode 100644 board/freescale/imx8mm_evk/lpddr4_timing.c
>  create mode 100644 board/freescale/imx8mm_evk/spl.c
>  create mode 100644 configs/imx8mm_evk_defconfig
>  create mode 100644 include/configs/imx8mm_evk.h
> 
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index ad4d2357bb..f7b674873f 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -622,7 +622,8 @@ dtb-$(CONFIG_ARCH_IMX8) += \
>   fsl-imx8qxp-colibri.dtb \
>   fsl-imx8qxp-mek.dtb
>  
> -dtb-$(CONFIG_ARCH_IMX8M) += fsl-imx8mq-evk.dtb
> +dtb-$(CONFIG_ARCH_IMX8M) += fsl-imx8mq-evk.dtb \
> + imx8mm-evk.dtb
>  
>  dtb-$(CONFIG_RCAR_GEN2) += \
>   r8a7790-lager-u-boot.dtb \
> diff --git a/arch/arm/dts/imx8mm-evk-u-boot.dtsi
> b/arch/arm/dts/imx8mm-evk-u-boot.dtsi new file mode 100644
> index 00..1095d36e31
> --- /dev/null
> +++ b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
> @@ -0,0 +1,92 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright 2019 NXP
> + */
> +
> +&{/soc} {
> + u-boot,dm-pre-reloc;
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> + u-boot,dm-pre-reloc;
> +};
> +
> +_24m {
> + u-boot,dm-spl;
> + u-boot,dm-pre-reloc;
> +};
> +
> + {
> + u-boot,dm-spl;
> + u-boot,dm-pre-reloc;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> +_reg_usdhc2_vmmc {
> + u-boot,dm-spl;
> +};
> +
> +_uart2 {
> + u-boot,dm-spl;
> +};
> +
> +_usdhc2_gpio {
> + u-boot,dm-spl;
> +};
> +
> +_usdhc2 {
> + u-boot,dm-spl;
> +};
> +
> +_usdhc3 {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> diff --git a/arch/arm/dts/imx8mm-evk.dts b/arch/arm/dts/imx8mm-evk.dts
> new file mode 100644
> index 00..2d5d89475b
> --- /dev/null
> +++ b/arch/arm/dts/imx8mm-evk.dts
> @@ -0,0 +1,235 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +/*
> + * Copyright 2019 NXP
> + */
> +
> +/dts-v1/;
> +
> +#include "imx8mm.dtsi"
> +
> +/ {
> + model = "FSL i.MX8MM EVK board";
> + compatible = "fsl,imx8mm-evk", "fsl,imx8mm";
> +
> + chosen {
> + stdout-path = 
> + };
> +
> + leds {
> + compatible = "gpio-leds";
> + pinctrl-names = "default";
> + pinctrl-0 = <_gpio_led>;
> +
> + status {
> + label = "status";
> + gpios = < 16 GPIO_ACTIVE_HIGH>;
> + default-state = "on";
> + };
> + };
> +
> + reg_usdhc2_vmmc: regulator-usdhc2 {
> + compatible = "regulator-fixed";
> + pinctrl-names = "default";
> + pinctrl-0 = <_reg_usdhc2_vmmc>;
> + regulator-name = "VSD_3V3";
> + regulator-min-microvolt = <330>;
> + regulator-max-microvolt = <330>;
> + gpio = 

Re: [U-Boot] Booting Linux kernel on x86_64

2019-08-10 Thread Andy Shevchenko
On Fri, Aug 9, 2019 at 6:52 PM Ryan Wilkins  wrote:
>
> Hello,
>
> I’m trying to get u-boot 2019.04 to execute the Linux 4.19.55 kernel from 
> u-boot on a generic Core i5 with 8 GB RAM and having issues.  The kernel that 
> I’m trying to boot will boot fine from GRUB so I know it works but starting 
> from u-boot just shows “Starting kernel” and the system appears to freeze.
>
> my bootcmd is
>   scsi reset; ext2load scsi 0:5 0x0400 bzImage; ext2load scsi 0:5 
> 0x0800 rootfs.cpio.uboot; zboot 0400 0 0800 ${filesize}
>
> The kernel bzip2 compressed file size is around 6 MB and the rootfs is about 
> 125 MB.
> The kernel and rootfs are loaded in OK and running zboot finds the kernel OK. 
>  The rootfs is a gzip compressed cpio with uboot wrapper.  I’m using 
> buildroot 2019.02 to create the system and rootfs.
>
> You might be asking why not just go with GRUB instead and the reason is the 
> company I’m working for has a lot of ARM-based devices out that all utilize 
> u-boot of which I’m quite familiar with, but this particular project is based 
> on the Intel Core i5.  It was decided to keep the system as similar as 
> possible to the ARM-based boards to keep support differences as minimal as 
> possible.  A number of utilities that we have already written are meant to 
> interact with the u-boot environment and depend on it.
>
> I realize this is rather sparse with information, but rather than make an 
> unnecessarily long email does anyone have any ideas of what to check or try 
> or requests for more information?
>
> Thanks in advance for any assistance.

You may try to enable 'earlyprintk=efi' (newer kernels have different
approach, i.e. 'earlycon=efifb') and also add 'keep_bootcon' to see if
the problem is at the beginning or ending stages of boot process.



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


[U-Boot] [PATCH 1/1] mailmap: provide usage instruction

2019-08-10 Thread Heinrich Schuchardt
Looking at the contents of file .mailmap it seems that some editors assumed
that translation is done by entering multiple lines into the file and the
last one replaces the others. This is not how it works. The translation
occurs according to entries in single lines as described in the
git-check-mailmap man-page.

Add a description of the file format.

Add an entry for Alexander Graf as his old email address is not valid
anymore.

Signed-off-by: Heinrich Schuchardt 
---
Resent, CC: U-Boot Mailing List 
---
 .mailmap | 8 
 1 file changed, 8 insertions(+)

diff --git a/.mailmap b/.mailmap
index 1bee048d13..dc72f24688 100644
--- a/.mailmap
+++ b/.mailmap
@@ -4,10 +4,18 @@
 # and/or not always written the same way, making contributions from the
 # same person appearing not to be so or badly displayed.
 #
+# This file is also used by scripts/get_maintainer.pl.
+#
 # This file can be modified by hand or updated by the following command:
 #  scripts/mailmapper > tmp; mv tmp .mailmap
 #
+# Entries in this file take one of the following forms:
+# Proper Name 
+#  
+# Proper Name  
+# Proper Name  Commit Name 

+Alexander Graf  
 Allen Martin 
 Andreas Bießmann 
 Andreas Bießmann 
--
2.20.1

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


[U-Boot] [PATCH 1/1] efi_loader: EFI_PXE_BASE_CODE_PROTOCOL stub

2019-08-10 Thread Heinrich Schuchardt
U-Boot implements the EFI_PXE_BASE_CODE_PROTOCOL because GRUB uses the mode
information for booting via PXE. All function pointers in the protocol were
NULL up to now which will cause immediate crashes when the services of the
protocol are called.

Create function stubs for all services of the protocol returning
EFI_UNSUPPORTED.

Signed-off-by: Heinrich Schuchardt 
---
 include/efi_api.h| 142 +++
 lib/efi_loader/efi_net.c | 132 +++-
 2 files changed, 257 insertions(+), 17 deletions(-)

diff --git a/include/efi_api.h b/include/efi_api.h
index e5634dc6a0..43778197af 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -1287,6 +1287,9 @@ struct efi_simple_network {
EFI_GUID(0x03c4e603, 0xac28, 0x11d3, \
 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d)

+#define EFI_PXE_BASE_CODE_PROTOCOL_REVISION 0x0001
+#define EFI_PXE_BASE_CODE_MAX_IPCNT 8
+
 struct efi_pxe_packet {
u8 packet[1472];
 };
@@ -1321,20 +1324,131 @@ struct efi_pxe_mode {
struct efi_pxe_packet pxe_reply;
 };

-struct efi_pxe {
-   u64 rev;
-   void (EFIAPI *start)(void);
-   void (EFIAPI *stop)(void);
-   void (EFIAPI *dhcp)(void);
-   void (EFIAPI *discover)(void);
-   void (EFIAPI *mftp)(void);
-   void (EFIAPI *udpwrite)(void);
-   void (EFIAPI *udpread)(void);
-   void (EFIAPI *setipfilter)(void);
-   void (EFIAPI *arp)(void);
-   void (EFIAPI *setparams)(void);
-   void (EFIAPI *setstationip)(void);
-   void (EFIAPI *setpackets)(void);
+struct efi_pxe_base_code_srvlist {
+   u16 type;
+   u8 accept_any_response;
+   u8 reserved;
+   struct efi_ip_address ip_addr;
+};
+
+struct efi_pxe_base_code_discover_info {
+   u8 use_m_cast;
+   u8 use_b_cast;
+   u8 use_u_cast;
+   u8 must_use_list;
+   struct efi_ip_address server_m_cast_ip;
+   u16 ip_cnt;
+   struct efi_pxe_base_code_srvlist srv_list[];
+};
+
+struct efi_pxe_base_code_mtftp_info {
+   struct efi_ip_address m_cast_ip;
+   u16 cport;
+   u16 sport;
+   u16 listen_timeout;
+   u16 transit_timeout;
+};
+
+struct efi_pxe_base_code_filter {
+   u8 filters;
+   u8 ip_cnt;
+   u16 reserved;
+   struct efi_ip_address ip_list[EFI_PXE_BASE_CODE_MAX_IPCNT];
+};
+
+struct efi_pxe_base_code_dhcpv4_packet {
+   u8 bootp_op_code;
+   u8 bootp_hw_type;
+   u8 bootp_addr_len;
+   u8 bootp_gate_hops;
+   u32 bootp_ident;
+   u16 bootp_seconds;
+   u16 bootp_flags;
+   u8 bootp_ci_addr[4];
+   u8 bootp_yi_addr[4];
+   u8 bootp_si_addr[4];
+   u8 bootp_gi_addr[4];
+   u8 bootp_hw_addr[16];
+   u8 bootp_srv_name[64];
+   u8 bootp_boot_file[128];
+   u32 dhcp_magick;
+   u8 dhcp_options[56];
+};
+
+struct efi_pxe_base_code_dhcpv6_packet {
+   u8 message_type;
+   u8 transaction_id[3];
+   u8 dhcp_options[1024];
+};
+
+typedef union {
+   u8 raw[1472];
+   struct efi_pxe_base_code_dhcpv4_packet dhcpv4;
+   struct efi_pxe_base_code_dhcpv6_packet dhcpv6;
+} EFI_PXE_BASE_CODE_PACKET;
+
+struct efi_pxe_base_code_protocol {
+   u64 revision;
+   efi_status_t (EFIAPI *start)(struct efi_pxe_base_code_protocol *this,
+u8 use_ipv6);
+   efi_status_t (EFIAPI *stop)(struct efi_pxe_base_code_protocol *this);
+   efi_status_t (EFIAPI *dhcp)(struct efi_pxe_base_code_protocol *this,
+   u8 sort_offers);
+   efi_status_t (EFIAPI *discover)(
+   struct efi_pxe_base_code_protocol *this,
+   u16 type, u16 *layer, u8 bis,
+   struct efi_pxe_base_code_discover_info *info);
+   efi_status_t (EFIAPI *mtftp)(
+   struct efi_pxe_base_code_protocol *this,
+   u32 operation, void *buffer_ptr,
+   u8 overwrite, efi_uintn_t *buffer_size,
+   struct efi_ip_address server_ip, char *filename,
+   struct efi_pxe_base_code_mtftp_info *info,
+   u8 dont_use_buffer);
+   efi_status_t (EFIAPI *udp_write)(
+   struct efi_pxe_base_code_protocol *this,
+   u16 op_flags, struct efi_ip_address *dest_ip,
+   u16 *dest_port,
+   struct efi_ip_address *gateway_ip,
+   struct efi_ip_address *src_ip, u16 *src_port,
+   efi_uintn_t *header_size, void *header_ptr,
+   efi_uintn_t *buffer_size, void *buffer_ptr);
+   efi_status_t (EFIAPI *udp_read)(
+   struct efi_pxe_base_code_protocol *this,
+   u16 op_flags, struct 

[U-Boot] [PATCH v2 5/5] dm: test: usb: rework keyboard test

2019-08-10 Thread Heinrich Schuchardt
Allow the unit test to pass full 8 byte scan code sequences to the USB
keyboard emulation driver and to parse multi-byte escape sequences.

The following features are not yet tested:

* LED status
* caps-lock
* num-lock
* numerical pad keys

The following features are not yet implemented by the USB keyboard
driver and therefore not tested:

* modifiers for non-alpha-numeric keys, e.g.  and 
* some special keys, e.g. 
* some modifiers, e.g.  and 
* alternative keyboard layouts

Signed-off-by: Heinrich Schuchardt 
---
v2
new patch
---
 drivers/usb/emul/sandbox_keyb.c |  27 +--
 test/dm/usb.c   | 283 +++-
 2 files changed, 292 insertions(+), 18 deletions(-)

diff --git a/drivers/usb/emul/sandbox_keyb.c b/drivers/usb/emul/sandbox_keyb.c
index 635945179e..2e7fb3b97c 100644
--- a/drivers/usb/emul/sandbox_keyb.c
+++ b/drivers/usb/emul/sandbox_keyb.c
@@ -155,14 +155,20 @@ static void *keyb_desc_list[] = {
NULL,
 };

-int sandbox_usb_keyb_add_string(struct udevice *dev, const char *str)
+/**
+ * sandbox_usb_keyb_add_string() - provide a USB scancode buffer
+ *
+ * @dev:   the keyboard emulation device
+ * @scancode:  scancode buffer with USB_KBD_BOOT_REPORT_SIZE bytes
+ */
+int sandbox_usb_keyb_add_string(struct udevice *dev,
+   const char scancode[USB_KBD_BOOT_REPORT_SIZE])
 {
struct sandbox_keyb_priv *priv = dev_get_priv(dev);
-   int len, ret;
+   int ret;

-   len = strlen(str);
-   ret = membuff_put(>in, str, len);
-   if (ret != len)
+   ret = membuff_put(>in, scancode, USB_KBD_BOOT_REPORT_SIZE);
+   if (ret != USB_KBD_BOOT_REPORT_SIZE)
return -ENOSPC;

return 0;
@@ -182,12 +188,12 @@ static int sandbox_keyb_interrupt(struct udevice *dev, 
struct usb_device *udev,
 {
struct sandbox_keyb_priv *priv = dev_get_priv(dev);
uint8_t *data = buffer;
-   int ch;

memset(data, '\0', length);
-   ch = membuff_getbyte(>in);
-   if (ch != -1)
-   data[2] = 4 + ch - 'a';
+   if (length < USB_KBD_BOOT_REPORT_SIZE)
+   return 0;
+
+   membuff_get(>in, buffer, USB_KBD_BOOT_REPORT_SIZE);

return 0;
 }
@@ -212,7 +218,8 @@ static int sandbox_keyb_probe(struct udevice *dev)
 {
struct sandbox_keyb_priv *priv = dev_get_priv(dev);

-   return membuff_new(>in, 256);
+   /* Provide an 80 character keyboard buffer */
+   return membuff_new(>in, 80 * USB_KBD_BOOT_REPORT_SIZE);
 }

 static const struct dm_usb_ops sandbox_usb_keyb_ops = {
diff --git a/test/dm/usb.c b/test/dm/usb.c
index ef454b0ae5..6420b6efdc 100644
--- a/test/dm/usb.c
+++ b/test/dm/usb.c
@@ -15,6 +15,12 @@
 #include 
 #include 

+struct keyboard_test_data {
+   const char modifiers;
+   const char scancode;
+   const char result[6];
+};
+
 /* Test that sandbox USB works correctly */
 static int dm_test_usb_base(struct unit_test_state *uts)
 {
@@ -115,9 +121,262 @@ static int dm_test_usb_stop(struct unit_test_state *uts)
 }
 DM_TEST(dm_test_usb_stop, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);

+/**
+ * dm_test_usb_keyb() - test USB keyboard driver
+ *
+ * This test copies USB keyboard scan codes into the key buffer of the USB
+ * keyboard emulation driver. These are picked up during emulated interrupts
+ * by the USB keyboard driver and converted to characters and escape sequences.
+ * The test then reads and verifies these characters and escape sequences from
+ * the standard input.
+ *
+ * TODO: The following features are not yet tested:
+ *
+ * * LED status
+ * * caps-lock
+ * * num-lock
+ * * numerical pad keys
+ *
+ * TODO: The following features are not yet implemented by the USB keyboard
+ * driver and therefore not tested:
+ *
+ * * modifiers for non-alpha-numeric keys, e.g.  and 
+ * * some special keys, e.g. 
+ * * some modifiers, e.g.  and 
+ * * alternative keyboard layouts
+ *
+ * @uts:   unit test state
+ * Return: 0 on success
+ */
 static int dm_test_usb_keyb(struct unit_test_state *uts)
 {
struct udevice *dev;
+   const struct keyboard_test_data *pos;
+   const struct keyboard_test_data kbd_test_data[] = {
+   /*  */
+   {0x00, 0x04, "a"},
+   /*  */
+   {0x00, 0x05, "b"},
+   /*  */
+   {0x00, 0x06, "c"},
+   /*  */
+   {0x00, 0x07, "d"},
+   /*  */
+   {0x00, 0x08, "e"},
+   /*  */
+   {0x00, 0x09, "f"},
+   /*  */
+   {0x00, 0x0a, "g"},
+   /*  */
+   {0x00, 0x0b, "h"},
+   /*  */
+   {0x00, 0x0c, "i"},
+   /*  */
+   {0x00, 0x0d, "j"},
+   /*  */
+   {0x00, 0x0e, "k"},
+   /*  */
+   {0x00, 0x0f, "l"},
+   /*  */
+   {0x00, 0x10, "m"},
+   /*  */
+   

[U-Boot] [PATCH v2 2/5] usb: kbd: implement special keys

2019-08-10 Thread Heinrich Schuchardt
Provide support for F1-F12, Insert, Delete, Home, End, Page Up, Page Down.

Signed-off-by: Heinrich Schuchardt 
Reviewed-by: Simon Glass 
---
v2:
no change
---
 common/usb_kbd.c | 54 
 1 file changed, 54 insertions(+)

diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 232d278e13..c9ac7a9e4c 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -232,6 +232,60 @@ static int usb_kbd_translate(struct usb_kbd_pdata *data, 
unsigned char scancode,
debug("%c", keycode);

switch (scancode) {
+   case 0x3a:  /* F1 */
+   usb_kbd_put_sequence(data, "\eOP");
+   break;
+   case 0x3b:  /* F2 */
+   usb_kbd_put_sequence(data, "\eOQ");
+   break;
+   case 0x3c:  /* F3 */
+   usb_kbd_put_sequence(data, "\eOR");
+   break;
+   case 0x3d:  /* F4 */
+   usb_kbd_put_sequence(data, "\eOS");
+   break;
+   case 0x3e:  /* F5 */
+   usb_kbd_put_sequence(data, "\e[15~");
+   break;
+   case 0x3f:  /* F6 */
+   usb_kbd_put_sequence(data, "\e[17~");
+   break;
+   case 0x40:  /* F7 */
+   usb_kbd_put_sequence(data, "\e[18~");
+   break;
+   case 0x41:  /* F8 */
+   usb_kbd_put_sequence(data, "\e[19~");
+   break;
+   case 0x42:  /* F9 */
+   usb_kbd_put_sequence(data, "\e[20~");
+   break;
+   case 0x43:  /* F10 */
+   usb_kbd_put_sequence(data, "\e[21~");
+   break;
+   case 0x44:  /* F11 */
+   usb_kbd_put_sequence(data, "\e[23~");
+   break;
+   case 0x45:  /* F12 */
+   usb_kbd_put_sequence(data, "\e[24~");
+   break;
+   case 0x49:  /* INSERT */
+   usb_kbd_put_sequence(data, "\e[2~");
+   break;
+   case 0x4a:  /* HOME */
+   usb_kbd_put_sequence(data, "\e[H");
+   break;
+   case 0x4b:  /* PAGE UP */
+   usb_kbd_put_sequence(data, "\e[5~");
+   break;
+   case 0x4c:  /* DELETE */
+   usb_kbd_put_sequence(data, "\e[3~");
+   break;
+   case 0x4d:  /* END */
+   usb_kbd_put_sequence(data, "\e[F");
+   break;
+   case 0x4e:  /* PAGE DOWN */
+   usb_kbd_put_sequence(data, "\e[6~");
+   break;
case 0x4f:  /* Right arrow key */
usb_kbd_put_sequence(data, "\e[C");
break;
--
2.20.1

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


[U-Boot] [PATCH v2 4/5] usb: kbd: move USB_KBD_BOOT_REPORT_SIZE to usb.h

2019-08-10 Thread Heinrich Schuchardt
Move constant USB_KBD_BOOT_REPORT_SIZE. This allows us to reuse it.

Signed-off-by: Heinrich Schuchardt 
---
v2
new patch
---
 common/usb_kbd.c | 6 --
 include/usb.h| 6 ++
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 42c8c4041a..050c9ee783 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -86,12 +86,6 @@ static const unsigned char usb_kbd_num_keypad[] = {
 #define USB_KBD_LEDMASK\
(USB_KBD_NUMLOCK | USB_KBD_CAPSLOCK | USB_KBD_SCROLLLOCK)

-/*
- * USB Keyboard reports are 8 bytes in boot protocol.
- * Appendix B of HID Device Class Definition 1.11
- */
-#define USB_KBD_BOOT_REPORT_SIZE 8
-
 struct usb_kbd_pdata {
unsigned long   intpipe;
int intpktsize;
diff --git a/include/usb.h b/include/usb.h
index 420a30e49f..db52736295 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -242,6 +242,12 @@ int usb_host_eth_scan(int mode);

 #ifdef CONFIG_USB_KEYBOARD

+/*
+ * USB Keyboard reports are 8 bytes in boot protocol.
+ * Appendix B of HID Device Class Definition 1.11
+ */
+#define USB_KBD_BOOT_REPORT_SIZE 8
+
 int drv_usb_kbd_init(void);
 int usb_kbd_deregister(int force);

--
2.20.1

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


[U-Boot] [PATCH v2 0/5] usb: kbd: implement special keys

2019-08-10 Thread Heinrich Schuchardt
GRUB uses function keys. So we should support these with an USB keyboard.
Provide support for F1-F12, Insert, Delete, Home, End, Page Up, Page Down.
Simplify the code beforehand.

Enhance the keyboard unit test.

v2:
enhance the keyboard unit test

Heinrich Schuchardt (5):
  usb: kbd: simplify coding for arrow keys
  usb: kbd: implement special keys
  usb: kbd: fix typo
  usb: kbd: move USB_KBD_BOOT_REPORT_SIZE to usb.h
  dm: test: usb: rework keyboard test

 common/usb_kbd.c|  89 +++---
 drivers/usb/emul/sandbox_keyb.c |  27 +--
 include/usb.h   |   6 +
 test/dm/usb.c   | 285 +++-
 4 files changed, 361 insertions(+), 46 deletions(-)

--
2.20.1

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


[U-Boot] [PATCH v2 1/5] usb: kbd: simplify coding for arrow keys

2019-08-10 Thread Heinrich Schuchardt
Avoid duplicate translation of arrow key codes.

Signed-off-by: Heinrich Schuchardt 
Reviewed-by: Simon Glass 
---
v2
no change
---
 common/usb_kbd.c | 31 +--
 1 file changed, 9 insertions(+), 22 deletions(-)

diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index cc99c6be07..232d278e13 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -74,15 +74,6 @@ static const unsigned char usb_kbd_num_keypad[] = {
'.', 0, 0, 0, '='
 };

-/*
- * map arrow keys to ^F/^B ^N/^P, can't really use the proper
- * ANSI sequence for arrow keys because the queuing code breaks
- * when a single keypress expands to 3 queue elements
- */
-static const unsigned char usb_kbd_arrow[] = {
-   0x6, 0x2, 0xe, 0x10
-};
-
 /*
  * NOTE: It's important for the NUM, CAPS, SCROLL-lock bits to be in this
  *   order. See usb_kbd_setled() function!
@@ -213,10 +204,6 @@ static int usb_kbd_translate(struct usb_kbd_pdata *data, 
unsigned char scancode,
keycode = usb_kbd_numkey[scancode - 0x1e];
}

-   /* Arrow keys */
-   if ((scancode >= 0x4f) && (scancode <= 0x52))
-   keycode = usb_kbd_arrow[scancode - 0x4f];
-
/* Numeric keypad */
if ((scancode >= 0x54) && (scancode <= 0x67))
keycode = usb_kbd_num_keypad[scancode - 0x54];
@@ -244,19 +231,19 @@ static int usb_kbd_translate(struct usb_kbd_pdata *data, 
unsigned char scancode,
if (keycode)
debug("%c", keycode);

-   switch (keycode) {
-   case 0x0e:  /* Down arrow key */
-   usb_kbd_put_sequence(data, "\e[B");
-   break;
-   case 0x10:  /* Up arrow key */
-   usb_kbd_put_sequence(data, "\e[A");
-   break;
-   case 0x06:  /* Right arrow key */
+   switch (scancode) {
+   case 0x4f:  /* Right arrow key */
usb_kbd_put_sequence(data, "\e[C");
break;
-   case 0x02:  /* Left arrow key */
+   case 0x50:  /* Left arrow key */
usb_kbd_put_sequence(data, "\e[D");
break;
+   case 0x51:  /* Down arrow key */
+   usb_kbd_put_sequence(data, "\e[B");
+   break;
+   case 0x52:  /* Up arrow key */
+   usb_kbd_put_sequence(data, "\e[A");
+   break;
default:
usb_kbd_put_queue(data, keycode);
break;
--
2.20.1

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


[U-Boot] [PATCH v2 3/5] usb: kbd: fix typo

2019-08-10 Thread Heinrich Schuchardt
%s/a interrupt/an interrupt/

Signed-off-by: Heinrich Schuchardt 
---
v2
new patch
---
 common/usb_kbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index c9ac7a9e4c..42c8c4041a 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -379,7 +379,7 @@ static inline void usb_kbd_poll_for_event(struct usb_device 
*dev)
 #if defined(CONFIG_SYS_USB_EVENT_POLL)
struct usb_kbd_pdata *data = dev->privptr;

-   /* Submit a interrupt transfer request */
+   /* Submit an interrupt transfer request */
usb_submit_int_msg(dev, data->intpipe, >new[0], data->intpktsize,
   data->intinterval);

--
2.20.1

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