[U-Boot] [PATCH v2 2/2] rockchip: configs: make rk3036 env config same as rk3288

2016-11-17 Thread Jacob Chen
To make rockchip soc keep the same partition map


Signed-off-by: Jacob Chen 
---

Changes in v2:
- add a commit message

 include/configs/kylin_rk3036.h | 17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/include/configs/kylin_rk3036.h b/include/configs/kylin_rk3036.h
index 4f0bd84..bc28525 100644
--- a/include/configs/kylin_rk3036.h
+++ b/include/configs/kylin_rk3036.h
@@ -19,9 +19,20 @@
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0 /* emmc */
 #define CONFIG_SYS_MMC_ENV_PART0 /* user area */
-#define CONFIG_ENV_OFFSET  (SZ_4M - SZ_64K) /* reserved area */
-#define CONFIG_ENV_OFFSET_REDUND   (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
-#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
+
+#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+/* SPL @ 32k for 34k
+ * u-boot directly after @ 68k for 400k or so
+ * ENV @ 992k
+ */
+#define CONFIG_ENV_OFFSET ((1024-32) * 1024)
+#else
+/* SPL @ 32k for ~36k
+ * ENV @ 96k
+ * u-boot @ 128K
+ */
+#define CONFIG_ENV_OFFSET (96 * 1024)
+#endif
 
 #endif
 
-- 
1.9.1

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


[U-Boot] [PATCH v2 1/2] rockchip: configs: correct env offset when enable CONFIG_ROCKCHIP_SPL_BACK_TO_BROM

2016-11-17 Thread Jacob Chen
With CONFIG_ROCKCHIP_SPL_BACK_TO_BROM enabled,
the environment is inside u-boot.
So solve it by moving environment after u-boot.

Signed-off-by: Jacob Chen 
---

Changes in v2:
- add a commit message

 include/configs/evb_rk3288.h  | 9 +
 include/configs/fennec_rk3288.h   | 9 +
 include/configs/miniarm_rk3288.h  | 9 +
 include/configs/popmetal_rk3288.h | 9 +
 4 files changed, 36 insertions(+)

diff --git a/include/configs/evb_rk3288.h b/include/configs/evb_rk3288.h
index 390c243..90b810a 100644
--- a/include/configs/evb_rk3288.h
+++ b/include/configs/evb_rk3288.h
@@ -12,11 +12,20 @@
 
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
+
+#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+/* SPL @ 32k for 34k
+ * u-boot directly after @ 68k for 400k or so
+ * ENV @ 992k
+ */
+#define CONFIG_ENV_OFFSET ((1024-32) * 1024)
+#else
 /* SPL @ 32k for ~36k
  * ENV @ 96k
  * u-boot @ 128K
  */
 #define CONFIG_ENV_OFFSET (96 * 1024)
+#endif
 
 #define CONFIG_SYS_WHITE_ON_BLACK
 #define CONFIG_CONSOLE_SCROLL_LINES10
diff --git a/include/configs/fennec_rk3288.h b/include/configs/fennec_rk3288.h
index 390c243..90b810a 100644
--- a/include/configs/fennec_rk3288.h
+++ b/include/configs/fennec_rk3288.h
@@ -12,11 +12,20 @@
 
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
+
+#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+/* SPL @ 32k for 34k
+ * u-boot directly after @ 68k for 400k or so
+ * ENV @ 992k
+ */
+#define CONFIG_ENV_OFFSET ((1024-32) * 1024)
+#else
 /* SPL @ 32k for ~36k
  * ENV @ 96k
  * u-boot @ 128K
  */
 #define CONFIG_ENV_OFFSET (96 * 1024)
+#endif
 
 #define CONFIG_SYS_WHITE_ON_BLACK
 #define CONFIG_CONSOLE_SCROLL_LINES10
diff --git a/include/configs/miniarm_rk3288.h b/include/configs/miniarm_rk3288.h
index aa259db..645d023 100644
--- a/include/configs/miniarm_rk3288.h
+++ b/include/configs/miniarm_rk3288.h
@@ -17,11 +17,20 @@
 
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0
+
+#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+/* SPL @ 32k for 34k
+ * u-boot directly after @ 68k for 400k or so
+ * ENV @ 992k
+ */
+#define CONFIG_ENV_OFFSET ((1024-32) * 1024)
+#else
 /* SPL @ 32k for ~36k
  * ENV @ 96k
  * u-boot @ 128K
  */
 #define CONFIG_ENV_OFFSET (96 * 1024)
+#endif
 
 #define CONFIG_SYS_WHITE_ON_BLACK
 #define CONFIG_CONSOLE_SCROLL_LINES10
diff --git a/include/configs/popmetal_rk3288.h 
b/include/configs/popmetal_rk3288.h
index 390c243..90b810a 100644
--- a/include/configs/popmetal_rk3288.h
+++ b/include/configs/popmetal_rk3288.h
@@ -12,11 +12,20 @@
 
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
+
+#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+/* SPL @ 32k for 34k
+ * u-boot directly after @ 68k for 400k or so
+ * ENV @ 992k
+ */
+#define CONFIG_ENV_OFFSET ((1024-32) * 1024)
+#else
 /* SPL @ 32k for ~36k
  * ENV @ 96k
  * u-boot @ 128K
  */
 #define CONFIG_ENV_OFFSET (96 * 1024)
+#endif
 
 #define CONFIG_SYS_WHITE_ON_BLACK
 #define CONFIG_CONSOLE_SCROLL_LINES10
-- 
1.9.1

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


[U-Boot] [PATCH v2 2/3] rockchip: configs: make rk3036 env config same as rk3288

2016-11-17 Thread Jacob Chen
To make rockchip soc keep the same partition map


Signed-off-by: Jacob Chen 
---

Changes in v2:
- add a commit message

 include/configs/kylin_rk3036.h | 17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/include/configs/kylin_rk3036.h b/include/configs/kylin_rk3036.h
index 4f0bd84..bc28525 100644
--- a/include/configs/kylin_rk3036.h
+++ b/include/configs/kylin_rk3036.h
@@ -19,9 +19,20 @@
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0 /* emmc */
 #define CONFIG_SYS_MMC_ENV_PART0 /* user area */
-#define CONFIG_ENV_OFFSET  (SZ_4M - SZ_64K) /* reserved area */
-#define CONFIG_ENV_OFFSET_REDUND   (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
-#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
+
+#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+/* SPL @ 32k for 34k
+ * u-boot directly after @ 68k for 400k or so
+ * ENV @ 992k
+ */
+#define CONFIG_ENV_OFFSET ((1024-32) * 1024)
+#else
+/* SPL @ 32k for ~36k
+ * ENV @ 96k
+ * u-boot @ 128K
+ */
+#define CONFIG_ENV_OFFSET (96 * 1024)
+#endif
 
 #endif
 
-- 
1.9.1

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


[U-Boot] [PATCH v2 1/3] rockchip: configs: correct env offset when enable CONFIG_ROCKCHIP_SPL_BACK_TO_BROM

2016-11-17 Thread Jacob Chen
With CONFIG_ROCKCHIP_SPL_BACK_TO_BROM enabled,
the environment is inside u-boot.
So solve it by moving environment after u-boot.

Signed-off-by: Jacob Chen 
---

Changes in v2:
- add a commit message

 include/configs/evb_rk3288.h  | 9 +
 include/configs/fennec_rk3288.h   | 9 +
 include/configs/miniarm_rk3288.h  | 9 +
 include/configs/popmetal_rk3288.h | 9 +
 4 files changed, 36 insertions(+)

diff --git a/include/configs/evb_rk3288.h b/include/configs/evb_rk3288.h
index 390c243..90b810a 100644
--- a/include/configs/evb_rk3288.h
+++ b/include/configs/evb_rk3288.h
@@ -12,11 +12,20 @@
 
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
+
+#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+/* SPL @ 32k for 34k
+ * u-boot directly after @ 68k for 400k or so
+ * ENV @ 992k
+ */
+#define CONFIG_ENV_OFFSET ((1024-32) * 1024)
+#else
 /* SPL @ 32k for ~36k
  * ENV @ 96k
  * u-boot @ 128K
  */
 #define CONFIG_ENV_OFFSET (96 * 1024)
+#endif
 
 #define CONFIG_SYS_WHITE_ON_BLACK
 #define CONFIG_CONSOLE_SCROLL_LINES10
diff --git a/include/configs/fennec_rk3288.h b/include/configs/fennec_rk3288.h
index 390c243..90b810a 100644
--- a/include/configs/fennec_rk3288.h
+++ b/include/configs/fennec_rk3288.h
@@ -12,11 +12,20 @@
 
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
+
+#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+/* SPL @ 32k for 34k
+ * u-boot directly after @ 68k for 400k or so
+ * ENV @ 992k
+ */
+#define CONFIG_ENV_OFFSET ((1024-32) * 1024)
+#else
 /* SPL @ 32k for ~36k
  * ENV @ 96k
  * u-boot @ 128K
  */
 #define CONFIG_ENV_OFFSET (96 * 1024)
+#endif
 
 #define CONFIG_SYS_WHITE_ON_BLACK
 #define CONFIG_CONSOLE_SCROLL_LINES10
diff --git a/include/configs/miniarm_rk3288.h b/include/configs/miniarm_rk3288.h
index aa259db..645d023 100644
--- a/include/configs/miniarm_rk3288.h
+++ b/include/configs/miniarm_rk3288.h
@@ -17,11 +17,20 @@
 
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0
+
+#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+/* SPL @ 32k for 34k
+ * u-boot directly after @ 68k for 400k or so
+ * ENV @ 992k
+ */
+#define CONFIG_ENV_OFFSET ((1024-32) * 1024)
+#else
 /* SPL @ 32k for ~36k
  * ENV @ 96k
  * u-boot @ 128K
  */
 #define CONFIG_ENV_OFFSET (96 * 1024)
+#endif
 
 #define CONFIG_SYS_WHITE_ON_BLACK
 #define CONFIG_CONSOLE_SCROLL_LINES10
diff --git a/include/configs/popmetal_rk3288.h 
b/include/configs/popmetal_rk3288.h
index 390c243..90b810a 100644
--- a/include/configs/popmetal_rk3288.h
+++ b/include/configs/popmetal_rk3288.h
@@ -12,11 +12,20 @@
 
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
+
+#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+/* SPL @ 32k for 34k
+ * u-boot directly after @ 68k for 400k or so
+ * ENV @ 992k
+ */
+#define CONFIG_ENV_OFFSET ((1024-32) * 1024)
+#else
 /* SPL @ 32k for ~36k
  * ENV @ 96k
  * u-boot @ 128K
  */
 #define CONFIG_ENV_OFFSET (96 * 1024)
+#endif
 
 #define CONFIG_SYS_WHITE_ON_BLACK
 #define CONFIG_CONSOLE_SCROLL_LINES10
-- 
1.9.1

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


[U-Boot] [PATCH v2 3/3] rockchip: configs: correct partitions 'boot' size

2016-11-17 Thread Jacob Chen
It should be 112M, to make rootfs start at 0x4

Signed-off-by: Jacob Chen 
Acked-by: Simon Glass 
---

Changes in v2: None

 include/configs/rockchip-common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/rockchip-common.h 
b/include/configs/rockchip-common.h
index 86c81b0..d077824 100644
--- a/include/configs/rockchip-common.h
+++ b/include/configs/rockchip-common.h
@@ -28,7 +28,7 @@
"name=reserved2,size=4M,uuid=${uuid_gpt_reserved2};" \
"name=loader2,size=4MB,uuid=${uuid_gpt_loader2};" \
"name=atf,size=4M,uuid=${uuid_gpt_atf};" \
-   "name=boot,size=128M,bootable,uuid=${uuid_gpt_boot};" \
+   "name=boot,size=112M,bootable,uuid=${uuid_gpt_boot};" \
"name=rootfs,size=-,uuid=${uuid_gpt_rootfs};\0" \
 
 #endif
-- 
1.9.1

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


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

2016-11-17 Thread Jaehoon Chung
Hi,

Added Marek as USB maintainer.

On 11/17/2016 01:21 PM, Dongwoo Lee wrote:
> 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.

I don't have USB knowledge..So i wonder that this is correct way.
Have other guys ever seen the similar issue?

> 
> 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);

xfer_ma_per_td is constant? Then why don't define "XFER_MAX_PER_TD"?
Then can remove xfer_max_per_td  variable.

> +
> + buf_pos = 0;

can be assigned to 0 when buf_pos is defined?

Best Regards,
Jaehoon Chung

> + 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;
>  }
>  
>  /**
> 

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


Re: [U-Boot] [PATCH v6 01/21] sf: Adopt flash table INFO macro from Linux

2016-11-17 Thread Siva Durga Prasad Paladugu
Hi,


> -Original Message-
> From: Siva Durga Prasad Paladugu
> Sent: Wednesday, November 16, 2016 6:21 PM
> To: 'Jagan Teki' 
> Cc: u-boot@lists.denx.de; Michal Simek 
> Subject: RE: [U-Boot] [PATCH v6 01/21] sf: Adopt flash table INFO macro from
> Linux
> 
> Hi,
> 
> > -Original Message-
> > From: Jagan Teki [mailto:ja...@openedev.com]
> > Sent: Wednesday, November 16, 2016 6:09 PM
> > To: Siva Durga Prasad Paladugu 
> > Cc: u-boot@lists.denx.de; Michal Simek 
> > Subject: Re: [U-Boot] [PATCH v6 01/21] sf: Adopt flash table INFO
> > macro from Linux
> >
> > On Wed, Nov 16, 2016 at 10:53 AM, Siva Durga Prasad Paladugu
> >  wrote:
> > > Hi,
> > >
> > >> -Original Message-
> > >> From: Jagan Teki [mailto:ja...@openedev.com]
> > >> Sent: Wednesday, November 16, 2016 9:33 AM
> > >> To: u-boot@lists.denx.de
> > >> Cc: Jagan Teki ; Simon Glass
> > ;
> > >> Bin Meng ; York Sun ;
> > Vignesh R
> > >> ; Mugunthan V N ; Michal
> > Simek
> > >> ; Siva Durga Prasad Paladugu
> > >> 
> > >> Subject: [PATCH v6 01/21] sf: Adopt flash table INFO macro from
> > >> Linux
> > >>
> > >> INFO macro make flash table entries more adjustable like adding new
> > >> flash_info attributes, update ID length bytes and so on and more
> > >> over it will sync to Linux way of defining flash_info attributes.
> > >>
> > >> - Add JEDEC_ID
> > >> - Add JEDEC_EXT macro
> > >> - Add JEDEC_MFR
> > >> - spi_flash_params => spi_flash_info
> > >> - params => info
> > >>
> > >> Cc: Simon Glass 
> > >> Cc: Bin Meng 
> > >> Cc: York Sun 
> > >> Cc: Vignesh R 
> > >> Cc: Mugunthan V N 
> > >> Cc: Michal Simek 
> > >> Cc: Siva Durga Prasad Paladugu 
> > >> Reviewed-by: Jagan Teki 
> > >> Tested-by: Jagan Teki 
> > >> Signed-off-by: Jagan Teki 
> > >> ---
> > >>  drivers/mtd/spi/sandbox.c |  10 +-
> > >>  drivers/mtd/spi/sf_internal.h |  26 +++--
> > >>  drivers/mtd/spi/sf_params.c   | 217 ++-
> --
> > 
> > >> -
> > >>  drivers/mtd/spi/spi_flash.c   | 136 +-
> > >>  include/linux/err.h   |   5 +
> > >>  5 files changed, 214 insertions(+), 180 deletions(-)
> > >>
> > >> diff --git a/drivers/mtd/spi/sandbox.c b/drivers/mtd/spi/sandbox.c
> > >> index f59134f..d68ee4a 100644
> > >> --- a/drivers/mtd/spi/sandbox.c
> > >> +++ b/drivers/mtd/spi/sandbox.c
> > >> @@ -88,7 +88,7 @@ struct sandbox_spi_flash {
> > >>   /* The current flash status (see STAT_XXX defines above) */
> > >>   u16 status;
> > >>   /* Data describing the flash we're emulating */
> > >> - const struct spi_flash_params *data;
> > >> + const struct spi_flash_info *data;
> > >>   /* The file on disk to serv up data from */
> > >>   int fd;
> > >>  };
> > >> @@ -112,7 +112,7 @@ static int sandbox_sf_probe(struct udevice *dev)
> > >>   struct sandbox_spi_flash *sbsf = dev_get_priv(dev);
> > >>   const char *file;
> > >>   size_t len, idname_len;
> > >> - const struct spi_flash_params *data;
> > >> + const struct spi_flash_info *data;
> > >>   struct sandbox_spi_flash_plat_data *pdata =
> dev_get_platdata(dev);
> > >>   struct sandbox_state *state = state_get_current();
> > >>   struct udevice *bus = dev->parent; @@ -168,7 +168,7 @@ static
> > >> int sandbox_sf_probe(struct udevice *dev)
> > >>   }
> > >>   debug("%s: device='%s'\n", __func__, spec);
> > >>
> > >> - for (data = spi_flash_params_table; data->name; data++) {
> > >> + for (data = spi_flash_ids; data->name; data++) {
> > >>   len = strlen(data->name);
> > >>   if (idname_len != len)
> > >>   continue;
> > >> @@ -359,7 +359,9 @@ static int sandbox_sf_xfer(struct udevice *dev,
> > >> unsigned int bitlen,
> > >>   debug(" id: off:%u tx:", sbsf->off);
> > >>   if (sbsf->off < IDCODE_LEN) {
> > >>   /* Extract correct byte from ID 0x00aabbcc 
> > >> */
> > >> - id = sbsf->data->jedec >>
> > >> + id = sbsf->data)->id[0]) << 16) |
> > >> + (((sbsf->data)->id[1]) << 8 |
> > >> + ((sbsf->data)->id[2]))) >>
> > >>   (8 * (IDCODE_LEN - 1 -
> > >> sbsf->off));
> > > Please, no magic 16 and 8 here and everywhere
> >
> > These are existing macro exapnsions will update on future if required.
> Its upto you.
> >
> > >>   } else {
> > >>   id = 0; diff --git
> > >> a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
> > >> index cde4cfb..a9455ac 100644
> > >> --- a/drivers/mtd/spi/sf_internal.h
> > >> +++ b/drivers/mtd/spi/sf_internal.h
> > >> @@ -103,24 +103,36 @@ int sst_write_bp(struct spi_flash *flash, u32
> > >> offset, size_t len,
> > >>  #define CMD_SPANSION_RDAR0x65 /* Read any device register */
> > >>  #define CMD_SPANSION_WRAR0x7

Re: [U-Boot] [PATCH v3 0/6] DM conversion of usb ether gadget

2016-11-17 Thread Mugunthan V N
On Thursday 17 November 2016 01:39 PM, Mugunthan V N wrote:
> This patch series adopts driver model for usb ether gadget
> driver. This series is tested with MUSB driver model conversion
> on AM335x GP evm and AM335x BBB (logs [1]).

Please drop this patch series as not all patches of this series landed
on mailing list. resent the series [1].

[1] - http://lists.denx.de/pipermail/u-boot/2016-November/273164.html

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


[U-Boot] [PATCH resend v3 6/6] drivers: usb: gadget: ether/rndis: convert driver to adopt device driver model

2016-11-17 Thread Mugunthan V N
Adopt usb ether gadget and rndis driver to adopt driver model

Signed-off-by: Mugunthan V N 
---
 drivers/usb/gadget/Kconfig |   4 ++
 drivers/usb/gadget/ether.c | 153 ++---
 drivers/usb/gadget/rndis.c |  13 +++-
 drivers/usb/gadget/rndis.h |  19 --
 include/net.h  |   7 +++
 5 files changed, 181 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 40839d89e9..261ed128ac 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -112,6 +112,10 @@ config G_DNL_VENDOR_NUM
 config G_DNL_PRODUCT_NUM
hex "Product ID of USB device"
 
+config USBNET_DEVADDR
+   string "USB Gadget Ethernet device mac address"
+   default "de:ad:be:ef:00:01"
+
 endif # USB_GADGET_DOWNLOAD
 
 endif # USB_GADGET
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 046ad8ca2b..8c3c3fd9ab 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -25,6 +25,7 @@
 #include "rndis.h"
 
 #include 
+#include 
 #include 
 #include 
 
@@ -116,7 +117,11 @@ struct eth_dev {
 
struct usb_request  *tx_req, *rx_req;
 
+#ifndef CONFIG_DM_ETH
struct eth_device   *net;
+#else
+   struct udevice  *net;
+#endif
struct net_device_stats stats;
unsigned inttx_qlen;
 
@@ -143,7 +148,11 @@ struct eth_dev {
 /*-*/
 struct ether_priv {
struct eth_dev ethdev;
+#ifndef CONFIG_DM_ETH
struct eth_device netdev;
+#else
+   struct udevice *netdev;
+#endif
struct usb_gadget_driver eth_driver;
 };
 
@@ -1851,7 +1860,11 @@ static void rndis_control_ack_complete(struct usb_ep *ep,
 
 static char rndis_resp_buf[8] __attribute__((aligned(sizeof(__le32;
 
+#ifndef CONFIG_DM_ETH
 static int rndis_control_ack(struct eth_device *net)
+#else
+static int rndis_control_ack(struct udevice *net)
+#endif
 {
struct ether_priv   *priv = (struct ether_priv *)net->priv;
struct eth_dev  *dev = &priv->ethdev;
@@ -2001,6 +2014,9 @@ static int eth_bind(struct usb_gadget *gadget)
int status = -ENOMEM;
int gcnum;
u8  tmp[7];
+#ifdef CONFIG_DM_ETH
+   struct eth_pdata*pdata = dev_get_platdata(l_priv->netdev);
+#endif
 
/* these flags are only ever cleared; compiler take note */
 #ifndefCONFIG_USB_ETH_CDC
@@ -2188,7 +2204,11 @@ autoconf_fail:
 
 
/* network device setup */
+#ifndef CONFIG_DM_ETH
dev->net = &l_priv->netdev;
+#else
+   dev->net = l_priv->netdev;
+#endif
 
dev->cdc = cdc;
dev->zlp = zlp;
@@ -2197,6 +2217,7 @@ autoconf_fail:
dev->out_ep = out_ep;
dev->status_ep = status_ep;
 
+   memset(tmp, 0, sizeof(tmp));
/*
 * Module params for these addresses should come from ID proms.
 * The host side address is used with CDC and RNDIS, and commonly
@@ -2204,10 +2225,13 @@ autoconf_fail:
 * host side code for the SAFE thing cares -- its original BLAN
 * thing didn't, Sharp never assigned those addresses on Zaurii.
 */
+#ifndef CONFIG_DM_ETH
get_ether_addr(dev_addr, dev->net->enetaddr);
-
-   memset(tmp, 0, sizeof(tmp));
memcpy(tmp, dev->net->enetaddr, sizeof(dev->net->enetaddr));
+#else
+   get_ether_addr(dev_addr, pdata->enetaddr);
+   memcpy(tmp, pdata->enetaddr, sizeof(pdata->enetaddr));
+#endif
 
get_ether_addr(host_addr, dev->host_mac);
 
@@ -2268,10 +2292,11 @@ autoconf_fail:
status_ep ? " STATUS " : "",
status_ep ? status_ep->name : ""
);
-   printf("MAC %02x:%02x:%02x:%02x:%02x:%02x\n",
-   dev->net->enetaddr[0], dev->net->enetaddr[1],
-   dev->net->enetaddr[2], dev->net->enetaddr[3],
-   dev->net->enetaddr[4], dev->net->enetaddr[5]);
+#ifndef CONFIG_DM_ETH
+   printf("MAC %pM\n", dev->net->enetaddr);
+#else
+   printf("MAC %pM\n", pdata->enetaddr);
+#endif
 
if (cdc || rndis)
printf("HOST MAC %02x:%02x:%02x:%02x:%02x:%02x\n",
@@ -2520,13 +2545,12 @@ void _usb_eth_halt(struct ether_priv *priv)
}
 
usb_gadget_unregister_driver(&priv->eth_driver);
-#ifdef CONFIG_DM_USB
-   device_remove(dev->usb_udev);
-#else
+#ifndef CONFIG_DM_USB
board_usb_cleanup(0, USB_INIT_DEVICE);
 #endif
 }
 
+#ifndef CONFIG_DM_ETH
 static int usb_eth_init(struct eth_device *netdev, bd_t *bd)
 {
struct ether_priv *priv = (struct ether_priv *)netdev->priv;
@@ -2593,3 +2617,114 @@ int usb_eth_initialize(bd_t *bi)
eth_register(netdev);
return 0;
 }
+#else
+static int usb_eth_start(struct udevice *dev)
+{
+   struct ether_priv *priv = dev_get_priv(dev);
+
+   return _usb_eth_init(priv);
+}
+
+static int usb_eth_send(struc

[U-Boot] [PATCH resend 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 = &priv->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 = &priv->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 = &priv->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 = &priv->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 = &priv->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 = &l_priv->netdev;
-- 
2.11.0.rc2

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


[U-Boot] [PATCH resend v3 4/6] drivers: usb: gadget: ether: use net device priv to pass usb ether priv

2016-11-17 Thread Mugunthan V N
Use net device priv to pass usb ether priv and use it in
net device ops callback.

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

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 16edeead65..54b8b59b29 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -1853,7 +1853,8 @@ static char rndis_resp_buf[8] 
__attribute__((aligned(sizeof(__le32;
 
 static int rndis_control_ack(struct eth_device *net)
 {
-   struct eth_dev  *dev = &l_priv->ethdev;
+   struct ether_priv   *priv = (struct ether_priv *)net->priv;
+   struct eth_dev  *dev = &priv->ethdev;
int length;
struct usb_request  *resp = dev->stat_req;
 
@@ -2335,16 +2336,12 @@ int dm_usb_init(struct eth_dev *e_dev)
 
 static int usb_eth_init(struct eth_device *netdev, bd_t *bd)
 {
-   struct eth_dev *dev = &l_priv->ethdev;
+   struct ether_priv *priv = (struct ether_priv *)netdev->priv;
+   struct eth_dev *dev = &priv->ethdev;
struct usb_gadget *gadget;
unsigned long ts;
unsigned long timeout = USB_CONNECT_TIMEOUT;
 
-   if (!netdev) {
-   error("received NULL ptr");
-   goto fail;
-   }
-
 #ifdef CONFIG_DM_USB
if (dm_usb_init(dev)) {
error("USB ether not found\n");
@@ -2379,15 +2376,15 @@ static int usb_eth_init(struct eth_device *netdev, bd_t 
*bd)
goto fail;
}
 
-   l_priv->eth_driver.speed= DEVSPEED;
-   l_priv->eth_driver.bind = eth_bind;
-   l_priv->eth_driver.unbind   = eth_unbind;
-   l_priv->eth_driver.setup= eth_setup;
-   l_priv->eth_driver.reset= eth_disconnect;
-   l_priv->eth_driver.disconnect   = eth_disconnect;
-   l_priv->eth_driver.suspend  = eth_suspend;
-   l_priv->eth_driver.resume   = eth_resume;
-   if (usb_gadget_register_driver(&l_priv->eth_driver) < 0)
+   priv->eth_driver.speed  = DEVSPEED;
+   priv->eth_driver.bind   = eth_bind;
+   priv->eth_driver.unbind = eth_unbind;
+   priv->eth_driver.setup  = eth_setup;
+   priv->eth_driver.reset  = eth_disconnect;
+   priv->eth_driver.disconnect = eth_disconnect;
+   priv->eth_driver.suspend= eth_suspend;
+   priv->eth_driver.resume = eth_resume;
+   if (usb_gadget_register_driver(&priv->eth_driver) < 0)
goto fail;
 
dev->network_started = 0;
@@ -2422,7 +2419,8 @@ static int usb_eth_send(struct eth_device *netdev, void 
*packet, int length)
 {
int retval;
void*rndis_pkt = NULL;
-   struct eth_dev  *dev = &l_priv->ethdev;
+   struct ether_priv   *priv = (struct ether_priv *)netdev->priv;
+   struct eth_dev  *dev = &priv->ethdev;
struct usb_request  *req = dev->tx_req;
unsigned long ts;
unsigned long timeout = USB_CONNECT_TIMEOUT;
@@ -2489,7 +2487,8 @@ drop:
 
 static int usb_eth_recv(struct eth_device *netdev)
 {
-   struct eth_dev *dev = &l_priv->ethdev;
+   struct ether_priv *priv = (struct ether_priv *)netdev->priv;
+   struct eth_dev *dev = &priv->ethdev;
 
usb_gadget_handle_interrupts(0);
 
@@ -2509,12 +2508,8 @@ static int usb_eth_recv(struct eth_device *netdev)
 
 void usb_eth_halt(struct eth_device *netdev)
 {
-   struct eth_dev *dev = &l_priv->ethdev;
-
-   if (!netdev) {
-   error("received NULL ptr");
-   return;
-   }
+   struct ether_priv *priv = (struct ether_priv *)netdev->priv;
+   struct eth_dev *dev = &priv->ethdev;
 
/* If the gadget not registered, simple return */
if (!dev->gadget)
@@ -2541,7 +2536,7 @@ void usb_eth_halt(struct eth_device *netdev)
dev->network_started = 0;
}
 
-   usb_gadget_unregister_driver(&l_priv->eth_driver);
+   usb_gadget_unregister_driver(&priv->eth_driver);
 #ifdef CONFIG_DM_USB
device_remove(dev->usb_udev);
 #else
@@ -2559,6 +2554,7 @@ int usb_eth_initialize(bd_t *bi)
netdev->send = usb_eth_send;
netdev->recv = usb_eth_recv;
netdev->halt = usb_eth_halt;
+   netdev->priv = l_priv;
 
 #ifdef CONFIG_MCAST_TFTP
   #error not supported
-- 
2.11.0.rc2

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


[U-Boot] [PATCH resend v3 3/6] drivers: usb: gadget: ether: consolidate global devices to single struct

2016-11-17 Thread Mugunthan V N
Consolidate the net device, usb eth device and gadget device
struct to single struct and a single global variable so that the
same can be passed as priv of ethernet driver.

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

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 71d9252f74..16edeead65 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -141,9 +141,14 @@ struct eth_dev {
  */
 
 /*-*/
-static struct eth_dev l_ethdev;
-static struct eth_device l_netdev;
-static struct usb_gadget_driver eth_driver;
+struct ether_priv {
+   struct eth_dev ethdev;
+   struct eth_device netdev;
+   struct usb_gadget_driver eth_driver;
+};
+
+struct ether_priv eth_priv;
+struct ether_priv *l_priv = ð_priv;
 
 /*-*/
 
@@ -1848,7 +1853,7 @@ static char rndis_resp_buf[8] 
__attribute__((aligned(sizeof(__le32;
 
 static int rndis_control_ack(struct eth_device *net)
 {
-   struct eth_dev  *dev = &l_ethdev;
+   struct eth_dev  *dev = &l_priv->ethdev;
int length;
struct usb_request  *resp = dev->stat_req;
 
@@ -1989,7 +1994,7 @@ static int get_ether_addr(const char *str, u8 *dev_addr)
 
 static int eth_bind(struct usb_gadget *gadget)
 {
-   struct eth_dev  *dev = &l_ethdev;
+   struct eth_dev  *dev = &l_priv->ethdev;
u8  cdc = 1, zlp = 1, rndis = 1;
struct usb_ep   *in_ep, *out_ep, *status_ep = NULL;
int status = -ENOMEM;
@@ -2182,7 +2187,7 @@ autoconf_fail:
 
 
/* network device setup */
-   dev->net = &l_netdev;
+   dev->net = &l_priv->netdev;
 
dev->cdc = cdc;
dev->zlp = zlp;
@@ -2330,7 +2335,7 @@ int dm_usb_init(struct eth_dev *e_dev)
 
 static int usb_eth_init(struct eth_device *netdev, bd_t *bd)
 {
-   struct eth_dev *dev = &l_ethdev;
+   struct eth_dev *dev = &l_priv->ethdev;
struct usb_gadget *gadget;
unsigned long ts;
unsigned long timeout = USB_CONNECT_TIMEOUT;
@@ -2374,7 +2379,15 @@ static int usb_eth_init(struct eth_device *netdev, bd_t 
*bd)
goto fail;
}
 
-   if (usb_gadget_register_driver(ð_driver) < 0)
+   l_priv->eth_driver.speed= DEVSPEED;
+   l_priv->eth_driver.bind = eth_bind;
+   l_priv->eth_driver.unbind   = eth_unbind;
+   l_priv->eth_driver.setup= eth_setup;
+   l_priv->eth_driver.reset= eth_disconnect;
+   l_priv->eth_driver.disconnect   = eth_disconnect;
+   l_priv->eth_driver.suspend  = eth_suspend;
+   l_priv->eth_driver.resume   = eth_resume;
+   if (usb_gadget_register_driver(&l_priv->eth_driver) < 0)
goto fail;
 
dev->network_started = 0;
@@ -2409,7 +2422,7 @@ static int usb_eth_send(struct eth_device *netdev, void 
*packet, int length)
 {
int retval;
void*rndis_pkt = NULL;
-   struct eth_dev  *dev = &l_ethdev;
+   struct eth_dev  *dev = &l_priv->ethdev;
struct usb_request  *req = dev->tx_req;
unsigned long ts;
unsigned long timeout = USB_CONNECT_TIMEOUT;
@@ -2476,7 +2489,7 @@ drop:
 
 static int usb_eth_recv(struct eth_device *netdev)
 {
-   struct eth_dev *dev = &l_ethdev;
+   struct eth_dev *dev = &l_priv->ethdev;
 
usb_gadget_handle_interrupts(0);
 
@@ -2496,7 +2509,7 @@ static int usb_eth_recv(struct eth_device *netdev)
 
 void usb_eth_halt(struct eth_device *netdev)
 {
-   struct eth_dev *dev = &l_ethdev;
+   struct eth_dev *dev = &l_priv->ethdev;
 
if (!netdev) {
error("received NULL ptr");
@@ -2528,7 +2541,7 @@ void usb_eth_halt(struct eth_device *netdev)
dev->network_started = 0;
}
 
-   usb_gadget_unregister_driver(ð_driver);
+   usb_gadget_unregister_driver(&l_priv->eth_driver);
 #ifdef CONFIG_DM_USB
device_remove(dev->usb_udev);
 #else
@@ -2536,23 +2549,9 @@ void usb_eth_halt(struct eth_device *netdev)
 #endif
 }
 
-static struct usb_gadget_driver eth_driver = {
-   .speed  = DEVSPEED,
-
-   .bind   = eth_bind,
-   .unbind = eth_unbind,
-
-   .setup  = eth_setup,
-   .reset  = eth_disconnect,
-   .disconnect = eth_disconnect,
-
-   .suspend= eth_suspend,
-   .resume = eth_resume,
-};
-
 int usb_eth_initialize(bd_t *bi)
 {
-   struct eth_device *netdev = &l_netdev;
+   struct eth_device *netdev = &l_priv->netdev;
 
strlcpy(netdev->name, USB_NET_NAME, sizeof(netdev->name));
 
-- 
2.11.0.rc2

__

[U-Boot] [PATCH v7 04/21] sf: Cleanup spi_flash_info{}

2016-11-17 Thread Jagan Teki
- Proper tabs spaces
- Removed unnecessary
- Add comments in spi_flash_info members
- Add comments for spi_flash_info.flags

Cc: Simon Glass 
Cc: Bin Meng 
Cc: York Sun 
Cc: Vignesh R 
Cc: Mugunthan V N 
Cc: Michal Simek 
Signed-off-by: Jagan Teki 
Reviewed-by: Siva Durga Prasad Paladugu 
Reviewed-by: Jagan Teki 
---
Changes for v7:
- Add comments for spi_flash_info.flags

 drivers/mtd/spi/sf_internal.h | 44 ---
 1 file changed, 20 insertions(+), 24 deletions(-)

diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
index a9455ac..bbc08f6 100644
--- a/drivers/mtd/spi/sf_internal.h
+++ b/drivers/mtd/spi/sf_internal.h
@@ -108,17 +108,9 @@ int sst_write_bp(struct spi_flash *flash, u32 offset, 
size_t len,
 #define JEDEC_ID(info) (((info)->id[1]) << 8 | ((info)->id[2]))
 #define JEDEC_EXT(info)(((info)->id[3]) << 8 | ((info)->id[4]))
 
-/**
- * struct spi_flash_info - SPI/QSPI flash device params structure
- *
- * @name:  Device name ([MANUFLETTER][DEVTYPE][DENSITY][EXTRAINFO])
- * @sector_size:   Isn't necessarily a sector size from vendor,
- * the size listed here is what works with CMD_ERASE_64K
- * @nr_sectors:No.of sectors on this device
- * @flags: Important param, for flash specific behaviour
- */
 struct spi_flash_info {
-   const char *name;
+   /* Device name ([MANUFLETTER][DEVTYPE][DENSITY][EXTRAINFO]) */
+   const char  *name;
 
/*
 * This array stores the ID bytes.
@@ -128,20 +120,24 @@ struct spi_flash_info {
u8  id[5];
u8  id_len;
 
-   u32 sector_size;
-   u32 nr_sectors;
-
-   u16 page_size;
-
-   u16 flags;
-#define SECT_4KBIT(0)
-#define E_FSR  BIT(1)
-#define SST_WR BIT(2)
-#define WR_QPP BIT(3)
-#define RD_QUADBIT(4)
-#define RD_DUALBIT(5)
-#define RD_QUADIO  BIT(6)
-#define RD_DUALIO  BIT(7)
+   /*
+* The size listed here is what works with SPINOR_OP_SE, which isn't
+* necessarily called a "sector" by the vendor.
+*/
+   u32 sector_size;
+   u32 nr_sectors;
+
+   u16 page_size;
+
+   u16 flags;
+#define SECT_4KBIT(0)  /* CMD_ERASE_4K works uniformly 
*/
+#define E_FSR  BIT(1)  /* use flag status register for */
+#define SST_WR BIT(2)  /* use SST byte/word programming */
+#define WR_QPP BIT(3)  /* use Quad Page Program */
+#define RD_QUADBIT(4)  /* use Quad Read */
+#define RD_DUALBIT(5)  /* use Dual Read */
+#define RD_QUADIO  BIT(6)  /* use Quad IO Read */
+#define RD_DUALIO  BIT(7)  /* use Dual IO Read */
 #define RD_FULL(RD_QUAD | RD_DUAL | RD_QUADIO | 
RD_DUALIO)
 };
 
-- 
1.9.1

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


[U-Boot] [PATCH resend v3 2/6] drivers: usb: gadget: ether: access network_started using local variable

2016-11-17 Thread Mugunthan V N
network_started of struct eth_dev can be accessed using local
variable dev and no reason to access it with the global struct.

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

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 9bc61186cf..71d9252f74 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -1142,7 +1142,7 @@ static void eth_status_complete(struct usb_ep *ep, struct 
usb_request *req)
event->bNotificationType, value);
if (event->bNotificationType ==
USB_CDC_NOTIFY_SPEED_CHANGE) {
-   l_ethdev.network_started = 1;
+   dev->network_started = 1;
printf("USB network up!\n");
}
}
@@ -1330,7 +1330,7 @@ eth_setup(struct usb_gadget *gadget, const struct 
usb_ctrlrequest *ctrl)
 * that network is working. So we signalize it
 * here.
 */
-   l_ethdev.network_started = 1;
+   dev->network_started = 1;
debug("USB network up!\n");
goto done_set_intf;
}
@@ -1830,10 +1830,10 @@ static void rndis_control_ack_complete(struct usb_ep 
*ep,
debug("rndis control ack complete --> %d, %d/%d\n",
req->status, req->actual, req->length);
 
-   if (!l_ethdev.network_started) {
+   if (!dev->network_started) {
if (rndis_get_state(dev->rndis_config)
== RNDIS_DATA_INITIALIZED) {
-   l_ethdev.network_started = 1;
+   dev->network_started = 1;
printf("USB RNDIS network up!\n");
}
}
@@ -2389,7 +2389,7 @@ static int usb_eth_init(struct eth_device *netdev, bd_t 
*bd)
timeout = simple_strtoul(getenv("cdc_connect_timeout"),
NULL, 10) * CONFIG_SYS_HZ;
ts = get_timer(0);
-   while (!l_ethdev.network_started) {
+   while (!dev->network_started) {
/* Handle control-c and timeouts */
if (ctrlc() || (get_timer(ts) > timeout)) {
error("The remote end did not respond in time.");
-- 
2.11.0.rc2

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


[U-Boot] [PATCH resend 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, &dev);
+   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 = &l_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.rc2

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


[U-Boot] [PATCH resend v3 0/6] DM conversion of usb ether gadget

2016-11-17 Thread Mugunthan V N
The previous series didn't land on the mailing list properly, so
resending the series as *v3 resend*, sorry for spamming.

This patch series adopts driver model for usb ether gadget
driver. This series is tested with MUSB driver model conversion
on AM335x GP evm and AM335x BBB (logs [1]).

Also pushed a branch for testing [2]

Changes from v2:
* Moved USB ether address from driver hard code to Kconfig entry
* Optimized if check in patch 5/6 as mentioned by Marek Vasut.

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.

[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

Note:
~
The following checkpatch warning can be ignored as this has to be
fixed all over the file which should be a separate patch.
CHECK: Avoid CamelCase: 
#297: FILE: drivers/usb/gadget/rndis.c:1157:
+int  rndis_set_param_dev(u8 configNr, struct eth_device *dev, int mtu,

Mugunthan V N (6):
  drivers: usb: gadget: ether: adopt to usb driver model
  drivers: usb: gadget: ether: access network_started using local
variable
  drivers: usb: gadget: ether: consolidate global devices to single
struct
  drivers: usb: gadget: ether: use net device priv to pass usb ether
priv
  drivers: usb: gadget: ether: prepare driver for driver model migration
  drivers: usb: gadget: ether/rndis: convert driver to adopt device
driver model

 drivers/usb/gadget/Kconfig |   4 +
 drivers/usb/gadget/ether.c | 315 -
 drivers/usb/gadget/rndis.c |  13 +-
 drivers/usb/gadget/rndis.h |  19 ++-
 include/net.h  |   7 +
 5 files changed, 293 insertions(+), 65 deletions(-)

-- 
2.11.0.rc2

___
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 Jaehoon Chung
Hi Tomas,

On 11/17/2016 08:05 PM, Tomas Melin wrote:
> Hi,
> 
> Thank you for your valuable comments and for taking the time to respond.
> Please see below for further comments.

No problem, It's useful to discuss about something. :)

> 
> 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.

You're right. This patch doesn't affect performance, because this patch just 
provides to enable bkops, right?
My means is "i don't want to provide the command for enabling BKOPS.".

There is no information on u-boot whether kernel can fully support the BKOPS 
functionality or not.
Do you know how to run bkops on kernel side when bkops is enabled from u-boot?

As i know, there are discussions about enabling BKOPS at Kernel mmc mailing.
Even when i had implemented the BKOPS feature, i put the some flag for enabling 
BKOPS. (likes MMC_CAP2_ENABLE_BKOPS)
It can be also chosen from USER with dt property. but Finally we removed this 
capability.

1) When BKOPS is enabled, needs to consider IO performance.
2) There is no periodic BKOPS functionality.
3) eMMC5.1 has introduced new automatic bkops feature..BIT[1] ATUO_EN.
(Also not apply on linux-kernel.)
4) mmc-util supports all configuration on kernel side. 

If it has to enable this, i think better that leaves a matter in Kernel.

> 
>>
>> 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.

_all_ configuration? i don't agree..We don't need to put _all_ configuration 
command on u-boot side.

Best Regards,
Jaehoon Chung

> 
> 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,

[U-Boot] [PATCH 2/4 v2] fsl/ddr: Add erratum_a009942_check_cpo and clean related erratum

2016-11-17 Thread Shengzhou Liu
- add additional function erratum_a009942_check_cpo to check if the
  board needs tuning CPO calibration for optimal setting.
- move ERRATUM_A009942(with revision to check cpo_sample option) from
  fsl_ddr_gen4.c to ctrl_regs.c for reuse on all DDR4/DDR3 parts.
- move ERRATUM_A008378 from fsl_ddr_gen4.c to ctrl_regs.c
- remove obsolete ERRATUM_A004934 which is replaced with ERRATUM_A009942.

Signed-off-by: Shengzhou Liu 
---
v2: fix warning.

 arch/arm/cpu/armv8/fsl-layerscape/cpu.c   |   7 +-
 arch/powerpc/cpu/mpc85xx/cpu_init.c   |   8 +-
 arch/powerpc/include/asm/config_mpc85xx.h |   2 -
 board/freescale/ls1021aqds/ls1021aqds.c   |   6 +-
 drivers/ddr/fsl/ctrl_regs.c   | 136 +-
 drivers/ddr/fsl/fsl_ddr_gen4.c|  23 -
 drivers/ddr/fsl/mpc85xx_ddr_gen3.c|   3 -
 include/fsl_ddr.h |   2 +
 include/fsl_ddr_sdram.h   |   3 +-
 9 files changed, 155 insertions(+), 35 deletions(-)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c 
b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
index b7a2e0c..19de15e 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
@@ -25,6 +25,9 @@
 #ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
 #include 
 #endif
+#ifdef CONFIG_SYS_FSL_DDR
+#include 
+#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -400,7 +403,9 @@ int arch_early_init_r(void)
 #ifdef CONFIG_SYS_FSL_ERRATUM_A009635
erratum_a009635();
 #endif
-
+#if defined(CONFIG_SYS_FSL_ERRATUM_A009942) && defined(CONFIG_SYS_FSL_DDR)
+   erratum_a009942_check_cpo();
+#endif
 #ifdef CONFIG_MP
 #if defined(CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT) && defined(CONFIG_ARMV8_PSCI)
/* Check the psci version to determine if the psci is supported */
diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c 
b/arch/powerpc/cpu/mpc85xx/cpu_init.c
index 53b3729..0e8be1d 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
@@ -45,7 +45,9 @@
 #include 
 #include 
 #endif
-
+#ifndef CONFIG_QEMU_E500
+#include 
+#endif
 #include "../../../../drivers/block/fsl_sata.h"
 #ifdef CONFIG_U_QE
 #include 
@@ -947,6 +949,10 @@ int cpu_init_r(void)
 
 #endif /* CONFIG_SYS_FSL_USB_DUAL_PHY_ENABLE */
 
+#ifdef CONFIG_SYS_FSL_ERRATUM_A009942
+   erratum_a009942_check_cpo();
+#endif
+
 #ifdef CONFIG_FMAN_ENET
fman_enet_init();
 #endif
diff --git a/arch/powerpc/include/asm/config_mpc85xx.h 
b/arch/powerpc/include/asm/config_mpc85xx.h
index 6d845e8..1e62a9c 100644
--- a/arch/powerpc/include/asm/config_mpc85xx.h
+++ b/arch/powerpc/include/asm/config_mpc85xx.h
@@ -681,7 +681,6 @@
 #define CONFIG_SYS_FSL_USB_DUAL_PHY_ENABLE
 #define CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY
 #define CONFIG_SYS_FSL_ERRATUM_A004468
-#define CONFIG_SYS_FSL_ERRATUM_A_004934
 #define CONFIG_SYS_FSL_ERRATUM_A005871
 #define CONFIG_SYS_FSL_ERRATUM_A006379
 #define CONFIG_SYS_FSL_ERRATUM_A007186
@@ -720,7 +719,6 @@
 #define CONFIG_SYS_FSL_TBCLK_DIV   16
 #define CONFIG_SYS_FSL_PCIE_COMPAT "fsl,qoriq-pcie-v2.4"
 #define CONFIG_SYS_FSL_USB1_PHY_ENABLE
-#define CONFIG_SYS_FSL_ERRATUM_A_004934
 #define CONFIG_SYS_FSL_ERRATUM_A005871
 #define CONFIG_SYS_FSL_ERRATUM_A006379
 #define CONFIG_SYS_FSL_ERRATUM_A007186
diff --git a/board/freescale/ls1021aqds/ls1021aqds.c 
b/board/freescale/ls1021aqds/ls1021aqds.c
index 4eb38a7..79078d2 100644
--- a/board/freescale/ls1021aqds/ls1021aqds.c
+++ b/board/freescale/ls1021aqds/ls1021aqds.c
@@ -22,7 +22,7 @@
 #include 
 #include 
 #include 
-
+#include 
 #include "../common/sleep.h"
 #include "../common/qixis.h"
 #include "ls1021aqds_qixis.h"
@@ -433,7 +433,9 @@ int board_init(void)
 #ifdef CONFIG_SYS_FSL_ERRATUM_A010315
erratum_a010315();
 #endif
-
+#ifdef CONFIG_SYS_FSL_ERRATUM_A009942
+   erratum_a009942_check_cpo();
+#endif
major = get_soc_major_rev();
if (major == SOC_MAJOR_VER_1_0) {
/* Set CCI-400 control override register to
diff --git a/drivers/ddr/fsl/ctrl_regs.c b/drivers/ddr/fsl/ctrl_regs.c
index 24fd366..69b3aed 100644
--- a/drivers/ddr/fsl/ctrl_regs.c
+++ b/drivers/ddr/fsl/ctrl_regs.c
@@ -5,14 +5,14 @@
  */
 
 /*
- * Generic driver for Freescale DDR/DDR2/DDR3 memory controller.
+ * Generic driver for Freescale DDR/DDR2/DDR3/DDR4 memory controller.
  * Based on code from spd_sdram.c
  * Author: James Yang [at freescale.com]
  */
 
 #include 
 #include 
-
+#include 
 #include 
 #include 
 #include 
@@ -2306,6 +2306,38 @@ compute_fsl_memctl_config_regs(const unsigned int 
ctrl_num,
unsigned int ip_rev = 0;
unsigned int unq_mrs_en = 0;
int cs_en = 1;
+#ifdef CONFIG_SYS_FSL_ERRATUM_A009942
+   unsigned int ddr_freq;
+#endif
+#if (defined(CONFIG_SYS_FSL_ERRATUM_A008378) && \
+   defined(CONFIG_SYS_FSL_DDRC_GEN4)) || \
+   defined(CONFIG_SYS_FSL_ERRATUM_A009942)
+   struct ccsr_ddr __iomem *ddrc;
+
+   switch (ctrl_num) {
+   case 0:
+   ddrc = (void *)CONFIG_SYS_FSL_

[U-Boot] [PATCH 1/2] Add-MSCC-Phys-VSC8530-VSC8531-VSC8540-VSC8541

2016-11-17 Thread John Haechten
>From 452bf05d5e3add67f2dded5537da4bb5d0527e70 Mon Sep 17 00:00:00 2001
From: John Haechten 
Date: Mon, 14 Nov 2016 08:44:02 -0800
Subject: [PATCH 1/2] Add-MSCC-Phys-VSC8530-VSC8531-VSC8540-VSC8541 (C)
Copyright 2016 Microsemi Corporation, MIT License (MIT) Author:John Haechten
 Signed-off-by:John Haechten
; Reviewed-by:Howard Hicks
; Series-to:u-boot;phy; Cc:Allan Nielsen
; Tested-by:Howard Hicks

Series-name:Add-Support-for-MSCC-PHY-VSC8530-VSC8531-VSC8540-VSC8541
Cover-letter:   Add u-boot support for MSCC 1G Phy family:
VSC8530/VSC8531/VSC8540/VSC8541 END Series-notes:   Tested using
BeagleBoneBlack, bb.org-overlays, v2016.11-rc3, with
0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch applied END

Signed-off-by: John Haechten 
---

drivers/net/phy/Makefile|   1 +
drivers/net/phy/mscc.c  | 462 
drivers/net/phy/phy.c   |   3 +
include/config_phylib_all_drivers.h |   1 +
include/configs/am335x_evm.h|   3 +
include/phy.h   |   1 +
scripts/config_whitelist.txt|   1 +
7 files changed, 472 insertions(+)
create mode 100644 drivers/net/phy/mscc.c

diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index 1e299b9..d372971 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -27,3 +27,4 @@ obj-$(CONFIG_PHY_TERANETICS) += teranetics.o
obj-$(CONFIG_PHY_TI) += ti.o
obj-$(CONFIG_PHY_XILINX) += xilinx_phy.o
obj-$(CONFIG_PHY_VITESSE) += vitesse.o
+obj-$(CONFIG_PHY_MSCC) += mscc.o
diff --git a/drivers/net/phy/mscc.c b/drivers/net/phy/mscc.c
new file mode 100644
index 000..e6d8fcd
--- /dev/null
+++ b/drivers/net/phy/mscc.c
@@ -0,0 +1,462 @@
+/*
+ * Driver for Microsemi VSC85xx PHYs
+ *
+ * Author: John Haechten
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2016 Microsemi Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
THE
+ * SOFTWARE.
+ *
+ */
+
+#include 
+
+/* Note: To include this PHY Driver file, #define CONFIG_PHY_MSCC */
+
+/* Microsemi PHY ID's */
+#define PHY_ID_VSC8530  0x00070560
+#define PHY_ID_VSC8531  0x00070570
+#define PHY_ID_VSC8540  0x00070760
+#define PHY_ID_VSC8541  0x00070770
+
+/* Microsemi VSC85xx PHY Register Pages */
+#define MSCC_EXT_PAGE_ACCESS31 /* Page Access Register */
+#define MSCC_PHY_PAGE_STD  0x /* Standard registers */
+#define MSCC_PHY_PAGE_EXT1 0x0001 /* Extended registers - page 1 */
+#define MSCC_PHY_PAGE_EXT2 0x0002 /* Extended registers - page 2 */
+#define MSCC_PHY_PAGE_EXT3 0x0003 /* Extended registers - page 3 */
+#define MSCC_PHY_PAGE_EXT4 0x0004 /* Extended registers - page 4 */
+#define MSCC_PHY_PAGE_GPIO 0x0010 /* GPIO registers */
+#define MSCC_PHY_PAGE_TEST 0x2A30 /* TEST Page registers */
+#define MSCC_PHY_PAGE_TR   0x52B5 /* Token Ring Page registers */
+
+/* MSCC PHY Auxiliary Control/Status Register */
+#define MIIM_AUX_CNTRL_STAT_REG  0x1c
+#define MIIM_AUX_CNTRL_STAT_ACTIPHY_TO   0x0004
+#define MIIM_AUX_CNTRL_STAT_F_DUPLEX 0x0020
+#define MIIM_AUX_CNTRL_STAT_SPEED_MASK   0x0018
+#define MIIM_AUX_CNTRL_STAT_SPEED_POS(3)
+#define MIIM_AUX_CNTRL_STAT_SPEED_10M(0x0)
+#define MIIM_AUX_CNTRL_STAT_SPEED_100M   (0x1)
+#define MIIM_AUX_CNTRL_STAT_SPEED_1000M  (0x2)
+
+#define MSCC_PHY_EXT_PHY_CNTL_1 23
+#define MAC_IF_SELECTION_MASK   0x1800
+#define MAC_IF_SELECTION_GMII   0
+#define MAC_IF_SELECTION_RMII   1
+#define MAC_IF_SELECTION_RGMII  2
+#define MAC_IF_SELECTION_POS11
+#
+/* Extended Page 2 Registers */
+#define MSCC_PHY_RGMII_CNTL 20
+#define VSC_FAST_LINK_FAIL2_ENA_MASK0x8000
+#define RGMII_RX_CLK_OUT_POS11
+#define RGMII_RX_CLK_OUT_DIS1
+#define RGMII_RX_CLK_DELAY_POS  4
+#define RGMII_RX_CLK_DELAY_MASK 0x0070
+#define RGMII_TX_CLK

Re: [U-Boot] [RFC PATCH 08/10] SPL: read and store arch property from U-Boot image

2016-11-17 Thread André Przywara
On 05/11/16 16:10, Simon Glass wrote:

Hi Simon,

> On 2 November 2016 at 19:36, Andre Przywara  wrote:
>> Read the specified "arch" value from a legacy or FIT U-Boot image and
>> store it in our SPL data structure.
>> This allows loaders to take the target architecture in account for
>> custom loading procedures.
>> Having the complete string -> arch mapping for FIT based images in the
>> SPL would be too big, so we leave it up to architectures (or boards) to
>> overwrite the weak function that does the actual translation, possibly
>> covering only the required subset there.
>>
>> Signed-off-by: Andre Przywara 
>> ---
>>  common/spl/spl.c | 1 +
>>  common/spl/spl_fit.c | 8 
>>  include/spl.h| 3 ++-
>>  3 files changed, 11 insertions(+), 1 deletion(-)
>>
> 
> Reviewed-by: Simon Glass 

Thanks!

> 
>> diff --git a/common/spl/spl.c b/common/spl/spl.c
>> index bdb165a..f76ddd2 100644
>> --- a/common/spl/spl.c
>> +++ b/common/spl/spl.c
>> @@ -114,6 +114,7 @@ int spl_parse_image_header(struct spl_image_info 
>> *spl_image,
>> header_size;
>> }
>> spl_image->os = image_get_os(header);
>> +   spl_image->arch = image_get_arch(header);
>> spl_image->name = image_get_name(header);
>> debug("spl: payload image: %.*s load addr: 0x%x size: %d\n",
>> (int)sizeof(spl_image->name), spl_image->name,
>> diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
>> index aae556f..a5d903b 100644
>> --- a/common/spl/spl_fit.c
>> +++ b/common/spl/spl_fit.c
>> @@ -123,6 +123,11 @@ static int get_aligned_image_size(struct spl_load_info 
>> *info, int data_size,
>> return (data_size + info->bl_len - 1) / info->bl_len;
>>  }
>>
>> +__weak u8 spl_genimg_get_arch_id(const char *arch_str)
>> +{
>> +   return IH_ARCH_DEFAULT;
>> +}
>> +
> 
> Do we need this weak function, or could we just add a normal function
> in the ARM code somewhere?

Mmh, but this here is generic code. In a later patch I provide an ARM
specific function under arch/arm, but so far this weak function just
mimics the current behaviour: return the current architecture.

> If you don't think we need much error checking you could do something like:
> 
> #ifdef CONFIG_ARM
> ... possible strcmp() here
> return IH_ARCH_ARM;
> #endif

So I found the weak function more elegant than #ifdef-ing architecture
specific code into a generic file.
Is there any issue with weak functions, shall we avoid them?

> 
>>  int spl_load_simple_fit(struct spl_image_info *spl_image,
>> struct spl_load_info *info, ulong sector, void *fit)
>>  {
>> @@ -136,6 +141,7 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
>> int base_offset, align_len = ARCH_DMA_MINALIGN - 1;
>> int src_sector;
>> void *dst, *src;
>> +   const char *arch_str;
>>
>> /*
>>  * Figure out where the external images start. This is the base for 
>> the
>> @@ -184,10 +190,12 @@ int spl_load_simple_fit(struct spl_image_info 
>> *spl_image,
>> data_offset = fdt_getprop_u32(fit, node, "data-offset");
>> data_size = fdt_getprop_u32(fit, node, "data-size");
>> load = fdt_getprop_u32(fit, node, "load");
>> +   arch_str = fdt_getprop(fit, node, "arch", NULL);
>> debug("data_offset=%x, data_size=%x\n", data_offset, data_size);
>> spl_image->load_addr = load;
>> spl_image->entry_point = load;
>> spl_image->os = IH_OS_U_BOOT;
>> +   spl_image->arch = spl_genimg_get_arch_id(arch_str);
>>
>> /*
>>  * Work out where to place the image. We read it so that the first
>> diff --git a/include/spl.h b/include/spl.h
>> index e080a82..6a9d2fb 100644
>> --- a/include/spl.h
>> +++ b/include/spl.h
>> @@ -22,11 +22,12 @@
>>
>>  struct spl_image_info {
>> const char *name;
>> -   u8 os;
>> u32 load_addr;
>> u32 entry_point;
>> u32 size;
>> u32 flags;
>> +   u8 os;
>> +   u8 arch;
> 
> Can you please add a struct comment?

Is that something specific / a special documentation format or do you
mean just document the structure members?

Cheers,
Andre.


___
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


Re: [U-Boot] [PATCH] spl: remove redundant call to parse_image_header()

2016-11-17 Thread Simon Glass
On 16 November 2016 at 04:15, Tomas Melin  wrote:
> Image header was checked twice.
>
> Signed-off-by: Tomas Melin 
> ---
>  common/spl/spl_ymodem.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/common/spl/spl_ymodem.c b/common/spl/spl_ymodem.c
> index 13e8e51..957894d 100644
> --- a/common/spl/spl_ymodem.c
> +++ b/common/spl/spl_ymodem.c
> @@ -109,7 +109,6 @@ static int spl_ymodem_load_image(struct spl_image_info 
> *spl_image,
> while ((res = xyzModem_stream_read(buf, BUF_SIZE, &err)) > 0)
> size += res;
> } else {
> -   spl_parse_image_header(spl_image, (struct image_header *)buf);
> ret = spl_parse_image_header(spl_image,
>  (struct image_header *)buf);
> if (ret)
> --
> 2.1.4
>

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] dm: blk: Fix get_desc to return block device descriptor

2016-11-17 Thread Simon Glass
On 16 November 2016 at 09:37, Michal Simek  wrote:
> Current get_desc() implementation is not able to succesfully
> finish and return pointer to block device descriptor.
>
> Also function always return non zero value even device is found.
>
> The patch fills block device descriptor and return 0 if device is found.
>
> Signed-off-by: Michal Simek 
> ---
>
> I have tested it with blk scsi which I am reworking after first RFC.
> With this patch I can run scsi part, scsi info, scsi read (I didn't test
> write not to break my HDD).
>
> ---
>  drivers/block/blk-uclass.c | 2 ++
>  1 file changed, 2 insertions(+)

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] spl: add check for FIT-header when loading image

2016-11-17 Thread Simon Glass
On 16 November 2016 at 03:54, Tomas Melin  wrote:
> Add check for FDT_MAGIC, otherwise also legacy images will be loaded as
> a FIT. With this check in place, the loader works correct both
> with legacy and FIT images.
>
> Signed-off-by: Tomas Melin 
> ---
>  common/spl/spl_spi.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c
> index a3caafb..78b8cd1 100644
> --- a/common/spl/spl_spi.c
> +++ b/common/spl/spl_spi.c
> @@ -99,7 +99,8 @@ static int spl_spi_load_image(struct spl_image_info 
> *spl_image,
> if (err)
> return err;
>
> -   if (IS_ENABLED(CONFIG_SPL_LOAD_FIT)) {
> +   if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) &&
> +   image_get_magic(header) == FDT_MAGIC) {
> struct spl_load_info load;
>
> debug("Found FIT\n");
> --
> 2.1.4
>

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


Re: [U-Boot] [PATCHv3 15/15] pci: layerscape: remove unnecessary legacy code

2016-11-17 Thread Simon Glass
On 16 November 2016 at 02:48, Zhiqiang Hou  wrote:
> From: Minghuan Lian 
>
> All Layerscape SoCs have supported new PCIe driver based on DM.
> The lagecy PCIe driver code is unused and can be removed.
>
> Signed-off-by: Minghuan Lian 
> Signed-off-by: Hou Zhiqiang 
> ---
> V3:
>  - No change
>
>  drivers/pci/pcie_layerscape.c | 733 
> --
>  1 file changed, 733 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] [RFC PATCH] common: miiphyutil: Work and report phy address in hex in mdio cmd

2016-11-17 Thread Simon Glass
On 16 November 2016 at 01:24, Michal Simek  wrote:
> It is confusing that mdio commands work and report phy id as
> decimal value when mii is working with hex values.
>
> For example:
> ZynqMP> mdio list
> gem:
> 21 - TI DP83867 <--> ethernet@ff0e
> ZynqMP> mdio read ethernet@ff0e 0
> Reading from bus gem
> PHY at address 21:
> 0 - 0x1140
> ZynqMP> mii dump 21 0
> Incorrect PHY address. Range should be 0-31
> ...
> ZynqMP> mii dump 15
> 0. (1140) -- PHY control register --
>   (8000:) 0.15= 0reset
>
> U-Boot normally takes hex values that's why this patch is changing mdio
> command to handle hex instead of changing mii command to handle decimal
> values.
>
> Signed-off-by: Michal Simek 
> ---
>
>  cmd/mdio.c | 6 +++---
>  common/miiphyutil.c| 2 +-
>  drivers/net/zynq_gem.c | 2 +-
>  3 files changed, 5 insertions(+), 5 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] [PATCHv3 09/15] pci: layerscape: add pci driver based on DM

2016-11-17 Thread Simon Glass
Hi,

On 16 November 2016 at 02:48, Zhiqiang Hou  wrote:
> From: Minghuan Lian 
>
> There are more than five kinds of Layerscape SoCs. unfortunately,
> PCIe controller of each SoC is a little bit different. In order
> to avoid too many macro definitions, the patch addes a new
> implementation of PCIe driver based on DM. PCIe dts node is
> used to describe the difference.
>
> Signed-off-by: Minghuan Lian 
> Signed-off-by: Hou Zhiqiang 
> ---
> V3:
>  - No change
>
>  drivers/pci/Kconfig   |   8 +
>  drivers/pci/pcie_layerscape.c | 761 
> ++
>  2 files changed, 769 insertions(+)
>
> diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
> index b8376b4..07d21ea 100644
> --- a/drivers/pci/Kconfig
> +++ b/drivers/pci/Kconfig
> @@ -61,4 +61,12 @@ config PCI_XILINX
>   Enable support for the Xilinx AXI bridge for PCI express, an IP 
> block
>   which can be used on some generations of Xilinx FPGAs.
>
> +config PCIE_LAYERSCAPE
> +   bool "Layerscape PCIe support"
> +   depends on DM_PCI
> +   help
> + Support Layerscape PCIe. The Layerscape SoC may have one or several
> + PCIe controllers. The PCIe may works in RC or EP mode according to
> + RCW setting.

Can you please write out RC, EP, RCW in full since this is help?

> +
>  endif
> diff --git a/drivers/pci/pcie_layerscape.c b/drivers/pci/pcie_layerscape.c
> index 2e6b986..f107d1c 100644
> --- a/drivers/pci/pcie_layerscape.c
> +++ b/drivers/pci/pcie_layerscape.c
> @@ -11,11 +11,14 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #ifndef CONFIG_LS102XA
>  #include 
>  #include 
>  #endif

This is odd - drivers should not have board-specific code in them.

>
> +DECLARE_GLOBAL_DATA_PTR;
> +
>  #ifndef CONFIG_SYS_PCI_MEMORY_BUS
>  #define CONFIG_SYS_PCI_MEMORY_BUS CONFIG_SYS_SDRAM_BASE
>  #endif
> @@ -40,6 +43,7 @@
>  #define PCIE_ATU_REGION_INDEX1 (0x1 << 0)
>  #define PCIE_ATU_REGION_INDEX2 (0x2 << 0)
>  #define PCIE_ATU_REGION_INDEX3 (0x3 << 0)
> +#define PCIE_ATU_REGION_NUM6
>  #define PCIE_ATU_CR1   0x904
>  #define PCIE_ATU_TYPE_MEM  (0x0 << 0)
>  #define PCIE_ATU_TYPE_IO   (0x2 << 0)
> @@ -58,6 +62,9 @@
>  #define PCIE_ATU_FUNC(x)   (((x) & 0x7) << 16)
>  #define PCIE_ATU_UPPER_TARGET  0x91C
>
> +/* DBI registers */
> +#define PCIE_SRIOV 0x178
> +#define PCIE_STRFMR1   0x71c /* Symbol Timer & Filter Mask Register1 
> */
>  #define PCIE_DBI_RO_WR_EN  0x8bc
>
>  #define PCIE_LINK_CAP  0x7c
> @@ -88,6 +95,8 @@
>  #define PCIE_BAR2_SIZE (4 * 1024) /* 4K */
>  #define PCIE_BAR4_SIZE (1 * 1024 * 1024) /* 1M */
>
> +#ifndef CONFIG_DM_PCI
> +
>  struct ls_pcie {
> int idx;
> void __iomem *dbi;
> @@ -814,3 +823,755 @@ void ft_pci_setup(void *blob, bd_t *bd)
>  {
>  }
>  #endif
> +
> +#else
> +
> +/* LUT registers */
> +#define PCIE_LUT_UDR(n)(0x800 + (n) * 8)
> +#define PCIE_LUT_LDR(n)(0x804 + (n) * 8)
> +#define PCIE_LUT_ENABLE(1 << 31)
> +#define PCIE_LUT_ENTRY_COUNT   32
> +
> +/* PF Controll registers */
> +#define PCIE_PF_VF_CTRL0x7F8
> +#define PCIE_PF_DBG0x7FC
> +
> +#define PCIE_SRDS_PRTCL(idx)   (PCIE1 + (idx))
> +#define PCIE_SYS_BASE_ADDR 0x340
> +#define PCIE_CCSR_SIZE 0x010
> +
> +/* CS2 */
> +#define PCIE_CS2_OFFSET0x1000 /* For PCIe without SR-IOV */
> +
> +#ifdef CONFIG_LS102XA
> +/* LS1021a PCIE space */
> +#define LS1021_PCIE_SPACE_OFFSET   0x40ULL
> +#define LS1021_PCIE_SPACE_SIZE 0x08ULL
> +
> +/* LS1021a PEX1/2 Misc Ports Status Register */
> +#define LS1021_PEXMSCPORTSR(pex_idx)   (0x94 + (pex_idx) * 4)
> +#define LS1021_LTSSM_STATE_SHIFT   20
> +#endif
> +
> +struct ls_pcie {
> +   int idx;
> +   struct list_head list;
> +   struct udevice *bus;
> +   struct fdt_resource dbi_res;
> +   struct fdt_resource lut_res;
> +   struct fdt_resource ctrl_res;
> +   struct fdt_resource cfg_res;
> +   void __iomem *dbi;
> +   void __iomem *lut;
> +   void __iomem *ctrl;
> +   void __iomem *cfg0;
> +   void __iomem *cfg1;
> +   bool big_endian;
> +   bool enabled;
> +   int next_lut_index;
> +   struct pci_controller hose;
> +};
> +
> +static LIST_HEAD(ls_pcie_list);
> +
> +static unsigned int dbi_readl(struct ls_pcie *pcie, unsigned int offset)
> +{
> +   return in_le32(pcie->dbi + offset);
> +}
> +
> +static void dbi_writel(struct ls_pcie *pcie, unsigned int value,
> +  unsigned int offset)
> +{
> +   out_le32(pcie->dbi + offset, value);
> +}
> +
> +#ifdef CONFIG_FSL_LSCH3
> +static void lut_writel(struct ls_pcie *pcie, unsigned int value,
> +  unsigned int offset)
> +{
> +   if (pcie->big_endian)
> +   out_be32(pcie->lut + o

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] [PATCHv3 03/15] dm: pci: remove pci_bus_to_hose(0) calling

2016-11-17 Thread Simon Glass
On 16 November 2016 at 02:48, Zhiqiang Hou  wrote:
> From: Minghuan Lian 
>
> There may be multiple PCIe controllers in a SoC.
> It is not correct that always calling pci_bus_to_hose(0) to get
> the first PCIe controller for the PCIe device connected other
> controllers. We just remove this calling because hose always point
> the correct PCIe controller.
>
> Signed-off-by: Minghuan Lian 
> Signed-off-by: Hou Zhiqiang 
> ---
> V3:
>  - Comment func pci_hose_phys_to_bus() that @hose must be the root PCI 
> controller
>
>  drivers/pci/pci_common.c | 17 +++--
>  1 file changed, 7 insertions(+), 10 deletions(-)

Reviewed-by: Simon Glass 

But please see below

>
> diff --git a/drivers/pci/pci_common.c b/drivers/pci/pci_common.c
> index 1755914..9e09acd 100644
> --- a/drivers/pci/pci_common.c
> +++ b/drivers/pci/pci_common.c
> @@ -181,11 +181,6 @@ phys_addr_t pci_hose_bus_to_phys(struct pci_controller 
> *hose,
> return phys_addr;
> }
>
> -#ifdef CONFIG_DM_PCI
> -   /* The root controller has the region information */
> -   hose = pci_bus_to_hose(0);
> -#endif
> -
> /*
>  * if PCI_REGION_MEM is set we do a two pass search with preference
>  * on matches that don't have PCI_REGION_SYS_MEMORY set
> @@ -236,6 +231,13 @@ int __pci_hose_phys_to_bus(struct pci_controller *hose,
> return 1;
>  }
>
> +/*
> + * pci_hose_phys_to_bus(): Convert physical address to bus address
> + * @hose:  PCI hose of the root PCI controller
> + * @phys_addr: physical address to convert
> + * @flags: flags of pci regions

@return 

> + *
> + */
>  pci_addr_t pci_hose_phys_to_bus(struct pci_controller *hose,
> phys_addr_t phys_addr,
> unsigned long flags)
> @@ -248,11 +250,6 @@ pci_addr_t pci_hose_phys_to_bus(struct pci_controller 
> *hose,
> return bus_addr;
> }
>
> -#ifdef CONFIG_DM_PCI
> -   /* The root controller has the region information */
> -   hose = pci_bus_to_hose(0);
> -#endif
> -
> /*
>  * if PCI_REGION_MEM is set we do a two pass search with preference
>  * on matches that don't have PCI_REGION_SYS_MEMORY set
> --
> 2.1.0.27.g96db324
>
___
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(&clk, 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, clk_rate);
> drivers/mmc/msm_sdhci.c-80- clk_free(&clk);
> drivers/mmc/msm_sdhci.c-81- if (ret < 0)
>
> drivers/net/dwc_eth_qos.c:484:  ret = clk_set_rate(&eqos->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, clk_rate);
> drivers/serial/serial_msm.c-176-clk_free(&clk);
> drivers/serial/serial_msm.c-177-if (ret < 0)
>
> drivers/spi/rk_spi.c:176:   ret = clk_set_rate(&priv->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] [PATCH] rockchip: configs: correct partitions 'boot' size

2016-11-17 Thread Simon Glass
On 15 November 2016 at 01:55, Jacob Chen  wrote:
> It should be 112M, to make rootfs start at 0x4
>
> Signed-off-by: Jacob Chen 
> ---
>
>  include/configs/rockchip-common.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH 12/15] pci: mvebu: Add PCIe driver for Armada-8K

2016-11-17 Thread Simon Glass
Hi,

On 15 November 2016 at 02:08, Stefan Roese  wrote:
> From: Shadi Ammouri 
>
> This patch adds a driver for the PCIe controller integrated in the
> Marvell Armada-8K SoC. This controller is based on the DesignWare
> IP core.
>
> The original version was written by Shadi and Yehuda. I ported this
> driver to the latest mainline U-Boot version with DM support.
>
> Tested on the Marvell DB-88F8040 Armada-8K eval board.
>
> Signed-off-by: Shadi Ammouri 
> Signed-off-by: Yehuda Yitschak 
> Signed-off-by: Stefan Roese 
> Cc: Simon Glass 
> Cc: Nadav Haklai 
> Cc: Neta Zur Hershkovits 
> Cc: Kostya Porotchkin 
> Cc: Omri Itach 
> Cc: Igal Liberman 
> Cc: Haim Boot 
> Cc: Hanna Hawa 
> ---
>  drivers/pci/Kconfig |  10 ++
>  drivers/pci/Makefile|   1 +
>  drivers/pci/pcie_dw_mvebu.c | 415 
> 
>  3 files changed, 426 insertions(+)
>  create mode 100644 drivers/pci/pcie_dw_mvebu.c
>
> diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
> index b8376b4..ff2c370 100644
> --- a/drivers/pci/Kconfig
> +++ b/drivers/pci/Kconfig
> @@ -33,6 +33,16 @@ config PCI_PNP
> help
>   Enable PCI memory and I/O space resource allocation and assignment.
>
> +config PCIE_DW_MVEBU
> +   bool "Enable Armada-8K PCIe driver (DesignWare core)"
> +   default n
> +   depends on DM_PCI
> +   depends on ARMADA_8K
> +   help
> + Say Y here if you want to enable PCIe controller support on
> + Armada-8K SoCs. The PCIe controller on Armada-8K is based on
> + DesignWare hardware.
> +
>  config PCI_SANDBOX
> bool "Sandbox PCI support"
> depends on SANDBOX && DM_PCI
> diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
> index 9583e91..86717a4 100644
> --- a/drivers/pci/Makefile
> +++ b/drivers/pci/Makefile
> @@ -30,5 +30,6 @@ obj-$(CONFIG_SH7780_PCI) +=pci_sh7780.o
>  obj-$(CONFIG_PCI_TEGRA) += pci_tegra.o
>  obj-$(CONFIG_TSI108_PCI) += tsi108_pci.o
>  obj-$(CONFIG_WINBOND_83C553) += w83c553f.o
> +obj-$(CONFIG_PCIE_DW_MVEBU) += pcie_dw_mvebu.o
>  obj-$(CONFIG_PCIE_LAYERSCAPE) += pcie_layerscape.o
>  obj-$(CONFIG_PCI_XILINX) += pcie_xilinx.o
> diff --git a/drivers/pci/pcie_dw_mvebu.c b/drivers/pci/pcie_dw_mvebu.c
> new file mode 100644
> index 000..dd5ba34
> --- /dev/null
> +++ b/drivers/pci/pcie_dw_mvebu.c
> @@ -0,0 +1,415 @@
> +/*
> + * Copyright (C) 2015 Marvell International Ltd.
> + *
> + * Copyright (C) 2016 Stefan Roese 
> + *
> + * Based on:
> + *   - drivers/pci/pcie_imx.c
> + *   - drivers/pci/pci_mvebu.c
> + *   - drivers/pci/pcie_xilinx.c
> + *
> + * SPDX-License-Identifier:GPL-2.0+
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +/* PCI Config space registers */
> +#define PCIE_CONFIG_BAR0   0x10
> +#define PCIE_LINK_STATUS_REG   0x80
> +#define PCIE_LINK_STATUS_SPEED_OFF 16
> +#define PCIE_LINK_STATUS_SPEED_MASK0xf
> +#define PCIE_LINK_STATUS_WIDTH_OFF 20
> +#define PCIE_LINK_STATUS_WIDTH_MASK0xf
> +
> +/* Resizable bar capability registers */
> +#define RESIZABLE_BAR_CAP  0x250
> +#define RESIZABLE_BAR_CTL0 0x254
> +#define RESIZABLE_BAR_CTL1 0x258
> +
> +/* iATU registers */
> +#define PCIE_ATU_VIEWPORT  0x900
> +#define PCIE_ATU_REGION_INBOUND(0x1 << 31)
> +#define PCIE_ATU_REGION_OUTBOUND   (0x0 << 31)
> +#define PCIE_ATU_REGION_INDEX1 (0x1 << 0)
> +#define PCIE_ATU_REGION_INDEX0 (0x0 << 0)
> +#define PCIE_ATU_CR1   0x904
> +#define PCIE_ATU_TYPE_MEM  (0x0 << 0)
> +#define PCIE_ATU_TYPE_IO   (0x2 << 0)
> +#define PCIE_ATU_TYPE_CFG0 (0x4 << 0)
> +#define PCIE_ATU_TYPE_CFG1 (0x5 << 0)
> +#define PCIE_ATU_CR2   0x908
> +#define PCIE_ATU_ENABLE(0x1 << 31)
> +#define PCIE_ATU_BAR_MODE_ENABLE   (0x1 << 30)
> +#define PCIE_ATU_LOWER_BASE0x90C
> +#define PCIE_ATU_UPPER_BASE0x910
> +#define PCIE_ATU_LIMIT 0x914
> +#define PCIE_ATU_LOWER_TARGET  0x918
> +#define PCIE_ATU_BUS(x)(((x) & 0xff) << 24)
> +#define PCIE_ATU_DEV(x)(((x) & 0x1f) << 19)
> +#define PCIE_ATU_FUNC(x)   (((x) & 0x7) << 16)
> +#define PCIE_ATU_UPPER_TARGET  0x91C
> +
> +#define PCIE_LINK_CAPABILITY   0x7C
> +#define PCIE_LINK_CTL_20xA0
> +#define TARGET_LINK_SPEED_MASK 0xF
> +#define LINK_SPEED_GEN_1   0x1
> +#define LINK_SPEED_GEN_2   0x2
> +#define LINK_SPEED_GEN_3   0x3
> +
> +#define PCIE_GEN3_RELATED  0x890
> +#define GEN3_EQU_DISABLE   (1 << 16)
> +#define GEN3_ZRXDC_NON_COMP(1 << 0)
> +
> +#define PCIE_GEN3_EQU_CTRL 0x8A8
> +#define GEN3_EQU_EVAL_2MS_DISABLE  (1 << 5)
> +
> +#define PCIE_ROOT_COMPLEX_

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

2016-11-17 Thread Simon Glass
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)
>  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?

>  {
> @@ -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


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 3/3] rockchip: configs: make rk3036 env config same with rk3288

2016-11-17 Thread Simon Glass
Hi Jacob

On 14 November 2016 at 21:01, Jacob Chen  wrote:
> Signed-off-by: Jacob Chen 
> ---
>
>  include/configs/kylin_rk3036.h | 17 ++---
>  1 file changed, 14 insertions(+), 3 deletions(-)

Please add a commit message.

For the subject 'same as rk3288' rather than 'same with rk3288'

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


Re: [U-Boot] [PATCH 3/3] board: popmetal: enable the usb host port power in board init

2016-11-17 Thread Simon Glass
Hi Kever,

On 15 November 2016 at 01:30, Kever Yang  wrote:
> Hi Simon,
>
> On 11/12/2016 12:17 AM, Simon Glass wrote:
>>
>> Hi Kever,
>>
>> On 9 November 2016 at 00:30, Kever Yang  wrote:
>>>
>>> Enable the usb host port 5V power by enable the fix regulator.
>>> The PopMetal board have a on board FE1.1 usb 2.0 hub which connect to
>>> the usb host port, we need to de-assert its reset pin at the same time.
>>
>> This should go in a USB driver.
>
>
> This patch 1)enable the 5V vbus power and 2)de-assert the hub reset pin,
> 1) may go to USB driver, but 2) still need to be in board init because that
> is
> totally board specific.

What is board-specific about it? Are those differences described in
the device tree?

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] [PATCH 01/11] net: dw: Add read_rom_hwaddr net_op hook

2016-11-17 Thread Simon Glass
Hi Oliver,

On 8 November 2016 at 08:54, Olliver Schinagl  wrote:
> Add the read_rom_hwaddr net_op hook so that it can be called from boards
> to read the mac from a ROM chip.
>
> Signed-off-by: Olliver Schinagl 
> ---
>  drivers/net/designware.c | 18 ++
>  1 file changed, 18 insertions(+)
>
> diff --git a/drivers/net/designware.c b/drivers/net/designware.c
> index 9e6d726..aa87f30 100644
> --- a/drivers/net/designware.c
> +++ b/drivers/net/designware.c
> @@ -230,6 +230,23 @@ static int _dw_write_hwaddr(struct dw_eth_dev *priv, u8 
> *mac_id)
> return 0;
>  }
>
> +__weak int dw_board_read_rom_hwaddr(unsigned char *enetaddr)
> +{
> +   return -ENOSYS;
> +}

Instead of a weak function I think this should use driver model, with
a driver supplied by the board to read this value. It should be
possible to supply the 'hardware-address reading' device to any
Ethernet driver, not just dwmmc.

> +
> +static int designware_eth_read_rom_hwaddr(struct udevice *dev)
> +{
> +   int retval;
> +   struct eth_pdata *pdata = dev_get_platdata(dev);
> +
> +   retval = dw_board_read_rom_hwaddr(pdata->enetaddr);
> +   if (retval == -ENOSYS)
> +   return 0;
> +
> +   return retval;
> +}
> +
>  static void dw_adjust_link(struct eth_mac_regs *mac_p,
>struct phy_device *phydev)
>  {
> @@ -685,6 +702,7 @@ static const struct eth_ops designware_eth_ops = {
> .free_pkt   = designware_eth_free_pkt,
> .stop   = designware_eth_stop,
> .write_hwaddr   = designware_eth_write_hwaddr,
> +   .read_rom_hwaddr= designware_eth_read_rom_hwaddr,
>  };
>
>  static int designware_eth_ofdata_to_platdata(struct udevice *dev)
> --
> 2.10.2
>

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


Re: [U-Boot] [PATCH 2/3] rockchip: configs: correct env offset when enable CONFIG_ROCKCHIP_SPL_BACK_TO_BROM

2016-11-17 Thread Simon Glass
Hi Jacob,

On 14 November 2016 at 21:01, Jacob Chen  wrote:
> Signed-off-by: Jacob Chen 
> ---
>
>  include/configs/evb_rk3288.h  | 9 +
>  include/configs/fennec_rk3288.h   | 9 +
>  include/configs/miniarm_rk3288.h  | 9 +
>  include/configs/popmetal_rk3288.h | 9 +
>  4 files changed, 36 insertions(+)

Please can you add a commit message? What is the problem? What change
are you making?

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


[U-Boot] [PATCH 2/2] Fix patman alignment issues in Add MSCC PHY:VSC8530/VSC8531/VSC8540/VSC8541

2016-11-17 Thread John Haechten
>From 2dc0ca2639fb806df031dc4bb2a1bca655f97b08 Mon Sep 17 00:00:00 2001
From: John Haechten 
Date: Mon, 14 Nov 2016 08:50:48 -0800
Subject: [PATCH 2/2] Fix patman alignment issues in Add MSCC
PHY:VSC8530/VSC8531/VSC8540/VSC8541 (C) Copyright 2016 Microsemi Corporation,
MIT License (MIT) Author: John Haechten 
Signed-off-by:John Haechten ; Reviewed-by:Howard
Hicks ; Series-to:u-boot;phy; Cc:Allan Nielsen
 Tested-by:Howard Hicks
 Series-name:Add Support for MSCC
PHY:VSC8530/VSC8531/VSC8540/VSC8541 Cover-letter:   Add u-boot support for
MSCC 1G Phy family: VSC8530/VSC8531/VSC8540/VSC8541 END Series-notes:
 Tested using BeagleBoneBlack, bb.org-overlays, v2016.11-rc3, with
0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch applied END

Signed-off-by: John Haechten 
---

drivers/net/phy/mscc.c | 2 +-
drivers/net/phy/phy.c  | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/mscc.c b/drivers/net/phy/mscc.c
index e6d8fcd..8070e8a 100644
--- a/drivers/net/phy/mscc.c
+++ b/drivers/net/phy/mscc.c
@@ -385,7 +385,7 @@ static int vsc8541_config(struct phy_device *phydev)
   break;
 default:
   printf("PHY 8541 MAC i/f config Error: mac i/f = 0x%x\n",
- phydev->interface);
+  phydev->interface);
   return -EINVAL;
 }

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 539abee..8db6574 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -513,7 +513,7 @@ int phy_init(void)
 phy_xilinx_init();
#endif
#ifdef CONFIG_PHY_MSCC
-phy_mscc_init();
+ phy_mscc_init();
#endif

  return 0;
--
1.9.1


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


Re: [U-Boot] [PATCH 1/3] davinci: omapl138_lcdk: use correct AIS config

2016-11-17 Thread Peter Howard
On Thu, 2016-11-17 at 17:19 -0500, Tom Rini wrote:
>   Error verifying signature: gpg: Fatal: can't create directory
> '/home/phoward/.gnupg': File exists
> On Wed, Nov 16, 2016 at 05:33:33PM +0100, Fabien Parent wrote:
> 
> > 
> > The AIS image built for the OMAPL138-LCDK board is not booting
> > because
> > the AIS configuration is not correct.
> > This commit adds a AIS configuration file that allow the SPL to
> > boot
> > correctly.
> > 
> > Signed-off-by: Fabien Parent 
> 
> Reviewed-by: Tom Rini 

Given these changes, can you modify/remove
board/davinci/da8xxevm/README.omapl138-lcdk please?


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


[U-Boot] [PATCH] sunxi: add support for Nintendo NES Classic Edition

2016-11-17 Thread FUKAUMI Naoki
Signed-off-by: FUKAUMI Naoki 
---
 arch/arm/dts/Makefile  |  1 +
 .../dts/sun8i-r16-nintendo-nes-classic-edition.dts | 63 ++
 board/sunxi/MAINTAINERS|  5 ++
 configs/Nintendo_NES_Classic_Edition_defconfig | 24 +
 4 files changed, 93 insertions(+)
 create mode 100644 arch/arm/dts/sun8i-r16-nintendo-nes-classic-edition.dts
 create mode 100644 configs/Nintendo_NES_Classic_Edition_defconfig

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 932dbe0..660f175 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -255,6 +255,7 @@ dtb-$(CONFIG_MACH_SUN8I_A33) += \
sun8i-a33-olinuxino.dtb \
sun8i-a33-q8-tablet.dtb \
sun8i-a33-sinlinx-sina33.dtb \
+   sun8i-r16-nintendo-nes-classic-edition.dtb \
sun8i-r16-parrot.dtb
 dtb-$(CONFIG_MACH_SUN8I_A83T) += \
sun8i-a83t-allwinner-h8homlet-v2.dtb \
diff --git a/arch/arm/dts/sun8i-r16-nintendo-nes-classic-edition.dts 
b/arch/arm/dts/sun8i-r16-nintendo-nes-classic-edition.dts
new file mode 100644
index 000..dce688e
--- /dev/null
+++ b/arch/arm/dts/sun8i-r16-nintendo-nes-classic-edition.dts
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2016 FUKAUMI Naoki 
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun8i-a33.dtsi"
+
+/ {
+   model = "Nintendo NES Classic Edition";
+   compatible = "nintendo,nes-classic-edition", "allwinner,sun8i-a33";
+
+   aliases {
+   serial0 = &uart0;
+   };
+
+   chosen {
+   stdout-path = "serial0:115200n8";
+   };
+};
+
+&uart0 {
+   pinctrl-names = "default";
+   pinctrl-0 = <&uart0_pins_a>;
+   status = "okay";
+};
diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS
index d7dc55b..e23d45e 100644
--- a/board/sunxi/MAINTAINERS
+++ b/board/sunxi/MAINTAINERS
@@ -232,6 +232,11 @@ M: Jelle van der Waa 
 S: Maintained
 F: configs/nanopi_neo_defconfig
 
+NINTENDO NES CLASSIC EDITION BOARD
+M: FUKAUMI Naoki 
+S: Maintained
+F: configs/Nintendo_NES_Classic_Edition_defconfig
+
 R16 EVB PARROT BOARD
 M: Quentin Schulz 
 S: Maintained
diff --git a/configs/Nintendo_NES_Classic_Edition_defconfig 
b/configs/Nintendo_NES_Classic_Edition_defconfig
new file mode 100644
index 000..fcda1be
--- /dev/null
+++ b/configs/Nintendo_NES_Classic_Edition_defconfig
@@ -0,0 +1,24 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+# CONFIG_SPL_MMC_SUPPORT is not set
+CONFIG_MACH_SUN8I_A33=y
+CONFIG_DRAM_CLK=600
+CONFIG_DRAM_ZQ=15291
+CONFIG_DRAM_ODT_EN=y
+# CONFIG_MMC is not set
+CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
+CONFIG_AXP_GPIO=y
+CONFIG_DEFAULT_DEVICE_TREE="sun8i-r16-nintendo-nes-classic-edition"
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_SPL=y
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_FPGA is not set
+CONFIG_AXP_DLDO1_VOLT=3300
+CONFIG_AXP_ELDO2_VOLT=1800
+CONFIG_USB_MUSB_GADGET=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_G_DNL_MANUFACTURER="Allwinner Technol

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 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.

York

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


Re: [U-Boot] [PATCH 3/7] sunxi: Enable UBI and NAND support

2016-11-17 Thread Maxime Ripard
On Mon, Nov 14, 2016 at 03:21:41PM +0100, Hans de Goede wrote:
> Hi,
> 
> On 14-11-16 15:12, Maxime Ripard wrote:
> > On Mon, Nov 14, 2016 at 12:18:06PM +0100, Hans de Goede wrote:
> > > >  #ifdef CONFIG_SPL_SPI_SUNXI
> > > > @@ -143,7 +157,14 @@
> > > >  #define CONFIG_GENERIC_MMC
> > > >  #define CONFIG_MMC_SUNXI
> > > >  #define CONFIG_MMC_SUNXI_SLOT  0
> > > > -#define CONFIG_ENV_IS_IN_MMC
> > > > +#endif
> > > > +
> > > > +#if defined(CONFIG_ENV_IS_IN_NAND)
> > > > +#define CONFIG_ENV_OFFSET  0xc0
> > > > +#define CONFIG_ENV_SIZE0x40
> > > > +#elif defined(CONFIG_ENV_IS_IN_MMC)
> > > > +#define CONFIG_ENV_OFFSET  (544 << 10) /* (8 + 24 
> > > > + 512) KiB */
> > > > +#define CONFIG_ENV_SIZE(128 << 10) /* 
> > > > 128 KiB */
> > > >  #define CONFIG_SYS_MMC_ENV_DEV 0   /* first detected MMC 
> > > > controller */
> > > >  #endif
> > 
> > Oh, and this part is broken. It relies on the fact that all board
> > define ENV_IS_IN_MMC (which they should), while obviously they
> > don't. I'm not exactly sure about what the proper fix would be.
> 
> Yes, this has been a known problem for a while, but never
> became an issue due to lack of NAND support.
> 
> My preferred way for dealing with this be would for the
> environment code in u-boot allowing to build in multiple
> back-ends and use spl_boot_device() which then would need
> to loose its spl prefix. For the CHIP devices I'm sure
> you can come up with a simpler fix since those don't
> have an sdcard-slot. But for other boards this will be
> necessary as we really don't want to have separate
> nand and mmc u-boot.bin files.

Ack, thanks.

> Anyways this is something for whomever will take over as sunxi
> custodian from me. Maybe someone from free-electrons can co-maintain
> with Jagan ?

Yes, that would make a lot of sense. I'll discuss this internally, and
do the interim while we come up with someone.

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 3/3] davinci: omapl138_lcdk: add MMC/SD SPL boot support

2016-11-17 Thread Tom Rini
On Wed, Nov 16, 2016 at 05:33:35PM +0100, Fabien Parent wrote:
> Define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR in order to be able
> to boot from MMC/SD.
> 
> The SPL is stored at sector 0x75, while u-boot will follow at
> sector 0xb5.
> 
> Signed-off-by: Fabien Parent 
> ---
>  include/configs/omapl138_lcdk.h | 8 
>  1 file changed, 8 insertions(+)
> 
> diff --git a/include/configs/omapl138_lcdk.h b/include/configs/omapl138_lcdk.h
> index 91ddbb1..0964176 100644
> --- a/include/configs/omapl138_lcdk.h
> +++ b/include/configs/omapl138_lcdk.h
> @@ -272,6 +272,14 @@
>  #define CONFIG_SPL_PAD_TO32768
>  #endif
>  
> +/* Load U-Boot Image From MMC */
> +#ifdef CONFIG_SPL_MMC_LOAD
> +#define SPL_SECTOR   0x75
> +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR  (SPL_SECTOR + \
> + CONFIG_SPL_PAD_TO / 512)
> +#undef CONFIG_SPL_SPI_LOAD
> +#endif
> +
>  /* AIS Image */
>  #define CONFIG_AIS_CONFIG_FILE   
> "board/davinci/da8xxevm/omapl138_lcdk_ais.cfg"

We need to do this on top of Sam's series, and we need to do this in
Kconfig and not adding more stuff to the config header.

-- 
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 2/3] davinci: da850evm: fix empty boot method list in the SPL

2016-11-17 Thread Tom Rini
On Wed, Nov 16, 2016 at 05:33:34PM +0100, Fabien Parent wrote:

> The list of available boot method is not part of the binary which
> prevent the SPL from booting u-boot or Linux.
> 
> Add the missing .u_boot_list* sections to the binary to fix it.
> 
> Signed-off-by: Fabien Parent 

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] [PATCH 1/3] davinci: omapl138_lcdk: use correct AIS config

2016-11-17 Thread Tom Rini
On Wed, Nov 16, 2016 at 05:33:33PM +0100, Fabien Parent wrote:

> The AIS image built for the OMAPL138-LCDK board is not booting because
> the AIS configuration is not correct.
> This commit adds a AIS configuration file that allow the SPL to boot
> correctly.
> 
> Signed-off-by: Fabien Parent 

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] [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] [PATCH] ARM: OMAP3_LOGIC: Update MTD Partition Table

2016-11-17 Thread Tom Rini
On Sat, Nov 12, 2016 at 10:02:37PM -0600, Adam Ford wrote:

> The previous partition table did not support a separate device tree
> and the kernel size was limited to 4MB.  This update shows the
> location of the device tree (labeled as spl-os) for those who
> want to use Falcon Mode or use U-Boot to store the Flattened
> Device Tree (FDT) to NAND without appending it to the kernel.
> 
> This also grows the kernel to 6MB since 4MB was becomming tight
> 
> Signed-off-by: Adam Ford 
> 
> diff --git a/include/configs/omap3_logic.h b/include/configs/omap3_logic.h
> index 301d4b2..abce61a 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] 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] [PATCH] ARM: OMAP3_LOGIC: Fix SPL Memory Map for Falcon Mode

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

> The memory map defined in commit ("49c7303f0e52: OMAP3: Enable SPL
> on omap3_logic) was used by a copy-paste of another board without
> fully understanding how the map works in Falcon mode.  This patch
> undoes the customization and uses the default SPL Memory Map
> for OMAP3.
> 
> When building the uImage, set LOADADDR=0x8200 and Falcon
> mode should properly load.
> 
> Signed-off-by: Adam Ford 
> 
> diff --git a/include/configs/omap3_logic.h b/include/configs/omap3_logic.h
> index 0827ebe..301d4b2 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] [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


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] [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] [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
+++ b/test/py/tests/

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] 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] [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 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(&rstcr, 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] [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] 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


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 = <&lic>;


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


[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


[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
http://lists.denx.de/mailman/listinfo/u-boo

[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


[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 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
+
+if u_boot_console.config.buil

[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 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


[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 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 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 spl_net_load_image(spl

[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, &bootdev);
@@ -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 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, &bootdev);
 
+   return loader->load_image(spl_image, &bootdev);
+}
+
+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(&spl_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(&spl_image, spl_boot_list[i]))
-   break;
-   }
 
-   if (i == ARRAY_SIZE(spl_boot_list) ||
-   spl_boot_list[i] == BOOT_DEVICE_NONE) {
+   if (boot_from_devices(&spl_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 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


[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


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


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


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


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] [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] 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 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(&rstcr, 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 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 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


[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] 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] 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


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 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 address which maps to @paddr
> 
> Why two Returns?

The first is just a part of the paragraph explaining what the function does. I 
could start it with "This function returns" if you really want, but I don't 
see as that makes it any clearer. The second is the kernel-doc style 
description of what the function returns, as described above.

> 
> > + */
> > +#ifndef phys_to_virt
> > +static inline void *phy

[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] 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


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


[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)&secondary_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(&gur->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(&gur->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(&gur->bootlocptrh, (u32)(gd->relocaddr >> 32));
gur_out32(&gur->bootlocptrl, (u32)gd->relocaddr);
-   gur_out32(&gur->scratchrw[6], 1);
-   asm volatile("dsb st" : : : "memory");
-   rst->brrl = cores;
-   asm volatile("dsb st" : : : "memory");
+
+   svr = gur_in32(&gur->svr);
+   ver = SVR_SOC_VER(svr);
+   if (ver == SVR_LS2080A || ver == SVR_LS2085A) {
+   gur_out32(&gur->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(&gur->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(&gur->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)
+   wake_secondary_core_n(i, j,
+

  1   2   >