[U-Boot] [PATCH 0/6][v4] Update LS2080A SoC code to support LS2088A SoC

2016-11-17 Thread Priyanka Jain
From: Priyanka Jain 

LS2088A is similar to LS2080A SoC with some differences like
1)Timer controller offset is different
2)It has A72 cores
3)Process to release secondary cores is different
4)LS2088A SoC has TZASC controller

In preparation of using same binary for LS2088A and LS2080A as both
are using same development boards. code is update to detect difference
based on SVR at runtime



Priyanka Jain (6):
  armv8: lsch3: Add generic get_svr() in assembly
  armv8: lsch3: Use SVR based timer base address detection
  armv8: fsl-layerscape: Update TZASC registers type
  armv8: fsl-layerscape : Check SVR for initializing TZASC
  armv8: fsl-layerscape: Add NXP LS2088A SoC support
  armv8/fsl-lsch3: Update code to release secondary cores

 arch/arm/cpu/armv8/fsl-layerscape/cpu.c|   13 -
 arch/arm/cpu/armv8/fsl-layerscape/cpu.h|1 +
 arch/arm/cpu/armv8/fsl-layerscape/doc/README.soc   |   58 +
 arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S   |   50 ++
 arch/arm/cpu/armv8/fsl-layerscape/mp.c |   68 ++-
 arch/arm/cpu/armv8/fsl-layerscape/soc.c|6 +-
 arch/arm/include/asm/arch-fsl-layerscape/config.h  |1 +
 arch/arm/include/asm/arch-fsl-layerscape/cpu.h |4 +
 .../include/asm/arch-fsl-layerscape/immap_lsch3.h  |9 ++-
 arch/arm/include/asm/arch-fsl-layerscape/soc.h |   12 +++-
 board/freescale/ls2080a/MAINTAINERS|2 +-
 board/freescale/ls2080aqds/MAINTAINERS |2 +-
 board/freescale/ls2080aqds/README  |   12 ++--
 board/freescale/ls2080ardb/MAINTAINERS |2 +-
 board/freescale/ls2080ardb/README  |8 +-
 15 files changed, 207 insertions(+), 41 deletions(-)

-- 
Changes for v4:
 update first patch get_svr() change to fix
 compilation issues on non-chassis3 platforms like ls1012a

Changes for v3:
 Add patch for implementing get_svr in assembly
 Update checks in code where svr is compared
 Add comments related to scratchrw[6] register in code

Changes for v2:
 Rename LS2080A_LS2085A_TIMER_ADDR to
 SYS_FSL_LS2080A_LS2085A_TIMER_ADDR in first patch
1.7.4.1

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


[U-Boot] [PATCH] board/ls2080rdb, qds: Enable ddr hashing for controller version 5.2.1

2016-11-17 Thread Priyanka Jain
From: Priyanka Jain 

Enable DDR hashing for DDR performance optimization
on LS2088A which has DDR controller version 5.2.1

Signed-off-by: Priyanka Jain 
---
 board/freescale/ls2080aqds/ddr.c |5 +
 board/freescale/ls2080ardb/ddr.c |5 +
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/board/freescale/ls2080aqds/ddr.c b/board/freescale/ls2080aqds/ddr.c
index 9c6f477..473dd7c 100644
--- a/board/freescale/ls2080aqds/ddr.c
+++ b/board/freescale/ls2080aqds/ddr.c
@@ -8,6 +8,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "ddr.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -134,6 +135,10 @@ found:
/* Enable ZQ calibration */
popts->zq_en = 1;
 
+   /* Enable DDR hashing */
+   if (fsl_ddr_get_version(0) == 0x50201)
+   popts->addr_hash = 1;
+
if (ddr_freq < 2350) {
if (pdimm[0].n_ranks == 2 && pdimm[1].n_ranks == 2) {
/* four chip-selects */
diff --git a/board/freescale/ls2080ardb/ddr.c b/board/freescale/ls2080ardb/ddr.c
index ecd1e71..c9cee50 100644
--- a/board/freescale/ls2080ardb/ddr.c
+++ b/board/freescale/ls2080ardb/ddr.c
@@ -8,6 +8,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "ddr.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -134,6 +135,10 @@ found:
/* Enable ZQ calibration */
popts->zq_en = 1;
 
+   /* Enable DDR hashing */
+   if (fsl_ddr_get_version(0) == 0x50201)
+   popts->addr_hash = 1;
+
if (ddr_freq < 2350) {
if (pdimm[0].n_ranks == 2 && pdimm[1].n_ranks == 2) {
/* four chip-selects */
-- 
1.7.4.1

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


Re: [U-Boot] [PATCH] drivers: net: keystone_net: add rgmii link type support when parsing dt

2016-11-17 Thread Mugunthan V N
Joe

On Tuesday 15 November 2016 09:10 AM, Joe Hershberger wrote:
> This is great, but can you please add this info to a bindings file in
> doc/device-tree-bindings/net/keystone-netcp.txt so that it's less
> magic?

link-interface is already documented in Kernel device tree bindings
(Documentation/devicetree/bindings/net/keystone-netcp.txt), still do we
need to document the same in u-boot as well?

Regards
Mugunthan V N
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot, v8, 4/8] efi_loader: AArch64: Run EFI payloads in EL2 if U-Boot runs in EL3

2016-11-17 Thread Alexander Graf
> Some boards decided not to run ATF or other secure firmware in EL3, so
> they instead run U-Boot there. The uEFI spec doesn't know what EL3 is
> though - it only knows about EL2 and EL1. So if we see that we're running
> in EL3, let's get into EL2 to make payloads happy.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: York Sun 

Thanks, applied to efi-next

Alex

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


Re: [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support

2016-11-17 Thread Alexander Graf

On 11/15/2016 11:11 PM, york sun wrote:

On 11/15/2016 12:36 PM, Alexander Graf wrote:

Hi York,

Do you want to take that patch set?


Yes, I can. I saw it assigned to you in patchwork so I didn't act.


Hm, I've added a few fixups to my efi-next queue to make the ls2080 
patches not break. I think I'll just add them to my queue directly after 
all - that way we don't have dependencies on each other.


I hope that's ok for you.


Alex

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


[U-Boot] [PATCH 4/6][v4] armv8: fsl-layerscape : Check SVR for initializing TZASC

2016-11-17 Thread Priyanka Jain
From: Priyanka Jain 

LS2080 SoC and its personalities does not support TZASC
But other new SoCs like LS2088A, LS1088A supports TZASC

Hence, skip initializing TZASC for Ls2080A based on SVR

Signed-off-by: Priyanka Jain 
---
Changes for v3:
 Update code which checks SVR

 arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S |   13 -
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S 
b/arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S
index ac189d3..f7b49cb 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S
+++ b/arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S
@@ -15,6 +15,7 @@
 #endif
 #ifdef CONFIG_FSL_LSCH3
 #include 
+#include 
 #endif
 
 ENTRY(lowlevel_init)
@@ -140,6 +141,16 @@ ENTRY(lowlevel_init)
 #endif
 
 #ifdef CONFIG_FSL_TZASC_400
+   /*
+* LS2080 and its personalities does not support TZASC
+* So skip TZASC related operations
+*/
+   bl  get_svr
+   lsr w0, w0, #16
+   ldr w1, =SVR_DEV_LS2080A
+   cmp w0, w1
+   b.eq1f
+
/* Set TZASC so that:
 * a. We use only Region0 whose global secure write/read is EN
 * b. We use only Region0 whose NSAID write/read is EN
@@ -182,7 +193,7 @@ ENTRY(lowlevel_init)
isb
dsb sy
 #endif
-
+1:
 #ifdef CONFIG_ARCH_LS1046A
/* Initialize the L2 RAM latency */
mrs   x1, S3_1_c11_c0_2
-- 
1.7.4.1

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


[U-Boot] [PATCH v3 5/6] drivers: usb: gadget: ether: prepare driver for driver model migration

2016-11-17 Thread Mugunthan V N
prepare driver for driver model migration

Signed-off-by: Mugunthan V N 
---
 drivers/usb/gadget/ether.c | 73 +-
 1 file changed, 52 insertions(+), 21 deletions(-)

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 54b8b59b29..046ad8ca2b 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -2334,9 +2334,8 @@ int dm_usb_init(struct eth_dev *e_dev)
 }
 #endif
 
-static int usb_eth_init(struct eth_device *netdev, bd_t *bd)
+static int _usb_eth_init(struct ether_priv *priv)
 {
-   struct ether_priv *priv = (struct ether_priv *)netdev->priv;
struct eth_dev *dev = >ethdev;
struct usb_gadget *gadget;
unsigned long ts;
@@ -2415,11 +2414,10 @@ fail:
return -1;
 }
 
-static int usb_eth_send(struct eth_device *netdev, void *packet, int length)
+static int _usb_eth_send(struct ether_priv *priv, void *packet, int length)
 {
int retval;
void*rndis_pkt = NULL;
-   struct ether_priv   *priv = (struct ether_priv *)netdev->priv;
struct eth_dev  *dev = >ethdev;
struct usb_request  *req = dev->tx_req;
unsigned long ts;
@@ -2485,30 +2483,15 @@ drop:
return -ENOMEM;
 }
 
-static int usb_eth_recv(struct eth_device *netdev)
+static int _usb_eth_recv(struct ether_priv *priv)
 {
-   struct ether_priv *priv = (struct ether_priv *)netdev->priv;
-   struct eth_dev *dev = >ethdev;
-
usb_gadget_handle_interrupts(0);
 
-   if (packet_received) {
-   debug("%s: packet received\n", __func__);
-   if (dev->rx_req) {
-   net_process_received_packet(net_rx_packets[0],
-   dev->rx_req->length);
-   packet_received = 0;
-
-   rx_submit(dev, dev->rx_req, 0);
-   } else
-   error("dev->rx_req invalid");
-   }
return 0;
 }
 
-void usb_eth_halt(struct eth_device *netdev)
+void _usb_eth_halt(struct ether_priv *priv)
 {
-   struct ether_priv *priv = (struct ether_priv *)netdev->priv;
struct eth_dev *dev = >ethdev;
 
/* If the gadget not registered, simple return */
@@ -2544,6 +2527,54 @@ void usb_eth_halt(struct eth_device *netdev)
 #endif
 }
 
+static int usb_eth_init(struct eth_device *netdev, bd_t *bd)
+{
+   struct ether_priv *priv = (struct ether_priv *)netdev->priv;
+
+   return _usb_eth_init(priv);
+}
+
+static int usb_eth_send(struct eth_device *netdev, void *packet, int length)
+{
+   struct ether_priv   *priv = (struct ether_priv *)netdev->priv;
+
+   return _usb_eth_send(priv, packet, length);
+}
+
+static int usb_eth_recv(struct eth_device *netdev)
+{
+   struct ether_priv *priv = (struct ether_priv *)netdev->priv;
+   struct eth_dev *dev = >ethdev;
+   int ret;
+
+   ret = _usb_eth_recv(priv);
+   if (ret) {
+   error("error packet receive\n");
+   return ret;
+   }
+
+   if (!packet_received)
+   return 0;
+
+   if (dev->rx_req) {
+   net_process_received_packet(net_rx_packets[0],
+   dev->rx_req->length);
+   } else {
+   error("dev->rx_req invalid");
+   }
+   packet_received = 0;
+   rx_submit(dev, dev->rx_req, 0);
+
+   return 0;
+}
+
+void usb_eth_halt(struct eth_device *netdev)
+{
+   struct ether_priv *priv = (struct ether_priv *)netdev->priv;
+
+   _usb_eth_halt(priv);
+}
+
 int usb_eth_initialize(bd_t *bi)
 {
struct eth_device *netdev = _priv->netdev;
-- 
2.11.0.rc1

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


[U-Boot] [PATCH v3 08/10] am33xx: board: init usb ether gadget for rndis support

2016-11-17 Thread Mugunthan V N
Add usb ether gadget device with usb_ether_init() when
CONFIG_DM_ETH and CONFIG_USB_ETHER are defined.

Signed-off-by: Mugunthan V N 
Reviewed-by: Tom Rini 
---
 arch/arm/cpu/armv7/am33xx/board.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/cpu/armv7/am33xx/board.c 
b/arch/arm/cpu/armv7/am33xx/board.c
index 245a9575ec..48816c9809 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
@@ -204,6 +204,14 @@ int arch_misc_init(void)
ret = uclass_first_device(UCLASS_MISC, );
if (ret || !dev)
return ret;
+
+#if defined(CONFIG_DM_ETH) && defined(CONFIG_USB_ETHER)
+   ret = usb_ether_init();
+   if (ret) {
+   error("USB ether init failed\n");
+   return ret;
+   }
+#endif
 #endif
return 0;
 }
-- 
2.11.0.rc1

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


[U-Boot] [PATCH v3 09/10] am335x_evm: enable usb ether gadget as it supports DM_ETH

2016-11-17 Thread Mugunthan V N
Since usb ether gadget have support for driver model, so enable
usb ether gadget.

Signed-off-by: Mugunthan V N 
Reviewed-by: Tom Rini 
---
 include/configs/am335x_evm.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 8e62248c73..91e02de91f 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -301,12 +301,9 @@
 #endif
 
 #ifdef CONFIG_USB_MUSB_GADGET
-/* Removing USB gadget and can be enabled adter adding support usb DM */
-#ifndef CONFIG_DM_ETH
 #define CONFIG_USB_ETHER
 #define CONFIG_USB_ETH_RNDIS
 #define CONFIG_USBNET_HOST_ADDR"de:ad:be:af:00:00"
-#endif /* CONFIG_DM_ETH */
 #endif /* CONFIG_USB_MUSB_GADGET */
 
 /*
-- 
2.11.0.rc1

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


[U-Boot] [PATCH v3 10/10] defconfig: am335x_evm: enable usb driver model

2016-11-17 Thread Mugunthan V N
enable usb driver model for am335x bbb as musb supports
driver model

Signed-off-by: Mugunthan V N 
---
 configs/am335x_evm_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
index e5a1696914..7e1cf3213e 100644
--- a/configs/am335x_evm_defconfig
+++ b/configs/am335x_evm_defconfig
@@ -60,3 +60,6 @@ CONFIG_G_DNL_VENDOR_NUM=0x0451
 CONFIG_G_DNL_PRODUCT_NUM=0xd022
 CONFIG_RSA=y
 CONFIG_SPL_OF_LIBFDT=y
+CONFIG_MISC=y
+CONFIG_DM_USB=y
+CONFIG_USB_MUSB_TI=y
-- 
2.11.0.rc1

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


Re: [U-Boot] [PATCH] sunxi: mmc: Set CONFIG_SYS_MMC_MAX_DEVICE

2016-11-17 Thread Jaehoon Chung
On 11/14/2016 03:48 AM, Hans de Goede wrote:
> Hi,
> 
> On 05-11-16 20:51, Emmanuel Vadot wrote:
>> Set CONFIG_SYS_MMC_MAX_DEVICE to 4 for sunxi SoC.
>> This define is needed in the API code.
>>
>> Signed-off-by: Emmanuel Vadot 
> 
> LGTM:
> 
> Reviewed-by: Hans de Goede 

Acked-by: Jaehoon Chung 

Best Regards,
Jaehoon Chung

> 
> Regards,
> 
> Hans
> 
> 
>> ---
>>  include/configs/sunxi-common.h | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
>> index 8363414..edb3ff7 100644
>> --- a/include/configs/sunxi-common.h
>> +++ b/include/configs/sunxi-common.h
>> @@ -145,6 +145,7 @@
>>  #define CONFIG_MMC_SUNXI_SLOT0
>>  #define CONFIG_ENV_IS_IN_MMC
>>  #define CONFIG_SYS_MMC_ENV_DEV0/* first detected MMC controller 
>> */
>> +#define CONFIG_SYS_MMC_MAX_DEVICE4
>>  #endif
>>
>>  /* 64MB of malloc() pool */
>>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
> 
> 
> 

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


[U-Boot] [PATCH v3 01/10] configs: am335x: usb: do not define CONFIG_DM_USB for spl

2016-11-17 Thread Mugunthan V N
Since OMAP's spl doesn't support DM currently, do not define
CONFIG_DM_USB for spl build.

Signed-off-by: Mugunthan V N 
Reviewed-by: Tom Rini 
---
 include/configs/am335x_evm.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index ec70b72970..8e62248c73 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -316,6 +316,7 @@
 #ifdef CONFIG_SPL_BUILD
 #undef CONFIG_DM_MMC
 #undef CONFIG_TIMER
+#undef CONFIG_DM_USB
 #endif
 
 #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT)
-- 
2.11.0.rc1

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


[U-Boot] [PATCH v3 07/10] drivers: usb: musb: add ti musb peripheral driver with driver model support

2016-11-17 Thread Mugunthan V N
Add a TI MUSB peripheral driver with driver model support and the
driver will be bound by the MUSB wrapper driver based on the
dr_mode device tree entry.

Signed-off-by: Mugunthan V N 
Reviewed-by: Simon Glass 
---
 drivers/usb/musb-new/musb_uboot.c |   2 +
 drivers/usb/musb-new/ti-musb.c| 109 ++
 2 files changed, 111 insertions(+)

diff --git a/drivers/usb/musb-new/musb_uboot.c 
b/drivers/usb/musb-new/musb_uboot.c
index ea71f75947..46e3faeeaa 100644
--- a/drivers/usb/musb-new/musb_uboot.c
+++ b/drivers/usb/musb-new/musb_uboot.c
@@ -373,6 +373,7 @@ struct dm_usb_ops musb_usb_ops = {
 #endif /* CONFIG_DM_USB */
 #endif /* CONFIG_USB_MUSB_HOST */
 
+#ifndef CONFIG_DM_USB
 #ifdef CONFIG_USB_MUSB_GADGET
 static struct musb *gadget;
 
@@ -453,3 +454,4 @@ int musb_register(struct musb_hdrc_platform_data *plat, 
void *bdata,
 
return 0;
 }
+#endif /* CONFIG_DM_USB */
diff --git a/drivers/usb/musb-new/ti-musb.c b/drivers/usb/musb-new/ti-musb.c
index 1c15aa2a42..b8abc1dc58 100644
--- a/drivers/usb/musb-new/ti-musb.c
+++ b/drivers/usb/musb-new/ti-musb.c
@@ -14,6 +14,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include "musb_uboot.h"
@@ -142,6 +143,106 @@ static int ti_musb_ofdata_to_platdata(struct udevice *dev)
return 0;
 }
 
+static struct musb *gadget;
+
+int usb_gadget_handle_interrupts(int index)
+{
+   WATCHDOG_RESET();
+   if (!gadget || !gadget->isr)
+   return -EINVAL;
+
+   return gadget->isr(0, gadget);
+}
+
+int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+{
+   int ret;
+
+   if (!driver || driver->speed < USB_SPEED_FULL || !driver->bind ||
+   !driver->setup) {
+   printf("Bad parameter.\n");
+   return -EINVAL;
+   }
+
+   if (!gadget) {
+   printf("Controller uninitialized\n");
+   return -ENXIO;
+   }
+
+   ret = musb_gadget_start(>g, driver);
+   if (ret < 0)
+   return ret;
+
+   ret = driver->bind(>g);
+   if (ret < 0)
+   return ret;
+
+   return 0;
+}
+
+int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
+{
+   if (driver->disconnect)
+   driver->disconnect(>g);
+   if (driver->unbind)
+   driver->unbind(>g);
+   return 0;
+}
+
+static int ti_musb_peripheral_usb_probe(struct udevice *dev)
+{
+   struct ti_musb_platdata *platdata = dev_get_platdata(dev);
+   struct usb_bus_priv *priv = dev_get_uclass_priv(dev);
+   struct omap_musb_board_data *otg_board_data;
+
+   otg_board_data = >otg_board_data;
+
+   gadget = musb_init_controller(>plat,
+ (struct device *)otg_board_data,
+ platdata->base);
+   if (!gadget) {
+   error("gadget init failed\n");
+   return -EIO;
+   }
+
+   return 0;
+}
+
+static int ti_musb_peripheral_remove(struct udevice *dev)
+{
+   musb_stop(gadget);
+
+   return 0;
+}
+
+static int ti_musb_peripheral_ofdata_to_platdata(struct udevice *dev)
+{
+   struct ti_musb_platdata *platdata = dev_get_platdata(dev);
+   const void *fdt = gd->fdt_blob;
+   int node = dev->of_offset;
+   int ret;
+
+   ret = ti_musb_ofdata_to_platdata(dev);
+   if (ret) {
+   error("platdata dt parse error\n");
+   return ret;
+   }
+
+   platdata->plat.mode = MUSB_PERIPHERAL;
+
+   return 0;
+}
+
+U_BOOT_DRIVER(ti_musb_peripheral) = {
+   .name   = "ti-musb-peripheral",
+   .id = UCLASS_USB_DEV_GENERIC,
+   .ofdata_to_platdata = ti_musb_peripheral_ofdata_to_platdata,
+   .probe = ti_musb_peripheral_usb_probe,
+   .remove = ti_musb_peripheral_remove,
+   .platdata_auto_alloc_size = sizeof(struct ti_musb_platdata),
+   .priv_auto_alloc_size = sizeof(struct musb),
+};
+
 static int ti_musb_host_probe(struct udevice *dev)
 {
struct musb_host_data *host = dev_get_priv(dev);
@@ -222,7 +323,15 @@ static int ti_musb_wrapper_bind(struct udevice *parent)
dr_mode = usb_get_dr_mode(node);
switch (dr_mode) {
case USB_DR_MODE_PERIPHERAL:
+   case USB_DR_MODE_OTG:
/* Bind MUSB device */
+   ret = device_bind_driver_to_node(parent,
+"ti-musb-peripheral",
+name, node, );
+   if (ret) {
+   error("musb - not able to bind usb device 
node\n");
+   return ret;
+   }
break;
case USB_DR_MODE_HOST:
/* Bind MUSB host */
-- 
2.11.0.rc1

___
U-Boot mailing list

[U-Boot] [PATCH v3 06/10] drivers: usb: musb: add ti musb host driver with driver model support

2016-11-17 Thread Mugunthan V N
Add a TI MUSB host driver with driver model support and the
driver will be bound by the MUSB wrapper driver based on the
dr_mode device tree entry.

Signed-off-by: Mugunthan V N 
Reviewed-by: Tom Rini 
---
 drivers/usb/musb-new/ti-musb.c | 191 +
 1 file changed, 191 insertions(+)

diff --git a/drivers/usb/musb-new/ti-musb.c b/drivers/usb/musb-new/ti-musb.c
index cf0e296bd0..1c15aa2a42 100644
--- a/drivers/usb/musb-new/ti-musb.c
+++ b/drivers/usb/musb-new/ti-musb.c
@@ -14,10 +14,195 @@
 #include 
 #include 
 
+#include 
+#include 
+#include "musb_uboot.h"
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_DM_USB
 
+/* USB 2.0 PHY Control */
+#define CM_PHY_PWRDN   (1 << 0)
+#define CM_PHY_OTG_PWRDN   (1 << 1)
+#define OTGVDET_EN (1 << 19)
+#define OTGSESSENDEN   (1 << 20)
+
+#define AM335X_USB1_CTRL   0x8
+
+struct ti_musb_platdata {
+   void *base;
+   void *ctrl_mod_base;
+   struct musb_hdrc_platform_data plat;
+   struct musb_hdrc_config musb_config;
+   struct omap_musb_board_data otg_board_data;
+};
+
+static int ti_musb_get_usb_index(int node)
+{
+   const void *fdt = gd->fdt_blob;
+   int i = 0;
+   char path[64];
+   const char *alias_path;
+   char alias[16];
+
+   fdt_get_path(fdt, node, path, sizeof(path));
+
+   do {
+   snprintf(alias, sizeof(alias), "usb%d", i);
+   alias_path = fdt_get_alias(fdt, alias);
+   if (alias_path == NULL) {
+   debug("USB index not found\n");
+   return -ENOENT;
+   }
+
+   if (!strcmp(path, alias_path))
+   return i;
+
+   i++;
+   } while (alias_path);
+
+   return -ENOENT;
+}
+
+static void ti_musb_set_phy_power(struct udevice *dev, u8 on)
+{
+   struct ti_musb_platdata *platdata = dev_get_platdata(dev);
+
+   if (on) {
+   clrsetbits_le32(platdata->ctrl_mod_base,
+   CM_PHY_PWRDN | CM_PHY_OTG_PWRDN,
+   OTGVDET_EN | OTGSESSENDEN);
+   } else {
+   clrsetbits_le32(platdata->ctrl_mod_base, 0,
+   CM_PHY_PWRDN | CM_PHY_OTG_PWRDN);
+   }
+}
+
+static int ti_musb_ofdata_to_platdata(struct udevice *dev)
+{
+   struct ti_musb_platdata *platdata = dev_get_platdata(dev);
+   const void *fdt = gd->fdt_blob;
+   int node = dev->of_offset;
+   int phys;
+   int ctrl_mod;
+   int usb_index;
+
+   platdata->base = (void *)dev_get_addr_index(dev, 1);
+
+   phys = fdtdec_lookup_phandle(fdt, node, "phys");
+   ctrl_mod = fdtdec_lookup_phandle(fdt, phys, "ti,ctrl_mod");
+   platdata->ctrl_mod_base = (void *)fdtdec_get_addr(fdt, ctrl_mod, "reg");
+   usb_index = ti_musb_get_usb_index(node);
+   switch (usb_index) {
+   case 1:
+   platdata->ctrl_mod_base += AM335X_USB1_CTRL;
+   case 0:
+   default:
+   break;
+   }
+
+   platdata->musb_config.multipoint = fdtdec_get_int(fdt, node,
+ "mentor,multipoint",
+ -1);
+   if (platdata->musb_config.multipoint < 0) {
+   error("MUSB multipoint DT entry missing\n");
+   return -ENOENT;
+   }
+
+   platdata->musb_config.dyn_fifo = 1;
+
+   platdata->musb_config.num_eps = fdtdec_get_int(fdt, node,
+  "mentor,num-eps", -1);
+   if (platdata->musb_config.num_eps < 0) {
+   error("MUSB num-eps DT entry missing\n");
+   return -ENOENT;
+   }
+
+   platdata->musb_config.ram_bits = fdtdec_get_int(fdt, node,
+   "mentor,ram-bits", -1);
+   if (platdata->musb_config.ram_bits < 0) {
+   error("MUSB ram-bits DT entry missing\n");
+   return -ENOENT;
+   }
+
+   platdata->otg_board_data.set_phy_power = ti_musb_set_phy_power;
+   platdata->otg_board_data.dev = dev;
+   platdata->plat.config = >musb_config;
+
+   platdata->plat.power = fdtdec_get_int(fdt, node, "mentor,power", -1);
+   if (platdata->plat.power < 0) {
+   error("MUSB mentor,power DT entry missing\n");
+   return -ENOENT;
+   }
+
+   platdata->plat.platform_ops = _dsps_ops;
+   platdata->plat.board_data = >otg_board_data;
+
+   return 0;
+}
+
+static int ti_musb_host_probe(struct udevice *dev)
+{
+   struct musb_host_data *host = dev_get_priv(dev);
+   struct ti_musb_platdata *platdata = dev_get_platdata(dev);
+   struct usb_bus_priv *priv = dev_get_uclass_priv(dev);
+   struct omap_musb_board_data *otg_board_data;
+   int ret;
+
+   

[U-Boot] [PATCH v3 04/10] am33xx: board: probe misc drivers to register musb devices

2016-11-17 Thread Mugunthan V N
MUSB wrapper driver is bound as MISC device and underlying usb
devices are bind to usb drivers based on dr_mode, so probing the
MISC wrapper driver to register musb devices.

Signed-off-by: Mugunthan V N 
Reviewed-by: Tom Rini 
---
 arch/arm/cpu/armv7/am33xx/board.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/cpu/armv7/am33xx/board.c 
b/arch/arm/cpu/armv7/am33xx/board.c
index fd4235e526..c3f50e9733 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
@@ -197,6 +197,13 @@ int arch_misc_init(void)
musb_register(_plat, _board_data,
(void *)USB1_OTG_BASE);
 #endif
+#else
+   struct udevice *dev;
+   int ret;
+
+   ret = uclass_first_device(UCLASS_MISC, );
+   if (ret || !dev)
+   return ret;
 #endif
return 0;
 }
-- 
2.11.0.rc1

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


[U-Boot] [PATCH v3 02/10] am33xx: board: do not register usb devices when CONFIG_DM_USB is defined

2016-11-17 Thread Mugunthan V N
Do not register usb devices when CONFIG_DM_USB is define.

Signed-off-by: Mugunthan V N 
Reviewed-by: Tom Rini 
---
 arch/arm/cpu/armv7/am33xx/board.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/am33xx/board.c 
b/arch/arm/cpu/armv7/am33xx/board.c
index 68badedd14..fd4235e526 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
@@ -120,7 +120,8 @@ int cpu_mmc_init(bd_t *bis)
 
 /* AM33XX has two MUSB controllers which can be host or gadget */
 #if (defined(CONFIG_USB_MUSB_GADGET) || defined(CONFIG_USB_MUSB_HOST)) && \
-   (defined(CONFIG_AM335X_USB0) || defined(CONFIG_AM335X_USB1))
+   (defined(CONFIG_AM335X_USB0) || defined(CONFIG_AM335X_USB1)) && \
+   (!defined(CONFIG_DM_USB))
 static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
 
 /* USB 2.0 PHY Control */
@@ -187,6 +188,7 @@ static struct musb_hdrc_platform_data otg1_plat = {
 
 int arch_misc_init(void)
 {
+#ifndef CONFIG_DM_USB
 #ifdef CONFIG_AM335X_USB0
musb_register(_plat, _board_data,
(void *)USB0_OTG_BASE);
@@ -195,6 +197,7 @@ int arch_misc_init(void)
musb_register(_plat, _board_data,
(void *)USB1_OTG_BASE);
 #endif
+#endif
return 0;
 }
 
-- 
2.11.0.rc1

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


[U-Boot] [PATCH v3 05/10] drivers: usb: musb: adopt musb backend driver to driver model

2016-11-17 Thread Mugunthan V N
Currently all backend driver ops uses hard coded physical
address, so to adopt the driver to DM, add device pointer to ops
call backs so that drivers can get physical addresses from the
usb driver priv/plat data.

Signed-off-by: Mugunthan V N 
Reviewed-by: Tom Rini 
---
 arch/arm/cpu/armv7/am33xx/board.c  |  4 ++--
 arch/arm/cpu/armv7/omap3/am35x_musb.c  |  6 +++---
 arch/arm/include/asm/arch-omap3/musb.h |  6 +++---
 arch/arm/include/asm/omap_musb.h   |  7 ---
 drivers/usb/musb-new/am35x.c   | 14 +++---
 drivers/usb/musb-new/musb_dsps.c   |  8 
 6 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/arch/arm/cpu/armv7/am33xx/board.c 
b/arch/arm/cpu/armv7/am33xx/board.c
index c3f50e9733..245a9575ec 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
@@ -148,7 +148,7 @@ static struct musb_hdrc_config musb_config = {
 };
 
 #ifdef CONFIG_AM335X_USB0
-static void am33xx_otg0_set_phy_power(u8 on)
+static void am33xx_otg0_set_phy_power(struct udevice *dev, u8 on)
 {
am33xx_usb_set_phy_power(on, >usb_ctrl0);
 }
@@ -167,7 +167,7 @@ static struct musb_hdrc_platform_data otg0_plat = {
 #endif
 
 #ifdef CONFIG_AM335X_USB1
-static void am33xx_otg1_set_phy_power(u8 on)
+static void am33xx_otg1_set_phy_power(struct udevice *dev, u8 on)
 {
am33xx_usb_set_phy_power(on, >usb_ctrl1);
 }
diff --git a/arch/arm/cpu/armv7/omap3/am35x_musb.c 
b/arch/arm/cpu/armv7/omap3/am35x_musb.c
index 74dd105eb6..d542699ab0 100644
--- a/arch/arm/cpu/armv7/omap3/am35x_musb.c
+++ b/arch/arm/cpu/armv7/omap3/am35x_musb.c
@@ -13,7 +13,7 @@
 #include 
 #include 
 
-void am35x_musb_reset(void)
+void am35x_musb_reset(struct udevice *dev)
 {
/* Reset the musb interface */
clrsetbits_le32(_scm_general_regs->ip_sw_reset,
@@ -22,7 +22,7 @@ void am35x_musb_reset(void)
USBOTGSS_SW_RST, 0);
 }
 
-void am35x_musb_phy_power(u8 on)
+void am35x_musb_phy_power(struct udevice *dev, u8 on)
 {
unsigned long start = get_timer(0);
 
@@ -53,7 +53,7 @@ void am35x_musb_phy_power(u8 on)
}
 }
 
-void am35x_musb_clear_irq(void)
+void am35x_musb_clear_irq(struct udevice *dev)
 {
clrsetbits_le32(_scm_general_regs->lvl_intr_clr,
0, USBOTGSS_INT_CLR);
diff --git a/arch/arm/include/asm/arch-omap3/musb.h 
b/arch/arm/include/asm/arch-omap3/musb.h
index cee4ed311e..d06a758f1b 100644
--- a/arch/arm/include/asm/arch-omap3/musb.h
+++ b/arch/arm/include/asm/arch-omap3/musb.h
@@ -7,7 +7,7 @@
 
 #ifndef __ASM_ARCH_OMAP3_MUSB_H
 #define __ASM_ARCH_OMAP3_MUSB_H
-extern void am35x_musb_reset(void);
-extern void am35x_musb_phy_power(u8 on);
-extern void am35x_musb_clear_irq(void);
+void am35x_musb_reset(struct udevice *dev);
+void am35x_musb_phy_power(struct udevice *dev, u8 on);
+void am35x_musb_clear_irq(struct udevice *dev);
 #endif
diff --git a/arch/arm/include/asm/omap_musb.h b/arch/arm/include/asm/omap_musb.h
index 8b9cb0eb8f..7c5fb40774 100644
--- a/arch/arm/include/asm/omap_musb.h
+++ b/arch/arm/include/asm/omap_musb.h
@@ -15,9 +15,10 @@ extern const struct musb_platform_ops omap2430_ops;
 
 struct omap_musb_board_data {
u8 interface_type;
-   void (*set_phy_power)(u8 on);
-   void (*clear_irq)(void);
-   void (*reset)(void);
+   struct udevice *dev;
+   void (*set_phy_power)(struct udevice *dev, u8 on);
+   void (*clear_irq)(struct udevice *dev);
+   void (*reset)(struct udevice *dev);
 };
 
 enum musb_interface{MUSB_INTERFACE_ULPI, MUSB_INTERFACE_UTMI};
diff --git a/drivers/usb/musb-new/am35x.c b/drivers/usb/musb-new/am35x.c
index b8791ddd5c..0167ea7797 100644
--- a/drivers/usb/musb-new/am35x.c
+++ b/drivers/usb/musb-new/am35x.c
@@ -336,7 +336,7 @@ eoi:
if (ret == IRQ_HANDLED || epintr || usbintr) {
/* clear level interrupt */
if (data->clear_irq)
-   data->clear_irq();
+   data->clear_irq(data->dev);
/* write EOI */
musb_writel(reg_base, USB_END_OF_INTR_REG, 0);
}
@@ -401,14 +401,14 @@ static int am35x_musb_init(struct musb *musb)
 
/* Reset the musb */
if (data->reset)
-   data->reset();
+   data->reset(data->dev);
 
/* Reset the controller */
musb_writel(reg_base, USB_CTRL_REG, AM35X_SOFT_RESET_MASK);
 
/* Start the on-chip PHY and its PLL. */
if (data->set_phy_power)
-   data->set_phy_power(1);
+   data->set_phy_power(data->dev, 1);
 
msleep(5);
 
@@ -416,7 +416,7 @@ static int am35x_musb_init(struct musb *musb)
 
/* clear level interrupt */
if (data->clear_irq)
-   data->clear_irq();
+   data->clear_irq(data->dev);
 
return 0;
 }
@@ -439,7 +439,7 @@ static int am35x_musb_exit(struct musb *musb)
 
/* Shutdown the on-chip PHY and its 

Re: [U-Boot] [PATCH] spl: mmc: fix build without CONFIG_SPL_LIBCOMMON_SUPPORT

2016-11-17 Thread Jaehoon Chung
Hi,

On 11/14/2016 06:46 AM, Yann E. MORIN wrote:
> When CONFIG_SPL_LIBCOMMON_SUPPORT is disabled, the last case statement
> is missing a proper statement, which makes the compiler whine.
> 
> Signed-off-by: "Yann E. MORIN" 
> Cc: Pantelis Antoniou 
> ---
>  common/spl/spl_mmc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
> index c674e61..cc81d19 100644
> --- a/common/spl/spl_mmc.c
> +++ b/common/spl/spl_mmc.c
> @@ -343,6 +343,7 @@ static int spl_mmc_load_image(struct spl_image_info 
> *spl_image,
>  
>   break;
>   case MMCSD_MODE_UNDEFINED:
> + ;
>  #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>   default:
>   puts("spl: mmc: wrong boot mode\n");

case MMCSD_MODE_UNDEFINED:
 ...
#ifdef CONFIG_
default:
put()
#endif
break; 


How about adding "break"?

Best Regards,
Jaehoon Chung

> 

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


[U-Boot] [PATCH v3 1/6] drivers: usb: gadget: ether: adopt to usb driver model

2016-11-17 Thread Mugunthan V N
Convert usb ether gadget to adopt usb driver model

Signed-off-by: Mugunthan V N 
Reviewed-by: Simon Glass 
---
 drivers/usb/gadget/ether.c | 36 
 1 file changed, 36 insertions(+)

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 497b981129..9bc61186cf 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -24,6 +24,10 @@
 #include "gadget_chips.h"
 #include "rndis.h"
 
+#include 
+#include 
+#include 
+
 #define USB_NET_NAME "usb_ether"
 
 #define atomic_read
@@ -101,6 +105,9 @@ struct eth_dev {
struct usb_gadget   *gadget;
struct usb_request  *req;   /* for control responses */
struct usb_request  *stat_req;  /* for cdc & rndis status */
+#ifdef CONFIG_DM_USB
+   struct udevice  *usb_udev;
+#endif
 
u8  config;
struct usb_ep   *in_ep, *out_ep, *status_ep;
@@ -2303,6 +2310,24 @@ fail:
 
 /*-*/
 
+#ifdef CONFIG_DM_USB
+int dm_usb_init(struct eth_dev *e_dev)
+{
+   struct udevice *dev = NULL;
+   int ret;
+
+   ret = uclass_first_device(UCLASS_USB_DEV_GENERIC, );
+   if (!dev || ret) {
+   error("No USB device found\n");
+   return -ENODEV;
+   }
+
+   e_dev->usb_udev = dev;
+
+   return ret;
+}
+#endif
+
 static int usb_eth_init(struct eth_device *netdev, bd_t *bd)
 {
struct eth_dev *dev = _ethdev;
@@ -2315,7 +2340,14 @@ static int usb_eth_init(struct eth_device *netdev, bd_t 
*bd)
goto fail;
}
 
+#ifdef CONFIG_DM_USB
+   if (dm_usb_init(dev)) {
+   error("USB ether not found\n");
+   return -ENODEV;
+   }
+#else
board_usb_init(0, USB_INIT_DEVICE);
+#endif
 
/* Configure default mac-addresses for the USB ethernet device */
 #ifdef CONFIG_USBNET_DEV_ADDR
@@ -2497,7 +2529,11 @@ void usb_eth_halt(struct eth_device *netdev)
}
 
usb_gadget_unregister_driver(_driver);
+#ifdef CONFIG_DM_USB
+   device_remove(dev->usb_udev);
+#else
board_usb_cleanup(0, USB_INIT_DEVICE);
+#endif
 }
 
 static struct usb_gadget_driver eth_driver = {
-- 
2.11.0.rc1

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


[U-Boot] [PATCH v3 03/10] drivers: usb: musb: add ti musb misc driver for wrapper

2016-11-17 Thread Mugunthan V N
Add a misc driver for MUSB wrapper, so that based on dr_mode the
USB devices can bind to USB host or USB device drivers.

Signed-off-by: Mugunthan V N 
Reviewed-by: Tom Rini 
---
 drivers/usb/musb-new/Kconfig   |  9 ++
 drivers/usb/musb-new/Makefile  |  1 +
 drivers/usb/musb-new/ti-musb.c | 64 ++
 3 files changed, 74 insertions(+)
 create mode 100644 drivers/usb/musb-new/ti-musb.c

diff --git a/drivers/usb/musb-new/Kconfig b/drivers/usb/musb-new/Kconfig
index c264859b6c..caba42c26f 100644
--- a/drivers/usb/musb-new/Kconfig
+++ b/drivers/usb/musb-new/Kconfig
@@ -14,6 +14,15 @@ config USB_MUSB_GADGET
help
  Enables the MUSB USB dual-role controller in gadget mode.
 
+config USB_MUSB_TI
+   bool "Enable TI OTG USB controller"
+   depends on DM_USB
+   default n
+   help
+ Say y here to enable support for the dual role high
+ speed USB controller based on the Mentor Graphics
+ silicon IP.
+
 if USB_MUSB_HOST || USB_MUSB_GADGET
 
 config USB_MUSB_PIC32
diff --git a/drivers/usb/musb-new/Makefile b/drivers/usb/musb-new/Makefile
index df1c3c8a45..296f230fbf 100644
--- a/drivers/usb/musb-new/Makefile
+++ b/drivers/usb/musb-new/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_USB_MUSB_AM35X) += am35x.o
 obj-$(CONFIG_USB_MUSB_OMAP2PLUS) += omap2430.o
 obj-$(CONFIG_USB_MUSB_PIC32) += pic32.o
 obj-$(CONFIG_USB_MUSB_SUNXI) += sunxi.o
+obj-$(CONFIG_USB_MUSB_TI) += ti-musb.o
 
 ccflags-y := $(call cc-option,-Wno-unused-variable) \
$(call cc-option,-Wno-unused-but-set-variable) \
diff --git a/drivers/usb/musb-new/ti-musb.c b/drivers/usb/musb-new/ti-musb.c
new file mode 100644
index 00..cf0e296bd0
--- /dev/null
+++ b/drivers/usb/musb-new/ti-musb.c
@@ -0,0 +1,64 @@
+/*
+ * MISC driver for TI MUSB Glue.
+ *
+ * (C) Copyright 2016
+ * Texas Instruments Incorporated, 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#ifdef CONFIG_DM_USB
+
+static int ti_musb_wrapper_bind(struct udevice *parent)
+{
+   const void *fdt = gd->fdt_blob;
+   int node;
+   int ret;
+
+   for (node = fdt_first_subnode(fdt, parent->of_offset); node > 0;
+node = fdt_next_subnode(fdt, node)) {
+   struct udevice *dev;
+   const char *name = fdt_get_name(fdt, node, NULL);
+   enum usb_dr_mode dr_mode;
+   struct driver *drv;
+
+   if (strncmp(name, "usb@", 4))
+   continue;
+
+   dr_mode = usb_get_dr_mode(node);
+   switch (dr_mode) {
+   case USB_DR_MODE_PERIPHERAL:
+   /* Bind MUSB device */
+   break;
+   case USB_DR_MODE_HOST:
+   /* Bind MUSB host */
+   break;
+   default:
+   break;
+   };
+   }
+   return 0;
+}
+
+static const struct udevice_id ti_musb_ids[] = {
+   { .compatible = "ti,am33xx-usb" },
+   { }
+};
+
+U_BOOT_DRIVER(ti_musb_wrapper) = {
+   .name   = "ti-musb-wrapper",
+   .id = UCLASS_MISC,
+   .of_match = ti_musb_ids,
+   .bind = ti_musb_wrapper_bind,
+};
+
+#endif /* CONFIG_DM_USB */
-- 
2.11.0.rc1

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


[U-Boot] [PATCH v3 00/10] driver model bring-up of musb on AM335x GP and BBB

2016-11-17 Thread Mugunthan V N
This patch series enables musb driver to adopt driver model. This
has been tested on the following evms (logs [1]) by loading
kernel and dtbs from usb mass storage (host) and usb rndis mode (device).
* AM335x GP evm
* AM335x BBB

Also pushed a branch for testing [2]

This patch series depends on the following patch series
* usb ether gadget DM conversion [4]

Changes from v2:
* Removed from non-useful error logs.
* Since defconfig is merged into single defconfig for all
  TI AM335x platforms, rebased those patches as well.

Changes from initial version:
* Separated out the usb gadget driver patches from earlier musb
  series [3] for testing and submitting of dwc3 dm musb patches.
* passed an dummy dev pointer for non-DM case as well for
  reducing the number of #ifdefs in musb backend driver.

[1] - http://pastebin.ubuntu.com/23489333/
[2] - git://git.ti.com/~mugunthanvnm/ti-u-boot/mugunth-ti-u-boot.git dm-musb-v3
[3] - http://lists.denx.de/pipermail/u-boot/2016-February/246827.html
[4] - http://lists.denx.de/pipermail/u-boot/2016-November/273037.html

Note:
~
The following checkpatch warning can be ignore as splitting the
line will break grep during debug session.
WARNING: line over 80 characters
#224: FILE: drivers/usb/musb-new/ti-musb.c:232:
+   error("musb - not able to bind usb host 
node\n");

total: 0 errors, 1 warnings, 0 checks, 207 lines checked

NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX 
MULTISTATEMENT_MACRO_USE_DO_WHILE NETWORKING_BLOCK_COMMENT_STYLE 
PREFER_ETHER_ADDR_COPY USLEEP_RANGE

../dm-musb/patches/musb/v3.00/0006-drivers-usb-musb-add-ti-musb-host-driver-with-driver.patch
 has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
WARNING: line over 80 characters
#164: FILE: drivers/usb/musb-new/ti-musb.c:332:
+   error("musb - not able to bind usb device 
node\n");

total: 0 errors, 1 warnings, 0 checks, 139 lines checked

NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX 
MULTISTATEMENT_MACRO_USE_DO_WHILE NETWORKING_BLOCK_COMMENT_STYLE 
PREFER_ETHER_ADDR_COPY USLEEP_RANGE

../dm-musb/patches/musb/v3.00/0007-drivers-usb-musb-add-ti-musb-peripheral-driver-with-.patch
 has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 0 warnings, 0 checks, 14 lines checked

Mugunthan V N (10):
  configs: am335x: usb: do not define CONFIG_DM_USB for spl
  am33xx: board: do not register usb devices when CONFIG_DM_USB is
defined
  drivers: usb: musb: add ti musb misc driver for wrapper
  am33xx: board: probe misc drivers to register musb devices
  drivers: usb: musb: adopt musb backend driver to driver model
  drivers: usb: musb: add ti musb host driver with driver model support
  drivers: usb: musb: add ti musb peripheral driver with driver model
support
  am33xx: board: init usb ether gadget for rndis support
  am335x_evm: enable usb ether gadget as it supports DM_ETH
  defconfig: am335x_evm: enable usb driver model

 arch/arm/cpu/armv7/am33xx/board.c  |  24 ++-
 arch/arm/cpu/armv7/omap3/am35x_musb.c  |   6 +-
 arch/arm/include/asm/arch-omap3/musb.h |   6 +-
 arch/arm/include/asm/omap_musb.h   |   7 +-
 configs/am335x_evm_defconfig   |   3 +
 drivers/usb/musb-new/Kconfig   |   9 +
 drivers/usb/musb-new/Makefile  |   1 +
 drivers/usb/musb-new/am35x.c   |  14 +-
 drivers/usb/musb-new/musb_dsps.c   |   8 +-
 drivers/usb/musb-new/musb_uboot.c  |   2 +
 drivers/usb/musb-new/ti-musb.c | 364 +
 include/configs/am335x_evm.h   |   4 +-
 12 files changed, 422 insertions(+), 26 deletions(-)
 create mode 100644 drivers/usb/musb-new/ti-musb.c

-- 
2.11.0.rc1

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


Re: [U-Boot] 2016.09+fslc was working... But not anymore

2016-11-17 Thread Fabio Estevam
Hi Carlos,

On Wed, Nov 16, 2016 at 4:57 PM, Carlos Alberto Musich Cuevas
 wrote:
> Hello,
>
> The following sequence is causing the error below.
>
> Please note that few days ago it was working.
>
>
>
> SEQUENCE
>
> $ cd ~/
> $ git clone 
> https://github.com/Freescale/u-boot-fslc.git
>  uboot2016
> $ cd uboot2016
> $ git checkout -b 2016.09+fslc remotes/origin/2016.09+fslc
> $ make udoo_defconfig
> $ make
>
> ERROR
>
> lib/asm-offsets.c:1:0: error: bad value (armv5) for -march= switch
>
>  /*
>
>  ^
>
> make[1]: *** [lib/asm-offsets.s] Error 1
>
> make: *** [prepare0] Error 2

The U-Boot community does not maintain this repository. You should
report the error to meta-fsl-arm mailing list.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 6/6][v4] armv8/fsl-lsch3: Update code to release secondary cores

2016-11-17 Thread Priyanka Jain
From: Priyanka Jain 

NXP ARMv8 SoC LS2080A release all secondary cores in one-go.
But other new SoCs like LS2088A, LS1088A release secondary
cores one by one.

Update code to release secondary cores based on SoC SVR
Add code to release cores one by one for non LS2080A SoCs

Signed-off-by: Priyanka Jain 
Signed-off-by: Raghav Dogra 
Signed-off-by: Prabhakar Kushwaha 
---
Changes for v3:
 Add comments related to scratchrw[6] register

 arch/arm/cpu/armv8/fsl-layerscape/cpu.c |2 +-
 arch/arm/cpu/armv8/fsl-layerscape/cpu.h |1 +
 arch/arm/cpu/armv8/fsl-layerscape/mp.c  |   68 +--
 3 files changed, 66 insertions(+), 5 deletions(-)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c 
b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
index 6d8316f..7bc6213 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
@@ -190,7 +190,7 @@ void enable_caches(void)
 }
 #endif
 
-static inline u32 initiator_type(u32 cluster, int init_id)
+inline u32 initiator_type(u32 cluster, int init_id)
 {
struct ccsr_gur *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
u32 idx = (cluster >> (init_id * 8)) & TP_CLUSTER_INIT_MASK;
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.h 
b/arch/arm/cpu/armv8/fsl-layerscape/cpu.h
index 8072f3c..a05f8aa 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.h
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.h
@@ -5,4 +5,5 @@
  */
 
 int fsl_qoriq_core_to_cluster(unsigned int core);
+u32 initiator_type(u32 cluster, int init_id);
 u32 cpu_mask(void);
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/mp.c 
b/arch/arm/cpu/armv8/fsl-layerscape/mp.c
index f607c39..97c6269 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/mp.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/mp.c
@@ -9,6 +9,8 @@
 #include 
 #include 
 #include 
+#include "cpu.h"
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -22,11 +24,39 @@ phys_addr_t determine_mp_bootpg(void)
return (phys_addr_t)_boot_code;
 }
 
+#ifdef CONFIG_FSL_LSCH3
+void wake_secondary_core_n(int cluster, int core, int cluster_cores)
+{
+   struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
+   struct ccsr_reset __iomem *rst = (void *)(CONFIG_SYS_FSL_RST_ADDR);
+   u32 mpidr = 0;
+
+   mpidr = ((cluster << 8) | core);
+   /*
+* mpidr_el1 register value of core which needs to be released
+* is written to scratchrw[6] register
+*/
+   gur_out32(>scratchrw[6], mpidr);
+   asm volatile("dsb st" : : : "memory");
+   rst->brrl |= 1 << ((cluster * cluster_cores) + core);
+   asm volatile("dsb st" : : : "memory");
+   /*
+* scratchrw[6] register value is polled
+* when the value becomes zero, this means that this core is up
+* and running, next core can be released now
+*/
+   while (gur_in32(>scratchrw[6]) != 0)
+   ;
+}
+#endif
+
 int fsl_layerscape_wake_seconday_cores(void)
 {
struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
 #ifdef CONFIG_FSL_LSCH3
struct ccsr_reset __iomem *rst = (void *)(CONFIG_SYS_FSL_RST_ADDR);
+   u32 svr, ver, cluster, type;
+   int j = 0, cluster_cores = 0;
 #elif defined(CONFIG_FSL_LSCH2)
struct ccsr_scfg __iomem *scfg = (void *)(CONFIG_SYS_FSL_SCFG_ADDR);
 #endif
@@ -55,10 +85,40 @@ int fsl_layerscape_wake_seconday_cores(void)
 #ifdef CONFIG_FSL_LSCH3
gur_out32(>bootlocptrh, (u32)(gd->relocaddr >> 32));
gur_out32(>bootlocptrl, (u32)gd->relocaddr);
-   gur_out32(>scratchrw[6], 1);
-   asm volatile("dsb st" : : : "memory");
-   rst->brrl = cores;
-   asm volatile("dsb st" : : : "memory");
+
+   svr = gur_in32(>svr);
+   ver = SVR_SOC_VER(svr);
+   if (ver == SVR_LS2080A || ver == SVR_LS2085A) {
+   gur_out32(>scratchrw[6], 1);
+   asm volatile("dsb st" : : : "memory");
+   rst->brrl = cores;
+   asm volatile("dsb st" : : : "memory");
+   } else {
+   /*
+* Release the cores out of reset one-at-a-time to avoid
+* power spikes
+*/
+   i = 0;
+   cluster = in_le32(>tp_cluster[i].lower);
+   for (j = 0; j < TP_INIT_PER_CLUSTER; j++) {
+   type = initiator_type(cluster, j);
+   if (type &&
+   TP_ITYP_TYPE(type) == TP_ITYP_TYPE_ARM)
+   cluster_cores++;
+   }
+
+   do {
+   cluster = in_le32(>tp_cluster[i].lower);
+   for (j = 0; j < TP_INIT_PER_CLUSTER; j++) {
+   type = initiator_type(cluster, j);
+   if (type &&
+   TP_ITYP_TYPE(type) == TP_ITYP_TYPE_ARM)
+   

Re: [U-Boot] [U-Boot, v8, 2/8] efi_loader: Fix efi_add_runtime_mmio definition

2016-11-17 Thread Alexander Graf
> The efi_add_runtime_mmio prototype for disabled CONFIG_EFI_LOADER
> was different from the enabled one. Sync them.
> 
> Signed-off-by: Alexander Graf 

Thanks, applied to efi-next

Alex

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


Re: [U-Boot] [U-Boot, v8, 1/8] efi_loader: Disable PSCI reset for ls1043 and ls1046

2016-11-17 Thread Alexander Graf
> The NXP ls1043 and ls1046 systems do not (yet) have PSCI enablement
> for reset. Don't enable generic PSCI reset code on them.
> 
> Signed-off-by: Alexander Graf 

Thanks, applied to efi-next

Alex

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


Re: [U-Boot] [PATCH] imx: iomux-v3: provide MX7D_PAD_ENET1_RX_CLK__ENET1_RGMII_RXC

2016-11-17 Thread Stefano Babic
Hi Sebastian,

On 16/11/2016 21:02, Sebastian Andrzej Siewior wrote:
> MX7D_PAD_ENET1_RX_CLK__ENET1_RX_CLK is in its currently RGMII_RXC.
> Fix this by providing RX_CLK with properly setting the DAISY value and
> MX7D_PAD_ENET1_RX_CLK__ENET1_RGMII_RXC which did the "previous" setting.
> There should be no fallout because there no in tree users of
> MX7D_PAD_ENET1_RX_CLK__ENET1_RX_CLK.
> 

Right - I do not see any use case, and we do not break any board.

> Signed-off-by: Sebastian Andrzej Siewior 
> ---
>  arch/arm/dts/imx7d-pinfunc.h  | 3 ++-
>  arch/arm/include/asm/arch-mx7/mx7d_pins.h | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/dts/imx7d-pinfunc.h b/arch/arm/dts/imx7d-pinfunc.h
> index 32d2464b417d..7bc1dee0f7ff 100644
> --- a/arch/arm/dts/imx7d-pinfunc.h
> +++ b/arch/arm/dts/imx7d-pinfunc.h
> @@ -1123,7 +1123,8 @@
>  #define MX7D_PAD_ENET1_TX_CLK__GPIO7_IO12 0x025C 
> 0x04CC 0x 0x5 0x0
>  #define MX7D_PAD_ENET1_TX_CLK__CCM_EXT_CLK1   0x025C 
> 0x04CC 0x04E4 0x6 0x2
>  #define MX7D_PAD_ENET1_TX_CLK__CSU_ALARM_AUT0 0x025C 
> 0x04CC 0x 0x7 0x0
> -#define MX7D_PAD_ENET1_RX_CLK__ENET1_RX_CLK   0x0260 
> 0x04D0 0x056C 0x0 0x0
> +#define MX7D_PAD_ENET1_RX_CLK__ENET1_RGMII_RXC0x0260 
> 0x04D0 0x056C 0x0 0x0
> +#define MX7D_PAD_ENET1_RX_CLK__ENET1_RX_CLK   0x0260 
> 0x04D0 0x056C 0x0 0x1
>  #define MX7D_PAD_ENET1_RX_CLK__WDOG2_WDOG_B   0x0260 
> 0x04D0 0x 0x1 0x0
>  #define MX7D_PAD_ENET1_RX_CLK__SAI1_TX_BCLK   0x0260 
> 0x04D0 0x06A8 0x2 0x1
>  #define MX7D_PAD_ENET1_RX_CLK__GPT2_CLK   0x0260 
> 0x04D0 0x 0x3 0x0
> diff --git a/arch/arm/include/asm/arch-mx7/mx7d_pins.h 
> b/arch/arm/include/asm/arch-mx7/mx7d_pins.h
> index 0ab1246de852..55375f5aa0dc 100644
> --- a/arch/arm/include/asm/arch-mx7/mx7d_pins.h
> +++ b/arch/arm/include/asm/arch-mx7/mx7d_pins.h
> @@ -1278,7 +1278,8 @@ enum {
>   MX7D_PAD_ENET1_TX_CLK__CCM_EXT_CLK1  = 
> IOMUX_PAD(0x04CC, 0x025C, 6, 0x04E4, 2, 0),
>   MX7D_PAD_ENET1_TX_CLK__CSU_ALARM_AUT0= 
> IOMUX_PAD(0x04CC, 0x025C, 7, 0x, 0, 0),
>  
> - MX7D_PAD_ENET1_RX_CLK__ENET1_RX_CLK  = 
> IOMUX_PAD(0x04D0, 0x0260, 0, 0x056C, 0, 0),
> + MX7D_PAD_ENET1_RX_CLK__ENET1_RGMII_RXC   = 
> IOMUX_PAD(0x04D0, 0x0260, 0, 0x056C, 0, 0),
> + MX7D_PAD_ENET1_RX_CLK__ENET1_RX_CLK  = 
> IOMUX_PAD(0x04D0, 0x0260, 0, 0x056C, 1, 0),
>   MX7D_PAD_ENET1_RX_CLK__WDOG2_WDOG_B  = 
> IOMUX_PAD(0x04D0, 0x0260, 1, 0x, 0, 0),
>   MX7D_PAD_ENET1_RX_CLK__SAI1_TX_BCLK  = 
> IOMUX_PAD(0x04D0, 0x0260, 2, 0x06A8, 1, 0),
>   MX7D_PAD_ENET1_RX_CLK__GPT2_CLK  = 
> IOMUX_PAD(0x04D0, 0x0260, 3, 0x, 0, 0),
> 

Acked-by: Stefano Babic 

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot,v8,5/8] ls2080ardb: Reserve DP-DDR RAM

2016-11-17 Thread Alexander Graf
> The DP-DDR shouldn't be exposed as conventional memory to an OS, so let's
> rather claim it's a reserved region in the EFI memory map
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: York Sun 

Thanks, applied to efi-next

Alex

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


Re: [U-Boot] [U-Boot, v8, 7/8] armv8: fsl-layerscape: Add support for efi_loader RTS reset

2016-11-17 Thread Alexander Graf
> When implementing efi loader support, we can expose runtime services
> for payloads. One such service is CPU reset.
> 
> This patch implements RTS CPU reset support for layerscape systems.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: York Sun 

Thanks, applied to efi-next

Alex

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


Re: [U-Boot] [U-Boot, v8, 6/8] armv8: ls2080a: Declare spin tables as reserved for efi loader

2016-11-17 Thread Alexander Graf
> The efi loader code has its own memory map, so it needs to be aware where
> the spin tables are located, to ensure that no code writes into those
> regions.
> 
> Signed-off-by: Alexander Graf 

Thanks, applied to efi-next

Alex

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


Re: [U-Boot] [U-Boot, v8, 3/8] ls2080: Exit dpaa only right before exiting U-Boot

2016-11-17 Thread Alexander Graf
> On ls2080 we have a separate network fabric component which we need to
> shut down before we enter Linux (or any other OS). Along with that also
> comes configuration of the fabric using a description file.
> 
> Today we always stop and configure the fabric in the boot script and
> (again) exit it on device tree generation. This works ok for the normal
> booti case, but with bootefi the payload we're running may still want to
> access the network.
> 
> So let's add a new fsl_mc command that defers configuration and stopping
> the hardware to when we actually exit U-Boot, so that we can still use
> the fabric from an EFI payload.
> 
> For existing boot scripts, nothing should change with this patch.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: York Sun 

Thanks, applied to efi-next

Alex

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


Re: [U-Boot] [PATCH] tools: imximage: display DCD block offset, length

2016-11-17 Thread Gary Bisson
Hi Eric, All,

On Wed, Nov 16, 2016 at 05:13:41PM -0700, Eric Nelson wrote:
> These values can be used to sign a U-Boot image for use when
> loading an image through the Serial Download Protocol (SDP).
> 
> Note that the address of 0x91 is usable with the stock
> configuration of imx_usb_loader on i.MX6 and i.MX7 SOCs:
> 
> https://github.com/boundarydevices/imx_usb_loader/blob/master/mx6_usb_work.conf#L3
> 
> Refer to the section on imx_usb_loader in this post for more
> details:
> 
> https://boundarydevices.com/high-assurance-boot-hab-dummies/
> 
> Signed-off-by: Eric Nelson 

Thanks, indeed such patch would ease the life of anybody that needs to
deal with HAB when creating the CSF files.

> ---
>  tools/imximage.c | 10 +-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/imximage.c b/tools/imximage.c
> index c9e42ec..2cd8d88 100644
> --- a/tools/imximage.c
> +++ b/tools/imximage.c
> @@ -281,7 +281,6 @@ static void set_dcd_rst_v2(struct imx_header *imxhdr, 
> uint32_t dcd_len,
>   d = (struct dcd_v2_cmd *)(((char *)d) + len);
>  
>   len = (char *)d - (char *)_v2->header;
> -

Is this part of the patch intended?

>   dcd_v2->header.tag = DCD_HEADER_TAG;
>   dcd_v2->header.length = cpu_to_be16(len);
>   dcd_v2->header.version = DCD_VERSION;
> @@ -501,10 +500,19 @@ static void print_hdr_v2(struct imx_header *imx_hdr)
>   printf("Entry Point:  %08x\n", (uint32_t)fhdr_v2->entry);
>   if (fhdr_v2->csf && (imximage_ivt_offset != UNDEFINED) &&
>   (imximage_csf_size != UNDEFINED)) {
> + uint16_t dcdlen;
> + int offs;
> +
> + dcdlen = hdr_v2->data.dcd_table.header.length;
> + offs = (char *)_v2->data.dcd_table
> + - (char *)hdr_v2;
> +
>   printf("HAB Blocks:   %08x %08x %08x\n",
>  (uint32_t)fhdr_v2->self, 0,

This isn't part of the patch, but why is self cast into a uint32_t
although it's already a uint32_t?

>  hdr_v2->boot_data.size - imximage_ivt_offset -
>  imximage_csf_size);
> + printf("DCD Blocks:   0091 %08x %08x\n",
> +offs, be16_to_cpu(dcdlen));
>   }

Not sure if "DCD Blocks" is the best naming, cause it really just
applies to SDP protocol.

This got me thinking and I think the printf above should also show the
Blocks for encryption which is also missing right now.

What about something like the snippet below?

if (fhdr_v2->csf && (imximage_ivt_offset != UNDEFINED) &&
(imximage_csf_size != UNDEFINED)) {
uint16_t dcdlen;
uint32_t dcdoff;
uint32_t entryoff;

dcdlen = hdr_v2->data.dcd_table.header.length;
dcdoff = (char *)_v2->data.dcd_table
- (char *)hdr_v2;
entryoff = fhdr_v2->entry - fhdr_v2->self;

printf("[HAB][Signature]\n");
printf("Blocks:   %08x %08x %08x\n",
   (uint32_t)fhdr_v2->self, 0,
   hdr_v2->boot_data.size - imximage_ivt_offset -
   imximage_csf_size);
printf("[HAB][Encryption]\n");
printf("Blocks:   %08x %08x %08x\n",
   fhdr_v2->self, 0, dcdoff + be16_to_cpu(dcdlen));
printf("Blocks:   %08x %08x %08x\n",
   fhdr_v2->entry, entryoff,
   hdr_v2->boot_data.size - imximage_ivt_offset -
   imximage_csf_size - entryoff);
printf("[HAB][SDP]\n");
printf("Blocks:   0091 %08x %08x\n",
   dcdoff, be16_to_cpu(dcdlen));
}

Regards,
Gary
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] mmc: add bkops-enable command

2016-11-17 Thread Tomas Melin
Hi,

Thank you for your valuable comments and for taking the time to respond.
Please see below for further comments.

On 11/16/2016 03:39 PM, Jaehoon Chung wrote:
>  
> On 11/16/2016 10:12 PM, Tomas Melin wrote:
>> Hi,
>>
>> On 11/16/2016 02:05 PM, Jaehoon Chung wrote:
>>>
>>> Why needs to set bkops on bootloader? Is there special reason?
>>> And Linux kernel has already discussed about this.
>>>
>> It is beneficial to be able to do all required eMMC settings without being 
>> dependent on Linux booting.
>> It saves time in production to do initial eMMC setup directly from 
>> bootloader.
>>
>>> I don't want to provide this command on u-boot side.
>>> Don't handle Onetime programmable register on u-boot. So NACK.
>>
>> U-Boot already provides One-time programmable commands such as hwpartition 
>> and rst-function.
>> This adds to that same palette of commands that are needed when properly 
>> configuring an eMMC device. 
> 
> hwpartition and rst-function didn't affect the performance. And it's not 
> critical thing.
> But BKOPS needs to consider too many things. 
> Just even set to enable bit..it's not working.

Sorry, but I don't see how this patch affects performance? This only adds a 
command (mmc bkops enable) that gives the user 
a _possibility_ to enable bkops in the eMMC. The choise whether or not to 
enable bkops is still left to the user.

> 
> Did you check the periodic bkops and auto bkops? And is it working correct?
> How to control suspend and Idle state? LEVEL2/3?
> 
> When i had tested the bkops, it has affected IO performance...Of course, it 
> should be maintained average.
> Because it should be doing GC with bkops. That is not reason that has to 
> enable on bootloader.

The reason to have this command in U-Boot is to be able to do _all_ 
configuration settings for the eMMC 
during manufacturing, prior to flashing the device. Thus, all settings are done 
only once from U-Boot.
In normal operation, the OS driver will be responsible for bkops handling.

BR,
Tomas

> 
> I will not apply on u-boot-mmc for bkops. There is no benefit.
> 
> If you set to enable bkops, then you did to pass the other controlling 
> responsibility to Kernel. 
> 
> Best Regards,
> Jaehoon Chung
> 
>>
>> One possible option going forward could be putting all eMMC-configure 
>> related commands behind a common CONFIG_ option.
>>
>> BR,
>> Tomas
>>
>>
>>>

 Signed-off-by: Tomas Melin 
 ---
  cmd/mmc.c | 26 ++
  drivers/mmc/mmc.c | 30 ++
  include/mmc.h |  4 
  3 files changed, 60 insertions(+)

 diff --git a/cmd/mmc.c b/cmd/mmc.c
 index b2761e9..3ae9682 100644
 --- a/cmd/mmc.c
 +++ b/cmd/mmc.c
 @@ -729,6 +729,29 @@ static int do_mmc_setdsr(cmd_tbl_t *cmdtp, int flag,
return ret;
  }
  
 +static int do_mmc_bkops_enable(cmd_tbl_t *cmdtp, int flag,
 + int argc, char * const argv[])
 +{
 +  int dev;
 +  struct mmc *mmc;
 +
 +  if (argc != 2)
 +  return CMD_RET_USAGE;
 +
 +  dev = simple_strtoul(argv[1], NULL, 10);
 +
 +  mmc = init_mmc_device(dev, false);
 +  if (!mmc)
 +  return CMD_RET_FAILURE;
 +
 +  if (IS_SD(mmc)) {
 +  puts("BKOPS_EN only exists on eMMC\n");
 +  return CMD_RET_FAILURE;
 +  }
 +
 +  return mmc_set_bkops_enable(mmc);
 +}
 +
  static cmd_tbl_t cmd_mmc[] = {
U_BOOT_CMD_MKENT(info, 1, 0, do_mmcinfo, "", ""),
U_BOOT_CMD_MKENT(read, 4, 1, do_mmc_read, "", ""),
 @@ -749,6 +772,7 @@ static cmd_tbl_t cmd_mmc[] = {
U_BOOT_CMD_MKENT(rpmb, CONFIG_SYS_MAXARGS, 1, do_mmcrpmb, "", ""),
  #endif
U_BOOT_CMD_MKENT(setdsr, 2, 0, do_mmc_setdsr, "", ""),
 +  U_BOOT_CMD_MKENT(bkops-enable, 2, 0, do_mmc_bkops_enable, "", ""),
  };
  
  static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const 
 argv[])
 @@ -813,6 +837,8 @@ U_BOOT_CMD(
"mmc rpmb counter - read the value of the write counter\n"
  #endif
"mmc setdsr  - set DSR register value\n"
 +  "mmc bkops-enable  - enable background operations handshake on 
 device\n"
 +  "   WARNING: This is a write-once setting.\n"
);
  
  /* Old command kept for compatibility. Same as 'mmc info' */
 diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
 index 0cec02c..d6f40cc 100644
 --- a/drivers/mmc/mmc.c
 +++ b/drivers/mmc/mmc.c
 @@ -1810,3 +1810,33 @@ int mmc_initialize(bd_t *bis)
mmc_do_preinit();
return 0;
  }
 +
 +int mmc_set_bkops_enable(struct mmc *mmc)
 +{
 +  int err;
 +  ALLOC_CACHE_ALIGN_BUFFER(u8, ext_csd, MMC_MAX_BLOCK_LEN);
 +
 +  err = mmc_send_ext_csd(mmc, ext_csd);
 +  if (err) {
 +  puts("Could not get ext_csd register values\n");
 +  

Re: [U-Boot] [U-Boot, v8, 4/8] efi_loader: AArch64: Run EFI payloads in EL2 if U-Boot runs in EL3

2016-11-17 Thread Alexander Graf
> Some boards decided not to run ATF or other secure firmware in EL3, so
> they instead run U-Boot there. The uEFI spec doesn't know what EL3 is
> though - it only knows about EL2 and EL1. So if we see that we're running
> in EL3, let's get into EL2 to make payloads happy.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: York Sun 

Thanks, applied to efi-next

Alex

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


Re: [U-Boot] [U-Boot,v8,8/8] ls2080ardb: Convert to distro boot

2016-11-17 Thread Alexander Graf
> Most new systems in U-Boot these days make use of the generic "distro"
> framework which allows a user to have U-Boot scan for a bootable OS
> on all available media types.
> 
> This patch extends the LS2080ARDB board to use that framework if the
> hard coded NOR flash location does not contain a bootable image.
> 
> Signed-off-by: Alexander Graf 

Thanks, applied to efi-next

Alex

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


[U-Boot] [PATCH v3 0/2] drivers: timer: inroduce ARC timer driver

2016-11-17 Thread Vlad Zakharov
This patch series replaces legacy approach to access ARC timer
via specific code in "arch/arc/lib/time.c" and uses timer
driver instead.

ARC cores may have up to 2 built-in timers: timer0 and timer1,
usually at least one of them exists.

They are controlled through auxiliary registers and so we
don't have to remap their control registers as we used to do
with MMIO registers of external peripheral devices.

Cc: Simon Glass 
---
Changes v2..v3 
- Use timer_conv_64 in arc_timer_get_count to prevent 32-bit timer overflow

Vlad Zakharov (2):
  drivers: timer: Introduce ARC timer driver
  arc: use timer driver instead of arch/arc/lib/timer.c

 arch/arc/dts/skeleton.dtsi   |  6 ++
 arch/arc/include/asm/arcregs.h   |  4 ++
 arch/arc/lib/Makefile|  1 -
 arch/arc/lib/timer.c | 24 ---
 configs/axs101_defconfig |  2 +
 configs/axs103_defconfig |  2 +
 configs/nsim_700_defconfig   |  2 +
 configs/nsim_700be_defconfig |  2 +
 configs/nsim_hs38_defconfig  |  2 +
 configs/nsim_hs38be_defconfig|  2 +
 configs/tb100_defconfig  |  2 +
 doc/device-tree-bindings/timer/arc_timer.txt | 24 +++
 drivers/timer/Kconfig|  7 ++
 drivers/timer/Makefile   |  1 +
 drivers/timer/arc_timer.c| 95 
 include/configs/axs10x.h |  2 -
 16 files changed, 151 insertions(+), 27 deletions(-)
 delete mode 100644 arch/arc/lib/timer.c
 create mode 100644 doc/device-tree-bindings/timer/arc_timer.txt
 create mode 100644 drivers/timer/arc_timer.c

-- 
2.7.4

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


[U-Boot] [PATCH v3 1/2] drivers: timer: Introduce ARC timer driver

2016-11-17 Thread Vlad Zakharov
This commit introduces timer driver for ARC.

ARC timers are configured via ARC AUX registers so we use special
functions to access timer control registers.

This driver allows utilization of either timer0 or timer1
depending on which one is available in real hardware. Essentially
only existing timers should be mentioned in board's Device Tree
description.

Signed-off-by: Vlad Zakharov 
Reviewed-by: Simon Glass 
---
Changes v2..v3
- Use timer_conv_64 in arc_timer_get_count to prevent 32-bit timer overflow

 arch/arc/include/asm/arcregs.h   |   4 ++
 doc/device-tree-bindings/timer/arc_timer.txt |  24 +++
 drivers/timer/Kconfig|  10 +++
 drivers/timer/Makefile   |   1 +
 drivers/timer/arc_timer.c| 101 +++
 5 files changed, 140 insertions(+)
 create mode 100644 doc/device-tree-bindings/timer/arc_timer.txt
 create mode 100644 drivers/timer/arc_timer.c

diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h
index cf999b0..54a9b00 100644
--- a/arch/arc/include/asm/arcregs.h
+++ b/arch/arc/include/asm/arcregs.h
@@ -33,6 +33,10 @@
 #define ARC_AUX_TIMER0_CTRL0x22/* Timer 0 control */
 #define ARC_AUX_TIMER0_LIMIT   0x23/* Timer 0 limit */
 
+#define ARC_AUX_TIMER1_CNT 0x100   /* Timer 1 count */
+#define ARC_AUX_TIMER1_CTRL0x101   /* Timer 1 control */
+#define ARC_AUX_TIMER1_LIMIT   0x102   /* Timer 1 limit */
+
 #define ARC_AUX_INTR_VEC_BASE  0x25
 
 /* Data cache related auxiliary registers */
diff --git a/doc/device-tree-bindings/timer/arc_timer.txt 
b/doc/device-tree-bindings/timer/arc_timer.txt
new file mode 100644
index 000..e25c6ae
--- /dev/null
+++ b/doc/device-tree-bindings/timer/arc_timer.txt
@@ -0,0 +1,24 @@
+ARC Timer
+
+Required properties:
+
+- compatible : should be "snps,arc-timer"
+- reg : Specifies timer ID, could be either 0 or 1.
+- clock-frequency : The frequency of the clock that drives the counter, in Hz.
+
+Examples:
+
+timer@0 {
+   compatible = "snps,arc-timer";
+   clock-frequency = <1>;
+   reg = <0>;
+};
+
+timer@1 {
+   compatible = "snps,arc-timer";
+   clock-frequency = <1>;
+   reg = <1>;
+};
+
+NOTE: if you specify both timers, frequencies should always be the same as 
both timers
+are driven by core clock.
diff --git a/drivers/timer/Kconfig b/drivers/timer/Kconfig
index cb18f12..d47c62d 100644
--- a/drivers/timer/Kconfig
+++ b/drivers/timer/Kconfig
@@ -46,4 +46,14 @@ config OMAP_TIMER
help
  Select this to enable an timer for Omap devices.
 
+config ARC_TIMER
+   bool "ARC timer support"
+   depends on TIMER
+   depends on ARC
+   help
+ Select this to enable built-in ARC timers.
+ ARC cores may have up to 2 built-in timers: timer0 and timer1,
+ usually at least one of them exists. Either of them is supported
+ in U-Boot.
+
 endmenu
diff --git a/drivers/timer/Makefile b/drivers/timer/Makefile
index f351fbb..e9624dd 100644
--- a/drivers/timer/Makefile
+++ b/drivers/timer/Makefile
@@ -9,3 +9,4 @@ obj-$(CONFIG_ALTERA_TIMER)  += altera_timer.o
 obj-$(CONFIG_SANDBOX_TIMER)+= sandbox_timer.o
 obj-$(CONFIG_X86_TSC_TIMER)+= tsc_timer.o
 obj-$(CONFIG_OMAP_TIMER)   += omap-timer.o
+obj-$(CONFIG_ARC_TIMER)+= arc_timer.o
diff --git a/drivers/timer/arc_timer.c b/drivers/timer/arc_timer.c
new file mode 100644
index 000..9af2295
--- /dev/null
+++ b/drivers/timer/arc_timer.c
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2016 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define NH_MODE (1 << 1)
+
+/*
+ * ARC timer control registers are mapped to auxiliary address space.
+ * There are special ARC asm command to access that addresses.
+ * Therefore we use built-in functions to read from and write to timer
+ * control register.
+ */
+
+/* Driver private data. Contains AUX register number. */
+struct arc_timer_priv {
+   uint timer_id;
+};
+
+static int arc_timer_get_count(struct udevice *dev, u64 *count)
+{
+   u32 val;
+   struct arc_timer_priv *priv = dev_get_priv(dev);
+   switch (priv->timer_id) {
+   case 0:
+   val = read_aux_reg(ARC_AUX_TIMER0_CNT);
+   break;
+   case 1:
+   val = read_aux_reg(ARC_AUX_TIMER1_CNT);
+   break;
+   }
+   *count = timer_conv_64(val);
+
+   return 0;
+}
+
+static int arc_timer_probe(struct udevice *dev)
+{
+   int id;
+
+   struct arc_timer_priv *priv = dev_get_priv(dev);
+
+   /* Get registers offset and size */
+   id = fdtdec_get_int(gd->fdt_blob, dev->of_offset, "reg", -1);
+   if (id < 0)
+   return -EINVAL;
+   if (id > 1)
+   return -ENXIO;
+
+   priv->timer_id = 

[U-Boot] [PATCH v3 2/2] arc: use timer driver instead of arch/arc/lib/timer.c

2016-11-17 Thread Vlad Zakharov
This commit replaces legacy timer code with usage of arc timer
driver.

Also it adds timer0 device tree node with corresponding
"clock-frequency" property.

Therefore we remove legacy CONFIG_SYS_TIMER_RATE config symbol
that is not longer required.

Furthermore the commit selects CONFIG_TIMER and CONFIG_ARC_TIMER
by default when selecting ARC architecture.

Signed-off-by: Vlad Zakharov 
Reviewed-by: Simon Glass  
---
No changes compared to v2

 arch/Kconfig   |  2 ++
 arch/arc/dts/skeleton.dtsi |  6 ++
 arch/arc/lib/Makefile  |  1 -
 arch/arc/lib/timer.c   | 24 
 include/configs/axs10x.h   |  2 --
 5 files changed, 8 insertions(+), 27 deletions(-)
 delete mode 100644 arch/arc/lib/timer.c

diff --git a/arch/Kconfig b/arch/Kconfig
index ffc7b45..56fa70e 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -12,6 +12,8 @@ config ARC
bool "ARC architecture"
select HAVE_PRIVATE_LIBGCC
select SUPPORT_OF_CONTROL
+   select TIMER
+   select ARC_TIMER
 
 config ARM
bool "ARM architecture"
diff --git a/arch/arc/dts/skeleton.dtsi b/arch/arc/dts/skeleton.dtsi
index b41d241..3e93d697 100644
--- a/arch/arc/dts/skeleton.dtsi
+++ b/arch/arc/dts/skeleton.dtsi
@@ -10,4 +10,10 @@
chosen { };
aliases { };
memory { device_type = "memory"; reg = <0 0>; };
+
+   timer@0 {
+   compatible = "snps,arc-timer";
+   clock-frequency = <1>;
+   reg = <0>;
+   };
 };
diff --git a/arch/arc/lib/Makefile b/arch/arc/lib/Makefile
index eb62b3c..12097bf 100644
--- a/arch/arc/lib/Makefile
+++ b/arch/arc/lib/Makefile
@@ -18,7 +18,6 @@ obj-y += memcmp.o
 obj-y += memcpy-700.o
 obj-y += memset.o
 obj-y += reset.o
-obj-y += timer.o
 obj-y += ints_low.o
 obj-y += init_helpers.o
 
diff --git a/arch/arc/lib/timer.c b/arch/arc/lib/timer.c
deleted file mode 100644
index a0acbbc..000
--- a/arch/arc/lib/timer.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-#include 
-
-#define NH_MODE(1 << 1)/* Disable timer if CPU is halted */
-
-int timer_init(void)
-{
-   write_aux_reg(ARC_AUX_TIMER0_CTRL, NH_MODE);
-   /* Set max value for counter/timer */
-   write_aux_reg(ARC_AUX_TIMER0_LIMIT, 0x);
-   /* Set initial count value and restart counter/timer */
-   write_aux_reg(ARC_AUX_TIMER0_CNT, 0);
-   return 0;
-}
-
-unsigned long timer_read_counter(void)
-{
-   return read_aux_reg(ARC_AUX_TIMER0_CNT);
-}
diff --git a/include/configs/axs10x.h b/include/configs/axs10x.h
index 3546c8d..0476223 100644
--- a/include/configs/axs10x.h
+++ b/include/configs/axs10x.h
@@ -11,8 +11,6 @@
 /*
  *  CPU configuration
  */
-#define CONFIG_SYS_TIMER_RATE  CONFIG_SYS_CLK_FREQ
-
 #define ARC_FPGA_PERIPHERAL_BASE   0xE000
 #define ARC_APB_PERIPHERAL_BASE0xF000
 #define ARC_DWMMC_BASE (ARC_FPGA_PERIPHERAL_BASE + 0x15000)
-- 
2.7.4

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


Re: [U-Boot] [PATCH 0/4] config: Add FreeBSD kconfig options

2016-11-17 Thread Emmanuel Vadot
On Fri, 11 Nov 2016 11:07:34 -0500
Tom Rini  wrote:

> On Mon, Nov 07, 2016 at 09:34:27AM +0100, Emmanuel Vadot wrote:
> 
> > This series of patches add the needed bits for booting the FreeBSD
> > loader.
> > FreeBSD loader needs the U-Boot API and dache disabled for it to run so
> > add kconfig options for them.
> > Also add some some boot command that locate and run the FreeBSD loader
> > if found.
> > 
> > Emmanuel Vadot (4):
> >   kconfig: Add API kconfig file
> >   kconfig: arm: Add SYS_DCACHE_OFF option
> >   kconfig: Add a FREEBSD option
> >   distro_bootcmd: Add command to run FreeBSD
> > 
> >  Kconfig |  2 ++
> >  api/Kconfig |  9 +
> >  arch/arm/Kconfig|  6 ++
> >  common/Kconfig  |  9 +
> >  include/config_distro_bootcmd.h | 32 
> 
> This is a good first start.  But I think there's a few things that need
> tweaking.  First, we don't want to globally turn off dcache, but it does
> need to be migrated to Kconfig (so we know if it's enabled or not).
> Second, we should instead use CMD_CACHE and the 'dcache' command to
> disable dcache prior to running the FreeBSD loader.  Then we make sure
> that the generic distro feature has CMD_CACHE if !SYS_DCACHE_OFF (and
> !SYS_ICACHE_OFF).  Thanks!
> 
> -- 
> Tom

 Hi Tom,

 I will make the modification, should I sent the patch for
migration of SYS_DCACHE_OFF to Kconfig as a separate patch ?


-- 
Emmanuel Vadot  
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Dynamically determine RAM size and pass it to kernel

2016-11-17 Thread Mike Looijmans
We have some Zynq based boards still in the field that have only 512MB RAM 
instead of 1GB. The memory chips are compatible and use the same settings 
apart from that one extra address bit.


So what works is just configure the DDR controller for 1GB and then check if 
writing some data "wraps" back, this is my "spike" code in the RAM init code 
for that:


+   u32 *ptr_1 = (u32*)0x1;
+   u32 *ptr_2 = (u32*)((gd->ram_size >> 1) + 0x1);
+
+   puts("RAM test");
+   *ptr_1 = 0x12345678;
+   if (*ptr_2 == *ptr_1) {
+   *ptr_1 = 0x87654321;
+   if (*ptr_2 == *ptr_1) {
+   puts(" [HALF]");
+   gd->ram_size >>= 1;
+   }
+   }

This works well, and reliably detects that the board only has half the amount 
of RAM, and corrects the ram_size variable.


The problem I'm seeing now is that this new ram_size does not get passed to 
the kernel. Apparently in modern versions of u-boot I need to somehow patch 
the "live" devicetree blob as well? How does that work?



Kind regards,

Mike Looijmans
System Expert

TOPIC Products
Materiaalweg 4, NL-5681 RJ Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
E-mail: mike.looijm...@topicproducts.com
Website: www.topicproducts.com

Please consider the environment before printing this e-mail





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


Re: [U-Boot] [PATCH] board/ls2088ardb: set rear fan speed to reduce noise

2016-11-17 Thread Fabio Estevam
On Thu, Nov 17, 2016 at 5:30 AM,   wrote:
> From: Ying Zhang 
>
> Fan settings(PWM signal set to ~50% duty cycle for all three rear)
> fans provide good thermal air flow with considerable reduction of
> fan noise.
>
> Signed-off-by: Ying Zhang 
> ---
>  board/freescale/ls2080ardb/ls2080ardb.c | 31 +++
>  include/configs/ls2080ardb.h|  6 ++
>  2 files changed, 37 insertions(+)
>
> diff --git a/board/freescale/ls2080ardb/ls2080ardb.c 
> b/board/freescale/ls2080ardb/ls2080ardb.c
> index 83d9e7e..1703b96 100644
> --- a/board/freescale/ls2080ardb/ls2080ardb.c
> +++ b/board/freescale/ls2080ardb/ls2080ardb.c
> @@ -151,6 +151,36 @@ int config_board_mux(int ctrl_type)
> return 0;
>  }
>
> +void set_fan_speed(void)

Make this function static, please.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] FDT retrived varaibles appear to have different properties fom other u-boot variables - and are corrupted on get, set, get sequence

2016-11-17 Thread Tom Rini
On Mon, Nov 14, 2016 at 12:08:23AM +, d...@synoia.com wrote:
> Cédric
> I move the fdt to 0x100
> fdt move ${fdt_addr}  100
> fdt addr 100
> 
> then
> fdt get value bootargs /chosen bootargs
> printenv bootargs 
> bootargs=all the boot args...but setenv abc $bootargs fails...as 
> does printenv $bootargs
> 
> fdt set bootargs /chosen bootargsfdt get value bootargs /chosen 
> bootargsbootargs=bootargs
> The variable name bootargs replaces the values contained in the variable 
> bootargs in the fdt.
> Something is not right in the world of fdt code.
>  Duncan Hare

I just tried this on a random platform that I have around, and do not
see this problem.  But also, what exactly is your end-goal here?  While
one can modify the fdt in memory and even modify the bootargs passed via
this method, normally one will just set bootargs in the environment and
let the fdt be updated by the normal mechanism (which will I suspect
blow away your modifications unless bootargs is _not_ set in the
environment).

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] 2016.09+fslc was working... But not anymore

2016-11-17 Thread Carlos Alberto Musich Cuevas
Hello,

The following sequence is causing the error below.

Please note that few days ago it was working.



SEQUENCE

$ cd ~/
$ git clone 
https://github.com/Freescale/u-boot-fslc.git
 uboot2016
$ cd uboot2016
$ git checkout -b 2016.09+fslc remotes/origin/2016.09+fslc
$ make udoo_defconfig
$ make

ERROR

lib/asm-offsets.c:1:0: error: bad value (armv5) for -march= switch

 /*

 ^

make[1]: *** [lib/asm-offsets.s] Error 1

make: *** [prepare0] Error 2

Thanks!

Regards,
Carlos
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Adding a mmc protect command

2016-11-17 Thread Eugene.Cho
Hi all,
I need to implement MMC write protection in u-boot, and was wondering what 
would be the best way.

Should this be a new mmc command or just APIs? Is there value in pushing this 
upstream?

I ask because I saw the following submission didn't make it.
http://lists.denx.de/pipermail/u-boot/2015-December/237810.html

The kernel.org's mmc-util has a write protect command we could model after if a 
"mmc protect" command is a better way to do this...
"writeprotect user set", "" "" "" "\n"

Maybe something like this?
"mmc protect [perm|pwron|tmp|none] blk# cnt - set write protection\n"

Thoughts?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] api: Use hashtable function for API_env_enum

2016-11-17 Thread Emmanuel Vadot
On Fri, 11 Nov 2016 09:16:46 -0700
Simon Glass  wrote:

> Hi,
> 
> On 5 November 2016 at 15:27, Emmanuel Vadot  wrote:
> >
> > Since the env is an hashtable, use the hashtable function for the 
> > API_ENV_ENUM
> > api call.
> 
> Can you please explain why in your commit message?

 Hi,

 I will send a new version with the why (spoiler: current code doesn't
work).

> >
> > Signed-off-by: Emmanuel Vadot 
> > ---
> >  api/api.c | 60 +++-
> >  1 file changed, 31 insertions(+), 29 deletions(-)
> >
> > diff --git a/api/api.c b/api/api.c
> > index 8a1433a..c368511 100644
> > --- a/api/api.c
> > +++ b/api/api.c
> > @@ -495,45 +495,47 @@ static int API_env_set(va_list ap)
> >   */
> >  static int API_env_enum(va_list ap)
> >  {
> > -   int i, n;
> > -   char *last, **next;
> > +   int i, buflen;
> > +   char *last, **next, *s;
> > +   ENTRY *match, search;
> > +   static char *var;
> >
> > last = (char *)va_arg(ap, unsigned long);
> >
> > if ((next = (char **)va_arg(ap, uintptr_t)) == NULL)
> > return API_EINVAL;
> >
> > -   if (last == NULL)
> > -   /* start over */
> > -   *next = ((char *)env_get_addr(0));
> > -   else {
> > -   *next = last;
> > -
> > -   for (i = 0; env_get_char(i) != '\0'; i = n + 1) {
> > -   for (n = i; env_get_char(n) != '\0'; ++n) {
> > -   if (n >= CONFIG_ENV_SIZE) {
> > -   /* XXX shouldn't we set *next = 
> > NULL?? */
> > -   return 0;
> > -   }
> > -   }
> > -
> > -   if (envmatch((uchar *)last, i) < 0)
> > -   continue;
> > -
> > -   /* try to get next name */
> > -   i = n + 1;
> > -   if (env_get_char(i) == '\0') {
> > -   /* no more left */
> > -   *next = NULL;
> > -   return 0;
> > -   }
> > -
> > -   *next = ((char *)env_get_addr(i));
> > -   return 0;
> > +   if (last == NULL) {
> > +   var = NULL;
> > +   i = 0;
> > +   } else {
> > +   var = strdup(last);
> 
> Need to check for failure here.
> 
> > +   s = strchr(var, '=');
> > +   if (s != NULL)
> > +   *s = 0;
> > +   search.key = var;
> > +   i = hsearch_r(search, FIND, , _htab, 0);
> > +   if (i == 0) {
> > +   i = API_EINVAL;
> > +   goto done;
> > }
> > }
> >
> > +   /* match the next entry after i */
> > +   i = hmatch_r("", i, , _htab);
> > +   if (i == 0)
> > +   goto done;
> > +   buflen = strlen(match->key) + strlen(match->data) + 2;
> > +   var = realloc(var, buflen);
> > +   snprintf(var, buflen, "%s=%s", match->key, match->data);
> > +   *next = var;
> > return 0;
> > +
> > +done:
> > +   free(var);
> > +   var = NULL;
> > +   *next = NULL;
> > +   return i;
> >  }
> >
> >  /*
> > --
> > 2.9.2
> >
> 
> Regards,
> SImon


-- 
Emmanuel Vadot  
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] tools: imximage: display DCD block offset, length

2016-11-17 Thread Eric Nelson
Hi Gary,

On 11/17/2016 05:16 AM, Gary Bisson wrote:
> Hi Eric, All,
> 
> On Wed, Nov 16, 2016 at 05:13:41PM -0700, Eric Nelson wrote:
>> These values can be used to sign a U-Boot image for use when
>> loading an image through the Serial Download Protocol (SDP).
>>
>> Note that the address of 0x91 is usable with the stock
>> configuration of imx_usb_loader on i.MX6 and i.MX7 SOCs:
>>
>> https://github.com/boundarydevices/imx_usb_loader/blob/master/mx6_usb_work.conf#L3
>>
>> Refer to the section on imx_usb_loader in this post for more
>> details:
>>
>> https://boundarydevices.com/high-assurance-boot-hab-dummies/
>>
>> Signed-off-by: Eric Nelson 
> 
> Thanks, indeed such patch would ease the life of anybody that needs to
> deal with HAB when creating the CSF files.
> 
>> ---
>>  tools/imximage.c | 10 +-
>>  1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/imximage.c b/tools/imximage.c
>> index c9e42ec..2cd8d88 100644
>> --- a/tools/imximage.c
>> +++ b/tools/imximage.c
>> @@ -281,7 +281,6 @@ static void set_dcd_rst_v2(struct imx_header *imxhdr, 
>> uint32_t dcd_len,
>>  d = (struct dcd_v2_cmd *)(((char *)d) + len);
>>  
>>  len = (char *)d - (char *)_v2->header;
>> -
> 
> Is this part of the patch intended?
> 

Nope.

>>  dcd_v2->header.tag = DCD_HEADER_TAG;
>>  dcd_v2->header.length = cpu_to_be16(len);
>>  dcd_v2->header.version = DCD_VERSION;
>> @@ -501,10 +500,19 @@ static void print_hdr_v2(struct imx_header *imx_hdr)
>>  printf("Entry Point:  %08x\n", (uint32_t)fhdr_v2->entry);
>>  if (fhdr_v2->csf && (imximage_ivt_offset != UNDEFINED) &&
>>  (imximage_csf_size != UNDEFINED)) {
>> +uint16_t dcdlen;
>> +int offs;
>> +
>> +dcdlen = hdr_v2->data.dcd_table.header.length;
>> +offs = (char *)_v2->data.dcd_table
>> +- (char *)hdr_v2;
>> +
>>  printf("HAB Blocks:   %08x %08x %08x\n",
>> (uint32_t)fhdr_v2->self, 0,
> 
> This isn't part of the patch, but why is self cast into a uint32_t
> although it's already a uint32_t?
> 

Unrelated, but good catch!

>> hdr_v2->boot_data.size - imximage_ivt_offset -
>> imximage_csf_size);
>> +printf("DCD Blocks:   0091 %08x %08x\n",
>> +   offs, be16_to_cpu(dcdlen));
>>  }
> 
> Not sure if "DCD Blocks" is the best naming, cause it really just
> applies to SDP protocol.
> 
> This got me thinking and I think the printf above should also show the
> Blocks for encryption which is also missing right now.
> 
> What about something like the snippet below?
> 
>   if (fhdr_v2->csf && (imximage_ivt_offset != UNDEFINED) &&
>   (imximage_csf_size != UNDEFINED)) {
>   uint16_t dcdlen;
>   uint32_t dcdoff;
>   uint32_t entryoff;
> 
>   dcdlen = hdr_v2->data.dcd_table.header.length;
>   dcdoff = (char *)_v2->data.dcd_table
>   - (char *)hdr_v2;
>   entryoff = fhdr_v2->entry - fhdr_v2->self;
> 
>   printf("[HAB][Signature]\n");
>   printf("Blocks:   %08x %08x %08x\n",
>  (uint32_t)fhdr_v2->self, 0,

I think somebody just pointed out that self is already a uint32_t,
so why the cast?

>  hdr_v2->boot_data.size - imximage_ivt_offset -
>  imximage_csf_size);
>   printf("[HAB][Encryption]\n");
>   printf("Blocks:   %08x %08x %08x\n",
>  fhdr_v2->self, 0, dcdoff + be16_to_cpu(dcdlen));
>   printf("Blocks:   %08x %08x %08x\n",
>  fhdr_v2->entry, entryoff,
>  hdr_v2->boot_data.size - imximage_ivt_offset -
>  imximage_csf_size - entryoff);
>   printf("[HAB][SDP]\n");
>   printf("Blocks:   0091 %08x %08x\n",
>  dcdoff, be16_to_cpu(dcdlen));
>   }

I like the more specific tags, but wonder if some minor edits wouldn't
make this more useful.

In particular, adding 0x before %08x would allow easier cut and paste
into signing scripts in a manual process.

I looked briefly at the output of 'mkimage -l' and found that it doesn't
reach this code block because imximage_ivt/csf_size variables are
set during the parsing of a .cfg file (they're UNDEFINED with
'mkimage -l').


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


[U-Boot] [PATCH] board/ls2088ardb: set rear fan speed to reduce noise

2016-11-17 Thread ying.zhang22455
From: Ying Zhang 

Fan settings(PWM signal set to ~50% duty cycle for all three rear)
fans provide good thermal air flow with considerable reduction of
fan noise.

Signed-off-by: Ying Zhang 
---
 board/freescale/ls2080ardb/ls2080ardb.c | 31 +++
 include/configs/ls2080ardb.h|  6 ++
 2 files changed, 37 insertions(+)

diff --git a/board/freescale/ls2080ardb/ls2080ardb.c 
b/board/freescale/ls2080ardb/ls2080ardb.c
index 83d9e7e..1703b96 100644
--- a/board/freescale/ls2080ardb/ls2080ardb.c
+++ b/board/freescale/ls2080ardb/ls2080ardb.c
@@ -151,6 +151,36 @@ int config_board_mux(int ctrl_type)
return 0;
 }
 
+void set_fan_speed(void)
+{
+   int ret, i;
+   u8 value;
+
+   select_i2c_ch_pca9547(I2C_MUX_CH_FAN);
+   value = 0x80;
+   ret = i2c_write(I2C_FAN_CONTROLLER_ADDR, 0x0, 1, , 1);
+   if (ret) {
+   printf("Fan: Failed to set fan speed\n");
+   return;
+   }
+   value = 1;
+   ret = i2c_write(I2C_FAN_CONTROLLER_ADDR, 0x58, 1, , 1);
+   if (ret) {
+   printf("Fan: Failed to set fan speed\n");
+   return;
+   }
+
+   /* set PWM = ~50% DCyc for all rear PWM fans */
+   value = 0x20;
+   for (i = 0xb4; i < 0xb9; i++) {
+   ret = i2c_write(I2C_FAN_CONTROLLER_ADDR, i, 1, , 1);
+   if (ret) {
+   printf("Fan: Failed to set fan speed\n");
+   return;
+   }
+   }
+}
+
 int board_init(void)
 {
char *env_hwconfig;
@@ -175,6 +205,7 @@ int board_init(void)
 #ifdef CONFIG_ENV_IS_NOWHERE
gd->env_addr = (ulong)_environment[0];
 #endif
+   set_fan_speed();
select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
 
QIXIS_WRITE(rst_ctl, QIXIS_RST_CTL_RESET_EN);
diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h
index b9cb6d3..05f98c0 100644
--- a/include/configs/ls2080ardb.h
+++ b/include/configs/ls2080ardb.h
@@ -264,6 +264,7 @@ unsigned long get_board_sys_clk(void);
 
 /* I2C bus multiplexer */
 #define I2C_MUX_CH_DEFAULT  0x8
+#defineI2C_MUX_CH_FAN  0xd
 
 /* SPI */
 #ifdef CONFIG_FSL_DSPI
@@ -279,6 +280,11 @@ unsigned long get_board_sys_clk(void);
 #define CONFIG_SYS_I2C_RTC_ADDR 0x68
 #define CONFIG_CMD_DATE
 
+/*
+ * Winbond fan controller
+ */
+#define I2C_FAN_CONTROLLER_ADDR0x2c
+
 /* EEPROM */
 #define CONFIG_ID_EEPROM
 #define CONFIG_CMD_EEPROM
-- 
2.1.0.27.g96db324

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


[U-Boot] [PATCH] usb: xhci: Limit transfer length in a single TD

2016-11-17 Thread Dongwoo Lee
The transfer request exceeding 4032KB (the maximum number of TRBs per
TD * the maximum size of transfer buffer on TRB) fails on xhci host
with timed out error or babble error state. This failure occurs when
accessing large files on USB mass-storage. Currently with xhci as well
as ehci host, the driver requests maximum 30MB (65536 blks * 512 byte)
to storage at once. However, xhci cannot handle this request because
of the reason mentioned above, even though ehci can handle this. Thus,
transfer request larger than this size should be splitted in order to
limit the length of data in a single TD.

Even though the single request is splitted into multiple requests,
the transfer speed has affected insignificantly in comparison with
ehci host: 22.6 MB/s on ehci and 22.3 MB/s on xhci for 100MB tranfer.

Reported-by: Jaehoon Chung 
Signed-off-by: Dongwoo Lee 
---
 drivers/usb/host/xhci.c | 30 +-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 3201177..594026e 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -907,12 +907,40 @@ static int _xhci_submit_int_msg(struct usb_device *udev, 
unsigned long pipe,
 static int _xhci_submit_bulk_msg(struct usb_device *udev, unsigned long pipe,
 void *buffer, int length)
 {
+   int ret;
+   int xfer_max_per_td, xfer_length, buf_pos;
+
if (usb_pipetype(pipe) != PIPE_BULK) {
printf("non-bulk pipe (type=%lu)", usb_pipetype(pipe));
return -EINVAL;
}
 
-   return xhci_bulk_tx(udev, pipe, length, buffer);
+   /*
+* When transfering data exceeding the maximum number of TRBs per
+* TD (default 64) is requested, the transfer fails with babble
+* error or time out.
+*
+* Thus, huge data transfer should be splitted into multiple TDs.
+*/
+   xfer_max_per_td = TRB_MAX_BUFF_SIZE * (TRBS_PER_SEGMENT - 1);
+
+   buf_pos = 0;
+   do {
+   if (length > xfer_max_per_td)
+   xfer_length = xfer_max_per_td;
+   else
+   xfer_length = length;
+
+   ret = xhci_bulk_tx(udev, pipe, xfer_length, buffer + buf_pos);
+   if (ret < 0)
+   return ret;
+
+   buf_pos += xfer_length;
+   length -= xfer_length;
+
+   } while (length > 0);
+
+   return ret;
 }
 
 /**
-- 
1.9.1

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


Re: [U-Boot] [PATCH v8 7/8] armv8: fsl-layerscape: Add support for efi_loader RTS reset

2016-11-17 Thread Alexander Graf



On 17/11/2016 17:48, york sun wrote:

On 11/17/2016 08:43 AM, Alexander Graf wrote:




I still have this compiling error


Can you please try my efi-next branch? It should hopefully be properly
fixed in there.



I will try to find some time to. My server is busy these days. Don't you
have the setup to run buildman?


I'm moving to a travis based workflow. Unfortunately travis is quite 
slow ;).


But yes, I've seen that problem and fixed it in efi-next.


For this patch, it adds efi_reset_system(). You already have it in
arch/arm/cpu/armv8/fwcall.c.


The problem is that those systems are not using PSCI. If they were, we 
could just use the generic PSCI based reset implementation. So instead 
we need to stub it out for FSL systems right now.


I'm still hoping we'll get to a point one day where all FSL systems 
simply have a working PSCI implementation and we can drop the special 
quirks :).



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


Re: [U-Boot] [PATCH] spl: mmc: fix build without CONFIG_SPL_LIBCOMMON_SUPPORT

2016-11-17 Thread Yann E. MORIN
Jaehoon, All,

On 2016-11-17 17:09 +0900, Jaehoon Chung spake thusly:
> On 11/14/2016 06:46 AM, Yann E. MORIN wrote:
> > When CONFIG_SPL_LIBCOMMON_SUPPORT is disabled, the last case statement
> > is missing a proper statement, which makes the compiler whine.
> > 
> > Signed-off-by: "Yann E. MORIN" 
> > Cc: Pantelis Antoniou 
> > ---
> >  common/spl/spl_mmc.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
> > index c674e61..cc81d19 100644
> > --- a/common/spl/spl_mmc.c
> > +++ b/common/spl/spl_mmc.c
> > @@ -343,6 +343,7 @@ static int spl_mmc_load_image(struct spl_image_info 
> > *spl_image,
> >  
> > break;
> > case MMCSD_MODE_UNDEFINED:
> > +   ;
> >  #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
> > default:
> > puts("spl: mmc: wrong boot mode\n");
> 
> case MMCSD_MODE_UNDEFINED:
>  ...
> #ifdef CONFIG_
> default:
>   put()
> #endif
>   break; 
> 
> 
> How about adding "break"?

>From what I understood, Tom Rini has another patch he preferred:
https://patchwork.ozlabs.org/patch/694196/
in which he pointed to:
https://patchwork.ozlabs.org/patch/689910/

Regards,
Yann E. MORIN.

-- 
.-..--..
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN |  ___   |
| +33 223 225 172 `.---:  X  AGAINST  |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL|   v   conspiracy.  |
'--^---^--^'
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] timer: Support clocks via phandle

2016-11-17 Thread Vlad Zakharov
Earlier timer driver needed a clock-frequency property in compatible
device-tree nodes. Another way is to reference a clock via a phandle.

So now timer_pre_probe tries to get clock by reference through device
tree. In case it is impossible to get clock device through the
reference, clock-frequency property of the timer node is read to provide
backward compatibility.

Signed-off-by: Vlad Zakharov 
---
 drivers/timer/timer-uclass.c | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/timer/timer-uclass.c b/drivers/timer/timer-uclass.c
index f8ddf93..cca41f1 100644
--- a/drivers/timer/timer-uclass.c
+++ b/drivers/timer/timer-uclass.c
@@ -8,6 +8,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -42,9 +43,17 @@ unsigned long notrace timer_get_rate(struct udevice *dev)
 static int timer_pre_probe(struct udevice *dev)
 {
struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev);
-
-   uc_priv->clock_rate = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
-"clock-frequency", 0);
+   struct clk *timer_clk;
+   int err;
+
+   err = clk_get_by_index(dev, 0, timer_clk);
+   if (!err) {
+   uc_priv->clock_rate = clk_get_rate(timer_clk);
+   if (uc_priv->clock_rate < 0)
+   return uc_priv->clock_rate;
+   } else
+   uc_priv->clock_rate = fdtdec_get_int(gd->fdt_blob,
+   dev->of_offset, "clock-frequency", 0);
 
return 0;
 }
-- 
2.7.4

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


[U-Boot] [PATCH 5/8] spl: Drop announce_boot_device()

2016-11-17 Thread Simon Glass
This task can be handled by inline code now. Drop this function.

Signed-off-by: Simon Glass 
---

 common/spl/spl.c | 86 ++--
 1 file changed, 3 insertions(+), 83 deletions(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 4555216..86474bb 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -267,87 +267,6 @@ __weak void board_boot_order(u32 *spl_boot_list)
spl_boot_list[0] = spl_boot_device();
 }
 
-#ifdef CONFIG_SPL_BOARD_LOAD_IMAGE
-__weak void spl_board_announce_boot_device(void) { }
-#endif
-
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
-struct boot_device_name {
-   u32 boot_dev;
-   const char *name;
-};
-
-struct boot_device_name boot_name_table[] = {
-#ifdef CONFIG_SPL_RAM_DEVICE
-   { BOOT_DEVICE_RAM, "RAM" },
-#endif
-#ifdef CONFIG_SPL_MMC_SUPPORT
-   { BOOT_DEVICE_MMC1, "MMC1" },
-   { BOOT_DEVICE_MMC2, "MMC2" },
-   { BOOT_DEVICE_MMC2_2, "MMC2_2" },
-#endif
-#ifdef CONFIG_SPL_NAND_SUPPORT
-   { BOOT_DEVICE_NAND, "NAND" },
-#endif
-#ifdef CONFIG_SPL_ONENAND_SUPPORT
-   { BOOT_DEVICE_ONENAND, "OneNAND" },
-#endif
-#ifdef CONFIG_SPL_NOR_SUPPORT
-   { BOOT_DEVICE_NOR, "NOR" },
-#endif
-#ifdef CONFIG_SPL_YMODEM_SUPPORT
-   { BOOT_DEVICE_UART, "UART" },
-#endif
-#if defined(CONFIG_SPL_SPI_SUPPORT) || defined(CONFIG_SPL_SPI_FLASH_SUPPORT)
-   { BOOT_DEVICE_SPI, "SPI" },
-#endif
-#ifdef CONFIG_SPL_ETH_SUPPORT
-#ifdef CONFIG_SPL_ETH_DEVICE
-   { BOOT_DEVICE_CPGMAC, "eth device" },
-#else
-   { BOOT_DEVICE_CPGMAC, "net" },
-#endif
-#endif
-#ifdef CONFIG_SPL_USBETH_SUPPORT
-   { BOOT_DEVICE_USBETH, "USB eth" },
-#endif
-#ifdef CONFIG_SPL_USB_SUPPORT
-   { BOOT_DEVICE_USB, "USB" },
-#endif
-#ifdef CONFIG_SPL_DFU_SUPPORT
-   { BOOT_DEVICE_DFU, "USB DFU" },
-#endif
-#ifdef CONFIG_SPL_SATA_SUPPORT
-   { BOOT_DEVICE_SATA, "SATA" },
-#endif
-   /* Keep this entry last */
-   { BOOT_DEVICE_NONE, "unknown boot device" },
-};
-
-static void announce_boot_device(u32 boot_device)
-{
-   int i;
-
-   puts("Trying to boot from ");
-
-#ifdef CONFIG_SPL_BOARD_LOAD_IMAGE
-   if (boot_device == BOOT_DEVICE_BOARD) {
-   spl_board_announce_boot_device();
-   puts("\n");
-   return;
-   }
-#endif
-   for (i = 0; i < ARRAY_SIZE(boot_name_table) - 1; i++) {
-   if (boot_name_table[i].boot_dev == boot_device)
-   break;
-   }
-
-   printf("%s\n", boot_name_table[i].name);
-}
-#else
-static inline void announce_boot_device(u32 boot_device) { }
-#endif
-
 static struct spl_image_loader *spl_ll_find_loader(uint boot_device)
 {
struct spl_image_loader *drv =
@@ -385,10 +304,11 @@ static int boot_from_devices(struct spl_image_info 
*spl_image,
 spl_boot_list[i] != BOOT_DEVICE_NONE; i++) {
struct spl_image_loader *loader;
 
-   announce_boot_device(spl_boot_list[i]);
loader = spl_ll_find_loader(spl_boot_list[i]);
 #if defined(CONFIG_SPL_SERIAL_SUPPORT) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
-   if (!loader)
+   if (loader)
+   printf("Trying to boot from %s", loader->name);
+   else
puts("SPL: Unsupported Boot Device!\n");
 #endif
if (loader && !spl_load_image(spl_image, loader))
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 2/8] spl: Add a name to the SPL load-image methods

2016-11-17 Thread Simon Glass
It is useful to name each method so that we can print out this name when
using the method. Currently this happens using a separate function. In
preparation for unifying this, add a name to each method.

The name is only available if we have libcommon support (i.e can use
printf()).

Signed-off-by: Simon Glass 
---

 arch/arm/mach-sunxi/board.c  |  2 +-
 arch/arm/mach-uniphier/boot-mode/spl_board.c |  2 +-
 arch/sandbox/cpu/spl.c   |  2 +-
 common/spl/spl.c |  4 ++--
 common/spl/spl_mmc.c |  6 +++---
 common/spl/spl_nand.c|  2 +-
 common/spl/spl_net.c |  5 +++--
 common/spl/spl_nor.c |  2 +-
 common/spl/spl_onenand.c |  3 ++-
 common/spl/spl_sata.c|  2 +-
 common/spl/spl_spi.c |  2 +-
 common/spl/spl_ubi.c |  4 ++--
 common/spl/spl_usb.c |  2 +-
 common/spl/spl_ymodem.c  |  2 +-
 drivers/mtd/spi/sunxi_spi_spl.c  |  2 +-
 include/spl.h| 15 ++-
 16 files changed, 36 insertions(+), 21 deletions(-)

diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
index 0f8ead9..205236d 100644
--- a/arch/arm/mach-sunxi/board.c
+++ b/arch/arm/mach-sunxi/board.c
@@ -142,7 +142,7 @@ static int spl_board_load_image(struct spl_image_info 
*spl_image,
 
return 0;
 }
-SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_BOARD, spl_board_load_image);
+SPL_LOAD_IMAGE_METHOD("FEL", 0, BOOT_DEVICE_BOARD, spl_board_load_image);
 #endif
 
 void s_init(void)
diff --git a/arch/arm/mach-uniphier/boot-mode/spl_board.c 
b/arch/arm/mach-uniphier/boot-mode/spl_board.c
index 854ab05..ba84087 100644
--- a/arch/arm/mach-uniphier/boot-mode/spl_board.c
+++ b/arch/arm/mach-uniphier/boot-mode/spl_board.c
@@ -127,4 +127,4 @@ static int spl_board_load_image(struct spl_image_info 
*spl_image,
 
return 0;
 }
-SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_BOARD, spl_board_load_image);
+SPL_LOAD_IMAGE_METHOD("eMMC", 0, BOOT_DEVICE_BOARD, spl_board_load_image);
diff --git a/arch/sandbox/cpu/spl.c b/arch/sandbox/cpu/spl.c
index 1ad7fb6..632446b 100644
--- a/arch/sandbox/cpu/spl.c
+++ b/arch/sandbox/cpu/spl.c
@@ -51,7 +51,7 @@ static int spl_board_load_image(struct spl_image_info 
*spl_image,
/* Hopefully this will not return */
return os_spl_to_uboot(fname);
 }
-SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_BOARD, spl_board_load_image);
+SPL_LOAD_IMAGE_METHOD("sandbox", 0, BOOT_DEVICE_BOARD, spl_board_load_image);
 
 void spl_board_init(void)
 {
diff --git a/common/spl/spl.c b/common/spl/spl.c
index bdb165a..4f23c0e 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -220,9 +220,9 @@ static int spl_ram_load_image(struct spl_image_info 
*spl_image,
 
return 0;
 }
-SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_RAM, spl_ram_load_image);
+SPL_LOAD_IMAGE_METHOD("RAM", 0, BOOT_DEVICE_RAM, spl_ram_load_image);
 #if defined(CONFIG_SPL_DFU_SUPPORT)
-SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_DFU, spl_ram_load_image);
+SPL_LOAD_IMAGE_METHOD("USB DFU", 0, BOOT_DEVICE_DFU, spl_ram_load_image);
 #endif
 #endif
 
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index c674e61..97edf78 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -352,6 +352,6 @@ static int spl_mmc_load_image(struct spl_image_info 
*spl_image,
return err;
 }
 
-SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_MMC1, spl_mmc_load_image);
-SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_MMC2, spl_mmc_load_image);
-SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_MMC2_2, spl_mmc_load_image);
+SPL_LOAD_IMAGE_METHOD("MMC1", 0, BOOT_DEVICE_MMC1, spl_mmc_load_image);
+SPL_LOAD_IMAGE_METHOD("MMC2", 0, BOOT_DEVICE_MMC2, spl_mmc_load_image);
+SPL_LOAD_IMAGE_METHOD("MMC2_2", 0, BOOT_DEVICE_MMC2_2, spl_mmc_load_image);
diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
index d1abda6..cd39f9b 100644
--- a/common/spl/spl_nand.c
+++ b/common/spl/spl_nand.c
@@ -151,4 +151,4 @@ static int spl_nand_load_image(struct spl_image_info 
*spl_image,
 }
 #endif
 /* Use priorty 1 so that Ubi can override this */
-SPL_LOAD_IMAGE_METHOD(1, BOOT_DEVICE_NAND, spl_nand_load_image);
+SPL_LOAD_IMAGE_METHOD("NAND", 1, BOOT_DEVICE_NAND, spl_nand_load_image);
diff --git a/common/spl/spl_net.c b/common/spl/spl_net.c
index f4b4bc4..0fba017 100644
--- a/common/spl/spl_net.c
+++ b/common/spl/spl_net.c
@@ -51,7 +51,8 @@ int spl_net_load_image_cpgmac(struct spl_image_info 
*spl_image,
 
return spl_net_load_image(spl_image, bootdev);
 }
-SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_CPGMAC, spl_net_load_image_cpgmac);
+SPL_LOAD_IMAGE_METHOD("eth device", 0, BOOT_DEVICE_CPGMAC,
+ spl_net_load_image_cpgmac);
 #endif
 
 #ifdef CONFIG_SPL_USBETH_SUPPORT
@@ -62,5 +63,5 @@ int spl_net_load_image_usb(struct spl_image_info *spl_image,
 
return 

[U-Boot] [PATCH 4/8] spl: Pass the loader into spl_load_image()

2016-11-17 Thread Simon Glass
Rather than have this function figure out the correct loader again, pass
it in as a parameter.

Signed-off-by: Simon Glass 
---

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

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 8c3a47d..4555216 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -365,12 +365,12 @@ static struct spl_image_loader *spl_ll_find_loader(uint 
boot_device)
return NULL;
 }
 
-static int spl_load_image(struct spl_image_info *spl_image, u32 boot_device)
+static int spl_load_image(struct spl_image_info *spl_image,
+ struct spl_image_loader *loader)
 {
struct spl_boot_device bootdev;
-   struct spl_image_loader *loader = spl_ll_find_loader(boot_device);
 
-   bootdev.boot_device = boot_device;
+   bootdev.boot_device = loader->boot_device;
bootdev.boot_device_name = NULL;
 
return loader->load_image(spl_image, );
@@ -391,7 +391,7 @@ static int boot_from_devices(struct spl_image_info 
*spl_image,
if (!loader)
puts("SPL: Unsupported Boot Device!\n");
 #endif
-   if (loader && !spl_load_image(spl_image, spl_boot_list[i]))
+   if (loader && !spl_load_image(spl_image, loader))
return 0;
}
 
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 6/8] spl: sunxi: Drop spl_board_announce_boot_device()

2016-11-17 Thread Simon Glass
This function is not used anymore. Drop it.

Signed-off-by: Simon Glass 
---

 arch/arm/mach-sunxi/board.c | 9 -
 1 file changed, 9 deletions(-)

diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
index 205236d..aa11493 100644
--- a/arch/arm/mach-sunxi/board.c
+++ b/arch/arm/mach-sunxi/board.c
@@ -247,15 +247,6 @@ u32 spl_boot_device(void)
return -1;  /* Never reached */
 }
 
-/*
- * Properly announce BOOT_DEVICE_BOARD as "FEL".
- * Overrides weak function from common/spl/spl.c
- */
-void spl_board_announce_boot_device(void)
-{
-   printf("FEL");
-}
-
 /* No confirmation data available in SPL yet. Hardcode bootmode */
 u32 spl_boot_mode(const u32 boot_device)
 {
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 7/8] spl: uniphier: Drop spl_board_announce_boot_device()

2016-11-17 Thread Simon Glass
This function is not used anymore. Drop it.

Signed-off-by: Simon Glass 
---

 arch/arm/mach-uniphier/boot-mode/spl_board.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/arch/arm/mach-uniphier/boot-mode/spl_board.c 
b/arch/arm/mach-uniphier/boot-mode/spl_board.c
index ba84087..a6b6686 100644
--- a/arch/arm/mach-uniphier/boot-mode/spl_board.c
+++ b/arch/arm/mach-uniphier/boot-mode/spl_board.c
@@ -12,11 +12,6 @@
 
 #include "../soc-info.h"
 
-void spl_board_announce_boot_device(void)
-{
-   printf("eMMC");
-}
-
 struct uniphier_romfunc_table {
void *mmc_send_cmd;
void *mmc_card_blockaddr;
-- 
2.8.0.rc3.226.g39d4020

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


Re: [U-Boot] [PATCH] drivers: net: keystone_net: add rgmii link type support when parsing dt

2016-11-17 Thread Tom Rini
On Mon, Nov 14, 2016 at 02:42:16PM +0530, Mugunthan V N wrote:

> Add support to detect RGMII link interface from link-interface
> device tree entry. Also rename the existing link type enums so
> that it provides meaning full interface like SGMII.
> 
> Signed-off-by: Mugunthan V N 

Reviewed-by: Tom Rini 

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 5/6] efi_loader: Allow to compile helloworld.efi w/o bundling it

2016-11-17 Thread Alexander Graf
Today we can compile a self-contained hello world efi test binary that
allows us to quickly verify whether the EFI loader framwork works.

We can use that binary outside of the self-contained test case though,
by providing it to a to-be-tested system via tftp.

This patch separates compilation of the helloworld.efi file from
including it in the u-boot binary for "bootefi hello". It also modifies
the efi_loader test case to enable travis to pick up the compiled file.
Because we're now no longer bloating the resulting u-boot binary, we
can enable compilation always, giving us good travis test coverage.

Signed-off-by: Alexander Graf 

---

v2 -> v3:

  - disable hello world on stm32f429
---
 arch/arm/lib/Makefile|  2 +-
 arch/x86/config.mk   |  2 +-
 arch/x86/lib/Makefile|  2 +-
 cmd/Kconfig  | 15 ++-
 configs/qemu-x86_efi_payload64_defconfig |  1 +
 configs/stm32f429-discovery_defconfig|  1 +
 lib/efi_loader/Makefile  |  3 +++
 test/py/tests/test_efi_loader.py |  2 +-
 8 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index a812306..0051f76 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -100,5 +100,5 @@ CFLAGS_REMOVE_$(EFI_CRT0) := $(CFLAGS_NON_EFI)
 CFLAGS_$(EFI_RELOC) := $(CFLAGS_EFI)
 CFLAGS_REMOVE_$(EFI_RELOC) := $(CFLAGS_NON_EFI)
 
-extra-$(CONFIG_CMD_BOOTEFI_HELLO) += $(EFI_CRT0) $(EFI_RELOC)
+extra-$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE) += $(EFI_CRT0) $(EFI_RELOC)
 extra-$(CONFIG_EFI) += $(EFI_CRT0) $(EFI_RELOC)
diff --git a/arch/x86/config.mk b/arch/x86/config.mk
index 03c71f7..1697dca 100644
--- a/arch/x86/config.mk
+++ b/arch/x86/config.mk
@@ -66,7 +66,7 @@ LDFLAGS_FINAL += --gc-sections -pie
 
 endif
 
-ifneq ($(CONFIG_EFI_STUB)$(CONFIG_CMD_BOOTEFI_HELLO),)
+ifneq ($(CONFIG_EFI_STUB)$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE),)
 
 ifneq ($(CONFIG_EFI_STUB_64BIT),)
 EFI_LDS := elf_x86_64_efi.lds
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index ff402dc..723288f 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -64,6 +64,6 @@ extra-$(CONFIG_EFI_STUB_64BIT) += crt0_x86_64_efi.o 
reloc_x86_64_efi.o
 
 endif
 
-ifneq ($(CONFIG_EFI_STUB)$(CONFIG_CMD_BOOTEFI_HELLO),)
+ifneq ($(CONFIG_EFI_STUB)$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE),)
 extra-y += $(EFI_CRT0) $(EFI_RELOC)
 endif
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 2a2f23e..b16c603 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -181,9 +181,22 @@ config CMD_BOOTEFI
help
  Boot an EFI image from memory.
 
+config CMD_BOOTEFI_HELLO_COMPILE
+   bool "Compile a standard EFI hello world binary for testing"
+   depends on CMD_BOOTEFI && (ARM || X86)
+   default y
+   help
+ This compiles a standard EFI hello world application with U-Boot so
+ that it can be used with the test/py testing framework. This is useful
+ for testing that EFI is working at a basic level, and for bringing
+ up EFI support on a new architecture.
+
+ No additional space will be required in the resulting U-Boot binary
+ when this option is enabled.
+
 config CMD_BOOTEFI_HELLO
bool "Allow booting a standard EFI hello world for testing"
-   depends on CMD_BOOTEFI && (ARM || X86)
+   depends on CMD_BOOTEFI_HELLO_COMPILE
help
  This adds a standard EFI hello world application to U-Boot so that
  it can be used with the 'bootefi hello' command. This is useful
diff --git a/configs/qemu-x86_efi_payload64_defconfig 
b/configs/qemu-x86_efi_payload64_defconfig
index c081ead..eaf0e32 100644
--- a/configs/qemu-x86_efi_payload64_defconfig
+++ b/configs/qemu-x86_efi_payload64_defconfig
@@ -52,3 +52,4 @@ CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_EFI=y
 CONFIG_EFI_STUB=y
 CONFIG_EFI_STUB_64BIT=y
+# CONFIG_CMD_BOOTEFI_HELLO_COMPILE is not set
diff --git a/configs/stm32f429-discovery_defconfig 
b/configs/stm32f429-discovery_defconfig
index 24e2221..bb161d4 100644
--- a/configs/stm32f429-discovery_defconfig
+++ b/configs/stm32f429-discovery_defconfig
@@ -10,3 +10,4 @@ CONFIG_SYS_PROMPT="U-Boot > "
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIMER=y
 CONFIG_OF_LIBFDT=y
+# CONFIG_CMD_BOOTEFI_HELLO_COMPILE is not set
diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
index f466408..fa8b91a 100644
--- a/lib/efi_loader/Makefile
+++ b/lib/efi_loader/Makefile
@@ -10,6 +10,9 @@
 CFLAGS_helloworld.o := $(CFLAGS_EFI)
 CFLAGS_REMOVE_helloworld.o := $(CFLAGS_NON_EFI)
 
+efiprogs-$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE) += helloworld.efi
+always := $(efiprogs-y)
+
 obj-$(CONFIG_CMD_BOOTEFI_HELLO) += helloworld_efi.o
 obj-y += efi_image_loader.o efi_boottime.o efi_runtime.o efi_console.o
 obj-y += efi_memory.o
diff --git a/test/py/tests/test_efi_loader.py b/test/py/tests/test_efi_loader.py
index 1c42653..7bf0170 100644
--- a/test/py/tests/test_efi_loader.py
+++ 

Re: [U-Boot] [GIT PULL] Xilinx changes

2016-11-17 Thread Tom Rini
On Tue, Nov 15, 2016 at 06:59:53PM +0100, Michal Simek wrote:

> Hi Tom,
> 
> please pull these changes to your tree.
> There are several things in this PR like
> DTS cleanups, Topic NL board with extending mkimage format and nand driver.
> 
> I have run buildman over it and there is not an issue.
> ./tools/buildman/buildman -b master zynq -C
> 
> Thanks,
> Michal
> 
> The following changes since commit 29e0cfb4f77f7aa369136302cee14a91e22dca71:
> 
>   Prepare v2016.11 (2016-11-14 11:27:11 -0500)
> 
> are available in the git repository at:
> 
>   git://www.denx.de/git/u-boot-microblaze.git master
> 
> for you to fetch changes up to 688d1be5ba63be281c2894e74b27209133598e2e:
> 
>   ARM64: zynqmp: Adding prefetchable memory space to pcie (2016-11-15
> 15:30:41 +0100)
> 

Applied to u-boot/master, thanks!




-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Please pull u-boot-mmc master

2016-11-17 Thread Tom Rini
On Wed, Nov 16, 2016 at 04:47:16PM +0900, Jaehoon Chung wrote:

> Dear Tom,
> 
> Could you these patches on u-boot/master, plz?
> 
> The following changes since commit 29e0cfb4f77f7aa369136302cee14a91e22dca71:
> 
>   Prepare v2016.11 (2016-11-14 11:27:11 -0500)
> 
> are available in the git repository at:
> 
>   http://git.denx.de/u-boot-mmc.git master
> 
> for you to fetch changes up to 91f839d2d30e489c2d6bf0deafb65b01d416b715:
> 
>   sunxi: sina33: Enable the LCD (2016-11-16 13:30:18 +0900)
> 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Stepping down as sunxi u-boot custodian (for real this time)

2016-11-17 Thread Hans de Goede

Hi,

On 17-11-16 20:50, Simon Glass wrote:

Hi Hans,

On 14 November 2016 at 04:53, Hans de Goede  wrote:

Hi All,

A while back I wrote:

"Between my $dayjob, linux-sunxi, other foss projects and last but
not least spending time with my wife and children I'm way too
busy lately.

So I've decided to seriously scale back my involvement in
linux-sunxi, as such I'm going to step down as u-boot sunxi
custodian."


Thanks for everything you have done, Hans! Are there really 100 sunxi
boards?


[hans@shalem u-boot]$ grep -l SUNXI configs/*_defconfig | wc -l
100

> You have been busy.

Yep.

Regards,

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


Re: [U-Boot] Stepping down as sunxi u-boot custodian (for real this time)

2016-11-17 Thread Simon Glass
Hi Hans,

On 17 November 2016 at 13:47, Hans de Goede  wrote:
>
> Hi,
>
> On 17-11-16 20:50, Simon Glass wrote:
>>
>> Hi Hans,
>>
>> On 14 November 2016 at 04:53, Hans de Goede  wrote:
>>>
>>> Hi All,
>>>
>>> A while back I wrote:
>>>
>>> "Between my $dayjob, linux-sunxi, other foss projects and last but
>>> not least spending time with my wife and children I'm way too
>>> busy lately.
>>>
>>> So I've decided to seriously scale back my involvement in
>>> linux-sunxi, as such I'm going to step down as u-boot sunxi
>>> custodian."
>>
>>
>> Thanks for everything you have done, Hans! Are there really 100 sunxi
>> boards?
>
>
> [hans@shalem u-boot]$ grep -l SUNXI configs/*_defconfig | wc -l
> 100

That was 99 a few weeks ago when I checked, but 100 is a much better number!

>
> > You have been busy.
>
> Yep.
>
> Regards,
>
> Hans

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


Re: [U-Boot] [PULL 00/24] efi patch queue 2016-11-17

2016-11-17 Thread Tom Rini
On Thu, Nov 17, 2016 at 05:21:14PM +0100, Alexander Graf wrote:

> Hi Tom,
> 
> This is my current patch queue for efi.  Please pull.
> 
> Alex
> 
> 
> The following changes since commit 29e0cfb4f77f7aa369136302cee14a91e22dca71:
> 
>   Prepare v2016.11 (2016-11-14 11:27:11 -0500)
> 
> are available in the git repository at:
> 
>   git://github.com/agraf/u-boot.git tags/signed-efi-next
> 
> for you to fetch changes up to b99ebaf9f01ebe864061818e00beb70cb1ddc635:
> 
>   ls2080ardb: Convert to distro boot (2016-11-17 14:18:56 +0100)
> 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/8] spl: Move the loading code into its own function

2016-11-17 Thread Simon Glass
Create a boot_from_devices() function to handle trying each device. This
helps to reduce the size of the already-large board_init_r() function.

Signed-off-by: Simon Glass 
---

 common/spl/spl.c | 33 +
 1 file changed, 21 insertions(+), 12 deletions(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 4f23c0e..8c3a47d 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -372,12 +372,29 @@ static int spl_load_image(struct spl_image_info 
*spl_image, u32 boot_device)
 
bootdev.boot_device = boot_device;
bootdev.boot_device_name = NULL;
-   if (loader)
-   return loader->load_image(spl_image, );
 
+   return loader->load_image(spl_image, );
+}
+
+static int boot_from_devices(struct spl_image_info *spl_image,
+u32 spl_boot_list[])
+{
+   int i;
+
+   for (i = 0; i < ARRAY_SIZE(spl_boot_list) &&
+spl_boot_list[i] != BOOT_DEVICE_NONE; i++) {
+   struct spl_image_loader *loader;
+
+   announce_boot_device(spl_boot_list[i]);
+   loader = spl_ll_find_loader(spl_boot_list[i]);
 #if defined(CONFIG_SPL_SERIAL_SUPPORT) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
-   puts("SPL: Unsupported Boot Device!\n");
+   if (!loader)
+   puts("SPL: Unsupported Boot Device!\n");
 #endif
+   if (loader && !spl_load_image(spl_image, spl_boot_list[i]))
+   return 0;
+   }
+
return -ENODEV;
 }
 
@@ -391,7 +408,6 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
BOOT_DEVICE_NONE,
};
struct spl_image_info spl_image;
-   int i;
 
debug(">>spl:board_init_r()\n");
 
@@ -418,15 +434,8 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
 
memset(_image, '\0', sizeof(spl_image));
board_boot_order(spl_boot_list);
-   for (i = 0; i < ARRAY_SIZE(spl_boot_list) &&
-   spl_boot_list[i] != BOOT_DEVICE_NONE; i++) {
-   announce_boot_device(spl_boot_list[i]);
-   if (!spl_load_image(_image, spl_boot_list[i]))
-   break;
-   }
 
-   if (i == ARRAY_SIZE(spl_boot_list) ||
-   spl_boot_list[i] == BOOT_DEVICE_NONE) {
+   if (boot_from_devices(_image, spl_boot_list)) {
puts("SPL: failed to boot from all boot devices\n");
hang();
}
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 1/8] spl: Use a single underscore in the SPL_LOAD_IMAGE_METHOD() macro

2016-11-17 Thread Simon Glass
A double underscore is normally reserved for compiler predefines. Use a
single underscore instead.

Signed-off-by: Simon Glass 
---

 include/spl.h | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/spl.h b/include/spl.h
index e080a82..11bdc2d 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -172,15 +172,15 @@ struct spl_image_loader {
ll_entry_declare(struct spl_image_loader, __name, spl_image_loader)
 
 /*
- * __priority is the priority of this method, 0 meaning it will be the top
+ * _priority is the priority of this method, 0 meaning it will be the top
  * choice for this device, 9 meaning it is the bottom choice.
- * __boot_device is the BOOT_DEVICE_... value
- * __method is the load_image function to call
+ * _boot_device is the BOOT_DEVICE_... value
+ * _method is the load_image function to call
  */
-#define SPL_LOAD_IMAGE_METHOD(__priority, __boot_device, __method) \
-   SPL_LOAD_IMAGE(__method ## __priority ## __boot_device) = { \
-   .boot_device = __boot_device, \
-   .load_image = __method, \
+#define SPL_LOAD_IMAGE_METHOD(_priority, _boot_device, _method) \
+   SPL_LOAD_IMAGE(_method ## _priority ## _boot_device) = { \
+   .boot_device = _boot_device, \
+   .load_image = _method, \
}
 
 /* SPL FAT image functions */
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 0/8] spl: Move image loader names into the linker list

2016-11-17 Thread Simon Glass
At present we have a linker list for all the image-loader methods but
announce_boot_device() uses its own switch() statement with the names of
each method. We may as well combine the name into the linker list.

The names are only needed if libcommon support is enabled, since printf()
is used to display then.

This series performs this adjustment, by adding the names and then
converting the generic SPL code over to use them. This allows the
board-specific spl_board_announce_boot_device() functions to be dropped as
well.


Simon Glass (8):
  spl: Use a single underscore in the SPL_LOAD_IMAGE_METHOD() macro
  spl: Add a name to the SPL load-image methods
  spl: Move the loading code into its own function
  spl: Pass the loader into spl_load_image()
  spl: Drop announce_boot_device()
  spl: sunxi: Drop spl_board_announce_boot_device()
  spl: uniphier: Drop spl_board_announce_boot_device()
  spl: sandbox: Drop spl_board_announce_boot_device()

 arch/arm/mach-sunxi/board.c  |  11 +--
 arch/arm/mach-uniphier/boot-mode/spl_board.c |   7 +-
 arch/sandbox/cpu/spl.c   |  19 +---
 common/spl/spl.c | 125 ++-
 common/spl/spl_mmc.c |   6 +-
 common/spl/spl_nand.c|   2 +-
 common/spl/spl_net.c |   5 +-
 common/spl/spl_nor.c |   2 +-
 common/spl/spl_onenand.c |   3 +-
 common/spl/spl_sata.c|   2 +-
 common/spl/spl_spi.c |   2 +-
 common/spl/spl_ubi.c |   4 +-
 common/spl/spl_usb.c |   2 +-
 common/spl/spl_ymodem.c  |   2 +-
 drivers/mtd/spi/sunxi_spi_spl.c  |   2 +-
 include/spl.h|  27 --
 16 files changed, 70 insertions(+), 151 deletions(-)

-- 
2.8.0.rc3.226.g39d4020

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


Re: [U-Boot] [PATCH v6 0/6] LS2080ARDB: Enable EFI boot support

2016-11-17 Thread york sun
On 11/17/2016 02:46 AM, Alexander Graf wrote:
> On 11/15/2016 11:11 PM, york sun wrote:
>> On 11/15/2016 12:36 PM, Alexander Graf wrote:
>>> Hi York,
>>>
>>> Do you want to take that patch set?
>>>
>> Yes, I can. I saw it assigned to you in patchwork so I didn't act.
>
> Hm, I've added a few fixups to my efi-next queue to make the ls2080
> patches not break. I think I'll just add them to my queue directly after
> all - that way we don't have dependencies on each other.
>
> I hope that's ok for you.

Totally. You have my review-by signature in most of them. I saw another 
compiling error last night. Please see the email thread for the related 
patch.

York

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


[U-Boot] [PATCH v2 5/6] efi_loader: Allow to compile helloworld.efi w/o bundling it

2016-11-17 Thread Alexander Graf
Today we can compile a self-contained hello world efi test binary that
allows us to quickly verify whether the EFI loader framwork works.

We can use that binary outside of the self-contained test case though,
by providing it to a to-be-tested system via tftp.

This patch separates compilation of the helloworld.efi file from
including it in the u-boot binary for "bootefi hello". It also modifies
the efi_loader test case to enable travis to pick up the compiled file.
Because we're now no longer bloating the resulting u-boot binary, we
can enable compilation always, giving us good travis test coverage.

Signed-off-by: Alexander Graf 
---
 arch/arm/lib/Makefile|  2 +-
 arch/x86/config.mk   |  2 +-
 arch/x86/lib/Makefile|  2 +-
 cmd/Kconfig  | 15 ++-
 configs/qemu-x86_efi_payload64_defconfig |  1 +
 lib/efi_loader/Makefile  |  3 +++
 test/py/tests/test_efi_loader.py |  2 +-
 7 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index a812306..0051f76 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -100,5 +100,5 @@ CFLAGS_REMOVE_$(EFI_CRT0) := $(CFLAGS_NON_EFI)
 CFLAGS_$(EFI_RELOC) := $(CFLAGS_EFI)
 CFLAGS_REMOVE_$(EFI_RELOC) := $(CFLAGS_NON_EFI)
 
-extra-$(CONFIG_CMD_BOOTEFI_HELLO) += $(EFI_CRT0) $(EFI_RELOC)
+extra-$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE) += $(EFI_CRT0) $(EFI_RELOC)
 extra-$(CONFIG_EFI) += $(EFI_CRT0) $(EFI_RELOC)
diff --git a/arch/x86/config.mk b/arch/x86/config.mk
index 03c71f7..1697dca 100644
--- a/arch/x86/config.mk
+++ b/arch/x86/config.mk
@@ -66,7 +66,7 @@ LDFLAGS_FINAL += --gc-sections -pie
 
 endif
 
-ifneq ($(CONFIG_EFI_STUB)$(CONFIG_CMD_BOOTEFI_HELLO),)
+ifneq ($(CONFIG_EFI_STUB)$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE),)
 
 ifneq ($(CONFIG_EFI_STUB_64BIT),)
 EFI_LDS := elf_x86_64_efi.lds
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index ff402dc..723288f 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -64,6 +64,6 @@ extra-$(CONFIG_EFI_STUB_64BIT) += crt0_x86_64_efi.o 
reloc_x86_64_efi.o
 
 endif
 
-ifneq ($(CONFIG_EFI_STUB)$(CONFIG_CMD_BOOTEFI_HELLO),)
+ifneq ($(CONFIG_EFI_STUB)$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE),)
 extra-y += $(EFI_CRT0) $(EFI_RELOC)
 endif
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 2a2f23e..b16c603 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -181,9 +181,22 @@ config CMD_BOOTEFI
help
  Boot an EFI image from memory.
 
+config CMD_BOOTEFI_HELLO_COMPILE
+   bool "Compile a standard EFI hello world binary for testing"
+   depends on CMD_BOOTEFI && (ARM || X86)
+   default y
+   help
+ This compiles a standard EFI hello world application with U-Boot so
+ that it can be used with the test/py testing framework. This is useful
+ for testing that EFI is working at a basic level, and for bringing
+ up EFI support on a new architecture.
+
+ No additional space will be required in the resulting U-Boot binary
+ when this option is enabled.
+
 config CMD_BOOTEFI_HELLO
bool "Allow booting a standard EFI hello world for testing"
-   depends on CMD_BOOTEFI && (ARM || X86)
+   depends on CMD_BOOTEFI_HELLO_COMPILE
help
  This adds a standard EFI hello world application to U-Boot so that
  it can be used with the 'bootefi hello' command. This is useful
diff --git a/configs/qemu-x86_efi_payload64_defconfig 
b/configs/qemu-x86_efi_payload64_defconfig
index c081ead..eaf0e32 100644
--- a/configs/qemu-x86_efi_payload64_defconfig
+++ b/configs/qemu-x86_efi_payload64_defconfig
@@ -52,3 +52,4 @@ CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_EFI=y
 CONFIG_EFI_STUB=y
 CONFIG_EFI_STUB_64BIT=y
+# CONFIG_CMD_BOOTEFI_HELLO_COMPILE is not set
diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
index f466408..fa8b91a 100644
--- a/lib/efi_loader/Makefile
+++ b/lib/efi_loader/Makefile
@@ -10,6 +10,9 @@
 CFLAGS_helloworld.o := $(CFLAGS_EFI)
 CFLAGS_REMOVE_helloworld.o := $(CFLAGS_NON_EFI)
 
+efiprogs-$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE) += helloworld.efi
+always := $(efiprogs-y)
+
 obj-$(CONFIG_CMD_BOOTEFI_HELLO) += helloworld_efi.o
 obj-y += efi_image_loader.o efi_boottime.o efi_runtime.o efi_console.o
 obj-y += efi_memory.o
diff --git a/test/py/tests/test_efi_loader.py b/test/py/tests/test_efi_loader.py
index 1c42653..7bf0170 100644
--- a/test/py/tests/test_efi_loader.py
+++ b/test/py/tests/test_efi_loader.py
@@ -104,7 +104,7 @@ def test_efi_setup_static(u_boot_console):
 global net_set_up
 net_set_up = True
 
-@pytest.mark.buildconfigspec('cmd_bootefi_hello')
+@pytest.mark.buildconfigspec('cmd_bootefi_hello_compile')
 def test_efi_helloworld_net(u_boot_console):
 """Run the helloworld.efi binary via TFTP.
 
-- 
1.8.5.6

___
U-Boot mailing list
U-Boot@lists.denx.de

[U-Boot] [PATCH v2 1/6] tests: net: Offset downloads to 4MB

2016-11-17 Thread Alexander Graf
The network test currently downloads files at 0MB offset of RAM start.
This works for most ARM systems, but x86 has weird memory layout constraints
on the first MB of RAM.

To not get caught into any of these, let's add a 4MB pad from start
of RAM to the default memory offset.

Signed-off-by: Alexander Graf 
---
 test/py/tests/test_net.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/py/tests/test_net.py b/test/py/tests/test_net.py
index 0884051..293b73a 100644
--- a/test/py/tests/test_net.py
+++ b/test/py/tests/test_net.py
@@ -147,7 +147,7 @@ def test_net_tftpboot(u_boot_console):
 
 addr = f.get('addr', None)
 if not addr:
-addr = u_boot_utils.find_ram_base(u_boot_console)
+addr = u_boot_utils.find_ram_base(u_boot_console) + (1024 * 1024 * 4)
 
 fn = f['fn']
 output = u_boot_console.run_command('tftpboot %x %s' % (addr, fn))
@@ -187,7 +187,7 @@ def test_net_nfs(u_boot_console):
 
 addr = f.get('addr', None)
 if not addr:
-addr = u_boot_utils.find_ram_base(u_boot_console)
+addr = u_boot_utils.find_ram_base(u_boot_console) + (1024 * 1024 * 4)
 
 fn = f['fn']
 output = u_boot_console.run_command('nfs %x %s' % (addr, fn))
-- 
1.8.5.6

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


[U-Boot] [PATCH v2 2/6] Travis: Expose build dir as variable

2016-11-17 Thread Alexander Graf
Some travis QEMU tests can transfer files between the build directory
and the guest U-Boot instance. For that to work, both need to have access
to the same directory.

This patch puts the current build path into an environment variable, so
that the environment generating python scripts can extract it from there
and read the respective files.

Signed-off-by: Alexander Graf 
---
 .travis.yml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 3d7fffe..acb41ea 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -86,10 +86,11 @@ script:
  # never prevent any test from running. That way, we can always pass
  # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
  # value.
- - if [[ "${TEST_PY_BD}" != "" ]]; then
+ - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD};
+   if [[ "${TEST_PY_BD}" != "" ]]; then
  ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
-k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
-   --build-dir `cd .. && pwd`/.bm-work/${TEST_PY_BD};
+   --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
fi
 
 matrix:
-- 
1.8.5.6

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


Re: [U-Boot] [PATCH] spi: Add support for MX66U51235F, MX66L1G45G and MT25QU02G

2016-11-17 Thread Jagan Teki
On Thu, Oct 27, 2016 at 3:48 AM, Bacrau, Dumitru
 wrote:
> Hi Teki,
>
> Sure, I can do that, but here is more information, maybe we can come up with 
> a better solution:
>
> For this device, the "U" in the part name means "1.8V". The equivalent 3.3V 
> part has "L" in the part name. So I would prefer having the names:
>  - MT25QL02G - for 3.3V device
>  - MT25QU02G - for the 1.8V device
>
> The advantages of this naming is that the string is easily searchable on the 
> web (for example if you search for N25Q1024 you will not find it on the 
> Micron website).

Sounds valid, submit with these changes, thanks.

-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PULL 00/24] efi patch queue 2016-11-17

2016-11-17 Thread Alexander Graf
Hi Tom,

This is my current patch queue for efi.  Please pull.

Alex


The following changes since commit 29e0cfb4f77f7aa369136302cee14a91e22dca71:

  Prepare v2016.11 (2016-11-14 11:27:11 -0500)

are available in the git repository at:

  git://github.com/agraf/u-boot.git tags/signed-efi-next

for you to fetch changes up to b99ebaf9f01ebe864061818e00beb70cb1ddc635:

  ls2080ardb: Convert to distro boot (2016-11-17 14:18:56 +0100)


Patch queue for efi - 2016-11-17

Highlights this time around:

  - x86 efi_loader support
  - hello world efi test case
  - network device name is now representative
  - terminal output reports modes correctly
  - fix psci reset for ls1043/ls1046
  - fix efi_add_runtime_mmio definition for x86
  - efi_loader support for ls2080


Alexander Graf (8):
  efi_loader: AArch64: Run EFI payloads in EL2 if U-Boot runs in EL3
  efi_loader: Disable PSCI reset for ls1043 and ls1046
  efi_loader: Fix efi_add_runtime_mmio definition
  ls2080: Exit dpaa only right before exiting U-Boot
  ls2080ardb: Reserve DP-DDR RAM
  armv8: ls2080a: Declare spin tables as reserved for efi loader
  armv8: fsl-layerscape: Add support for efi_loader RTS reset
  ls2080ardb: Convert to distro boot

Emmanuel Vadot (1):
  efi_loader: console: Correctly report modes

Masahiro Yamada (1):
  efi_loader: fix depends on line of EFI_LOADER

Oleksandr Tymoshenko (1):
  efi: Use device device path type Messaging for network interface node

Simon Glass (13):
  x86: Correct a build warning in x86 tables
  efi: Correct cache flush alignment
  efi: Fix debug message address format
  x86: Tidy up selection of building the EFI stub
  efi: Makefile: Export variables for use with EFI
  efi: Add support for a hello world test program
  elf: arm: Add a few ARM relocation types
  efi: arm: Add EFI app support
  efi: arm: Add aarch64 EFI app support
  x86: Move efi .lds files into the 'lib' directory
  x86: Move efi .S files into the 'lib' directory
  efi: x86: Adjust EFI files support efi_loader
  x86: Enable EFI loader support

 Kconfig|   1 +
 Makefile   |  11 +-
 arch/arm/config.mk |   7 ++
 arch/arm/cpu/armv8/Kconfig |   5 +-
 arch/arm/cpu/armv8/config.mk   |   4 +
 arch/arm/cpu/armv8/fsl-layerscape/cpu.c|  33 -
 arch/arm/cpu/armv8/fsl-layerscape/fdt.c|   6 +
 arch/arm/include/asm/u-boot-arm.h  |   1 +
 arch/arm/lib/Makefile  |  10 ++
 arch/arm/lib/bootm.c   |   7 ++
 arch/arm/lib/crt0_aarch64_efi.S| 135 
 arch/arm/lib/crt0_arm_efi.S| 138 +
 arch/arm/lib/elf_aarch64_efi.lds   |  70 +++
 arch/arm/lib/elf_arm_efi.lds   |  70 +++
 arch/arm/lib/reloc_aarch64_efi.c   |  87 +
 arch/arm/lib/reloc_arm_efi.c   |  66 ++
 arch/arm/lib/relocate.S|   3 +-
 arch/arm/lib/relocate_64.S |   3 +-
 arch/x86/config.mk |  20 ++-
 arch/x86/include/asm/u-boot-x86.h  |   1 +
 arch/x86/lib/Makefile  |  23 
 arch/x86/lib/bootm.c   |   4 +
 .../lib/{efi/crt0-efi-ia32.S => crt0_ia32_efi.S}   |   0
 .../{efi/crt0-efi-x86_64.S => crt0_x86_64_efi.S}   |   0
 arch/x86/lib/efi/Makefile  |  18 ---
 arch/x86/{cpu/efi => lib}/elf_ia32_efi.lds |   2 -
 arch/x86/{cpu/efi => lib}/elf_x86_64_efi.lds   |   2 -
 .../x86/lib/{efi/reloc_ia32.c => reloc_ia32_efi.c} |   0
 .../lib/{efi/reloc_x86_64.c => reloc_x86_64_efi.c} |   0
 arch/x86/lib/tables.c  |   2 +
 board/freescale/ls2080a/ls2080a.c  |   6 +-
 board/freescale/ls2080aqds/ls2080aqds.c|  11 +-
 board/freescale/ls2080ardb/ls2080ardb.c|  20 ++-
 cmd/Kconfig|   9 ++
 cmd/bootefi.c  |  40 --
 configs/efi-x86_defconfig  |   1 +
 doc/README.efi |  14 +++
 doc/README.x86 |   1 -
 drivers/net/fsl-mc/mc.c|  24 +++-
 include/asm-generic/sections.h |   2 +
 include/configs/ls2080ardb.h   |  26 +++-
 include/efi.h  |   7 +-
 include/efi_api.h  |  13 ++
 include/efi_loader.h

Re: [U-Boot] [PATCH v2 10/22] spi: Add error checking for invalid bus widths

2016-11-17 Thread Jagan Teki
On Mon, Nov 14, 2016 at 2:52 AM, Simon Glass  wrote:
> At present an invalid bus width prints a message but does not return an
> error. This is the opposite of the correct behaviour. Adjust it to avoid
> code bloat in the common case, and avoid hard-to-debug failure in the
> uncommon case.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  drivers/spi/spi-uclass.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/spi/spi-uclass.c b/drivers/spi/spi-uclass.c
> index 26eada2..358e229 100644
> --- a/drivers/spi/spi-uclass.c
> +++ b/drivers/spi/spi-uclass.c
> @@ -415,8 +415,8 @@ int spi_slave_ofdata_to_platdata(const void *blob, int 
> node,
> mode |= SPI_TX_QUAD;
> break;
> default:
> -   error("spi-tx-bus-width %d not supported\n", value);
> -   break;
> +   debug("spi-tx-bus-width %d not supported\n", value);
> +   return -EPROTONOSUPPORT;

Why we need to return? we can simply warn saying that un-supported
width so-that the plat->mode for prior mode assignment shouldn't fail.

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] cmd: move CMD_PXE to Kconfig

2016-11-17 Thread Yann E. MORIN
Peter, All,

On 2016-11-16 14:04 +, Peter Robinson spake thusly:
> On Sun, Nov 13, 2016 at 8:59 PM, Yann E. MORIN  
> wrote:
> > Currently, CMD_PXE is forcibly enabled in config_distro_defaults.h, so
> > that general purpose distributions can rely on it being defined. This
> > header is included, under conditions or not, by various archs or
> > famillies of archs / SoCs.
> >
> > However, it is very possible that boards based on those SoCs will not
> > have a physical ethernet connector at all, even if the have a MAC; for
> > example, the Nanopi Neo AIR (sunxi H3) does not. It is also possible
> > that network booting is absolutely not necessary for a device.
> >
> > However, it is not possible to disable the PXE command, as it is
> > forcibly enabled and is non-configurable.
> >
> > But it turns out we already have a config option to build a distro-ready
> > image, in the name of DISTRO_DEFAULTS.
> >
> > Move CMD_PXE out of the hard-coded config_distro_defaults.h into a
> > Kconfig option, that gets selected by DISTRO_DEFAULTS when it is set.
> 
> So this changes the default expectation on all boards that currently
> use distro defaults?

Well, I'm not totally aware of all the implications of such a change,
but my analysis is:

  - CONFIG_CMD_PXE was in include/config_distro_defaults.h, which to my
poor little brain means "we want that as a distro default";

  - CONFIG_CMD_PXE is now enabled by CONFIG_DISTRO_DEFAULTS, which means
the same (and the help text confirms that).

So, it looks to me that the expected behaviour does not change. In
theory! ;-)

Now, I may well have missed something, in which case I always accept
being enlighten; just point me to the pieces I missed (totally possible,
I'm new in U-Boot land!).

I'm running buildman on all configs right now, on current master (but it
takes a lot of time...). Once this is done, I'll re-run it on my change.
>From what I understand, buildman should point me to boards which are
affected by the change, right? When we have that list, we can assess
whether it is acceptable or not.

Thanks! :-)

Regards,
Yann E. MORIN.

> > Signed-off-by: "Yann E. MORIN" 
> > Cc: Joe Hershberger 
> > ---
> >  Kconfig  | 1 +
> >  cmd/Kconfig  | 5 +
> >  include/config_distro_defaults.h | 2 --
> >  3 files changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/Kconfig b/Kconfig
> > index 1263d0b..5421cd3 100644
> > --- a/Kconfig
> > +++ b/Kconfig
> > @@ -60,6 +60,7 @@ config DISTRO_DEFAULTS
> > select CMD_BOOTZ if ARM && !ARM64
> > select CMD_BOOTI if ARM64
> > select CMD_DHCP
> > +   select CMD_PXE
> > select CMD_EXT2
> > select CMD_EXT4
> > select CMD_FAT
> > diff --git a/cmd/Kconfig b/cmd/Kconfig
> > index e339d86..95f5ce6 100644
> > --- a/cmd/Kconfig
> > +++ b/cmd/Kconfig
> > @@ -496,6 +496,11 @@ config CMD_DHCP
> > help
> >   Boot image via network using DHCP/TFTP protocol
> >
> > +config CMD_PXE
> > +   bool "pxe"
> > +   help
> > + Boot image via network using PXE protocol
> > +
> >  config CMD_NFS
> > bool "nfs"
> > default y
> > diff --git a/include/config_distro_defaults.h 
> > b/include/config_distro_defaults.h
> > index b5efab5..01cd6d9 100644
> > --- a/include/config_distro_defaults.h
> > +++ b/include/config_distro_defaults.h
> > @@ -20,8 +20,6 @@
> >  #define CONFIG_BOOTP_PXE
> >  #define CONFIG_BOOTP_SUBNETMASK
> >
> > -#define CONFIG_CMD_PXE
> > -
> >  #define CONFIG_CMDLINE_EDITING
> >  #define CONFIG_AUTO_COMPLETE
> >  #define CONFIG_SYS_LONGHELP
> > --
> > 2.7.4
> >
> > ___
> > U-Boot mailing list
> > U-Boot@lists.denx.de
> > http://lists.denx.de/mailman/listinfo/u-boot

-- 
.-..--..
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN |  ___   |
| +33 223 225 172 `.---:  X  AGAINST  |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL|   v   conspiracy.  |
'--^---^--^'
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v8 7/8] armv8: fsl-layerscape: Add support for efi_loader RTS reset

2016-11-17 Thread york sun
On 11/17/2016 08:43 AM, Alexander Graf wrote:
>>>
>>
>> I still have this compiling error
>
> Can you please try my efi-next branch? It should hopefully be properly
> fixed in there.
>

I will try to find some time to. My server is busy these days. Don't you 
have the setup to run buildman?

For this patch, it adds efi_reset_system(). You already have it in 
arch/arm/cpu/armv8/fwcall.c.

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


Re: [U-Boot] 2016.09+fslc was working... But not anymore

2016-11-17 Thread Fabio Estevam
On Wed, Nov 16, 2016 at 4:57 PM, Carlos Alberto Musich Cuevas
 wrote:
> Hello,
>
> The following sequence is causing the error below.
>
> Please note that few days ago it was working.
>
>
>
> SEQUENCE
>
> $ cd ~/
> $ git clone 
> https://github.com/Freescale/u-boot-fslc.git
>  uboot2016
> $ cd uboot2016
> $ git checkout -b 2016.09+fslc remotes/origin/2016.09+fslc
> $ make udoo_defconfig
> $ make
>
> ERROR
>
> lib/asm-offsets.c:1:0: error: bad value (armv5) for -march= switch

It seems that you missed to export your toolchain.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v8 7/8] armv8: fsl-layerscape: Add support for efi_loader RTS reset

2016-11-17 Thread Alexander Graf



On 17/11/2016 18:02, york sun wrote:

On 11/17/2016 09:01 AM, Alexander Graf wrote:



On 17/11/2016 17:48, york sun wrote:

On 11/17/2016 08:43 AM, Alexander Graf wrote:




I still have this compiling error


Can you please try my efi-next branch? It should hopefully be properly
fixed in there.



I will try to find some time to. My server is busy these days. Don't you
have the setup to run buildman?


I'm moving to a travis based workflow. Unfortunately travis is quite
slow ;).

But yes, I've seen that problem and fixed it in efi-next.


For this patch, it adds efi_reset_system(). You already have it in
arch/arm/cpu/armv8/fwcall.c.


The problem is that those systems are not using PSCI. If they were, we
could just use the generic PSCI based reset implementation. So instead
we need to stub it out for FSL systems right now.

I'm still hoping we'll get to a point one day where all FSL systems
simply have a working PSCI implementation and we can drop the special
quirks :).



We are marching toward that direction. You can see some PSCI related
patches and some PPA (our implementation of trusted-firmware) related
patches.


So every time a system gets converted to PSCI, we can exclude it from 
the special efi_reset_system() implementation towards the generic PSCI one.


I'd appreciate if you could also be the second pair of eyes on patches 
to make sure we're moving them over when that moment comes.



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


[U-Boot] [PATCH v2 4/6] tests: Add efi_loader hello world test

2016-11-17 Thread Alexander Graf
Now that we have working network tests and a hello world efi application
built inside our tree, we can automatically test that efi binary running
inside of U-Boot.

Signed-off-by: Alexander Graf 
---
 test/py/tests/test_efi_loader.py | 158 +++
 1 file changed, 158 insertions(+)
 create mode 100644 test/py/tests/test_efi_loader.py

diff --git a/test/py/tests/test_efi_loader.py b/test/py/tests/test_efi_loader.py
new file mode 100644
index 000..1c42653
--- /dev/null
+++ b/test/py/tests/test_efi_loader.py
@@ -0,0 +1,158 @@
+# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
+# Copyright (c) 2016, Alexander Graf 
+#
+# based on test_net.py.
+#
+# SPDX-License-Identifier: GPL-2.0
+
+# Test efi loader implementation
+
+import pytest
+import u_boot_utils
+
+"""
+Note: This test relies on boardenv_* containing configuration values to define
+which the network environment available for testing. Without this, the parts
+that rely on network will be automatically skipped.
+
+For example:
+
+# Boolean indicating whether the Ethernet device is attached to USB, and hence
+# USB enumeration needs to be performed prior to network tests.
+# This variable may be omitted if its value is False.
+env__net_uses_usb = False
+
+# Boolean indicating whether the Ethernet device is attached to PCI, and hence
+# PCI enumeration needs to be performed prior to network tests.
+# This variable may be omitted if its value is False.
+env__net_uses_pci = True
+
+# True if a DHCP server is attached to the network, and should be tested.
+# If DHCP testing is not possible or desired, this variable may be omitted or
+# set to False.
+env__net_dhcp_server = True
+
+# A list of environment variables that should be set in order to configure a
+# static IP. If solely relying on DHCP, this variable may be omitted or set to
+# an empty list.
+env__net_static_env_vars = [
+("ipaddr", "10.0.0.100"),
+("netmask", "255.255.255.0"),
+("serverip", "10.0.0.1"),
+]
+
+# Details regarding a file that may be read from a TFTP server. This variable
+# may be omitted or set to None if TFTP testing is not possible or desired.
+env__efi_loader_helloworld_file = {
+"fn": "lib/efi_loader/helloworld.efi",
+"size": 5058624,
+"crc32": "c2244b26",
+}
+"""
+
+net_set_up = False
+
+def test_efi_pre_commands(u_boot_console):
+"""Execute any commands required to enable network hardware.
+
+These commands are provided by the boardenv_* file; see the comment at the
+beginning of this file.
+"""
+
+init_usb = u_boot_console.config.env.get('env__net_uses_usb', False)
+if init_usb:
+u_boot_console.run_command('usb start')
+
+init_pci = u_boot_console.config.env.get('env__net_uses_pci', False)
+if init_pci:
+u_boot_console.run_command('pci enum')
+
+@pytest.mark.buildconfigspec('cmd_dhcp')
+def test_efi_dhcp(u_boot_console):
+"""Test the dhcp command.
+
+The boardenv_* file may be used to enable/disable this test; see the
+comment at the beginning of this file.
+"""
+
+test_dhcp = u_boot_console.config.env.get('env__net_dhcp_server', False)
+if not test_dhcp:
+pytest.skip('No DHCP server available')
+
+u_boot_console.run_command('setenv autoload no')
+output = u_boot_console.run_command('dhcp')
+assert 'DHCP client bound to address ' in output
+
+global net_set_up
+net_set_up = True
+
+@pytest.mark.buildconfigspec('net')
+def test_efi_setup_static(u_boot_console):
+"""Set up a static IP configuration.
+
+The configuration is provided by the boardenv_* file; see the comment at
+the beginning of this file.
+"""
+
+env_vars = u_boot_console.config.env.get('env__net_static_env_vars', None)
+if not env_vars:
+pytest.skip('No static network configuration is defined')
+
+for (var, val) in env_vars:
+u_boot_console.run_command('setenv %s %s' % (var, val))
+
+global net_set_up
+net_set_up = True
+
+@pytest.mark.buildconfigspec('cmd_bootefi_hello')
+def test_efi_helloworld_net(u_boot_console):
+"""Run the helloworld.efi binary via TFTP.
+
+The helloworld.efi file is downloaded from the TFTP server and gets
+executed.
+"""
+
+if not net_set_up:
+pytest.skip('Network not initialized')
+
+f = u_boot_console.config.env.get('env__efi_loader_helloworld_file', None)
+if not f:
+pytest.skip('No hello world binary specified in environment')
+
+addr = f.get('addr', None)
+if not addr:
+addr = u_boot_utils.find_ram_base(u_boot_console) + (1024 * 1024 * 4)
+
+fn = f['fn']
+output = u_boot_console.run_command('tftpboot %x %s' % (addr, fn))
+expected_text = 'Bytes transferred = '
+sz = f.get('size', None)
+if sz:
+expected_text += '%d' % sz
+assert expected_text in output
+
+expected_crc = f.get('crc32', None)
+if not expected_crc:
+return
+
+   

[U-Boot] [PATCH v2 0/6] efi_laoder: Add travis test coverage

2016-11-17 Thread Alexander Graf
Now that we have Travis-CI support in U-Boot as well as a simple hello world
efi binary test case, we can make use of the two and verify that efi_loader
support still works on every commit.

This patch set enables network as well as basic efi_loader test coverage once
the uboot-test-hooks pull request at

  https://github.com/swarren/uboot-test-hooks/pull/9

is accepted.

---

v1 -> v2:

  - Make the tests actually work
  - New patch: Travis: Expose build dir as variable
  - New patch: Travis: Remove sleep test from integratorcp_cm926ejs-qemu test

Alexander Graf (6):
  tests: net: Offset downloads to 4MB
  Travis: Expose build dir as variable
  travis: Add python path for environments
  tests: Add efi_loader hello world test
  efi_loader: Allow to compile helloworld.efi w/o bundling it
  Travis: Remove sleep test from integratorcp_cm926ejs-qemu test

 .travis.yml  |   7 +-
 arch/arm/lib/Makefile|   2 +-
 arch/x86/config.mk   |   2 +-
 arch/x86/lib/Makefile|   2 +-
 cmd/Kconfig  |  15 ++-
 configs/qemu-x86_efi_payload64_defconfig |   1 +
 lib/efi_loader/Makefile  |   3 +
 test/py/tests/test_efi_loader.py | 158 +++
 test/py/tests/test_net.py|   4 +-
 9 files changed, 186 insertions(+), 8 deletions(-)
 create mode 100644 test/py/tests/test_efi_loader.py

-- 
1.8.5.6

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


[U-Boot] [PATCH v2 3/6] travis: Add python path for environments

2016-11-17 Thread Alexander Graf
When running in travis-ci, we want to pass environment configuration to
the tests. These reside in a path available through PYTHONPATH, so let's
define that one to point to the unit test repo.

Signed-off-by: Alexander Graf 
---
 .travis.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.travis.yml b/.travis.yml
index acb41ea..89f78d3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -49,6 +49,7 @@ install:
 env:
   global:
 - PATH=/tmp/dtc:/tmp/uboot-test-hooks/bin:$PATH
+- PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci
 - BUILD_DIR=build
 - HOSTCC="cc"
 - HOSTCXX="c++"
-- 
1.8.5.6

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


[U-Boot] [PATCH 8/8] spl: sandbox: Drop spl_board_announce_boot_device()

2016-11-17 Thread Simon Glass
This function is not used anymore. Drop it.

Signed-off-by: Simon Glass 
---

 arch/sandbox/cpu/spl.c | 17 +++--
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/arch/sandbox/cpu/spl.c b/arch/sandbox/cpu/spl.c
index 632446b..7cc76d4 100644
--- a/arch/sandbox/cpu/spl.c
+++ b/arch/sandbox/cpu/spl.c
@@ -25,19 +25,6 @@ u32 spl_boot_device(void)
return BOOT_DEVICE_BOARD;
 }
 
-void spl_board_announce_boot_device(void)
-{
-   char fname[256];
-   int ret;
-
-   ret = os_find_u_boot(fname, sizeof(fname));
-   if (ret) {
-   printf("(%s not found, error %d)\n", fname, ret);
-   return;
-   }
-   printf("%s\n", fname);
-}
-
 static int spl_board_load_image(struct spl_image_info *spl_image,
struct spl_boot_device *bootdev)
 {
@@ -45,8 +32,10 @@ static int spl_board_load_image(struct spl_image_info 
*spl_image,
int ret;
 
ret = os_find_u_boot(fname, sizeof(fname));
-   if (ret)
+   if (ret) {
+   printf("(%s not found, error %d)\n", fname, ret);
return ret;
+   }
 
/* Hopefully this will not return */
return os_spl_to_uboot(fname);
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH v2 6/6] Travis: Remove sleep test from integratorcp_cm926ejs-qemu test

2016-11-17 Thread Alexander Graf
Most of the time when running the sleep test in Travis for
the integratorcp_cm926ejs target I get errors like this:

  E   assert 2.01056289673 >= 3

The deviation is tiny, but fails the overall build result. Since
the sleep test is not terribly important as gate keeper for travis
tests, let's just exclude it for this board.

Signed-off-by: Alexander Graf 
---
 .travis.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.travis.yml b/.travis.yml
index 89f78d3..1957734 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -244,6 +244,7 @@ matrix:
   BUILDMAN="^vexpress_ca9x4$"
 - env:
 - TEST_PY_BD="integratorcp_cm926ejs"
+  TEST_PY_TEST_SPEC="not sleep"
   TEST_PY_ID="--id qemu"
   BUILDMAN="^integratorcp_cm926ejs$"
 - env:
-- 
1.8.5.6

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


Re: [U-Boot] Dynamically determine RAM size and pass it to kernel

2016-11-17 Thread Mike Looijmans

On 17-11-16 13:34, Mike Looijmans wrote:

We have some Zynq based boards still in the field that have only 512MB RAM
instead of 1GB. The memory chips are compatible and use the same settings
apart from that one extra address bit.

So what works is just configure the DDR controller for 1GB and then check if
writing some data "wraps" back, this is my "spike" code in the RAM init code
for that:

+   u32 *ptr_1 = (u32*)0x1;
+   u32 *ptr_2 = (u32*)((gd->ram_size >> 1) + 0x1);
+
+   puts("RAM test");
+   *ptr_1 = 0x12345678;
+   if (*ptr_2 == *ptr_1) {
+   *ptr_1 = 0x87654321;
+   if (*ptr_2 == *ptr_1) {
+   puts(" [HALF]");
+   gd->ram_size >>= 1;
+   }
+   }


I found that I can replace that with "get_mem_size()" which does this better.



This works well, and reliably detects that the board only has half the amount
of RAM, and corrects the ram_size variable.

The problem I'm seeing now is that this new ram_size does not get passed to
the kernel. Apparently in modern versions of u-boot I need to somehow patch
the "live" devicetree blob as well? How does that work?






Kind regards,

Mike Looijmans
System Expert

TOPIC Products
Materiaalweg 4, NL-5681 RJ Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
E-mail: mike.looijm...@topicproducts.com
Website: www.topicproducts.com

Please consider the environment before printing this e-mail





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


Re: [U-Boot] [PATCH 0/4] config: Add FreeBSD kconfig options

2016-11-17 Thread Tom Rini
On Thu, Nov 17, 2016 at 03:12:02PM +0100, Emmanuel Vadot wrote:
> On Fri, 11 Nov 2016 11:07:34 -0500
> Tom Rini  wrote:
> 
> > On Mon, Nov 07, 2016 at 09:34:27AM +0100, Emmanuel Vadot wrote:
> > 
> > > This series of patches add the needed bits for booting the FreeBSD
> > > loader.
> > > FreeBSD loader needs the U-Boot API and dache disabled for it to run so
> > > add kconfig options for them.
> > > Also add some some boot command that locate and run the FreeBSD loader
> > > if found.
> > > 
> > > Emmanuel Vadot (4):
> > >   kconfig: Add API kconfig file
> > >   kconfig: arm: Add SYS_DCACHE_OFF option
> > >   kconfig: Add a FREEBSD option
> > >   distro_bootcmd: Add command to run FreeBSD
> > > 
> > >  Kconfig |  2 ++
> > >  api/Kconfig |  9 +
> > >  arch/arm/Kconfig|  6 ++
> > >  common/Kconfig  |  9 +
> > >  include/config_distro_bootcmd.h | 32 
> > 
> > This is a good first start.  But I think there's a few things that need
> > tweaking.  First, we don't want to globally turn off dcache, but it does
> > need to be migrated to Kconfig (so we know if it's enabled or not).
> > Second, we should instead use CMD_CACHE and the 'dcache' command to
> > disable dcache prior to running the FreeBSD loader.  Then we make sure
> > that the generic distro feature has CMD_CACHE if !SYS_DCACHE_OFF (and
> > !SYS_ICACHE_OFF).  Thanks!
> > 
> > -- 
> > Tom
> 
>  Hi Tom,
> 
>  I will make the modification, should I sent the patch for
> migration of SYS_DCACHE_OFF to Kconfig as a separate patch ?

I'll grab (and re-run the moveconfig.py part) for the first two parts of
your series.

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v8 7/8] armv8: fsl-layerscape: Add support for efi_loader RTS reset

2016-11-17 Thread Alexander Graf



On 17/11/2016 17:41, york sun wrote:

On 11/16/2016 04:02 PM, Alexander Graf wrote:

When implementing efi loader support, we can expose runtime services
for payloads. One such service is CPU reset.

This patch implements RTS CPU reset support for layerscape systems.

Signed-off-by: Alexander Graf 
Reviewed-by: York Sun 

---

v4 -> v5:

  - Use __efi_runtime tags
---
 arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 33 +++--
 1 file changed, 31 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c 
b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
index b7a2e0c..0b516e3 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
@@ -17,6 +17,7 @@
 #ifdef CONFIG_MP
 #include 
 #endif
+#include 
 #include 
 #include 
 #ifdef CONFIG_FSL_ESDHC
@@ -462,9 +463,10 @@ int timer_init(void)
return 0;
 }

-void reset_cpu(ulong addr)
+__efi_runtime_data u32 __iomem *rstcr = (u32 *)CONFIG_SYS_FSL_RST_ADDR;
+
+void __efi_runtime reset_cpu(ulong addr)
 {
-   u32 __iomem *rstcr = (u32 *)CONFIG_SYS_FSL_RST_ADDR;
u32 val;

/* Raise RESET_REQ_B */
@@ -473,6 +475,33 @@ void reset_cpu(ulong addr)
scfg_out32(rstcr, val);
 }

+#ifdef CONFIG_EFI_LOADER
+
+void __efi_runtime EFIAPI efi_reset_system(
+  enum efi_reset_type reset_type,
+  efi_status_t reset_status,
+  unsigned long data_size, void *reset_data)
+{
+   switch (reset_type) {
+   case EFI_RESET_COLD:
+   case EFI_RESET_WARM:
+   reset_cpu(0);
+   break;
+   case EFI_RESET_SHUTDOWN:
+   /* Nothing we can do */
+   break;
+   }
+
+   while (1) { }
+}
+
+void efi_reset_system_init(void)
+{
+   efi_add_runtime_mmio(, sizeof(*rstcr));
+}
+
+#endif
+
 phys_size_t board_reserve_ram_top(phys_size_t ram_size)
 {
phys_size_t ram_top = ram_size;



I still have this compiling error


Can you please try my efi-next branch? It should hopefully be properly 
fixed in there.



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


Re: [U-Boot] [PATCH v5 10/13] tegra: Use a U-Boot-specific .dtsi file

2016-11-17 Thread Stephen Warren

On 11/16/2016 06:13 PM, Simon Glass wrote:

With the new device-tree rules it is possible to put device-tree changes
needed by U-Boot into their own file. As an example of this approach, move
Tegra over to use it.


Sounds like a good idea.


diff --git a/arch/arm/dts/tegra20-u-boot.dtsi b/arch/arm/dts/tegra20-u-boot.dtsi



+/ {
+   compatible = "nvidia,tegra20";
+   interrupt-parent = <>;


I don't think either of those lines is specific to U-Boot.

I'd expect to see more "U-Boot overlay" DTs than this; I recall there 
being more differences between U-Boot and kernel DTS files when I last 
sync'd the two.

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


Re: [U-Boot] [PATCH] board/ls2080rdb, qds: Enable ddr hashing for controller version 5.2.1

2016-11-17 Thread york sun
On 11/17/2016 01:39 AM, Priyanka Jain wrote:
> From: Priyanka Jain 
>
> Enable DDR hashing for DDR performance optimization
> on LS2088A which has DDR controller version 5.2.1
>
> Signed-off-by: Priyanka Jain 
> ---
>  board/freescale/ls2080aqds/ddr.c |5 +
>  board/freescale/ls2080ardb/ddr.c |5 +
>  2 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/board/freescale/ls2080aqds/ddr.c 
> b/board/freescale/ls2080aqds/ddr.c
> index 9c6f477..473dd7c 100644
> --- a/board/freescale/ls2080aqds/ddr.c
> +++ b/board/freescale/ls2080aqds/ddr.c
> @@ -8,6 +8,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include "ddr.h"
>
>  DECLARE_GLOBAL_DATA_PTR;
> @@ -134,6 +135,10 @@ found:
>   /* Enable ZQ calibration */
>   popts->zq_en = 1;
>
> + /* Enable DDR hashing */
> + if (fsl_ddr_get_version(0) == 0x50201)
> + popts->addr_hash = 1;
> +

We already have this option. You simply need to set it in hwconfig.

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


Re: [U-Boot] [PATCH 10/12] cmd: tpm_test: fix indentation

2016-11-17 Thread Simon Glass
On 15 November 2016 at 17:50, Andre Przywara  wrote:
> The final line with the linefeeds should obviously only printed once
> (what the code actually does), but the indentation suggests otherwise.
>
> Fix the indentation to avoid compiler warnings and puzzled readers.
>
> Pointed out by GCC 6.2's -Wmisleading-indentation warning.
>
> Signed-off-by: Andre Przywara 
> ---
>  cmd/tpm_test.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

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


Re: [U-Boot] [PATCH v8 7/8] armv8: fsl-layerscape: Add support for efi_loader RTS reset

2016-11-17 Thread york sun
On 11/16/2016 04:02 PM, Alexander Graf wrote:
> When implementing efi loader support, we can expose runtime services
> for payloads. One such service is CPU reset.
>
> This patch implements RTS CPU reset support for layerscape systems.
>
> Signed-off-by: Alexander Graf 
> Reviewed-by: York Sun 
>
> ---
>
> v4 -> v5:
>
>   - Use __efi_runtime tags
> ---
>  arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 33 
> +++--
>  1 file changed, 31 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c 
> b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
> index b7a2e0c..0b516e3 100644
> --- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
> +++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
> @@ -17,6 +17,7 @@
>  #ifdef CONFIG_MP
>  #include 
>  #endif
> +#include 
>  #include 
>  #include 
>  #ifdef CONFIG_FSL_ESDHC
> @@ -462,9 +463,10 @@ int timer_init(void)
>   return 0;
>  }
>
> -void reset_cpu(ulong addr)
> +__efi_runtime_data u32 __iomem *rstcr = (u32 *)CONFIG_SYS_FSL_RST_ADDR;
> +
> +void __efi_runtime reset_cpu(ulong addr)
>  {
> - u32 __iomem *rstcr = (u32 *)CONFIG_SYS_FSL_RST_ADDR;
>   u32 val;
>
>   /* Raise RESET_REQ_B */
> @@ -473,6 +475,33 @@ void reset_cpu(ulong addr)
>   scfg_out32(rstcr, val);
>  }
>
> +#ifdef CONFIG_EFI_LOADER
> +
> +void __efi_runtime EFIAPI efi_reset_system(
> +enum efi_reset_type reset_type,
> +efi_status_t reset_status,
> +unsigned long data_size, void *reset_data)
> +{
> + switch (reset_type) {
> + case EFI_RESET_COLD:
> + case EFI_RESET_WARM:
> + reset_cpu(0);
> + break;
> + case EFI_RESET_SHUTDOWN:
> + /* Nothing we can do */
> + break;
> + }
> +
> + while (1) { }
> +}
> +
> +void efi_reset_system_init(void)
> +{
> +   efi_add_runtime_mmio(, sizeof(*rstcr));
> +}
> +
> +#endif
> +
>  phys_size_t board_reserve_ram_top(phys_size_t ram_size)
>  {
>   phys_size_t ram_top = ram_size;
>

I still have this compiling error

21: armv8: fsl-layerscape: Add support for efi_loader RTS reset
aarch64:  +   ls1043aqds ls1043aqds_qspi ls1043aqds_nand 
ls1043aqds_lpuart ls1043aqds_sdcard_qspi ls1043aqds_nor_ddr3 
ls1043aqds_sdcard_ifc
+(ls1043aqds,ls1043aqds_qspi,ls1043aqds_nand,ls1043aqds_lpuart,ls1043aqds_sdcard_qspi,ls1043aqds_nor_ddr3,ls1043aqds_sdcard_ifc)
 
arch/arm/cpu/armv8/fsl-layerscape/built-in.o: In function 
`efi_reset_system':
+(ls1043aqds,ls1043aqds_qspi,ls1043aqds_nand,ls1043aqds_lpuart,ls1043aqds_sdcard_qspi,ls1043aqds_nor_ddr3,ls1043aqds_sdcard_ifc)
 
build/../arch/arm/cpu/armv8/fsl-layerscape/cpu.c:484: multiple 
definition of `efi_reset_system'
+(ls1043aqds,ls1043aqds_qspi,ls1043aqds_nand,ls1043aqds_lpuart,ls1043aqds_sdcard_qspi,ls1043aqds_nor_ddr3,ls1043aqds_sdcard_ifc)
 
arch/arm/cpu/armv8/fwcall.o:build/../arch/arm/cpu/armv8/fwcall.c:128: 
first defined here
+(ls1043aqds,ls1043aqds_qspi,ls1043aqds_nand,ls1043aqds_lpuart,ls1043aqds_sdcard_qspi,ls1043aqds_nor_ddr3,ls1043aqds_sdcard_ifc)
 
make[2]: *** [arch/arm/cpu/armv8/built-in.o] Error 1
+(ls1043aqds,ls1043aqds_qspi,ls1043aqds_nand,ls1043aqds_lpuart,ls1043aqds_sdcard_qspi,ls1043aqds_nor_ddr3,ls1043aqds_sdcard_ifc)
 
make[1]: *** [arch/arm/cpu/armv8] Error 2
22: ls2080ardb: Convert to distro boot
+ exit 128

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


Re: [U-Boot] Stepping down as sunxi u-boot custodian (for real this time)

2016-11-17 Thread Simon Glass
Hi Hans,

On 14 November 2016 at 04:53, Hans de Goede  wrote:
> Hi All,
>
> A while back I wrote:
>
> "Between my $dayjob, linux-sunxi, other foss projects and last but
> not least spending time with my wife and children I'm way too
> busy lately.
>
> So I've decided to seriously scale back my involvement in
> linux-sunxi, as such I'm going to step down as u-boot sunxi
> custodian."

Thanks for everything you have done, Hans! Are there really 100 sunxi
boards? You have been busy.

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


[U-Boot] [PATCH v2 6/7] spi: cadence_qspi: Fix CS timings

2016-11-17 Thread Phil Edworthy
The Cadence QSPI controller has specified overheads for the various CS
times that are in addition to those programmed in to the Device Delay
register. The overheads are different for the delays.

In addition, the existing code does not handle the case when the delay
is less than a SCLK period.

This change accurately calculates the additional delays in Ref clocks.

Signed-off-by: Phil Edworthy 
---
v2:
 Was "spi: cadence_qspi: Fix CQSPI_CAL_DELAY calculation"
 Note only did the existing code not cope with the delay less than
 an SCLK period, but the calculation didn't round properly, and
 didn't take into account the delays that the QSPI Controller adds
 to those programmed into the Device Delay reg.
---
 drivers/spi/cadence_qspi_apb.c | 23 ---
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/spi/cadence_qspi_apb.c b/drivers/spi/cadence_qspi_apb.c
index 72c7c79..4d53aad 100644
--- a/drivers/spi/cadence_qspi_apb.c
+++ b/drivers/spi/cadence_qspi_apb.c
@@ -169,9 +169,6 @@
((readl(base + CQSPI_REG_CONFIG) >> \
CQSPI_REG_CONFIG_IDLE_LSB) & 0x1)
 
-#define CQSPI_CAL_DELAY(tdelay_ns, tref_ns, tsclk_ns)  \
-   tdelay_ns) - (tsclk_ns)) / (tref_ns)))
-
 #define CQSPI_GET_RD_SRAM_LEVEL(reg_base)  \
(((readl(reg_base + CQSPI_REG_SDRAMLEVEL)) >>   \
CQSPI_REG_SDRAMLEVEL_RD_LSB) & CQSPI_REG_SDRAMLEVEL_RD_MASK)
@@ -357,16 +354,20 @@ void cadence_qspi_apb_delay(void *reg_base,
cadence_qspi_apb_controller_disable(reg_base);
 
/* Convert to ns. */
-   ref_clk_ns = (10) / ref_clk;
+   ref_clk_ns = DIV_ROUND_UP(10, ref_clk);
 
/* Convert to ns. */
-   sclk_ns = (10) / sclk_hz;
-
-   /* Plus 1 to round up 1 clock cycle. */
-   tshsl = CQSPI_CAL_DELAY(tshsl_ns, ref_clk_ns, sclk_ns) + 1;
-   tchsh = CQSPI_CAL_DELAY(tchsh_ns, ref_clk_ns, sclk_ns) + 1;
-   tslch = CQSPI_CAL_DELAY(tslch_ns, ref_clk_ns, sclk_ns) + 1;
-   tsd2d = CQSPI_CAL_DELAY(tsd2d_ns, ref_clk_ns, sclk_ns) + 1;
+   sclk_ns = DIV_ROUND_UP(10, sclk_hz);
+
+   /* The controller adds additional delay to that programmed in the reg */
+   if (tshsl_ns >= sclk_ns + ref_clk_ns)
+   tshsl_ns -= sclk_ns + ref_clk_ns;
+   if (tchsh_ns >= sclk_ns + 3 * ref_clk_ns)
+   tchsh_ns -= sclk_ns + 3 * ref_clk_ns;
+   tshsl = DIV_ROUND_UP(tshsl_ns, ref_clk_ns);
+   tchsh = DIV_ROUND_UP(tchsh_ns, ref_clk_ns);
+   tslch = DIV_ROUND_UP(tslch_ns, ref_clk_ns);
+   tsd2d = DIV_ROUND_UP(tsd2d_ns, ref_clk_ns);
 
reg = ((tshsl & CQSPI_REG_DELAY_TSHSL_MASK)
<< CQSPI_REG_DELAY_TSHSL_LSB);
-- 
2.7.4

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


Re: [U-Boot] [PATCH 01/27] Provide a generic io.h & address mapping functions

2016-11-17 Thread Paul Burton
On Monday, 3 October 2016 15:49:33 GMT Simon Glass wrote:
> Hi Paul,
> 
> On 1 October 2016 at 08:19, Paul Burton  wrote:
> > Most architectures currently supported by U-Boot use trivial
> > implementations of map_to_physmem & virt_to_phys which simply cast a
> > physical address to a pointer for use a virtual address & vice-versa.
> > This results in a lot of duplicate implementations of these mapping
> > functions.
> > 
> > The functions provided by different architectures also differs, with
> > some having implementations of phys_to_virt & others not. A later patch
> > in this series will make use of phys_to_virt, so requires that it be
> > provided for all architectures.
> > 
> > This patch introduces an asm-generic/io.h which provides generic
> > implementations of address mapping functions, allowing the duplication
> > of them between architectures to be removed. Once architectures are
> > converted to make use of this generic header it will also ensure that
> > all of phys_to_virt, virt_to_phys, map_physmem & unmap_physmem are
> > provided. The 2 families of functions differ in that map_physmem may
> > create dynamic mappings whilst phys_to_virt may not & therefore is more
> > limited in scope but doesn't require information such as a length &
> > flags.
> > 
> > This patch doesn't convert any architectures to make use of this generic
> > header - later patches in the series will do so.
> > 
> > Signed-off-by: Paul Burton 
> > Cc: Albert Aribaud 
> > Cc: Alexey Brodkin 
> > Cc: Alison Wang 
> > Cc: Angelo Dureghello 
> > Cc: Bin Meng 
> > Cc: Daniel Schwierzeck 
> > Cc: Francois Retief 
> > Cc: Macpaul Lin 
> > Cc: Michal Simek 
> > Cc: Mike Frysinger 
> > Cc: Nobuhiro Iwamatsu 
> > Cc: Scott McNutt 
> > Cc: Sonic Zhang 
> > Cc: Thomas Chou 
> > Cc: Wolfgang Denk 
> > ---
> > 
> >  include/asm-generic/io.h | 110
> >  +++ 1 file changed, 110
> >  insertions(+)
> >  create mode 100644 include/asm-generic/io.h
> 
> Reviewed-by: Simon Glass 
> 
> Question and nits below.
> 
> > diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
> > new file mode 100644
> > index 000..dd3a46d
> > --- /dev/null
> > +++ b/include/asm-generic/io.h
> > @@ -0,0 +1,110 @@
> > +/*
> > + * Generic I/O functions.
> > + *
> > + * Copyright (c) 2016 Imagination Technologies Ltd.
> > + *
> > + * SPDX-License-Identifier:GPL-2.0+
> > + */
> > +
> > +#ifndef __ASM_GENERIC_IO_H__
> > +#define __ASM_GENERIC_IO_H__
> > +
> > +/*
> > + * This file should be included at the end of each architecture-specific
> > + * asm/io.h such that we may provide generic implementations without
> > + * conflicting with architecture-specific code.
> > + */
> > +
> > +#ifndef __ASSEMBLY__
> > +
> > +/**
> > + * phys_to_virt() - Return a virtual address mapped to a given physical
> > address + * @paddr: the physical address
> > + *
> 
> @return

Hi Simon,

I was under the impression that we're following the kernel-doc style, both 
based on the style of existing comments & the statement from the CodingStyle 
page of the wiki:

  U-Boot adopted the kernel-doc annotation style, this is the only exception
  from multi-line comment rule of Coding Style. While not mandatory, adding
  documentation is strongly advised. The Linux kernel kernel-doc document
  applies with no changes.

  (From http://www.denx.de/wiki/U-Boot/CodingStyle)

The kernel-doc-nano-HOWTO.txt file linked to from that wiki paragraph & 
included in the Linux kernel source shows this example:

  /**
   * foobar() - short function description of foobar
   * @arg1: Describe the first argument to foobar.
   * @arg2: Describe the second argument to foobar.
   *One can provide multiple line descriptions
   *for arguments.
   *
   * A longer description, with more discussion of the function foobar()
   * that might be useful to those using or modifying it.  Begins with
   * empty comment line, and may include additional embedded empty
   * comment lines.
   *
   * The longer description can have multiple paragraphs.
   *
   * Return: Describe the return value of foobar.
   */

Nowhere does it use @return & that's not what's done in Linux, so my belief is 
that having a "Return:" line at the end of the comment is the right way.

> 
> > + * Returns a virtual address which the CPU can access that maps to the
> > physical + * address @paddr. This should only be used where it is known
> > that no dynamic + * mapping is required. In general, map_physmem should
> > be used instead. + *
> > + * Returns: a virtual 

Re: [U-Boot] [PATCH] SPI: add support for the EON EN25Q80B flash chip

2016-11-17 Thread Jagan Teki
On Fri, Nov 11, 2016 at 2:17 AM, Angus Ainslie  wrote:
> add a new jedec id for the EN25Q80B

NAK, no s-o-b
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: OMAP3_LOGIC: Remove FIT Support

2016-11-17 Thread Tom Rini
On Sat, Nov 12, 2016 at 09:53:31PM -0600, Adam Ford wrote:

> Commit ("2cd1ff84037a: OMAP3_LOGIC: Setup defconfig to enable
> SPL and NAND booting") accidentally enabled FIT support.
> 
> This patch removes the FIT support.
> 
> Signed-off-by: Adam Ford 
> 
> diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig
> index c8eb5b5..ac1a6a3 100644

Reviewed-by: Tom Rini 

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Stepping down as sunxi u-boot custodian (for real this time)

2016-11-17 Thread Maxime Ripard
Hi Hans,

On Mon, Nov 14, 2016 at 12:53:13PM +0100, Hans de Goede wrote:
> Hi All,
> 
> A while back I wrote:
> 
> "Between my $dayjob, linux-sunxi, other foss projects and last but
> not least spending time with my wife and children I'm way too
> busy lately.
> 
> So I've decided to seriously scale back my involvement in
> linux-sunxi, as such I'm going to step down as u-boot sunxi
> custodian."
> 
> After that I did get some breathing room, and kept doing
> sunxi u-boot maintenance until now, but this still feels
> too much like a job rather then a hobby. The problem is
> that I don't want to think during the weekend:
> "Oh !@#$ I still need to prep a u-boot sunxi pull-req"
> 
> This is nothing against the u-boot community, I think
> you're all great and I still love thinkering with this
> kind of stuff, but when a hobby starts feeling as a chore
> something is wrong.
> 
> So after this mail I'm going to send a mail updating
> the MAINTAINERS status of sunxi to orphan and I will also
> unsubscribe myself from the u-boot list to protect myself
> against getting dragged in again.
> 
> I do expect (after taking a break for a couple of weeks)
> that I will likely submit the occasional patch, but at
> this point in time I do not want any maintainer
> responsibilities.
> 
> Yesterday and today I've gone over my pending patches
> queue, reviewed then all and I've merged all the ones
> which looked good into u-boot-sunxi/next, so that
> should be a good starting point for the next
> maintainer.

Thanks a lot for the great work you did over those years :)

> Jagan (in the Cc) has indicated in the past that he is
> interested in taking over as sunxi custodian, Jagan already
> is the SPI custodian, so I believe that he will do well.
> 
> So Jagan, if you still want the job, go for it.

As I said before, I can help whoever is willing to take over by
becoming co-maintainer for some time, in order to make the transition
as smooth as possible.

Jagan, are you still willing to do this?

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


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


Re: [U-Boot] [PATCH] splash: fix splash source flags check

2016-11-17 Thread Tom Rini
On Wed, Nov 16, 2016 at 01:02:32PM +0200, Tomas Melin wrote:

> SPLASH_STORAGE_RAW is defined as 0, so a check against & will
> never be true. These flags are never combined so do a check
> against == instead.
> 
> Signed-off-by: Tomas Melin 

Reviewed-by: Tom Rini 

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Fixed clock driver (clk: convert API to match reset/mailbox style)

2016-11-17 Thread Simon Glass
Hi Michal,

On 16 November 2016 at 00:15, Michal Simek  wrote:
> Hi Simon,
>
> On 15.11.2016 20:23, Simon Glass wrote:
>> Hi Michal,
>>
>> On 15 November 2016 at 12:07, Michal Simek  wrote:
>>> Hi guys,
>>>
>>> I just found today with playing with clock drivers that the patch
>>> clk: convert API to match reset/mailbox style
>>> (sha1: 135aa95002646c46e89de93fa36adad1b010548f)
>>>
>>> added this part of code to fixed clock driver
>>> -static ulong clk_fixed_rate_get_rate(struct udevice *dev)
>>> +static ulong clk_fixed_rate_get_rate(struct clk *clk)
>>>  {
>>> -   return to_clk_fixed_rate(dev)->fixed_rate;
>>> -}
>>> +   if (clk->id != 0)
>>> +   return -EINVAL;
>>>
>>>
>>> which is returning -EINVAL when ulong should be returned.
>>
>> This is intended - you can use IS_ERR_VALUE() to check if it is an error.
>
> ok then some drivers needs to be fixed.
>
> drivers/mmc/atmel_sdhci.c:90:   ret = clk_set_rate(, gck_rate);
> drivers/mmc/atmel_sdhci.c-91-   if (ret)
> drivers/mmc/atmel_sdhci.c-92-   return ret;
>
>
> drivers/mmc/msm_sdhci.c:79: ret = clk_set_rate(, clk_rate);
> drivers/mmc/msm_sdhci.c-80- clk_free();
> drivers/mmc/msm_sdhci.c-81- if (ret < 0)
>
> drivers/net/dwc_eth_qos.c:484:  ret = clk_set_rate(>clk_ptp_ref,
> 125 * 1000 * 1000);
> drivers/net/dwc_eth_qos.c-485-  if (ret < 0) {
> drivers/net/dwc_eth_qos.c:486:  error("clk_set_rate(clk_ptp_ref)
> failed: %d", ret);
> drivers/net/dwc_eth_qos.c-487-  goto err_disable_clk_ptp_ref;
> drivers/net/dwc_eth_qos.c-488-  }
>
> drivers/serial/serial_msm.c:175:ret = clk_set_rate(, clk_rate);
> drivers/serial/serial_msm.c-176-clk_free();
> drivers/serial/serial_msm.c-177-if (ret < 0)
>
> drivers/spi/rk_spi.c:176:   ret = clk_set_rate(>clk, 9900);
> drivers/spi/rk_spi.c-177-   if (ret < 0) {
> drivers/spi/rk_spi.c-178-   debug("%s: Failed to set clock:
> %d\n", __func__, ret);

Yes indeed.

>
>
>>
>>>
>>> The next thing I have found is that fixed clock driver has no set_rate
>>> function which is fine but when I was testing one driver which tries to
>>> set rate then error code was generated but without any useful
>>> information what happened.
>>
>> It should return -ENOSYS, right?
>
> I think -EINVAL in driver as reaction for incorrect id looks good.
> It was more about returning minus value where you should return unsigned.

Yes that's right. I meant -ENOSYS when the driver does not implement the method.

But consider -ENOENT when there is no such thing, as we tend to use
-EINVAL for invalid data (e.g. in device tree)

>
>>
>>> Are you ok with adding empty set_rate function with returning error
>>> message that set rate is not supported for fixed clocks?
>>
>> What would it return that is different? If you are asking for a
>> printed error message, that would bloat the code. So long as the
>> caller checks the error we should be OK.
>
> Caller checks the return code for sure but it is a question if this is
> enough for people to know what's wrong. When this happen you have no
> clue that this problem is coming from clock subsystem.
> I can add one print message to the driver but the same message will end
> up in all these drivers.

IMO a nice solution to this sort of thing is to improve U-Boot's debug
facilities, so you can turn on debugging without having to add #define
DEBUG in each file. The problem is that you bloat the code for a case
that (once development is done) never happens. In particular a great
feature would be something that prints out an error trace, showing
where the error is created. E.g.

#ifdef GLOBAL_DEBUG
#define ERR_RET(val)  ({ printf("%s: %d: Returning error %d\n",
__func__, _LINE__, val); return (val); }, ret)
#else
#define ERR_RET(val) (val)
#endif

Then:

if (ret)
   return ERR_RET(ret)

If we start adding printf() to drivers we carry that load into
production code. I think it is easy to print the error in the board
and then you can start digging.

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


Re: [U-Boot] New UCLASS_PINCTRL driver - probe is not called for all nodes

2016-11-17 Thread Simon Glass
Hi Konstantin,

On 15 November 2016 at 06:56, Konstantin Porotchkin  wrote:
> Hi, All,
>
> I am currently porting the Marvell (mvebu) pin control driver for Armada-8K
> family  to the current u-boot sources.
> The Armada 8K SoC is a hybrid chip that contains several interconnected
> dies in a single package.
> Each such device (AP, CP0, CP1) has an independent pin controller with
> different memory mapping.
> The DTS for such configuration looks like the following:
> / {
> ap806 {
> config-space {
> pinctl: pinctl@6F4000 {
> ...
> };
> };
> };
> cp110-master {
> config-space {
> cpm_pinctl: pinctl@44000 {
> ...
> };
> };
> };
> cp110-slave {
> config-space {
> cps_pinctl: pinctl@44000 {
> ...
> };
> };
> };
> };
>
> I expect that my driver "probe" method will be called 3 times - one for
> every controller.
> However, according to my test, only the first controller is probed
> (pinctl@6F4000).
> Two others are listed in the DM tree, but are not active (not probed).
>
> I can do a trick and sequentially call uclass_get_device() function for
> the UCLASS_PINCTRL type, causing all 3 controller to be probed and
> activated.
> However I think this is not the way it should work.
> Is my assumption wrong and such hybrid devices should use the above trick
> for bringing up all controllers in the package?

They should be activated automatically by devices that use them. This
is the pinctrl-0 property in the device. Can you take a look at why
that is not working?

Specifically, see pinctrl_select_state() in device_probe().

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


Re: [U-Boot] [PATCH 1/3] dts: rk3288: correct sdram setting for miniarm

2016-11-17 Thread Simon Glass
On 14 November 2016 at 21:01, Jacob Chen  wrote:
> miniarm board use lpddr3
>
> Signed-off-by: Jacob Chen 
> ---
>
>  arch/arm/dts/rk3288-miniarm.dts | 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)

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


Re: [U-Boot] [PATCHv3 02/15] dm: pci: return the real controller in pci_bus_to_hose()

2016-11-17 Thread Simon Glass
On 16 November 2016 at 02:48, Zhiqiang Hou  wrote:
> From: Minghuan Lian 
>
> for the legacy PCI driver, the function pci_bus_to_hose() returns
> the real PCIe controller. To keep consistency, this function is
> changed to return the PCIe controller pointer of the root bus
> instead of the current PCIe bus.
>
> Signed-off-by: Minghuan Lian 
> Signed-off-by: Hou Zhiqiang 
> ---
> V3:
>  - No change
>
>  drivers/pci/pci_compat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH v3 1/3] spl: add RAM boot device only if it is actually defined

2016-11-17 Thread Stefan Agner
On 2016-11-17 17:14, Simon Glass wrote:
> Hi Stefan,
> 
> On 15 November 2016 at 14:02, Stefan Agner  wrote:
>> From: Stefan Agner 
>>
>> Some devices (e.g. dra7xx) support loading to RAM using DFU without
>> having direct boot from RAM support. Make sure the linker list
>> does not contain BOOT_DEVICE_RAM if CONFIG_SPL_RAM_SUPPORT is not
>> enabled.
>>
>> Fixes: 98136b2f26fa ("spl: Convert spl_ram_load_image() to use linker list")
>>
>> Signed-off-by: Stefan Agner 
>> ---
>>
>> Changes in v3: None
>> Changes in v2:
>> - Use CONFIG_SPL_RAM_SUPPORT to descide whether to compile the
>>   function in first place.
>>
>>  common/spl/spl.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/common/spl/spl.c b/common/spl/spl.c
>> index bdb165a..ef17619 100644
>> --- a/common/spl/spl.c
>> +++ b/common/spl/spl.c
>> @@ -174,7 +174,7 @@ __weak void __noreturn jump_to_image_no_args(struct 
>> spl_image_info *spl_image)
>>  # define CONFIG_SPL_LOAD_FIT_ADDRESS   0
>>  #endif
>>
>> -#if defined(CONFIG_SPL_RAM_DEVICE) || defined(CONFIG_SPL_DFU_SUPPORT)
>> +#if defined(CONFIG_SPL_RAM_SUPPORT) || defined(CONFIG_SPL_DFU_SUPPORT)

I just realized that this patch is wrong, the config option is currently
named "CONFIG_SPL_RAM_DEVICE". I will send a v4.



>>  static ulong spl_ram_load_read(struct spl_load_info *load, ulong sector,
>>ulong count, void *buf)
> 
> Can this be moved into its own file?
> 

Hm, we discussed that on v2:
https://www.mail-archive.com/u-boot@lists.denx.de/msg230689.html

I planned to post a separate patch for that.

For the separate patch, how should I do this? CONFIG_SPL_RAM_DEVICE is
still old config, so I guess I would first have to move that to Kconfig.

What is CONFIG_SPL_RAM_DEVICE actually doing? I think it means that the
image to boot is already there? (loaded by boot ROM?)


CONFIG_SPL_RAM_SUPPORT "Enable booting directly from RAM"
CONFIG_SPL_RAM_DEVICE depends on CONFIG_SPL_RAM_SUPPORT "Image preloaded
by ROM"
CONFIG_SPL_DFU_SUPPORT depends on CONFIG_SPL_RAM_SUPPORT "Load image via
DFU"


--
Stefan

>>  {
>> @@ -220,7 +220,9 @@ static int spl_ram_load_image(struct spl_image_info 
>> *spl_image,
>>
>> return 0;
>>  }
>> +#if defined(CONFIG_SPL_RAM_SUPPORT)
>>  SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_RAM, spl_ram_load_image);
>> +#endif
>>  #if defined(CONFIG_SPL_DFU_SUPPORT)
>>  SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_DFU, spl_ram_load_image);
>>  #endif
>> --
>> 2.10.2
>>
> 
> Regards,
> Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


  1   2   >