Re: [U-Boot] [PATCH v2] armv7: add cacheline sizes where missing

2016-01-28 Thread Albert ARIBAUD
On Wed, 27 Jan 2016 08:46:11 +0100, Albert ARIBAUD
 wrote:
> Some armv7 targets are missing a cache line size declaration.
> In preparation for "arm: cache: Implement cache range check for v7"
> patch, add these declarations with the appropriate value for
> the target's SoC or CPU.
> 
> Signed-off-by: Albert ARIBAUD 
> ---
> 
> Changes in v2:
> - fix include/configs/at91-sama5_common.h (Cortex-A5: 32 bytes)

Applied to u-boot-arm/master, adding Tom's Reviewed-by from V1 since
there was no change to TI boards in V2.

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


Re: [U-Boot] [PATCH 0/2] dfu: samsung: Commits to allow sending and storing large files via DFU

2016-01-28 Thread Heiko Schocher

Hello Lukasz,

Am 28.01.2016 um 17:46 schrieb Lukasz Majewski:

Those commits allow sending and storing large files (e.g. 26 MiB) on the Odroid 
XU3 board.

On purpose they are sent together to shed light on the process of tunning board 
to
be capable of large files transfer.

I would be _REALLY_ grateful for excessive testing, since I'm not able to test 
this code
on NAND based devices. Please support me and test this patch for potential 
regressions.

This change applies on the u-boot-master tree.
SHA1: aada3d062a0cacde1e783af2ac560f2a0fdf3682

Lukasz Majewski (2):
   dfu: usb: f_dfu: Set deferred call for dfu_flush() function
   dfu: odroid xu3: Define DFU_MANIFEST_POLL_TIMEOUT to handle large
 files transmission and storage

  common/cmd_dfu.c | 20 
  drivers/usb/gadget/f_dfu.c   | 11 +++
  include/configs/odroid_xu3.h |  1 +
  include/dfu.h| 25 +
  4 files changed, 49 insertions(+), 8 deletions(-)


Tested on the smartweb board (NAND):
http://xeidos.ddns.net/buildbot/builders/smartweb_dfu/builds/49/steps/shell/logs/tbotlog

with current U-Boot mainline.

bye,
Heiko
--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH] dfu: allow get_medium_size() to return bigger medium sizes than 2GiB

2016-01-28 Thread Heiko Schocher

Hello Joe,

Am 28.01.2016 um 16:03 schrieb Joe Hershberger:

On Thu, Jan 28, 2016 at 8:24 AM, Heiko Schocher  wrote:

change the get_medium_size() function from
-   long (*get_medium_size)(struct dfu_entity *dfu);
+   int (*get_medium_size)(struct dfu_entity *dfu, u64 *size);

so it can return bigger medium sizes than 2GiB, and the return
value is seperate from the size.

Signed-off-by: Heiko Schocher 

---
I just have a DDP nand with a size of 4GiB, and the
mtd partition layout is:
device nand2 , # parts = 9
  #: namesizeoffset  mask_flags
  0: spl 0x0008  0x  0
  1: spl.backup1 0x0008  0x0008  0
  2: spl.backup2 0x0008  0x0010  0
  3: spl.backup3 0x0008  0x0018  0
  4: u-boot  0x0078  0x0020  0
  5: u-boot.env0 0x0020  0x0098  0
  6: u-boot.env1 0x0020  0x00b8  0
  7: mtdoops 0x0020  0x00d8  0
  8: rootfs  0xff08  0x00f8  0

so the last partition is to big for returning the size in a long.


to -> too



  drivers/dfu/dfu.c  | 8 
  drivers/dfu/dfu_mmc.c  | 8 +---
  drivers/dfu/dfu_nand.c | 5 +++--
  drivers/dfu/dfu_ram.c  | 5 +++--
  drivers/dfu/dfu_sf.c   | 5 +++--
  include/dfu.h  | 4 ++--
  6 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
index 8f5915e..daa2eb9 100644
--- a/drivers/dfu/dfu.c
+++ b/drivers/dfu/dfu.c
@@ -335,11 +335,11 @@ int dfu_read(struct dfu_entity *dfu, void *buf, int size, 
int blk_seq_num)
 if (dfu->i_buf_start == NULL)
 return -ENOMEM;

-   dfu->r_left = dfu->get_medium_size(dfu);
-   if (dfu->r_left < 0)
-   return dfu->r_left;
+   ret = dfu->get_medium_size(dfu, &dfu->r_left);
+   if (ret < 0)
+   return ret;

-   debug("%s: %s %ld [B]\n", __func__, dfu->name, dfu->r_left);
+   debug("%s: %s %lld [B]\n", __func__, dfu->name, dfu->r_left);

 dfu->i_blk_seq_num = 0;
 dfu->crc = 0;
diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c
index 395d472..5c1c1d1 100644
--- a/drivers/dfu/dfu_mmc.c
+++ b/drivers/dfu/dfu_mmc.c
@@ -205,14 +205,15 @@ int dfu_flush_medium_mmc(struct dfu_entity *dfu)
 return ret;
  }

-long dfu_get_medium_size_mmc(struct dfu_entity *dfu)
+int dfu_get_medium_size_mmc(struct dfu_entity *dfu, u64 *size)


i64 size? Same for all other places.


Lukasz mentioned "long long" ...


  {
 int ret;
 long len;

 switch (dfu->layout) {
 case DFU_RAW_ADDR:
-   return dfu->data.mmc.lba_size * dfu->data.mmc.lba_blk_size;
+   *size = dfu->data.mmc.lba_size * dfu->data.mmc.lba_blk_size;


You need to check that size is not NULL before dereferencing it. Same
for all other places.


Correct, add it.


+   return 0;
 case DFU_FS_FAT:
 case DFU_FS_EXT4:
 dfu_file_buf_filled = -1;
@@ -221,7 +222,8 @@ long dfu_get_medium_size_mmc(struct dfu_entity *dfu)
 return ret;
 if (len > CONFIG_SYS_DFU_MAX_FILE_SIZE)
 return -1;
-   return len;
+   *size = len;
+   return 0;
 default:
 printf("%s: Layout (%s) not (yet) supported!\n", __func__,
dfu_get_layout(dfu->layout));
diff --git a/drivers/dfu/dfu_nand.c b/drivers/dfu/dfu_nand.c
index a975492..4612e09 100644
--- a/drivers/dfu/dfu_nand.c
+++ b/drivers/dfu/dfu_nand.c
@@ -114,9 +114,10 @@ static int dfu_write_medium_nand(struct dfu_entity *dfu,
 return ret;
  }

-long dfu_get_medium_size_nand(struct dfu_entity *dfu)
+int dfu_get_medium_size_nand(struct dfu_entity *dfu, u64 *size)
  {
-   return dfu->data.nand.size;
+   *size = dfu->data.nand.size;
+   return 0;
  }

  static int dfu_read_medium_nand(struct dfu_entity *dfu, u64 offset, void *buf,
diff --git a/drivers/dfu/dfu_ram.c b/drivers/dfu/dfu_ram.c
index e094a94..466759d 100644
--- a/drivers/dfu/dfu_ram.c
+++ b/drivers/dfu/dfu_ram.c
@@ -41,9 +41,10 @@ static int dfu_write_medium_ram(struct dfu_entity *dfu, u64 
offset,
 return dfu_transfer_medium_ram(DFU_OP_WRITE, dfu, offset, buf, len);
  }

-long dfu_get_medium_size_ram(struct dfu_entity *dfu)
+int dfu_get_medium_size_ram(struct dfu_entity *dfu, u64 *size)
  {
-   return dfu->data.ram.size;
+   *size = dfu->data.ram.size;
+   return 0;
  }

  static int dfu_read_medium_ram(struct dfu_entity *dfu, u64 offset,
diff --git a/drivers/dfu/dfu_sf.c b/drivers/dfu/dfu_sf.c
index 9702eee..35c5fa1 100644
--- a/drivers/dfu/dfu_sf.c
+++ b/drivers/dfu/dfu_sf.c
@@ -12,9 +12,10 @@
  #include 
  #include 

-static long

Re: [U-Boot] [PATCH 10/26] Kconfig: Move CONFIG_FIT and CONFIG_OF_*_SETUP to Kconfig

2016-01-28 Thread Heiko Schocher

Hello Simon,

Am 28.01.2016 um 17:39 schrieb Simon Glass:

Move these options to Kconfig and tidy up board configuration:

CONFIG_FIT
CONFIG_OF_BOARD_SETUP
CONFIG_OF_SYSTEM_SETUP

Unfortunately the first one is a little complicated. We need to make sure
this option is not enabled in SPL by this change. Also this option is
enabled automatically in the host builds by defining CONFIG_GIT in the


CONFIG_FIT ?


image.h file. To solve this, add a new IMAGE_USE_FIT #define which can
be used in files that are built on the host but must also build for U-Boot
and SPL.

Note: Masahiro's moveconfig.py script is amazing.

Signed-off-by: Simon Glass 
---


bye,
Heiko
--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] rpi: link to another model number info source

2016-01-28 Thread Stephen Warren
This source has been blessed by Dom Cobley at the RPi Foundation, so seems
like the best source to refer to. It's a superset of and consistent with
the other sources.

Cc: Lubomir Rintel 
Cc: Eric Anholt 
Signed-off-by: Stephen Warren 
---
This patch is in reponse to Lubomir Rintel's "rpi: fix up Model B
entries", although doesn't actually depend on it for context.
---
 board/raspberrypi/rpi/rpi.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index b344362514fe..89d78cc6c407 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -78,6 +78,11 @@ struct msg_get_clock_rate {
  * 
http://raspberryalphaomega.org.uk/2013/02/06/automatic-raspberry-pi-board-revision-detection-model-a-b1-and-b2/
  * http://www.raspberrypi.org/forums/viewtopic.php?f=63&t=32733
  * 
http://git.drogon.net/?p=wiringPi;a=blob;f=wiringPi/wiringPi.c;h=503151f61014418b9c42f4476a6086f75cd4e64b;hb=refs/heads/master#l922
+ *
+ * In http://lists.denx.de/pipermail/u-boot/2016-January/243752.html
+ * ("[U-Boot] [PATCH] rpi: fix up Model B entries") Dom Cobley at the RPi
+ * Foundation stated that the following source was accurate:
+ * https://github.com/AndrewFromMelbourne/raspberry_pi_revision
  */
 struct rpi_model {
const char *name;
-- 
1.9.1

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


Re: [U-Boot] [PATCH] rpi: fix up Model B entries

2016-01-28 Thread Stephen Warren
On 01/25/2016 01:36 PM, Lubomir Rintel wrote:
> It seems like the P5 header was not present on "Model B" any board prior
> to Revision 2.0, there's no need for a separate device tree.
> 
> Also, it looks like "rev2" is incorrectly used to only cover the 512MiB
> memory models; there also were 256MiB 2.0 boards.
> 
> I don't have all of the boards to check this, I'm following this table:
> http://elinux.org/RPi_HardwareHistory#Board_Revision_History
> ---

You forgot you signed-off-by line on this patch. You also possibly need
to Cc Tom Rini so he knows the patch exists.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Include patchwork patch ID in commit message?

2016-01-28 Thread Heiko Schocher

Hello Joe,

Am 28.01.2016 um 16:15 schrieb Joe Hershberger:

Hi Heiko,

On Thu, Jan 28, 2016 at 12:39 AM, Heiko Schocher  wrote:

Hello Tom,

Am 28.01.2016 um 00:45 schrieb Tom Rini:


On Wed, Jan 27, 2016 at 05:15:17PM -0600, Joe Hershberger wrote:


On Wed, Jan 27, 2016 at 4:22 PM, Tom Rini  wrote:


On Wed, Jan 27, 2016 at 03:08:09PM -0600, Joe Hershberger wrote:


Hi Tom,

I'm playing with the idea of including the patchwork patch ID in the
commit message of each commit that I apply to provide better
cross-reference ability.

* Access to comments on patches
* Clarity on exactly which version of a patch was applied
* No need to search by patch subject

Here is an example in a working branch:


http://git.denx.de/?p=u-boot/u-boot-net.git;a=commit;h=48f9a0c786d0a3cbfdf45846567deaebe27a334a



I'd prfer Patchwork or Patchwork-ID or something not just Patch.



Would it be more or less compelling if it had a format similar this?

Patchwork: https://patchwork.ozlabs.org/patch/571773/



Yes.



Sorry, for dummy question ... what should I see in the above link?


The link is the think to see, not what it points to. The idea is that
instead of just the patch number, include the patch number in a full
URL for even easier access to the patch.


Uh, ah, got it ... I think the patchworks patchnumber would be enough.
I like Bins proposal, that patchwork add it automatically ...

bye,
Heiko
--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] test/py: make each unit test a pytest

2016-01-28 Thread Stephen Warren
On 01/28/2016 08:52 PM, Simon Glass wrote:
> Hi Stephen,
> 
> On 28 January 2016 at 16:45, Stephen Warren  wrote:
>> From: Stephen Warren 
>>
>> A custom fixture named ut_subtest is implemented which is parametrized
>> with the names of all unit tests that the U-Boot binary supports. This
>> causes each U-Boot unit test to be exposes as a separate pytest. In turn,
>> this allows more fine-grained pass/fail counts and test selection, e.g.:
>>
>> test.py --bd sandbox -k ut_dm_usb
>>
>> ... will run about 8 tests at present.
>>
>> Signed-off-by: Stephen Warren 
>> ---
>> This depends on at least my recently sent "test/py: run C-based unit tests".
>>
>>  test/py/conftest.py  | 105 
>> ---
>>  test/py/tests/test_ut.py |  14 +++
>>  2 files changed, 86 insertions(+), 33 deletions(-)
> 
> This seems a bit extreme. It might be better to move the remaining
> three commands under the 'ut' subcommand. Then all unit tests would be
> visible from the 'ut' help...

I'm not sure what you mean by "extreme"? Do you mean you don't want each
unit test exposed as a separate pytest? I thought based on our previous
conversation that was exactly what you wanted. If not, I'm not sure what
the deficiency in the current code is; either all the dm subtests are
executed at once by a single pytest with a single overall status, or
they're each a separate pytest with individual status. Any grouping
that's in between those seems like it would be entirely arbitrary?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH] dfu: allow get_medium_size() to return bigger medium sizes than 2GiB

2016-01-28 Thread Heiko Schocher

Hello Lukasz,

Am 28.01.2016 um 15:56 schrieb Lukasz Majewski:

Hi Heiko,


change the get_medium_size() function from
-   long (*get_medium_size)(struct dfu_entity *dfu);
+   int (*get_medium_size)(struct dfu_entity *dfu, u64 *size);

so it can return bigger medium sizes than 2GiB, and the return
value is seperate from the size.

Signed-off-by: Heiko Schocher 

---
I just have a DDP nand with a size of 4GiB, and the
mtd partition layout is:
device nand2 , # parts = 9
  #: namesizeoffset  mask_flags
  0: spl 0x0008  0x  0
  1: spl.backup1 0x0008  0x0008  0
  2: spl.backup2 0x0008  0x0010  0
  3: spl.backup3 0x0008  0x0018  0
  4: u-boot  0x0078  0x0020  0
  5: u-boot.env0 0x0020  0x0098  0
  6: u-boot.env1 0x0020  0x00b8  0
  7: mtdoops 0x0020  0x00d8  0
  8: rootfs  0xff08  0x00f8  0

so the last partition is to big for returning the size in a long.

  drivers/dfu/dfu.c  | 8 
  drivers/dfu/dfu_mmc.c  | 8 +---
  drivers/dfu/dfu_nand.c | 5 +++--
  drivers/dfu/dfu_ram.c  | 5 +++--
  drivers/dfu/dfu_sf.c   | 5 +++--
  include/dfu.h  | 4 ++--
  6 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
index 8f5915e..daa2eb9 100644
--- a/drivers/dfu/dfu.c
+++ b/drivers/dfu/dfu.c
@@ -335,11 +335,11 @@ int dfu_read(struct dfu_entity *dfu, void *buf,
int size, int blk_seq_num) if (dfu->i_buf_start == NULL)
return -ENOMEM;

-   dfu->r_left = dfu->get_medium_size(dfu);
-   if (dfu->r_left < 0)
-   return dfu->r_left;
+   ret = dfu->get_medium_size(dfu, &dfu->r_left);
+   if (ret < 0)
+   return ret;

-   debug("%s: %s %ld [B]\n", __func__, dfu->name,
dfu->r_left);
+   debug("%s: %s %lld [B]\n", __func__, dfu->name,
dfu->r_left);
dfu->i_blk_seq_num = 0;
dfu->crc = 0;
diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c
index 395d472..5c1c1d1 100644
--- a/drivers/dfu/dfu_mmc.c
+++ b/drivers/dfu/dfu_mmc.c
@@ -205,14 +205,15 @@ int dfu_flush_medium_mmc(struct dfu_entity *dfu)
return ret;
  }

-long dfu_get_medium_size_mmc(struct dfu_entity *dfu)
+int dfu_get_medium_size_mmc(struct dfu_entity *dfu, u64 *size)


The idea to use the return value to get error code and separate pointer
for passing the size is the way to go in my opinion.


Thats, why I posted it as an RFC, I was unsure too...


The problem is in details. Please find my comments below.


  {
int ret;
long len;

switch (dfu->layout) {
case DFU_RAW_ADDR:
-   return dfu->data.mmc.lba_size *
dfu->data.mmc.lba_blk_size;
+   *size = dfu->data.mmc.lba_size *
dfu->data.mmc.lba_blk_size;
+   return 0;
case DFU_FS_FAT:
case DFU_FS_EXT4:
dfu_file_buf_filled = -1;
@@ -221,7 +222,8 @@ long dfu_get_medium_size_mmc(struct dfu_entity
*dfu) return ret;
if (len > CONFIG_SYS_DFU_MAX_FILE_SIZE)
return -1;
-   return len;
+   *size = len;
+   return 0;
default:
printf("%s: Layout (%s) not (yet) supported!\n",
__func__, dfu_get_layout(dfu->layout));
diff --git a/drivers/dfu/dfu_nand.c b/drivers/dfu/dfu_nand.c
index a975492..4612e09 100644
--- a/drivers/dfu/dfu_nand.c
+++ b/drivers/dfu/dfu_nand.c
@@ -114,9 +114,10 @@ static int dfu_write_medium_nand(struct
dfu_entity *dfu, return ret;
  }

-long dfu_get_medium_size_nand(struct dfu_entity *dfu)
+int dfu_get_medium_size_nand(struct dfu_entity *dfu, u64 *size)
  {
-   return dfu->data.nand.size;
+   *size = dfu->data.nand.size;
+   return 0;
  }

  static int dfu_read_medium_nand(struct dfu_entity *dfu, u64 offset,
void *buf, diff --git a/drivers/dfu/dfu_ram.c b/drivers/dfu/dfu_ram.c
index e094a94..466759d 100644
--- a/drivers/dfu/dfu_ram.c
+++ b/drivers/dfu/dfu_ram.c
@@ -41,9 +41,10 @@ static int dfu_write_medium_ram(struct dfu_entity
*dfu, u64 offset, return dfu_transfer_medium_ram(DFU_OP_WRITE, dfu,
offset, buf, len); }

-long dfu_get_medium_size_ram(struct dfu_entity *dfu)
+int dfu_get_medium_size_ram(struct dfu_entity *dfu, u64 *size)
  {
-   return dfu->data.ram.size;
+   *size = dfu->data.ram.size;
+   return 0;
  }

  static int dfu_read_medium_ram(struct dfu_entity *dfu, u64 offset,
diff --git a/drivers/dfu/dfu_sf.c b/drivers/dfu/dfu_sf.c
index 9702eee..35c5fa1 100644
--- a/drivers/dfu/dfu_sf.c
+++ b/drivers/dfu/dfu_sf.c
@@ -12,9 +12,10 @@
  #include 
  #include 

-static long dfu_get_medium_size_sf(struct dfu_entity *dfu)
+int dfu_get_medium_size_sf(struct dfu_entity *dfu, u64 *s

Re: [U-Boot] [PATCH v3 4/4] qe: assgin pins to qe-hdlc

2016-01-28 Thread Qiang Zhao



> -Original Message-
> From: Mingkai Hu
> Sent: Friday, January 29, 2016 11:03 AM
> To: Qiang Zhao 
> Cc: tr...@konsulko.com; york sun ; u-boot@lists.denx.de;
> Qiang Zhao 
> Subject: RE: [PATCH v3 4/4] qe: assgin pins to qe-hdlc
> 
> > -Original Message-
> > From: Zhao Qiang [mailto:qiang.z...@nxp.com]
> > Sent: Friday, January 29, 2016 10:51 AM
> > To: Mingkai Hu
> > Cc: tr...@konsulko.com; york sun; u-boot@lists.denx.de; Qiang Zhao
> > Subject: [PATCH v3 4/4] qe: assgin pins to qe-hdlc
> >
> > qe-hdlc and usb multi-use the pins, when set hwconfig=qe-hdlc, assign
> > the pins to qe-hdlc, if not, assgin it to usb
> >
> > Signed-off-by: Zhao Qiang 
> > ---
> >  int ft_board_setup(void *blob, bd_t *bd)  {
> > u64 base[CONFIG_NR_DRAM_BANKS];
> > @@ -169,6 +185,21 @@ int ft_board_setup(void *blob, bd_t *bd)  #ifdef
> > CONFIG_SYS_DPAA_FMAN
> > fdt_fixup_fman_ethernet(blob);
> >  #endif
> > +
> > +   /* qe-hdlc and usb multi-use the pins,
> > +* when set hwconfig to qe-hdlc, delete usb node.
> > +*/
> 
> Use multiple lines comments.
> /*
>  *
>  */

Thank you! I will change it in next version.

> 
> > +   if (hwconfig("qe-hdlc"))
> > +#ifdef CONFIG_HAS_FSL_XHCI_USB
> > +   fdt_del_node_and_alias(blob, "usb1"); #endif
> > +   /* qe just support qe-uart and qe-hdlc,
> > +* if qe-uart and qe-hdlc are not set in hwconfig,
> > +* delete qe node.
> > +*/
> 
> Ditto.

Thank you! I will change it in next version.

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


[U-Boot] [PATCH v4 2/4] QE: add QE support on ls1043ardb

2016-01-28 Thread Zhao Qiang
Upload qe microcode on ls1043ardb

Signed-off-by: Zhao Qiang 
---
 board/freescale/ls1043ardb/ls1043ardb.c | 8 
 drivers/qe/qe.c | 6 ++
 include/configs/ls1043ardb.h| 7 +++
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/board/freescale/ls1043ardb/ls1043ardb.c 
b/board/freescale/ls1043ardb/ls1043ardb.c
index c8f723a..834fdff 100644
--- a/board/freescale/ls1043ardb/ls1043ardb.c
+++ b/board/freescale/ls1043ardb/ls1043ardb.c
@@ -21,6 +21,10 @@
 #include 
 #include 
 #include "cpld.h"
+#ifdef CONFIG_U_QE
+#include "../../../drivers/qe/qe.h"
+#endif
+
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -113,6 +117,10 @@ int board_init(void)
enable_layerscape_ns_access();
 #endif
 
+#ifdef CONFIG_U_QE
+   u_qe_init();
+#endif
+
return 0;
 }
 
diff --git a/drivers/qe/qe.c b/drivers/qe/qe.c
index 2a9e61b..8a432a8 100644
--- a/drivers/qe/qe.c
+++ b/drivers/qe/qe.c
@@ -192,8 +192,7 @@ void qe_init(uint qe_base)
 #ifdef CONFIG_U_QE
 void u_qe_init(void)
 {
-   uint qe_base = CONFIG_SYS_IMMR + 0x0140; /* QE immr base */
-   qe_immr = (qe_map_t *)qe_base;
+   qe_immr = (qe_map_t *)(CONFIG_SYS_IMMR + QE_IMMR_OFFSET);
 
u_qe_upload_firmware((const void *)CONFIG_SYS_QE_FW_ADDR);
out_be32(&qe_immr->iram.iready, QE_IRAM_READY);
@@ -204,9 +203,8 @@ void u_qe_init(void)
 void u_qe_resume(void)
 {
qe_map_t *qe_immrr;
-   uint qe_base = CONFIG_SYS_IMMR + QE_IMMR_OFFSET; /* QE immr base */
-   qe_immrr = (qe_map_t *)qe_base;
 
+   qe_immrr = (qe_map_t *)(CONFIG_SYS_IMMR + QE_IMMR_OFFSET);
u_qe_firmware_resume((const void *)CONFIG_SYS_QE_FW_ADDR, qe_immrr);
out_be32(&qe_immrr->iram.iready, QE_IRAM_READY);
 }
diff --git a/include/configs/ls1043ardb.h b/include/configs/ls1043ardb.h
index 585114f..6494507 100644
--- a/include/configs/ls1043ardb.h
+++ b/include/configs/ls1043ardb.h
@@ -278,6 +278,13 @@
 #define CONFIG_ETHPRIME"FM1@DTSEC3"
 #endif
 
+/* QE */
+#if !defined(CONFIG_SD_BOOT) && !defined(CONFIG_NAND_BOOT) && \
+   !defined(CONFIG_QSPI_BOOT)
+#define CONFIG_U_QE
+#endif
+#define CONFIG_SYS_QE_FW_ADDR 0x6060
+
 /* USB */
 #define CONFIG_HAS_FSL_XHCI_USB
 #ifdef CONFIG_HAS_FSL_XHCI_USB
-- 
2.1.0.27.g96db324

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


[U-Boot] [PATCH v4 3/4] ls1043rdb: move USB mux config to config_board_mux

2016-01-28 Thread Zhao Qiang
USB pins are muxed with other feature, move USB mux config
to config_board_mux.

Signed-off-by: Zhao Qiang 
---
 board/freescale/ls1043ardb/ls1043ardb.c | 30 +++---
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/board/freescale/ls1043ardb/ls1043ardb.c 
b/board/freescale/ls1043ardb/ls1043ardb.c
index 834fdff..c2d4887 100644
--- a/board/freescale/ls1043ardb/ls1043ardb.c
+++ b/board/freescale/ls1043ardb/ls1043ardb.c
@@ -75,23 +75,8 @@ int dram_init(void)
 
 int board_early_init_f(void)
 {
-   struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
-   u32 usb_pwrfault;
-
fsl_lsch2_early_init_f();
 
-#ifdef CONFIG_HAS_FSL_XHCI_USB
-   out_be32(&scfg->rcwpmuxcr0, 0x);
-   out_be32(&scfg->usbdrvvbus_selcr, SCFG_USBDRVVBUS_SELCR_USB1);
-   usb_pwrfault = (SCFG_USBPWRFAULT_DEDICATED <<
-   SCFG_USBPWRFAULT_USB3_SHIFT) |
-   (SCFG_USBPWRFAULT_DEDICATED <<
-   SCFG_USBPWRFAULT_USB2_SHIFT) |
-   (SCFG_USBPWRFAULT_SHARED <<
-SCFG_USBPWRFAULT_USB1_SHIFT);
-   out_be32(&scfg->usbpwrfault_selcr, usb_pwrfault);
-#endif
-
return 0;
 }
 
@@ -126,6 +111,21 @@ int board_init(void)
 
 int config_board_mux(void)
 {
+   struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
+   u32 usb_pwrfault;
+
+#ifdef CONFIG_HAS_FSL_XHCI_USB
+   out_be32(&scfg->rcwpmuxcr0, 0x);
+   out_be32(&scfg->usbdrvvbus_selcr, SCFG_USBDRVVBUS_SELCR_USB1);
+   usb_pwrfault = (SCFG_USBPWRFAULT_DEDICATED <<
+   SCFG_USBPWRFAULT_USB3_SHIFT) |
+   (SCFG_USBPWRFAULT_DEDICATED <<
+   SCFG_USBPWRFAULT_USB2_SHIFT) |
+   (SCFG_USBPWRFAULT_SHARED <<
+SCFG_USBPWRFAULT_USB1_SHIFT);
+   out_be32(&scfg->usbpwrfault_selcr, usb_pwrfault);
+#endif
+
return 0;
 }
 
-- 
2.1.0.27.g96db324

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


[U-Boot] [PATCH v4 1/4] QE: mask the codes not used for micro QE

2016-01-28 Thread Zhao Qiang
use "#ifdef CONFIG_QE" to mask the codes
not used for micro QE

Signed-off-by: Zhao Qiang 
---
 drivers/qe/qe.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/qe/qe.c b/drivers/qe/qe.c
index 08620b2..2a9e61b 100644
--- a/drivers/qe/qe.c
+++ b/drivers/qe/qe.c
@@ -20,7 +20,9 @@
 #define MPC85xx_DEVDISR_QE_DISABLE 0x1
 
 qe_map_t   *qe_immr = NULL;
+#ifdef CONFIG_QE
 static qe_snum_t   snums[QE_NUM_OF_SNUM];
+#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -81,6 +83,7 @@ void *qe_muram_addr(uint offset)
return (void *)&qe_immr->muram[offset];
 }
 
+#ifdef CONFIG_QE
 static void qe_sdma_init(void)
 {
volatile sdma_t *p;
@@ -184,6 +187,7 @@ void qe_init(uint qe_base)
qe_sdma_init();
qe_snums_init();
 }
+#endif
 
 #ifdef CONFIG_U_QE
 void u_qe_init(void)
@@ -214,6 +218,7 @@ void qe_reset(void)
 (u8) QE_CR_PROTOCOL_UNSPECIFIED, 0);
 }
 
+#ifdef CONFIG_QE
 void qe_assign_page(uint snum, uint para_ram_base)
 {
u32 cecr;
@@ -229,6 +234,7 @@ void qe_assign_page(uint snum, uint para_ram_base)
 
return;
 }
+#endif
 
 /*
  * brg: 0~15 as BRG1~BRG16
-- 
2.1.0.27.g96db324

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


[U-Boot] [PATCH v4 4/4] qe: assgin pins to qe-hdlc

2016-01-28 Thread Zhao Qiang
qe-hdlc and usb multi-use the pins, when set hwconfig=qe-hdlc,
assign the pins to qe-hdlc, if not, assgin it to usb

Signed-off-by: Zhao Qiang 
---
 board/freescale/ls1043ardb/ls1043ardb.c | 53 ++---
 1 file changed, 43 insertions(+), 10 deletions(-)

diff --git a/board/freescale/ls1043ardb/ls1043ardb.c 
b/board/freescale/ls1043ardb/ls1043ardb.c
index c2d4887..7ba72f8 100644
--- a/board/freescale/ls1043ardb/ls1043ardb.c
+++ b/board/freescale/ls1043ardb/ls1043ardb.c
@@ -114,18 +114,24 @@ int config_board_mux(void)
struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
u32 usb_pwrfault;
 
+   if (hwconfig("qe-hdlc")) {
+   out_be32(&scfg->rcwpmuxcr0,
+(in_be32(&scfg->rcwpmuxcr0) & ~0xff00) | 0x6600);
+   printf("Assign to qe-hdlc clk, rcwpmuxcr0=%x\n",
+  in_be32(&scfg->rcwpmuxcr0));
+   } else {
 #ifdef CONFIG_HAS_FSL_XHCI_USB
-   out_be32(&scfg->rcwpmuxcr0, 0x);
-   out_be32(&scfg->usbdrvvbus_selcr, SCFG_USBDRVVBUS_SELCR_USB1);
-   usb_pwrfault = (SCFG_USBPWRFAULT_DEDICATED <<
-   SCFG_USBPWRFAULT_USB3_SHIFT) |
-   (SCFG_USBPWRFAULT_DEDICATED <<
-   SCFG_USBPWRFAULT_USB2_SHIFT) |
-   (SCFG_USBPWRFAULT_SHARED <<
-SCFG_USBPWRFAULT_USB1_SHIFT);
-   out_be32(&scfg->usbpwrfault_selcr, usb_pwrfault);
+   out_be32(&scfg->rcwpmuxcr0, 0x);
+   out_be32(&scfg->usbdrvvbus_selcr, SCFG_USBDRVVBUS_SELCR_USB1);
+   usb_pwrfault = (SCFG_USBPWRFAULT_DEDICATED <<
+   SCFG_USBPWRFAULT_USB3_SHIFT) |
+   (SCFG_USBPWRFAULT_DEDICATED <<
+   SCFG_USBPWRFAULT_USB2_SHIFT) |
+   (SCFG_USBPWRFAULT_SHARED <<
+SCFG_USBPWRFAULT_USB1_SHIFT);
+   out_be32(&scfg->usbpwrfault_selcr, usb_pwrfault);
 #endif
-
+   }
return 0;
 }
 
@@ -152,6 +158,16 @@ int misc_init_r(void)
 }
 #endif
 
+void fdt_del_qe(void *blob)
+{
+   int nodeoff = 0;
+
+   while ((nodeoff = fdt_node_offset_by_compatible(blob, 0,
+   "fsl,qe")) >= 0) {
+   fdt_del_node(blob, nodeoff);
+   }
+}
+
 int ft_board_setup(void *blob, bd_t *bd)
 {
u64 base[CONFIG_NR_DRAM_BANKS];
@@ -169,6 +185,23 @@ int ft_board_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_SYS_DPAA_FMAN
fdt_fixup_fman_ethernet(blob);
 #endif
+
+   /*
+* qe-hdlc and usb multi-use the pins,
+* when set hwconfig to qe-hdlc, delete usb node.
+*/
+   if (hwconfig("qe-hdlc"))
+#ifdef CONFIG_HAS_FSL_XHCI_USB
+   fdt_del_node_and_alias(blob, "usb1");
+#endif
+   /*
+* qe just support qe-uart and qe-hdlc,
+* if qe-uart and qe-hdlc are not set in hwconfig,
+* delete qe node.
+*/
+   if (!hwconfig("qe-uart") && !hwconfig("qe-hdlc"))
+   fdt_del_qe(blob);
+
return 0;
 }
 
-- 
2.1.0.27.g96db324

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


[U-Boot] [PATCH v4 0/4] QE patchset introduction

2016-01-28 Thread Zhao Qiang
*Changes in v4:
-[PATCH v4 4/4] qe: assgin pins to qe-hdlc
- modify the format of multi-line comments

*Changes in v3:
-split [PATCH v2 3/3] QE: assgin pins to QE-HDLC to two patches:
  [PATCH v3 3/4] ls1043rdb: move USB mux config to config_board_mux
  and [PATCH v3 4/4] qe: assgin pins to qe-hdlc.

*Changes in v2:
-Add new patch in patchset.QE: mask the codes not used for micro QE
-[PATCH v2 2/3] QE: add QE support on ls1043ardb
-get qe_immr and qe_immr directly instead of from qe_base

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


Re: [U-Boot] ARMv8: Use U-Boot to boot Xen?

2016-01-28 Thread Peng Fan
Hi Dirk,

Cc Ian xen experts.

On Thu, Jan 28, 2016 at 08:06:30PM +0100, Dirk Behme wrote:
>Hi,
>
>are there any U-Boot examples/patches to boot Xen on an ARMv8/aarch64 system?
>
>I've found
>
>http://lists.denx.de/pipermail/u-boot/2015-October/230077.html
>
>what might be helpful.
>
>But maybe I missed anything else?

I guess you are asking steps how to boot xen using uboot?

You may need to take this:
http://wiki.xen.org/wiki/Xen_ARM_with_Virtualization_Extensions

Regards,
Peng.

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


Re: [U-Boot] [PATCH] test/py: fix a couple typos in comments

2016-01-28 Thread Simon Glass
On 28 January 2016 at 17:18, Simon Glass  wrote:
> On 28 January 2016 at 10:18, Stephen Warren  wrote:
>> From: Stephen Warren 
>>
>> s/updata/update/.
>>
>> Signed-off-by: Stephen Warren 
>> ---
>>  test/py/tests/test_env.py | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> Reviewed-by: Simon Glass 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/9] test/py: fix spawn.expect multiple match handling

2016-01-28 Thread Simon Glass
On 28 January 2016 at 20:47, Simon Glass  wrote:
> On 27 January 2016 at 23:57, Stephen Warren  wrote:
>> From: Stephen Warren 
>>
>> Multiple patterns may be passed to spawn.expect(). The pattern which
>> matches at the earliest position should be designated as the match. This
>> aspect works correctly. When multiple patterns match at the same position,
>> priority should be given the the earliest entry in the list of patterns.
>> This aspect does not work correctly. This patch fixes it.
>>
>> Signed-off-by: Stephen Warren 
>> ---
>>  test/py/u_boot_spawn.py | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Acked-by: Simon Glass 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 7/9] test/py: pass test DTB to sandbox

2016-01-28 Thread Simon Glass
On 28 January 2016 at 20:47, Simon Glass  wrote:
> On 27 January 2016 at 23:57, Stephen Warren  wrote:
>> From: Stephen Warren 
>>
>> This is required for at least "ut dm" to operate correctly.
>>
>> Signed-off-by: Stephen Warren 
>> ---
>>  test/py/u_boot_console_sandbox.py | 7 ++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> Acked-by: Simon Glass 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] test/py: dfu: allow boardenv to specify test sizes

2016-01-28 Thread Simon Glass
On 28 January 2016 at 20:52, Simon Glass  wrote:
> On 28 January 2016 at 13:14, Stephen Warren  wrote:
>> From: Stephen Warren 
>>
>> Allow the env__dfu_configs boardenv data to specify the set of DFU
>> transfer sizes to test. Manually specifying test sizes is useful if you
>> wish to test multiple DFU configurations (e.g. SD card ext4 filesystem, SD
>> card whole raw partition, RAM, etc.), but don't want to test every
>> single transfer size on each, to avoid bloating the overall time taken by
>> testing. If the boardenv doesn't specify a set of sizes, the built-in list
>> is used as a default, preserving backwards-compatibility.
>>
>> Signed-off-by: Stephen Warren 
>> ---
>>  test/py/tests/test_dfu.py | 12 ++--
>>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> Acked-by: Simon Glass 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/9] test/dm: clear unit test failure count each run

2016-01-28 Thread Simon Glass
On 28 January 2016 at 20:46, Simon Glass  wrote:
> On 27 January 2016 at 23:57, Stephen Warren  wrote:
>> From: Stephen Warren 
>>
>> The ut command prints a test failure count each time it is executed.
>> This is stored in a global variable which is never reset. Consequently,
>> the printed failure count accumulates across runs. Fix this by clearing
>> the counter each time "ut" is invoked.
>>
>> Signed-off-by: Stephen Warren 
>> ---
>>  test/dm/test-main.c | 2 ++
>>  1 file changed, 2 insertions(+)
>
> Acked-by: Simon Glass 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 8/9] test/py: run sandbox in source directory

2016-01-28 Thread Simon Glass
On 28 January 2016 at 20:47, Simon Glass  wrote:
> On 27 January 2016 at 23:57, Stephen Warren  wrote:
>> From: Stephen Warren 
>>
>> Some unit tests expect the cwd of the sandbox process to be the root
>> of the source tree. Ensure that requirement is met.
>>
>> Signed-off-by: Stephen Warren 
>> ---
>>  test/py/u_boot_console_sandbox.py | 2 +-
>>  test/py/u_boot_spawn.py   | 8 ++--
>>  2 files changed, 7 insertions(+), 3 deletions(-)
>
> Acked-by: Simon Glass 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/9] test/py: detect another "bad pattern" in console output

2016-01-28 Thread Simon Glass
On 28 January 2016 at 20:47, Simon Glass  wrote:
> On 27 January 2016 at 23:57, Stephen Warren  wrote:
>> From: Stephen Warren 
>>
>> Many error situations in U-Boot print the message:
>> ### ERROR ### Please RESET the board ###
>>
>> Add this to the list of bad patterns the test system detects. One
>> practical advantage of this change is to detect the case where sandbox
>> is told to use a particular DTB file, and the file cannot be opened.
>>
>> Signed-off-by: Stephen Warren 
>> ---
>>  test/py/u_boot_console_base.py | 2 ++
>>  1 file changed, 2 insertions(+)
>
> Acked-by: Simon Glass 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/9] test/py: correctly log xfail/xpass tests

2016-01-28 Thread Simon Glass
On 28 January 2016 at 20:47, Simon Glass  wrote:
> On 27 January 2016 at 23:57, Stephen Warren  wrote:
>> From: Stephen Warren 
>>
>> Tests can complete in passed, skipped, xpass, xfailed, or failed, states.
>> Currently the U-Boot log generation code doesn't handle the xfailed or
>> xpass states since they aren't used. Add support for the remaining states.
>> Without this, tests that xfail end up being reported as skipped.
>>
>> Signed-off-by: Stephen Warren 
>> ---
>>  test/py/conftest.py | 60 
>> +
>>  test/py/multiplexed_log.css |  8 ++
>>  test/py/multiplexed_log.py  | 30 ---
>>  3 files changed, 74 insertions(+), 24 deletions(-)
>
> Acked-by: Simon Glass 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/9] test.py: calculate bad patterns on change only

2016-01-28 Thread Simon Glass
On 28 January 2016 at 20:47, Simon Glass  wrote:
> On 27 January 2016 at 23:57, Stephen Warren  wrote:
>> From: Stephen Warren 
>>
>> A future patch will use the bad_patterns array in multiple places. Rather
>> than duplicating the code to calculate it, or even sharing it in a
>> function and simply calling it redundantly when nothing has changed, only
>> re-calculate the list when some change is made to it. This reduces work.
>>
>> Signed-off-by: Stephen Warren 
>> ---
>>  test/py/u_boot_console_base.py | 49 
>> +-
>>  1 file changed, 25 insertions(+), 24 deletions(-)
>
> Acked-by: Simon Glass 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/9] test/py: check for bad patterns everywhere we wait

2016-01-28 Thread Simon Glass
On 28 January 2016 at 20:47, Simon Glass  wrote:
> On 27 January 2016 at 23:57, Stephen Warren  wrote:
>> From: Stephen Warren 
>>
>> Currently, bad patterns are only honored when executing a shell command.
>> Other cases, such as the initial boot-up of U-Boot or when interacting
>> with command output rather than gathering all output prior to the shell
>> prompt, do not currently look for bad patterns in console output. This
>> patch makes sure that bad patterns are honored everywhere.
>>
>> One benefit of this change is that if U-Boot sandbox fails to start up,
>> the error message it emits can be caught immediately, rather than relying
>> on a (long) timeout when waiting for the expected signon message and/or
>> command prompt.
>>
>> Signed-off-by: Stephen Warren 
>> ---
>>  test/py/u_boot_console_base.py | 26 +++---
>>  1 file changed, 19 insertions(+), 7 deletions(-)
>
> Acked-by: Simon Glass 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] test/py: Provide custom IDs when parametrizing tests

2016-01-28 Thread Simon Glass
On 26 January 2016 at 16:18, Stephen Warren  wrote:
> On 01/26/2016 04:08 PM, Simon Glass wrote:
>>
>> Hi Stephen,
>>
>> On 26 January 2016 at 15:26, Stephen Warren  wrote:
>>>
>>> From: Stephen Warren 
>>>
>>> When pytest generates the name for parametrized tests, simple parameter
>>> values (ints, strings) get used directly, but more complex values such
>>> as dicts are not handled. This yields test names such as:
>>>
>>>  dfu[env__usb_dev_port0-env__dfu_config0]
>>>  dfu[env__usb_dev_port0-env__dfu_config1]
>>>
>>> Add some code to extract a custom fixture ID from the fixture values, so
>>> that we end up with meaningful names such as:
>>>
>>>  dfu[micro_b-emmc]
>>>  dfu[devport2-ram]
>>>
>>> If the boardenv file doesn't define custom names, the code falls back to
>>> the old algorithm.
>>>
>>> Signed-off-by: Stephen Warren 
>>> ---
>>>   test/py/conftest.py   | 8 +++-
>>>   test/py/tests/test_dfu.py | 3 +++
>>>   test/py/tests/test_ums.py | 3 +++
>>>   3 files changed, 13 insertions(+), 1 deletion(-)
>>
>>
>> Reviewed-by: Simon Glass 
>>
>>> diff --git a/test/py/conftest.py b/test/py/conftest.py
>
>
>>> @@ -225,7 +225,13 @@ def pytest_generate_tests(metafunc):
>>>   # ... otherwise, see if there's a key that contains a list
>>> of
>>>   # values to use instead.
>>
>>
>> Is this function comment still accurate?
>
>
> Yes; that comment is referring to the list of values that the relevant test
> function iterates over, not the names/IDs of the values or anything like
> that.
>

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/4] test/py: make net test aware of USB and PCI enumeration

2016-01-28 Thread Simon Glass
On 26 January 2016 at 13:00, Simon Glass  wrote:
> On 26 January 2016 at 11:10, Stephen Warren  wrote:
>> From: Stephen Warren 
>>
>> The existing net test executes a list of commands supplied by boardenv
>> variable env__net_pre_commands. The idea was that boardenv would know
>> whether the Ethernet device was attached to USB, PCI, ... and hence was
>> the best place to put any commands required to probe the device.
>>
>> However, this approach doesn't scale well when attempting to use a single
>> boardenv across multiple branches of U-Boot, some of which require "pci
>> enum" to enumerate PCI and others of which don't, or don't /yet/ simply
>> because various upstream changes haven't been merged down.
>>
>> This patch updates the test to require that the boardenv state which HW
>> features are required for Ethernet to work, and lets the test itself map
>> that knowledge to the set of commands to execute. Since this mapping is
>> part of the test script, which is part of the U-Boot code/branch, this
>> approach is more scalable. It also feels cleaner, since again boardenv
>> is only providing data, rather than test logic.
>>
>> Signed-off-by: Stephen Warren 
>> ---
>>  test/py/tests/test_net.py | 28 +++-
>>  1 file changed, 15 insertions(+), 13 deletions(-)
>
> Reviewed-by: Simon Glass 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] test/py: use " for docstrings

2016-01-28 Thread Simon Glass
On 26 January 2016 at 16:08, Simon Glass  wrote:
> On 26 January 2016 at 13:41, Stephen Warren  wrote:
>> From: Stephen Warren 
>>
>> Python's coding style docs indicate to use " not ' for docstrings.
>>
>> test/py has other violations of the coding style docs, since the docs
>> specify a stranger style than I would expect, but nobody has complained
>> about those yet:-)
>>
>> Signed-off-by: Stephen Warren 
>> ---
>>  test/py/conftest.py   |  44 ++--
>>  test/py/multiplexed_log.py| 122 
>> +-
>>  test/py/tests/test_000_version.py |   2 +-
>>  test/py/tests/test_dfu.py |  32 -
>>  test/py/tests/test_env.py |  54 +++
>>  test/py/tests/test_help.py|   2 +-
>>  test/py/tests/test_hush_if_test.py|  10 +--
>>  test/py/tests/test_md.py  |   8 +--
>>  test/py/tests/test_net.py |  24 +++
>>  test/py/tests/test_sandbox_exit.py|   4 +-
>>  test/py/tests/test_shell_basics.py|  10 +--
>>  test/py/tests/test_sleep.py   |   4 +-
>>  test/py/tests/test_ums.py |  24 +++
>>  test/py/tests/test_unknown_cmd.py |   4 +-
>>  test/py/u_boot_console_base.py|  48 ++---
>>  test/py/u_boot_console_exec_attach.py |  12 ++--
>>  test/py/u_boot_console_sandbox.py |  20 +++---
>>  test/py/u_boot_spawn.py   |  30 -
>>  test/py/u_boot_utils.py   |  36 +-
>>  19 files changed, 245 insertions(+), 245 deletions(-)
>
> Reviewed-by: Simon Glass 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] test/py: Quote consistency

2016-01-28 Thread Simon Glass
On 26 January 2016 at 16:08, Simon Glass  wrote:
> On 26 January 2016 at 13:41, Stephen Warren  wrote:
>> From: Stephen Warren 
>>
>> When converting test/py from " to ', I missed a few places (or added a
>> few inconsistencies later). Fix these.
>>
>> Note that only quotes in code are converted; double-quotes in comments
>> and HTML are left as-is, since English and HTML use " not '.
>>
>> Signed-off-by: Stephen Warren 
>> ---
>>  test/py/multiplexed_log.py | 68 
>> +++---
>>  test/py/test.py|  8 ++---
>>  test/py/tests/test_dfu.py  |  2 +-
>>  test/py/tests/test_net.py  |  4 +--
>>  test/py/tests/test_shell_basics.py |  2 +-
>>  5 files changed, 42 insertions(+), 42 deletions(-)
>
> Reviewed-by: Simon Glass 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] Implement "pci enum" command for CONFIG_DM_PCI

2016-01-28 Thread Simon Glass
On 26 January 2016 at 23:17, Bin Meng  wrote:
> On Wed, Jan 27, 2016 at 2:10 AM, Stephen Warren  wrote:
>> From: Stephen Warren 
>>
>> With CONFIG_DM_PCI enabled, PCI buses are not enumerated at boot, as they
>> are without that config option enabled. No command exists to enumerate the
>> PCI buses. Hence, unless some board-specific code causes PCI enumeration,
>> PCI-based Ethernet devices are not detected, and network access is not
>> available.
>>
>> This patch implements "pci enum" in the CONFIG_DM_PCI case, thus giving a
>> mechanism whereby PCI can be enumerated.
>>
>> do_pci()'s handling of case 'e' is moved into a single location before the
>> dev variable is assigned, in order to skip calculation of dev. The enum
>> sub-command doesn't need the dev value, and skipping its calculation
>> avoids an irrelevant error being printed.
>>
>> Using a command to initialize PCI like this has a disadvantage relative to
>> enumerating PCI at boot. In particular, Ethernet devices are not probed
>> during PCI enumeration, but only when used. This defers setting variables
>> such as ethact, ethaddr, etc. until the first network-related command is
>> executed. Hopefully this will not cause further issues. Perhaps in the
>> long term, we need a "net start/enum" command too?
>>
>> Signed-off-by: Stephen Warren 
>> ---
>> This series naturally needs to be applied in order in a single branch.
>> This series depends on all previous applied test/py patches.
>>
>>  common/cmd_pci.c | 18 +-
>>  drivers/pci/pci-uclass.c | 15 +++
>>  2 files changed, 20 insertions(+), 13 deletions(-)
>>
>
> Reviewed-by: Bin Meng 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/4] distro bootcmd: enumerate PCI before network operations

2016-01-28 Thread Simon Glass
On 26 January 2016 at 13:00, Simon Glass  wrote:
> Hi Stephen,
>
> On 26 January 2016 at 11:10, Stephen Warren  wrote:
>> From: Stephen Warren 
>>
>> The PCI bus must be enumerated before PCI devices, such as Ethernet
>> devices, are known to U-Boot. Enhance the distro boot commands to perform
>> PCI enumeration when needed.
>>
>> Signed-off-by: Stephen Warren 
>> ---
>>  doc/README.distro   |  8 
>>  include/config_distro_bootcmd.h | 12 
>>  2 files changed, 20 insertions(+)
>
> Reviewed-by: Simon Glass 
>
> I wonder whether longer term we can invent something that 'knows' that
> USB and PCI are needed for particular features. This would have to be
> board-specific though, so probably isn't that different from what you
> have here.
>
> Regards,
> Simon

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/4] distro bootcmd: make net boot only optionally start USB

2016-01-28 Thread Simon Glass
On 26 January 2016 at 12:59, Simon Glass  wrote:
> On 26 January 2016 at 11:10, Stephen Warren  wrote:
>> From: Stephen Warren 
>>
>> Currently, the distro boot commands always enumerate USB devices before
>> performing network operations. However, depending on the board and end-
>> user configuration, network devices may not be attached to USB, and so
>> enumerating USB may not be necessary. Enhance the scripts to make this
>> step optional, so that the user can decrease boot time if they don't
>> need USB.
>>
>> This change is performed by moving the "usb start" invocation into a
>> standalone variable. If the user desires, they can replace that
>> variable's value with some no-op command such as "true" instead.
>>
>> Booting from a USB storage device always needs to enumerate USB devices,
>> so this action is still hard-coded.
>>
>> Signed-off-by: Stephen Warren 
>> ---
>>  doc/README.distro   |  7 +++
>>  include/config_distro_bootcmd.h | 11 ++-
>>  2 files changed, 13 insertions(+), 5 deletions(-)
>
> Reviewed-by: Simon Glass 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] test/py: make crash detection more robust

2016-01-28 Thread Simon Glass
On 25 January 2016 at 18:17, Simon Glass  wrote:
> Hi Stephen,
>
> On 25 January 2016 at 18:11, Stephen Warren  wrote:
>> On 01/25/2016 06:07 PM, Simon Glass wrote:
>>>
>>> Hi Stephen,
>>>
>>> On 25 January 2016 at 15:07, Stephen Warren  wrote:

 From: Stephen Warren 

 test/py contains logic to detect the target crashing and rebooting by
 searching the console output for a U-Boot signon message, which will
 presumably be emitted when the system boots after the crash/reset.

 Currently, this logic only searches for the exact signon message that
 was printed by the U-Boot version under test, upon the assumption that
 binary is written into flash, and hence will be the version booted after
 any reset. However, this is not a valid assumption; some test setups
 download the U-Boot-under-test into RAM and boot it from there, and in
 such a scenario an arbitrary U-Boot version may be located in flash and
 hence run after any reset.

 Fix the reset detection logic to match any U-Boot signon message. This
 prevents false negatives.

 Signed-off-by: Stephen Warren 
 ---
   test/py/u_boot_console_base.py | 20 +++-
   1 file changed, 7 insertions(+), 13 deletions(-)

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] ARM: tegra: shut down USB device controller at boot

2016-01-28 Thread Simon Glass
On 26 January 2016 at 12:59, Simon Glass  wrote:
> On 26 January 2016 at 10:59, Stephen Warren  wrote:
>>
>> From: Stephen Warren 
>>
>> When loading U-Boot into RAM over USB protocols using tools such as
>> tegrarcm or L4T's exec-uboot.sh/tegraflash.py, Tegra's USB device
>> mode controller is initialized and enumerated by the host PC running
>> the tool. Unfortunately, these tools do not shut down the USB
>> controller before executing the downloaded code, and so the host PC
>> does not "de-enumerate" the USB device. This patch implements optional
>> code to shut down the USB controller when U-Boot boots to avoid leaving
>> a stale USB device present.
>>
>> Signed-off-by: Stephen Warren 
>> ---
>> This patch needs to be applied along with the next patch in this series,
>> likely in u-boot-dm since that patch modifies test code that's only
>> currently present in u-boot-dm.
>> ---
>>  arch/arm/mach-tegra/Kconfig  | 13 +
>>  arch/arm/mach-tegra/board2.c | 10 +-
>>  2 files changed, 22 insertions(+), 1 deletion(-)
>
>
> Reviewed-by: Simon Glass 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] test/py: dfu: error out if USB device already exists

2016-01-28 Thread Simon Glass
On 26 January 2016 at 12:59, Simon Glass  wrote:
> On 26 January 2016 at 10:59, Stephen Warren  wrote:
>> From: Stephen Warren 
>>
>> The DFU test requests U-Boot configure its USB controller in device mode,
>> then waits for the host machine to enumerate the USB device and create a
>> device node for it. However, this wait can be fooled if the USB device
>> node already exists before the test starts, e.g. if some previous software
>> stack already configured the USB controller into device mode and never
>> de-configured it. This "previous software stack" could even be another
>> test/py test, if U-Boot's own USB teardown does not operate correctly. If
>> this happens, dfu-util may be run before U-Boot is ready to serve DFU
>> commands, which may cause false test failures.
>>
>> Enhance the dfu test to fail if the device node exists before it is
>> expected to.
>>
>> Signed-off-by: Stephen Warren 
>> ---
>> This patch depends on the previous patch "ARM: tegra: shut down USB
>> device controller at boot", so needs to be applied in the same branch.
>> Otherwise, test failures will occur.
>> ---
>>  test/py/tests/test_dfu.py | 6 ++
>>  1 file changed, 6 insertions(+)
>
> Reviewed-by: Simon Glass 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] dm: Remove device_probe_child()

2016-01-28 Thread Simon Glass
On 25 January 2016 at 18:15, Bin Meng  wrote:
> On Tue, Jan 26, 2016 at 5:58 AM, Simon Glass  wrote:
>> This function is not used as the use case for it did not eventuate. Remove
>> it to avoid confusion.
>>
>> Signed-off-by: Simon Glass 
>> ---
>>
>>  drivers/core/device.c|  9 +
>>  include/dm/device-internal.h | 13 -
>>  2 files changed, 1 insertion(+), 21 deletions(-)
>>
>
> Reviewed-by: Bin Meng 

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


Re: [U-Boot] [PATCH] test/py: make each unit test a pytest

2016-01-28 Thread Simon Glass
Hi Stephen,

On 28 January 2016 at 16:45, Stephen Warren  wrote:
> From: Stephen Warren 
>
> A custom fixture named ut_subtest is implemented which is parametrized
> with the names of all unit tests that the U-Boot binary supports. This
> causes each U-Boot unit test to be exposes as a separate pytest. In turn,
> this allows more fine-grained pass/fail counts and test selection, e.g.:
>
> test.py --bd sandbox -k ut_dm_usb
>
> ... will run about 8 tests at present.
>
> Signed-off-by: Stephen Warren 
> ---
> This depends on at least my recently sent "test/py: run C-based unit tests".
>
>  test/py/conftest.py  | 105 
> ---
>  test/py/tests/test_ut.py |  14 +++
>  2 files changed, 86 insertions(+), 33 deletions(-)

This seems a bit extreme. It might be better to move the remaining
three commands under the 'ut' subcommand. Then all unit tests would be
visible from the 'ut' help...

>
> diff --git a/test/py/conftest.py b/test/py/conftest.py
> index 3e162cafcc4a..05491a2453c0 100644
> --- a/test/py/conftest.py
> +++ b/test/py/conftest.py
> @@ -21,7 +21,9 @@ import pexpect
>  import pytest
>  from _pytest.runner import runtestprotocol
>  import ConfigParser
> +import re
>  import StringIO
> +import subprocess
>  import sys
>
>  # Globals: The HTML log file, and the connection to the U-Boot console.
> @@ -189,8 +191,43 @@ def pytest_configure(config):
>  import u_boot_console_exec_attach
>  console = u_boot_console_exec_attach.ConsoleExecAttach(log, ubconfig)
>
> -def pytest_generate_tests(metafunc):
> -"""pytest hook: parameterize test functions based on custom rules.
> +re_ut_test_list = 
> re.compile(r'_u_boot_list_2_(dm|env)_test_2_\1_test_(.*)\s*$')
> +def generate_ut_subtest(metafunc, fixture_name):
> +"""Provide parametrization for a ut_subtest fixture.
> +
> +Determines the set of unit tests built into a U-Boot binary by parsing 
> the
> +list of symbols present in the U-Boot binary. Provides this information 
> to
> +test functions by parameterizing their ut_subtest fixture parameter.
> +
> +Args:
> +metafunc: The pytest test function.
> +fixture_name: The fixture name to test.
> +
> +Returns:
> +Nothing.
> +"""
> +
> +# This does rely on an objdump binary, but that's quite likely to be
> +# present. This approach trivially takes care of any source or Makefile-
> +# level conditional compilation which may occur, and matches the test
> +# execution order of a plain "ut dm" command. A source-scanning approach
> +# would not do neither. This approach also doesn't require access to the
> +# U-Boot source tree when running tests.
> +
> +cmd = 'objdump -t "%s" | sort' % (console.config.build_dir + '/u-boot')
> +out = subprocess.check_output(cmd, shell=True)
> +vals = []
> +for l in out.splitlines():
> +m = re_ut_test_list.search(l)
> +if not m:
> +continue
> +vals.append(m.group(1) + ' ' + m.group(2))
> +
> +ids = ['ut_' + s.replace(' ', '_') for s in vals]
> +metafunc.parametrize(fixture_name, vals, ids=ids)
> +
> +def generate_config(metafunc, fixture_name):
> +"""Provide parametrization for {env,brd}__ fixtures.
>
>  If a test function takes parameter(s) (fixture names) of the form 
> brd__xxx
>  or env__xxx, the brd and env configuration dictionaries are consulted to
> @@ -199,6 +236,7 @@ def pytest_generate_tests(metafunc):
>
>  Args:
>  metafunc: The pytest test function.
> +fixture_name: The fixture name to test.
>
>  Returns:
>  Nothing.
> @@ -208,30 +246,49 @@ def pytest_generate_tests(metafunc):
>  'brd': console.config.brd,
>  'env': console.config.env,
>  }
> +parts = fixture_name.split('__')
> +if len(parts) < 2:
> +return
> +if parts[0] not in subconfigs:
> +return
> +subconfig = subconfigs[parts[0]]
> +vals = []
> +val = subconfig.get(fixture_name, [])
> +# If that exact name is a key in the data source:
> +if val:
> +# ... use the dict value as a single parameter value.
> +vals = (val, )
> +else:
> +# ... otherwise, see if there's a key that contains a list of
> +# values to use instead.
> +vals = subconfig.get(fixture_name+ 's', [])
> +def fixture_id(index, val):
> +try:
> +return val['fixture_id']
> +except:
> +return fixture_name + str(index)
> +ids = [fixture_id(index, val) for (index, val) in enumerate(vals)]
> +metafunc.parametrize(fixture_name, vals, ids=ids)
> +
> +def pytest_generate_tests(metafunc):
> +"""pytest hook: parameterize test functions based on custom rules.
> +
> +Check each test function parameter (fixture name) to see if it is one of
> +our custom names, and if so, provide the correct parametrization for that
> +parameter.
> +
> +Args:
> +   

Re: [U-Boot] [PATCH] test/py: dfu: allow boardenv to specify test sizes

2016-01-28 Thread Simon Glass
On 28 January 2016 at 13:14, Stephen Warren  wrote:
> From: Stephen Warren 
>
> Allow the env__dfu_configs boardenv data to specify the set of DFU
> transfer sizes to test. Manually specifying test sizes is useful if you
> wish to test multiple DFU configurations (e.g. SD card ext4 filesystem, SD
> card whole raw partition, RAM, etc.), but don't want to test every
> single transfer size on each, to avoid bloating the overall time taken by
> testing. If the boardenv doesn't specify a set of sizes, the built-in list
> is used as a default, preserving backwards-compatibility.
>
> Signed-off-by: Stephen Warren 
> ---
>  test/py/tests/test_dfu.py | 12 ++--
>  1 file changed, 10 insertions(+), 2 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 7/9] test/py: pass test DTB to sandbox

2016-01-28 Thread Simon Glass
On 27 January 2016 at 23:57, Stephen Warren  wrote:
> From: Stephen Warren 
>
> This is required for at least "ut dm" to operate correctly.
>
> Signed-off-by: Stephen Warren 
> ---
>  test/py/u_boot_console_sandbox.py | 7 ++-
>  1 file changed, 6 insertions(+), 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 8/9] test/py: run sandbox in source directory

2016-01-28 Thread Simon Glass
On 27 January 2016 at 23:57, Stephen Warren  wrote:
> From: Stephen Warren 
>
> Some unit tests expect the cwd of the sandbox process to be the root
> of the source tree. Ensure that requirement is met.
>
> Signed-off-by: Stephen Warren 
> ---
>  test/py/u_boot_console_sandbox.py | 2 +-
>  test/py/u_boot_spawn.py   | 8 ++--
>  2 files changed, 7 insertions(+), 3 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 9/9] test/py: run C-based unit tests

2016-01-28 Thread Simon Glass
Hi Stephen,

On 27 January 2016 at 23:57, Stephen Warren  wrote:
> From: Stephen Warren 
>
> Add tests that execute the existing C-based unit test commands. These
> simply run the command and validate the overall result. For now,
> fine-grained details are not mapped into separate pytest test results in
> the current implementation. However, the detail is available in the log
> file for inspection, if attention is needed.
>
> Now that the DM unit test runs under test/py, remove the manual shell
> script that invokes it.
>
> Signed-off-by: Stephen Warren 
> ---
>  test/dm/test-dm.sh   | 16 -
>  test/py/tests/test_ut.py | 59 
> 
>  2 files changed, 59 insertions(+), 16 deletions(-)
>  delete mode 100755 test/dm/test-dm.sh
>  create mode 100644 test/py/tests/test_ut.py
>
> diff --git a/test/dm/test-dm.sh b/test/dm/test-dm.sh
> deleted file mode 100755
> index 1a0f1509b415..
> --- a/test/dm/test-dm.sh
> +++ /dev/null
> @@ -1,16 +0,0 @@
> -#!/bin/sh
> -
> -die() {
> -   echo $1
> -   exit 1
> -}
> -
> -NUM_CPUS=$(cat /proc/cpuinfo |grep -c processor)
> -make O=sandbox sandbox_config || die "Cannot configure U-Boot"
> -make O=sandbox -s -j${NUM_CPUS} || die "Cannot build U-Boot"
> -dd if=/dev/zero of=spi.bin bs=1M count=2
> -echo -n "this is a test" > testflash.bin
> -dd if=/dev/zero bs=1M count=4 >>testflash.bin
> -./sandbox/u-boot -d ./sandbox/arch/sandbox/dts/test.dtb -c "ut dm"
> -rm spi.bin
> -rm testflash.bin
> diff --git a/test/py/tests/test_ut.py b/test/py/tests/test_ut.py
> new file mode 100644
> index ..b033ca54d756
> --- /dev/null
> +++ b/test/py/tests/test_ut.py
> @@ -0,0 +1,59 @@
> +# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
> +#
> +# SPDX-License-Identifier: GPL-2.0
> +
> +import os.path
> +import pytest
> +
> +@pytest.mark.buildconfigspec('ut_dm')
> +def test_ut_dm(u_boot_console):
> +"""Execute the "ut dm" command."""
> +
> +fn = u_boot_console.config.source_dir + '/testflash.bin'
> +if not os.path.exists(fn):
> +data = 'this is a test'
> +data += '\x00' * ((4 * 1024 * 1024) - len(data))
> +with open(fn, 'wb') as fh:
> +fh.write(data)
> +

The SPI tests are currently disabled, but they will need the spi.bin file.

> +output = u_boot_console.run_command('ut dm')
> +assert output.endswith('Failures: 0')
> +
> +@pytest.mark.buildconfigspec('ut_env')
> +def test_ut_env(u_boot_console):
> +"""Execute the "ut env" command."""
> +
> +output = u_boot_console.run_command('ut env')
> +assert output.endswith('Failures: 0')
> +
> +@pytest.mark.buildconfigspec('ut_time')
> +def test_ut_time(u_boot_console):
> +"""Execute the "ut time" command."""
> +
> +output = u_boot_console.run_command('ut time')
> +assert output.endswith('Test passed')
> +
> +@pytest.mark.buildconfigspec('sandbox')
> +def test_ut_cmd(u_boot_console):
> +"""Execute the "ut_cmd" command."""
> +
> +output = u_boot_console.run_command('ut_cmd')
> +assert output.endswith('do_ut_cmd: Everything went swimmingly')
> +
> +@pytest.mark.buildconfigspec('sandbox')
> +def test_ut_compression(u_boot_console):
> +"""Execute the "ut_compression" command."""
> +
> +output = u_boot_console.run_command('ut_compression')
> +assert output.endswith('ut_compression ok')
> +
> +# Even when this passes, it prints lots of scary messages such as:
> +# Must RESET board to recover
> +# Equally, it fails if "ut dm" has been run first in the U-Boot session.
> +# Don't enable this test until those issues have been researched/solved.

The messages are correct because the test is deliberating making the
output buffer to small to check that decompression doesn't overrun the
end.

One way around this would be to silence the console. Sett
dm_test_main() for how it silences the console, and records the
output. Alternatively you could just look for the 'ok' message at the
end.

> +#@pytest.mark.buildconfigspec('sandbox')
> +#def test_ut_compression(u_boot_console):
> +#"""Execute the "ut_image_decomp" command."""
> +#
> +#output = u_boot_console.run_command('ut_image_decomp')
> +#assert output.endswith('ut_image_decomp ok')
> --
> 2.7.0
>

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


Re: [U-Boot] [PATCH 5/9] test/py: detect another "bad pattern" in console output

2016-01-28 Thread Simon Glass
On 27 January 2016 at 23:57, Stephen Warren  wrote:
> From: Stephen Warren 
>
> Many error situations in U-Boot print the message:
> ### ERROR ### Please RESET the board ###
>
> Add this to the list of bad patterns the test system detects. One
> practical advantage of this change is to detect the case where sandbox
> is told to use a particular DTB file, and the file cannot be opened.
>
> Signed-off-by: Stephen Warren 
> ---
>  test/py/u_boot_console_base.py | 2 ++
>  1 file changed, 2 insertions(+)

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 6/9] test/py: correctly log xfail/xpass tests

2016-01-28 Thread Simon Glass
On 27 January 2016 at 23:57, Stephen Warren  wrote:
> From: Stephen Warren 
>
> Tests can complete in passed, skipped, xpass, xfailed, or failed, states.
> Currently the U-Boot log generation code doesn't handle the xfailed or
> xpass states since they aren't used. Add support for the remaining states.
> Without this, tests that xfail end up being reported as skipped.
>
> Signed-off-by: Stephen Warren 
> ---
>  test/py/conftest.py | 60 
> +
>  test/py/multiplexed_log.css |  8 ++
>  test/py/multiplexed_log.py  | 30 ---
>  3 files changed, 74 insertions(+), 24 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 4/9] test/py: check for bad patterns everywhere we wait

2016-01-28 Thread Simon Glass
On 27 January 2016 at 23:57, Stephen Warren  wrote:
> From: Stephen Warren 
>
> Currently, bad patterns are only honored when executing a shell command.
> Other cases, such as the initial boot-up of U-Boot or when interacting
> with command output rather than gathering all output prior to the shell
> prompt, do not currently look for bad patterns in console output. This
> patch makes sure that bad patterns are honored everywhere.
>
> One benefit of this change is that if U-Boot sandbox fails to start up,
> the error message it emits can be caught immediately, rather than relying
> on a (long) timeout when waiting for the expected signon message and/or
> command prompt.
>
> Signed-off-by: Stephen Warren 
> ---
>  test/py/u_boot_console_base.py | 26 +++---
>  1 file changed, 19 insertions(+), 7 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 3/9] test.py: calculate bad patterns on change only

2016-01-28 Thread Simon Glass
On 27 January 2016 at 23:57, Stephen Warren  wrote:
> From: Stephen Warren 
>
> A future patch will use the bad_patterns array in multiple places. Rather
> than duplicating the code to calculate it, or even sharing it in a
> function and simply calling it redundantly when nothing has changed, only
> re-calculate the list when some change is made to it. This reduces work.
>
> Signed-off-by: Stephen Warren 
> ---
>  test/py/u_boot_console_base.py | 49 
> +-
>  1 file changed, 25 insertions(+), 24 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 2/9] test/py: fix spawn.expect multiple match handling

2016-01-28 Thread Simon Glass
On 27 January 2016 at 23:57, Stephen Warren  wrote:
> From: Stephen Warren 
>
> Multiple patterns may be passed to spawn.expect(). The pattern which
> matches at the earliest position should be designated as the match. This
> aspect works correctly. When multiple patterns match at the same position,
> priority should be given the the earliest entry in the list of patterns.
> This aspect does not work correctly. This patch fixes it.
>
> Signed-off-by: Stephen Warren 
> ---
>  test/py/u_boot_spawn.py | 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 1/9] test/dm: clear unit test failure count each run

2016-01-28 Thread Simon Glass
On 27 January 2016 at 23:57, Stephen Warren  wrote:
> From: Stephen Warren 
>
> The ut command prints a test failure count each time it is executed.
> This is stored in a global variable which is never reset. Consequently,
> the printed failure count accumulates across runs. Fix this by clearing
> the counter each time "ut" is invoked.
>
> Signed-off-by: Stephen Warren 
> ---
>  test/dm/test-main.c | 2 ++
>  1 file changed, 2 insertions(+)

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


[U-Boot] [PATCH v2 2/7] fdt: Build a U-Boot binary without device tree

2016-01-28 Thread Simon Glass
At present u-boot.bin holds the plain U-Boot binary without the device tree.
This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin
depending on whether device tree is used.

Adjust the build such that u-boot.bin includes a device tree (if enabled),
and the plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin remains
the same.

This should be acceptable since:

- without OF_CONTROL, u-boot.bin still does not include a device tree
- with OF_CONTROL, u-boot-dtb.bin does not change

The main impact is build systems which are set up to use u-boot.bin as
the output file and then add a device tree. These will have to change to use
u-boot-nodtb.bin instead.

Adjust tegra rules so it continues to produce the correct files.

Signed-off-by: Simon Glass 
---

Changes in v2: None

 Makefile | 24 
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index 6b95e79..aebc43b 100644
--- a/Makefile
+++ b/Makefile
@@ -822,9 +822,17 @@ PHONY += dtbs
 dtbs dts/dt.dtb: checkdtc u-boot
$(Q)$(MAKE) $(build)=dts dtbs
 
-u-boot-dtb.bin: u-boot.bin dts/dt.dtb FORCE
+ifeq ($(CONFIG_OF_CONTROL),y)
+u-boot-dtb.bin: u-boot-nodtb.bin dts/dt.dtb FORCE
$(call if_changed,cat)
 
+u-boot.bin: u-boot-dtb.bin FORCE
+   $(call if_changed,cat)
+else
+u-boot.bin: u-boot-nodtb.bin FORCE
+   $(call if_changed,cat)
+endif
+
 %.imx: %.bin
$(Q)$(MAKE) $(build)=arch/arm/imx-common $@
 
@@ -841,11 +849,11 @@ OBJCOPYFLAGS_u-boot.srec := -O srec
 u-boot.hex u-boot.srec: u-boot FORCE
$(call if_changed,objcopy)
 
-OBJCOPYFLAGS_u-boot.bin := -O binary \
+OBJCOPYFLAGS_u-boot-nodtb.bin := -O binary \
$(if $(CONFIG_X86_RESET_VECTOR),-R .start16 -R .resetvec)
 
-binary_size_check: u-boot.bin FORCE
-   @file_size=$(shell wc -c u-boot.bin | awk '{print $$1}') ; \
+binary_size_check: u-boot-nodtb.bin FORCE
+   @file_size=$(shell wc -c u-boot-nodtb.bin | awk '{print $$1}') ; \
map_size=$(shell cat u-boot.map | \
awk '/_image_copy_start/ {start = $$1} /_image_binary_end/ {end 
= $$1} END {if (start != "" && end != "") print "ibase=16; " toupper(end) " - " 
toupper(start)}' \
| sed 's/0X//g' \
@@ -853,12 +861,12 @@ binary_size_check: u-boot.bin FORCE
if [ "" != "$$map_size" ]; then \
if test $$map_size -ne $$file_size; then \
echo "u-boot.map shows a binary size of $$map_size" >&2 
; \
-   echo "  but u-boot.bin shows $$file_size" >&2 ; \
+   echo "  but u-boot-nodtb.bin shows $$file_size" >&2 ; \
exit 1; \
fi \
fi
 
-u-boot.bin: u-boot FORCE
+u-boot-nodtb.bin: u-boot FORCE
$(call if_changed,objcopy)
$(call DO_STATIC_RELA,$<,$@,$(CONFIG_SYS_TEXT_BASE))
$(BOARD_SIZE_CHECK)
@@ -1017,7 +1025,7 @@ rom: u-boot.rom FORCE
 IFDTOOL=$(objtree)/tools/ifdtool
 IFDTOOL_FLAGS  = -f 0:$(objtree)/u-boot.dtb
 IFDTOOL_FLAGS += -m 0x$(shell $(NM) u-boot |grep _dt_ucode_base_size |cut -d' 
' -f1)
-IFDTOOL_FLAGS += -U $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot.bin
+IFDTOOL_FLAGS += -U $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot-nodtb.bin
 IFDTOOL_FLAGS += -w $(CONFIG_SYS_X86_START16):$(objtree)/u-boot-x86-16bit.bin
 IFDTOOL_FLAGS += -C
 
@@ -1068,7 +1076,7 @@ endif
 
 ifneq ($(CONFIG_TEGRA),)
 OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary 
--pad-to=$(CONFIG_SYS_TEXT_BASE)
-u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot.bin FORCE
+u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot-nodtb.bin FORCE
$(call if_changed,pad_cat)
 
 ifeq ($(CONFIG_OF_SEPARATE),y)
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH v2 1/7] tegra: Clarify generation of -nodtb file with OF_CONTROL

2016-01-28 Thread Simon Glass
Fix the ALL-y logic in the Makefile so that is clear that we always want
the -nodtb file.

Signed-off-by: Simon Glass 
---

Changes in v2:
- Rewrite this commit based on tegra feedback

 Makefile | 15 +--
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index 06996d4..6b95e79 100644
--- a/Makefile
+++ b/Makefile
@@ -764,14 +764,8 @@ ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
 endif
 
 # enable combined SPL/u-boot/dtb rules for tegra
-ifneq ($(CONFIG_TEGRA),)
-ifeq ($(CONFIG_SPL),y)
-ifeq ($(CONFIG_OF_SEPARATE),y)
-ALL-y += u-boot-dtb-tegra.bin
-else
-ALL-y += u-boot-nodtb-tegra.bin
-endif
-endif
+ifeq ($(CONFIG_TEGRA)$(CONFIG_SPL),yy)
+ALL-y += u-boot-nodtb-tegra.bin u-boot-dtb-tegra.bin
 endif
 
 # Add optional build target if defined in board/cpu/soc headers
@@ -1078,8 +1072,9 @@ u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot.bin FORCE
$(call if_changed,pad_cat)
 
 ifeq ($(CONFIG_OF_SEPARATE),y)
-u-boot-dtb-tegra.bin: u-boot-nodtb-tegra.bin dts/dt.dtb FORCE
-   $(call if_changed,cat)
+OBJCOPYFLAGS_u-boot-dtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
+u-boot-dtb-tegra.bin: spl/u-boot-spl u-boot-dtb.bin FORCE
+   $(call if_changed,pad_cat)
 endif
 endif
 
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH v2 5/7] socfpga: Simplify Makefile filenames

2016-01-28 Thread Simon Glass
We don't need the -dtb suffix anymore, so drop it.

Signed-off-by: Simon Glass 
---

Changes in v2:
- Fix the update_filename in MCV

 Makefile | 10 +-
 include/configs/socfpga_mcvevk.h |  2 +-
 scripts/Makefile.spl |  6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index f9096c5..079636a 100644
--- a/Makefile
+++ b/Makefile
@@ -1009,10 +1009,10 @@ u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE
 
 ifneq ($(CONFIG_ARCH_SOCFPGA),)
 quiet_cmd_socboot = SOCBOOT $@
-cmd_socboot = cat  spl/u-boot-spl-dtb.sfp spl/u-boot-spl-dtb.sfp   \
-   spl/u-boot-spl-dtb.sfp spl/u-boot-spl-dtb.sfp   \
-   u-boot-dtb.img > $@ || rm -f $@
-u-boot-with-spl-dtb.sfp: spl/u-boot-spl-dtb.sfp u-boot-dtb.img FORCE
+cmd_socboot = cat  spl/u-boot-spl.sfp spl/u-boot-spl.sfp   \
+   spl/u-boot-spl.sfp spl/u-boot-spl.sfp   \
+   u-boot.img > $@ || rm -f $@
+u-boot-with-spl.sfp: spl/u-boot-spl.sfp u-boot.img FORCE
$(call if_changed,socboot)
 endif
 
@@ -1321,7 +1321,7 @@ spl/u-boot-spl: tools prepare $(if 
$(CONFIG_OF_SEPARATE),dts/dt.dtb)
 spl/sunxi-spl.bin: spl/u-boot-spl
@:
 
-spl/u-boot-spl-dtb.sfp: spl/u-boot-spl
+spl/u-boot-spl.sfp: spl/u-boot-spl
@:
 
 spl/boot.bin: spl/u-boot-spl
diff --git a/include/configs/socfpga_mcvevk.h b/include/configs/socfpga_mcvevk.h
index e7b5675..f260a64 100644
--- a/include/configs/socfpga_mcvevk.h
+++ b/include/configs/socfpga_mcvevk.h
@@ -56,7 +56,7 @@
"netdev=eth0\0" \
"hostname=mcvevk\0" \
"kernel_addr_r=0x1000\0"\
-   "update_filename=u-boot-with-spl-dtb.sfp\0" \
+   "update_filename=u-boot-with-spl.sfp\0" \
"update_sd_offset=0x800\0"  \
"update_sd="/* Update the SD firmware partition */  \
"if mmc rescan ; then " \
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 2b4890f..32324e9 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -146,7 +146,7 @@ ALL-y   += $(obj)/$(BOARD)-spl.bin
 endif
 
 ifdef CONFIG_ARCH_SOCFPGA
-ALL-y  += $(obj)/$(SPL_BIN)-dtb.sfp
+ALL-y  += $(obj)/$(SPL_BIN).sfp
 endif
 
 ifdef CONFIG_SUNXI
@@ -230,8 +230,8 @@ LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
 endif
 
 ifdef CONFIG_ARCH_SOCFPGA
-MKIMAGEFLAGS_$(SPL_BIN)-dtb.sfp = -T socfpgaimage
-$(obj)/$(SPL_BIN)-dtb.sfp: $(obj)/$(SPL_BIN)-dtb.bin FORCE
+MKIMAGEFLAGS_$(SPL_BIN).sfp = -T socfpgaimage
+$(obj)/$(SPL_BIN).sfp: $(obj)/$(SPL_BIN).bin FORCE
$(call if_changed,mkimage)
 endif
 
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH v2 6/7] Makefile: Make u-boot.img the same as u-boot-dtb.img

2016-01-28 Thread Simon Glass
When OF_CONTROL is enabled, u-boot.img has no purpose since it does not
include the required device tree binary. The correct image to use is
u-boot-dtb.img with OF_CONTROL but u-boot.img without OF_CONTROL.

Create u-boot.img even when OF_CONTROL is enabled, so that this file can be
used in both cases.

Signed-off-by: Simon Glass 
---

Changes in v2: None

 Makefile | 13 +++--
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index 079636a..e796983 100644
--- a/Makefile
+++ b/Makefile
@@ -900,6 +900,8 @@ MKIMAGEFLAGS_u-boot.img = -A $(ARCH) -T firmware -C none -O 
u-boot \
-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
-n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
 
+MKIMAGEFLAGS_u-boot-dtb.img = $(MKIMAGEFLAGS_u-boot.img)
+
 MKIMAGEFLAGS_u-boot.kwb = -n $(srctree)/$(CONFIG_SYS_KWD_CONFIG:"%"=%) \
-T kwbimage -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE)
 
@@ -909,17 +911,12 @@ MKIMAGEFLAGS_u-boot-spl.kwb = -n 
$(srctree)/$(CONFIG_SYS_KWD_CONFIG:"%"=%) \
 MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \
-R $(srctree)/$(CONFIG_SYS_FSL_PBL_PBI:"%"=%) -T pblimage
 
-u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE
+u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE
$(call if_changed,mkimage)
 
 u-boot-spl.kwb: u-boot-dtb.img spl/u-boot-spl.bin FORCE
$(call if_changed,mkimage)
 
-MKIMAGEFLAGS_u-boot-dtb.img = $(MKIMAGEFLAGS_u-boot.img)
-
-u-boot-dtb.img: u-boot-dtb.bin FORCE
-   $(call if_changed,mkimage)
-
 u-boot.sha1:   u-boot.bin
tools/ubsha1 u-boot.bin
 
@@ -1125,11 +1122,7 @@ spl/u-boot-spl.pbl: spl/u-boot-spl.bin FORCE
$(call if_changed,mkimage)
 
 ifeq ($(ARCH),arm)
-ifdef CONFIG_OF_CONTROL
-UBOOT_BINLOAD := u-boot-dtb.img
-else
 UBOOT_BINLOAD := u-boot.img
-endif
 else
 UBOOT_BINLOAD := u-boot.bin
 endif
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH v2 7/7] Makefile: Drop unnecessary -dtb suffixes

2016-01-28 Thread Simon Glass
When OF_CONTROL is enabled, u-boot-dtb.* files are the same as u-boot.*
files. So we can use the latter for simplicity.

Signed-off-by: Simon Glass 
---

Changes in v2:
- Tweak the tegra rule slightly

 Makefile | 15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index e796983..a2aa227 100644
--- a/Makefile
+++ b/Makefile
@@ -914,7 +914,7 @@ MKIMAGEFLAGS_u-boot.pbl = -n 
$(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \
 u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE
$(call if_changed,mkimage)
 
-u-boot-spl.kwb: u-boot-dtb.img spl/u-boot-spl.bin FORCE
+u-boot-spl.kwb: u-boot.img spl/u-boot-spl.bin FORCE
$(call if_changed,mkimage)
 
 u-boot.sha1:   u-boot.bin
@@ -1055,7 +1055,7 @@ endif
 cmd_ifdtool += $(IFDTOOL) $(IFDTOOL_FLAGS) u-boot.tmp;
 cmd_ifdtool += mv u-boot.tmp $@
 
-u-boot.rom: u-boot-x86-16bit.bin u-boot-dtb.bin
+u-boot.rom: u-boot-x86-16bit.bin u-boot.bin
$(call if_changed,ifdtool)
 
 OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec
@@ -1066,8 +1066,7 @@ endif
 ifneq ($(CONFIG_SUNXI),)
 OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \
   --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff
-u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin \
-   u-boot$(if $(CONFIG_OF_CONTROL),-dtb,).img FORCE
+u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img FORCE
$(call if_changed,pad_cat)
 endif
 
@@ -1077,7 +1076,7 @@ u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot-nodtb.bin 
FORCE
$(call if_changed,pad_cat)
 
 OBJCOPYFLAGS_u-boot-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
-u-boot-tegra.bin: spl/u-boot-spl u-boot-dtb.bin FORCE
+u-boot-tegra.bin: spl/u-boot-spl u-boot.bin FORCE
$(call if_changed,pad_cat)
 
 u-boot-dtb-tegra.bin: u-boot-tegra.bin FORCE
@@ -1088,7 +1087,7 @@ OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI)
 u-boot-app.efi: u-boot FORCE
$(call if_changed,zobjcopy)
 
-u-boot-dtb.bin.o: u-boot-dtb.bin FORCE
+u-boot.bin.o: u-boot.bin FORCE
$(call if_changed,efipayload)
 
 u-boot-payload.lds: $(LDSCRIPT_EFI) FORCE
@@ -1098,10 +1097,10 @@ u-boot-payload.lds: $(LDSCRIPT_EFI) FORCE
 quiet_cmd_u-boot_payload ?= LD  $@
   cmd_u-boot_payload ?= $(LD) $(LDFLAGS_EFI_PAYLOAD) -o $@ \
   -T u-boot-payload.lds arch/x86/cpu/call32.o \
-  lib/efi/efi.o lib/efi/efi_stub.o u-boot-dtb.bin.o \
+  lib/efi/efi.o lib/efi/efi_stub.o u-boot.bin.o \
   $(addprefix arch/$(ARCH)/lib/efi/,$(EFISTUB))
 
-u-boot-payload: u-boot-dtb.bin.o u-boot-payload.lds FORCE
+u-boot-payload: u-boot.bin.o u-boot-payload.lds FORCE
$(call if_changed,u-boot_payload)
 
 OBJCOPYFLAGS_u-boot-payload.efi := $(OBJCOPYFLAGS_EFI)
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH v2 3/7] fdt: Build an SPL binary without device tree

2016-01-28 Thread Simon Glass
At present u-boot-spl.bin holds the plain SPL binary without the device
tree. This is somewhat annoying since you need either u-boot-spl.bin or
u-boot-spl-dtb.bin depending on whether device tree is used.

Adjust the build such that u-boot-spl.bin includes a device tree
(if enabled), and the plain binary is in u-boot-spl-nodtb.bin. For now
u-boot-spl-dtb.bin remains the same.

Signed-off-by: Simon Glass 
---

Changes in v2: None

 scripts/Makefile.spl | 20 ++--
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index dff16b9..2b4890f 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -131,14 +131,14 @@ boot.bin: $(obj)/u-boot-spl.bin
 else
 MKIMAGEFLAGS_boot.bin = -T zynqimage
 
-spl/boot.bin: $(obj)/u-boot-spl-dtb.bin
+spl/boot.bin: $(obj)/u-boot-spl.bin
$(call if_changed,mkimage)
 endif
 
 ALL-y  += $(obj)/$(SPL_BIN).bin $(obj)/$(SPL_BIN).cfg
 
 ifdef CONFIG_SPL_OF_CONTROL
-ALL-$(CONFIG_OF_SEPARATE) += $(obj)/$(SPL_BIN)-pad.bin 
$(obj)/$(SPL_BIN)-dtb.bin
+ALL-$(CONFIG_OF_SEPARATE) += $(obj)/$(SPL_BIN)-pad.bin 
$(obj)/$(SPL_BIN)-nodtb.bin
 endif
 
 ifdef CONFIG_SAMSUNG
@@ -166,11 +166,19 @@ all:  $(ALL-y)
 quiet_cmd_cat = CAT $@
 cmd_cat = cat $(filter-out $(PHONY), $^) > $@
 
-$(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN).bin $(obj)/$(SPL_BIN)-pad.bin \
+ifeq ($(CONFIG_SPL_OF_CONTROL),y)
+$(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin 
$(obj)/$(SPL_BIN)-pad.bin \
$(obj)/$(SPL_BIN).dtb FORCE
$(call if_changed,cat)
 
-# Create a file that pads from the end of u-boot-spl.bin to bss_end
+$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-dtb.bin FORCE
+   $(call if_changed,cat)
+else
+$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-nodtb.bin FORCE
+   $(call if_changed,cat)
+endif
+
+# Create a file that pads from the end of u-boot-spl-nodtb.bin to bss_end
 $(obj)/$(SPL_BIN)-pad.bin: $(obj)/$(SPL_BIN)
@bss_size_str=$(shell $(NM) $< | awk 'BEGIN {size = 0} /__bss_size/ 
{size = $$1} END {print "ibase=16; " toupper(size)}' | bc); \
dd if=/dev/zero of=$@ bs=1 count=$${bss_size_str} 2>/dev/null;
@@ -211,9 +219,9 @@ endif
 quiet_cmd_objcopy = OBJCOPY $@
 cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
 
-OBJCOPYFLAGS_$(SPL_BIN).bin = $(SPL_OBJCFLAGS) -O binary
+OBJCOPYFLAGS_$(SPL_BIN)-nodtb.bin = $(SPL_OBJCFLAGS) -O binary
 
-$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN) FORCE
+$(obj)/$(SPL_BIN)-nodtb.bin: $(obj)/$(SPL_BIN) FORCE
$(call if_changed,objcopy)
 
 LDFLAGS_$(SPL_BIN) += -T u-boot-spl.lds $(LDFLAGS_FINAL)
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH v2 4/7] tegra: Always build a boot image with the same filename

2016-01-28 Thread Simon Glass
Adjust the Makefile to build u-boot-tegra.bin which contains a device tree
if OF_CONTROL is enabled, and does not if not. This mirrors U-Boot's new
approach of using u-boot.bin to handle both cases.

Signed-off-by: Simon Glass 
---

Changes in v2:
- Update based on previous changes

 Makefile | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index aebc43b..f9096c5 100644
--- a/Makefile
+++ b/Makefile
@@ -765,7 +765,7 @@ endif
 
 # enable combined SPL/u-boot/dtb rules for tegra
 ifeq ($(CONFIG_TEGRA)$(CONFIG_SPL),yy)
-ALL-y += u-boot-nodtb-tegra.bin u-boot-dtb-tegra.bin
+ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin u-boot-dtb-tegra.bin
 endif
 
 # Add optional build target if defined in board/cpu/soc headers
@@ -1079,11 +1079,12 @@ OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary 
--pad-to=$(CONFIG_SYS_TEXT_BASE)
 u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot-nodtb.bin FORCE
$(call if_changed,pad_cat)
 
-ifeq ($(CONFIG_OF_SEPARATE),y)
-OBJCOPYFLAGS_u-boot-dtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
-u-boot-dtb-tegra.bin: spl/u-boot-spl u-boot-dtb.bin FORCE
+OBJCOPYFLAGS_u-boot-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
+u-boot-tegra.bin: spl/u-boot-spl u-boot-dtb.bin FORCE
$(call if_changed,pad_cat)
-endif
+
+u-boot-dtb-tegra.bin: u-boot-tegra.bin FORCE
+   $(call if_changed,cat)
 endif
 
 OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI)
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH v2 0/7] fdt: Replace u-boot-dtb.bin with u-boot.bin

2016-01-28 Thread Simon Glass
At present u-boot.bin holds the plain U-Boot binary without the device tree.
This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin
depending on whether device tree is used.

This series adjusts the build such that u-boot.bin includes a device tree if
enabled, and the plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin
remains the same.

This should be acceptable since:

- without OF_CONTROL, u-boot.bin still does not include a device tree
- with OF_CONTROL, u-boot-dtb.bin does not change

The main impact is to build systems which are set up to use u-boot.bin as
the output file and then add a device tree. These will have to change to use
u-boot-nodtb.bin instead.

The original decision to use a separate u-boot-dtb.bin was aimed at allowing
any device tree file to be concatenated to the u-boot.bin image after the
build. However this no-longer seems so important. More important is the
convenience of using the same output file regardless of the setting for
OF_CONTROL.

Changes in v2:
- Rewrite this commit based on tegra feedback
- Update based on previous changes
- Fix the update_filename in MCV
- Tweak the tegra rule slightly

Simon Glass (7):
  tegra: Clarify generation of -nodtb file with OF_CONTROL
  fdt: Build a U-Boot binary without device tree
  fdt: Build an SPL binary without device tree
  tegra: Always build a boot image with the same filename
  socfpga: Simplify Makefile filenames
  Makefile: Make u-boot.img the same as u-boot-dtb.img
  Makefile: Drop unnecessary -dtb suffixes

 Makefile | 78 +++-
 include/configs/socfpga_mcvevk.h |  2 +-
 scripts/Makefile.spl | 26 +-
 3 files changed, 55 insertions(+), 51 deletions(-)

-- 
2.7.0.rc3.207.g0ac5344

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


Re: [U-Boot] [PATCH v1] arm: imx: Add support for GE Bx50v3 boards

2016-01-28 Thread Peng Fan
Hi Akshay,

CC i.MX maintainer Stefano for you.

On Wed, Jan 27, 2016 at 05:53:47PM -0500, Akshay Bhat wrote:
>Add support for GE B450v3, B650v3 and B850v3 boards. The boards
>are based on Advantech BA16 module which has a imx6 processor.

Which imx6 processor?

>The boards support:
> - FEC Ethernet
> - USB Ports
> - SDHC and MMC boot
> - SPI NOR
> - LVDS and HDMI display
>
>Basic information about the module:
> - Module manufacturer: Advantech
> - CPU: Freescale ARM Cortex-A9 i.MX6
> - SPECS:
> Up to 2GB Onboard DDR3 Memory;
> Up to 16GB Onboard eMMC NAND Flash
> Supports OpenGL ES 2.0 and OpenVG 1.1
> HDMI, 24-bit LVDS
> 1x UART, 2x I2C, 8x GPIO,
> 4x Host USB 2.0 port, 1x USB OTG port,
> 1x micro SD (SDHC),1x SDIO, 1x SATA II,
> 1x 10/100/1000 Mbps Ethernet, 1x PCIe X1 Gen2
>
>Signed-off-by: Akshay Bhat 
>---
>
> arch/arm/cpu/armv7/mx6/Kconfig |  10 +
> board/ge/bx50v3/Kconfig|  15 ++
> board/ge/bx50v3/MAINTAINERS|   8 +
> board/ge/bx50v3/Makefile   |   8 +
> board/ge/bx50v3/bx50v3.c   | 534 +
> board/ge/bx50v3/bx50v3.cfg | 151 
> configs/ge_b450v3_defconfig|   9 +
> configs/ge_b650v3_defconfig|   9 +
> configs/ge_b850v3_defconfig|   9 +
> include/configs/ge_bx50v3.h| 374 +
> 10 files changed, 1127 insertions(+)
> create mode 100644 board/ge/bx50v3/Kconfig
> create mode 100644 board/ge/bx50v3/MAINTAINERS
> create mode 100644 board/ge/bx50v3/Makefile
> create mode 100644 board/ge/bx50v3/bx50v3.c
> create mode 100644 board/ge/bx50v3/bx50v3.cfg
> create mode 100644 configs/ge_b450v3_defconfig
> create mode 100644 configs/ge_b650v3_defconfig
> create mode 100644 configs/ge_b850v3_defconfig
> create mode 100644 include/configs/ge_bx50v3.h
>
>diff --git a/arch/arm/cpu/armv7/mx6/Kconfig b/arch/arm/cpu/armv7/mx6/Kconfig
>index 8489182..c4e89f1 100644
>--- a/arch/arm/cpu/armv7/mx6/Kconfig
>+++ b/arch/arm/cpu/armv7/mx6/Kconfig
>@@ -60,6 +60,15 @@ config TARGET_CM_FX6
> config TARGET_EMBESTMX6BOARDS
>   bool "embestmx6boards"
> 
>+config TARGET_GE_B450V3
>+  bool "General Electric B450v3"
>+
>+config TARGET_GE_B650V3
>+  bool "General Electric B650v3"
>+
>+config TARGET_GE_B850V3
>+  bool "General Electric B850v3"
>+
> config TARGET_GW_VENTANA
>   bool "gw_ventana"
>   select SUPPORT_SPL
>@@ -153,6 +162,7 @@ endchoice
> config SYS_SOC
>   default "mx6"
> 
>+source "board/ge/bx50v3/Kconfig"
> source "board/aristainetos/Kconfig"
> source "board/bachmann/ot1200/Kconfig"
> source "board/barco/platinum/Kconfig"
>diff --git a/board/ge/bx50v3/Kconfig b/board/ge/bx50v3/Kconfig
>new file mode 100644
>index 000..2c4a689
>--- /dev/null
>+++ b/board/ge/bx50v3/Kconfig
>@@ -0,0 +1,15 @@
>+if TARGET_GE_B450V3 || TARGET_GE_B650V3 || TARGET_GE_B850V3
>+
>+config SYS_BOARD
>+  default "bx50v3"
>+
>+config SYS_VENDOR
>+  default "ge"
>+
>+config SYS_SOC
>+  default "mx6"
>+
>+config SYS_CONFIG_NAME
>+  default "ge_bx50v3"
>+
>+endif
>diff --git a/board/ge/bx50v3/MAINTAINERS b/board/ge/bx50v3/MAINTAINERS
>new file mode 100644
>index 000..8e60791
>--- /dev/null
>+++ b/board/ge/bx50v3/MAINTAINERS
>@@ -0,0 +1,8 @@
>+GE_BX50V3 BOARD
>+M:Martin Donnelly 
>+S:Maintained
>+F:board/ge/bx50v3/
>+F:include/configs/ge_bx50v3.h
>+F:configs/ge_b450v3_defconfig
>+F:configs/ge_b650v3_defconfig
>+F:configs/ge_b850v3_defconfig
>diff --git a/board/ge/bx50v3/Makefile b/board/ge/bx50v3/Makefile
>new file mode 100644
>index 000..bcd149f
>--- /dev/null
>+++ b/board/ge/bx50v3/Makefile
>@@ -0,0 +1,8 @@
>+#
>+# Copyright 2015 Timesys Corporation
>+# Copyright 2015 General Electric Company
>+#
>+# SPDX-License-Identifier:GPL-2.0+
>+#
>+
>+obj-y  := bx50v3.o
>diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c
>new file mode 100644
>index 000..42035be
>--- /dev/null
>+++ b/board/ge/bx50v3/bx50v3.c
>@@ -0,0 +1,534 @@
>+/*
>+ * Copyright 2015 Timesys Corporation
>+ * Copyright 2015 General Electric Company
>+ * Copyright 2012 Freescale Semiconductor, Inc.
>+ *
>+ * SPDX-License-Identifier:   GPL-2.0+
>+ */
>+
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+DECLARE_GLOBAL_DATA_PTR;
>+
>+#define UART_PAD_CTRL  (PAD_CTL_PUS_100K_UP | \
>+  PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \
>+  PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
>+
>+#define USDHC_PAD_CTRL (PAD_CTL_PUS_47K_UP |  \
>+  PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm | \
>+  PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
>+
>+#define ENET_PAD_CTRL  (PAD_CTL_PUS_100K_UP | PAD_CTL_PUE |   \
>+  PAD_CTL_SPEED_HIGH | PAD_CTL_DSE_48ohm | PAD_CTL_SRE_FAST)
>+
>+#define ENET_CLK_PAD_CTRL (PAD_CTL_SPEED_MED | \
>+  PAD_CTL_DSE

[U-Boot] [PATCH v3 4/4] qe: assgin pins to qe-hdlc

2016-01-28 Thread Zhao Qiang
qe-hdlc and usb multi-use the pins, when set hwconfig=qe-hdlc,
assign the pins to qe-hdlc, if not, assgin it to usb

Signed-off-by: Zhao Qiang 
---
 board/freescale/ls1043ardb/ls1043ardb.c | 51 ++---
 1 file changed, 41 insertions(+), 10 deletions(-)

diff --git a/board/freescale/ls1043ardb/ls1043ardb.c 
b/board/freescale/ls1043ardb/ls1043ardb.c
index c2d4887..a97a09a 100644
--- a/board/freescale/ls1043ardb/ls1043ardb.c
+++ b/board/freescale/ls1043ardb/ls1043ardb.c
@@ -114,18 +114,24 @@ int config_board_mux(void)
struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
u32 usb_pwrfault;
 
+   if (hwconfig("qe-hdlc")) {
+   out_be32(&scfg->rcwpmuxcr0,
+(in_be32(&scfg->rcwpmuxcr0) & ~0xff00) | 0x6600);
+   printf("Assign to qe-hdlc clk, rcwpmuxcr0=%x\n",
+  in_be32(&scfg->rcwpmuxcr0));
+   } else {
 #ifdef CONFIG_HAS_FSL_XHCI_USB
-   out_be32(&scfg->rcwpmuxcr0, 0x);
-   out_be32(&scfg->usbdrvvbus_selcr, SCFG_USBDRVVBUS_SELCR_USB1);
-   usb_pwrfault = (SCFG_USBPWRFAULT_DEDICATED <<
-   SCFG_USBPWRFAULT_USB3_SHIFT) |
-   (SCFG_USBPWRFAULT_DEDICATED <<
-   SCFG_USBPWRFAULT_USB2_SHIFT) |
-   (SCFG_USBPWRFAULT_SHARED <<
-SCFG_USBPWRFAULT_USB1_SHIFT);
-   out_be32(&scfg->usbpwrfault_selcr, usb_pwrfault);
+   out_be32(&scfg->rcwpmuxcr0, 0x);
+   out_be32(&scfg->usbdrvvbus_selcr, SCFG_USBDRVVBUS_SELCR_USB1);
+   usb_pwrfault = (SCFG_USBPWRFAULT_DEDICATED <<
+   SCFG_USBPWRFAULT_USB3_SHIFT) |
+   (SCFG_USBPWRFAULT_DEDICATED <<
+   SCFG_USBPWRFAULT_USB2_SHIFT) |
+   (SCFG_USBPWRFAULT_SHARED <<
+SCFG_USBPWRFAULT_USB1_SHIFT);
+   out_be32(&scfg->usbpwrfault_selcr, usb_pwrfault);
 #endif
-
+   }
return 0;
 }
 
@@ -152,6 +158,16 @@ int misc_init_r(void)
 }
 #endif
 
+void fdt_del_qe(void *blob)
+{
+   int nodeoff = 0;
+
+   while ((nodeoff = fdt_node_offset_by_compatible(blob, 0,
+   "fsl,qe")) >= 0) {
+   fdt_del_node(blob, nodeoff);
+   }
+}
+
 int ft_board_setup(void *blob, bd_t *bd)
 {
u64 base[CONFIG_NR_DRAM_BANKS];
@@ -169,6 +185,21 @@ int ft_board_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_SYS_DPAA_FMAN
fdt_fixup_fman_ethernet(blob);
 #endif
+
+   /* qe-hdlc and usb multi-use the pins,
+* when set hwconfig to qe-hdlc, delete usb node.
+*/
+   if (hwconfig("qe-hdlc"))
+#ifdef CONFIG_HAS_FSL_XHCI_USB
+   fdt_del_node_and_alias(blob, "usb1");
+#endif
+   /* qe just support qe-uart and qe-hdlc,
+* if qe-uart and qe-hdlc are not set in hwconfig,
+* delete qe node.
+*/
+   if (!hwconfig("qe-uart") && !hwconfig("qe-hdlc"))
+   fdt_del_qe(blob);
+
return 0;
 }
 
-- 
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] [PATCH 2/7] fdt: Build a U-Boot binary without device tree

2016-01-28 Thread Simon Glass
Hi Stephen,

On 25 January 2016 at 17:42, Stephen Warren  wrote:
> On 01/25/2016 02:14 PM, Stephen Warren wrote:
>>
>> On 01/25/2016 01:30 PM, Simon Glass wrote:
>>>
>>> At present u-boot.bin holds the plain U-Boot binary without the device
>>> tree.
>>> This is somewhat annoying since you need either u-boot.bin or
>>> u-boot-dtb.bin
>>> depending on whether device tree is used.
>>>
>>> Adjust the build such that u-boot.bin includes a device tree, and the
>>> plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin remains the
>>> same.
>>>
>>> This should be acceptable since:
>>>
>>> - without OF_CONTROL, u-boot.bin still does not include a device tree
>>> - with OF_CONTROL, u-boot-dtb.bin does not change
>>>
>>> The main impact is build systems which are set up to use u-boot.bin as
>>> the output file and then add a device tree. These will have to change
>>> to use
>>> u-boot-nodtb.bin instead.
>>
>>
>> That's probably going to annoy somebody. Have you put thought into how
>> such a build system could auto-detect which file it should use in order
>> to automatically adjust to the different file naming conventions of
>> different U-Boot versions or branches? If not, this change will burden
>> the operator of any tool or automated system with manually handling the
>> difference by branching their own code or processes:-(
>>
>>> Adjust tegra rules so it continues to produce the correct files.
>>
>>
>> I don't see anything Tegra-related in this patch. Perhaps patch 1/7 was
>> included here in a previous version and the commit description not
>> updated?
>>
>> Anyway, I think this patch doesn't affect me or Tegra's flashing tools.
>> For reference, the tool currently uses the following files:
>>
>> u-boot
>> spl/u-boot-spl
>> u-boot-nodtb-tegra.bin
>> u-boot.dtb
>> u-boot-dtb-tegra.bin
>
>
> Oh, that list is for ARMv7 targets. For ARMv8 targets, we currently use the
> following instead:
>
> u-boot*
> u-boot.bin
> u-boot.dtb
> u-boot-dtb.bin
>
> Preferably those files won't change either, or if they do, there's a trivial
> way of determining which set of files is present (e.g. perhaps we pick up
> u-boot-nodtb.bin and u-boot-dtb.bin if those two files exist, else we pick
> up u-boot.bin and u-boot-dtb.bin?)

The only addition will be u-boot-nodtb.bin. I'm not sure what you
should pick up - perhaps everything?

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


Re: [U-Boot] [PATCH v3 4/4] qe: assgin pins to qe-hdlc

2016-01-28 Thread Mingkai Hu


> -Original Message-
> From: Zhao Qiang [mailto:qiang.z...@nxp.com]
> Sent: Friday, January 29, 2016 10:51 AM
> To: Mingkai Hu
> Cc: tr...@konsulko.com; york sun; u-boot@lists.denx.de; Qiang Zhao
> Subject: [PATCH v3 4/4] qe: assgin pins to qe-hdlc
> 
> qe-hdlc and usb multi-use the pins, when set hwconfig=qe-hdlc, assign the
> pins to qe-hdlc, if not, assgin it to usb
> 
> Signed-off-by: Zhao Qiang 
> ---
>  board/freescale/ls1043ardb/ls1043ardb.c | 51 ++-
> --
>  1 file changed, 41 insertions(+), 10 deletions(-)
> 
> diff --git a/board/freescale/ls1043ardb/ls1043ardb.c
> b/board/freescale/ls1043ardb/ls1043ardb.c
> index c2d4887..a97a09a 100644
> --- a/board/freescale/ls1043ardb/ls1043ardb.c
> +++ b/board/freescale/ls1043ardb/ls1043ardb.c
> @@ -114,18 +114,24 @@ int config_board_mux(void)
>   struct ccsr_scfg *scfg = (struct ccsr_scfg
> *)CONFIG_SYS_FSL_SCFG_ADDR;
>   u32 usb_pwrfault;
> 
> + if (hwconfig("qe-hdlc")) {
> + out_be32(&scfg->rcwpmuxcr0,
> +  (in_be32(&scfg->rcwpmuxcr0) & ~0xff00) | 0x6600);
> + printf("Assign to qe-hdlc clk, rcwpmuxcr0=%x\n",
> +in_be32(&scfg->rcwpmuxcr0));
> + } else {
>  #ifdef CONFIG_HAS_FSL_XHCI_USB
> - out_be32(&scfg->rcwpmuxcr0, 0x);
> - out_be32(&scfg->usbdrvvbus_selcr, SCFG_USBDRVVBUS_SELCR_USB1);
> - usb_pwrfault = (SCFG_USBPWRFAULT_DEDICATED <<
> - SCFG_USBPWRFAULT_USB3_SHIFT) |
> - (SCFG_USBPWRFAULT_DEDICATED <<
> - SCFG_USBPWRFAULT_USB2_SHIFT) |
> - (SCFG_USBPWRFAULT_SHARED <<
> -  SCFG_USBPWRFAULT_USB1_SHIFT);
> - out_be32(&scfg->usbpwrfault_selcr, usb_pwrfault);
> + out_be32(&scfg->rcwpmuxcr0, 0x);
> + out_be32(&scfg->usbdrvvbus_selcr, SCFG_USBDRVVBUS_SELCR_USB1);
> + usb_pwrfault = (SCFG_USBPWRFAULT_DEDICATED <<
> + SCFG_USBPWRFAULT_USB3_SHIFT) |
> + (SCFG_USBPWRFAULT_DEDICATED <<
> + SCFG_USBPWRFAULT_USB2_SHIFT) |
> + (SCFG_USBPWRFAULT_SHARED <<
> +  SCFG_USBPWRFAULT_USB1_SHIFT);
> + out_be32(&scfg->usbpwrfault_selcr, usb_pwrfault);
>  #endif
> -
> + }
>   return 0;
>  }
> 
> @@ -152,6 +158,16 @@ int misc_init_r(void)  }  #endif
> 
> +void fdt_del_qe(void *blob)
> +{
> + int nodeoff = 0;
> +
> + while ((nodeoff = fdt_node_offset_by_compatible(blob, 0,
> + "fsl,qe")) >= 0) {
> + fdt_del_node(blob, nodeoff);
> + }
> +}
> +
>  int ft_board_setup(void *blob, bd_t *bd)  {
>   u64 base[CONFIG_NR_DRAM_BANKS];
> @@ -169,6 +185,21 @@ int ft_board_setup(void *blob, bd_t *bd)  #ifdef
> CONFIG_SYS_DPAA_FMAN
>   fdt_fixup_fman_ethernet(blob);
>  #endif
> +
> + /* qe-hdlc and usb multi-use the pins,
> +  * when set hwconfig to qe-hdlc, delete usb node.
> +  */

Use multiple lines comments.
/*
 *
 */

> + if (hwconfig("qe-hdlc"))
> +#ifdef CONFIG_HAS_FSL_XHCI_USB
> + fdt_del_node_and_alias(blob, "usb1"); #endif
> + /* qe just support qe-uart and qe-hdlc,
> +  * if qe-uart and qe-hdlc are not set in hwconfig,
> +  * delete qe node.
> +  */

Ditto.

> + if (!hwconfig("qe-uart") && !hwconfig("qe-hdlc"))
> + fdt_del_qe(blob);
> +
>   return 0;
>  }
> 
> --
> 2.1.0.27.g96db324

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


[U-Boot] [PATCH v3 0/4] QE patchset introduction

2016-01-28 Thread Zhao Qiang
*Changes in v3:
- split [PATCH v2 3/3] QE: assgin pins to QE-HDLC to two patches:
  [PATCH v3 3/4] ls1043rdb: move USB mux config to config_board_mux
  and [PATCH v3 4/4] qe: assgin pins to qe-hdlc.

*Changes in v2:
- Add new patch in patchset.QE: mask the codes not used for micro QE
- [PATCH v2 2/3] QE: add QE support on ls1043ardb
- get qe_immr and qe_immr directly instead of from qe_base

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


[U-Boot] [PATCH v3 3/4] ls1043rdb: move USB mux config to config_board_mux

2016-01-28 Thread Zhao Qiang
USB pins are muxed with other feature, move USB mux config
to config_board_mux.

Signed-off-by: Zhao Qiang 
---
 board/freescale/ls1043ardb/ls1043ardb.c | 30 +++---
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/board/freescale/ls1043ardb/ls1043ardb.c 
b/board/freescale/ls1043ardb/ls1043ardb.c
index 834fdff..c2d4887 100644
--- a/board/freescale/ls1043ardb/ls1043ardb.c
+++ b/board/freescale/ls1043ardb/ls1043ardb.c
@@ -75,23 +75,8 @@ int dram_init(void)
 
 int board_early_init_f(void)
 {
-   struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
-   u32 usb_pwrfault;
-
fsl_lsch2_early_init_f();
 
-#ifdef CONFIG_HAS_FSL_XHCI_USB
-   out_be32(&scfg->rcwpmuxcr0, 0x);
-   out_be32(&scfg->usbdrvvbus_selcr, SCFG_USBDRVVBUS_SELCR_USB1);
-   usb_pwrfault = (SCFG_USBPWRFAULT_DEDICATED <<
-   SCFG_USBPWRFAULT_USB3_SHIFT) |
-   (SCFG_USBPWRFAULT_DEDICATED <<
-   SCFG_USBPWRFAULT_USB2_SHIFT) |
-   (SCFG_USBPWRFAULT_SHARED <<
-SCFG_USBPWRFAULT_USB1_SHIFT);
-   out_be32(&scfg->usbpwrfault_selcr, usb_pwrfault);
-#endif
-
return 0;
 }
 
@@ -126,6 +111,21 @@ int board_init(void)
 
 int config_board_mux(void)
 {
+   struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
+   u32 usb_pwrfault;
+
+#ifdef CONFIG_HAS_FSL_XHCI_USB
+   out_be32(&scfg->rcwpmuxcr0, 0x);
+   out_be32(&scfg->usbdrvvbus_selcr, SCFG_USBDRVVBUS_SELCR_USB1);
+   usb_pwrfault = (SCFG_USBPWRFAULT_DEDICATED <<
+   SCFG_USBPWRFAULT_USB3_SHIFT) |
+   (SCFG_USBPWRFAULT_DEDICATED <<
+   SCFG_USBPWRFAULT_USB2_SHIFT) |
+   (SCFG_USBPWRFAULT_SHARED <<
+SCFG_USBPWRFAULT_USB1_SHIFT);
+   out_be32(&scfg->usbpwrfault_selcr, usb_pwrfault);
+#endif
+
return 0;
 }
 
-- 
2.1.0.27.g96db324

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


[U-Boot] [PATCH v3 2/4] QE: add QE support on ls1043ardb

2016-01-28 Thread Zhao Qiang
Upload qe microcode on ls1043ardb

Signed-off-by: Zhao Qiang 
---
 board/freescale/ls1043ardb/ls1043ardb.c | 8 
 drivers/qe/qe.c | 6 ++
 include/configs/ls1043ardb.h| 7 +++
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/board/freescale/ls1043ardb/ls1043ardb.c 
b/board/freescale/ls1043ardb/ls1043ardb.c
index c8f723a..834fdff 100644
--- a/board/freescale/ls1043ardb/ls1043ardb.c
+++ b/board/freescale/ls1043ardb/ls1043ardb.c
@@ -21,6 +21,10 @@
 #include 
 #include 
 #include "cpld.h"
+#ifdef CONFIG_U_QE
+#include "../../../drivers/qe/qe.h"
+#endif
+
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -113,6 +117,10 @@ int board_init(void)
enable_layerscape_ns_access();
 #endif
 
+#ifdef CONFIG_U_QE
+   u_qe_init();
+#endif
+
return 0;
 }
 
diff --git a/drivers/qe/qe.c b/drivers/qe/qe.c
index 2a9e61b..8a432a8 100644
--- a/drivers/qe/qe.c
+++ b/drivers/qe/qe.c
@@ -192,8 +192,7 @@ void qe_init(uint qe_base)
 #ifdef CONFIG_U_QE
 void u_qe_init(void)
 {
-   uint qe_base = CONFIG_SYS_IMMR + 0x0140; /* QE immr base */
-   qe_immr = (qe_map_t *)qe_base;
+   qe_immr = (qe_map_t *)(CONFIG_SYS_IMMR + QE_IMMR_OFFSET);
 
u_qe_upload_firmware((const void *)CONFIG_SYS_QE_FW_ADDR);
out_be32(&qe_immr->iram.iready, QE_IRAM_READY);
@@ -204,9 +203,8 @@ void u_qe_init(void)
 void u_qe_resume(void)
 {
qe_map_t *qe_immrr;
-   uint qe_base = CONFIG_SYS_IMMR + QE_IMMR_OFFSET; /* QE immr base */
-   qe_immrr = (qe_map_t *)qe_base;
 
+   qe_immrr = (qe_map_t *)(CONFIG_SYS_IMMR + QE_IMMR_OFFSET);
u_qe_firmware_resume((const void *)CONFIG_SYS_QE_FW_ADDR, qe_immrr);
out_be32(&qe_immrr->iram.iready, QE_IRAM_READY);
 }
diff --git a/include/configs/ls1043ardb.h b/include/configs/ls1043ardb.h
index 585114f..6494507 100644
--- a/include/configs/ls1043ardb.h
+++ b/include/configs/ls1043ardb.h
@@ -278,6 +278,13 @@
 #define CONFIG_ETHPRIME"FM1@DTSEC3"
 #endif
 
+/* QE */
+#if !defined(CONFIG_SD_BOOT) && !defined(CONFIG_NAND_BOOT) && \
+   !defined(CONFIG_QSPI_BOOT)
+#define CONFIG_U_QE
+#endif
+#define CONFIG_SYS_QE_FW_ADDR 0x6060
+
 /* USB */
 #define CONFIG_HAS_FSL_XHCI_USB
 #ifdef CONFIG_HAS_FSL_XHCI_USB
-- 
2.1.0.27.g96db324

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


[U-Boot] [PATCH v3 1/4] QE: mask the codes not used for micro QE

2016-01-28 Thread Zhao Qiang
use "#ifdef CONFIG_QE" to mask the codes
not used for micro QE

Signed-off-by: Zhao Qiang 
---
 drivers/qe/qe.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/qe/qe.c b/drivers/qe/qe.c
index 08620b2..2a9e61b 100644
--- a/drivers/qe/qe.c
+++ b/drivers/qe/qe.c
@@ -20,7 +20,9 @@
 #define MPC85xx_DEVDISR_QE_DISABLE 0x1
 
 qe_map_t   *qe_immr = NULL;
+#ifdef CONFIG_QE
 static qe_snum_t   snums[QE_NUM_OF_SNUM];
+#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -81,6 +83,7 @@ void *qe_muram_addr(uint offset)
return (void *)&qe_immr->muram[offset];
 }
 
+#ifdef CONFIG_QE
 static void qe_sdma_init(void)
 {
volatile sdma_t *p;
@@ -184,6 +187,7 @@ void qe_init(uint qe_base)
qe_sdma_init();
qe_snums_init();
 }
+#endif
 
 #ifdef CONFIG_U_QE
 void u_qe_init(void)
@@ -214,6 +218,7 @@ void qe_reset(void)
 (u8) QE_CR_PROTOCOL_UNSPECIFIED, 0);
 }
 
+#ifdef CONFIG_QE
 void qe_assign_page(uint snum, uint para_ram_base)
 {
u32 cecr;
@@ -229,6 +234,7 @@ void qe_assign_page(uint snum, uint para_ram_base)
 
return;
 }
+#endif
 
 /*
  * brg: 0~15 as BRG1~BRG16
-- 
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] [PATCH] mailmap: fix Ricardo's entry

2016-01-28 Thread Masahiro Yamada
Hi Ricardo,

2016-01-29 11:42 GMT+09:00 Masahiro Yamada :
> Commit df48b23428e9 (".mailmap: Add all the mail alias for Ricardo
> Ribalda") assigned two different proper names for the email address
> "ricardo.riba...@uam.es".  This is a completely wrong usage as the
> mailmap feature exists for coalescing together commits by the same
> person whose name is sometimes spelled differently.
>
> Signed-off-by: Masahiro Yamada 
> ---
>
>  .mailmap | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/.mailmap b/.mailmap
> index f72fef1..5ea9f93 100644
> --- a/.mailmap
> +++ b/.mailmap
> @@ -21,7 +21,6 @@ Jagan Teki 
>  Markus Klotzbuecher 
>  Prabhakar Kushwaha 
>  Rajeshwari Shinde 
> -Ricardo Ribalda Delgado 
>  Ricardo Ribalda 
>  Ricardo Ribalda 
>  Sandeep Paulraj 


Note:

I dropped the first one of the three in order not to
change the git-shortlog output.
(all of your commits are merged together into "Ricardo Ribalda".)

If this is not your intention (if you want all of them merged to
"Ricardo Ribalda Delgado"), the name part of your entries should be
fixed.



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


[U-Boot] [PATCH] mailmap: fix Ricardo's entry

2016-01-28 Thread Masahiro Yamada
Commit df48b23428e9 (".mailmap: Add all the mail alias for Ricardo
Ribalda") assigned two different proper names for the email address
"ricardo.riba...@uam.es".  This is a completely wrong usage as the
mailmap feature exists for coalescing together commits by the same
person whose name is sometimes spelled differently.

Signed-off-by: Masahiro Yamada 
---

 .mailmap | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index f72fef1..5ea9f93 100644
--- a/.mailmap
+++ b/.mailmap
@@ -21,7 +21,6 @@ Jagan Teki 
 Markus Klotzbuecher 
 Prabhakar Kushwaha 
 Rajeshwari Shinde 
-Ricardo Ribalda Delgado 
 Ricardo Ribalda 
 Ricardo Ribalda 
 Sandeep Paulraj 
-- 
1.9.1

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


[U-Boot] [PATCH] imx: MX6DQ{P}/DL:SABRESD Fix bmode eMMC failure

2016-01-28 Thread Peng Fan
From: Ye Li 

The BOOTCFG value used by bmode for SABRESD eMMC boot are actually for SD card.
Fixed the value to correct one.

The issue was fixed in 2014.04 u-boot, but that patch seems missed during 
porting
to 2015.04.

Signed-off-by: Ye Li 
Signed-off-by: Peng Fan 
Cc: Stefano Babic 
Cc: Fabio Estevam 
---
 board/freescale/mx6sabresd/mx6sabresd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/freescale/mx6sabresd/mx6sabresd.c 
b/board/freescale/mx6sabresd/mx6sabresd.c
index d20953d..42f89ab 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -638,7 +638,7 @@ static const struct boot_mode board_boot_modes[] = {
{"sd2",  MAKE_CFGVAL(0x40, 0x28, 0x00, 0x00)},
{"sd3",  MAKE_CFGVAL(0x40, 0x30, 0x00, 0x00)},
/* 8 bit bus width */
-   {"emmc", MAKE_CFGVAL(0x40, 0x38, 0x00, 0x00)},
+   {"emmc", MAKE_CFGVAL(0x60, 0x58, 0x00, 0x00)},
{NULL,   0},
 };
 #endif
-- 
2.6.2

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


Re: [U-Boot] ARMv8: Use U-Boot to boot Xen?

2016-01-28 Thread Simon Glass
Hi Dirk,

On 28 January 2016 at 12:06, Dirk Behme  wrote:
>
> Hi,
>
> are there any U-Boot examples/patches to boot Xen on an ARMv8/aarch64 system?
>
> I've found
>
> http://lists.denx.de/pipermail/u-boot/2015-October/230077.html
>
> what might be helpful.
>
> But maybe I missed anything else?

I'm aware of these:

http://lists.denx.de/pipermail/u-boot/2015-April/211789.html

http://events.linuxfoundation.org/sites/events/files/slides/U-Boot%20FIT%20for%20Xen.pdf

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

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


Re: [U-Boot] [PATCH] Use correct spelling of "U-Boot"

2016-01-28 Thread Simon Glass
On 27 January 2016 at 00:28, Bin Meng  wrote:
> Correct spelling of "U-Boot" shall be used in all written text
> (documentation, comments in source files etc.).
>
> Signed-off-by: Bin Meng 
>
> ---
> I cc'ed all maintainers, please help review in case I made any
> mistakes. Also we should keep an eye on this when reviewing
> patches in the future.

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


[U-Boot] [PATCH] common/memsize.c: Simplify RAM size detection

2016-01-28 Thread Eddy Petrișor
The case of memory of size 0 is not that different from a memory of any other
size, so we remove the duplicate code and treat the small differences when it
is the case.

Series-to: u-boot
Signed-off-by: Eddy Petrișor 
---
 common/memsize.c | 47 +--
 1 file changed, 21 insertions(+), 26 deletions(-)

diff --git a/common/memsize.c b/common/memsize.c
index 0fb9ba5..5c0d279 100644
--- a/common/memsize.c
+++ b/common/memsize.c
@@ -33,38 +33,28 @@ long get_ram_size(long *base, long maxsize)
long   size;
inti = 0;
 
-   for (cnt = (maxsize / sizeof(long)) >> 1; cnt > 0; cnt >>= 1) {
+   for (cnt = (maxsize / sizeof(long)) >> 1; cnt >= 0; cnt >>= 1) {
addr = base + cnt;  /* pointer arith! */
sync();
-   save[i++] = *addr;
+   save[i] = *addr;
sync();
-   *addr = ~cnt;
-   }
-
-   addr = base;
-   sync();
-   save[i] = *addr;
-   sync();
-   *addr = 0;
-
-   sync();
-   if ((val = *addr) != 0) {
-   /* Restore the original data before leaving the function. */
-   sync();
-   *addr = save[i];
-   for (cnt = 1; cnt < maxsize / sizeof(long); cnt <<= 1) {
-   addr  = base + cnt;
-   sync();
-   *addr = save[--i];
+   if (cnt) {
+   i++;
+   *addr = ~cnt;
+   } else {
+   *addr = 0;
}
-   return (0);
}
 
-   for (cnt = 1; cnt < maxsize / sizeof(long); cnt <<= 1) {
+   sync();
+   cnt = 0;
+   do {
addr = base + cnt;  /* pointer arith! */
val = *addr;
-   *addr = save[--i];
-   if (val != ~cnt) {
+   *addr = save[i--];
+   sync();
+   if (((cnt == 0) && (val != 0)) ||
+   ((cnt != 0) && (val != ~cnt))) {
size = cnt * sizeof(long);
/*
 * Restore the original data
@@ -74,11 +64,16 @@ long get_ram_size(long *base, long maxsize)
 cnt < maxsize / sizeof(long);
 cnt <<= 1) {
addr  = base + cnt;
-   *addr = save[--i];
+   *addr = save[i--];
}
return (size);
}
-   }
+
+   if (cnt)
+   cnt = cnt << 1;
+   else
+   cnt = 1;
+   } while (cnt < maxsize / sizeof(long));
 
return (maxsize);
 }
-- 
2.1.4

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


[U-Boot] ARMv8: Use U-Boot to boot Xen?

2016-01-28 Thread Dirk Behme

Hi,

are there any U-Boot examples/patches to boot Xen on an ARMv8/aarch64 
system?


I've found

http://lists.denx.de/pipermail/u-boot/2015-October/230077.html

what might be helpful.

But maybe I missed anything else?

Many thanks

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


Re: [U-Boot] [PATCH] test/py: fix a couple typos in comments

2016-01-28 Thread Simon Glass
On 28 January 2016 at 10:18, Stephen Warren  wrote:
> From: Stephen Warren 
>
> s/updata/update/.
>
> Signed-off-by: Stephen Warren 
> ---
>  test/py/tests/test_env.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

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


Re: [U-Boot] [PATCH] autoboot.c: Fill env vars in process_fdt_options() only if TEXT_BASE is set

2016-01-28 Thread Simon Glass
On 28 January 2016 at 09:34, Stefan Roese  wrote:
>
> The x86 build target "efi-x86" has no TEXT_BASE configured. And with the
> introduction of CONFIG_BOOTDELAY for x86, this function is now called
> for this board as well. Resulting in compile errors for this target.
>
> Without TEXT_BASE it makes no sense to fill these values. So lets only
> configure the env variable if TEXT_BASE is defined.
>
> Signed-off-by: Stefan Roese 
> Cc: Simon Glass 
> Cc: Bin Meng 
> Cc: Tom Rini 
> ---
>  common/autoboot.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)


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


Re: [U-Boot] [PATCH 0/7] fdt: Replace u-boot-dtb.bin with u-boot.bin

2016-01-28 Thread Simon Glass
Hi Hans,

On 28 January 2016 at 01:25, Hans de Goede  wrote:
> Hi,
>
> On 28-01-16 04:58, Simon Glass wrote:
>>
>> Hi Hans,
>>
>> On 25 January 2016 at 13:30, Simon Glass  wrote:
>>>
>>>
>>> At present u-boot.bin holds the plain U-Boot binary without the device
>>> tree.
>>> This is somewhat annoying since you need either u-boot.bin or
>>> u-boot-dtb.bin
>>> depending on whether device tree is used.
>>>
>>> This series adjusts the build such that u-boot.bin includes a device
>>> tree,
>>> and the plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin
>>> remains
>>> the same.
>>>
>>> This should be acceptable since:
>>>
>>> - without OF_CONTROL, u-boot.bin still does not include a device tree
>>> - with OF_CONTROL, u-boot-dtb.bin does not change
>>>
>>> The main impact is build systems which are set up to use u-boot.bin as
>>> the output file and then add a device tree. These will have to change to
>>> use
>>> u-boot-nodtb.bin instead.
>>>
>>> The original decision to use a separate u-boot-dtb.bin was aimed at
>>> allowing
>>> any device tree file to be concatenated to the u-boot.bin image after the
>>> build. However this no-longer seems so important. More important is the
>>> convenience of using the same output file regardless of the setting for
>>> OF_CONTROL.
>>
>>
>> Do you have any comments on this series please?
>
>
> I'm fine with this series, all normal sunxi use-cases use
> u-boot-sunxi-with-spl.bin
> which is generated like this:
>
> ifneq ($(CONFIG_SUNXI),)
> OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \
>--pad-to=$(CONFIG_SPL_PAD_TO)
> --gap-fill=0xff
> u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin \
> u-boot$(if $(CONFIG_OF_CONTROL),-dtb,).img FORCE
> $(call if_changed,pad_cat)
> endif
>
> Which should stay working just fine, although it might be slightly
> simplified after your patch to simply always use u-boot.img.
>
> sunxi spl does not use a dtb, so nothing should change there.

OK thanks. I'll respin the series with the comments address and send v2.

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


[U-Boot] [PATCH] test/py: make each unit test a pytest

2016-01-28 Thread Stephen Warren
From: Stephen Warren 

A custom fixture named ut_subtest is implemented which is parametrized
with the names of all unit tests that the U-Boot binary supports. This
causes each U-Boot unit test to be exposes as a separate pytest. In turn,
this allows more fine-grained pass/fail counts and test selection, e.g.:

test.py --bd sandbox -k ut_dm_usb

... will run about 8 tests at present.

Signed-off-by: Stephen Warren 
---
This depends on at least my recently sent "test/py: run C-based unit tests".

 test/py/conftest.py  | 105 ---
 test/py/tests/test_ut.py |  14 +++
 2 files changed, 86 insertions(+), 33 deletions(-)

diff --git a/test/py/conftest.py b/test/py/conftest.py
index 3e162cafcc4a..05491a2453c0 100644
--- a/test/py/conftest.py
+++ b/test/py/conftest.py
@@ -21,7 +21,9 @@ import pexpect
 import pytest
 from _pytest.runner import runtestprotocol
 import ConfigParser
+import re
 import StringIO
+import subprocess
 import sys
 
 # Globals: The HTML log file, and the connection to the U-Boot console.
@@ -189,8 +191,43 @@ def pytest_configure(config):
 import u_boot_console_exec_attach
 console = u_boot_console_exec_attach.ConsoleExecAttach(log, ubconfig)
 
-def pytest_generate_tests(metafunc):
-"""pytest hook: parameterize test functions based on custom rules.
+re_ut_test_list = 
re.compile(r'_u_boot_list_2_(dm|env)_test_2_\1_test_(.*)\s*$')
+def generate_ut_subtest(metafunc, fixture_name):
+"""Provide parametrization for a ut_subtest fixture.
+
+Determines the set of unit tests built into a U-Boot binary by parsing the
+list of symbols present in the U-Boot binary. Provides this information to
+test functions by parameterizing their ut_subtest fixture parameter.
+
+Args:
+metafunc: The pytest test function.
+fixture_name: The fixture name to test.
+
+Returns:
+Nothing.
+"""
+
+# This does rely on an objdump binary, but that's quite likely to be
+# present. This approach trivially takes care of any source or Makefile-
+# level conditional compilation which may occur, and matches the test
+# execution order of a plain "ut dm" command. A source-scanning approach
+# would not do neither. This approach also doesn't require access to the
+# U-Boot source tree when running tests.
+
+cmd = 'objdump -t "%s" | sort' % (console.config.build_dir + '/u-boot')
+out = subprocess.check_output(cmd, shell=True)
+vals = []
+for l in out.splitlines():
+m = re_ut_test_list.search(l)
+if not m:
+continue
+vals.append(m.group(1) + ' ' + m.group(2))
+
+ids = ['ut_' + s.replace(' ', '_') for s in vals]
+metafunc.parametrize(fixture_name, vals, ids=ids)
+
+def generate_config(metafunc, fixture_name):
+"""Provide parametrization for {env,brd}__ fixtures.
 
 If a test function takes parameter(s) (fixture names) of the form brd__xxx
 or env__xxx, the brd and env configuration dictionaries are consulted to
@@ -199,6 +236,7 @@ def pytest_generate_tests(metafunc):
 
 Args:
 metafunc: The pytest test function.
+fixture_name: The fixture name to test.
 
 Returns:
 Nothing.
@@ -208,30 +246,49 @@ def pytest_generate_tests(metafunc):
 'brd': console.config.brd,
 'env': console.config.env,
 }
+parts = fixture_name.split('__')
+if len(parts) < 2:
+return
+if parts[0] not in subconfigs:
+return
+subconfig = subconfigs[parts[0]]
+vals = []
+val = subconfig.get(fixture_name, [])
+# If that exact name is a key in the data source:
+if val:
+# ... use the dict value as a single parameter value.
+vals = (val, )
+else:
+# ... otherwise, see if there's a key that contains a list of
+# values to use instead.
+vals = subconfig.get(fixture_name+ 's', [])
+def fixture_id(index, val):
+try:
+return val['fixture_id']
+except:
+return fixture_name + str(index)
+ids = [fixture_id(index, val) for (index, val) in enumerate(vals)]
+metafunc.parametrize(fixture_name, vals, ids=ids)
+
+def pytest_generate_tests(metafunc):
+"""pytest hook: parameterize test functions based on custom rules.
+
+Check each test function parameter (fixture name) to see if it is one of
+our custom names, and if so, provide the correct parametrization for that
+parameter.
+
+Args:
+metafunc: The pytest test function.
+
+Returns:
+Nothing.
+"""
+
 for fn in metafunc.fixturenames:
-parts = fn.split('__')
-if len(parts) < 2:
+if fn == 'ut_subtest':
+generate_ut_subtest(metafunc, fn)
 continue
-if parts[0] not in subconfigs:
-continue
-subconfig = subconfigs[parts[0]]
-vals = []
-val = subconfig.get(fn, [])
-# If that exact name is a key i

[U-Boot] Pull request: u-boot-net.git master

2016-01-28 Thread Joe Hershberger
Hi Tom,

Here are the network patches for this round. Should be pretty basic stuff.

Thanks!
-Joe

The following changes since commit 077678eb0c226e52a1f90edabd3369ab26065b32:

  Merge git://git.denx.de/u-boot-dm (2016-01-12 18:12:42 -0500)

are available in the git repository at:


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

for you to fetch changes up to b2b7fbc33ff1b990804e481153dd45de579cff75:

  net: Add bootfile in DHCP Request (2016-01-28 17:19:43 -0600)


Alexandre Messier (4):
  net: phy: micrel: Disable B_CAST on config
  net: phy: Set ANRESTART in setup_forced
  net: phy: Use 'autoneg' flag from phydev
  net: Add bootfile in DHCP Request

Alexey Brodkin (4):
  drivers/net/phy: introduce phy_set_supported()
  include/net.h: add max_speed member in struct eth_pdata
  net/designware: do explicit port selection for 1Gb mode
  net/designware: add support of max-speed device tree property

Bin Meng (15):
  powerpc: bsc9132qds: Do not wrap pci_eth_init() with CONFIG_TSEC_ENET
  powerpc: c29xpcie: Do not wrap pci_eth_init() with CONFIG_TSEC_ENET
  powerpc: mpc8572ds: Do not wrap pci_eth_init() with CONFIG_TSEC_ENET
  powerpc: mpc8548cds: Do not wrap pci_eth_init() with CONFIG_TSEC_ENET
  powerpc: p1010rdb: Do not wrap pci_eth_init() with CONFIG_TSEC_ENET
  arm: ls1021atwr: Do not wrap pci_eth_init() with CONFIG_TSEC_ENET
  net: tsec: fsl_mdio: Fix several cosmetic issues
  net: tsec: Move rx_idx and tx_idx to struct tsec_private
  net: tsec: Move rxbd and txbd to struct tsec_private
  net: tsec: Adjust orders to avoid forward declaration of tsec_send()
  net: tsec: Use tsec_private pointer as the parameter for internal routines
  doc: dt-bindings: Describe Freescale TSEC ethernet controller
  net: tsec: Add driver model ethernet support
  net: tsec: Use priv->tbiaddr to initialize TBI PHY address
  arm: ls102xa: Rewrite the logic of ft_fixup_enet_phy_connect_type()

Codrin Ciubotariu (5):
  drivers: net: vsc9953: Fix number of reserved registers
  drivers: net: vsc9953: Fix FDB aging time
  doc: t1040-l2switch: Update README
  common: cmd_ethsw: Spelling fixes
  drivers: net: vsc9953: Add LAG support

Dinh Nguyen (2):
  net: phy: micrel: add documentation for Micrel KSZ90x1 binding
  net: phy: micrel: fix divisor value for KSZ9031 phy skew

Florian Fainelli (2):
  net: phy: ensure Gigabit features are masked off if requested
  net: phy: breakdown PHY_*_FEATURES defines

Peng Fan (1):
  net: bootp: Ignore packets whose yiaddr is 0

Sascha Hauer (1):
  net: phy: genphy: Allow overwriting features

Shaohui Xie (2):
  net: phy: introduce a quirk PHY_FLAG_BROKEN_RESET
  net: phy: implements probe for Cortina phy

Simon Glass (7):
  tegra: Report errors from PCI init
  net: Don't call board/cpu_eth_init() with driver model
  net: Move common init into a new eth_common.c file
  net: Move environment functions to the common file
  net: Move remaining common functions to eth_common.c
  net: Move driver-model code into its own file
  net: Rename eth.c to eth_lecacy.c

Stefan Agner (1):
  net: phy: do not read configuration register on reset

 arch/arm/cpu/armv7/ls102xa/fdt.c|  16 +-
 board/freescale/bsc9132qds/bsc9132qds.c |   4 +-
 board/freescale/c29xpcie/c29xpcie.c |   4 +-
 board/freescale/ls1021atwr/ls1021atwr.c |   4 +-
 board/freescale/mpc8548cds/mpc8548cds.c |   4 +-
 board/freescale/mpc8572ds/mpc8572ds.c   |   4 +-
 board/freescale/p1010rdb/p1010rdb.c |   4 +-
 common/cmd_ethsw.c  |  78 +++-
 doc/README.t1040-l2switch   |  29 +-
 doc/device-tree-bindings/net/fsl-tsec-phy.txt   |  64 +++
 doc/device-tree-bindings/net/micrel-ksz90x1.txt | 165 +++
 drivers/net/designware.c|  16 +-
 drivers/net/designware.h|   1 +
 drivers/net/fsl_mdio.c  |   4 +-
 drivers/net/phy/cortina.c   |   7 +
 drivers/net/phy/micrel.c|  25 +-
 drivers/net/phy/phy.c   | 102 ++--
 drivers/net/tsec.c  | 536 ++---
 drivers/net/vsc9953.c   | 354 +-
 drivers/pci/pci_tegra.c |   6 +-
 include/ethsw.h |   6 +
 include/fsl_mdio.h  |   7 +-
 include/net.h   |   2 +
 include/phy.h   |  25 +-
 include/tsec.h  |  69 +--
 include/vsc9953.h   |  24 +-
 net/Makefile|   7 +-
 net/bootp.c |   4 +
 net/{et

Re: [U-Boot] Pull request, u-boot-tegra/master

2016-01-28 Thread Tom Rini
On Thu, Jan 28, 2016 at 10:46:47AM -0700, Tom Warren wrote:

> Tom,
> 
> Please pull u-boot-tegra/master into U-Boot/master. Thanks!
> 
> All tegra builds are OK (32-bit and 64-bit).
> 
> The following changes since commit b20c38a973a51bf3f663bd298c63ad1b8e0de445:
> 
>   arm: mvebu: Add support for the Armada XP theadorable board (2016-01-27
> 07:45:43 +0100)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-tegra.git master
> 
> for you to fetch changes up to 7fb82986be6252acf5aa05ac1ba7225548134a18:
> 
>   ARM: tegra: rm Jetson TK1 PMIC GPIO programming (2016-01-28 10:32:31
> -0700)
> 

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

2016-01-28 Thread Tom Rini
On Thu, Jan 28, 2016 at 03:13:18PM +0800, Bin Meng wrote:

> Hi Tom,
> 
> The following changes since commit b20c38a973a51bf3f663bd298c63ad1b8e0de445:
> 
>   arm: mvebu: Add support for the Armada XP theadorable board
> (2016-01-27 07:45:43 +0100)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-x86.git master
> 
> for you to fetch changes up to 81aaa3d9fce5ce9641e5f0c3354da876d859b3b6:
> 
>   x86: Correct spi node alias (2016-01-28 13:53:30 +0800)
> 

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-01-28 Thread Tom Rini
On Wed, Jan 27, 2016 at 04:42:09PM +0100, Michal Simek wrote:

> Hi Tom,
> 
> here is the branch with xilinx changes which are flying around.
> It is targeting PowerPC, Microblaze, ARM and ARM64.
> I can't see any build problem via buildman.
> 
> Thanks,
> Michal
> 
> 
> The following changes since commit 9e4de7fd4acc8f99b6d383c711d21c0159849629:
> 
>   Merge branch 'master' of http://git.denx.de/u-boot-sunxi (2016-01-26
> 17:45:37 -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 f36919a8138ed7ecd3dbce4630e02936b13907da:
> 
>   ppc: xilinx-ppc440-generic: Wire LL_TEMAC driver (2016-01-27 15:57:20
> +0100)
> 

Applied to u-boot/master, thanks!

But note:
+(xilinx-ppc405-generic) Device Tree Source is not correctly specified.
+(xilinx-ppc405-generic) Please define 'CONFIG_DEFAULT_DEVICE_TREE'
+(xilinx-ppc405-generic) or build with 'DEVICE_TREE=' argument
+(xilinx-ppc405-generic) make[2]: *** 
[arch/powerpc/dts/xilinx-ppc440-generic.dtb] Error 1
+(xilinx-ppc405-generic) make[1]: *** [dts] Error 2

-- 
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-fsl-qoriq.git master

2016-01-28 Thread Tom Rini
On Wed, Jan 27, 2016 at 05:30:45PM +, york sun wrote:

> Tom,
> 
> The following changes since commit 12f229ea8f6c8e20f8fd07906eafc853c4c354a9:
> 
>   Merge git://git.denx.de/u-boot-fdt (2016-01-22 17:01:22 -0500)
> 
> are available in the git repository at:
> 
> 
>   git://git.denx.de/u-boot-fsl-qoriq.git master
> 
> for you to fetch changes up to b0f20caf6570fbc4d19c41dcedf9679784042860:
> 
>   armv8/ls1043aqds: add QSPI boot support (2016-01-27 08:29:09 -0800)
> 

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-marvell/master

2016-01-28 Thread Tom Rini
On Wed, Jan 27, 2016 at 07:58:00AM +0100, Stefan Roese wrote:

> Hi Tom,
> 
> please pull the following patch.
> 
> Thanks,
> Stefan
> 
> The following changes since commit 9e4de7fd4acc8f99b6d383c711d21c0159849629:
> 
>   Merge branch 'master' of http://git.denx.de/u-boot-sunxi
> (2016-01-26 17:45:37 -0500)
> 
> are available in the git repository at:
> 
>   git://www.denx.de/git/u-boot-marvell.git
> 
> for you to fetch changes up to b20c38a973a51bf3f663bd298c63ad1b8e0de445:
> 
>   arm: mvebu: Add support for the Armada XP theadorable board
> (2016-01-27 07:45:43 +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] net: tftp: Add TFTP specific config for retry count

2016-01-28 Thread MESSIER, ALEXANDRE
Hi Joe,

It turns out that commit f5fb734 "net: TFTP: variables cleanup and addition"
implements the same functionality as this patch.

Please disregard this patch.

Thanks!

> -Original Message-
> From: Joe Hershberger [mailto:joe.hershber...@gmail.com]
> Sent: January-22-16 2:29 PM
> To: amessier.t...@gmail.com
> Cc: u-boot; Joe Hershberger; MESSIER, ALEXANDRE
> Subject: Re: [U-Boot] [PATCH] net: tftp: Add TFTP specific config for retry
> count
>
> On Fri, Jan 22, 2016 at 1:18 PM,   wrote:
> > From: Alexandre Messier 
> >
> > There is currently one config option (CONFIG_NET_RETRY_COUNT) that is
> > available to tune the retries of the network stack.
> > Unfortunately, it is global to all protocols, and the value is
> > interpreted differently in all of them.
> >
> > Add a new config option that sets directly the number of retries
> > specifically for TFTP.
> >
> > Signed-off-by: Alexandre Messier 
> > ---
> >  README | 5 +
> >  net/tftp.c | 4 
> >  2 files changed, 9 insertions(+)
> >
> > diff --git a/README b/README
> > index ece4793..9d53c2e 100644
> > --- a/README
> > +++ b/README
> > @@ -2845,6 +2845,11 @@ CBFS (Coreboot Filesystem) support
> > before giving up the operation. If not defined, a
> > default value of 5 is used.
> >
> > +   CONFIG_NET_RETRY_COUNT_TFTP
> > +
> > +   Override CONFIG_NET_RETRY_COUNT for TFTP. If not defined,
> > +   falls back to CONFIG_NET_RETRY_COUNT.
> > +
>
> If you want to add a new config option, it needs to be in the Kconfig system.
>
> > CONFIG_ARP_TIMEOUT
> >
> > Timeout waiting for an ARP reply in milliseconds.
> > diff --git a/net/tftp.c b/net/tftp.c
> > index f2889fe..884cfaa 100644
> > --- a/net/tftp.c
> > +++ b/net/tftp.c
> > @@ -20,12 +20,16 @@
> >  #define WELL_KNOWN_PORT69
> >  /* Millisecs to timeout for lost pkt */
> >  #define TIMEOUT5000UL
> > +#ifndef CONFIG_NET_RETRY_COUNT_TFTP
> >  #ifndefCONFIG_NET_RETRY_COUNT
> >  /* # of timeouts before giving up */
> >  # define TIMEOUT_COUNT 10
> >  #else
> >  # define TIMEOUT_COUNT  (CONFIG_NET_RETRY_COUNT * 2)  #endif
> > +#else
> > +# define TIMEOUT_COUNT CONFIG_NET_RETRY_COUNT_TFTP #endif
> >  /* Number of "loading" hashes per line (for checking the image size) */
> >  #define HASHES_PER_LINE65
> >
> > --
> > 2.7.0
> >
> > ___
> > U-Boot mailing list
> > U-Boot@lists.denx.de
> > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.denx.de_mail
> > man_listinfo_u-2Dboot&d=CwIBaQ&c=0YGvTs3tT-
> VMy8_v51yLDw&r=adEdfGeVvAp5
> > D3jUKeOClnVoZZOSb93LtGg4Qgmpmjw&m=9unHvE5XXKyF-
> lM3U6pF9XpWvcC8xlNgyTBS
> > nEPIi6k&s=iNlpx7rwu413FslQ29XOXe1QNlTHfFNrF_Ej2NKr2T8&e=



This e-mail contains privileged and confidential information intended for the 
use of the addressees named above. If you are not the intended recipient of 
this e-mail, you are hereby notified that you must not disseminate, copy or 
take any action in respect of any information contained in it. If you have 
received this e-mail in error, please notify the sender immediately by e-mail 
and immediately destroy this e-mail and its attachments.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] test/py: dfu: allow boardenv to specify test sizes

2016-01-28 Thread Stephen Warren
From: Stephen Warren 

Allow the env__dfu_configs boardenv data to specify the set of DFU
transfer sizes to test. Manually specifying test sizes is useful if you
wish to test multiple DFU configurations (e.g. SD card ext4 filesystem, SD
card whole raw partition, RAM, etc.), but don't want to test every
single transfer size on each, to avoid bloating the overall time taken by
testing. If the boardenv doesn't specify a set of sizes, the built-in list
is used as a default, preserving backwards-compatibility.

Signed-off-by: Stephen Warren 
---
 test/py/tests/test_dfu.py | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/test/py/tests/test_dfu.py b/test/py/tests/test_dfu.py
index bb70008af300..093e8d067871 100644
--- a/test/py/tests/test_dfu.py
+++ b/test/py/tests/test_dfu.py
@@ -36,6 +36,14 @@ env__dfu_configs = (
 "fixture_id": "emmc",
 "alt_info": "/dfu_test.bin ext4 0 1;/dfu_dummy.bin ext4 0 1",
 "cmd_params": "mmc 0",
+# This value is optional.
+# If present, it specified the set of transfer sizes tested.
+# If missing, a default list of sizes will be used, which covers
+#   various useful corner cases.
+# Manually specifying test sizes is useful if you wish to test 4 DFU
+# configurations, but don't want to test every single transfer size
+# on each, to avoid bloating the overall time taken by testing.
+"test_sizes": (63, 64, 65),
 },
 )
 
@@ -52,7 +60,7 @@ device.)
 # The set of file sizes to test. These values trigger various edge-cases such
 # as one less than, equal to, and one greater than typical USB max packet
 # sizes, and similar boundary conditions.
-test_sizes = (
+test_sizes_default = (
 64 - 1,
 64,
 64 + 1,
@@ -245,7 +253,7 @@ def test_dfu(u_boot_console, env__usb_dev_port, 
env__dfu_config):
 if not first_usb_dev_port:
 first_usb_dev_port = env__usb_dev_port
 if env__usb_dev_port == first_usb_dev_port:
-sizes = test_sizes
+sizes = env__dfu_config.get('test_sizes', test_sizes_default)
 else:
 sizes = []
 
-- 
2.7.0

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


[U-Boot] [PATCH] test/py: fix a couple typos in comments

2016-01-28 Thread Stephen Warren
From: Stephen Warren 

s/updata/update/.

Signed-off-by: Stephen Warren 
---
 test/py/tests/test_env.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py
index 651303f8cd69..c41aa5a9d9c7 100644
--- a/test/py/tests/test_env.py
+++ b/test/py/tests/test_env.py
@@ -94,7 +94,7 @@ def unset_var(state_test_env, var):
 object.
 
 Args:
-state_test_env: The StateTestEnv object to updata.
+state_test_env: The StateTestEnv object to update.
 var: The variable name to unset.
 
 Returns:
@@ -112,7 +112,7 @@ def set_var(state_test_env, var, value):
 object.
 
 Args:
-state_test_env: The StateTestEnv object to updata.
+state_test_env: The StateTestEnv object to update.
 var: The variable name to set.
 value: The value to set the variable to.
 
-- 
2.7.0

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


Re: [U-Boot] [PATCH] ARM: tegra: rm Jetson TK1 PMIC GPIO programming

2016-01-28 Thread Stephen Warren

On 01/18/2016 12:16 PM, Tom Warren wrote:

Stephen Warren wrotea tMonday, January 18, 2016 11:23 AM:

The PMIC is configured such that its GPIOs have the correct configuration at
power-up, so no programming is required.

In fact, the current programming is actively wrong, since:

(a) the AS3722 driver configures the GPIO to be an output before setting its
output value, which causes a 0v glitch on the output.

(b) the AS3722 driver configures the GPIO to drive a high voltage from its
VSUP_GPIO power source rather than its VDD_GPIO_LV power source, so the
pin drives 5V not 1.8V as desired.

Solve these problems by removing the code which configures the PMIC GPIOs.

Note that this patch was tested directly on top of v2016.01; since then, commit
96350f729c42 "dm: tegra: net: Convert tegra boards to driver model for
Ethernet" prevents PCIe from being initialized. Alternatively, simply revert 
that
commit to get PCIe Ethernet working again, then apply this patch to test.


Acked-by: Tom Warren 
I'll apply this to u-boot-tegra/next ASAP.


I don't see this patch there yet. It'd be good to get it pulled upstream 
ASAP since the merge window for v2016.03 closes this weekend.

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


[U-Boot] [PATCH 20/26] mkimage: Support placing data outside the FIT

2016-01-28 Thread Simon Glass
One limitation of FIT is that all the data is 'inline' within it, using a
'data' property in each image node. This means that to find out what is in
the FIT it is necessary to scan the entire file. Once loaded it can be
scanned and then the images can be copied to the correct place in memory.

In SPL it can take a significant amount of time to copy images around in
memory. Also loading data that does not end up being used is wasteful. It
would be useful if the FIT were small, acting as a directory, with the
actual data stored elsewhere.

This allows SPL to load the entire FIT, without the images, then load the
images it wants later.

Add a -E option to mkimage to request that it output an 'external' FIT.

Signed-off-by: Simon Glass 
---

 doc/mkimage.1 |   9 +++
 doc/uImage.FIT/source_file_format.txt |  20 ++-
 tools/fit_image.c | 109 ++
 tools/imagetool.h |   1 +
 tools/mkimage.c   |   5 +-
 5 files changed, 142 insertions(+), 2 deletions(-)

diff --git a/doc/mkimage.1 b/doc/mkimage.1
index b1b45d7..d9ffc75 100644
--- a/doc/mkimage.1
+++ b/doc/mkimage.1
@@ -112,6 +112,15 @@ Provide special options to the device tree compiler that 
is used to
 create the image.
 
 .TP
+.BI "\-E
+After processing, move the image data outside the FIT and store a data offset
+in the FIT. Images will be placed one after the other immediately after the
+FIT, with each one aligned to a 4-byte boundary. The existing 'data' property
+in each image will be replaced with 'data-offset' and 'data-size' properties.
+A 'data-offset' of 0 indicates that it starts in the first (4-byte aligned)
+byte after the FIT.
+
+.TP
 .BI "\-f [" "image tree source file" " | " "auto" "]"
 Image tree source file that describes the structure and contents of the
 FIT image.
diff --git a/doc/uImage.FIT/source_file_format.txt 
b/doc/uImage.FIT/source_file_format.txt
index 029f481..e39b38c 100644
--- a/doc/uImage.FIT/source_file_format.txt
+++ b/doc/uImage.FIT/source_file_format.txt
@@ -2,6 +2,7 @@ U-boot new uImage source file format (bindings definition)
 ==
 
 Author: Marian Balakowicz 
+External data additions, 25/1/16 Simon Glass 
 
 1) Introduction
 ---
@@ -262,7 +263,24 @@ Older, 2.4 kernel and 2.6 non-FDT kernel do not use FDT 
blob, in such cases
 not* be specified in a configuration node.
 
 
-8) Examples
+8) External data
+
+
+The above format shows a 'data' property which holds the data for each image.
+It is also possible for this data to reside outside the FIT itself. This
+allows the FIT to be quite small, so that it can be loaded and scanned
+without loading a large amount of data. Then when an image is needed it can
+be loaded from an external source.
+
+In this case the 'data' property is omitted. Instead you can use:
+
+  - data-offset : offset of the data in a separate image store. The image
+store is placed immediately after the last byte of the device tree binary,
+aligned to a 4-byte boundary.
+  - data-size : size of the data in bytes
+
+
+9) Examples
 ---
 
 Please see doc/uImage.FIT/*.its for actual image source files.
diff --git a/tools/fit_image.c b/tools/fit_image.c
index 0d8007b..5d087e3 100644
--- a/tools/fit_image.c
+++ b/tools/fit_image.c
@@ -354,6 +354,108 @@ err:
 }
 
 /**
+ * fit_extract_data() - Move all data outside the FIT
+ *
+ * This takes a normal FIT file and removes all the 'data' properties from it.
+ * The data is placed in an area after the FIT so that it can be accessed
+ * using an offset into that area. The 'data' properties turn into
+ * 'data-offset' properties.
+ *
+ * This function cannot cope with FITs with 'data-offset' properties. All
+ * data must be in 'data' properties on entry.
+ */
+static int fit_extract_data(struct image_tool_params *params, const char 
*fname)
+{
+   void *buf;
+   int buf_ptr;
+   int fit_size, new_size;
+   int fd;
+   struct stat sbuf;
+   void *fdt;
+   int ret;
+   int images;
+   int node;
+
+   fd = mmap_fdt(params->cmdname, fname, 0, &fdt, &sbuf, false);
+   if (fd < 0)
+   return -EIO;
+   fit_size = fdt_totalsize(fdt);
+
+   /* Allocate space to hold the image data we will extract */
+   buf = malloc(fit_size);
+   if (!buf) {
+   ret = -ENOMEM;
+   goto err;
+   }
+   buf_ptr = 0;
+
+   images = fdt_path_offset(fdt, FIT_IMAGES_PATH);
+   if (images < 0) {
+   debug("%s: Cannot find /images node: %d\n", __func__, images);
+   ret = -EINVAL;
+   goto err;
+   }
+
+   for (node = fdt_first_subnode(fdt, images);
+node >= 0;
+node = fdt_next_subnode(fdt, node)) {
+   const char *data;
+   int len;
+
+   data = fdt_getprop(fdt, node, "data", &l

[U-Boot] [PATCH 18/26] mkimage: Support automatic creating of a FIT without a .its

2016-01-28 Thread Simon Glass
At present, when generating a FIT, mkimage requires a .its file containing
the structure of the FIT and referring to the images to be included.

Creating the .its file is a separate step that makes it harder to use FIT.
This is not required for creating legacy images.

Often the FIT is pretty standard, consisting of an OS image, some device
tree files and a single configuration. We can handle this case automatically
and avoid needing a .its file at all.

To start with, support automatically generate the FIT using a new '-f auto'
option. Initially this only supports adding a single image (e.g. a linux
kernel) and a single configuration.

Signed-off-by: Simon Glass 
---

 doc/mkimage.1 |  16 +++-
 tools/fit_image.c | 216 +-
 tools/imagetool.h |   1 +
 tools/mkimage.c   |   8 +-
 4 files changed, 235 insertions(+), 6 deletions(-)

diff --git a/doc/mkimage.1 b/doc/mkimage.1
index 1b9d18c..146c114 100644
--- a/doc/mkimage.1
+++ b/doc/mkimage.1
@@ -108,10 +108,15 @@ Provide special options to the device tree compiler that 
is used to
 create the image.
 
 .TP
-.BI "\-f [" "image tree source file" "]"
+.BI "\-f [" "image tree source file" " | " "auto" "]"
 Image tree source file that describes the structure and contents of the
 FIT image.
 
+This can be automatically generated for some simple cases.
+Use "-f auto" for this. In that case the arguments -d, -A, -O, -T, -C, -a
+and -e are used to specify the image to include in the FIT and its attributes.
+No .its file is required.
+
 .TP
 .BI "\-F"
 Indicates that an existing FIT image should be modified. No dtc
@@ -178,6 +183,15 @@ with unavailable keys are skipped.
 .B -c """Kernel 3.8 image for production devices""" kernel.itb
 .fi
 
+.P
+Create a FIT image containing a kernel, using automatic mode. No .its file
+is required.
+.nf
+.B mkimage -f auto -A arm -O linux -T kernel -C none -a 43e0 -e 0 
+.br
+.B -c """Kernel 4.4 image for production devices""" -d vmlinuz kernel.itb
+.fi
+
 .SH HOMEPAGE
 http://www.denx.de/wiki/U-Boot/WebHome
 .PP
diff --git a/tools/fit_image.c b/tools/fit_image.c
index eb2a25e..343de60 100644
--- a/tools/fit_image.c
+++ b/tools/fit_image.c
@@ -18,6 +18,8 @@
 #include "fit_common.h"
 #include "mkimage.h"
 #include 
+#include 
+#include 
 #include 
 
 static image_header_t header;
@@ -71,6 +73,207 @@ err_keydest:
 }
 
 /**
+ * fit_calc_size() - Calculate the approximate size of the FIT we will generate
+ */
+static int fit_calc_size(struct image_tool_params *params)
+{
+   int size, total_size;
+
+   size = imagetool_get_filesize(params, params->datafile);
+   if (size < 0)
+   return -1;
+
+   total_size = size;
+
+   /* TODO(s...@chromium.org): Add in the size of any other files */
+
+   /* Add plenty of space for headers, properties, nodes, etc. */
+   total_size += 4096;
+
+   return total_size;
+}
+
+static int fdt_property_file(struct image_tool_params *params,
+void *fdt, const char *name, const char *fname)
+{
+   struct stat sbuf;
+   void *ptr;
+   int ret;
+   int fd;
+
+   fd = open(fname, O_RDWR | O_BINARY);
+   if (fd < 0) {
+   fprintf(stderr, "%s: Can't open %s: %s\n",
+   params->cmdname, fname, strerror(errno));
+   return -1;
+   }
+
+   if (fstat(fd, &sbuf) < 0) {
+   fprintf(stderr, "%s: Can't stat %s: %s\n",
+   params->cmdname, fname, strerror(errno));
+   goto err;
+   }
+
+   ret = fdt_property_val(fdt, "data", sbuf.st_size, &ptr);
+   if (ret)
+   return ret;
+   ret = read(fd, ptr, sbuf.st_size);
+   if (ret != sbuf.st_size) {
+   fprintf(stderr, "%s: Can't read %s: %s\n",
+   params->cmdname, fname, strerror(errno));
+   goto err;
+   }
+
+   return 0;
+err:
+   close(fd);
+   return -1;
+}
+
+static int fdt_property_strf(void *fdt, const char *name, const char *fmt, ...)
+{
+   char str[100];
+   va_list ptr;
+
+   va_start(ptr, fmt);
+   vsnprintf(str, sizeof(str), fmt, ptr);
+   va_end(ptr);
+   return fdt_property_string(fdt, name, str);
+}
+
+/**
+ * fit_write_images() - Write out a list of images to the FIT
+ *
+ * Include the main image (params->datafile).
+ */
+static int fit_write_images(struct image_tool_params *params, char *fdt)
+{
+   const char *typename;
+   char str[100];
+   int ret;
+
+   fdt_begin_node(fdt, "images");
+
+   /* First the main image */
+   typename = genimg_get_type_short_name(params->fit_image_type);
+   snprintf(str, sizeof(str), "%s@1", typename);
+   fdt_begin_node(fdt, str);
+   fdt_property_string(fdt, "description", params->imagename);
+   fdt_property_string(fdt, "type", typename);
+   fdt_property_string(fdt, "arch", genimg_get_arch_name(params->arch));
+ 

[U-Boot] [PATCH 24/26] spl: Add a way to specify a list of device trees to include

2016-01-28 Thread Simon Glass
When building a FIT, more than one device tree can be included. The board
can select (at run-time) the one that it wants.

Add a Kconfig option to allow the list of devices trees (supported by the
board) to be specified.

When using SPL_LOAD_FIT, build u-boot.img in FIT format instead of the
legacy image format. Include all the listed device tree files in this FIT.

Signed-off-by: Simon Glass 
---

 Makefile| 10 +-
 dts/Kconfig | 10 ++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 8b9f622..d01cd3e 100644
--- a/Makefile
+++ b/Makefile
@@ -903,9 +903,16 @@ quiet_cmd_cpp_cfg = CFG $@
 cmd_cpp_cfg = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
-DDO_DEPS_ONLY -D__ASSEMBLY__ -x assembler-with-cpp -P -dM -E -o $@ $<
 
+ifdef CONFIG_SPL_LOAD_FIT
+MKIMAGEFLAGS_u-boot.img = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
+   -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
+   -n "U-Boot $(UBOOTRELEASE) for $(BOARD) board" -E \
+   -b $(patsubst %,arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) -i
+else
 MKIMAGEFLAGS_u-boot.img = -A $(ARCH) -T firmware -C none -O u-boot \
-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
-n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
+endif
 
 MKIMAGEFLAGS_u-boot-dtb.img = $(MKIMAGEFLAGS_u-boot.img)
 
@@ -918,7 +925,8 @@ MKIMAGEFLAGS_u-boot-spl.kwb = -n 
$(srctree)/$(CONFIG_SYS_KWD_CONFIG:"%"=%) \
 MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \
-R $(srctree)/$(CONFIG_SYS_FSL_PBL_PBI:"%"=%) -T pblimage
 
-u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE
+u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl: \
+   $(if $(CONFIG_SPL_LOAD_FIT),u-boot-nodtb.bin 
dts/dt.dtb,u-boot.bin) FORCE
$(call if_changed,mkimage)
 
 u-boot-spl.kwb: u-boot.img spl/u-boot-spl.bin FORCE
diff --git a/dts/Kconfig b/dts/Kconfig
index ba83d5f..9ef2660 100644
--- a/dts/Kconfig
+++ b/dts/Kconfig
@@ -59,6 +59,16 @@ config DEFAULT_DEVICE_TREE
  It can be overridden from the command line:
  $ make DEVICE_TREE=
 
+config OF_LIST
+   string "List of device tree files to include for DT control"
+   depends on SPL_LOAD_FIT
+   help
+ This option specifies a list of device tree files to use for DT
+ control. These will be packaged into a FIT. At run-time, SPL will
+ select the correct DT to use by examining the hardware (e.g.
+ reading a board ID value). This is a list of device tree files
+ (without the directory or .dtb suffix) separated by .
+
 config OF_SPL_REMOVE_PROPS
string "List of device tree properties to drop for SPL"
depends on SPL_OF_CONTROL
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH 23/26] spl: Add an option to load a FIT containing U-Boot

2016-01-28 Thread Simon Glass
This provides a way to load a FIT containing U-Boot and a selection of device
tree files. The board can select the correct device tree by probing the
hardware. Then U-Boot is started with the selected device tree.

Signed-off-by: Simon Glass 
---

 Kconfig  |  11 +++
 common/spl/Makefile  |   1 +
 common/spl/spl_fit.c | 192 +++
 include/spl.h|  18 +
 4 files changed, 222 insertions(+)
 create mode 100644 common/spl/spl_fit.c

diff --git a/Kconfig b/Kconfig
index 3ce5ba1..f32c6c7 100644
--- a/Kconfig
+++ b/Kconfig
@@ -215,6 +215,17 @@ config SYS_TEXT_BASE
help
  TODO: Move CONFIG_SYS_TEXT_BASE for all the architecture
 
+config SPL_LOAD_FIT
+   bool "Enable SPL loading U-Boot as a FIT"
+   depends on FIT
+   help
+ Normally with the SPL framework a legacy image is generated as part
+ of the build. This contains U-Boot along with information as to
+ where it should be loaded. This option instead enables generation
+ of a FIT (Flat Image Tree) which provides more flexibility. In
+ particular it can handle selecting from multiple device tree
+ and passing the correct one to U-Boot.
+
 config SYS_CLK_FREQ
depends on ARC || ARCH_SUNXI
int "CPU clock frequency"
diff --git a/common/spl/Makefile b/common/spl/Makefile
index 10a4589..2e0f695 100644
--- a/common/spl/Makefile
+++ b/common/spl/Makefile
@@ -10,6 +10,7 @@
 
 ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_SPL_FRAMEWORK) += spl.o
+obj-$(CONFIG_SPL_LOAD_FIT) += spl_fit.o
 obj-$(CONFIG_SPL_NOR_SUPPORT) += spl_nor.o
 obj-$(CONFIG_SPL_YMODEM_SUPPORT) += spl_ymodem.o
 obj-$(CONFIG_SPL_NAND_SUPPORT) += spl_nand.o
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
new file mode 100644
index 000..f225f64
--- /dev/null
+++ b/common/spl/spl_fit.c
@@ -0,0 +1,192 @@
+/*
+ * Copyright (C) 2016 Google, Inc
+ * Written by Simon Glass 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+
+static ulong fdt_getprop_u32(const void *fdt, int node, const char *prop)
+{
+   const u32 *cell;
+   int len;
+
+   cell = fdt_getprop(fdt, node, prop, &len);
+   if (len != sizeof(*cell))
+   return -1U;
+   return fdt32_to_cpu(*cell);
+}
+
+static int spl_fit_select_fdt(const void *fdt, int images, int *fdt_offsetp)
+{
+   const char *name, *fdt_name;
+   int conf, node, fdt_node;
+   int len;
+
+   *fdt_offsetp = 0;
+   conf = fdt_path_offset(fdt, FIT_CONFS_PATH);
+   if (conf < 0) {
+   debug("%s: Cannot find /configurations node: %d\n", __func__,
+ conf);
+   return -EINVAL;
+   }
+   for (node = fdt_first_subnode(fdt, conf);
+node >= 0;
+node = fdt_next_subnode(fdt, node)) {
+   name = fdt_getprop(fdt, node, "description", &len);
+   if (!name)
+   return -EINVAL;
+   if (board_fit_config_name_match(name))
+   continue;
+
+   debug("Selecting config '%s'", name);
+   fdt_name = fdt_getprop(fdt, node, FIT_FDT_PROP, &len);
+   if (!fdt_name) {
+   debug("%s: Cannot find fdt name property: %d\n",
+ __func__, len);
+   return -EINVAL;
+   }
+
+   debug(", fdt '%s'\n", fdt_name);
+   fdt_node = fdt_subnode_offset(fdt, images, fdt_name);
+   if (fdt_node < 0) {
+   debug("%s: Cannot find fdt node '%s': %d\n",
+ __func__, fdt_name, fdt_node);
+   return -EINVAL;
+   }
+
+   *fdt_offsetp = fdt_getprop_u32(fdt, fdt_node, "data-offset");
+   len = fdt_getprop_u32(fdt, fdt_node, "data-size");
+#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+   printf("FIT: Selected '%s'\n", name);
+#endif
+
+   return len;
+   }
+
+#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+   printf("No matching DT out of these options:\n");
+   for (node = fdt_first_subnode(fdt, conf);
+node >= 0;
+node = fdt_next_subnode(fdt, node)) {
+   name = fdt_getprop(fdt, node, "name", &len);
+   printf("   %s\n", name);
+   }
+#endif
+
+   return -ENOENT;
+}
+
+int spl_load_simple_fit(struct spl_load_info *info, ulong sector, void *fit)
+{
+   int sectors;
+   ulong size, load;
+   unsigned long count;
+   int node, images;
+   void *load_ptr;
+   int fdt_offset, fdt_len;
+   int data_offset, data_size;
+   int base_offset;
+   int src_sector;
+   void *dst;
+
+   /*
+* Figure out where the external images start. This is the base for the
+* data-offset properties in each image.
+*/
+   size = fdt_totalsize(fit);
+   size = (size + 3)

Re: [U-Boot] [PATCH 1/2] dfu: usb: f_dfu: Set deferred call for dfu_flush() function

2016-01-28 Thread Stephen Warren

On 01/28/2016 09:46 AM, Lukasz Majewski wrote:

This patch fixes situation when one would like to write large file into
medium with the file system (fat, ext4, etc).
This change sets file size limitation to the DFU internal buffer size.


Tested-by: Stephen Warren 

I tested this on NVIDIA's Jetson TX1 using test/py's test_dfu, with 
existing transfer sizes (63 bytes ... 8MB) rather than attempting to do 
anything with large files.

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


[U-Boot] Pull request, u-boot-tegra/master

2016-01-28 Thread Tom Warren
Tom,

Please pull u-boot-tegra/master into U-Boot/master. Thanks!

All tegra builds are OK (32-bit and 64-bit).

The following changes since commit b20c38a973a51bf3f663bd298c63ad1b8e0de445:

  arm: mvebu: Add support for the Armada XP theadorable board (2016-01-27
07:45:43 +0100)

are available in the git repository at:

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

for you to fetch changes up to 7fb82986be6252acf5aa05ac1ba7225548134a18:

  ARM: tegra: rm Jetson TK1 PMIC GPIO programming (2016-01-28 10:32:31
-0700)


Stephen Warren (1):
  ARM: tegra: rm Jetson TK1 PMIC GPIO programming

 board/nvidia/jetson-tk1/jetson-tk1.c | 13 -
 1 file changed, 13 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 01/15] armv8: ls2080: Add SFP Configs for LS2080/LS2085

2016-01-28 Thread york sun
On 01/28/2016 05:22 AM, Saksham Jain wrote:
> In LS2080/LS2085, SFP is LE and Ver is 3.4
> The base address is 0x01e80200
> SFP will be used in Secure Boot to read fuses.
> Signed-off-by: Aneesh Bansal 
> Signed-off-by: Saksham Jain 
> ---

Please insert a blank line before your signature for future patches.

York


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


Re: [U-Boot] [PATCH] ARM: tegra: rm Jetson TK1 PMIC GPIO programming

2016-01-28 Thread Tom Warren
OK. I was waiting to see if Simon's dm display driver changes would go in via 
the Tegra repo (they apply / build OK now, but I've had no time for testing).

With the merge window closing, I'll send a PR with just this fix. Thanks.

Tom

> -Original Message-
> From: Stephen Warren [mailto:swar...@wwwdotorg.org]
> Sent: Thursday, January 28, 2016 10:11 AM
> To: Tom Warren 
> Cc: u-boot@lists.denx.de; Simon Glass ; Stephen Warren
> ; Thierry Reding 
> Subject: Re: [PATCH] ARM: tegra: rm Jetson TK1 PMIC GPIO programming
> 
> On 01/18/2016 12:16 PM, Tom Warren wrote:
> > Stephen Warren wrotea tMonday, January 18, 2016 11:23 AM:
> >> The PMIC is configured such that its GPIOs have the correct
> >> configuration at power-up, so no programming is required.
> >>
> >> In fact, the current programming is actively wrong, since:
> >>
> >> (a) the AS3722 driver configures the GPIO to be an output before
> >> setting its output value, which causes a 0v glitch on the output.
> >>
> >> (b) the AS3722 driver configures the GPIO to drive a high voltage
> >> from its VSUP_GPIO power source rather than its VDD_GPIO_LV power
> >> source, so the pin drives 5V not 1.8V as desired.
> >>
> >> Solve these problems by removing the code which configures the PMIC
> GPIOs.
> >>
> >> Note that this patch was tested directly on top of v2016.01; since
> >> then, commit
> >> 96350f729c42 "dm: tegra: net: Convert tegra boards to driver model
> >> for Ethernet" prevents PCIe from being initialized. Alternatively,
> >> simply revert that commit to get PCIe Ethernet working again, then apply
> this patch to test.
> >>
> > Acked-by: Tom Warren  I'll apply this to
> > u-boot-tegra/next ASAP.
> 
> I don't see this patch there yet. It'd be good to get it pulled upstream ASAP
> since the merge window for v2016.03 closes this weekend.
---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Olinuxino A13 NAND boot (Sunxi)

2016-01-28 Thread Kevin Kowalewski
Hi,

I've been trying for a few days now to get u-boot loaded onto NAND and
actually booting here on my Olinuxino A13 which is an Allwinner CPU so the
sunxi side of things. I've had no such luck using the 2016-01 RC2 nor the
CHIP u-Boot branch, which is based off the the R8. My understanding is SPL
replaces boot0 / boot1 for Allwinner/sunxi boards.

The board uses 8K page sizes with 640 B OOB. ECC Strength is reported
online as 1024/40 and I've changed the dts to match as there are a few
floating around online for the A13.

There are 3 ways I've tried to get u-boot with SPL loading from NAND and
none of them have been successful.

1. Use the same fel write script that CHIP uses. With their pre-compiled
uBoot and my dts nand is visible and writable by uBoot for both write and
write.raw. Theirs separate the sunxi-spl and uboot and flashes it to
different locations.
2. Use 2016-01 RC2 compiled with the a13 dts with the added nand entry.
Flash the whole u-boot-sunxi-with-spl.bin to the beginning of nand. The
size lined up with 8K pages so no padding was needed (or so I assume). For
some reason the write locks up when trying to write something large than
~100K or so...
3. Boot buildroot and use mtd_debug erase & nandwrite to write the
u-boot-sunxi-with-spl.bin to the beginning of NAND.

I saw this post: http://lists.denx.de/pipermail/u-boot/2015-May/214959.html
about someone trying something similar, but I find it strange none of my
images work.

Adding the chip to the nand_ids.c file, just enabled ONFI, without it
u-Boot claims the ONFI header can't be found, doesn't seem like a big deal.

Any help would be greatly appreciated.

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


[U-Boot] [PATCH 06/26] mkimage: Make 'params' static

2016-01-28 Thread Simon Glass
This is not used outside mkimage.c, so make this variable static.

Signed-off-by: Simon Glass 
---

 tools/mkimage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/mkimage.c b/tools/mkimage.c
index 5aae748..b8293f6 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -15,7 +15,7 @@
 static void copy_file(int, const char *, int);
 
 /* parameters initialized by core will be used by the image type code */
-struct image_tool_params params = {
+static struct image_tool_params params = {
.os = IH_OS_LINUX,
.arch = IH_ARCH_PPC,
.type = IH_TYPE_KERNEL,
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH 2/2] dfu: odroid xu3: Define DFU_MANIFEST_POLL_TIMEOUT to handle large files transmission and storage

2016-01-28 Thread Lukasz Majewski
As tested on the Odroid XU3, large files to be stored on the file system
require considerable time to be physically written to the medium.

The default 300 ms is not enough to store large file (e.g. 26 MiB).
To fix this situation the DFU_MANIFEST_POLL_TIMEOUT has been defined.

It is used to cease the communication with dfu-util and allow the target
board to store the data on file system.

Signed-off-by: Lukasz Majewski 
---
 include/configs/odroid_xu3.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/odroid_xu3.h b/include/configs/odroid_xu3.h
index 648e48b..500f0f9 100644
--- a/include/configs/odroid_xu3.h
+++ b/include/configs/odroid_xu3.h
@@ -69,6 +69,7 @@
 #define CONFIG_CMD_DFU
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE   SZ_32M
 #define DFU_DEFAULT_POLL_TIMEOUT   300
+#define DFU_MANIFEST_POLL_TIMEOUT   25000
 
 /* THOR */
 #define CONFIG_G_DNL_THOR_VENDOR_NUM   CONFIG_G_DNL_VENDOR_NUM
-- 
2.0.0.rc2

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


[U-Boot] [PATCH 1/2] dfu: usb: f_dfu: Set deferred call for dfu_flush() function

2016-01-28 Thread Lukasz Majewski
This patch fixes situation when one would like to write large file into
medium with the file system (fat, ext4, etc).
This change sets file size limitation to the DFU internal buffer size.

Since u-boot is not supporting interrupts and seek on file systems, it
becomes challenging to store large file appropriately.

To reproduce this error - create large file (around 26 MiB) and sent it
to the target board.

Lets examine the flow of USB transactions:

0. DFU uses EP0 with 64B MPS [Max Packet Size]

1. Send file - OUT (PC->target) - dat_26MiB.img is sent with 4096 B transactions

2. Get status - OUT (PC->target) - wait for DFU_STATE_dfuDNLOAD_IDLE (0x05) sent
   from target board - IN transaction
   (target->PC)

3. The whole file content is sent to target - OUT (PC->target) with ZLP [Zero
  Length Packet]

Now the interesting part starts:

4. OUT (PC->target) Setup transaction (request to share DFU state)

5. IN (target->PC) - reply the current DFU state
- In the UDC driver the req->completion (with dfu_flush) is called
  after successful IN transfer.
- The dfu_flush() (called from req->completion callback) saves the
  whole file at once (u-boot doesn't support seek on fs).
  Such operation takes considerable time. When the file
  is large - e.g. 26MiB - this time may be more than 5 seconds.

6. OUT (PC->target) - ZLP, is send in the same time when dfu_flush()
 writes data to eMMC memory.
 The dfu-util application has hard coded timeout on USB transaction
 completion set to 5 seconds (it uses libusb calls).

When the file to store is large (e.g. 26 MiB) the time needed to write it
may excess the dfu-util timeout and following error message will be displayed:
"unable to read DFU status" on the HOST PC console.

This change is supposed to leverage DFU's part responsible for storing files
on file systems. Other DFU operations - i.e. raw/partition write to NAND and
eMMC should work as before.

The only functional change is the error reporting. When dfu_flush() fails
the u-boot prompt will exit with error information and dfu-util application
exits afterwards as well.

Test HW:
- Odroid XU3 (Exynos5433) - test with large file
- Trats (Exynos4210) - test for regression - eMMC, raw,

Signed-off-by: Lukasz Majewski 
Reported-by: Alex Gdalevich 
---
 common/cmd_dfu.c   | 20 
 drivers/usb/gadget/f_dfu.c | 11 +++
 include/dfu.h  | 25 +
 3 files changed, 48 insertions(+), 8 deletions(-)

diff --git a/common/cmd_dfu.c b/common/cmd_dfu.c
index 6d95ce9..d8aae26 100644
--- a/common/cmd_dfu.c
+++ b/common/cmd_dfu.c
@@ -79,6 +79,26 @@ static int do_dfu(cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
if (ctrlc())
goto exit;
 
+   if (dfu_get_defer_flush()) {
+   /*
+* Call to usb_gadget_handle_interrupts() is necessary
+* to act on ZLP OUT transaction from HOST PC after
+* transmitting the whole file.
+*
+* If this ZLP OUT packet is NAK'ed, the HOST libusb
+* function fails after timeout (by default it is set to
+* 5 seconds). In such situation the dfu-util program
+* exits with error message.
+*/
+   usb_gadget_handle_interrupts(controller_index);
+   ret = dfu_flush(dfu_get_defer_flush(), NULL, 0, 0);
+   dfu_set_defer_flush(NULL);
+   if (ret) {
+   error("Deferred dfu_flush() failed!");
+   goto exit;
+   }
+   }
+
WATCHDOG_RESET();
usb_gadget_handle_interrupts(controller_index);
}
diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
index 77a1567..7d88008 100644
--- a/drivers/usb/gadget/f_dfu.c
+++ b/drivers/usb/gadget/f_dfu.c
@@ -44,6 +44,8 @@ struct f_dfu {
unsigned intpoll_timeout;
 };
 
+struct dfu_entity *dfu_defer_flush;
+
 typedef int (*dfu_state_fn) (struct f_dfu *,
 const struct usb_ctrlrequest *,
 struct usb_gadget *,
@@ -167,14 +169,7 @@ static void dnload_request_complete(struct usb_ep *ep, 
struct usb_request *req)
 static void dnload_request_flush(struct usb_ep *ep, struct usb_request *req)
 {
struct f_dfu *f_dfu = req->context;
-   int ret;
-
-   ret = dfu_flush(dfu_get_entity(f_dfu->altsetting), req->buf,
-   req->length, f_dfu->blk_seq_num);
-   if (ret) {
-   f_dfu->dfu_status = DFU_STATUS_errUNKNOWN;
-   f_dfu->dfu_state

[U-Boot] [PATCH 0/2] dfu: samsung: Commits to allow sending and storing large files via DFU

2016-01-28 Thread Lukasz Majewski
Those commits allow sending and storing large files (e.g. 26 MiB) on the Odroid 
XU3 board.

On purpose they are sent together to shed light on the process of tunning board 
to
be capable of large files transfer.

I would be _REALLY_ grateful for excessive testing, since I'm not able to test 
this code
on NAND based devices. Please support me and test this patch for potential 
regressions.

This change applies on the u-boot-master tree.
SHA1: aada3d062a0cacde1e783af2ac560f2a0fdf3682

Lukasz Majewski (2):
  dfu: usb: f_dfu: Set deferred call for dfu_flush() function
  dfu: odroid xu3: Define DFU_MANIFEST_POLL_TIMEOUT to handle large
files transmission and storage

 common/cmd_dfu.c | 20 
 drivers/usb/gadget/f_dfu.c   | 11 +++
 include/configs/odroid_xu3.h |  1 +
 include/dfu.h| 25 +
 4 files changed, 49 insertions(+), 8 deletions(-)

-- 
2.0.0.rc2

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


[U-Boot] [PATCH 22/26] spl: Add a way for boards to select which device tree to load

2016-01-28 Thread Simon Glass
SPL calls this function with each device tree it can find in the FIT. The
board should implement this function, using whatever hardware detection it
can muster to determine the correct device tree.

Signed-off-by: Simon Glass 
---

 include/image.h | 13 +
 1 file changed, 13 insertions(+)

diff --git a/include/image.h b/include/image.h
index fa201d7..922104d 100644
--- a/include/image.h
+++ b/include/image.h
@@ -1155,4 +1155,17 @@ ulong android_image_get_kload(const struct andr_img_hdr 
*hdr);
 
 #endif /* CONFIG_ANDROID_BOOT_IMAGE */
 
+/**
+ * board_fit_config_name_match() - Check for a matching board name
+ *
+ * This is used when SPL loads a FIT containing multiple device tree files
+ * and wants to work out which one to use. The description of each one is
+ * passed to this function. The description comes from the 'description' field
+ * in each (FDT) image node.
+ *
+ * @name: Device tree description
+ * @return 0 if this device tree should be used, non-zero to try the next
+ */
+int board_fit_config_name_match(const char *name);
+
 #endif /* __IMAGE_H__ */
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH 17/26] image: Add functions to obtain short names

2016-01-28 Thread Simon Glass
Sometimes it is useful to obtain the short name for an Operating System,
architecture or compression mechanism. Provide functions for this.

Signed-off-by: Simon Glass 
---

 common/image.c  | 26 ++
 include/image.h | 27 +++
 2 files changed, 49 insertions(+), 4 deletions(-)

diff --git a/common/image.c b/common/image.c
index fad31b2..e72a979 100644
--- a/common/image.c
+++ b/common/image.c
@@ -603,11 +603,9 @@ const char *genimg_get_type_name(uint8_t type)
return (get_table_entry_name(uimage_type, "Unknown Image", type));
 }
 
-const char *genimg_get_type_short_name(uint8_t type)
+static const char *genimg_get_short_name(const table_entry_t *table, int val)
 {
-   const table_entry_t *table;
-
-   table = get_table_entry(uimage_type, type);
+   table = get_table_entry(table, val);
if (!table)
return "unknown";
 #if defined(USE_HOSTCC) || !defined(CONFIG_NEEDS_MANUAL_RELOC)
@@ -617,12 +615,32 @@ const char *genimg_get_type_short_name(uint8_t type)
 #endif
 }
 
+const char *genimg_get_type_short_name(uint8_t type)
+{
+   return genimg_get_short_name(uimage_type, type);
+}
+
 const char *genimg_get_comp_name(uint8_t comp)
 {
return (get_table_entry_name(uimage_comp, "Unknown Compression",
comp));
 }
 
+const char *genimg_get_comp_short_name(uint8_t comp)
+{
+   return genimg_get_short_name(uimage_comp, comp);
+}
+
+const char *genimg_get_os_short_name(uint8_t os)
+{
+   return genimg_get_short_name(uimage_os, os);
+}
+
+const char *genimg_get_arch_short_name(uint8_t arch)
+{
+   return genimg_get_short_name(uimage_arch, arch);
+}
+
 /**
  * get_table_entry_id - translate short entry name to id
  * @table: pointer to a translation table for entries of a specific type
diff --git a/include/image.h b/include/image.h
index 9eb3616..fa201d7 100644
--- a/include/image.h
+++ b/include/image.h
@@ -414,7 +414,25 @@ int get_table_entry_id(const table_entry_t *table,
 char *get_table_entry_name(const table_entry_t *table, char *msg, int id);
 
 const char *genimg_get_os_name(uint8_t os);
+
+/**
+ * genimg_get_os_short_name() - get the short name for an OS
+ *
+ * @param os   OS (IH_OS_...)
+ * @return OS short name, or "unknown" if unknown
+ */
+const char *genimg_get_os_short_name(uint8_t comp);
+
 const char *genimg_get_arch_name(uint8_t arch);
+
+/**
+ * genimg_get_arch_short_name() - get the short name for an architecture
+ *
+ * @param arch Architecture type (IH_ARCH_...)
+ * @return architecture short name, or "unknown" if unknown
+ */
+const char *genimg_get_arch_short_name(uint8_t arch);
+
 const char *genimg_get_type_name(uint8_t type);
 
 /**
@@ -426,6 +444,15 @@ const char *genimg_get_type_name(uint8_t type);
 const char *genimg_get_type_short_name(uint8_t type);
 
 const char *genimg_get_comp_name(uint8_t comp);
+
+/**
+ * genimg_get_comp_short_name() - get the short name for a compression method
+ *
+ * @param comp compression method (IH_COMP_...)
+ * @return compression method short name, or "unknown" if unknown
+ */
+const char *genimg_get_comp_short_name(uint8_t comp);
+
 int genimg_get_os_id(const char *name);
 int genimg_get_arch_id(const char *name);
 int genimg_get_type_id(const char *name);
-- 
2.7.0.rc3.207.g0ac5344

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


  1   2   3   >