Re: [U-Boot] [PATCH 2/2] net: mvneta: zero Tx descriptors on init

2018-06-17 Thread Stefan Roese

On 17.06.2018 13:55, Baruch Siach wrote:

From: Rabeeh Khoury 

Make the initialization sequence consistent with the Linux kernel
driver.

Signed-off-by: Rabeeh Khoury 
Signed-off-by: Baruch Siach 
---
  drivers/net/mvneta.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c
index 316a72b16517..32d02212b66c 100644
--- a/drivers/net/mvneta.c
+++ b/drivers/net/mvneta.c
@@ -1708,6 +1708,7 @@ static int mvneta_probe(struct udevice *dev)
buffer_loc.tx_descs = (struct mvneta_tx_desc *)bd_space;
size = roundup(MVNETA_MAX_TXD * sizeof(struct mvneta_tx_desc),
ARCH_DMA_MINALIGN);
+   memset(buffer_loc.tx_descs, 0, size);
buffer_loc.rx_descs = (struct mvneta_rx_desc *)
((phys_addr_t)bd_space + size);
size += roundup(MVNETA_MAX_RXD * sizeof(struct mvneta_rx_desc),



Reviewed-by: Stefan Roese 

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


Re: [U-Boot] [PATCH 1/2] net: mvneta: dcache flush TX descriptors at init

2018-06-17 Thread Stefan Roese

On 17.06.2018 13:55, Baruch Siach wrote:

From: Rabeeh Khoury 

This fixes sporadic timeout on initial packet Tx (usually ARP), with an
error message like:

   timeout: packet not sent

Signed-off-by: Rabeeh Khoury 
Signed-off-by: Baruch Siach 
---
  drivers/net/mvneta.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c
index 45e5eda95522..316a72b16517 100644
--- a/drivers/net/mvneta.c
+++ b/drivers/net/mvneta.c
@@ -1702,6 +1702,7 @@ static int mvneta_probe(struct udevice *dev)
  
  		/* Align buffer area for descs and rx_buffers to 1MiB */

bd_space = memalign(1 << MMU_SECTION_SHIFT, BD_SPACE);
+   flush_dcache_range((ulong)bd_space, (ulong)bd_space+BD_SPACE);
mmu_set_region_dcache_behaviour((phys_addr_t)bd_space, BD_SPACE,
DCACHE_OFF);
buffer_loc.tx_descs = (struct mvneta_tx_desc *)bd_space;



Nitpicking comment: Checkpatch will most likely complain about missing
spaces around '+'. Other than this:

Reviewed-by: Stefan Roese 

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


[U-Boot] [PATCH v3 4/4] arm: zynq: Add parallel NOR flash mini u-boot configuration for zynq

2018-06-17 Thread Siva Durga Prasad Paladugu
Add configuration files/dtses for mini u-boot configuration
which runs on smaller footprint OCM memory. This configuration
only has required parallel nor flash support.

Signed-off-by: Siva Durga Prasad Paladugu 
---
Changes from v2:
- None

Changes from v1:
- None
---
 arch/arm/dts/Makefile  |  1 +
 arch/arm/dts/zynq-cse-nor.dts  | 88 ++
 configs/zynq_cse_nor_defconfig | 50 
 3 files changed, 139 insertions(+)
 create mode 100644 arch/arm/dts/zynq-cse-nor.dts
 create mode 100644 configs/zynq_cse_nor_defconfig

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 71b7c3a..9e29fe6 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -129,6 +129,7 @@ dtb-$(CONFIG_ARCH_UNIPHIER_SLD8) += \
 dtb-$(CONFIG_ARCH_ZYNQ) += \
zynq-cc108.dtb \
zynq-cse-nand.dtb \
+   zynq-cse-nor.dtb \
zynq-cse-qspi-single.dtb \
zynq-microzed.dtb \
zynq-picozed.dtb \
diff --git a/arch/arm/dts/zynq-cse-nor.dts b/arch/arm/dts/zynq-cse-nor.dts
new file mode 100644
index 000..ba6f9a1
--- /dev/null
+++ b/arch/arm/dts/zynq-cse-nor.dts
@@ -0,0 +1,88 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Xilinx CSE NOR board DTS
+ *
+ * Copyright (C) 2018 Xilinx, Inc.
+ */
+/dts-v1/;
+#include "zynq-7000.dtsi"
+
+/ {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   model = "Zynq CSE NOR Board";
+   compatible = "xlnx,zynq-cse-nor", "xlnx,zynq-7000";
+
+   aliases {
+   serial0 = &dcc;
+   };
+
+   memory@fffc {
+   device_type = "memory";
+   reg = <0xFFFC 0x4>;
+   };
+
+   chosen {
+   stdout-path = "serial0:115200n8";
+   };
+
+   dcc: dcc {
+   compatible = "arm,dcc";
+   status = "disabled";
+   u-boot,dm-pre-reloc;
+   };
+
+   amba: amba {
+   compatible = "simple-bus";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   interrupt-parent = <&intc>;
+   ranges;
+
+   intc: interrupt-controller@f8f01000 {
+   compatible = "arm,cortex-a9-gic";
+   #interrupt-cells = <3>;
+   interrupt-controller;
+   reg = <0xF8F01000 0x1000>,
+ <0xF8F00100 0x100>;
+   };
+
+   slcr: slcr@f800 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "xlnx,zynq-slcr", "syscon", "simple-bus";
+   reg = <0xF800 0x1000>;
+   ranges;
+   clkc: clkc@100 {
+   #clock-cells = <1>;
+   compatible = "xlnx,ps7-clkc";
+   fclk-enable = <0xf>;
+   clock-output-names = "armpll", "ddrpll",
+   "iopll", "cpu_6or4x",
+   "cpu_3or2x", "cpu_2x", "cpu_1x",
+   "ddr2x", "ddr3x", "dci",
+   "lqspi", "smc", "pcap", "gem0",
+   "gem1", "fclk0", "fclk1",
+   "fclk2", "fclk3", "can0",
+   "can1", "sdio0", "sdio1",
+   "uart0", "uart1", "spi0",
+   "spi1", "dma", "usb0_aper",
+   "usb1_aper", "gem0_aper",
+   "gem1_aper", "sdio0_aper",
+   "sdio1_aper", "spi0_aper",
+   "spi1_aper", "can0_aper",
+   "can1_aper", "i2c0_aper",
+   "i2c1_aper", "uart0_aper",
+   "uart1_aper", "gpio_aper",
+   "lqspi_aper", "smc_aper",
+   "swdt", "dbg_trc", "dbg_apb";
+   reg = <0x100 0x100>;
+   };
+   };
+   };
+
+};
+
+&dcc {
+   status = "okay";
+};
diff --git a/configs/zynq_cse_nor_defconfig b/configs/zynq_cse_nor_defconfig
new file mode 100644
index 000..842d520
--- /dev/null
+++ b/configs/zynq_cse_nor_defconfig
@@ -0,0 +1,50 @@
+CONFIG_ARM=y
+CONFIG_SYS_CONFIG_NAME="zynq_cse"
+CONFIG_ARCH_ZYNQ=y
+CONFIG_SYS_TEXT_BASE=0xFFFC
+CONFIG_SPL_STACK_R_ADDR=0x20
+CONFIG_SYS_MALLOC_LEN=0x1000
+CONFIG_ZYNQ_M29EW_WB_HACK=y
+CONFIG_DEFAULT_DEVICE_TREE="zynq-cse-nor"
+CONFIG_BOOTDELAY=-1
+# CONFIG_DISPLAY_CPUINFO is not 

[U-Boot] [PATCH v3 2/4] arm: zynq: Dont define SDRAM_BASE and SDRAM_SIZE in .h

2018-06-17 Thread Siva Durga Prasad Paladugu
Remove the SDRAM_BASE nad SDRAM_SIZE as it can now get these
details from DT.

Signed-off-by: Siva Durga Prasad Paladugu 
---
Changes from v2:
- None

Changes from v1:
- Removed commit reference from description as per comment
---
 include/configs/zynq_cse.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/include/configs/zynq_cse.h b/include/configs/zynq_cse.h
index 2f5843f..adc02f0 100644
--- a/include/configs/zynq_cse.h
+++ b/include/configs/zynq_cse.h
@@ -41,7 +41,4 @@
 #undef CONFIG_SYS_MALLOC_LEN
 #define CONFIG_SYS_MALLOC_LEN  0x1000
 
-#define CONFIG_SYS_SDRAM_BASE  0xfffc
-#define CONFIG_SYS_SDRAM_SIZE  0x4
-
 #endif /* __CONFIG_ZYNQ_CSE_H */
-- 
2.7.4

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


[U-Boot] [PATCH v3 3/4] arm: zynq: Add Nand flash mini u-boot configuration for zynq

2018-06-17 Thread Siva Durga Prasad Paladugu
Add configuration files/dtses for mini u-boot configuration
which runs on smaller footprint of memory. This configuration
has only required nand flash support.

Signed-off-by: Siva Durga Prasad Paladugu 
---
Changes from v2:
- None
Changes from v1:
- Update memory node as per comment
- Removed intc and fclk as per comment
---
 arch/arm/dts/Makefile   |  1 +
 arch/arm/dts/zynq-cse-nand.dts  | 80 +
 configs/zynq_cse_nand_defconfig | 50 ++
 3 files changed, 131 insertions(+)
 create mode 100644 arch/arm/dts/zynq-cse-nand.dts
 create mode 100644 configs/zynq_cse_nand_defconfig

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index a0349a8..71b7c3a 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -128,6 +128,7 @@ dtb-$(CONFIG_ARCH_UNIPHIER_SLD8) += \
 
 dtb-$(CONFIG_ARCH_ZYNQ) += \
zynq-cc108.dtb \
+   zynq-cse-nand.dtb \
zynq-cse-qspi-single.dtb \
zynq-microzed.dtb \
zynq-picozed.dtb \
diff --git a/arch/arm/dts/zynq-cse-nand.dts b/arch/arm/dts/zynq-cse-nand.dts
new file mode 100644
index 000..9b1dd19
--- /dev/null
+++ b/arch/arm/dts/zynq-cse-nand.dts
@@ -0,0 +1,80 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Xilinx CSE NAND board DTS
+ *
+ * Copyright (C) 2018 Xilinx, Inc.
+ */
+/dts-v1/;
+
+/ {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   model = "Zynq CSE NAND Board";
+   compatible = "xlnx,zynq-cse-nand", "xlnx,zynq-7000";
+
+   aliases {
+   serial0 = &dcc;
+   };
+
+   memory@0 {
+   device_type = "memory";
+   reg = <0x0 0x40>;
+   };
+
+   chosen {
+   stdout-path = "serial0:115200n8";
+   };
+
+   dcc: dcc {
+   compatible = "arm,dcc";
+   status = "disabled";
+   u-boot,dm-pre-reloc;
+   };
+
+   amba: amba {
+   u-boot,dm-pre-reloc;
+   compatible = "simple-bus";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges;
+
+   slcr: slcr@f800 {
+   u-boot,dm-pre-reloc;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "xlnx,zynq-slcr", "syscon", "simple-bus";
+   reg = <0xF800 0x1000>;
+   ranges;
+   clkc: clkc@100 {
+   u-boot,dm-pre-reloc;
+   #clock-cells = <1>;
+   compatible = "xlnx,ps7-clkc";
+   clock-output-names = "armpll", "ddrpll",
+   "iopll", "cpu_6or4x",
+   "cpu_3or2x", "cpu_2x", "cpu_1x",
+   "ddr2x", "ddr3x", "dci",
+   "lqspi", "smc", "pcap", "gem0",
+   "gem1", "fclk0", "fclk1",
+   "fclk2", "fclk3", "can0",
+   "can1", "sdio0", "sdio1",
+   "uart0", "uart1", "spi0",
+   "spi1", "dma", "usb0_aper",
+   "usb1_aper", "gem0_aper",
+   "gem1_aper", "sdio0_aper",
+   "sdio1_aper", "spi0_aper",
+   "spi1_aper", "can0_aper",
+   "can1_aper", "i2c0_aper",
+   "i2c1_aper", "uart0_aper",
+   "uart1_aper", "gpio_aper",
+   "lqspi_aper", "smc_aper",
+   "swdt", "dbg_trc", "dbg_apb";
+   reg = <0x100 0x100>;
+   };
+   };
+   };
+
+};
+
+&dcc {
+   status = "okay";
+};
diff --git a/configs/zynq_cse_nand_defconfig b/configs/zynq_cse_nand_defconfig
new file mode 100644
index 000..7c7e143
--- /dev/null
+++ b/configs/zynq_cse_nand_defconfig
@@ -0,0 +1,50 @@
+CONFIG_ARM=y
+CONFIG_SYS_CONFIG_NAME="zynq_cse"
+CONFIG_ARCH_ZYNQ=y
+CONFIG_SYS_TEXT_BASE=0x10
+CONFIG_SPL_STACK_R_ADDR=0x20
+CONFIG_SYS_MALLOC_LEN=0x2
+CONFIG_DEFAULT_DEVICE_TREE="zynq-cse-nand"
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_SPL=y
+CONFIG_SPL_STACK_R=y
+CONFIG_SYS_PROMPT="Zynq> "
+# CONFIG_CMD_BDI is not set
+# CONFIG_CMD_CONSOLE is not set
+# CONFIG_CMD_BOOTD is not set
+# CONFIG_CMD_BOOTM is not set
+# CONFIG_CMD_ELF is not set
+# CONFIG_CMD_FDT is not set
+# CONFIG_CMD_GO is not set
+# CONFIG_CMD_RUN is not set
+# CONFIG_CMD_IMI

[U-Boot] [PATCH v3 1/4] lib: fdtdec: Add new variable ram_start to global data

2018-06-17 Thread Siva Durga Prasad Paladugu
Added new variable ram_start to global data structure for holding
the start address of first bank of RAM, and then use this ram_start
for calculating ram_top properly. This patch fixes the erroneous
calculation of ram_top incase of non zero ram start address.
This patch also renames fdtdec_setup_memory_size() to
fdtdec_setup_mem_size_start() as this routine now takes care
of memory size and start.

Signed-off-by: Siva Durga Prasad Paladugu 
Signed-off-by: Michal Simek 
---
Changes from v2:
- Used new varibale ram_start
- Rename fdtdec_setup_memory_size

Changes from v1:
- None
---
 arch/arm/mach-mvebu/arm64-common.c   |  2 +-
 board/emulation/qemu-arm/qemu-arm.c  |  2 +-
 board/renesas/alt/alt.c  |  2 +-
 board/renesas/blanche/blanche.c  |  2 +-
 board/renesas/draak/draak.c  |  2 +-
 board/renesas/eagle/eagle.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/salvator-x/salvator-x.c|  2 +-
 board/renesas/silk/silk.c|  2 +-
 board/renesas/stout/stout.c  |  2 +-
 board/renesas/ulcb/ulcb.c|  2 +-
 board/st/stm32f429-discovery/stm32f429-discovery.c   |  2 +-
 board/st/stm32f429-evaluation/stm32f429-evaluation.c |  2 +-
 board/st/stm32f469-discovery/stm32f469-discovery.c   |  2 +-
 board/st/stm32h743-disco/stm32h743-disco.c   |  2 +-
 board/st/stm32h743-eval/stm32h743-eval.c |  2 +-
 board/xilinx/zynq/board.c|  2 +-
 board/xilinx/zynqmp/zynqmp.c |  2 +-
 board/xilinx/zynqmp_r5/board.c   |  2 +-
 common/board_f.c |  4 ++--
 include/asm-generic/global_data.h|  1 +
 include/fdtdec.h | 16 +---
 lib/fdtdec.c |  3 ++-
 tools/patman/func_test.py|  2 +-
 tools/patman/test/-cover-letter.patch|  2 +-
 ...orrect-cast-for-sandbox-in-fdtdec_setup_memory_.patch |  4 ++--
 tools/patman/test/test01.txt |  2 +-
 30 files changed, 41 insertions(+), 37 deletions(-)

diff --git a/arch/arm/mach-mvebu/arm64-common.c 
b/arch/arm/mach-mvebu/arm64-common.c
index d3ea9e6..c2ab831 100644
--- a/arch/arm/mach-mvebu/arm64-common.c
+++ b/arch/arm/mach-mvebu/arm64-common.c
@@ -54,7 +54,7 @@ int dram_init_banksize(void)
 
 int dram_init(void)
 {
-   if (fdtdec_setup_memory_size() != 0)
+   if (fdtdec_setup_mem_size_start() != 0)
return -EINVAL;
 
return 0;
diff --git a/board/emulation/qemu-arm/qemu-arm.c 
b/board/emulation/qemu-arm/qemu-arm.c
index 6ec4200..926bbf2 100644
--- a/board/emulation/qemu-arm/qemu-arm.c
+++ b/board/emulation/qemu-arm/qemu-arm.c
@@ -47,7 +47,7 @@ int board_init(void)
 
 int dram_init(void)
 {
-   if (fdtdec_setup_memory_size() != 0)
+   if (fdtdec_setup_mem_size_start() != 0)
return -EINVAL;
 
return 0;
diff --git a/board/renesas/alt/alt.c b/board/renesas/alt/alt.c
index 86e9d24..58838ff 100644
--- a/board/renesas/alt/alt.c
+++ b/board/renesas/alt/alt.c
@@ -78,7 +78,7 @@ int board_init(void)
 
 int dram_init(void)
 {
-   if (fdtdec_setup_memory_size() != 0)
+   if (fdtdec_setup_mem_size_start() != 0)
return -EINVAL;
 
return 0;
diff --git a/board/renesas/blanche/blanche.c b/board/renesas/blanche/blanche.c
index 7d48d0f..1fd511c 100644
--- a/board/renesas/blanche/blanche.c
+++ b/board/renesas/blanche/blanche.c
@@ -339,7 +339,7 @@ int board_eth_init(bd_t *bis)
 
 int dram_init(void)
 {
-   if (fdtdec_setup_memory_size() != 0)
+   if (fdtdec_setup_mem_size_start() != 0)
return -EINVAL;
 
return 0;
diff --git a/board/renesas/draak/draak.c b/board/renesas/draak/draak.c
index f804fae..b178131 100644
--- a/board/renesas/draak/draak.c
+++ b/board/renesas/draak/draak.c
@@ -96,7 +96,7 @@ int board_init(void)
 
 int dram_init(void)
 {
-   if (fdtdec_setup_memory_size() != 0)
+   if (fdtdec_setup_mem_size_start() != 0)
return -EINVAL;
 
return 0;
diff --git a/board/renesas/eagle/eagle.c b/board/renesas/eagle/eagle.c
index 4bf0a20..26deca9 100644
--- a/board/renesas/eagle/eagle.c
+++ b/board/renesas/eagle/eagle.c
@@ -73,7 +73,7 @@ int board_init(void)
 
 int dram_init(void)
 {
-   if (fdtdec_setup_memory_size() != 0)
+   if (fdtdec_setup_mem_size_start() != 0)
return -EINVAL;
 
return 0;
diff

Re: [U-Boot] [PATCH] usb: sunxi: ohci: make ohci_t the first member in private data

2018-06-17 Thread Jagan Teki
On Mon, Jun 18, 2018 at 6:44 AM, Marek Vasut  wrote:
> On 06/17/2018 06:13 PM, Vasily Khoruzhick wrote:
>> ohci-hcd casts priv_data pointer to (ohci_t *), thus it must be
>> the first member in private data struct.
>>
>> Fixes 831cc98b1 ("usb: sunxi: Simplify ccm reg base code")
>>
>> Signed-off-by: Vasily Khoruzhick 
>
> Sigh, I really wonder how (or if at all!) the original series was
> tested. And then I get flak for scrutinizing patches, right ...

APAIK, I did basic sanity with possible tests.

But one thing for sure is, you should have to wait for sometime to
apply this patch. Applying fast (that to during weekend) making
reviewers or maintainers not giving enough room to work.

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


Re: [U-Boot] [PATCH v10 00/35] phy: sunxi: Add Allwinner sun4i USB PHY

2018-06-17 Thread Vasily Khoruzhick
On Sun, Jun 17, 2018 at 11:04 PM, Jagan Teki  wrote:
>> Do git pull and make sure you are at least at
>> a715415bb5948c84cc44c601b193188990f7238b.
>
> Yes, I even tried on this, can't see any issue? Let me know If I still miss 
> any.
>
> U-Boot 2018.07-rc1-00165-ga715415bb5 (Jun 18 2018 - 11:28:28 +0530)
> Allwinner Technology
>
> CPU:   Allwinner A64 (SUN50I)
> Model: BananaPi-M64
> DRAM:  2 GiB
> MMC:   SUNXI SD/MMC: 0, SUNXI SD/MMC: 1
> Loading Environment from FAT... Unable to use mmc 1:3... Failed (-5)
> In:serial
> Out:   serial
> Err:   serial
> Allwinner mUSB OTG (Peripheral)
> Net:
> Warning: usb_ether using MAC address from ROM
> eth0: usb_ether
> starting USB...
> USB0:   USB EHCI 1.00
> USB1:   USB OHCI 1.0
> USB2:   USB EHCI 1.00
> USB3:   USB OHCI 1.0
> scanning bus 0 for devices... 1 USB Device(s) found
> scanning bus 2 for devices... 4 USB Device(s) found
>scanning usb for storage devices... 0 Storage Device(s) found
> Hit any key to stop autoboot:  0
> => usb info
> 1: Hub,  USB Revision 2.0
>  - u-boot EHCI Host Controller
>  - Class: Hub
>  - PacketSize: 64  Configurations: 1
>  - Vendor: 0x  Product 0x Version 1.0
>Configuration: 1
>- Interfaces: 1 Self Powered 0mA
>  Interface: 0
>  - Alternate Setting 0, Endpoints: 1
>  - Class Hub
>  - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms
>
> 1: Hub,  USB Revision 2.0
>  - u-boot EHCI Host Controller
>  - Class: Hub
>  - PacketSize: 64  Configurations: 1
>  - Vendor: 0x  Product 0x Version 1.0
>Configuration: 1
>- Interfaces: 1 Self Powered 0mA
>  Interface: 0
>  - Alternate Setting 0, Endpoints: 1
>  - Class Hub
>  - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms
>
> 2: Hub,  USB Revision 2.0
>  -  USB 2.0 Hub
>  - Class: Hub
>  - PacketSize: 64  Configurations: 1
>  - Vendor: 0x1a40  Product 0x0101 Version 1.17
>Configuration: 1
>- Interfaces: 1 Self Powered Remote Wakeup 100mA
>  Interface: 0
>  - Alternate Setting 0, Endpoints: 1
>  - Class Hub
>  - Endpoint 1 In Interrupt MaxPacket 1 Interval 12ms
>
> 3: Human Interface,  USB Revision 1.10
>  -  Dell KB216 Wired Keyboard
>  - Class: (from Interface) Human Interface
>  - PacketSize: 8  Configurations: 1
>  - Vendor: 0x413c  Product 0x2113 Version 1.8
>Configuration: 1
>- Interfaces: 2 Bus Powered Remote Wakeup 100mA
>  Interface: 0
>  - Alternate Setting 0, Endpoints: 1
>  - Class Human Interface, Subclass: Boot Keyboard
>  - Endpoint 1 In Interrupt MaxPacket 8 Interval 24ms
>  Interface: 1
>  - Alternate Setting 0, Endpoints: 1
>  - Class Human Interface, Subclass: None
>  - Endpoint 2 In Interrupt MaxPacket 8 Interval 48ms

Leave this one plugged in.

> 4: Human Interface,  USB Revision 2.0
>  - Logitech USB Receiver
>  - Class: (from Interface) Human Interface
>  - PacketSize: 32  Configurations: 1
>  - Vendor: 0x046d  Product 0xc52b Version 36.1
>Configuration: 1
>- Interfaces: 3 Bus Powered Remote Wakeup 98mA
>- String: "RQR24.01_B0023"
>  Interface: 0
>  - Alternate Setting 0, Endpoints: 1
>  - Class Human Interface, Subclass: Boot Keyboard
>  - Endpoint 1 In Interrupt MaxPacket 8 Interval 8ms
>  Interface: 1
>  - Alternate Setting 0, Endpoints: 1
>  - Class Human Interface, Subclass: Boot Mouse
>  - Endpoint 2 In Interrupt MaxPacket 8 Interval 2ms
>  Interface: 2
>  - Alternate Setting 0, Endpoints: 1
>  - Class Human Interface, Subclass: None
>  - Endpoint 3 In Interrupt MaxPacket 32 Interval 2ms

Unplug this one.

Make sure that you have CONFIG_USB_KEYBOARD in your config and then
run 'usb reset' (or try booting Linux).
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v10 00/35] phy: sunxi: Add Allwinner sun4i USB PHY

2018-06-17 Thread Jagan Teki
On Mon, Jun 18, 2018 at 11:18 AM, Vasily Khoruzhick  wrote:
> On Sun, Jun 17, 2018 at 10:19 PM, Jagan Teki  wrote:
>
> Hi Jagan,
>
>> I've plugged keyboard and mouse on so-pine board, couldn't reproduce the 
>> issue.
>> This is on top of master, where this series got merged, is this issue
>> reproduces on your recent changes?
>
>> U-Boot 2018.07-rc1-00161-g76d69eb01d (Jun 18 2018 - 10:41:20 +0530)
>> Allwinner Technology
>>
>> CPU:   Allwinner A64 (SUN50I)
>> Model: Pine64+
>> DRAM:  2 GiB
>> MMC:   SUNXI SD/MMC: 0, SUNXI SD/MMC: 1
>> Loading Environment from FAT... Card did not respond to voltage select!
>> ** Bad device mmc 1 **
>> Failed (-5)
>> In:serial
>> Out:   serial
>> Err:   serial
>> Net:   phy interface7
>> eth0: ethernet@1c3
>> starting USB...
>> USB0:   USB EHCI 0.00
>> USB1:   USB OHCI 0.0
>
> See these zeroes? USB clock isn't enabled. USB host is not functional.

True, what I'm trying to say is I can't reproduce on top of this series.

>
> You can do 'usb tree' with this build to ensure that your keyboard or
> mouse is NOT detected. You can also plug some USB flash to ensure that
> nothing is detected.
>
> Do git pull and make sure you are at least at
> a715415bb5948c84cc44c601b193188990f7238b.

Yes, I even tried on this, can't see any issue? Let me know If I still miss any.

U-Boot 2018.07-rc1-00165-ga715415bb5 (Jun 18 2018 - 11:28:28 +0530)
Allwinner Technology

CPU:   Allwinner A64 (SUN50I)
Model: BananaPi-M64
DRAM:  2 GiB
MMC:   SUNXI SD/MMC: 0, SUNXI SD/MMC: 1
Loading Environment from FAT... Unable to use mmc 1:3... Failed (-5)
In:serial
Out:   serial
Err:   serial
Allwinner mUSB OTG (Peripheral)
Net:
Warning: usb_ether using MAC address from ROM
eth0: usb_ether
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   USB EHCI 1.00
USB3:   USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 4 USB Device(s) found
   scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
=> usb info
1: Hub,  USB Revision 2.0
 - u-boot EHCI Host Controller
 - Class: Hub
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x  Product 0x Version 1.0
   Configuration: 1
   - Interfaces: 1 Self Powered 0mA
 Interface: 0
 - Alternate Setting 0, Endpoints: 1
 - Class Hub
 - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

1: Hub,  USB Revision 2.0
 - u-boot EHCI Host Controller
 - Class: Hub
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x  Product 0x Version 1.0
   Configuration: 1
   - Interfaces: 1 Self Powered 0mA
 Interface: 0
 - Alternate Setting 0, Endpoints: 1
 - Class Hub
 - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

2: Hub,  USB Revision 2.0
 -  USB 2.0 Hub
 - Class: Hub
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x1a40  Product 0x0101 Version 1.17
   Configuration: 1
   - Interfaces: 1 Self Powered Remote Wakeup 100mA
 Interface: 0
 - Alternate Setting 0, Endpoints: 1
 - Class Hub
 - Endpoint 1 In Interrupt MaxPacket 1 Interval 12ms

3: Human Interface,  USB Revision 1.10
 -  Dell KB216 Wired Keyboard
 - Class: (from Interface) Human Interface
 - PacketSize: 8  Configurations: 1
 - Vendor: 0x413c  Product 0x2113 Version 1.8
   Configuration: 1
   - Interfaces: 2 Bus Powered Remote Wakeup 100mA
 Interface: 0
 - Alternate Setting 0, Endpoints: 1
 - Class Human Interface, Subclass: Boot Keyboard
 - Endpoint 1 In Interrupt MaxPacket 8 Interval 24ms
 Interface: 1
 - Alternate Setting 0, Endpoints: 1
 - Class Human Interface, Subclass: None
 - Endpoint 2 In Interrupt MaxPacket 8 Interval 48ms

4: Human Interface,  USB Revision 2.0
 - Logitech USB Receiver
 - Class: (from Interface) Human Interface
 - PacketSize: 32  Configurations: 1
 - Vendor: 0x046d  Product 0xc52b Version 36.1
   Configuration: 1
   - Interfaces: 3 Bus Powered Remote Wakeup 98mA
   - String: "RQR24.01_B0023"
 Interface: 0
 - Alternate Setting 0, Endpoints: 1
 - Class Human Interface, Subclass: Boot Keyboard
 - Endpoint 1 In Interrupt MaxPacket 8 Interval 8ms
 Interface: 1
 - Alternate Setting 0, Endpoints: 1
 - Class Human Interface, Subclass: Boot Mouse
 - Endpoint 2 In Interrupt MaxPacket 8 Interval 2ms
 Interface: 2
 - Alternate Setting 0, Endpoints: 1
 - Class Human Interface, Subclass: None
 - Endpoint 3 In Interrupt MaxPacket 32 Interval 2ms
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v10 00/35] phy: sunxi: Add Allwinner sun4i USB PHY

2018-06-17 Thread Vasily Khoruzhick
On Sun, Jun 17, 2018 at 10:19 PM, Jagan Teki  wrote:

Hi Jagan,

> I've plugged keyboard and mouse on so-pine board, couldn't reproduce the 
> issue.
> This is on top of master, where this series got merged, is this issue
> reproduces on your recent changes?

> U-Boot 2018.07-rc1-00161-g76d69eb01d (Jun 18 2018 - 10:41:20 +0530)
> Allwinner Technology
>
> CPU:   Allwinner A64 (SUN50I)
> Model: Pine64+
> DRAM:  2 GiB
> MMC:   SUNXI SD/MMC: 0, SUNXI SD/MMC: 1
> Loading Environment from FAT... Card did not respond to voltage select!
> ** Bad device mmc 1 **
> Failed (-5)
> In:serial
> Out:   serial
> Err:   serial
> Net:   phy interface7
> eth0: ethernet@1c3
> starting USB...
> USB0:   USB EHCI 0.00
> USB1:   USB OHCI 0.0

See these zeroes? USB clock isn't enabled. USB host is not functional.

You can do 'usb tree' with this build to ensure that your keyboard or
mouse is NOT detected. You can also plug some USB flash to ensure that
nothing is detected.

Do git pull and make sure you are at least at
a715415bb5948c84cc44c601b193188990f7238b.

Rebuild, reflash u-boot, plug you keyboard, and do 'usb reset'.

Anyway, look for "[PATCH] usb: sunxi: ohci: make ohci_t the first
member in private data" in your inbox if you want to see a fix.

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


[U-Boot] [PATCH] imx6ul: geam: Fix fdt_file mismatch

2018-06-17 Thread Jagan Teki
fdt_file is looking for imx6ul-geam-kit.dtb but Linux
has imx6ul-geam.dtb, since Linux skipped -kit on file name
by below commit.
"ARM: dts: imx6ul-geam: Skip suffix -kit from dts name"
(sha1: 182de5ebce71e469cfa686fcdf08c9cbe11ece97)

So, due to this mismatch U-Boot failed to pick the
proper dtb which eventually break the Linux boot.

This patch fixed this mismatch by
- renaming dts files
- update config option to use new dtb file
- update fdt_file to new dtb file name

Signed-off-by: Jagan Teki 
---
 arch/arm/dts/Makefile | 2 +-
 arch/arm/dts/{imx6ul-geam-kit-u-boot.dtsi => imx6ul-geam-u-boot.dtsi} | 0
 arch/arm/dts/{imx6ul-geam-kit.dts => imx6ul-geam.dts} | 0
 board/engicam/common/board.c  | 4 ++--
 configs/imx6ul_geam_mmc_defconfig | 2 +-
 configs/imx6ul_geam_nand_defconfig| 2 +-
 6 files changed, 5 insertions(+), 5 deletions(-)
 rename arch/arm/dts/{imx6ul-geam-kit-u-boot.dtsi => imx6ul-geam-u-boot.dtsi} 
(100%)
 rename arch/arm/dts/{imx6ul-geam-kit.dts => imx6ul-geam.dts} (100%)

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 3da8fc7a18..dc968159e6 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -427,7 +427,7 @@ dtb-$(CONFIG_MX6SX) += \
imx6sx-sdb.dtb
 
 dtb-$(CONFIG_MX6UL) += \
-   imx6ul-geam-kit.dtb \
+   imx6ul-geam.dtb \
imx6ul-isiot-emmc.dtb \
imx6ul-isiot-nand.dtb \
imx6ul-opos6uldev.dtb
diff --git a/arch/arm/dts/imx6ul-geam-kit-u-boot.dtsi 
b/arch/arm/dts/imx6ul-geam-u-boot.dtsi
similarity index 100%
rename from arch/arm/dts/imx6ul-geam-kit-u-boot.dtsi
rename to arch/arm/dts/imx6ul-geam-u-boot.dtsi
diff --git a/arch/arm/dts/imx6ul-geam-kit.dts b/arch/arm/dts/imx6ul-geam.dts
similarity index 100%
rename from arch/arm/dts/imx6ul-geam-kit.dts
rename to arch/arm/dts/imx6ul-geam.dts
diff --git a/board/engicam/common/board.c b/board/engicam/common/board.c
index fb37403aa1..5dccb17cb2 100644
--- a/board/engicam/common/board.c
+++ b/board/engicam/common/board.c
@@ -50,8 +50,8 @@ static void setenv_fdt_file(void)
env_set("fdt_file", "imx6q-icore-rqs.dtb");
else if (is_mx6dl() || is_mx6solo())
env_set("fdt_file", "imx6dl-icore-rqs.dtb");
-   } else if (!strcmp(cmp_dtb, "imx6ul-geam-kit"))
-   env_set("fdt_file", "imx6ul-geam-kit.dtb");
+   } else if (!strcmp(cmp_dtb, "imx6ul-geam"))
+   env_set("fdt_file", "imx6ul-geam.dtb");
else if (!strcmp(cmp_dtb, "imx6ul-isiot-mmc"))
env_set("fdt_file", "imx6ul-isiot-emmc.dtb");
else if (!strcmp(cmp_dtb, "imx6ul-isiot-emmc"))
diff --git a/configs/imx6ul_geam_mmc_defconfig 
b/configs/imx6ul_geam_mmc_defconfig
index 4ae09fff11..6cd1bfd15e 100644
--- a/configs/imx6ul_geam_mmc_defconfig
+++ b/configs/imx6ul_geam_mmc_defconfig
@@ -10,7 +10,7 @@ CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 # CONFIG_CMD_BMODE is not set
-CONFIG_DEFAULT_DEVICE_TREE="imx6ul-geam-kit"
+CONFIG_DEFAULT_DEVICE_TREE="imx6ul-geam"
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
diff --git a/configs/imx6ul_geam_nand_defconfig 
b/configs/imx6ul_geam_nand_defconfig
index e8f9cb4478..d3364a790f 100644
--- a/configs/imx6ul_geam_nand_defconfig
+++ b/configs/imx6ul_geam_nand_defconfig
@@ -8,7 +8,7 @@ CONFIG_TARGET_MX6UL_ENGICAM=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
 # CONFIG_CMD_BMODE is not set
-CONFIG_DEFAULT_DEVICE_TREE="imx6ul-geam-kit"
+CONFIG_DEFAULT_DEVICE_TREE="imx6ul-geam"
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
-- 
2.14.3

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


Re: [U-Boot] [PATCH v10 00/35] phy: sunxi: Add Allwinner sun4i USB PHY

2018-06-17 Thread Jagan Teki
On Sat, Jun 16, 2018 at 11:34 PM, Vasily Khoruzhick  wrote:
> On Tue, Jun 5, 2018 at 8:39 PM, Vasily Khoruzhick  wrote:
>> On Tue, Jun 5, 2018 at 12:04 AM, Jagan Teki  wrote:
>>>
>>> Let me look at it and will come back.
>>
>> I fixed it. See "usb: sunxi: sun50i: enable OHCI0 clock when OHCI1 is
>> in use" and "sunxi: clock: Fix EHCI and OHCI clocks on A64" on ML.
>
> I found another issue caused by this series, u-boot crashes while
> shutting down USB if any low-speed or full-speed device is plugged
> (e.g. keyboard):

I've plugged keyboard and mouse on so-pine board, couldn't reproduce the issue.
This is on top of master, where this series got merged, is this issue
reproduces on your recent changes?

U-Boot 2018.07-rc1-00161-g76d69eb01d (Jun 18 2018 - 10:41:20 +0530)
Allwinner Technology

CPU:   Allwinner A64 (SUN50I)
Model: Pine64+
DRAM:  2 GiB
MMC:   SUNXI SD/MMC: 0, SUNXI SD/MMC: 1
Loading Environment from FAT... Card did not respond to voltage select!
** Bad device mmc 1 **
Failed (-5)
In:serial
Out:   serial
Err:   serial
Net:   phy interface7
eth0: ethernet@1c3
starting USB...
USB0:   USB EHCI 0.00
USB1:   USB OHCI 0.0
scanning bus 0 for devices... 1 USB Device(s) found
   scanning usb for storage devices... 0 Storage Device(s) found
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] Makefile: drop unused cpp_cfg macro

2018-06-17 Thread Baruch Siach
Commit e19b0fb4851f (kbuild: generate u-boot.cfg as a byproduct of
include/autoconf.mk) removed the use of the cpp_cfg macro in Makefile,
but forgot to remove its definition.

Cc: Masahiro Yamada 
Signed-off-by: Baruch Siach 
---
 Makefile | 5 -
 1 file changed, 5 deletions(-)

diff --git a/Makefile b/Makefile
index 61ef84576afa..cbee84249b06 100644
--- a/Makefile
+++ b/Makefile
@@ -1052,11 +1052,6 @@ ifndef CONFIG_SYS_UBOOT_START
 CONFIG_SYS_UBOOT_START := 0
 endif
 
-# Create a file containing the configuration options the image was built with
-quiet_cmd_cpp_cfg = CFG $@
-cmd_cpp_cfg = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
-   -DDO_DEPS_ONLY -D__ASSEMBLY__ -x assembler-with-cpp -P -dM -E -o $@ $<
-
 # Boards with more complex image requirments can provide an .its source file
 # or a generator script
 ifneq ($(CONFIG_SPL_FIT_SOURCE),"")
-- 
2.17.1

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


[U-Boot] [PATCH] ARM: dts: rmobile: Add HS200 support to E3 Ebisu

2018-06-17 Thread Marek Vasut
Add regulator nodes and pinmux settings to the SDHI3 on E3 Ebisu
and enable HS200 mode on it.

Signed-off-by: Marek Vasut 
Cc: Nobuhiro Iwamatsu 
---
 arch/arm/dts/r8a77990-ebisu.dts | 38 +
 1 file changed, 38 insertions(+)

diff --git a/arch/arm/dts/r8a77990-ebisu.dts b/arch/arm/dts/r8a77990-ebisu.dts
index e68d78678a..564240a266 100644
--- a/arch/arm/dts/r8a77990-ebisu.dts
+++ b/arch/arm/dts/r8a77990-ebisu.dts
@@ -28,6 +28,24 @@
/* first 128MB is reserved for secure area. */
reg = <0x0 0x4800 0x0 0x3800>;
};
+
+   reg_1p8v: regulator0 {
+   compatible = "regulator-fixed";
+   regulator-name = "fixed-1.8V";
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <180>;
+   regulator-boot-on;
+   regulator-always-on;
+   };
+
+   reg_3p3v: regulator1 {
+   compatible = "regulator-fixed";
+   regulator-name = "fixed-3.3V";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-boot-on;
+   regulator-always-on;
+   };
 };
 
 &avb {
@@ -71,6 +89,18 @@
groups = "scif_clk_a";
function = "scif_clk";
};
+
+   sdhi3_pins: sd2 {
+   groups = "sdhi3_data8", "sdhi3_ctrl";
+   function = "sdhi3";
+   power-source = <1800>;
+   };
+
+   sdhi3_pins_uhs: sd2_uhs {
+   groups = "sdhi3_data8", "sdhi3_ctrl";
+   function = "sdhi3";
+   power-source = <1800>;
+   };
 };
 
 &sdhi0 {
@@ -82,7 +112,15 @@
 };
 
 &sdhi3 {
+   /* used for on-board 8bit eMMC */
+   pinctrl-0 = <&sdhi3_pins>;
+   pinctrl-1 = <&sdhi3_pins_uhs>;
+   pinctrl-names = "default", "state_uhs";
+
+   vmmc-supply = <®_3p3v>;
+   vqmmc-supply = <®_1p8v>;
bus-width = <8>;
+   mmc-hs200-1_8v;
non-removable;
status = "okay";
 };
-- 
2.17.1

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


[U-Boot] [PATCH] Makefile: drop mention of *.cfgtmp

2018-06-17 Thread Baruch Siach
Since commit f916757300 (imx: Create distinct pre-processed mkimage
config files), *.cfgtmp files are no longer generated. There is no need
to remove them on the 'clean' target anymore.

Remove also the .gitignore glob.

Cc: Trent Piepho 
Signed-off-by: Baruch Siach 
---
 .gitignore | 1 -
 Makefile   | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index 9110eda6468f..f97838a756a6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,7 +20,6 @@
 *.swp
 *.bin
 *.patch
-*.cfgtmp
 *.tab.[ch]
 
 # host programs on Cygwin
diff --git a/Makefile b/Makefile
index 6a190e7a894b..61ef84576afa 100644
--- a/Makefile
+++ b/Makefile
@@ -1613,13 +1613,12 @@ PHONY += $(clean-dirs) clean archclean
 $(clean-dirs):
$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
 
-# TODO: Do not use *.cfgtmp
 clean: $(clean-dirs)
$(call cmd,rmdirs)
$(call cmd,rmfiles)
@find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
\( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
-   -o -name '*.ko.*' -o -name '*.su' -o -name '*.cfgtmp' \
+   -o -name '*.ko.*' -o -name '*.su' \
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
-o -name '*.lex.c' -o -name '*.tab.[ch]' \
-o -name '*.symtypes' -o -name 'modules.order' \
-- 
2.17.1

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


[U-Boot] [PATCH] net: ravb: Filter out supported PHY features

2018-06-17 Thread Marek Vasut
The RAVB only supports 100Full and 1000Full operation, it does not support
10Full or any Half-duplex modes. The PHY could still advertise those features
though, so filter out the PHY features accordingly.

Signed-off-by: Marek Vasut 
Cc: Nobuhiro Iwamatsu 
Cc: Joe Hershberger 
---
 drivers/net/ravb.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c
index d66fcef4e7..adcbc931e0 100644
--- a/drivers/net/ravb.c
+++ b/drivers/net/ravb.c
@@ -318,12 +318,13 @@ static int ravb_phy_config(struct udevice *dev)
 
eth->phydev = phydev;
 
-   /* 10BASE is not supported for Ethernet AVB MAC */
-   phydev->supported &= ~(SUPPORTED_10baseT_Full
-  | SUPPORTED_10baseT_Half);
+   phydev->supported &= SUPPORTED_100baseT_Full |
+SUPPORTED_1000baseT_Full | SUPPORTED_Autoneg |
+SUPPORTED_TP | SUPPORTED_MII | SUPPORTED_Pause |
+SUPPORTED_Asym_Pause;
+
if (pdata->max_speed != 1000) {
-   phydev->supported &= ~(SUPPORTED_1000baseT_Half
-  | SUPPORTED_1000baseT_Full);
+   phydev->supported &= ~SUPPORTED_1000baseT_Full;
reg = phy_read(phydev, -1, MII_CTRL1000);
reg &= ~(BIT(9) | BIT(8));
phy_write(phydev, -1, MII_CTRL1000, reg);
-- 
2.17.1

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


[U-Boot] [PATCH 3/3] ARM: dts: rmobile: Move the PHY reset GPIOs into PHY nodes

2018-06-17 Thread Marek Vasut
Both the RAVB and SH ether driver now support parsing the PHY reset
GPIOs from both the PHY nodes and the MAC nodes, move the reset GPIOs
back into the PHY nodes to minimize DT difference between U-Boot and
Linux.

Signed-off-by: Marek Vasut 
Cc: Nobuhiro Iwamatsu 
---
 arch/arm/dts/r8a77970-eagle.dts   | 2 +-
 arch/arm/dts/salvator-common.dtsi | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/dts/r8a77970-eagle.dts b/arch/arm/dts/r8a77970-eagle.dts
index 5b8b2f8704..5dcad63492 100644
--- a/arch/arm/dts/r8a77970-eagle.dts
+++ b/arch/arm/dts/r8a77970-eagle.dts
@@ -39,13 +39,13 @@
phy-handle = <&phy0>;
phy-mode = "rgmii-id";
status = "okay";
-   reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
 
phy0: ethernet-phy@0 {
rxc-skew-ps = <1500>;
reg = <0>;
interrupt-parent = <&gpio1>;
interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
+   reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
};
 };
 
diff --git a/arch/arm/dts/salvator-common.dtsi 
b/arch/arm/dts/salvator-common.dtsi
index 6b176ea36a..514c57b2c8 100644
--- a/arch/arm/dts/salvator-common.dtsi
+++ b/arch/arm/dts/salvator-common.dtsi
@@ -257,7 +257,6 @@
pinctrl-names = "default";
phy-handle = <&phy0>;
phy-mode = "rgmii-txid";
-   reset-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>;
status = "okay";
 
phy0: ethernet-phy@0 {
@@ -265,6 +264,7 @@
reg = <0>;
interrupt-parent = <&gpio2>;
interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+   reset-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>;
};
 };
 
-- 
2.17.1

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


[U-Boot] [PATCH 2/3] net: sh_eth: Support reset GPIO both in mac and phy node

2018-06-17 Thread Marek Vasut
The recent DTs have the PHY reset GPIO in the PHY node rather than
the ethernet MAC node, support extracting the PHY reset GPIO info
from both the PHY node and ethernet MAC node.

Signed-off-by: Marek Vasut 
Cc: Nobuhiro Iwamatsu 
Cc: Joe Hershberger 
---
 drivers/net/sh_eth.c | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index 645cde8e4a..2e1123c488 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -810,6 +810,7 @@ static int sh_ether_probe(struct udevice *udev)
struct eth_pdata *pdata = dev_get_platdata(udev);
struct sh_ether_priv *priv = dev_get_priv(udev);
struct sh_eth_dev *eth = &priv->shdev;
+   struct ofnode_phandle_args phandle_args;
struct mii_dev *mdiodev;
int ret;
 
@@ -819,8 +820,16 @@ static int sh_ether_probe(struct udevice *udev)
if (ret < 0)
return ret;
 
-   gpio_request_by_name(udev, "reset-gpios", 0, &priv->reset_gpio,
-GPIOD_IS_OUT);
+   ret = dev_read_phandle_with_args(udev, "phy-handle", NULL, 0, 0, 
&phandle_args);
+   if (!ret) {
+   gpio_request_by_name_nodev(phandle_args.node, "reset-gpios", 0,
+  &priv->reset_gpio, GPIOD_IS_OUT);
+   }
+
+   if (!dm_gpio_is_valid(&priv->reset_gpio)) {
+   gpio_request_by_name(udev, "reset-gpios", 0, &priv->reset_gpio,
+GPIOD_IS_OUT);
+   }
 
mdiodev = mdio_alloc();
if (!mdiodev) {
-- 
2.17.1

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


[U-Boot] [PATCH 1/3] net: ravb: Support reset GPIO both in mac and phy node

2018-06-17 Thread Marek Vasut
The recent DTs have the PHY reset GPIO in the PHY node rather than
the ethernet MAC node, support extracting the PHY reset GPIO info
from both the PHY node and ethernet MAC node.

Signed-off-by: Marek Vasut 
Cc: Nobuhiro Iwamatsu 
Cc: Joe Hershberger 
---
 drivers/net/ravb.c | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c
index 999894f0f6..d66fcef4e7 100644
--- a/drivers/net/ravb.c
+++ b/drivers/net/ravb.c
@@ -469,6 +469,7 @@ static int ravb_probe(struct udevice *dev)
 {
struct eth_pdata *pdata = dev_get_platdata(dev);
struct ravb_priv *eth = dev_get_priv(dev);
+   struct ofnode_phandle_args phandle_args;
struct mii_dev *mdiodev;
void __iomem *iobase;
int ret;
@@ -480,8 +481,16 @@ static int ravb_probe(struct udevice *dev)
if (ret < 0)
goto err_mdio_alloc;
 
-   gpio_request_by_name(dev, "reset-gpios", 0, ð->reset_gpio,
-GPIOD_IS_OUT);
+   ret = dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0, 
&phandle_args);
+   if (!ret) {
+   gpio_request_by_name_nodev(phandle_args.node, "reset-gpios", 0,
+  ð->reset_gpio, GPIOD_IS_OUT);
+   }
+
+   if (!dm_gpio_is_valid(ð->reset_gpio)) {
+   gpio_request_by_name(dev, "reset-gpios", 0, ð->reset_gpio,
+GPIOD_IS_OUT);
+   }
 
mdiodev = mdio_alloc();
if (!mdiodev) {
-- 
2.17.1

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


Re: [U-Boot] [PATCH] usb: sunxi: ohci: make ohci_t the first member in private data

2018-06-17 Thread Marek Vasut
On 06/17/2018 06:13 PM, Vasily Khoruzhick wrote:
> ohci-hcd casts priv_data pointer to (ohci_t *), thus it must be
> the first member in private data struct.
> 
> Fixes 831cc98b1 ("usb: sunxi: Simplify ccm reg base code")
> 
> Signed-off-by: Vasily Khoruzhick 

Sigh, I really wonder how (or if at all!) the original series was
tested. And then I get flak for scrutinizing patches, right ...

Thanks for the fix, applied.

> ---
>  drivers/usb/host/ohci-sunxi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/ohci-sunxi.c b/drivers/usb/host/ohci-sunxi.c
> index e13f6ec9a4..db6f438275 100644
> --- a/drivers/usb/host/ohci-sunxi.c
> +++ b/drivers/usb/host/ohci-sunxi.c
> @@ -33,9 +33,9 @@ struct ohci_sunxi_cfg {
>  };
>  
>  struct ohci_sunxi_priv {
> + ohci_t ohci;
>   struct sunxi_ccm_reg *ccm;
>   u32 *reset0_cfg;
> - ohci_t ohci;
>   int ahb_gate_mask; /* Mask of ahb_gate0 clk gate bits for this hcd */
>   int usb_gate_mask; /* Mask of usb_clk_cfg clk gate bits for this hcd */
>   struct phy phy;
> 


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


[U-Boot] P4080DS SerDes configuration (and P4080DS memory, mabye?)

2018-06-17 Thread Wolfgang Wegner
Dear QoriQ experts,

I am trying to set up a P4080DS board.
The manual (P4080DSUG.pdf) lists SerDes configurations with Bank 1 lanes
A-H used as PCIe, and Banks 2 and 3 as SGMII (one of them configured as
XAUI would be OK, too - what is important to me is 3 PCI slots and an
SGMII slot).

U-Boot lists valid serdes configurations matching those given in the
processor reference manual P4080RM.pdf (table 3-16 on page 144) in
arch/powerpc/cpu/mpc85xx/p4080_serdes.c where no such configuration is
found - however, the document "PBL Configuration Tool User Guide"
(QCSPBLUG.pdf) by Freescale/NXP implies some more configurations on page
12.

Does anybody know about those other configurations? As I did not find
any reference in the Errata I am not yet convinced to give up on them...

BTW, is a pair of registered DIMMs KVR1333D3D4R9S/8G (DDR3 8GB) supposed
to work in the board with current U-Boot 2018.07-rc1-00165-ga715415bb5?
The memory seems to be detected vorrectly but then the console hangs at
the first "Testing..." line:
[...]
DRAM:  Initializingusing SPD
Detected RDIMM 9965516-001.B00LF
Detected RDIMM 9965516-001.B00LF
14 GiB left unmapped
Testing 0x - 0x7fff

2x4GB unbuffered DIMMs seem to run smooth.

Best regards,
Wolfgang

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


[U-Boot] Q about ARM "boot_mode.h"

2018-06-17 Thread Wis Macomson

On Github:

linux-u-boot/arch/arm/include/asm/arch-rockchip/boot_mode.h

contains these lines 21-26

  #ifndef __ASSEMBLY__
   int setup_boot_mode(void);
  #endif

  int setup_boot_mode(void);

Won't this give multiple definitions of "setup_boot_mode" if __ASSEMBLY__  
is not defined?


-wis

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


Re: [U-Boot] [RFC] ARM: rmobile: create DT memory nodes for R8A7795 3.0 and newer

2018-06-17 Thread Laurent Pinchart
Hi Marek,

On Saturday, 16 June 2018 02:42:30 EEST Marek Vasut wrote:
> On 06/16/2018 01:21 AM, Laurent Pinchart wrote:
> > On Friday, 15 June 2018 15:00:31 EEST Marek Vasut wrote:
> >> On 06/15/2018 01:43 PM, Marek Vasut wrote:
> >>> On 06/15/2018 12:37 PM, Ulrich Hecht wrote:
>  On Fri, Jun 15, 2018 at 12:09 PM, Marek Vasut  wrote:
> >> + arm_smccc_smc(ARM_SMCCC_RENESAS_MEMCONF,
> >> +   0, 0, 0, 0, 0, 0, 0, &res);
> > 
> > Will this call work on platforms without patched ATF ?
> > (I think not, don't you need to handle return value?)
>  
>  I have not actually tested that, but if I understand the ATF code
>  correctly, unimplemented calls return
>  SMC_UNK (0x), which should be handled by the default case (NOP)
>  below.
> >>> 
> >>> Which means the board has a memory size of 0 and fails to boot ?
> >>> 
> >> + switch (res.a0) {
> >> + case 1:
> >> + base[0] = 0x04800ULL;
> >> + size[0] = 0x03800ULL;
> >> + base[1] = 0x5ULL;
> >> + size[1] = 0x04000ULL;
> >> + base[2] = 0x6ULL;
> >> + size[2] = 0x04000ULL;
> >> + base[3] = 0x7ULL;
> >> + size[3] = 0x04000ULL;
> >> + fdt_fixup_memory_banks(blob, base, size, 4);
> >> + break;
> >> + case 2:
> >> + base[0] = 0x04800ULL;
> >> + size[0] = 0x07800ULL;
> >> + base[1] = 0x5ULL;
> >> + size[1] = 0x08000ULL;
> >> + fdt_fixup_memory_banks(blob, base, size, 2);
> >> + break;
> >> + case 3:
> >> + base[0] = 0x04800ULL;
> >> + size[0] = 0x07800ULL;
> >> + base[1] = 0x5ULL;
> >> + size[1] = 0x08000ULL;
> >> + base[2] = 0x6ULL;
> >> + size[2] = 0x08000ULL;
> >> + base[3] = 0x7ULL;
> >> + size[3] = 0x08000ULL;
> >> + fdt_fixup_memory_banks(blob, base, size, 4);
> >> + break;
> > 
> > Obvious design question is -- since you're adding new SMC call anyway,
> > can't the call just return the memory layout table itself, so that it
> > won't be duplicated both in U-Boot and ATF ?
>  
>  My gut feeling was to go with the smallest interface possible.
> >>> 
> >>> But this doesn't scale. The API here uses some ad-hoc constants to
> >>> identify memory layout tables which have to be encoded both in ATF and
> >>> U-Boot, both of which must be kept in sync.
> >>> 
> >>> The ATF already has those memory layout tables, it's only a matter of
> >>> passing them to U-Boot. If you do just that, the ad-hoc constants and
> >>> encoding of tables into U-Boot goes away and in fact simplifies the
> >>> design.
> >>> 
> >>> Yet, I have to wonder if ATF doesn't already contain some sort of
> >>> standard SMC call to get memory topology. It surprises me that it
> >>> wouldn't.
> >> 
> >> In fact, Laurent (CCed) was solving some similar issue with lossy decomp
> >> and I think this involved some passing of memory layout information from
> >> ATF to U-Boot too, or am I mistaken ?
> > 
> > That's correct, ATF stores information about the memory layout at a fixed
> > address in system memory, and U-Boot can read it.
> 
> Well, that sounds good ! Maybe we can avoid adding SMC call altogether
> then? :)

I'd prefer that, yes.

Let's not duplicate the mechanism used to pass FCNL information from ATF to U-
Boot, but instead create a data table format that can store all the 
information we need, in an easily extensible way.

To see how the mechanism is implemented for FCNL, search for 47FD7000 in the 
Renesas ATF sources (git://github.com/renesas-rcar/arm-trusted-firmware.git).

-- 
Regards,

Laurent Pinchart



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


Re: [U-Boot] [PATCH] spi: mxc: Fix compilation problem of DM_SPI class driver

2018-06-17 Thread Michael Nazzareno Trimarchi
Hi

On Sun, Jun 17, 2018 at 8:27 PM, Michael Trimarchi
 wrote:
> drivers/spi/mxc_spi.c:507: undefined reference to `dev_get_addr'
> linux-ld.bfd: BFD (GNU Binutils) 2.29.1 assertion fail elf32-arm.c:9509
>
> Change-Id: I1df196ed847cf06e19d3039bc4461eb8bd928a83

I will repost without change id ;)

> Signed-off-by: Michael Trimarchi 
> ---
>  drivers/spi/mxc_spi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
> index b77129c..fcb214a 100644
> --- a/drivers/spi/mxc_spi.c
> +++ b/drivers/spi/mxc_spi.c
> @@ -504,7 +504,7 @@ static int mxc_spi_probe(struct udevice *bus)
> return -EINVAL;
> }
>
> -   plat->base = dev_get_addr(bus);
> +   plat->base = devfdt_get_addr(bus);
> if (plat->base == FDT_ADDR_T_NONE)
> return -ENODEV;
>
> --
> 2.7.4
>



-- 
| Michael Nazzareno Trimarchi Amarula Solutions BV |
| COO  -  Founder  Cruquiuskade 47 |
| +31(0)851119172 Amsterdam 1018 AM NL |
|  [`as] http://www.amarulasolutions.com   |
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] spi: mxc: Fix compilation problem of DM_SPI class driver

2018-06-17 Thread Michael Trimarchi
drivers/spi/mxc_spi.c:507: undefined reference to `dev_get_addr'
linux-ld.bfd: BFD (GNU Binutils) 2.29.1 assertion fail elf32-arm.c:9509

Change-Id: I1df196ed847cf06e19d3039bc4461eb8bd928a83
Signed-off-by: Michael Trimarchi 
---
 drivers/spi/mxc_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
index b77129c..fcb214a 100644
--- a/drivers/spi/mxc_spi.c
+++ b/drivers/spi/mxc_spi.c
@@ -504,7 +504,7 @@ static int mxc_spi_probe(struct udevice *bus)
return -EINVAL;
}
 
-   plat->base = dev_get_addr(bus);
+   plat->base = devfdt_get_addr(bus);
if (plat->base == FDT_ADDR_T_NONE)
return -ENODEV;
 
-- 
2.7.4

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


[U-Boot] [PATCH] usb: sunxi: ohci: make ohci_t the first member in private data

2018-06-17 Thread Vasily Khoruzhick
ohci-hcd casts priv_data pointer to (ohci_t *), thus it must be
the first member in private data struct.

Fixes 831cc98b1 ("usb: sunxi: Simplify ccm reg base code")

Signed-off-by: Vasily Khoruzhick 
---
 drivers/usb/host/ohci-sunxi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/ohci-sunxi.c b/drivers/usb/host/ohci-sunxi.c
index e13f6ec9a4..db6f438275 100644
--- a/drivers/usb/host/ohci-sunxi.c
+++ b/drivers/usb/host/ohci-sunxi.c
@@ -33,9 +33,9 @@ struct ohci_sunxi_cfg {
 };
 
 struct ohci_sunxi_priv {
+   ohci_t ohci;
struct sunxi_ccm_reg *ccm;
u32 *reset0_cfg;
-   ohci_t ohci;
int ahb_gate_mask; /* Mask of ahb_gate0 clk gate bits for this hcd */
int usb_gate_mask; /* Mask of usb_clk_cfg clk gate bits for this hcd */
struct phy phy;
-- 
2.17.1

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


[U-Boot] [PATCH V2] eth: dm: fec: Add gpio phy reset binding

2018-06-17 Thread Michael Trimarchi
Add the missing gpio phy reset binding to the gpio and
reset time configuration

Signed-off-by: Michael Trimarchi 
---
Changes v1 -> v2:
- fix commit message
- fix timeout property read
---
 drivers/net/fec_mxc.c | 43 +--
 drivers/net/fec_mxc.h |  5 -
 2 files changed, 41 insertions(+), 7 deletions(-)

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 694a0b2..dac07b6 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -15,7 +15,6 @@
 #include 
 #include 
 #include 
-#include "fec_mxc.h"
 
 #include 
 #include 
@@ -24,6 +23,9 @@
 #include 
 #include 
 #include 
+#include 
+
+#include "fec_mxc.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -1245,6 +1247,19 @@ static int fec_phy_init(struct fec_priv *priv, struct 
udevice *dev)
return 0;
 }
 
+#ifdef CONFIG_DM_GPIO
+/* FEC GPIO reset */
+static void fec_gpio_reset(struct fec_priv *priv)
+{
+   debug("fec_gpio_reset: fec_gpio_reset(dev)\n");
+   if (dm_gpio_is_valid(&priv->phy_reset_gpio)) {
+   dm_gpio_set_value(&priv->phy_reset_gpio, 1);
+   udelay(priv->reset_delay);
+   dm_gpio_set_value(&priv->phy_reset_gpio, 0);
+   }
+}
+#endif
+
 static int fecmxc_probe(struct udevice *dev)
 {
struct eth_pdata *pdata = dev_get_platdata(dev);
@@ -1257,6 +1272,9 @@ static int fecmxc_probe(struct udevice *dev)
if (ret)
return ret;
 
+#ifdef CONFIG_DM_GPIO
+   fec_gpio_reset(priv);
+#endif
/* Reset chip. */
writel(readl(&priv->eth->ecntrl) | FEC_ECNTRL_RESET,
   &priv->eth->ecntrl);
@@ -1314,6 +1332,7 @@ static int fecmxc_remove(struct udevice *dev)
 
 static int fecmxc_ofdata_to_platdata(struct udevice *dev)
 {
+   int ret = 0;
struct eth_pdata *pdata = dev_get_platdata(dev);
struct fec_priv *priv = dev_get_priv(dev);
const char *phy_mode;
@@ -1331,12 +1350,24 @@ static int fecmxc_ofdata_to_platdata(struct udevice 
*dev)
return -EINVAL;
}
 
-   /* TODO
-* Need to get the reset-gpio and related properties from DT
-* and implemet the enet reset code on .probe call
-*/
+#ifdef CONFIG_DM_GPIO
+   ret = gpio_request_by_name(dev, "phy-reset-gpios", 0,
+&priv->phy_reset_gpio, GPIOD_IS_OUT);
+   if (ret == 0) {
+   ret = dev_read_u32_array(dev, "phy-reset-duration",
+&priv->reset_delay, 1);
+   } else if (ret == -ENOENT) {
+   priv->reset_delay = 1000;
+   ret = 0;
+   }
 
-   return 0;
+   if (priv->reset_delay > 1000) {
+   printf("FEX MXC: gpio reset timeout should be less the 1000\n");
+   priv->reset_delay = 1000;
+   }
+#endif
+
+   return ret;
 }
 
 static const struct udevice_id fecmxc_ids[] = {
diff --git a/drivers/net/fec_mxc.h b/drivers/net/fec_mxc.h
index 3b935af..fd89443 100644
--- a/drivers/net/fec_mxc.h
+++ b/drivers/net/fec_mxc.h
@@ -250,7 +250,10 @@ struct fec_priv {
int phy_id;
int (*mii_postcall)(int);
 #endif
-
+#ifdef CONFIG_DM_GPIO
+   struct gpio_desc phy_reset_gpio;
+   uint32_t reset_delay;
+#endif
 #ifdef CONFIG_DM_ETH
u32 interface;
 #endif
-- 
2.7.4

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


[U-Boot] Please pull u-boot-x86

2018-06-17 Thread Bin Meng
Hi Tom,

The following changes since commit a715415bb5948c84cc44c601b193188990f7238b:

  Merge branch 'master' of git://git.denx.de/u-boot-usb (2018-06-16
00:07:37 -0400)

are available in the git repository at:

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

for you to fetch changes up to 0102023966558075e52758bd22ffd8f96b093a7e:

  x86: efi: app: Display correct CPU info during boot (2018-06-17
21:16:04 +0800)


Bin Meng (12):
  x86: cherryhill: Fix DTC warning
  x86: doc: Fix reference to EFI doc in U-Boot
  x86: efi: Refactor the directory of EFI app and payload support
  x86: efi: payload: Add arch_cpu_init()
  x86: Add generic EFI payload support
  x86: Drop QEMU-specific EFI payload support
  x86: baytrail: Drop EFI-specific test logics
  efi: stub: Pass EFI GOP information to U-Boot payload
  dm: video: Add an EFI framebuffer driver
  x86: efi: payload: Add EFI framebuffer driver support
  x86: Rename efi-x86 target to efi-x86_app
  x86: efi: app: Display correct CPU info during boot

Ivan Gorinov (1):
  x86: use EFI calling convention for efi_main on x86_64

 arch/x86/Kconfig
|   3 +-
 arch/x86/cpu/Makefile
|   2 +-
 arch/x86/cpu/baytrail/Kconfig
|   6 ++--
 arch/x86/cpu/baytrail/valleyview.c
|   3 --
 arch/x86/{lib => cpu}/efi/Kconfig |   0
 arch/x86/cpu/efi/Makefile
|   9 +-
 arch/x86/cpu/efi/{efi.c => app.c}
|   2 +-
 arch/x86/{lib => cpu}/efi/car.S   |   0
 arch/x86/{lib/efi/efi.c => cpu/efi/payload.c}
|  11 +--
 arch/x86/cpu/intel_common/Makefile
|   2 +-
 arch/x86/cpu/qemu/Makefile
|   2 --
 arch/x86/cpu/qemu/qemu.c
|   4 ---
 arch/x86/dts/Makefile
|   3 +-
 arch/x86/dts/cherryhill.dts
|   2 --
 arch/x86/dts/{efi.dts => efi-x86_app.dts}
|   4 +--
 arch/x86/dts/efi-x86_payload.dts
|  40 +
 arch/x86/lib/Makefile
|   1 -
 arch/x86/lib/crt0_x86_64_efi.S
|  24 ---
 arch/x86/lib/efi/Makefile
|   7 -
 board/advantech/som-db5800-som-6867/Kconfig
|   5 ++--
 board/congatec/conga-qeval20-qa3-e3845/Kconfig
|   5 ++--
 board/dfi/dfi-bt700/Kconfig
|   5 ++--
 board/efi/Kconfig
|  15 --
 board/efi/{efi-x86 => efi-x86_app}/Kconfig
|   6 ++--
 board/efi/{efi-x86 => efi-x86_app}/MAINTAINERS|   0
 board/efi/{efi-x86 => efi-x86_app}/Makefile
|   2 +-
 board/efi/{efi-x86/efi.c => efi-x86_app/app.c}|   0
 board/efi/efi-x86_payload/Kconfig
|  39 
 board/efi/efi-x86_payload/MAINTAINERS
|   7 +
 board/efi/efi-x86_payload/Makefile
|   5 
 board/efi/efi-x86_payload/start.S
|   8 +
 board/emulation/qemu-x86/Kconfig
|   6 ++--
 board/emulation/qemu-x86/MAINTAINERS
|   2 --
 board/intel/minnowmax/Kconfig
|   5 ++--
 configs/{efi-x86_defconfig => efi-x86_app_defconfig}
|   4 +--
 configs/{qemu-x86_efi_payload32_defconfig =>
efi-x86_payload32_defconfig} |  24 ---
 configs/{qemu-x86_efi_payload64_defconfig =>
efi-x86_payload64_defconfig} |  24 ---
 doc/README.u-boot_on_efi
|  33 +---
 doc/README.x86
|  14 -
 drivers/video/Kconfig
|   9 ++
 drivers/video/Makefile
|   1 +
 drivers/video/efi.c
| 146 
+
 include/configs/{efi-x86.h => efi-x86_app.h}  |   0
 include/configs/efi-x86_payload.h
|  32 
 include/efi.h
|  35 ++
 lib/efi/efi_app.c
|   3 +-
 lib/efi/efi_stub.c
|  18 ++-
 47 files changed, 443 insertions(+), 135 deletions(-)
 rename arch/x86/{lib => cpu}/efi/Kconfig (100%)
 rename arch/x86/cpu/efi/{efi.c => app.c} (92%)
 rename arch/x86/{lib => cpu}/efi/car.S (100%)
 rename arch/x86/{lib/efi/efi.c => cpu/efi/payload.c} (97%)
 rename arch/x86/dts/{efi.dts => efi-x86_app.dts} (82%)
 create mode 100644 arch/x86/dts/efi-x86_payload.dts
 delete mode 100644 arch/x86/lib/efi/Makefile
 rename board/efi/{efi-x86 => efi-x86_app}/Kconfig (64%)
 rename board/efi/{efi-x86 => efi-x86_app}/MAINTAINERS (100%)
 rename board/efi/{efi-x86 => efi-x86_app}/Makefile (82%)
 rename board/efi/{efi-x86/efi.c => efi-x86_app/app.c} (100%)
 create mode 100644 board/efi/efi-x86_payload/Kconfig
 create mode 100644 board/efi/efi-x86_payload/MAINTAINERS
 create mode 100644 board/efi/efi-x86_payload/Makefile
 create mode 100644 board/efi/efi-x86_payload/start.S
 rename configs/{efi-x86_defconfig => efi-x86_app_defconfig} (92%)
 rename configs/{qemu-x86_efi_payload32_defconfig =>
efi-x86_payload32_defconfig} (61%)
 rename configs/{qemu-x86_efi_payload64_defconfig =>
efi-x86_payload64_defconfig} (62%)
 create mode 100644 drivers/video/efi.c
 rename include/conf

Re: [U-Boot] [PATCH v2 10/13] dm: video: Add an EFI framebuffer driver

2018-06-17 Thread Bin Meng
On Tue, Jun 12, 2018 at 11:36 PM, Bin Meng  wrote:
> This adds a DM video driver for U-Boot as the EFI payload. The driver
> makes use of all necessary information from the passed EFI GOP info
> to create a linear framebuffer device, as if it were initialized by
> U-Boot itself.
>
> Signed-off-by: Bin Meng 
> Reviewed-by: Anatolij Gustschin 
> ---
>
> Changes in v2: None
>
>  drivers/video/Kconfig  |   9 +++
>  drivers/video/Makefile |   1 +
>  drivers/video/efi.c| 146 
> +
>  3 files changed, 156 insertions(+)
>  create mode 100644 drivers/video/efi.c
>

applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 06/13] x86: Add generic EFI payload support

2018-06-17 Thread Bin Meng
On Tue, Jun 12, 2018 at 11:36 PM, Bin Meng  wrote:
> It is possible to create a generic EFI payload for all x86 boards.
> The payload is configured to include as many generic drivers as
> possible. All stuff that touches low-level initialization are not
> allowed as such is the EFI BIOS's responsibility. Platform specific
> drivers (like gpio, spi, etc) are not included.
>
> Signed-off-by: Bin Meng 
> Reviewed-by: Simon Glass 
>
> ---
>
> Changes in v2:
> - update README.u-boot_on_efi to mention generic EFI payload support
>
>  arch/x86/dts/Makefile |  1 +
>  arch/x86/dts/efi-x86_payload.dts  | 36 +
>  board/efi/Kconfig |  9 +
>  board/efi/efi-x86_payload/Kconfig | 38 
> +++
>  board/efi/efi-x86_payload/MAINTAINERS |  7 +++
>  board/efi/efi-x86_payload/Makefile|  5 +
>  board/efi/efi-x86_payload/start.S |  8 
>  configs/efi-x86_payload32_defconfig   | 35 
>  configs/efi-x86_payload64_defconfig   | 36 +
>  doc/README.u-boot_on_efi  | 19 +-
>  include/configs/efi-x86_payload.h | 32 +
>  11 files changed, 216 insertions(+), 10 deletions(-)
>  create mode 100644 arch/x86/dts/efi-x86_payload.dts
>  create mode 100644 board/efi/efi-x86_payload/Kconfig
>  create mode 100644 board/efi/efi-x86_payload/MAINTAINERS
>  create mode 100644 board/efi/efi-x86_payload/Makefile
>  create mode 100644 board/efi/efi-x86_payload/start.S
>  create mode 100644 configs/efi-x86_payload32_defconfig
>  create mode 100644 configs/efi-x86_payload64_defconfig
>  create mode 100644 include/configs/efi-x86_payload.h
>

applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 08/13] x86: baytrail: Drop EFI-specific test logics

2018-06-17 Thread Bin Meng
On Tue, Jun 12, 2018 at 11:36 PM, Bin Meng  wrote:
> Now that we have generic EFI payload support, drop EFI-specific test
> logics in BayTrail Kconfig and codes, and all BayTrail boards too.
>
> Signed-off-by: Bin Meng 
> Reviewed-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/baytrail/Kconfig  | 6 +++---
>  arch/x86/cpu/baytrail/valleyview.c | 3 ---
>  board/advantech/som-db5800-som-6867/Kconfig| 5 ++---
>  board/congatec/conga-qeval20-qa3-e3845/Kconfig | 5 ++---
>  board/dfi/dfi-bt700/Kconfig| 5 ++---
>  board/intel/minnowmax/Kconfig  | 5 ++---
>  6 files changed, 11 insertions(+), 18 deletions(-)
>

applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 09/13] efi: stub: Pass EFI GOP information to U-Boot payload

2018-06-17 Thread Bin Meng
On Tue, Jun 12, 2018 at 11:36 PM, Bin Meng  wrote:
> If UEFI BIOS has the graphics output protocol (GOP), let's pass its
> information to U-Boot payload so that U-Boot can utilize it (eg:
> an EFI framebuffer driver).
>
> Signed-off-by: Bin Meng 
> Reviewed-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  include/efi.h  | 35 +++
>  lib/efi/efi_stub.c | 15 +++
>  2 files changed, 50 insertions(+)
>

applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 13/13] x86: efi: app: Display correct CPU info during boot

2018-06-17 Thread Bin Meng
On Tue, Jun 12, 2018 at 11:36 PM, Bin Meng  wrote:
> Currently when EFI application boots, it says:
>
>   CPU: x86_64, vendor , device 0h
>
> Fix this by calling x86_cpu_init_f() in arch_cpu_init().
>
> Signed-off-by: Bin Meng 
> Reviewed-by: Simon Glass 
>
> ---
>
> Changes in v2:
> - drop patches that were already applied to u-boot-x86
>
>  arch/x86/cpu/efi/app.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 11/13] x86: efi: payload: Add EFI framebuffer driver support

2018-06-17 Thread Bin Meng
On Tue, Jun 12, 2018 at 11:36 PM, Bin Meng  wrote:
> This turns on the EFI framebuffer driver support so that a graphics
> console can be of additional help.
>
> Signed-off-by: Bin Meng 
> Reviewed-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/dts/efi-x86_payload.dts  | 4 
>  board/efi/efi-x86_payload/Kconfig | 1 +
>  2 files changed, 5 insertions(+)
>

applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 12/13] x86: Rename efi-x86 target to efi-x86_app

2018-06-17 Thread Bin Meng
On Tue, Jun 12, 2018 at 11:36 PM, Bin Meng  wrote:
> To avoid confusion, let's rename the efi-x86 target to efi-x86_app.
>
> Signed-off-by: Bin Meng 
> Reviewed-by: Simon Glass 
>
> ---
>
> Changes in v2:
> - update README.u-boot_on_efi to use efi-x86_app
>
>  arch/x86/cpu/efi/Makefile| 2 +-
>  arch/x86/cpu/efi/{efi.c => app.c}| 0
>  arch/x86/cpu/intel_common/Makefile   | 2 +-
>  arch/x86/dts/Makefile| 2 +-
>  arch/x86/dts/{efi.dts => efi-x86_app.dts}| 4 ++--
>  board/efi/Kconfig| 6 +++---
>  board/efi/{efi-x86 => efi-x86_app}/Kconfig   | 6 +++---
>  board/efi/{efi-x86 => efi-x86_app}/MAINTAINERS   | 0
>  board/efi/{efi-x86 => efi-x86_app}/Makefile  | 2 +-
>  board/efi/{efi-x86/efi.c => efi-x86_app/app.c}   | 0
>  configs/{efi-x86_defconfig => efi-x86_app_defconfig} | 4 ++--
>  doc/README.u-boot_on_efi | 8 
>  include/configs/{efi-x86.h => efi-x86_app.h} | 0
>  13 files changed, 18 insertions(+), 18 deletions(-)
>  rename arch/x86/cpu/efi/{efi.c => app.c} (100%)
>  rename arch/x86/dts/{efi.dts => efi-x86_app.dts} (82%)
>  rename board/efi/{efi-x86 => efi-x86_app}/Kconfig (64%)
>  rename board/efi/{efi-x86 => efi-x86_app}/MAINTAINERS (100%)
>  rename board/efi/{efi-x86 => efi-x86_app}/Makefile (82%)
>  rename board/efi/{efi-x86/efi.c => efi-x86_app/app.c} (100%)
>  rename configs/{efi-x86_defconfig => efi-x86_app_defconfig} (92%)
>  rename include/configs/{efi-x86.h => efi-x86_app.h} (100%)
>

applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 05/13] x86: efi: payload: Add arch_cpu_init()

2018-06-17 Thread Bin Meng
On Tue, Jun 12, 2018 at 11:36 PM, Bin Meng  wrote:
> This adds arch_cpu_init() to the payload codes, in preparation for
> supporting a generic efi payload.
>
> Signed-off-by: Bin Meng 
> Reviewed-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/efi/payload.c | 11 ---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>

applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 04/13] x86: efi: Refactor the directory of EFI app and payload support

2018-06-17 Thread Bin Meng
On Tue, Jun 12, 2018 at 11:36 PM, Bin Meng  wrote:
> At present the EFI application and payload support codes in the x86
> directory is distributed in a hybrid way. For example, the Kconfig
> options for both app and payload are in arch/x86/lib/efi/Kconfig,
> but the source codes in the same directory get built only for
> CONFIG_EFI_STUB.
>
> This refactors the codes by consolidating all the EFI support codes
> into arch/x86/cpu/efi, just like other x86 targets.
>
> Signed-off-by: Bin Meng 
> Reviewed-by: Simon Glass 
>
> ---
>
> Changes in v2:
> - update README.u-boot_on_efi to reflect directory changes
>
>  arch/x86/Kconfig  | 3 +--
>  arch/x86/cpu/Makefile | 2 +-
>  arch/x86/{lib => cpu}/efi/Kconfig | 0
>  arch/x86/cpu/efi/Makefile | 7 +++
>  arch/x86/{lib => cpu}/efi/car.S   | 0
>  arch/x86/{lib/efi/efi.c => cpu/efi/payload.c} | 0
>  arch/x86/lib/Makefile | 1 -
>  arch/x86/lib/efi/Makefile | 7 ---
>  doc/README.u-boot_on_efi  | 6 +-
>  9 files changed, 10 insertions(+), 16 deletions(-)
>  rename arch/x86/{lib => cpu}/efi/Kconfig (100%)
>  rename arch/x86/{lib => cpu}/efi/car.S (100%)
>  rename arch/x86/{lib/efi/efi.c => cpu/efi/payload.c} (100%)
>  delete mode 100644 arch/x86/lib/efi/Makefile
>

applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 07/13] x86: Drop QEMU-specific EFI payload support

2018-06-17 Thread Bin Meng
On Tue, Jun 12, 2018 at 11:36 PM, Bin Meng  wrote:
> Now that we have generic EFI payload support for all x86 boards,
> drop the QEMU-specific one.
>
> Signed-off-by: Bin Meng 
> Reviewed-by: Simon Glass 
>
> ---
>
> Changes in v2:
> - update QEMU MAINTAINERS file to remove defconfig files
>
>  arch/x86/cpu/qemu/Makefile   |  2 --
>  arch/x86/cpu/qemu/qemu.c |  4 ---
>  board/emulation/qemu-x86/Kconfig |  6 ++--
>  board/emulation/qemu-x86/MAINTAINERS |  2 --
>  configs/qemu-x86_efi_payload32_defconfig | 47 ---
>  configs/qemu-x86_efi_payload64_defconfig | 48 
> 
>  6 files changed, 3 insertions(+), 106 deletions(-)
>  delete mode 100644 configs/qemu-x86_efi_payload32_defconfig
>  delete mode 100644 configs/qemu-x86_efi_payload64_defconfig
>

applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 01/13] x86: doc: Fix reference to EFI doc in U-Boot

2018-06-17 Thread Bin Meng
On Tue, Jun 12, 2018 at 11:36 PM, Bin Meng  wrote:
> Since commit f3b5056c4e72 ("efi_loader: split README.efi into two
> separate documents"), the original README.efi was renamed to
> README.u-boot_on_efi, but x86 doc still refers to the old one.
>
> This updates the x86 doc to reference both README.u-boot_on_efi and
> README.uefi.
>
> Signed-off-by: Bin Meng 
> ---
>
> Changes in v2:
> - update the x86 doc to reference also README.uefi
>
>  doc/README.x86 | 14 +++---
>  1 file changed, 7 insertions(+), 7 deletions(-)
>

applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


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

2018-06-17 Thread Tom Rini
On Sat, Jun 16, 2018 at 02:12:30AM +0200, Marek Vasut wrote:

> The following changes since commit 7868909ed53ed41a945f7ed95ebb88aa252142ce:
> 
>   Merge git://git.denx.de/u-boot-fsl-qoriq (2018-06-12 13:25:24 -0400)
> 
> are available in the Git repository at:
> 
>   git://git.denx.de/u-boot-usb.git master
> 
> for you to fetch changes up to b9f34757db5dcde9ccfa6ce35705b025bc4843fc:
> 
>   usb: sunxi: access ahb_reset0_cfg in CCM using its offset (2018-06-14
> 12:57:19 +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


[U-Boot] [PATCH 5/5] x86: efi-x86_payload: Enable usb keyboard during boot

2018-06-17 Thread Bin Meng
For boards that don't route serial port pins out, it's quite common
to attach a USB keyboard as the input device, along with a monitor.
However USB is not automatically started in the generic efi payload
codes. This uses a payload specific last_stage_init() to start the
USB bus, so that a USB keyboard can be used on the U-Boot shell.

Signed-off-by: Bin Meng 
---

 arch/x86/cpu/cpu.c| 2 +-
 arch/x86/cpu/efi/payload.c| 9 +
 include/configs/efi-x86_payload.h | 2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index db36553..6aefa12 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -193,7 +193,7 @@ void show_boot_progress(int val)
outb(val, POST_PORT);
 }
 
-#ifndef CONFIG_SYS_COREBOOT
+#if !defined(CONFIG_SYS_COREBOOT) && !defined(CONFIG_EFI_STUB)
 /*
  * Implement a weak default function for boards that optionally
  * need to clean up the system before jumping to the kernel.
diff --git a/arch/x86/cpu/efi/payload.c b/arch/x86/cpu/efi/payload.c
index 9fd9f57..e3f0f82 100644
--- a/arch/x86/cpu/efi/payload.c
+++ b/arch/x86/cpu/efi/payload.c
@@ -7,6 +7,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -160,3 +161,11 @@ int reserve_arch(void)
 
return 0;
 }
+
+int last_stage_init(void)
+{
+   /* start usb so that usb keyboard can be used as input device */
+   usb_init();
+
+   return 0;
+}
diff --git a/include/configs/efi-x86_payload.h 
b/include/configs/efi-x86_payload.h
index 9c62fd2..1cf5c03 100644
--- a/include/configs/efi-x86_payload.h
+++ b/include/configs/efi-x86_payload.h
@@ -14,7 +14,7 @@
 
 #define CONFIG_SYS_MONITOR_LEN (1 << 20)
 
-#define CONFIG_STD_DEVICES_SETTINGS"stdin=serial,i8042-kbd\0" \
+#define CONFIG_STD_DEVICES_SETTINGS"stdin=serial,i8042-kbd,usbkbd\0" \
"stdout=serial,vidconsole\0" \
"stderr=serial,vidconsole\0"
 
-- 
2.7.4

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


[U-Boot] [PATCH 4/5] x86: efi-x86_payload: Enumerate PCI bus during early boot

2018-06-17 Thread Bin Meng
The generic efi payload currently does not enumerate the PCI bus,
which means peripherals on the PCI bus are not discovered by their
drivers. This uses board_early_init_r() to do the PCI enumeration.

Signed-off-by: Bin Meng 
---

 board/efi/efi-x86_payload/Kconfig   |  1 +
 board/efi/efi-x86_payload/Makefile  |  2 +-
 board/efi/efi-x86_payload/payload.c | 18 ++
 3 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 board/efi/efi-x86_payload/payload.c

diff --git a/board/efi/efi-x86_payload/Kconfig 
b/board/efi/efi-x86_payload/Kconfig
index b6e57b9..08dd0c2 100644
--- a/board/efi/efi-x86_payload/Kconfig
+++ b/board/efi/efi-x86_payload/Kconfig
@@ -17,6 +17,7 @@ config SYS_TEXT_BASE
 
 config BOARD_SPECIFIC_OPTIONS # dummy
def_bool y
+   select BOARD_EARLY_INIT_R
imply SYS_NS16550
imply SCSI
imply SCSI_AHCI
diff --git a/board/efi/efi-x86_payload/Makefile 
b/board/efi/efi-x86_payload/Makefile
index 6982340..00ef695 100644
--- a/board/efi/efi-x86_payload/Makefile
+++ b/board/efi/efi-x86_payload/Makefile
@@ -2,4 +2,4 @@
 #
 # Copyright (C) 2018, Bin Meng 
 
-obj-y  += start.o
+obj-y  += start.o payload.o
diff --git a/board/efi/efi-x86_payload/payload.c 
b/board/efi/efi-x86_payload/payload.c
new file mode 100644
index 000..4eeb49a
--- /dev/null
+++ b/board/efi/efi-x86_payload/payload.c
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018, Bin Meng 
+ */
+
+#include 
+#include 
+
+int board_early_init_r(void)
+{
+   /*
+* Make sure PCI bus is enumerated so that peripherals on the PCI bus
+* can be discovered by their drivers
+*/
+   pci_init();
+
+   return 0;
+}
-- 
2.7.4

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


[U-Boot] [PATCH 3/5] efi: stub: Move the use_uart assignment immediately after exit_boot_services() call

2018-06-17 Thread Bin Meng
The use_uart assignment should follow immediately after the call to
exit_boot_services(), in case we want some debug output after that.

Signed-off-by: Bin Meng 
---

 lib/efi/efi_stub.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/efi/efi_stub.c b/lib/efi/efi_stub.c
index 262fc56..1b495ec 100644
--- a/lib/efi/efi_stub.c
+++ b/lib/efi/efi_stub.c
@@ -361,14 +361,14 @@ efi_status_t EFIAPI efi_main(efi_handle_t image,
}
}
 
+   /* The EFI UART won't work now, switch to a debug one */
+   use_uart = true;
+
map.version = version;
map.desc_size = desc_size;
add_entry_addr(priv, EFIET_MEMORY_MAP, &map, sizeof(map), desc, size);
add_entry_addr(priv, EFIET_END, NULL, 0, 0, 0);
 
-   /* The EFI UART won't work now, switch to a debug one */
-   use_uart = true;
-
memcpy((void *)CONFIG_SYS_TEXT_BASE, _binary_u_boot_bin_start,
   (ulong)_binary_u_boot_bin_end -
   (ulong)_binary_u_boot_bin_start);
-- 
2.7.4

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


[U-Boot] [PATCH 2/5] board_r: Do not initialize IDE when DM BLK is on

2018-06-17 Thread Bin Meng
With driver model philosophy, we should avoid explicitly calling
driver initialization routine during boot. This updates the ram
init sequence table to exclude the IDE initialization for DM BLK.

Signed-off-by: Bin Meng 
---

 common/board_r.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/board_r.c b/common/board_r.c
index 6b29706..6949d4a 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -596,7 +596,7 @@ static int initr_pcmcia(void)
 }
 #endif
 
-#if defined(CONFIG_IDE)
+#if defined(CONFIG_IDE) && !defined(CONFIG_BLK)
 static int initr_ide(void)
 {
puts("IDE:   ");
@@ -826,7 +826,7 @@ static init_fnc_t init_sequence_r[] = {
 #if defined(CONFIG_CMD_PCMCIA) && !defined(CONFIG_IDE)
initr_pcmcia,
 #endif
-#if defined(CONFIG_IDE)
+#if defined(CONFIG_IDE) && !defined(CONFIG_BLK)
initr_ide,
 #endif
 #ifdef CONFIG_LAST_STAGE_INIT
-- 
2.7.4

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


[U-Boot] [PATCH 1/5] x86: qemu: Change default vesa mode to 1024x768x32

2018-06-17 Thread Bin Meng
The default vesa mode was changed since commit 55b4e1b7d999
("x86: Change default FRAMEBUFFER_VESA_MODE of some boards") for
better VxWorks compatibility but with the changes QEMU video console
no longer works. This is because QEMU's vgabios implements the VESA
mode 8:8:8 as 24bpp without an alpha channel, which U-Boot's video
console driver currently does not support yet.

We need change to real 32bpp in order to make it work again. QEMU
vgabios implements the custom 32bpp VESA mode starting from 0x140
(320x200x32) to 0x147 (1600x1200x32). Set it to 0x144 (1024x768x32).

Fixes: 55b4e1b7d999 ("x86: Change default FRAMEBUFFER_VESA_MODE of some boards")
Signed-off-by: Bin Meng 
---

 configs/qemu-x86_64_defconfig | 3 ++-
 configs/qemu-x86_defconfig| 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/configs/qemu-x86_64_defconfig b/configs/qemu-x86_64_defconfig
index d2eb53f..51227f1 100644
--- a/configs/qemu-x86_64_defconfig
+++ b/configs/qemu-x86_64_defconfig
@@ -67,5 +67,6 @@ CONFIG_SPL_TIMER=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
-CONFIG_FRAMEBUFFER_VESA_MODE_112=y
+CONFIG_FRAMEBUFFER_VESA_MODE_USER=y
+CONFIG_FRAMEBUFFER_VESA_MODE=0x144
 CONFIG_CONSOLE_SCROLL_LINES=5
diff --git a/configs/qemu-x86_defconfig b/configs/qemu-x86_defconfig
index f489d52..7144e9c 100644
--- a/configs/qemu-x86_defconfig
+++ b/configs/qemu-x86_defconfig
@@ -47,5 +47,6 @@ CONFIG_SPI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
-CONFIG_FRAMEBUFFER_VESA_MODE_112=y
+CONFIG_FRAMEBUFFER_VESA_MODE_USER=y
+CONFIG_FRAMEBUFFER_VESA_MODE=0x144
 CONFIG_CONSOLE_SCROLL_LINES=5
-- 
2.7.4

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


[U-Boot] [PATCH 1/2] net: mvneta: dcache flush TX descriptors at init

2018-06-17 Thread Baruch Siach
From: Rabeeh Khoury 

This fixes sporadic timeout on initial packet Tx (usually ARP), with an
error message like:

  timeout: packet not sent

Signed-off-by: Rabeeh Khoury 
Signed-off-by: Baruch Siach 
---
 drivers/net/mvneta.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c
index 45e5eda95522..316a72b16517 100644
--- a/drivers/net/mvneta.c
+++ b/drivers/net/mvneta.c
@@ -1702,6 +1702,7 @@ static int mvneta_probe(struct udevice *dev)
 
/* Align buffer area for descs and rx_buffers to 1MiB */
bd_space = memalign(1 << MMU_SECTION_SHIFT, BD_SPACE);
+   flush_dcache_range((ulong)bd_space, (ulong)bd_space+BD_SPACE);
mmu_set_region_dcache_behaviour((phys_addr_t)bd_space, BD_SPACE,
DCACHE_OFF);
buffer_loc.tx_descs = (struct mvneta_tx_desc *)bd_space;
-- 
2.17.1

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


[U-Boot] [PATCH 2/2] net: mvneta: zero Tx descriptors on init

2018-06-17 Thread Baruch Siach
From: Rabeeh Khoury 

Make the initialization sequence consistent with the Linux kernel
driver.

Signed-off-by: Rabeeh Khoury 
Signed-off-by: Baruch Siach 
---
 drivers/net/mvneta.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c
index 316a72b16517..32d02212b66c 100644
--- a/drivers/net/mvneta.c
+++ b/drivers/net/mvneta.c
@@ -1708,6 +1708,7 @@ static int mvneta_probe(struct udevice *dev)
buffer_loc.tx_descs = (struct mvneta_tx_desc *)bd_space;
size = roundup(MVNETA_MAX_TXD * sizeof(struct mvneta_tx_desc),
ARCH_DMA_MINALIGN);
+   memset(buffer_loc.tx_descs, 0, size);
buffer_loc.rx_descs = (struct mvneta_rx_desc *)
((phys_addr_t)bd_space + size);
size += roundup(MVNETA_MAX_RXD * sizeof(struct mvneta_rx_desc),
-- 
2.17.1

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


[U-Boot] [PATCH] eth: dm: fec: Add gpio phy reset binding

2018-06-17 Thread Michael Trimarchi
Add the missing gpio phy reset binding to the gpio and it's
reset time configuration

Signed-off-by: Michael Trimarchi 
---
 drivers/net/fec_mxc.c | 42 --
 drivers/net/fec_mxc.h |  5 -
 2 files changed, 40 insertions(+), 7 deletions(-)

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 694a0b2..9eb2693 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -15,7 +15,6 @@
 #include 
 #include 
 #include 
-#include "fec_mxc.h"
 
 #include 
 #include 
@@ -24,6 +23,9 @@
 #include 
 #include 
 #include 
+#include 
+
+#include "fec_mxc.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -1245,6 +1247,19 @@ static int fec_phy_init(struct fec_priv *priv, struct 
udevice *dev)
return 0;
 }
 
+#ifdef CONFIG_DM_GPIO
+/* FEC GPIO reset */
+static void fec_gpio_reset(struct fec_priv *priv)
+{
+   debug("fec_gpio_reset: fec_gpio_reset(dev)\n");
+   if (dm_gpio_is_valid(&priv->phy_reset_gpio)) {
+   dm_gpio_set_value(&priv->phy_reset_gpio, 1);
+   udelay(priv->reset_delay);
+   dm_gpio_set_value(&priv->phy_reset_gpio, 0);
+   }
+}
+#endif
+
 static int fecmxc_probe(struct udevice *dev)
 {
struct eth_pdata *pdata = dev_get_platdata(dev);
@@ -1257,6 +1272,9 @@ static int fecmxc_probe(struct udevice *dev)
if (ret)
return ret;
 
+#ifdef CONFIG_DM_GPIO
+   fec_gpio_reset(priv);
+#endif
/* Reset chip. */
writel(readl(&priv->eth->ecntrl) | FEC_ECNTRL_RESET,
   &priv->eth->ecntrl);
@@ -1314,6 +1332,7 @@ static int fecmxc_remove(struct udevice *dev)
 
 static int fecmxc_ofdata_to_platdata(struct udevice *dev)
 {
+   int ret = 0;
struct eth_pdata *pdata = dev_get_platdata(dev);
struct fec_priv *priv = dev_get_priv(dev);
const char *phy_mode;
@@ -1331,12 +1350,23 @@ static int fecmxc_ofdata_to_platdata(struct udevice 
*dev)
return -EINVAL;
}
 
-   /* TODO
-* Need to get the reset-gpio and related properties from DT
-* and implemet the enet reset code on .probe call
-*/
+#ifdef CONFIG_DM_GPIO
+   ret = gpio_request_by_name(dev, "phy-reset-gpios", 0,
+&priv->phy_reset_gpio, GPIOD_IS_OUT);
+   if (ret == 0) {
+   ret = dev_read_u32_array(dev, "phy-reset-duration",
+&priv->reset_delay, 1000);
+   } else if (ret == -ENOENT) {
+   ret = 0;
+   }
 
-   return 0;
+   if (priv->reset_delay > 1000) {
+   printf("FEX MXC: gpio reset timeout should be less the 1000\n");
+   priv->reset_delay = 1000;
+   }
+#endif
+
+   return ret;
 }
 
 static const struct udevice_id fecmxc_ids[] = {
diff --git a/drivers/net/fec_mxc.h b/drivers/net/fec_mxc.h
index 3b935af..fd89443 100644
--- a/drivers/net/fec_mxc.h
+++ b/drivers/net/fec_mxc.h
@@ -250,7 +250,10 @@ struct fec_priv {
int phy_id;
int (*mii_postcall)(int);
 #endif
-
+#ifdef CONFIG_DM_GPIO
+   struct gpio_desc phy_reset_gpio;
+   uint32_t reset_delay;
+#endif
 #ifdef CONFIG_DM_ETH
u32 interface;
 #endif
-- 
2.7.4

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


[U-Boot] [PATCH] ARM: dts: rmobile: Move the PHY reset GPIO back

2018-06-17 Thread Marek Vasut
The current state of RAVB driver expects the PHY reset GPIO in the
RAVB mode, move it back from the PHY node to avoid breakage.

Signed-off-by: Marek Vasut 
Cc: Nobuhiro Iwamatsu 
---
 arch/arm/dts/salvator-common.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/dts/salvator-common.dtsi 
b/arch/arm/dts/salvator-common.dtsi
index 514c57b2c8..6b176ea36a 100644
--- a/arch/arm/dts/salvator-common.dtsi
+++ b/arch/arm/dts/salvator-common.dtsi
@@ -257,6 +257,7 @@
pinctrl-names = "default";
phy-handle = <&phy0>;
phy-mode = "rgmii-txid";
+   reset-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>;
status = "okay";
 
phy0: ethernet-phy@0 {
@@ -264,7 +265,6 @@
reg = <0>;
interrupt-parent = <&gpio2>;
interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
-   reset-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>;
};
 };
 
-- 
2.17.1

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