Re: [U-Boot] [PATCH] imx: serial: Wait for ongoing transmission to finish before serial reset

2017-10-09 Thread Łukasz Majewski

Hi Simon,


Hi Lukasz,

On 3 October 2017 at 03:16, Lukasz Majewski  wrote:

It may happen that the MXC serial IP block is performing some ongoing
transmission (started at e.g. board_init()) when the "initr_serial" is
called.

As a result the serial port IP block is reset, so transmitted data is
corrupted:

I2C:   ready
DRAM:  1 GiB
jSS('HH��SL_SDHC: 04 rev 0x0

This patch prevents from this situation, by waiting for transmission
complete bit set (UART Status Register 2 (UARTx_USR2), bit TXDC):

I2C:   ready
DRAM:  1 GiB
ID:unit type 0x4 rev 0x0

Signed-off-by: Lukasz Majewski 
---

  drivers/serial/serial_mxc.c | 7 +++
  1 file changed, 7 insertions(+)


Is it possible to use driver model to do this in a generic way for all
serial drivers? The pending() method allows you to check if there are
any characters in the output FIFO.


Please correct me if I'm wrong.

Do you mean to define pre_init() callback in serial-uclass.c file, which 
would utilize ->pending callback if available?


In that way we would have the generic facility for above check available 
on all platforms.





Regards,
Simon




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v1 2/3] disk: efi: correct the overlap check on GPT header and PTE

2017-10-09 Thread Łukasz Majewski

On 10/09/2017 09:47 AM, Patrick Delaunay wrote:

the partition starting at 0x4400 is refused with overlap error:
   $> gpt write mmc 0 "name=test,start=0x4400,size=0"
   Writing GPT: Partition overlap
   error!

even if the 0x4400 is the first available offset for LBA35 with default
value:
- MBR=LBA1
- GPT header=LBA2
- PTE= 32 LBAs (128 entry), 3 to 34

And the command to have one partition for all the disk failed also :
   $> gpt write mmc 0 "name=test,size=0"

After the patch :

   $> gpt write mmc 0 "name=test,size=0"
   Writing GPT: success!
   $> part list mmc 0

   Partition Map for MMC device 0  --   Partition Type: EFI

   Part Start LBA   End LBA Name
Attributes
Type GUID
Partition GUID
   10x0022  0x01ce9fde  "test"
attrs:  0x
type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
type:   data
guid:   b4b84b8a-04e3-4000-0036-aff5c9c495b1

And 0x22 = 34 LBA => offset = 0x4400 is accepted as expected



Reviewed-by: Łukasz Majewski 


Signed-off-by: Patrick Delaunay 
---

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

diff --git a/disk/part_efi.c b/disk/part_efi.c
index 0abf487..2992d9e 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -469,8 +469,8 @@ int gpt_fill_pte(struct blk_desc *dev_desc,
 * If our partition overlaps with either the GPT
 * header, or the partition entry, reject it.
 */
-   if (((start <= hdr_end && hdr_start <= (start + size)) ||
-(start <= pte_end && pte_start <= (start + size {
+   if (((start < hdr_end && hdr_start < (start + size)) ||
+(start < pte_end && pte_start < (start + size {
printf("Partition overlap\n");
return -1;
}




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH] imx: serial: Wait for ongoing transmission to finish before serial reset

2017-10-04 Thread Łukasz Majewski

HI Lothar,


Hi,

On Tue,  3 Oct 2017 11:16:45 +0200 Lukasz Majewski wrote:

It may happen that the MXC serial IP block is performing some ongoing
transmission (started at e.g. board_init()) when the "initr_serial" is
called.

As a result the serial port IP block is reset, so transmitted data is
corrupted:

I2C:   ready
DRAM:  1 GiB
jSS('HH��SL_SDHC: 04 rev 0x0

This patch prevents from this situation, by waiting for transmission
complete bit set (UART Status Register 2 (UARTx_USR2), bit TXDC):

I2C:   ready
DRAM:  1 GiB
ID:unit type 0x4 rev 0x0

Signed-off-by: Lukasz Majewski 
---

  drivers/serial/serial_mxc.c | 7 +++
  1 file changed, 7 insertions(+)

diff --git a/drivers/serial/serial_mxc.c b/drivers/serial/serial_mxc.c
index cce80a8..ef4eb12 100644
--- a/drivers/serial/serial_mxc.c
+++ b/drivers/serial/serial_mxc.c
@@ -141,6 +141,13 @@ struct mxc_uart {
  
  static void _mxc_serial_init(struct mxc_uart *base)

  {
+   /*
+* Wait for any ongoing transmission to finish - for example
+* from pre-relocation enabled UART
+*/
+   while (!(readl(&base->sr2) & USR2_TXDC))
+   ;
+


Loops that poll for HW activated bits should always have a timeout.
Hardware will definitely break some day and deliver unexpected results.
Software should cope with this as best as it can!


In principle yes.

Please find below rationale for this patch:

1. According to imx6q this bit shows emptiness of TxFIFO and Shift 
register [1]. It seems like a purely HW controlled bit.


2. Having timeout here would require first initialization of timer. 
However, this code is also used in a very early console initialization.


3. In Linux kernel [2] the same check is performed with:

while (!(readl(sport->port.membase + USR2) & USR2_TXDC))
barrier();


[1] - Transmitter Complete. Indicates that the transmit buffer (TxFIFO) 
and Shift Register is empty; therefore
the transmission is complete. TXDC is cleared automatically when data is 
written to the TxFIFO.


[2] - 
http://elixir.free-electrons.com/linux/v4.2/source/drivers/tty/serial/imx.c#L1379





Lothar Waßmann




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH] Kconfig: BOOTCOMMAND: Define default set of boot commands in Kconfig

2017-10-02 Thread Łukasz Majewski

On 10/01/2017 02:41 AM, Tom Rini wrote:

On Sat, Sep 30, 2017 at 10:20:47PM +0200, Łukasz Majewski wrote:

On 09/14/2017 04:55 PM, Tom Rini wrote:

On Mon, Sep 11, 2017 at 10:53:51PM +0200, Łukasz Majewski wrote:

On 09/11/2017 07:31 PM, Tom Rini wrote:

On Sun, Sep 10, 2017 at 08:25:02PM +0200, Lukasz Majewski wrote:


This patch gives an opportunity to override the defined CONFIG_BOOTCOMMAND
(at  files) with set of commands defined in
board _defconfig file.

Rationale: This change allows having two different u-boot builds - one for
production and one (far more larger) for factory setup.

Signed-off-by: Lukasz Majewski 


I don't get it, sorry.  We need to move CONFIG_BOOTCOMMAND into Kconfig
with some other logic so that distro_bootcmd stuff works.



The state of the art:
-

Many boards use CONFIG_BOOTCOMMAND as a set of commands to be
executed at boot time:

bootcmd=CONFIG_BOOTCOMMAND

One notable user of it is config_distro_bootcmd.h


Right.


Rationale:
--

With this patch I can:

1. Setup one set of commands to be executed by default - e.g.:

bootcmd="run boot_mmc"

and

2. Have other defconfig - e.g. _factory_defconfig, which
enables some extra stuff (like USB, gadget, gpt write, etc) and is
used solely for factory flashing.

By having the opportunity to override CONFIG_BOOTCOMMAND in Kconfig,
I can use the same code base and just adjust Kconfig for board.


What do you mean by "some other logic"?


Well, CONFIG_BOOTCOMMAND needs to be moved to Kconfig itself.  Figuring
out some of the "how" will take a little work.  And a little
re-organization.  But that needs doing.



Cannot we start with the approach proposed by this commit?

How would you see the rework done?


I'd like to see something that tries to move CONFIG_BOOTCOMMAND around.
Move the distro boot things into include/environment/ and use the
post-processed command as value in configs/*_defconfig as fits, or put
things into something else in include/environment/ for other repeated
but not distro boot commands.



The proposed above changes are orthogonal to this patch.

This patch _only_ gives the opportunity to override current BOOTCOMMAND 
settings.
This functionality allows the same code base for two distinct u-boot 
builds - namely factory (for flashing) and production one.


Such approach is very convenient with OE builds.

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] fsl_esdhc driver is broken with DM

2017-10-01 Thread Łukasz Majewski

Hi Fabio,


Hi Tom,

On Sun, Oct 1, 2017 at 11:49 AM, Tom Rini  wrote:


Same regression is observed with mx7dsabresd board as well.


It's likely to be all i.MX :(


Only the i.MX configs with CONFIG_DM_MMC=y.


Yes, I can confirm this.

I'm using SPL + imx_usb (and boot to eMMC) on my imx6q boards and both work.

However, I'm not using the DM for eMMC (# CONFIG_DM_MMC is not set).




Have all of the changes gone in such that an i.MX platform with SPL can
be non-interactively booted via imx_usb?  Not having my iMX platforms in
automated testing means that I always end up not testing them nearly
often enough.


Yes, Stefan's patches have been been applied and are in mainline now.

doc/README.sdp contains all the details to get imx_usb to load SPL + u-boot.img.

However, the two platforms I saw the issue does not use SPL.

Jagan,

I noticed that some of your i.MX boards do select CONFIG_DM_MMC=y.

Is MMC functional in U-Boot mainline on these targets?

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




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH] Kconfig: BOOTCOMMAND: Define default set of boot commands in Kconfig

2017-09-30 Thread Łukasz Majewski

On 09/14/2017 04:55 PM, Tom Rini wrote:

On Mon, Sep 11, 2017 at 10:53:51PM +0200, Łukasz Majewski wrote:

On 09/11/2017 07:31 PM, Tom Rini wrote:

On Sun, Sep 10, 2017 at 08:25:02PM +0200, Lukasz Majewski wrote:


This patch gives an opportunity to override the defined CONFIG_BOOTCOMMAND
(at  files) with set of commands defined in
board _defconfig file.

Rationale: This change allows having two different u-boot builds - one for
production and one (far more larger) for factory setup.

Signed-off-by: Lukasz Majewski 


I don't get it, sorry.  We need to move CONFIG_BOOTCOMMAND into Kconfig
with some other logic so that distro_bootcmd stuff works.



The state of the art:
-

Many boards use CONFIG_BOOTCOMMAND as a set of commands to be
executed at boot time:

bootcmd=CONFIG_BOOTCOMMAND

One notable user of it is config_distro_bootcmd.h


Right.


Rationale:
--

With this patch I can:

1. Setup one set of commands to be executed by default - e.g.:

bootcmd="run boot_mmc"

and

2. Have other defconfig - e.g. _factory_defconfig, which
enables some extra stuff (like USB, gadget, gpt write, etc) and is
used solely for factory flashing.

By having the opportunity to override CONFIG_BOOTCOMMAND in Kconfig,
I can use the same code base and just adjust Kconfig for board.


What do you mean by "some other logic"?


Well, CONFIG_BOOTCOMMAND needs to be moved to Kconfig itself.  Figuring
out some of the "how" will take a little work.  And a little
re-organization.  But that needs doing.



Cannot we start with the approach proposed by this commit?

How would you see the rework done?

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v3 4/7] armv8: ls1043ardb: Use static DDR setting for SPL boot

2017-09-29 Thread Łukasz Majewski

Hi York,


On 09/29/2017 12:44 AM, Łukasz Majewski wrote:

Hi York,


This board has soldered DDR chips. To reduce the SPL image size,
use static DDR setting instead of dynamic DDR driver.


I'm just wondering - since your board supports FIT in SPL, maybe it
would be good to have a binary blob with DDR RAM settings embedded into it?

Then you would be able to provide "hardcoded" SDRAM setup via it?
In this way it could be easily replaceable?



Lukasz,

It sounds reasonable but doesn't work for our platforms. The limitation
is the static RAM. In order to load anything, we need to have some
memory. Lacking of memory is the exact reason I have to use static DDR
setting. I have to make room for other drivers in SPL.


I rather thought about:

Creating FIT image with firmware property, in which you will have 1:1 
binary image for DDR controller registers (e.g. 256B).


Then you could store this image to non-volatile memory and read it from 
SPL (just copy values to registers).


In that way you would be able to switch different configurations for 
different memories (DDR2/DDR3/, 1066, 1333 MHz) without the need to 
replace u-boot/SPL.




York




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] Patman - Submitting to mailing list

2017-09-29 Thread Łukasz Majewski

On 09/28/2017 11:05 PM, Duncan Hare wrote:

Get the following message from running tools/patman/pathan.py
git: 'send-email' is not a git command. See 'git --help'.

What do I need to do? Duncan Hare

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



Maybe you don't have the git send-email installed?


--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v3 5/7] armv8: layerscape: Enable falcon boot

2017-09-29 Thread Łukasz Majewski
IG_SPL_BUILD */
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 79bd19a..1d7d4f3 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -215,8 +215,8 @@ void __asm_switch_ttbr(u64 new_ttbr);
   * @entry_point: kernel entry point
   * @es_flag: execution state flag, ES_TO_AARCH64 or ES_TO_AARCH32
   */
-void armv8_switch_to_el2(u64 args, u64 mach_nr, u64 fdt_addr,
-u64 arg4, u64 entry_point, u64 es_flag);
+void __noreturn armv8_switch_to_el2(u64 args, u64 mach_nr, u64 fdt_addr,
+   u64 arg4, u64 entry_point, u64 es_flag);
  /*
   * Switch from EL2 to EL1 for ARMv8
   *
diff --git a/arch/arm/lib/spl.c b/arch/arm/lib/spl.c
index 27d6682..ab5d227 100644
--- a/arch/arm/lib/spl.c
+++ b/arch/arm/lib/spl.c
@@ -7,6 +7,7 @@
   *
   * SPDX-License-Identifier:   GPL-2.0+
   */
+
  #include 
  #include 
  #include 
@@ -47,6 +48,15 @@ void __weak board_init_f(ulong dummy)
   * image.
   */
  #ifdef CONFIG_SPL_OS_BOOT
+#ifdef CONFIG_ARM64
+void __noreturn jump_to_image_linux(struct spl_image_info *spl_image)
+{
+   debug("Entering kernel arg pointer: 0x%p\n", spl_image->arg);
+   cleanup_before_linux();
+   armv8_switch_to_el2((u64)spl_image->arg, 0, 0, 0,
+   spl_image->entry_point, ES_TO_AARCH64);
+}
+#else
  void __noreturn jump_to_image_linux(struct spl_image_info *spl_image)
  {
unsigned long machid = 0x;
@@ -62,4 +72,5 @@ void __noreturn jump_to_image_linux(struct spl_image_info 
*spl_image)
cleanup_before_linux();
image_entry(0, machid, spl_image->arg);
  }
+#endif /* CONFIG_ARM64 */
  #endif



I can confirm that your changes already available in master branch work. 
I'm able to boot fitImage from SPL, with using falcon boot mode.


Reviewed-by: Łukasz Majewski 
Tested-by: Łukasz Majewski 

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v3 4/7] armv8: ls1043ardb: Use static DDR setting for SPL boot

2017-09-29 Thread Łukasz Majewski

Hi York,


This board has soldered DDR chips. To reduce the SPL image size,
use static DDR setting instead of dynamic DDR driver.


I'm just wondering - since your board supports FIT in SPL, maybe it 
would be good to have a binary blob with DDR RAM settings embedded into it?


Then you would be able to provide "hardcoded" SDRAM setup via it?
In this way it could be easily replaceable?



Signed-off-by: York Sun 

---

Changes in v3:
Minor cosmetic fix.

Changes in v2:
Drop checking secure boot in this patch after rebasing to latest mater.
Recent change in SPL makes the image size bigger.

  board/freescale/ls1043ardb/ddr.c | 46 +++
  board/freescale/ls1043ardb/ddr.h | 69 
  include/configs/ls1043ardb.h |  6 ++--
  3 files changed, 118 insertions(+), 3 deletions(-)

diff --git a/board/freescale/ls1043ardb/ddr.c b/board/freescale/ls1043ardb/ddr.c
index 354b864..fc0c1f6 100644
--- a/board/freescale/ls1043ardb/ddr.c
+++ b/board/freescale/ls1043ardb/ddr.c
@@ -169,18 +169,64 @@ int fsl_ddr_get_dimm_params(dimm_params_t *pdimm,
  
  	return 0;

  }
+#else
+
+phys_size_t fixed_sdram(void)
+{
+   int i;
+   char buf[32];
+   fsl_ddr_cfg_regs_t ddr_cfg_regs;
+   phys_size_t ddr_size;
+   ulong ddr_freq, ddr_freq_mhz;
+
+   ddr_freq = get_ddr_freq(0);
+   ddr_freq_mhz = ddr_freq / 100;
+
+   printf("Configuring DDR for %s MT/s data rate\n",
+  strmhz(buf, ddr_freq));
+
+   for (i = 0; fixed_ddr_parm_0[i].max_freq > 0; i++) {
+   if ((ddr_freq_mhz > fixed_ddr_parm_0[i].min_freq) &&
+   (ddr_freq_mhz <= fixed_ddr_parm_0[i].max_freq)) {
+   memcpy(&ddr_cfg_regs,
+  fixed_ddr_parm_0[i].ddr_settings,
+  sizeof(ddr_cfg_regs));
+   break;
+   }
+   }
+
+   if (fixed_ddr_parm_0[i].max_freq == 0)
+   panic("Unsupported DDR data rate %s MT/s data rate\n",
+ strmhz(buf, ddr_freq));
+
+   ddr_size = (phys_size_t)2048 * 1024 * 1024;
+   fsl_ddr_set_memctl_regs(&ddr_cfg_regs, 0, 0);
+
+   return ddr_size;
+}
  #endif
  
  int fsl_initdram(void)

  {
phys_size_t dram_size;
  
+#ifdef CONFIG_SYS_DDR_RAW_TIMING

  #if defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SPL)
puts("Initializing DDR\n");
dram_size = fsl_ddr_sdram();
  #else
dram_size =  fsl_ddr_sdram_size();
  #endif
+#else
+#if defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SPL)
+   puts("Initialzing DDR using fixed setting\n");
+   dram_size = fixed_sdram();
+#else
+   gd->ram_size = 0x8000;
+
+   return 0;
+#endif
+#endif
erratum_a008850_post();
  
  #ifdef CONFIG_FSL_DEEP_SLEEP

diff --git a/board/freescale/ls1043ardb/ddr.h b/board/freescale/ls1043ardb/ddr.h
index a77ddf3..6bc0eb6 100644
--- a/board/freescale/ls1043ardb/ddr.h
+++ b/board/freescale/ls1043ardb/ddr.h
@@ -45,4 +45,73 @@ static const struct board_specific_parameters *udimms[] = {
udimm0,
  };
  
+#ifndef CONFIG_SYS_DDR_RAW_TIMING

+fsl_ddr_cfg_regs_t ddr_cfg_regs_1600 = {
+   .cs[0].bnds = 0x007F,
+   .cs[1].bnds = 0,
+   .cs[2].bnds = 0,
+   .cs[3].bnds = 0,
+   .cs[0].config = 0x80040322,
+   .cs[0].config_2 = 0,
+   .cs[1].config = 0,
+   .cs[1].config_2 = 0,
+   .cs[2].config = 0,
+   .cs[3].config = 0,
+   .timing_cfg_3 = 0x010C1000,
+   .timing_cfg_0 = 0x91550018,
+   .timing_cfg_1 = 0xBBB48C42,
+   .timing_cfg_2 = 0x0048C111,
+   .ddr_sdram_cfg = 0xC50C0008,
+   .ddr_sdram_cfg_2 = 0x00401100,
+   .ddr_sdram_cfg_3 = 0,
+   .ddr_sdram_mode = 0x03010210,
+   .ddr_sdram_mode_2 = 0,
+   .ddr_sdram_mode_3 = 0x00010210,
+   .ddr_sdram_mode_4 = 0,
+   .ddr_sdram_mode_5 = 0x00010210,
+   .ddr_sdram_mode_6 = 0,
+   .ddr_sdram_mode_7 = 0x00010210,
+   .ddr_sdram_mode_8 = 0,
+   .ddr_sdram_mode_9 = 0x0500,
+   .ddr_sdram_mode_10 = 0x0400,
+   .ddr_sdram_mode_11 = 0x0400,
+   .ddr_sdram_mode_12 = 0x0400,
+   .ddr_sdram_mode_13 = 0x0400,
+   .ddr_sdram_mode_14 = 0x0400,
+   .ddr_sdram_mode_15 = 0x0400,
+   .ddr_sdram_mode_16 = 0x0400,
+   .ddr_sdram_interval = 0x18600618,
+   .ddr_data_init = 0xDEADBEEF,
+   .ddr_sdram_clk_cntl = 0x0300,
+   .ddr_init_addr = 0,
+   .ddr_init_ext_addr = 0,
+   .timing_cfg_4 = 0x0002,
+   .timing_cfg_5 = 0x03401400,
+   .timing_cfg_6 = 0,
+   .timing_cfg_7 = 0x1330,
+   .timing_cfg_8 = 0x02115600,
+   .timing_cfg_9 = 0,
+   .ddr_zq_cntl = 0x8A090705,
+   .ddr_wrlvl_cntl = 0x8675F607,
+   .ddr_wrlvl_cntl_2 = 0x07090800,
+   .ddr_wrlvl_cntl_3 = 0,
+   .ddr_sr_cntr = 0,
+   .ddr_sdram_rcw_1 = 0,
+   .ddr_sdram_rcw_2 = 0,
+   .ddr_cdr1 = 0x8004,
+   .ddr_cdr2

Re: [U-Boot] [PATCH v2] sf: bar: Clean BA24 Bank Address Register bit after read/write/erase operation

2017-09-27 Thread Łukasz Majewski

On 09/27/2017 10:04 AM, Jagan Teki wrote:

On Mon, Sep 25, 2017 at 4:10 PM, Lukasz Majewski  wrote:

The content of Bank Address Register (BAR) is volatile. It is cleared
after power cycle or reset command (RESET F0h).

Some memories (like e.g. s25fl256s) use it to access memory larger than
0x100 (16 MiB).

The problem shows up when one:

1. Reads/writes/erases memory > 16 MiB
2. Calls "reset" u-boot command (which is not causing BAR to be cleared)

In the above scenario, the SoC ROM sends 0x00 address to read SPL.
Unfortunately, the BA24 bit is still set and hence it receives content
from 0x100 (16 MiB) memory address.
As a result the SoC aborts and we hang. Only power cycle can take the
SoC out of this state.

How to reproduce/test:

sf probe; sf erase 0x120 0x80; reset
sf probe; sf erase 0x120 0x80; sf write 0x1100 0x120 0x80; 
reset
sf probe; sf read 0x1100 0x120 0x80; reset

Signed-off-by: Lukasz Majewski 

---
Changes in v2:

- Rename cleanup_bar() to clean_bar()
- Rewrite in-code comments
---
  drivers/mtd/spi/spi_flash.c | 33 +
  1 file changed, 33 insertions(+)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 34f6888..5b3c974 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -113,6 +113,27 @@ static int write_cr(struct spi_flash *flash, u8 wc)
  #endif

  #ifdef CONFIG_SPI_FLASH_BAR
+/*
+ * This "cleanup" is necessary in a situation when one was accessing


Update cleanup with clean_bar

Applied to u-boot-spi/master


Thanks :-)



thanks!




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2] sf: bar: Clean BA24 Bank Address Register bit after read/write/erase operation

2017-09-27 Thread Łukasz Majewski

Hi Jagan,


On Tue, Sep 26, 2017 at 12:37 PM, Łukasz Majewski  wrote:

On 09/26/2017 07:40 AM, Jagan Teki wrote:


On Mon, Sep 25, 2017 at 4:10 PM, Lukasz Majewski  wrote:


The content of Bank Address Register (BAR) is volatile. It is cleared
after power cycle or reset command (RESET F0h).

Some memories (like e.g. s25fl256s) use it to access memory larger than
0x100 (16 MiB).

The problem shows up when one:

1. Reads/writes/erases memory > 16 MiB
2. Calls "reset" u-boot command (which is not causing BAR to be cleared)

In the above scenario, the SoC ROM sends 0x00 address to read SPL.
Unfortunately, the BA24 bit is still set and hence it receives content
from 0x100 (16 MiB) memory address.
As a result the SoC aborts and we hang. Only power cycle can take the
SoC out of this state.

How to reproduce/test:

sf probe; sf erase 0x120 0x80; reset
sf probe; sf erase 0x120 0x80; sf write 0x1100 0x120
0x80; reset
sf probe; sf read 0x1100 0x120 0x80; reset



Sorry, I didn't follow this test.. are you writing on at 18MiB offset
and doing reset how it will reproduce?



Please start with erase test case first.

The problem shows up when you try to access SPI-NOR memory > 16 MiB.
It works with current code, since BAR is adjusted properly.

Then after this access (without removing power), please type 'reset'
command.

You will observe, that the board will not boot (if SPI-NOR is a booting
device).

The problem is that ROM bootloader tries to access 0x0 address, but BA24 (in
the SPI-NOR controller)  is programmed from last operation (to 0x1). Hence,
the ROM Boot reads from 0x100 address.



because we can write it 0x0 and
after reset the ROM look for 16MiB on this flash this is what you
concern about right?


Yes, I understand ROM look at 16MiB, but the test-case you have erase
is from 18MiB right, it should be 0x0 on the test case right?


No it is correct.

The value 0x1200 must only be > 16 MiB. After accessing this 
location, the BA24 bit is set.


Then after "reset" the BA24 is still set and hence BOOT ROM reads from 
wrong address.




thanks!




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2] sf: bar: Clean BA24 Bank Address Register bit after read/write/erase operation

2017-09-26 Thread Łukasz Majewski

Hi Jagan,


On 09/26/2017 07:40 AM, Jagan Teki wrote:

On Mon, Sep 25, 2017 at 4:10 PM, Lukasz Majewski  wrote:

The content of Bank Address Register (BAR) is volatile. It is cleared
after power cycle or reset command (RESET F0h).

Some memories (like e.g. s25fl256s) use it to access memory larger than
0x100 (16 MiB).

The problem shows up when one:

1. Reads/writes/erases memory > 16 MiB
2. Calls "reset" u-boot command (which is not causing BAR to be cleared)

In the above scenario, the SoC ROM sends 0x00 address to read SPL.
Unfortunately, the BA24 bit is still set and hence it receives content
from 0x100 (16 MiB) memory address.
As a result the SoC aborts and we hang. Only power cycle can take the
SoC out of this state.

How to reproduce/test:

sf probe; sf erase 0x120 0x80; reset
sf probe; sf erase 0x120 0x80; sf write 0x1100 0x120 
0x80; reset

sf probe; sf read 0x1100 0x120 0x80; reset


Sorry, I didn't follow this test.. are you writing on at 18MiB offset
and doing reset how it will reproduce? 


Please start with erase test case first.

The problem shows up when you try to access SPI-NOR memory > 16 MiB.
It works with current code, since BAR is adjusted properly.

Then after this access (without removing power), please type 'reset' 
command.


You will observe, that the board will not boot (if SPI-NOR is a booting 
device).


The problem is that ROM bootloader tries to access 0x0 address, but BA24 
(in the SPI-NOR controller)  is programmed from last operation (to 0x1). 
Hence, the ROM Boot reads from 0x100 address.


And maybe some explanation why and how it was discovered.

I was storing in u-boot rootfs on SPI-NOR. This data crossed 16 MiB 
boundary on my Spansion memory.
After this operation I wanted to move forward with factory setup 
procedure and executed "reset".


The board hanged and I had to power cycle it to have it working again.





because we can write it 0x0 and
after reset the ROM look for 16MiB on this flash this is what you
concern about right?


The problem is with not clearing bit BA24 after each operation. This 
causes hangs after "reset" command.





thanks!







--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2] sf: bar: Clean BA24 Bank Address Register bit after read/write/erase operation

2017-09-26 Thread Łukasz Majewski

On 09/26/2017 07:40 AM, Jagan Teki wrote:

On Mon, Sep 25, 2017 at 4:10 PM, Lukasz Majewski  wrote:

The content of Bank Address Register (BAR) is volatile. It is cleared
after power cycle or reset command (RESET F0h).

Some memories (like e.g. s25fl256s) use it to access memory larger than
0x100 (16 MiB).

The problem shows up when one:

1. Reads/writes/erases memory > 16 MiB
2. Calls "reset" u-boot command (which is not causing BAR to be cleared)

In the above scenario, the SoC ROM sends 0x00 address to read SPL.
Unfortunately, the BA24 bit is still set and hence it receives content
from 0x100 (16 MiB) memory address.
As a result the SoC aborts and we hang. Only power cycle can take the
SoC out of this state.

How to reproduce/test:

sf probe; sf erase 0x120 0x80; reset
sf probe; sf erase 0x120 0x80; sf write 0x1100 0x120 0x80; 
reset
sf probe; sf read 0x1100 0x120 0x80; reset


Sorry, I didn't follow this test.. are you writing on at 18MiB offset
and doing reset how it will reproduce? 


Please start with erase test case first.

The problem shows up when you try to access SPI-NOR memory > 16 MiB.
It works with current code, since BAR is adjusted properly.

Then after this access (without removing power), please type 'reset' 
command.


You will observe, that the board will not boot (if SPI-NOR is a booting 
device).


The problem is that ROM bootloader tries to access 0x0 address, but BA24 
(in the SPI-NOR controller)  is programmed from last operation (to 0x1). 
Hence, the ROM Boot reads from 0x100 address.




because we can write it 0x0 and
after reset the ROM look for 16MiB on this flash this is what you
concern about right?


The problem is with not clearing bit BA24 after each operation. This 
causes hangs after "reset" command.





thanks!




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 5/7] armv8: layerscape: Eanble falcon boot

2017-09-25 Thread Łukasz Majewski

Hi York,

If you don't mind, I would like to ask you for some help and 
clarification regarding your work.



Add jump_to_image_linux() for arm64. Add "noreturn" flag to
armv8_switch_to_el2(). Add hooks to fsl-layerscape to enable falcon
boot.


I'm trying to do the same on imx6q board (armv7).



Signed-off-by: York Sun 

---

Changes in v2:
Relace getenv_f() with env_get_f() after rebasing to latet master.

  .../arm/cpu/armv8/fsl-layerscape/doc/README.falcon | 140 +
  arch/arm/cpu/armv8/fsl-layerscape/spl.c|  29 +
  arch/arm/include/asm/system.h  |   2 +-
  arch/arm/lib/spl.c |  11 ++
  4 files changed, 181 insertions(+), 1 deletion(-)
  create mode 100644 arch/arm/cpu/armv8/fsl-layerscape/doc/README.falcon

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/doc/README.falcon 
b/arch/arm/cpu/armv8/fsl-layerscape/doc/README.falcon
new file mode 100644
index 000..282b19f
--- /dev/null
+++ b/arch/arm/cpu/armv8/fsl-layerscape/doc/README.falcon
@@ -0,0 +1,140 @@
+Falcon boot option
+--
+Falcon boot is a short cut boot method for SD/eMMC targets. It skips loading 
the
+RAM version U-Boot. Instead, it loads FIT image and boot directly to Linux.
+CONFIG_SPL_OS_BOOT enables falcon boot. CONFIG_SPL_LOAD_FIT enables the FIT
	   ^^ - this is a bit cumbersome, since it requires some stub 
for dtb creation (but this can be fixed for boards not yet supporting 
dts u-boot configuration).



+image support (also need CONFIG_SPL_OF_LIBFDT, CONFIG_SPL_FIT and optionally
+CONFIG_SPL_GZIP).
+
+To enable falcon boot, a hook function spl_start_uboot() returns 0 to indicate
+booting U-Boot is not the first choice. The kernel FIT image needs to be put
+at CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR. SPL mmc driver reads the header to
+determine if this is a FIT image. If true, FIT image components are parsed and
+copied or decompressed (if applicable) to their desitinations. If FIT image is
+not found, normal U-Boot flow will follow.


This part is similar to the one for old, venerable uImage.


+
+An important part of falcon boot is to prepare the device tree. A normal U-Boot
+does FDT fixups when booting Linux. For falcon boot, Linux boots directly from
+SPL, skipping the normal U-Boot. The device tree has to be prepared in advance.
+A command "spl export" should be called under the normal RAM version U-Boot.
+It is equivalent to go through "bootm" step-by-step until device tree fixup is
+done. The device tree in memory is the one needed for falcon boot. Falcon boot
+flow suggests to save this image to SD/eMMC at the location pointed by macro
+CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR, with maximum size specified by macro
+CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS. However, when FIT image is used for
+Linux, the device tree stored in FIT image overwrites the memory loaded by spl
+driver from these sectors. We could change this loading order to favor the
+stored sectors. But when secure boot is enabled, these sectors are used for
+signature header and needs to be loaded before the FIT image. So it is 
important
+to understand the device tree in FIT image should be the one actually used, or
+leave it abscent to favor the stored sectors. It is easier to deploy the FIT
+image with embedded static device tree to multiple boards.
+
+Macro CONFIG_SYS_SPL_ARGS_ADDR serves two purposes. One is the pointer to load
+the stored sectors to. Normally this is the static device tree. The second
+purpose is the memory location of signature header for secure boot. After the
+FIT image is loaded into memory, it is validated against the signature header
+before individual components are extracted (and optionally decompressed) into
+their final memory locations, respectivelly. After the validation, the header
+is no longer used. The static device tree is copied into this location. So
+this macro is passed as the location of device tree when booting Linux.


I've not yet go to this point -> Please look into below comments.

I'm just curious - how can I specify the DTBs precedence? I mean how to 
decide if one from FIT or from eMMC sector are used?




+components. Otherwise U-Boot cannot load them correctly.
+
+Generate FIT image with static device tree
+--
+Example:
+
+/dts-v1/;


I'm trying to load fitImage (with kernel + 2 dtbs) from eMMC directly by 
SPL. The fitImage has been generated with OE-core recipe. The same 
results are with one generated with mkimage.



+
+/ {
+   description = "Image file for the LS1043A Linux Kernel";
+   #address-cells = <1>;
+
+   images {
+   kernel@1 {
+   description = "ARM64 Linux kernel";
+   data = /incbin/("./arch/arm64/boot/Image.gz");
+   type = "kernel";
+   arch = "arm64";
+   os = "linux";
+   compression = "gzip";
+   

Re: [U-Boot] [PATCH] sf: bar: Clean BA24 Bank Address Register bit after read/write/erase operation

2017-09-25 Thread Łukasz Majewski

Hi Jagan,


On Wed, Sep 13, 2017 at 3:09 PM, Lukasz Majewski  wrote:

The content of Bank Address Register (BAR) is volatile. It is cleared
after power cycle or reset command (RESET F0h).

Some memories (like e.g. s25fl256s) use it to access memory larger than
0x100 (16 MiB).

The problem shows up when one:

1. Reads/writes/erases memory > 16 MiB
2. Calls "reset" u-boot command (which is not causing BAR to be cleared)

In the above scenario, the SoC ROM sends 0x00 address to read SPL.
Unfortunately, the BA24 bit is still set and hence it receives content
from 0x100 memory address.
As a result the SoC aborts and we hang. Only power cycle can take the
SoC out of this state.

How to reproduce/test:

sf probe; sf erase 0x120 0x80; reset
sf probe; sf erase 0x120 0x80; sf write 0x1100 0x120 0x80; 
reset
sf probe; sf read 0x1100 0x120 0x80; reset

Signed-off-by: Lukasz Majewski 
---
  drivers/mtd/spi/spi_flash.c | 33 +
  1 file changed, 33 insertions(+)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 34f6888..d19d64a 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -113,6 +113,27 @@ static int write_cr(struct spi_flash *flash, u8 wc)
  #endif

  #ifdef CONFIG_SPI_FLASH_BAR
+/*
+ * This "cleanup" is necessary in a situation when one was accessing
+ * spi flash memory > 16 MiB by using Bank Address Register's BA24 bit.
+ *
+ * After it the BA24 bit shall be cleared to allow access to correct
+ * memory region after SW reset (by calling "reset" command).
+ *
+ * Otherwise, the BA24 bit may be left set and then after reset, the
+ * ROM would seek for SPL from 0x100, not 0x0.


This need to change, SPL will look 16 MiB * bank_sel


Ok. I will update the description.




+ */
+static int cleanup_bar(struct spi_flash *flash)


what about clear_bar?


Ok. I will change the name.



thanks!




--
Best regards,

Lukasz Majewski

--

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


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

2017-09-25 Thread Łukasz Majewski

Hi Jagan,


Hi Tom,

Please pull this PR.


Would you find some time and look into following patch:

http://patchwork.ozlabs.org/patch/813266/

Thanks in advance,
Łukasz



thanks!
Jagan.

The following changes since commit 1f6049e2501b5c35c61435dbc05ba96743202674:

   tools/mkimage: Make the path to the dtc binary that mkimage calls 
configurable (2017-09-24 07:33:03 -0400)

are available in the git repository at:

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

for you to fetch changes up to db10809c17c7cd8960d0c45248bbef6e76251ad7:

   Fix s25fl256s position in spi_flash_ids list (2017-09-25 13:00:34 +0530)


Marek Vasut (1):
   sf: Fix S25FL116K entry

Peng Fan (1):
   spi: mxc_spi: support driver model

Suresh Gupta (1):
   spi: fsl_qspi: Add controller busy check before new spi operation

Vsevolod Gribov (1):
   Fix s25fl256s position in spi_flash_ids list

Yogesh Gaur (1):
   mtd/spi: Add MT35XU512ABA1G12 NOR flash support

  drivers/mtd/spi/spi_flash_ids.c |   5 +-
  drivers/spi/fsl_qspi.c  |  28 ++-
  drivers/spi/fsl_qspi.h  |   4 +
  drivers/spi/mxc_spi.c   | 181 +---
  4 files changed, 183 insertions(+), 35 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH] GPT: fix memory leaks identified by Coverity

2017-09-25 Thread Łukasz Majewski

On 09/25/2017 02:37 AM, ali...@peloton-tech.com wrote:

From: Alison Chaiken 

Create a common exit for most of the error handling code in
do_rename_gpt_parts.   Delete the list elements in disk_partitions
before calling INIT_LIST_HEAD from get_gpt_info() a second time.

The SIZEOF_MISMATCH error is not addressed, since that problem was
already fixed by "GPT: incomplete initialization in
allocate_disk_part".

Signed-off-by: Alison Chaiken 
---
  cmd/gpt.c | 84 +--
  1 file changed, 66 insertions(+), 18 deletions(-)

diff --git a/cmd/gpt.c b/cmd/gpt.c
index d4406e3120..dfa41947e1 100644
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -633,6 +633,21 @@ static int do_disk_guid(struct blk_desc *dev_desc, char * 
const namestr)
  }
  
  #ifdef CONFIG_CMD_GPT_RENAME

+
+/* There are 3 malloc() calls in set_gpt_info() and there is no info about 
which
+ * failed.
+ */
+static void set_gpt_cleanup(char **str_disk_guid,
+   disk_partition_t **partitions)
+{
+#ifdef CONFIG_RANDOM_UUID
+   if (str_disk_guid)
+   free(str_disk_guid);
+#endif
+   if (partitions)
+   free(partitions);
+}
+
  static int do_rename_gpt_parts(struct blk_desc *dev_desc, char *subcomm,
   char *name1, char *name2)
  {
@@ -651,19 +666,26 @@ static int do_rename_gpt_parts(struct blk_desc *dev_desc, 
char *subcomm,
ret = get_disk_guid(dev_desc, disk_guid);
if (ret < 0)
return ret;
+   /* Allocates disk_partitions, requiring matching call to del_gpt_info()
+* if successful.
+*/
numparts = get_gpt_info(dev_desc);
if (numparts <=  0)
return numparts ? numparts : -ENODEV;
  
  	partlistlen = calc_parts_list_len(numparts);

partitions_list = malloc(partlistlen);
-   if (partitions_list == NULL)
+   if (!partitions_list) {
+   del_gpt_info();
return -ENOMEM;
+   }
memset(partitions_list, '\0', partlistlen);
  
  	ret = create_gpt_partitions_list(numparts, disk_guid, partitions_list);

-   if (ret < 0)
+   if (ret < 0) {
+   free(partitions_list);
return ret;
+   }
/*
 * Uncomment the following line to print a string that 'gpt write'
 * or 'gpt verify' will accept as input.
@@ -671,15 +693,23 @@ static int do_rename_gpt_parts(struct blk_desc *dev_desc, 
char *subcomm,
debug("OLD partitions_list is %s with %u chars\n", partitions_list,
  (unsigned)strlen(partitions_list));
  
+	/* set_gpt_info allocates new_partitions and str_disk_guid */

ret = set_gpt_info(dev_desc, partitions_list, &str_disk_guid,
   &new_partitions, &part_count);
-   if (ret < 0)
-   return ret;
+   if (ret < 0) {
+   del_gpt_info();
+   free(partitions_list);
+   if (ret == -ENOMEM)
+   set_gpt_cleanup(&str_disk_guid, &new_partitions);
+   else
+   goto out;
+   }
  
  	if (!strcmp(subcomm, "swap")) {

if ((strlen(name1) > PART_NAME_LEN) || (strlen(name2) > 
PART_NAME_LEN)) {
printf("Names longer than %d characters are 
truncated.\n", PART_NAME_LEN);
-   return -EINVAL;
+   ret = -EINVAL;
+   goto out;
}
list_for_each(pos, &disk_partitions) {
curr = list_entry(pos, struct disk_part, list);
@@ -693,21 +723,24 @@ static int do_rename_gpt_parts(struct blk_desc *dev_desc, 
char *subcomm,
}
if ((ctr1 + ctr2 < 2) || (ctr1 != ctr2)) {
printf("Cannot swap partition names except in 
pairs.\n");
-   return -EINVAL;
+   ret = -EINVAL;
+   goto out;
}
} else { /* rename */
if (strlen(name2) > PART_NAME_LEN) {
printf("Names longer than %d characters are 
truncated.\n", PART_NAME_LEN);
-   return -EINVAL;
+   ret = -EINVAL;
+   goto out;
}
partnum = (int)simple_strtol(name1, NULL, 10);
if ((partnum < 0) || (partnum > numparts)) {
printf("Illegal partition number %s\n", name1);
-   return -EINVAL;
+   ret = -EINVAL;
+   goto out;
}
ret = part_get_info(dev_desc, partnum, new_partitions);
if (ret < 0)
-   return ret;
+   goto out;
  
  		/* U-Boot partition numbering starts at 1 */

list_for_each(pos, &disk_partitions) {
@@ -722,33 +755,48 @@ static int do_rename_gpt_parts(struct blk_desc

Re: [U-Boot] Make Menuconfig Fails

2017-09-25 Thread Łukasz Majewski

Hi Duncan,


make menuconfig
   HOSTCC  scripts/kconfig/mconf.o
In file included from scripts/kconfig/mconf.c:23:0:
scripts/kconfig/lxdialog/dialog.h:26:20: fatal error: curses.h: No such file or 
directory
  #include CURSES_LOC


It seems like you are missing ncurses5-dev package.



Appears CURSES_LOC is undefined.
Thanks.
  Duncan Hare

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




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH 0/5] Follow the Linux Kernel in building dtc as needed

2017-09-24 Thread Łukasz Majewski

Hi Tom,


On Sun, Sep 24, 2017 at 06:50:01PM +0200, Marek Vasut wrote:

On 09/24/2017 04:26 PM, Tom Rini wrote:

The following series has been applied.  I am posting this for the record.

For the record, I do not believe that using git submodules is a good approach
here.  We have a small amount of code that we need here, and happily we can
leverage infrastructur e from the Linux Kernel.

Speaking of, this is not the first time we have run into problems deviating
from the workflow of the kernel.  The problems of having large number of
warnings, or not stemmed from not just leve raging all of the infrastructure
from the kernel.  So related, yes, fixes for these warnings should come in,
and as always, if they're in the upstream kernel dts as well, they should be
fixed there.


So any comments regarding bundling external tools were ignored, even
though the discussion was not finished, great.

Furthermore, there was zero time to review this series, it was just
applied and posted afterward ? What sort of practice is this ?


Yes.  I put on my slightly-less-than-benevolent dictator hat today, and


Linus style? :D Management


explained my reasoning.  I do feel bad that you're rather unhappy with
the overall situation, but no, I believe this is the right answer.

Now, there's some follow up further re-syncing with the kernel that
could be done (scripts/Makefile.lib/extrawarn can be further re-matched
up with the kernel now, but that would have made a larger delta than
"just migrate to providing the tool").



But seriously, do we have some kind of road map for this?

I mean if we have copied the dtc tool into u-boot temporarily (until 
distros catch up) or will it stay with us forever ?


--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] Makefile: Update minimum dtc version to 1.4.3

2017-09-24 Thread Łukasz Majewski

Hi Marek, Tom,


On 09/24/2017 01:36 PM, Tom Rini wrote:

On Sun, Sep 24, 2017 at 10:28:18AM +0200, Marek Vasut wrote:

On 09/24/2017 05:22 AM, Tom Rini wrote:

On Sat, Sep 23, 2017 at 09:07:02PM -0500, Robert Nelson wrote:

On Sat, Sep 23, 2017 at 8:49 PM, Bin Meng  wrote:

Hi Tom,

On Sun, Sep 24, 2017 at 12:10 AM, Tom Rini  wrote:

On Sat, Sep 23, 2017 at 03:04:39PM +0200, Marek Vasut wrote:

On 09/23/2017 02:56 PM, Tom Rini wrote:

On Sat, Sep 23, 2017 at 12:39:44PM +0200, Marek Vasut wrote:

On 09/22/2017 04:20 PM, Tom Rini wrote:

On Fri, Sep 15, 2017 at 01:15:25PM -0400, Tom Rini wrote:


With support for overlays and calling the -@ flag to dtc we need to have
at least 1.4.3 available now.

Cc: Simon Glass 
Reported-by: Stephen Warren 
Signed-off-by: Tom Rini 


Applied to u-boot/master, thanks!


Debian still only has 1.4.2 even in unstable, so u-boot/master no longer
builds on any debian system.


Then perhaps we need to mirror the kernel and provide / build dtc, but
allow for people to override it.


What about allowing old DTC version if DTOs are not in use ?


If you can re-work the logic for that, sure, thanks!



Ubuntu 16.04 LTS is still at dtc v1.4.0, so it's broken there too.


Maybe it's just time to embed a copy of dtc into u-boot (like the
kernel, especially since we use so many features...)?


That is my intention at this point, and I'm testing a small series to do
that now (the last pain point looks to have been the patch that allows
'DTC' to be over-ridden for FreeBSD).


cfr my comment about vendoring , I'd really hate to go down that path.
Chrome does that and look what came out of it -- outdated patched
packages in the chrome codebase, with debian trying hard to unbundle
that stuff again.


Yes, but we're going to do it all the same.  We're tied to some of the
tools we need and vendors aren't keeping pace with them either.  dtc
1.4.0 (Ubuntu 16.04) is from 2013.  dtc 1.4.3 is from last December.


The new DTC version is only mandated by DTO support, which is not used
by anyone to my knowledge at this point. Whoever wants to use DTO,
should have new enough DTC and I'm fine with the build failing if they
don't.

This heavy-handed approach of imposing custom DTC build on everyone
because of a feature noone uses is awful and I disagree with it. If
there is a version check for DTC for builds with and without DTO, fine,
I can live with that.

But bundling DTC only because of unused functionality, NAK.


And I plan on following the Linux Kernel model of just syncing only
directly with the upstream project.


See above, this is heavy-handed and IMO unnecessary. In fact, I hope the
kernel removes the DTC fork completely.



As a debian stable user (at almost all my machines) I would like to 
have the dtc 1.4.3 being used only for DTBO enabled.


Maybe, it would be possible to have such check added (and remove it when 
distros keep up with dtc version)?




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] Makefile: Update minimum dtc version to 1.4.3

2017-09-24 Thread Łukasz Majewski

On 09/24/2017 08:41 AM, Heinrich Schuchardt wrote:

On 09/23/2017 07:53 PM, Tom Rini wrote:

On Sat, Sep 23, 2017 at 07:43:09PM +0200, Marek Vasut wrote:

On 09/23/2017 07:37 PM, Tom Rini wrote:

On Sat, Sep 23, 2017 at 07:33:44PM +0200, Marek Vasut wrote:

On 09/23/2017 07:05 PM, Tom Rini wrote:

On Sat, Sep 23, 2017 at 08:56:08AM -0400, Tom Rini wrote:

On Sat, Sep 23, 2017 at 12:39:44PM +0200, Marek Vasut wrote:

On 09/22/2017 04:20 PM, Tom Rini wrote:

On Fri, Sep 15, 2017 at 01:15:25PM -0400, Tom Rini wrote:


With support for overlays and calling the -@ flag to dtc we need to have
at least 1.4.3 available now.

Cc: Simon Glass 
Reported-by: Stephen Warren 
Signed-off-by: Tom Rini 


Applied to u-boot/master, thanks!


Debian still only has 1.4.2 even in unstable, so u-boot/master no longer
builds on any debian system.


Then perhaps we need to mirror the kernel and provide / build dtc, but
allow for people to override it.


This isn't too hard and I'm pushing that through Jenkins now to confirm
I've got all the logic correct.  I think this will be the least error
prone method long term.


NAK, this is the same thing which chromium does and what Debian is
trying to stop -- vendoring. We will end up with patched custom DTC out
of sync with upstream.


Shrug, it's what Linux does, and what QEMU does, and probably what other
projects do as well since apparently even Debian/Unstable is 2 releases
and nearly a year behind (or, 9 months if you don't want to exaggerate).


And it will likely stay that way for debian stable. I am really
disappointed in the "Shrug" reaction to such massive breakage.


Nope and nor will it catch old-stable breaking in January when gcc-6.x
or newer is required.



Above you have been discussing code duplication. This is not the right
way to work with git.

The git way is to add
https://git.kernel.org/pub/scm/utils/dtc/dtc.git
as git submodule (https://git-scm.com/docs/git-submodule).

In our make file we can then use git submodule init, git submodule
update, git verify-tag before we build a dtc with the appropriate version.

This way we can build dtc from sources but stay in sync with the upstream.


+1



Regards

Heinrich

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




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH] sf: bar: Clean BA24 Bank Address Register bit after read/write/erase operation

2017-09-23 Thread Łukasz Majewski

Hi Fabio, Jagan,


Hi Lukasz,

On Wed, Sep 13, 2017 at 6:39 AM, Lukasz Majewski  wrote:


  #ifdef CONFIG_SPI_FLASH_BAR
+/*
+ * This "cleanup" is necessary in a situation when one was accessing
+ * spi flash memory > 16 MiB by using Bank Address Register's BA24 bit.
+ *
+ * After it the BA24 bit shall be cleared to allow access to correct
+ * memory region after SW reset (by calling "reset" command).
+ *
+ * Otherwise, the BA24 bit may be left set and then after reset, the
+ * ROM would seek for SPL from 0x100, not 0x0.
+ */
+static int cleanup_bar(struct spi_flash *flash)
+{
+   u8 cmd, bank_sel = 0;
+
+   if (flash->bank_curr == 0)
+   return 0;
+   cmd = flash->bank_write_cmd;
+
+   return spi_flash_write_common(flash, &cmd, 1, &bank_sel, 1);
+}
+


What about defining an empty stub for this function when
CONFIG_SPI_FLASH_BAR is not defined?


  static int write_bar(struct spi_flash *flash, u32 offset)
  {
 u8 cmd, bank_sel;
@@ -339,6 +360,10 @@ int spi_flash_cmd_erase_ops(struct spi_flash *flash, u32 
offset, size_t len)
 len -= erase_size;
 }

+#ifdef CONFIG_SPI_FLASH_BAR
+   ret = cleanup_bar(flash);
+#endif


Then you don't need to add the ifdefs when calling cleanup_bar().



Jagan, could you look into this patch?

I would prefer to keep the coding style similar to the one already 
present in this file.



--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [OE-core] [PATCH] u-boot: Upgrade to 2017.09

2017-09-18 Thread Łukasz Majewski

Hi Khem,


On Sun, Sep 17, 2017 at 2:18 AM, Martin Jansa  wrote:

Is anyone seeing u-boot-fw-utils.do_install failure with this?



I am seeing same failures too. havent yet dug into it.


Please pay note to change in directory structure in u-boot envs (from 
2017.09):


Now to build fw_printenv one needs to run:

do_compile () {
oe_runmake ${UBOOT_MACHINE}
oe_runmake envtools(<-  was env)
}

And Yes, I do agree with Marek, fw_printf is widely used on many, many 
boards .





u-boot-fw-utils/1_2017.09-r0/git/tools/env/fw_printenv: No such file or
directory

I've tried u-boot-fw-utils-cross, but it fails as well even sooner in
do_compile:

Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 32 ARCH=arm CC=gcc
-isystemwork/x86_64-linux/u-boot-fw-utils-cross/1_2017.09-r0/recipe-sysroot-native/usr/include
-O2 -pipe
-Lwork/x86_64-linux/u-boot-fw-utils-cross/1_2017.09-r0/recipe-sysroot-native/usr/lib
-Lwork/x86_64-linux/u-boot-fw-utils-cross/1_2017.09-r0/recipe-sysroot-native/lib
-Wl,-rpath-link,work/x86_64-linux/u-boot-fw-utils-cross/1_2017.09-r0/recipe-sysroot-native/usr/lib
-Wl,-rpath-link,work/x86_64-linux/u-boot-fw-utils-cross/1_2017.09-r0/recipe-sysroot-native/lib
-Wl,-rpath,work/x86_64-linux/u-boot-fw-utils-cross/1_2017.09-r0/recipe-sysroot-native/usr/lib
-Wl,-rpath,work/x86_64-linux/u-boot-fw-utils-cross/1_2017.09-r0/recipe-sysroot-native/lib
-Wl,-O1 V=1 rpi_3_32b_config
| make -f ./scripts/Makefile.build obj=scripts/basic
|   cc -Wp,-MD,scripts/basic/.fixdep.d -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer  -o scripts/basic/fixdep scripts/basic/fixdep.c
| /bin/sh: 1: cc: not found
| make[1]: *** [scripts/basic/fixdep] Error 127
| make: *** [scripts_basic] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at
work/x86_64-linux/u-boot-fw-utils-cross/1_2017.09-r0/temp/log.do_compile.12859)
ERROR: Task
(virtual:cross:oe-core/meta/recipes-bsp/u-boot/u-boot-fw-utils_2017.09.bb:do_compile)
failed with exit code '1'


On Mon, Sep 11, 2017 at 10:30 PM, Otavio Salvador 
wrote:


This upgrades the U-Boot to the 2017.09 release.

Signed-off-by: Otavio Salvador 
---

  .../u-boot/{u-boot-common_2017.07.inc => u-boot-common_2017.09.inc} |
2 +-
  .../u-boot/{u-boot-fw-utils_2017.07.bb => u-boot-fw-utils_2017.09.bb}   |
0
  .../u-boot/{u-boot-mkimage_2017.07.bb => u-boot-mkimage_2017.09.bb} |
0
  meta/recipes-bsp/u-boot/{u-boot_2017.07.bb => u-boot_2017.09.bb}|
0
  4 files changed, 1 insertion(+), 1 deletion(-)
  rename meta/recipes-bsp/u-boot/{u-boot-common_2017.07.inc =>
u-boot-common_2017.09.inc} (89%)
  rename meta/recipes-bsp/u-boot/{u-boot-fw-utils_2017.07.bb =>
u-boot-fw-utils_2017.09.bb} (100%)
  rename meta/recipes-bsp/u-boot/{u-boot-mkimage_2017.07.bb =>
u-boot-mkimage_2017.09.bb} (100%)
  rename meta/recipes-bsp/u-boot/{u-boot_2017.07.bb => u-boot_2017.09.bb}
(100%)

diff --git a/meta/recipes-bsp/u-boot/u-boot-common_2017.07.inc
b/meta/recipes-bsp/u-boot/u-boot-common_2017.09.inc
similarity index 89%
rename from meta/recipes-bsp/u-boot/u-boot-common_2017.07.inc
rename to meta/recipes-bsp/u-boot/u-boot-common_2017.09.inc
index e37f5fd409..02e51242cb 100644
--- a/meta/recipes-bsp/u-boot/u-boot-common_2017.07.inc
+++ b/meta/recipes-bsp/u-boot/u-boot-common_2017.09.inc
@@ -7,7 +7,7 @@ PE = "1"

  # We use the revision in order to avoid having to fetch it from the
  # repo during parse
-SRCREV = "d85ca029f257b53a96da6c2fb421e78a003a9943"
+SRCREV = "c98ac3487e413c71e5d36322ef3324b21c6f60f9"

  SRC_URI = "git://git.denx.de/u-boot.git \
  file://MPC8315ERDB-enable-DHCP.patch \
diff --git a/meta/recipes-bsp/u-boot/u-boot-fw-utils_2017.07.bb
b/meta/recipes-bsp/u-boot/u-boot-fw-utils_2017.09.bb
similarity index 100%
rename from meta/recipes-bsp/u-boot/u-boot-fw-utils_2017.07.bb
rename to meta/recipes-bsp/u-boot/u-boot-fw-utils_2017.09.bb
diff --git a/meta/recipes-bsp/u-boot/u-boot-mkimage_2017.07.bb
b/meta/recipes-bsp/u-boot/u-boot-mkimage_2017.09.bb
similarity index 100%
rename from meta/recipes-bsp/u-boot/u-boot-mkimage_2017.07.bb
rename to meta/recipes-bsp/u-boot/u-boot-mkimage_2017.09.bb
diff --git a/meta/recipes-bsp/u-boot/u-boot_2017.07.bb
b/meta/recipes-bsp/u-boot/u-boot_2017.09.bb
similarity index 100%
rename from meta/recipes-bsp/u-boot/u-boot_2017.07.bb
rename to meta/recipes-bsp/u-boot/u-boot_2017.09.bb
--
2.14.1

--
___
Openembedded-core mailing list
openembedded-c...@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core




--
___
Openembedded-core mailing list
openembedded-c...@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


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




--
Best regards,

Lukasz M

Re: [U-Boot] [PATCH] sf: bar: Clean BA24 Bank Address Register bit after read/write/erase operation

2017-09-13 Thread Łukasz Majewski

Hi Fabio,


Hi Lukasz,

On Wed, Sep 13, 2017 at 6:39 AM, Lukasz Majewski  wrote:


  #ifdef CONFIG_SPI_FLASH_BAR
+/*
+ * This "cleanup" is necessary in a situation when one was accessing
+ * spi flash memory > 16 MiB by using Bank Address Register's BA24 bit.
+ *
+ * After it the BA24 bit shall be cleared to allow access to correct
+ * memory region after SW reset (by calling "reset" command).
+ *
+ * Otherwise, the BA24 bit may be left set and then after reset, the
+ * ROM would seek for SPL from 0x100, not 0x0.
+ */
+static int cleanup_bar(struct spi_flash *flash)
+{
+   u8 cmd, bank_sel = 0;
+
+   if (flash->bank_curr == 0)
+   return 0;
+   cmd = flash->bank_write_cmd;
+
+   return spi_flash_write_common(flash, &cmd, 1, &bank_sel, 1);
+}
+


What about defining an empty stub for this function when
CONFIG_SPI_FLASH_BAR is not defined?


  static int write_bar(struct spi_flash *flash, u32 offset)
  {
 u8 cmd, bank_sel;
@@ -339,6 +360,10 @@ int spi_flash_cmd_erase_ops(struct spi_flash *flash, u32 
offset, size_t len)
 len -= erase_size;
 }

+#ifdef CONFIG_SPI_FLASH_BAR
+   ret = cleanup_bar(flash);
+#endif


Then you don't need to add the ifdefs when calling cleanup_bar().


I took the approach already used in this file, so I would prefer to 
leave it is in this patch (to be in sync with the rest).







--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH] fs/fat: fix fatbuf leak

2017-09-13 Thread Łukasz Majewski

On 09/12/2017 10:40 PM, Rob Clark wrote:

A new fatbuf was allocated by get_fs_info() (called by fat_itr_root()),
but not freed, resulting in eventually running out of memory.  Spotted
by running 'ls -r' in a large FAT filesystem from Shell.efi.

fatbuf is mainly used to cache FAT entry lookups (get_fatent())..
possibly once fat_write.c it can move into the iterator to simplify
this.

Signed-off-by: Rob Clark 
---
I can squash this back in to the earlier readdir patches and resend
them if that is preferred.

  fs/fat/fat.c | 23 ---
  1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index f5f74c12ff..f0284398b4 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -1042,6 +1042,7 @@ int fat_exists(const char *filename)
return 0;
  
  	ret = fat_itr_resolve(itr, filename, TYPE_ANY);

+   free(fsdata.fatbuf);
return ret == 0;
  }
  
@@ -1061,17 +1062,19 @@ int fat_size(const char *filename, loff_t *size)

 * Directories don't have size, but fs_size() is not
 * expected to fail if passed a directory path:
 */
+   free(fsdata.fatbuf);
fat_itr_root(itr, &fsdata);
if (!fat_itr_resolve(itr, filename, TYPE_DIR)) {
*size = 0;
-   return 0;
+   ret = 0;
}
-   return ret;
+   goto out;
}
  
  	*size = FAT2CPU32(itr->dent->size);

-
-   return 0;
+out:
+   free(fsdata.fatbuf);
+   return ret;
  }
  
  int file_fat_read_at(const char *filename, loff_t pos, void *buffer,

@@ -1087,10 +1090,14 @@ int file_fat_read_at(const char *filename, loff_t pos, 
void *buffer,
  
  	ret = fat_itr_resolve(itr, filename, TYPE_FILE);

if (ret)
-   return ret;
+   goto out;
  
  	printf("reading %s\n", filename);

-   return get_contents(&fsdata, itr->dent, pos, buffer, maxsize, actread);
+   ret = get_contents(&fsdata, itr->dent, pos, buffer, maxsize, actread);
+
+out:
+   free(fsdata.fatbuf);
+   return ret;
  }
  
  int file_fat_read(const char *filename, void *buffer, int maxsize)

@@ -1126,7 +1133,7 @@ typedef struct {
  
  int fat_opendir(const char *filename, struct fs_dir_stream **dirsp)

  {
-   fat_dir *dir = malloc(sizeof(*dir));
+   fat_dir *dir = calloc(1, sizeof(*dir));
int ret;
  
  	if (!dir)

@@ -1144,6 +1151,7 @@ int fat_opendir(const char *filename, struct 
fs_dir_stream **dirsp)
return 0;
  
  fail:

+   free(dir->fsdata.fatbuf);
free(dir);
return ret;
  }
@@ -1174,6 +1182,7 @@ int fat_readdir(struct fs_dir_stream *dirs, struct 
fs_dirent **dentp)
  void fat_closedir(struct fs_dir_stream *dirs)
  {
fat_dir *dir = (fat_dir *)dirs;
+   free(dir->fsdata.fatbuf);
    free(dir);
  }
  


Reviewed-by: Łukasz Majewski 

--
Best regards,

Lukasz Majewski

--

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


[U-Boot] [GIT] Pull request: u-boot-dfu

2017-09-13 Thread Łukasz Majewski

Dear Marek,

The following changes since commit d81a1de96e2636163783c342b8fda965e696e382:

  misc: Kconfig: Add SPL_I2C_EEPROM option (2017-09-11 22:44:30 -0400)

are available in the git repository at:

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

for you to fetch changes up to 9bfa5a43ed4faeda391be5015a0d9832701102ae:

  usb: dwc2: Align size of invalidating dcache before starting DMA 
(2017-09-13 12:54:14 +0200)



Eddie Cai (4):
  usb: rockchip: add the rockusb gadget
  usb: rockchip: add rockusb command
  rockchip:usb: add a simple readme for rockusb
  rockchip: rk3288: enable rockusb support on rk3288 based device

Seung-Woo Kim (1):
  usb: dwc2: Align size of invalidating dcache before starting DMA

 arch/arm/include/asm/arch-rockchip/f_rockusb.h | 132 
+++

 arch/arm/mach-rockchip/Kconfig |   2 +
 cmd/Kconfig|   9 +++
 cmd/Makefile   |   1 +
 cmd/rockusb.c  |  74 
 configs/chromebit_mickey_defconfig |   8 +++
 configs/chromebook_jerry_defconfig |   8 +++
 configs/chromebook_minnie_defconfig|   8 +++
 configs/evb-rk3288_defconfig   |  10 +++
 configs/fennec-rk3288_defconfig|   6 ++
 configs/firefly-rk3288_defconfig   |   6 ++
 configs/miqi-rk3288_defconfig  |   6 ++
 configs/phycore-rk3288_defconfig   |   7 ++
 configs/popmetal-rk3288_defconfig  |   6 ++
 configs/rock2_defconfig|   9 +++
 configs/tinker-rk3288_defconfig|   6 ++
 doc/README.rockusb |  51 ++
 drivers/usb/gadget/Kconfig |   8 +++
 drivers/usb/gadget/Makefile|   1 +
 drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c |   3 +-
 drivers/usb/gadget/f_rockusb.c | 691 


 include/configs/rk3288_common.h|  12 
 22 files changed, 1063 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/include/asm/arch-rockchip/f_rockusb.h
 create mode 100644 cmd/rockusb.c
 create mode 100644 doc/README.rockusb
 create mode 100644 drivers/usb/gadget/f_rockusb.c


Travis CI tested:

https://travis-ci.org/lmajewski/u-boot-dfu/builds/274944050
https://travis-ci.org/lmajewski/u-boot-dfu/builds/274944178
https://travis-ci.org/lmajewski/u-boot-dfu/builds/274945208
https://travis-ci.org/lmajewski/u-boot-dfu/builds/274965975


--
Best regards.

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


Re: [U-Boot] [PATCH v2 00/14] sunxi: convert musb to the device model and enable usb_ether

2017-09-13 Thread Łukasz Majewski

Hi Maxime,

Hi,

This serie aims at fixing an issue we had to carry out of tree patches
for for a few years.

The issue is this: a significant number of Allwinner boards don't have
an Ethernet connection, while an Ethernet connection is pretty useful
for example during development to do some PXE/NFS boot.

However, we needed to have DM_ETH enabled for the boards that use our
Ethernet controller drivers that rely on it. It meant having to use
the newly introduced DM_ETH support in the usb_ether gadget, but our
musb peripheral wasn't converted to the device model, and therefore
not usable with it.

The other alternative was to use the old-style usb_ether driver, which
worked fine but were disabling the Ethernet controller driver.

Thus, none were good, upstreamable solution.

Fix this properly by adding support for the musb in peripheral mode in
the device model. While we're doing so, I also took the occasion to
move a number of configuration options to Kconfig, and rework the
dependencies between them to ease the selection of related options
while trying to avoid as much as possible the combinations that are
not valid.

This was tested on a Sinlinx SinA33 that is wired as a peripheral-only
mUSB.

Let me know what you think,


Thanks for your effort. I've ack'ed gadget relevant commits, so I think 
that this series should go through the sunxi tree.


Best regards,
Łukasz


Maxime

Changes from v1:
   - Rebased on v2017.09
   - Added some help on a number of options introduced
   - Added the various tags collected

Maxime Ripard (14):
   usb: gadget: Move USBNET_DEVADDR option out of g_dnl
   usb: gadget: Document USBNET_DEVADDR
   usb: gadget: Move USBNET_HOST_ADDR to Kconfig
   usb: gadget: Convert USB_ETHER to Kconfig
   usb: gadget: usb_ether: Move the interfaces to Kconfig
   usb: gadget: Make g_dnl USB settings common
   usb: gadget: usb_ether: Move settings to common
   sunxi: provide default USB gadget setup
   sunxi: imply USB_GADGET
   cmd: fastboot: Rework fastboot dependency
   musb: sunxi: switch to the device model
   sunxi: Register usb_ether
   sunxi: Imply USB_ETHER
   sunxi: sina33: Sync the device tree with the kernel

  arch/arm/Kconfig |   4 +-
  arch/arm/dts/axp223.dtsi |  58 ++-
  arch/arm/dts/axp22x.dtsi |  10 +-
  arch/arm/dts/sun8i-a23-a33.dtsi  | 446 ++-
  arch/arm/dts/sun8i-a33-sinlinx-sina33.dts|  43 +-
  arch/arm/dts/sun8i-a33.dtsi  | 477 +---
  arch/arm/include/asm/arch-sunxi/usb_phy.h|   7 +-
  board/samsung/common/gadget.c|   4 +-
  board/siemens/common/factoryset.c|   4 +-
  board/sunxi/board.c  |   3 +-
  cmd/fastboot/Kconfig |   4 +-
  configs/A13-OLinuXino_defconfig  |   5 +-
  configs/A20-OLinuXino-Lime2-eMMC_defconfig   |   5 +-
  configs/A20-OLinuXino-Lime2_defconfig|   5 +-
  configs/CHIP_defconfig   |   5 +-
  configs/CHIP_pro_defconfig   |   5 +-
  configs/Cubietruck_defconfig |   5 +-
  configs/Nintendo_NES_Classic_Edition_defconfig   |   5 +-
  configs/Sinlinx_SinA33_defconfig |   5 +-
  configs/am335x_baltos_defconfig  |   8 +-
  configs/am335x_boneblack_defconfig   |  10 +-
  configs/am335x_boneblack_vboot_defconfig |   9 +-
  configs/am335x_evm_defconfig |   9 +-
  configs/am335x_evm_nor_defconfig |   9 +-
  configs/am335x_evm_norboot_defconfig |  10 +-
  configs/am335x_evm_spiboot_defconfig |   9 +-
  configs/am335x_evm_usbspl_defconfig  |   9 +-
  configs/am335x_hs_evm_defconfig  |   7 +-
  configs/am43xx_evm_defconfig |   6 +-
  configs/am43xx_evm_ethboot_defconfig |   6 +-
  configs/am43xx_evm_qspiboot_defconfig|   6 +-
  configs/am43xx_evm_usbhost_boot_defconfig|   6 +-
  configs/am43xx_hs_evm_defconfig  |   6 +-
  configs/am57xx_evm_defconfig |   8 +-
  configs/am57xx_evm_nodt_defconfig|   9 +-
  configs/am57xx_hs_evm_defconfig  |   8 +-
  configs/apalis-tk1_defconfig |   6 +-
  configs/apalis_imx6_defconfig|   6 +-
  configs/apalis_imx6_nospl_com_defconfig  |   6 +-
  configs/apalis_imx6_nospl_it_defconfig   |   6 +-
  configs/apalis_t30_defconfig |   6 +-
  configs/bcm11130_defconfig   |   6 +-
  configs/bcm11130_nand_defconfig  |   6 +-
  configs/bcm23550_w1d_defconfig   |   9 +-
  configs/bcm28155_ap_defconfig|   9 +-
  configs/bcm28155_w1d_defconfig   |   6 +-
  configs/beaver_defconfig   

Re: [U-Boot] [PATCH v2 14/14] sunxi: sina33: Sync the device tree with the kernel

2017-09-13 Thread Łukasz Majewski

On 09/12/2017 09:01 PM, Maxime Ripard wrote:

The kernel DT of the SinA33 has evolved quite a bit. Make sure we sync it
and its upstream DTSI to be able to use the OTG. The DTs were taken from
the 4.13 kernel release.

Reviewed-by: Simon Glass 
Signed-off-by: Maxime Ripard 
---
  arch/arm/dts/axp223.dtsi  |  58 ++-
  arch/arm/dts/axp22x.dtsi  |  10 +-
  arch/arm/dts/sun8i-a23-a33.dtsi   | 446 +++---
  arch/arm/dts/sun8i-a33-sinlinx-sina33.dts |  43 ++-
  arch/arm/dts/sun8i-a33.dtsi   | 477 +++
  include/dt-bindings/clock/sun8i-a23-a33-ccu.h | 127 +-
  include/dt-bindings/reset/sun8i-a23-a33-ccu.h |  87 +++-
  7 files changed, 914 insertions(+), 334 deletions(-)
  create mode 100644 arch/arm/dts/axp223.dtsi
  create mode 100644 include/dt-bindings/clock/sun8i-a23-a33-ccu.h
  create mode 100644 include/dt-bindings/reset/sun8i-a23-a33-ccu.h

diff --git a/arch/arm/dts/axp223.dtsi b/arch/arm/dts/axp223.dtsi
new file mode 100644
index ..b91b6c1278c7
--- /dev/null
+++ b/arch/arm/dts/axp223.dtsi
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2016 Free Electrons
+ *
+ * Quentin Schulz 
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * AXP223 Integrated Power Management Chip
+ * http://www.x-powers.com/product/AXP22X.php
+ * http://dl.linux-sunxi.org/AXP/AXP223-en.pdf
+ *
+ * The AXP223 shares most of its logic with the AXP221 but it has some
+ * differences, for the VBUS driver for example.
+ */
+
+#include "axp22x.dtsi"
+
+&usb_power_supply {
+   compatible = "x-powers,axp223-usb-power-supply";
+};
diff --git a/arch/arm/dts/axp22x.dtsi b/arch/arm/dts/axp22x.dtsi
index 458b6681e3ec..87fb08e812ec 100644
--- a/arch/arm/dts/axp22x.dtsi
+++ b/arch/arm/dts/axp22x.dtsi
@@ -52,6 +52,16 @@
interrupt-controller;
#interrupt-cells = <1>;
  
+	ac_power_supply: ac-power-supply {

+   compatible = "x-powers,axp221-ac-power-supply";
+   status = "disabled";
+   };
+
+   battery_power_supply: battery-power-supply {
+   compatible = "x-powers,axp221-battery-power-supply";
+   status = "disabled";
+   };
+
regulators {
/* Default work frequency for buck regulators */
x-powers,dcdc-freq = <3000>;
diff --git a/arch/arm/dts/sun8i-a23-a33.dtsi b/arch/arm/dts/sun8i-a23-a33.dtsi
index f97c38f097d1..ea50dda75adc 100644
--- a/arch/arm/dts/sun8i-a23-a33.dtsi
+++ b/arch/arm/dts/sun8i-a23-a33.dtsi
@@ -46,7 +46,8 @@
  
  #include 
  
-#include 

+#include 
+#include 
  
  / {

interrupt-parent = <&gic>;
@@ -60,7 +61,9 @@
compatible = "allwinner,simple-framebuffer",
 "simple-framebuffer";
allwinner,pipeline = "de_be0-lcd0";
-   clocks = <&pll6 0>;
+   clocks = <&ccu CLK_BUS_LCD>, <&ccu CLK_BUS_DE_BE>,
+<&ccu CLK_LCD_CH0>, <&ccu CLK_DE_BE>,
+ 

Re: [U-Boot] [PATCH v2 13/14] sunxi: Imply USB_ETHER

2017-09-13 Thread Łukasz Majewski

On 09/12/2017 09:01 PM, Maxime Ripard wrote:

Now that we can enable the usb_ether gadget, do it. This will be especially
useful for boards that don't have any ethernet controller, such as the ones
based on the A13 or A33.

Reviewed-by: Simon Glass 
Signed-off-by: Maxime Ripard 
---
  arch/arm/Kconfig | 1 +
  1 file changed, 1 insertion(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 519f42778a8d..bce5959ef687 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -703,6 +703,7 @@ config ARCH_SUNXI
imply SPL_MMC_SUPPORT if MMC
imply SPL_POWER_SUPPORT
imply SPL_SERIAL_SUPPORT
+   imply USB_ETHER
imply USB_GADGET
  
  config TARGET_TS4600



Reviewed-by: Łukasz Majewski 

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 12/14] sunxi: Register usb_ether

2017-09-13 Thread Łukasz Majewski

On 09/12/2017 09:01 PM, Maxime Ripard wrote:

Call the function to register the usb_ether gadget in the board.

Reviewed-by: Simon Glass 
Signed-off-by: Maxime Ripard 
---
  board/sunxi/board.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index f9224360d758..610fa89056ef 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -737,6 +737,8 @@ int misc_init_r(void)
return ret;
  #endif
  
+	usb_ether_init();

+
return 0;
  }
  


Reviewed-by: Łukasz Majewski 

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 11/14] musb: sunxi: switch to the device model

2017-09-13 Thread Łukasz Majewski

On 09/12/2017 09:01 PM, Maxime Ripard wrote:

The device model was implemented so far using a hook that needed to be
called from the board support, without DT support and only for the host.

Switch to probing both in peripheral and host mode through the DT.

Reviewed-by: Simon Glass 
Signed-off-by: Maxime Ripard 
---
  arch/arm/include/asm/arch-sunxi/usb_phy.h |  7 +---
  board/sunxi/board.c   |  1 +-
  drivers/usb/musb-new/sunxi.c  | 56 +++-
  3 files changed, 27 insertions(+), 37 deletions(-)

diff --git a/arch/arm/include/asm/arch-sunxi/usb_phy.h 
b/arch/arm/include/asm/arch-sunxi/usb_phy.h
index cef6c985bc8d..5a9cacb6f4a3 100644
--- a/arch/arm/include/asm/arch-sunxi/usb_phy.h
+++ b/arch/arm/include/asm/arch-sunxi/usb_phy.h
@@ -19,10 +19,3 @@ void sunxi_usb_phy_power_off(int index);
  int sunxi_usb_phy_vbus_detect(int index);
  int sunxi_usb_phy_id_detect(int index);
  void sunxi_usb_phy_enable_squelch_detect(int index, int enable);
-
-/* Not really phy related, but we have to declare this somewhere ... */
-#if defined(CONFIG_USB_MUSB_HOST) || defined(CONFIG_USB_MUSB_GADGET)
-void sunxi_musb_board_init(void);
-#else
-#define sunxi_musb_board_init()
-#endif
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 70e01437c4f4..f9224360d758 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -736,7 +736,6 @@ int misc_init_r(void)
if (ret)
return ret;
  #endif
-   sunxi_musb_board_init();
  
  	return 0;

  }
diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c
index 5c1a902e42dc..7ee44ea91900 100644
--- a/drivers/usb/musb-new/sunxi.c
+++ b/drivers/usb/musb-new/sunxi.c
@@ -308,9 +308,6 @@ static struct musb_hdrc_platform_data musb_plat = {
.platform_ops   = &sunxi_musb_ops,
  };
  
-#ifdef CONFIG_USB_MUSB_HOST

-static int musb_usb_remove(struct udevice *dev);
-
  static int musb_usb_probe(struct udevice *dev)
  {
struct musb_host_data *host = dev_get_priv(dev);
@@ -319,16 +316,20 @@ static int musb_usb_probe(struct udevice *dev)
  
  	priv->desc_before_addr = true;
  
+#ifdef CONFIG_USB_MUSB_HOST

host->host = musb_init_controller(&musb_plat, NULL,
  (void *)SUNXI_USB0_BASE);
if (!host->host)
return -EIO;
  
  	ret = musb_lowlevel_init(host);

-   if (ret == 0)
-   printf("MUSB OTG\n");
-   else
-   musb_usb_remove(dev);
+   if (!ret)
+   printf("Allwinner mUSB OTG (Host)\n");
+#else
+   ret = musb_register(&musb_plat, NULL, (void *)SUNXI_USB0_BASE);
+   if (!ret)
+   printf("Allwinner mUSB OTG (Peripheral)\n");
+#endif
  
  	return ret;

  }
@@ -352,30 +353,27 @@ static int musb_usb_remove(struct udevice *dev)
return 0;
  }
  
-U_BOOT_DRIVER(usb_musb) = {

-   .name   = "sunxi-musb",
-   .id = UCLASS_USB,
-   .probe = musb_usb_probe,
-   .remove = musb_usb_remove,
-   .ops= &musb_usb_ops,
-   .platdata_auto_alloc_size = sizeof(struct usb_platdata),
-   .priv_auto_alloc_size = sizeof(struct musb_host_data),
+static const struct udevice_id sunxi_musb_ids[] = {
+   { .compatible = "allwinner,sun4i-a10-musb" },
+   { .compatible = "allwinner,sun6i-a31-musb" },
+   { .compatible = "allwinner,sun8i-a33-musb" },
+   { .compatible = "allwinner,sun8i-h3-musb" },
+   { }
  };
-#endif
  
-void sunxi_musb_board_init(void)

-{
+U_BOOT_DRIVER(usb_musb) = {
+   .name   = "sunxi-musb",
  #ifdef CONFIG_USB_MUSB_HOST
-   struct udevice *dev;
-
-   /*
-* Bind the driver directly for now as musb linux kernel support is
-* still pending upstream so our dts files do not have the necessary
-* nodes yet. TODO: Remove this as soon as the dts nodes are in place
-* and bind by compatible instead.
-*/
-   device_bind_driver(dm_root(), "sunxi-musb", "sunxi-musb", &dev);
+   .id = UCLASS_USB,
  #else
-   musb_register(&musb_plat, NULL, (void *)SUNXI_USB0_BASE);
+   .id = UCLASS_USB_DEV_GENERIC,
  #endif
-}
+   .of_match   = sunxi_musb_ids,
+   .probe  = musb_usb_probe,
+   .remove = musb_usb_remove,
+#ifdef CONFIG_USB_MUSB_HOST
+   .ops= &musb_usb_ops,
+#endif
+   .platdata_auto_alloc_size = sizeof(struct usb_platdata),
+   .priv_auto_alloc_size = sizeof(struct musb_host_data),
+};



Reviewed-by: Łukasz Majewski 

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 10/14] cmd: fastboot: Rework fastboot dependency

2017-09-13 Thread Łukasz Majewski
SB_GADGET_VENDOR_NUM=0x0525
  CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
  CONFIG_CI_UDC=y
-CONFIG_USB_GADGET_DOWNLOAD=y
  CONFIG_USB_ETHER=y
  CONFIG_USB_ETH_CDC=y
  # CONFIG_VIDEO_SW_CURSOR is not set
diff --git a/configs/omap3_beagle_defconfig b/configs/omap3_beagle_defconfig
index 86967b07fb9c..024e35647304 100644
--- a/configs/omap3_beagle_defconfig
+++ b/configs/omap3_beagle_defconfig
@@ -9,8 +9,6 @@ CONFIG_SPL=y
  CONFIG_SPL_MTD_SUPPORT=y
  CONFIG_SPL_OS_BOOT=y
  CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_CMD_FASTBOOT=y
  CONFIG_FASTBOOT_BUF_ADDR=0x8200
  # CONFIG_CMD_IMLS is not set
  CONFIG_CMD_SPL=y
@@ -51,7 +49,6 @@ CONFIG_USB_GADGET=y
  CONFIG_USB_GADGET_MANUFACTURER="TI"
  CONFIG_USB_GADGET_VENDOR_NUM=0x0451
  CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
-CONFIG_USB_GADGET_DOWNLOAD=y
  CONFIG_USB_ETHER=y
  CONFIG_USB_HOST_ETHER=y
  CONFIG_USB_ETHER_ASIX=y
diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig
index b1693be7edd7..4380d6c84220 100644
--- a/configs/omap3_logic_defconfig
+++ b/configs/omap3_logic_defconfig
@@ -15,7 +15,6 @@ CONFIG_SPL_OS_BOOT=y
  CONFIG_HUSH_PARSER=y
  CONFIG_SYS_PROMPT="OMAP Logic # "
  CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
  CONFIG_FASTBOOT_BUF_ADDR=0x8200
  # CONFIG_CMD_IMI is not set
  # CONFIG_CMD_IMLS is not set
@@ -48,6 +47,5 @@ CONFIG_USB_GADGET=y
  CONFIG_USB_GADGET_MANUFACTURER="TI"
  CONFIG_USB_GADGET_VENDOR_NUM=0x0451
  CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
-CONFIG_USB_GADGET_DOWNLOAD=y
  CONFIG_USB_ETHER=y
  CONFIG_BCH=y
diff --git a/configs/parrot_r16_defconfig b/configs/parrot_r16_defconfig
index b36b9efec650..6be57e604e89 100644
--- a/configs/parrot_r16_defconfig
+++ b/configs/parrot_r16_defconfig
@@ -23,4 +23,3 @@ CONFIG_FASTBOOT_FLASH_MMC_DEV=0
  CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_MUSB_GADGET=y
  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
-CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/phycore-rk3288_defconfig b/configs/phycore-rk3288_defconfig
index ba50ea9d8665..f9a53fc920d0 100644
--- a/configs/phycore-rk3288_defconfig
+++ b/configs/phycore-rk3288_defconfig
@@ -76,7 +76,6 @@ CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
  CONFIG_USB_GADGET_VENDOR_NUM=0x2207
  CONFIG_USB_GADGET_PRODUCT_NUM=0x320a
  CONFIG_USB_GADGET_DWC2_OTG=y
-CONFIG_USB_GADGET_DOWNLOAD=y
  CONFIG_USB_HOST_ETHER=y
  CONFIG_USB_ETHER_ASIX=y
  CONFIG_USB_ETHER_SMSC95XX=y
diff --git a/configs/popmetal-rk3288_defconfig 
b/configs/popmetal-rk3288_defconfig
index a8d5cbf70940..5e592e6b918b 100644
--- a/configs/popmetal-rk3288_defconfig
+++ b/configs/popmetal-rk3288_defconfig
@@ -73,7 +73,6 @@ CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
  CONFIG_USB_GADGET_VENDOR_NUM=0x2207
  CONFIG_USB_GADGET_PRODUCT_NUM=0x320a
  CONFIG_USB_GADGET_DWC2_OTG=y
-CONFIG_USB_GADGET_DOWNLOAD=y
  CONFIG_USB_HOST_ETHER=y
  CONFIG_USB_ETHER_ASIX=y
  CONFIG_USB_ETHER_SMSC95XX=y
diff --git a/configs/rock2_defconfig b/configs/rock2_defconfig
index d0ffdc7b0e70..be28c6640c1f 100644
--- a/configs/rock2_defconfig
+++ b/configs/rock2_defconfig
@@ -71,7 +71,6 @@ CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
  CONFIG_USB_GADGET_VENDOR_NUM=0x2207
  CONFIG_USB_GADGET_PRODUCT_NUM=0x320a
  CONFIG_USB_GADGET_DWC2_OTG=y
-CONFIG_USB_GADGET_DOWNLOAD=y
  CONFIG_DM_VIDEO=y
  CONFIG_DISPLAY=y
  CONFIG_VIDEO_ROCKCHIP=y
diff --git a/configs/sniper_defconfig b/configs/sniper_defconfig
index 75371c47ce8e..21254a5ad32b 100644
--- a/configs/sniper_defconfig
+++ b/configs/sniper_defconfig
@@ -13,8 +13,6 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=2
  CONFIG_HUSH_PARSER=y
  CONFIG_SYS_PROMPT="sniper # "
  CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_CMD_FASTBOOT=y
  CONFIG_FASTBOOT_BUF_ADDR=0x8200
  CONFIG_FASTBOOT_BUF_SIZE=0x200
  CONFIG_FASTBOOT_FLASH=y
@@ -46,5 +44,4 @@ CONFIG_USB_GADGET=y
  CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
  CONFIG_USB_GADGET_VENDOR_NUM=0x0451
  CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
-CONFIG_USB_GADGET_DOWNLOAD=y
  CONFIG_OF_LIBFDT=y
diff --git a/configs/tinker-rk3288_defconfig b/configs/tinker-rk3288_defconfig
index 84fcd8979f20..816fc0189c1d 100644
--- a/configs/tinker-rk3288_defconfig
+++ b/configs/tinker-rk3288_defconfig
@@ -76,7 +76,6 @@ CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
  CONFIG_USB_GADGET_VENDOR_NUM=0x2207
  CONFIG_USB_GADGET_PRODUCT_NUM=0x320a
  CONFIG_USB_GADGET_DWC2_OTG=y
-CONFIG_USB_GADGET_DOWNLOAD=y
  CONFIG_USB_HOST_ETHER=y
  CONFIG_USB_ETHER_ASIX=y
  CONFIG_USB_ETHER_SMSC95XX=y



Reviewed-by: Łukasz Majewski 

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 09/14] sunxi: imply USB_GADGET

2017-09-13 Thread Łukasz Majewski

On 09/12/2017 09:01 PM, Maxime Ripard wrote:

A good number of our boards have USB_GADGET enabled. Imply it so that all
the boards can benefit from it, and remove some boilerplate from our
defconfigs.

Reviewed-by: Simon Glass 
Signed-off-by: Maxime Ripard 
---
  arch/arm/Kconfig   | 1 +
  configs/A13-OLinuXino_defconfig| 1 -
  configs/A20-OLinuXino-Lime2-eMMC_defconfig | 1 -
  configs/A20-OLinuXino-Lime2_defconfig  | 1 -
  configs/CHIP_defconfig | 1 -
  configs/CHIP_pro_defconfig | 1 -
  configs/Cubietruck_defconfig   | 1 -
  configs/Nintendo_NES_Classic_Edition_defconfig | 1 -
  configs/Sinlinx_SinA33_defconfig   | 1 -
  configs/parrot_r16_defconfig   | 1 -
  10 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 53eae8953e0b..1eb59c591a54 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -705,6 +705,7 @@ config ARCH_SUNXI
imply SPL_POWER_SUPPORT
imply SPL_SERIAL_SUPPORT
imply USB_FUNCTION_FASTBOOT
+   imply USB_GADGET
  
  config TARGET_TS4600

bool "Support TS4600"
diff --git a/configs/A13-OLinuXino_defconfig b/configs/A13-OLinuXino_defconfig
index ae790164dff7..e55dbff44d36 100644
--- a/configs/A13-OLinuXino_defconfig
+++ b/configs/A13-OLinuXino_defconfig
@@ -31,5 +31,4 @@ CONFIG_AXP_ALDO3_VOLT=3300
  CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_MUSB_GADGET=y
  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
-CONFIG_USB_GADGET=y
  CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/A20-OLinuXino-Lime2-eMMC_defconfig 
b/configs/A20-OLinuXino-Lime2-eMMC_defconfig
index b136af66b71f..9491708d80c6 100644
--- a/configs/A20-OLinuXino-Lime2-eMMC_defconfig
+++ b/configs/A20-OLinuXino-Lime2-eMMC_defconfig
@@ -33,5 +33,4 @@ CONFIG_SCSI=y
  CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_MUSB_GADGET=y
  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
-CONFIG_USB_GADGET=y
  CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/A20-OLinuXino-Lime2_defconfig 
b/configs/A20-OLinuXino-Lime2_defconfig
index ebb435f30956..2bb8ee8c9ebd 100644
--- a/configs/A20-OLinuXino-Lime2_defconfig
+++ b/configs/A20-OLinuXino-Lime2_defconfig
@@ -32,5 +32,4 @@ CONFIG_SCSI=y
  CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_MUSB_GADGET=y
  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
-CONFIG_USB_GADGET=y
  CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/CHIP_defconfig b/configs/CHIP_defconfig
index 7d50d0533dcd..b9f70d240c3c 100644
--- a/configs/CHIP_defconfig
+++ b/configs/CHIP_defconfig
@@ -22,6 +22,5 @@ CONFIG_AXP_ALDO4_VOLT=3300
  CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_MUSB_GADGET=y
  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
-CONFIG_USB_GADGET=y
  CONFIG_USB_GADGET_DOWNLOAD=y
  CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/configs/CHIP_pro_defconfig b/configs/CHIP_pro_defconfig
index 76daf477ec87..74f6eb10fc01 100644
--- a/configs/CHIP_pro_defconfig
+++ b/configs/CHIP_pro_defconfig
@@ -27,6 +27,5 @@ CONFIG_AXP_ALDO4_VOLT=3300
  CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_MUSB_GADGET=y
  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
-CONFIG_USB_GADGET=y
  CONFIG_USB_GADGET_DOWNLOAD=y
  CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/configs/Cubietruck_defconfig b/configs/Cubietruck_defconfig
index 1b2989d364f6..458e2a9d8b04 100644
--- a/configs/Cubietruck_defconfig
+++ b/configs/Cubietruck_defconfig
@@ -32,5 +32,4 @@ CONFIG_SCSI=y
  CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_MUSB_GADGET=y
  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
-CONFIG_USB_GADGET=y
  CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/Nintendo_NES_Classic_Edition_defconfig 
b/configs/Nintendo_NES_Classic_Edition_defconfig
index 5986764a14b9..e031dd8f5d5f 100644
--- a/configs/Nintendo_NES_Classic_Edition_defconfig
+++ b/configs/Nintendo_NES_Classic_Edition_defconfig
@@ -22,5 +22,4 @@ CONFIG_AXP_DLDO1_VOLT=3300
  CONFIG_AXP_ELDO2_VOLT=1800
  CONFIG_USB_MUSB_GADGET=y
  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
-CONFIG_USB_GADGET=y
  CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/Sinlinx_SinA33_defconfig b/configs/Sinlinx_SinA33_defconfig
index 9299aedd6019..143a9b4b6c10 100644
--- a/configs/Sinlinx_SinA33_defconfig
+++ b/configs/Sinlinx_SinA33_defconfig
@@ -27,5 +27,4 @@ CONFIG_DFU_RAM=y
  CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_MUSB_GADGET=y
  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
-CONFIG_USB_GADGET=y
  CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/parrot_r16_defconfig b/configs/parrot_r16_defconfig
index 57db9587fe77..b36b9efec650 100644
--- a/configs/parrot_r16_defconfig
+++ b/configs/parrot_r16_defconfig
@@ -23,5 +23,4 @@ CONFIG_FASTBOOT_FLASH_MMC_DEV=0
  CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_MUSB_GADGET=y
  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
-CONFIG_USB_GADGET=y
  CONFIG_USB_GADGET_DOWNLOAD=y


Reviewed-by: Łukasz Majewski 

--
Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Ger

Re: [U-Boot] [PATCH v2 08/14] sunxi: provide default USB gadget setup

2017-09-13 Thread Łukasz Majewski

On 09/12/2017 09:01 PM, Maxime Ripard wrote:

All the Allwinner boards use the same manufacturer, VID and PID for the
gadgets. Make them the defaults to remove some boilerplate from our
defconfigs.


Reviewed-by: Łukasz Majewski 


Reviewed-by: Simon Glass 
Signed-off-by: Maxime Ripard 
---
  configs/A13-OLinuXino_defconfig| 3 ---
  configs/A20-OLinuXino-Lime2-eMMC_defconfig | 3 ---
  configs/A20-OLinuXino-Lime2_defconfig  | 3 ---
  configs/CHIP_defconfig | 3 ---
  configs/CHIP_pro_defconfig | 3 ---
  configs/Cubietruck_defconfig   | 3 ---
  configs/Nintendo_NES_Classic_Edition_defconfig | 3 ---
  configs/Sinlinx_SinA33_defconfig   | 3 ---
  configs/parrot_r16_defconfig   | 3 ---
  drivers/usb/gadget/Kconfig | 3 +++
  10 files changed, 3 insertions(+), 27 deletions(-)

diff --git a/configs/A13-OLinuXino_defconfig b/configs/A13-OLinuXino_defconfig
index 2574018d8213..ae790164dff7 100644
--- a/configs/A13-OLinuXino_defconfig
+++ b/configs/A13-OLinuXino_defconfig
@@ -32,7 +32,4 @@ CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_MUSB_GADGET=y
  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
  CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="Allwinner Technology"
-CONFIG_USB_GADGET_VENDOR_NUM=0x1f3a
-CONFIG_USB_GADGET_PRODUCT_NUM=0x1010
  CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/A20-OLinuXino-Lime2-eMMC_defconfig 
b/configs/A20-OLinuXino-Lime2-eMMC_defconfig
index 5663a824e71b..b136af66b71f 100644
--- a/configs/A20-OLinuXino-Lime2-eMMC_defconfig
+++ b/configs/A20-OLinuXino-Lime2-eMMC_defconfig
@@ -34,7 +34,4 @@ CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_MUSB_GADGET=y
  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
  CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="Allwinner Technology"
-CONFIG_USB_GADGET_VENDOR_NUM=0x1f3a
-CONFIG_USB_GADGET_PRODUCT_NUM=0x1010
  CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/A20-OLinuXino-Lime2_defconfig 
b/configs/A20-OLinuXino-Lime2_defconfig
index 63d013293690..ebb435f30956 100644
--- a/configs/A20-OLinuXino-Lime2_defconfig
+++ b/configs/A20-OLinuXino-Lime2_defconfig
@@ -33,7 +33,4 @@ CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_MUSB_GADGET=y
  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
  CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="Allwinner Technology"
-CONFIG_USB_GADGET_VENDOR_NUM=0x1f3a
-CONFIG_USB_GADGET_PRODUCT_NUM=0x1010
  CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/CHIP_defconfig b/configs/CHIP_defconfig
index 278039c05573..7d50d0533dcd 100644
--- a/configs/CHIP_defconfig
+++ b/configs/CHIP_defconfig
@@ -23,8 +23,5 @@ CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_MUSB_GADGET=y
  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
  CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="Allwinner Technology"
-CONFIG_USB_GADGET_VENDOR_NUM=0x1f3a
-CONFIG_USB_GADGET_PRODUCT_NUM=0x1010
  CONFIG_USB_GADGET_DOWNLOAD=y
  CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/configs/CHIP_pro_defconfig b/configs/CHIP_pro_defconfig
index edbdefc69ddf..76daf477ec87 100644
--- a/configs/CHIP_pro_defconfig
+++ b/configs/CHIP_pro_defconfig
@@ -28,8 +28,5 @@ CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_MUSB_GADGET=y
  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
  CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="Allwinner Technology"
-CONFIG_USB_GADGET_VENDOR_NUM=0x1f3a
-CONFIG_USB_GADGET_PRODUCT_NUM=0x1010
  CONFIG_USB_GADGET_DOWNLOAD=y
  CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/configs/Cubietruck_defconfig b/configs/Cubietruck_defconfig
index 2d1753645b0f..1b2989d364f6 100644
--- a/configs/Cubietruck_defconfig
+++ b/configs/Cubietruck_defconfig
@@ -33,7 +33,4 @@ CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_MUSB_GADGET=y
  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
  CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="Allwinner Technology"
-CONFIG_USB_GADGET_VENDOR_NUM=0x1f3a
-CONFIG_USB_GADGET_PRODUCT_NUM=0x1010
  CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/Nintendo_NES_Classic_Edition_defconfig 
b/configs/Nintendo_NES_Classic_Edition_defconfig
index 99f7d30f150d..5986764a14b9 100644
--- a/configs/Nintendo_NES_Classic_Edition_defconfig
+++ b/configs/Nintendo_NES_Classic_Edition_defconfig
@@ -23,7 +23,4 @@ CONFIG_AXP_ELDO2_VOLT=1800
  CONFIG_USB_MUSB_GADGET=y
  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
  CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="Allwinner Technology"
-CONFIG_USB_GADGET_VENDOR_NUM=0x1f3a
-CONFIG_USB_GADGET_PRODUCT_NUM=0x1010
  CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/Sinlinx_SinA33_defconfig b/configs/Sinlinx_SinA33_defconfig
index 8c5fc7587909..9299aedd6019 100644
--- a/configs/Sinlinx_SinA33_defconfig
+++ b/configs/Sinlinx_SinA33_defconfig
@@ -28,7 +28,4 @@ CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_MUSB_GADGET=y
  CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
  CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="Allwinner Technology"
-CONFIG_USB_GADGET_VENDOR_NUM=0x1f3a
-CONFIG_U

Re: [U-Boot] [PATCH v2 05/14] usb: gadget: usb_ether: Move the interfaces to Kconfig

2017-09-13 Thread Łukasz Majewski

On 09/12/2017 09:01 PM, Maxime Ripard wrote:

We need to select an interface for the usb_ether gadget, and they haven't
been converted to Kconfig yet. Add a choice to make sure we have an option
selected, and convert all the users.


Reviewed-by: Łukasz Majewski 



Signed-off-by: Maxime Ripard 
---
  configs/gwventana_emmc_defconfig   |  1 +-
  configs/gwventana_gw5904_defconfig |  1 +-
  configs/gwventana_nand_defconfig   |  1 +-
  configs/mx6qsabrelite_defconfig|  1 +-
  configs/nitrogen6dl2g_defconfig|  1 +-
  configs/nitrogen6dl_defconfig  |  1 +-
  configs/nitrogen6q2g_defconfig |  1 +-
  configs/nitrogen6q_defconfig   |  1 +-
  configs/nitrogen6s1g_defconfig |  1 +-
  configs/nitrogen6s_defconfig   |  1 +-
  configs/novena_defconfig   |  1 +-
  configs/sansa_fuze_plus_defconfig  |  1 +-
  configs/warp7_defconfig|  1 +-
  configs/warp7_secure_defconfig |  1 +-
  configs/xfi3_defconfig |  1 +-
  drivers/usb/gadget/Kconfig | 28 +++-
  include/configs/am335x_evm.h   |  4 +
  include/configs/am3517_evm.h   |  4 +
  include/configs/baltos.h   |  4 +
  include/configs/gw_ventana.h   |  1 +-
  include/configs/ma5d4evk.h |  1 +-
  include/configs/nitrogen6x.h   |  1 +-
  include/configs/novena.h   |  1 +-
  include/configs/pcm051.h   |  4 +
  include/configs/sama5d2_ptc.h  |  1 +-
  include/configs/sansa_fuze_plus.h  |  1 +-
  include/configs/siemens-am33x-common.h |  4 +
  include/configs/vinco.h|  1 +-
  include/configs/warp7.h|  2 +--
  include/configs/xfi3.h |  1 +-
  scripts/config_whitelist.txt   |  2 +--
  31 files changed, 43 insertions(+), 32 deletions(-)

diff --git a/configs/gwventana_emmc_defconfig b/configs/gwventana_emmc_defconfig
index 35d9e1ac27dc..03d732d8f11e 100644
--- a/configs/gwventana_emmc_defconfig
+++ b/configs/gwventana_emmc_defconfig
@@ -69,6 +69,7 @@ CONFIG_G_DNL_MANUFACTURER="Gateworks"
  CONFIG_G_DNL_VENDOR_NUM=0x0525
  CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
  CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
  CONFIG_USB_HOST_ETHER=y
  CONFIG_USB_ETHER_ASIX=y
  CONFIG_USB_ETHER_SMSC95XX=y
diff --git a/configs/gwventana_gw5904_defconfig 
b/configs/gwventana_gw5904_defconfig
index ca7eb5ac573e..51aa13dbaca3 100644
--- a/configs/gwventana_gw5904_defconfig
+++ b/configs/gwventana_gw5904_defconfig
@@ -73,6 +73,7 @@ CONFIG_G_DNL_MANUFACTURER="Gateworks"
  CONFIG_G_DNL_VENDOR_NUM=0x0525
  CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
  CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
  CONFIG_USB_HOST_ETHER=y
  CONFIG_USB_ETHER_ASIX=y
  CONFIG_USB_ETHER_SMSC95XX=y
diff --git a/configs/gwventana_nand_defconfig b/configs/gwventana_nand_defconfig
index cb9655574888..4b2e1a752935 100644
--- a/configs/gwventana_nand_defconfig
+++ b/configs/gwventana_nand_defconfig
@@ -72,6 +72,7 @@ CONFIG_G_DNL_MANUFACTURER="Gateworks"
  CONFIG_G_DNL_VENDOR_NUM=0x0525
  CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
  CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
  CONFIG_USB_HOST_ETHER=y
  CONFIG_USB_ETHER_ASIX=y
  CONFIG_USB_ETHER_SMSC95XX=y
diff --git a/configs/mx6qsabrelite_defconfig b/configs/mx6qsabrelite_defconfig
index bab0d0c79f0d..f716c8fd7f77 100644
--- a/configs/mx6qsabrelite_defconfig
+++ b/configs/mx6qsabrelite_defconfig
@@ -55,5 +55,6 @@ CONFIG_G_DNL_MANUFACTURER="Boundary"
  CONFIG_G_DNL_VENDOR_NUM=0x0525
  CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
  CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
  # CONFIG_VIDEO_SW_CURSOR is not set
  CONFIG_OF_LIBFDT=y
diff --git a/configs/nitrogen6dl2g_defconfig b/configs/nitrogen6dl2g_defconfig
index 0d19b85a30f3..fd4a46558129 100644
--- a/configs/nitrogen6dl2g_defconfig
+++ b/configs/nitrogen6dl2g_defconfig
@@ -52,5 +52,6 @@ CONFIG_G_DNL_MANUFACTURER="Boundary"
  CONFIG_G_DNL_VENDOR_NUM=0x0525
  CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
  CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
  # CONFIG_VIDEO_SW_CURSOR is not set
  CONFIG_OF_LIBFDT=y
diff --git a/configs/nitrogen6dl_defconfig b/configs/nitrogen6dl_defconfig
index a20580eb77bb..30046e3f3a07 100644
--- a/configs/nitrogen6dl_defconfig
+++ b/configs/nitrogen6dl_defconfig
@@ -52,5 +52,6 @@ CONFIG_G_DNL_MANUFACTURER="Boundary"
  CONFIG_G_DNL_VENDOR_NUM=0x0525
  CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
  CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
  # CONFIG_VIDEO_SW_CURSOR is not set
  CONFIG_OF_LIBFDT=y
diff --git a/configs/nitrogen6q2g_defconfig b/configs/nitrogen6q2g_defconfig
index 940c74a5ece2..f9160c208fe7 100644
--- a/configs/nitrogen6q2g_defconfig
+++ b/configs/nitrogen6q2g_defconfig
@@ -53,5 +53,6 @@ CONFIG_G_DNL_MANUFACTURER="Boundary"
  CONFIG_G_DNL_VENDOR_NUM=0x0525
  CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
  CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
  # CONFIG_VIDEO_SW_CURSOR is not s

Re: [U-Boot] [PATCH v2 04/14] usb: gadget: Convert USB_ETHER to Kconfig

2017-09-13 Thread Łukasz Majewski

On 09/12/2017 09:01 PM, Maxime Ripard wrote:

The USB Ethernet gadget option has not yet been moved to Kconfig, let's
deal with that.


Reviewed-by: Łukasz Majewski 



Signed-off-by: Maxime Ripard 
---
  configs/am335x_baltos_defconfig  |  1 +
  configs/am335x_boneblack_defconfig   |  1 +
  configs/am335x_boneblack_vboot_defconfig |  1 +
  configs/am335x_evm_defconfig |  1 +
  configs/am335x_evm_nor_defconfig |  1 +
  configs/am335x_evm_norboot_defconfig |  1 +
  configs/am335x_evm_spiboot_defconfig |  1 +
  configs/am335x_evm_usbspl_defconfig  |  1 +
  configs/am335x_hs_evm_defconfig  |  1 +
  configs/draco_defconfig  |  1 +
  configs/etamin_defconfig |  1 +
  configs/gwventana_emmc_defconfig |  1 +
  configs/gwventana_gw5904_defconfig   |  1 +
  configs/gwventana_nand_defconfig |  1 +
  configs/ma5d4evk_defconfig   |  1 +
  configs/mx6qsabrelite_defconfig  |  1 +
  configs/nitrogen6dl2g_defconfig  |  1 +
  configs/nitrogen6dl_defconfig|  1 +
  configs/nitrogen6q2g_defconfig   |  1 +
  configs/nitrogen6q_defconfig |  1 +
  configs/nitrogen6s1g_defconfig   |  1 +
  configs/nitrogen6s_defconfig |  1 +
  configs/novena_defconfig |  1 +
  configs/omap3_beagle_defconfig   |  1 +
  configs/omap3_evm_defconfig  |  1 +
  configs/omap3_logic_defconfig|  1 +
  configs/pcm051_rev1_defconfig|  1 +
  configs/pcm051_rev3_defconfig|  1 +
  configs/pxm2_defconfig   |  1 +
  configs/rastaban_defconfig   |  1 +
  configs/rut_defconfig|  1 +
  configs/sama5d2_ptc_nandflash_defconfig  |  1 +
  configs/sama5d2_ptc_spiflash_defconfig   |  1 +
  configs/sansa_fuze_plus_defconfig|  1 +
  configs/thuban_defconfig |  1 +
  configs/vinco_defconfig  |  1 +
  configs/warp7_defconfig  |  1 +
  configs/warp7_secure_defconfig   |  1 +
  configs/xfi3_defconfig   |  1 +
  drivers/usb/gadget/Kconfig   | 14 ++
  include/configs/am335x_evm.h |  1 -
  include/configs/am3517_evm.h |  1 -
  include/configs/baltos.h |  1 -
  include/configs/gw_ventana.h |  1 -
  include/configs/h2200.h  |  1 -
  include/configs/ma5d4evk.h   |  1 -
  include/configs/nitrogen6x.h |  1 -
  include/configs/novena.h |  1 -
  include/configs/omap3_beagle.h   |  1 -
  include/configs/omap3_evm.h  |  1 -
  include/configs/omap3_logic.h|  1 -
  include/configs/pcm051.h |  1 -
  include/configs/sama5d2_ptc.h|  1 -
  include/configs/sansa_fuze_plus.h|  1 -
  include/configs/siemens-am33x-common.h   |  1 -
  include/configs/tao3530.h|  2 --
  include/configs/vinco.h  |  1 -
  include/configs/warp7.h  |  1 -
  include/configs/xfi3.h   |  1 -
  scripts/config_whitelist.txt |  1 -
  60 files changed, 53 insertions(+), 21 deletions(-)

diff --git a/configs/am335x_baltos_defconfig b/configs/am335x_baltos_defconfig
index be057acf8634..2f075091b27a 100644
--- a/configs/am335x_baltos_defconfig
+++ b/configs/am335x_baltos_defconfig
@@ -63,6 +63,7 @@ CONFIG_USB_GADGET_DOWNLOAD=y
  CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
  CONFIG_G_DNL_VENDOR_NUM=0x0403
  CONFIG_G_DNL_PRODUCT_NUM=0xbd00
+CONFIG_USB_ETHER=y
  CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
  CONFIG_FAT_WRITE=y
  CONFIG_OF_LIBFDT=y
diff --git a/configs/am335x_boneblack_defconfig 
b/configs/am335x_boneblack_defconfig
index 719d16b145eb..a3dd9b03b538 100644
--- a/configs/am335x_boneblack_defconfig
+++ b/configs/am335x_boneblack_defconfig
@@ -42,6 +42,7 @@ CONFIG_USB_GADGET_DOWNLOAD=y
  CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
  CONFIG_G_DNL_VENDOR_NUM=0x0451
  CONFIG_G_DNL_PRODUCT_NUM=0xd022
+CONFIG_USB_ETHER=y
  CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
  CONFIG_LZO=y
  CONFIG_OF_LIBFDT=y
diff --git a/configs/am335x_boneblack_vboot_defconfig 
b/configs/am335x_boneblack_vboot_defconfig
index 0a239bb73399..7d52382c24dc 100644
--- a/configs/am335x_boneblack_vboot_defconfig
+++ b/configs/am335x_boneblack_vboot_defconfig
@@ -52,4 +52,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y
  CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
  CONFIG_G_DNL_VENDOR_NUM=0x0451
  CONFIG_G_DNL_PRODUCT_NUM=0xd022
+CONFIG_USB_ETHER=y
  CONFIG_LZO=y
diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
index 00c1af43449d..69b2cf3e1f61 100644
--- a/configs/am335x_evm_defconfig
+++ b/configs/am335x_evm_defconfig
@@ -54,6 +54,7 @@ CONFIG_USB_GADGET_DOWNLOAD=y
  CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
 

Re: [U-Boot] [PATCH v2 03/14] usb: gadget: Move USBNET_HOST_ADDR to Kconfig

2017-09-13 Thread Łukasz Majewski
CONFIG_USB_ETH_RNDIS
-#define CONFIG_USBNET_HOST_ADDR"de:ad:be:af:00:00"
  #endif /* CONFIG_USB_MUSB_GADGET */
  
  /*

diff --git a/include/configs/baltos.h b/include/configs/baltos.h
index 185c749d7868..535fdd4373b0 100644
--- a/include/configs/baltos.h
+++ b/include/configs/baltos.h
@@ -286,7 +286,6 @@
  #ifdef CONFIG_USB_MUSB_GADGET
  #define CONFIG_USB_ETHER
  #define CONFIG_USB_ETH_RNDIS
-#define CONFIG_USBNET_HOST_ADDR"de:ad:be:af:00:00"
  #endif /* CONFIG_USB_MUSB_GADGET */
  
  #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT)

diff --git a/include/configs/h2200.h b/include/configs/h2200.h
index 870014ddf475..e956e89a89d5 100644
--- a/include/configs/h2200.h
+++ b/include/configs/h2200.h
@@ -127,7 +127,6 @@
  #define CONFIG_USB_ETH_SUBSET
  
  #define CONFIG_USBNET_DEV_ADDR		"de:ad:be:ef:00:01"

-#define CONFIG_USBNET_HOST_ADDR"de:ad:be:ef:00:02"
  #define CONFIG_EXTRA_ENV_SETTINGS \
"stdin=serial\0" \
"stdout=serial\0" \
diff --git a/include/configs/siemens-am33x-common.h 
b/include/configs/siemens-am33x-common.h
index 2314a2d2ef35..2bcd77e9efc8 100644
--- a/include/configs/siemens-am33x-common.h
+++ b/include/configs/siemens-am33x-common.h
@@ -181,7 +181,6 @@
  #ifdef CONFIG_USB_MUSB_GADGET
  #define CONFIG_USB_ETHER
  #define CONFIG_USB_ETH_RNDIS
-#define CONFIG_USBNET_HOST_ADDR"de:ad:be:af:00:00"
  #endif /* CONFIG_USB_MUSB_GADGET */
  
  /* USB DRACO ID as default */

diff --git a/include/configs/warp7.h b/include/configs/warp7.h
index 75ae8a3e3338..9ce425156677 100644
--- a/include/configs/warp7.h
+++ b/include/configs/warp7.h
@@ -139,7 +139,6 @@
  #define CONFIG_USB_ETHER
  #define CONFIG_USB_ETH_CDC
  #define CONFIG_USB_ETH_RNDIS
-#define CONFIG_USBNET_HOST_ADDR"de:ad:be:af:00:00"
  #define CONFIG_USBNET_DEV_ADDR"de:ad:be:af:00:01"
  
  #endif

diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 9ce0c3f039ff..784e83c7c8a1 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -4983,7 +4983,6 @@ CONFIG_USBD_SERIAL_OUT_PKTSIZE
  CONFIG_USBD_VENDORID
  CONFIG_USBID_ADDR
  CONFIG_USBNET_DEV_ADDR
-CONFIG_USBNET_HOST_ADDR
  CONFIG_USBNET_MANUFACTURER
  CONFIG_USBTTY
  CONFIG_USB_AM35X



Reviewed-by: Łukasz Majewski 

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 01/14] usb: gadget: Move USBNET_DEVADDR option out of g_dnl

2017-09-13 Thread Łukasz Majewski

On 09/12/2017 09:01 PM, Maxime Ripard wrote:

The USBNET_DEVADDR has nothing to do with the USB download gadget, but
rather with the USB Ethernet gadget. Move it out of the if statement.

Reviewed-by: Simon Glass 
Signed-off-by: Maxime Ripard 
---
  drivers/usb/gadget/Kconfig | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 225b66bc95ff..d52626908846 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -119,10 +119,10 @@ config G_DNL_VENDOR_NUM
  config G_DNL_PRODUCT_NUM
hex "Product ID of USB device"
  
+endif # USB_GADGET_DOWNLOAD

+
  config USBNET_DEVADDR
string "USB Gadget Ethernet device mac address"
default "de:ad:be:ef:00:01"
  
-endif # USB_GADGET_DOWNLOAD

-
  endif # USB_GADGET



Acked-by: Łukasz Majewski 

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 02/14] usb: gadget: Document USBNET_DEVADDR

2017-09-13 Thread Łukasz Majewski

On 09/12/2017 09:01 PM, Maxime Ripard wrote:

Add an help about the USBNET_DEVADDR Kconfig option to make it clearer what
it's about.

Signed-off-by: Maxime Ripard 
---
  drivers/usb/gadget/Kconfig | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index d52626908846..6dc9d177f5ad 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -124,5 +124,8 @@ endif # USB_GADGET_DOWNLOAD
  config USBNET_DEVADDR
string "USB Gadget Ethernet device mac address"
default "de:ad:be:ef:00:01"
+   help
+ Ethernet MAC address of the device-side (ie. local board's) MAC
+ address of the usb_ether interface
  
  endif # USB_GADGET




Acked-by: Łukasz Majewski 

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [U-Boot,V9,1/4] usb: rockchip: add the rockusb gadget

2017-09-12 Thread Łukasz Majewski

Hi Dr. Philipp,


Hi Lukasz,


On 12 Sep 2017, at 10:14, Łukasz Majewski  wrote:

Hi Philipp,

This patch series is waiting for opening new merge window. It is already 
applied to usb-next tree.


Didn’t the new merge window just open yesterday?


I'm sure Marek will send PR shortly.



Regards,
Philipp.




this patch implement rockusb protocol on the device side. this is based on USB
download gadget infrastructure. the rockusb function implements the rd, wl, rid
commands. it can work with rkdeveloptool

Signed-off-by: Eddie Cai 
Reviewed-by: Simon Glass 

Changes in v9:
-fix compile error

Changes in v8:
-none

Changes in v7:
-none

Changes in v6:
-move some data to f_rockusb structure

Changes in v5:
-fix build error when build non-rockchip board
-fix checkpatch error

Changes in v4:
-use enum instead of macro define
-move some structure define and macro to f_rockusb.h
-add some function comment as Simon required
-address other comment from Simon
-fix build error as Lukasz point out
---
  arch/arm/include/asm/arch-rockchip/f_rockusb.h | 132 +
  drivers/usb/gadget/Kconfig |   8 +
  drivers/usb/gadget/Makefile|   1 +
  drivers/usb/gadget/f_rockusb.c | 691 +
  4 files changed, 832 insertions(+)
  create mode 100644 arch/arm/include/asm/arch-rockchip/f_rockusb.h
  create mode 100644 drivers/usb/gadget/f_rockusb.c


Acked-by: Philipp Tomsich 



--
Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de 
<mailto:w...@denx.de>





--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [U-Boot,V9,1/4] usb: rockchip: add the rockusb gadget

2017-09-12 Thread Łukasz Majewski

Hi Philipp,

This patch series is waiting for opening new merge window. It is already 
applied to usb-next tree.



this patch implement rockusb protocol on the device side. this is based on USB
download gadget infrastructure. the rockusb function implements the rd, wl, rid
commands. it can work with rkdeveloptool

Signed-off-by: Eddie Cai 
Reviewed-by: Simon Glass 

Changes in v9:
-fix compile error

Changes in v8:
-none

Changes in v7:
-none

Changes in v6:
-move some data to f_rockusb structure

Changes in v5:
-fix build error when build non-rockchip board
-fix checkpatch error

Changes in v4:
-use enum instead of macro define
-move some structure define and macro to f_rockusb.h
-add some function comment as Simon required
-address other comment from Simon
-fix build error as Lukasz point out
---
  arch/arm/include/asm/arch-rockchip/f_rockusb.h | 132 +
  drivers/usb/gadget/Kconfig |   8 +
  drivers/usb/gadget/Makefile|   1 +
  drivers/usb/gadget/f_rockusb.c | 691 +
  4 files changed, 832 insertions(+)
  create mode 100644 arch/arm/include/asm/arch-rockchip/f_rockusb.h
  create mode 100644 drivers/usb/gadget/f_rockusb.c



Acked-by: Philipp Tomsich 




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH] Kconfig: BOOTCOMMAND: Define default set of boot commands in Kconfig

2017-09-11 Thread Łukasz Majewski

On 09/11/2017 07:31 PM, Tom Rini wrote:

On Sun, Sep 10, 2017 at 08:25:02PM +0200, Lukasz Majewski wrote:


This patch gives an opportunity to override the defined CONFIG_BOOTCOMMAND
(at  files) with set of commands defined in
board _defconfig file.

Rationale: This change allows having two different u-boot builds - one for
production and one (far more larger) for factory setup.

Signed-off-by: Lukasz Majewski 


I don't get it, sorry.  We need to move CONFIG_BOOTCOMMAND into Kconfig
with some other logic so that distro_bootcmd stuff works.



The state of the art:
-

Many boards use CONFIG_BOOTCOMMAND as a set of commands to be executed 
at boot time:


bootcmd=CONFIG_BOOTCOMMAND

One notable user of it is config_distro_bootcmd.h

Rationale:
--

With this patch I can:

1. Setup one set of commands to be executed by default - e.g.:

bootcmd="run boot_mmc"

and

2. Have other defconfig - e.g. _factory_defconfig, which 
enables some extra stuff (like USB, gadget, gpt write, etc) and is used 
solely for factory flashing.


By having the opportunity to override CONFIG_BOOTCOMMAND in Kconfig, I 
can use the same code base and just adjust Kconfig for board.



What do you mean by "some other logic"?


--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH 05/13] usb: gadget: Make g_dnl USB settings common

2017-09-09 Thread Łukasz Majewski

Hi Maxime,


The g_dnl USB settings for the vendor ID, product ID and manufacturer are
actually common settings that can and should be shared by all the gadgets.

Make them common by renaming them, and convert all the users.


Reviewed-by: Lukasz Majewski 



Signed-off-by: Maxime Ripard 
---
  board/samsung/common/gadget.c|  4 ++--
  board/siemens/common/factoryset.c|  4 ++--
  configs/A13-OLinuXino_defconfig  |  6 +++---
  configs/A20-OLinuXino-Lime2-eMMC_defconfig   |  6 +++---
  configs/A20-OLinuXino-Lime2_defconfig|  6 +++---
  configs/CHIP_defconfig   |  6 +++---
  configs/CHIP_pro_defconfig   |  6 +++---
  configs/Cubietruck_defconfig |  6 +++---
  configs/Nintendo_NES_Classic_Edition_defconfig   |  6 +++---
  configs/Sinlinx_SinA33_defconfig |  6 +++---
  configs/am335x_baltos_defconfig  |  6 +++---
  configs/am335x_boneblack_defconfig   |  6 +++---
  configs/am335x_boneblack_vboot_defconfig |  6 +++---
  configs/am335x_evm_defconfig |  6 +++---
  configs/am335x_evm_nor_defconfig |  6 +++---
  configs/am335x_evm_norboot_defconfig |  6 +++---
  configs/am335x_evm_spiboot_defconfig |  6 +++---
  configs/am335x_evm_usbspl_defconfig  |  6 +++---
  configs/am335x_hs_evm_defconfig  |  6 +++---
  configs/am43xx_evm_defconfig |  6 +++---
  configs/am43xx_evm_ethboot_defconfig |  6 +++---
  configs/am43xx_evm_qspiboot_defconfig|  6 +++---
  configs/am43xx_evm_usbhost_boot_defconfig|  6 +++---
  configs/am43xx_hs_evm_defconfig  |  6 +++---
  configs/am57xx_evm_defconfig |  6 +++---
  configs/am57xx_evm_nodt_defconfig|  6 +++---
  configs/am57xx_hs_evm_defconfig  |  6 +++---
  configs/apalis-tk1_defconfig |  6 +++---
  configs/apalis_imx6_defconfig|  6 +++---
  configs/apalis_imx6_nospl_com_defconfig  |  6 +++---
  configs/apalis_imx6_nospl_it_defconfig   |  6 +++---
  configs/apalis_t30_defconfig |  6 +++---
  configs/bcm11130_defconfig   |  6 +++---
  configs/bcm11130_nand_defconfig  |  6 +++---
  configs/bcm23550_w1d_defconfig   |  6 +++---
  configs/bcm28155_ap_defconfig|  6 +++---
  configs/bcm28155_w1d_defconfig   |  6 +++---
  configs/beaver_defconfig |  6 +++---
  configs/birdland_bav335a_defconfig   |  6 +++---
  configs/birdland_bav335b_defconfig   |  6 +++---
  configs/cei-tk1-som_defconfig|  6 +++---
  configs/cgtqmx6eval_defconfig|  6 +++---
  configs/chromebit_mickey_defconfig   |  6 +++---
  configs/chromebook_jerry_defconfig   |  6 +++---
  configs/chromebook_minnie_defconfig  |  6 +++---
  configs/colibri_imx6_defconfig   |  6 +++---
  configs/colibri_imx6_nospl_defconfig |  6 +++---
  configs/colibri_imx7_defconfig   |  6 +++---
  configs/colibri_t20_defconfig|  6 +++---
  configs/colibri_t30_defconfig|  6 +++---
  configs/colibri_vf_defconfig |  6 +++---
  configs/corvus_defconfig |  6 +++---
  configs/dalmore_defconfig|  6 +++---
  configs/dms-ba16-1g_defconfig|  6 +++---
  configs/dms-ba16_defconfig   |  6 +++---
  configs/dra7xx_evm_defconfig |  6 +++---
  configs/dra7xx_hs_evm_defconfig  |  6 +++---
  configs/draco_defconfig  |  6 +++---
  configs/e2220-1170_defconfig |  6 +++---
  configs/edison_defconfig |  6 +++---
  configs/etamin_defconfig |  6 +++---
  configs/evb-rk3036_defconfig |  6 +++---
  configs/evb-rk3229_defconfig |  6 +++---
  configs/evb-rk3288_defconfig |  6 +++---
  configs/evb-rk3328_defconfig |  6 +++---
  configs/fennec-rk3288_defconfig  |  6 +++---
  configs/firefly-rk3288_defconfig |  6 +++---
  configs/gwventana_emmc_defconfig |  6 +++---
  configs/gwventana_gw5904_defconfig   |  6 +++---
  configs/gwventana_nand_defconfig |  6 +++---
  configs/jetson-tk1_defconfig |  6 +++---
  configs/kc1_defconfig|  6 +++---
  configs/kylin-rk3036_defconfig   |  6 +++---
  configs/ma5d4evk_defconfig   |  6 +++---
  configs/miqi-rk3288_defconfig   

Re: [U-Boot] [PATCH 06/13] usb: gadget: usb_ether: Move settings to common

2017-09-08 Thread Łukasz Majewski

On 09/08/2017 07:34 PM, Maxime Ripard wrote:

The usb_ether gadget duplicates the USB settings for the manufacturer,
product ID and vendor ID.

Make sure we use the common option so that we can expect a single VID/PID
couple for a single device.

Signed-off-by: Maxime Ripard 


Reviewed-by: Lukasz Majewski 


---
  configs/sama5d2_ptc_nandflash_defconfig |  1 +
  configs/sama5d2_ptc_spiflash_defconfig  |  1 +
  configs/vinco_defconfig |  1 +
  drivers/usb/gadget/ether.c  | 16 
  include/configs/ma5d4evk.h  |  1 -
  include/configs/sama5d2_ptc.h   |  1 -
  include/configs/vinco.h |  1 -
  scripts/config_whitelist.txt|  1 -
  8 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/configs/sama5d2_ptc_nandflash_defconfig 
b/configs/sama5d2_ptc_nandflash_defconfig
index 6672a5ce11f7..431056a50a8b 100644
--- a/configs/sama5d2_ptc_nandflash_defconfig
+++ b/configs/sama5d2_ptc_nandflash_defconfig
@@ -29,5 +29,6 @@ CONFIG_USB=y
  CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_STORAGE=y
  CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Atmel SAMA5D2_PTC"
  CONFIG_USB_GADGET_ATMEL_USBA=y
  CONFIG_USB_ETHER=y
diff --git a/configs/sama5d2_ptc_spiflash_defconfig 
b/configs/sama5d2_ptc_spiflash_defconfig
index 9a23a808f1b3..66bb671820a6 100644
--- a/configs/sama5d2_ptc_spiflash_defconfig
+++ b/configs/sama5d2_ptc_spiflash_defconfig
@@ -30,5 +30,6 @@ CONFIG_USB=y
  CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_STORAGE=y
  CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Atmel SAMA5D2_PTC"
  CONFIG_USB_GADGET_ATMEL_USBA=y
  CONFIG_USB_ETHER=y
diff --git a/configs/vinco_defconfig b/configs/vinco_defconfig
index b0df6b3c7805..8d7f9f99ab81 100644
--- a/configs/vinco_defconfig
+++ b/configs/vinco_defconfig
@@ -33,3 +33,4 @@ CONFIG_USB_STORAGE=y
  CONFIG_USB_GADGET=y
  CONFIG_USB_GADGET_ATMEL_USBA=y
  CONFIG_USB_ETHER=y
+CONFIG_USB_GADGET_MANUFACTURER="L+G VInCo"
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 2cf5c8d31e25..dbb578258f96 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -273,8 +273,8 @@ static inline int BITRATE(struct usb_gadget *g)
   * static ushort idProduct;
   */
  
-#if defined(CONFIG_USBNET_MANUFACTURER)

-static char *iManufacturer = CONFIG_USBNET_MANUFACTURER;
+#if defined(CONFIG_USB_GADGET_MANUFACTURER)
+static char *iManufacturer = CONFIG_USB_GADGET_MANUFACTURER;
  #else
  static char *iManufacturer = "U-Boot";
  #endif
@@ -2073,11 +2073,11 @@ static int eth_bind(struct usb_gadget *gadget)
 * to choose the right configuration otherwise.
 */
if (rndis) {
-#if defined(CONFIG_USB_RNDIS_VENDOR_ID) && defined(CONFIG_USB_RNDIS_PRODUCT_ID)
+#if defined(CONFIG_USB_GADGET_VENDOR_NUM) && 
defined(CONFIG_USB_GADGET_PRODUCT_NUM)
device_desc.idVendor =
-   __constant_cpu_to_le16(CONFIG_USB_RNDIS_VENDOR_ID);
+   __constant_cpu_to_le16(CONFIG_USB_GADGET_VENDOR_NUM);
device_desc.idProduct =
-   __constant_cpu_to_le16(CONFIG_USB_RNDIS_PRODUCT_ID);
+   __constant_cpu_to_le16(CONFIG_USB_GADGET_PRODUCT_NUM);
  #else
device_desc.idVendor =
__constant_cpu_to_le16(RNDIS_VENDOR_NUM);
@@ -2092,9 +2092,9 @@ static int eth_bind(struct usb_gadget *gadget)
 * supporting one submode of the "SAFE" variant of MDLM.)
 */
} else {
-#if defined(CONFIG_USB_CDC_VENDOR_ID) && defined(CONFIG_USB_CDC_PRODUCT_ID)
-   device_desc.idVendor = cpu_to_le16(CONFIG_USB_CDC_VENDOR_ID);
-   device_desc.idProduct = cpu_to_le16(CONFIG_USB_CDC_PRODUCT_ID);
+#if defined(CONFIG_USB_GADGET_VENDOR_NUM) && 
defined(CONFIG_USB_GADGET_PRODUCT_NUM)
+   device_desc.idVendor = 
cpu_to_le16(CONFIG_USB_GADGET_VENDOR_NUM);
+   device_desc.idProduct = 
cpu_to_le16(CONFIG_USB_GADGET_PRODUCT_NUM);
  #else
if (!cdc) {
device_desc.idVendor =
diff --git a/include/configs/ma5d4evk.h b/include/configs/ma5d4evk.h
index 6d25d84c6eb6..3aeb7e6ef136 100644
--- a/include/configs/ma5d4evk.h
+++ b/include/configs/ma5d4evk.h
@@ -97,7 +97,6 @@
  #ifdef CONFIG_CMD_USB
  
  /* USB device */

-#define CONFIG_USBNET_MANUFACTURER  "AriesEmbedded"
  #define CONFIG_USB_FUNCTION_MASS_STORAGE
  #define CONFIG_SYS_DFU_DATA_BUF_SIZE  (1 * 1024 * 1024)
  #define DFU_DEFAULT_POLL_TIMEOUT  300
diff --git a/include/configs/sama5d2_ptc.h b/include/configs/sama5d2_ptc.h
index 543592e3a574..2328c7614ed7 100644
--- a/include/configs/sama5d2_ptc.h
+++ b/include/configs/sama5d2_ptc.h
@@ -60,7 +60,6 @@
  #endif
  
  /* USB device */

-#define CONFIG_USBNET_MANUFACTURER  "Atmel SAMA5D2_PTC"
  
  /* Ethernet Hardware */

  #define CONFIG_MACB
diff --git a/include/configs/vinco.h b/include/configs/vinco.h
index d3d5dc8f7732..265da84fc0cc 100644
--- a/include/configs/vinco.h

Re: [U-Boot] [PATCH v3 10/14] doc: overlays: Tweak documentation regarding overlays

2017-09-06 Thread Łukasz Majewski

On 09/04/2017 10:12 PM, Pantelis Antoniou wrote:

From: Franklin S Cooper Jr 

Pull some information regarding overlays from commit messages and
put them directly within the documentation. Also add some information
regarding required dtc version to properly use overlays.

Signed-off-by: Franklin S Cooper Jr 
---
  doc/README.fdt-overlays | 85 +++--
  doc/uImage.FIT/overlay-fdt-boot.txt |  8 +++-
  2 files changed, 87 insertions(+), 6 deletions(-)

diff --git a/doc/README.fdt-overlays b/doc/README.fdt-overlays
index ee868ec..39139cb 100644
--- a/doc/README.fdt-overlays
+++ b/doc/README.fdt-overlays
@@ -1,9 +1,76 @@
-U-Boot FDT Overlay usage (without FIT images)
+U-Boot FDT Overlay usage
  =
  
-FDT overlays are now available for use even without FIT images.

-It is not as automagic as with FIT images though and require a few
-manual steps.
+Overlays Syntax
+---
+
+Overlays require slightly different syntax compared to traditional overlays.
+Please refer to dt-object-internal.txt in the dtc sources for information
+regarding the internal format of overlays:
+https://git.kernel.org/pub/scm/utils/dtc/dtc.git/tree/Documentation/dt-object-internal.txt
+
+Building Overlays
+-
+
+In a nutshell overlays provides a means to manipulate a symbol a previous dtb
+or overlay has defined. It requires both the base and all the overlays
+to be compiled with the -@ command line switch so that symbol information is
+included.
+
+Note support for -@ option can only be found in dtc version 1.4.4 or newer.
+Only version 4.14 or higher of the Linux kernel includes a built in version
+of dtc that meets this requirement.
+
+Building an overlay follows the same process as building a traditional dtb.
+
+For example:
+
+base.dts
+
+
+   /dts-v1/;
+   / {
+   foo: foonode {
+   foo-property;
+   };
+   };
+
+   $ dtc -@ -I dts -O dtb -o base.dtb base.dts
+
+bar.dts
+---
+
+   /dts-v1/;
+   /plugin/;
+   / {
+   fragment@1 {
+   target = <&foo>;
+   __overlay__ {
+   overlay-1-property;
+   bar: barnode {
+   bar-property;
+   };
+   };
+   };
+   };
+
+   $ dtc -@ -I dts -O dtb -o bar.dtb bar.dts
+
+Ways to Utilize Overlays in U-boot
+--
+
+There are two ways to apply overlays in U-boot.
+1. Include and define overlays within a FIT image and have overlays
+   automatically applied.
+
+2. Manually load and apply overlays
+
+The remainder of this document will discuss using overlays via the manual
+approach. For information on using overlays as part of a FIT image please see:
+doc/uImage.FIT/overlay-fdt-boot.txt
+
+Manually Loading and Applying Overlays
+--
  
  1. Figure out where to place both the base device tree blob and the

  overlay. Make sure you have enough space to grow the base tree without
@@ -29,6 +96,16 @@ overlapping anything.
  
  => fdt apply $fdtovaddr
  
+6. Boot system like you would do with a traditional dtb.

+
+For bootm:
+
+=> bootm ${kerneladdr} - ${fdtaddr}
+
+For bootz:
+
+=> bootz ${kerneladdr} - ${fdtaddr}
+
  Please note that in case of an error, both the base and overlays are going
  to be invalidated, so keep copies to avoid reloading.
  
diff --git a/doc/uImage.FIT/overlay-fdt-boot.txt b/doc/uImage.FIT/overlay-fdt-boot.txt

index dbdf2a1..63e47da 100644
--- a/doc/uImage.FIT/overlay-fdt-boot.txt
+++ b/doc/uImage.FIT/overlay-fdt-boot.txt
@@ -1,5 +1,5 @@
-U-Boot FDT Overlay usage
-
+U-Boot FDT Overlay FIT usage
+
  
  Introduction

  
@@ -8,6 +8,10 @@ of similar boards and their expansion options. The same kernel 
on DT enabled
  platforms can support this easily enough by providing a DT blob upon boot
  that matches the desired configuration.
  
+This document focuses on specifically using overlays as part of a FIT image.

+General information regarding overlays including its syntax and building it
+can be found in doc/README.fdt-overlays
+
  Configuration without overlays
  --
  



Reviwed-by: Łukasz Majewski

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v3 09/14] doc: Document how to apply fdt overlays

2017-09-06 Thread Łukasz Majewski

On 09/04/2017 10:12 PM, Pantelis Antoniou wrote:

We have the capability to apply overlays on the command line but
we didn't have a document explaining how.

Signed-off-by: Pantelis Antoniou 
---
  doc/README.fdt-overlays | 37 +
  1 file changed, 37 insertions(+)
  create mode 100644 doc/README.fdt-overlays

diff --git a/doc/README.fdt-overlays b/doc/README.fdt-overlays
new file mode 100644
index 000..ee868ec
--- /dev/null
+++ b/doc/README.fdt-overlays
@@ -0,0 +1,37 @@
+U-Boot FDT Overlay usage (without FIT images)
+=
+
+FDT overlays are now available for use even without FIT images.
+It is not as automagic as with FIT images though and require a few
+manual steps.
+
+1. Figure out where to place both the base device tree blob and the
+overlay. Make sure you have enough space to grow the base tree without
+overlapping anything.
+
+=> setenv fdtaddr 0x87f0
+=> setenv fdtovaddr 0x87fc
+
+2. Load the base blob and overlay blobs
+
+=> load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/base.dtb
+=> load ${devtype} ${bootpart} ${fdtovaddr} ${bootdir}/overlay.dtb
+
+3. Set it as the working fdt tree.
+
+=> fdtaddr $fdtaddr
+
+4. Grow it enough so it can 'fit' all the applied overlays
+
+=> fdt resize 8192
+
+5. You are now ready to apply the overlay.
+
+=> fdt apply $fdtovaddr
+
+Please note that in case of an error, both the base and overlays are going
+to be invalidated, so keep copies to avoid reloading.
+
+Pantelis Antoniou
+pantelis.anton...@konsulko.com
+11/7/2017



Reviewed-by: Łukasz Majewski

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v3 08/14] fit: fdt overlays doc

2017-09-06 Thread Łukasz Majewski
quot;fdt@4", "fdt@5";
+   };
+   bar {
+   fdt = "fdt@4";
+   };
+   baz {
+   fdt = "fdt@5";
+   };
+   };
+   };
+
+Booting this image is exactly the same as the non-overlay example.
+u-boot will retrieve the base blob and apply the overlays in sequence as
+they are declared in the configuration.
+
+Note the minimum amount of different DT blobs, as well as the requirement for
+the DT blobs to have a load address; the overlay application requires the blobs
+to be writeable.
+
+Configuration using overlays and feature selection
+--
+
+Although the configuration in the previous section works is a bit inflexible
+since it requires all possible configuration options to be laid out before
+hand in the FIT image. For the add-on boards the extra config selection method
+might make sense.
+
+Note the two bar & baz configuration nodes. To boot a reva board with
+the bar add-on board enabled simply use:
+
+   # bootm #foo-reva.dtb#bar
+
+While booting a revb with bar and baz is as follows:
+
+   # bootm #foo-revb.dtb#bar#baz
+
+The limitation for a feature selection configuration node is that a single
+fdt option is currently supported.
+
+Pantelis Antoniou
+pantelis.anton...@konsulko.com
+12/6/2017
diff --git a/doc/uImage.FIT/source_file_format.txt 
b/doc/uImage.FIT/source_file_format.txt
index 136d3d7..ba8013a 100644
--- a/doc/uImage.FIT/source_file_format.txt
+++ b/doc/uImage.FIT/source_file_format.txt
@@ -235,7 +235,7 @@ o config@1
|- description = "configuration description"
|- kernel = "kernel sub-node unit name"
|- ramdisk = "ramdisk sub-node unit name"
-  |- fdt = "fdt sub-node unit-name"
+  |- fdt = "fdt sub-node unit-name" [, "fdt overlay sub-node unit-name", ...]
|- fpga = "fpga sub-node unit-name"
|- loadables = "loadables sub-node unit-name"
  
@@ -249,7 +249,9 @@ o config@1

- ramdisk : Unit name of the corresponding ramdisk image (component image
  node of a "ramdisk" type).
- fdt : Unit name of the corresponding fdt blob (component image node of a
-"fdt type").
+"fdt type"). Additional fdt overlay nodes can be supplied which signify
+that the resulting device tree blob is generated by the first base fdt
+blob with all subsequent overlays applied.
- setup : Unit name of the corresponding setup binary (used for booting
  an x86 kernel). This contains the setup.bin file built by the kernel.
- fpga : Unit name of the corresponding fpga bitstream blob



Reviewed-by: Łukasz Majewski


I'm just curious - what was the fit image size reduction on your test setup?

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v3 1/1] usb: gadget: g_dnl: Sync internal SN variable with env

2017-09-05 Thread Łukasz Majewski

Hi Sam,


On 4 September 2017 at 08:36, Heiko Schocher  wrote:

Hello Lukasz,

Am 02.09.2017 um 13:08 schrieb Łukasz Majewski:


Hi Heiko,

Would you find some time and run this patch through your test setup?

Thanks in advance.



Of course, as it is automated ;-)

Okay, I had to add an oneliner, to say tbot, which patchwork patch it
has to download... for the records see [1].

Here the results for the smartweb board (in short, my dfu test are
working with this patch):

http://xeidos.ddns.net/tests/test_db_auslesen.php#408

Logs:
http://xeidos.ddns.net/tbot/id_408/html_log.html

Especially the steps:

(download patchwork patch, check with checkpatch, apply to mainline):
http://xeidos.ddns.net/tbot/id_408/html_log.html#92
http://xeidos.ddns.net/tbot/id_408/html_log.html#95
http://xeidos.ddns.net/tbot/id_408/html_log.html#98

and the dfu test:

http://xeidos.ddns.net/tbot/id_408/html_log.html#398
http://xeidos.ddns.net/tbot/id_408/html_log.html#409
http://xeidos.ddns.net/tbot/id_408/html_log.html#413
http://xeidos.ddns.net/tbot/id_408/html_log.html#417

My browser (firefox) seems to have problems with jumping to the correct
"id"s in the html file ...

Hope you can find the logs, if not, look into the raw logfile:

http://xeidos.ddns.net/tbot/id_408/tbot.txt

but this is not very comfortable ...

So, please add my:

Tested-by: Heiko Schocher 



Hi Lukasz,

Now that testing is done (thanks Heiko!), can you please Ack or Review
this patch? I really want it to go in v2017.09 release, as it's
critical bug fix for us.


No problem from my side:

Acked-by: Łukasz Majewski 


If Marek don't mind - I would like to ask Tom to apply it directly to 
-master branch (because of the patch importance).





Thanks!


bye,
Heiko

[1] tbot patch for adding a patchworkpatch

root@raspberrypi:/home/pi/data/tbot# git diff
diff --git a/config/smartweb.py b/config/smartweb.py
index 72a7972..98c8e0f 100644
--- a/config/smartweb.py
+++ b/config/smartweb.py
@@ -37,6 +37,8 @@ tc_workfd_apply_patchwork_patches_list_hand = [
]
tc_workfd_apply_patchwork_patches_blacklist = ['204183', '561384']

+tc_workfd_apply_patchwork_patches_list = ['808671']
+
uboot_get_parameter_file_list = ['.config', 'include/configs/smartweb.h',
'arch/arm/mach-at91/include/mach/at91sam9260.h']

tc_workfd_set_toolchain_arch = 'arm'
root@raspberrypi:/home/pi/data/tbot#


--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany





--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 1/8] fs/fat: split out helper to init fsdata

2017-09-03 Thread Łukasz Majewski

On 09/03/2017 05:47 PM, Rob Clark wrote:

On Sun, Sep 3, 2017 at 10:52 AM, Łukasz Majewski  wrote:

On 09/02/2017 06:37 PM, Rob Clark wrote:


Want to re-use this in fat dirent iterator in next patch.

Signed-off-by: Rob Clark 



Reviewed-by: Łukasz Majewski 



thanks

btw, is there some way to make get_maintainers.pl to find your
@denx.de address instead of the @samsung address which bounces?
(Sorry, I hadn't realized you had a new addr, so you were missed from
CC on some of the patches, I think.)


I've updated git-mailrc entry (about which I've forgotten).

However, get_maintainer looks for people making changes to the file(s) 
to which patch is applied.

Hence, you see my old address.



BR,
-R




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH 1/9] lib: Add CRC32-C

2017-09-03 Thread Łukasz Majewski

Hi Marek,


This is needed for BTRFS.

Signed-off-by: Marek Behun 

  create mode 100644 lib/crc32c.c


Excuse me my ignorance, but in u-boot we already have:
./lib/crc32.c

is the crc32c algorithm a different one from venerable crc32?




diff --git a/include/u-boot/crc.h b/include/u-boot/crc.h
index 6764d58bab..6d08f5df98 100644
--- a/include/u-boot/crc.h
+++ b/include/u-boot/crc.h
@@ -28,4 +28,8 @@ uint32_t crc32_no_comp (uint32_t, const unsigned char *, 
uint);
  void crc32_wd_buf(const unsigned char *input, uint ilen,
unsigned char *output, uint chunk_sz);
  
+/* lib/crc32c.c */

+void crc32c_init(uint32_t *, uint32_t);
+uint32_t crc32c_cal(uint32_t, const char *, int, uint32_t *);
+
  #endif /* _UBOOT_CRC_H */
diff --git a/lib/Kconfig b/lib/Kconfig
index fe337acaeb..29e55dbe1d 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -146,6 +146,9 @@ config SHA_PROG_HW_ACCEL
  config MD5
bool
  
+config CRC32C

+   bool
+
  endmenu
  
  menu "Compression Support"

diff --git a/lib/Makefile b/lib/Makefile
index 2eef1eb80e..a58ce0f815 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -67,6 +67,7 @@ obj-y += display_options.o
  CFLAGS_display_options.o := $(if $(BUILD_TAG),-DBUILD_TAG='"$(BUILD_TAG)"')
  obj-$(CONFIG_BCH) += bch.o
  obj-y += crc32.o
+obj-$(CONFIG_CRC32C) += crc32c.o
  obj-y += ctype.o
  obj-y += div64.o
  obj-y += hang.o
diff --git a/lib/crc32c.c b/lib/crc32c.c
new file mode 100644
index 00..322c08ff5d
--- /dev/null
+++ b/lib/crc32c.c
@@ -0,0 +1,38 @@
+/*
+ * Copied from Linux kernel crypto/crc32c.c
+ * Copyright (c) 2004 Cisco Systems, Inc.
+ * Copyright (c) 2008 Herbert Xu 
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+
+uint32_t crc32c_cal(uint32_t crc, const char *data, int length,
+   uint32_t *crc32c_table)
+{
+   while (length--)
+   crc = crc32c_table[(u8)(crc ^ *data++)] ^ (crc >> 8);
+
+   return crc;
+}
+
+void crc32c_init(uint32_t *crc32c_table, uint32_t pol)
+{
+   int i, j;
+   uint32_t v;
+   const uint32_t poly = pol; /* Bit-reflected CRC32C polynomial */
+
+   for (i = 0; i < 256; i++) {
+   v = i;
+   for (j = 0; j < 8; j++)
+   v = (v >> 1) ^ ((v & 1) ? poly : 0);
+
+   crc32c_table[i] = v;
+   }
+}




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [RFC] toradex: imx6: Move g_dnl_bind_fixup() into common SPL code

2017-09-03 Thread Łukasz Majewski

On 09/03/2017 04:56 PM, Fabio Estevam wrote:

From: Fabio Estevam 

Instead of having every board file to add its own g_dnl_bind_fixup()
implementation, move it to the common imx6 SPL code.



Reviewed-by: Łukasz Majewski 


Signed-off-by: Fabio Estevam 
---
Stefan,

I don't have access to Toradex board to test it, hence marking it
as RFC.

I have tested it with imx6q-sabresd and it works fine on this board.

  arch/arm/mach-imx/spl.c   | 10 ++
  board/toradex/apalis_imx6/apalis_imx6.c   | 13 -
  board/toradex/colibri_imx6/colibri_imx6.c | 13 -
  board/toradex/common/tdx-common.c | 13 -
  4 files changed, 10 insertions(+), 39 deletions(-)

diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
index 8e8e2f7..e350bc9 100644
--- a/arch/arm/mach-imx/spl.c
+++ b/arch/arm/mach-imx/spl.c
@@ -14,6 +14,7 @@
  #include 
  #include 
  #include 
+#include 
  
  DECLARE_GLOBAL_DATA_PTR;
  
@@ -86,6 +87,15 @@ u32 spl_boot_device(void)

}
return BOOT_DEVICE_NONE;
  }
+
+#ifdef CONFIG_SPL_USB_GADGET_SUPPORT
+int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
+{
+   put_unaligned(CONFIG_G_DNL_PRODUCT_NUM + 0xfff, &dev->idProduct);
+
+   return 0;
+}
+#endif
  #endif
  
  #if defined(CONFIG_SPL_MMC_SUPPORT)

diff --git a/board/toradex/apalis_imx6/apalis_imx6.c 
b/board/toradex/apalis_imx6/apalis_imx6.c
index ebc6c12..628a61d 100644
--- a/board/toradex/apalis_imx6/apalis_imx6.c
+++ b/board/toradex/apalis_imx6/apalis_imx6.c
@@ -29,7 +29,6 @@
  #include 
  #include 
  #include 
-#include 
  #include 
  #include 
  #include 
@@ -1224,18 +1223,6 @@ void reset_cpu(ulong addr)
  {
  }
  
-#ifdef CONFIG_SPL_USB_GADGET_SUPPORT

-int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
-{
-   unsigned short usb_pid;
-
-   usb_pid = TORADEX_USB_PRODUCT_NUM_OFFSET + 0xfff;
-   put_unaligned(usb_pid, &dev->idProduct);
-
-   return 0;
-}
-#endif
-
  #endif
  
  static struct mxc_serial_platdata mxc_serial_plat = {

diff --git a/board/toradex/colibri_imx6/colibri_imx6.c 
b/board/toradex/colibri_imx6/colibri_imx6.c
index 669d912..756e3f3 100644
--- a/board/toradex/colibri_imx6/colibri_imx6.c
+++ b/board/toradex/colibri_imx6/colibri_imx6.c
@@ -28,7 +28,6 @@
  #include 
  #include 
  #include 
-#include 
  #include 
  #include 
  #include 
@@ -1108,18 +1107,6 @@ void reset_cpu(ulong addr)
  {
  }
  
-#ifdef CONFIG_SPL_USB_GADGET_SUPPORT

-int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
-{
-   unsigned short usb_pid;
-
-   usb_pid = TORADEX_USB_PRODUCT_NUM_OFFSET + 0xfff;
-   put_unaligned(usb_pid, &dev->idProduct);
-
-   return 0;
-}
-#endif
-
  #endif
  
  static struct mxc_serial_platdata mxc_serial_plat = {

diff --git a/board/toradex/common/tdx-common.c 
b/board/toradex/common/tdx-common.c
index b4e4727..a7efeb8 100644
--- a/board/toradex/common/tdx-common.c
+++ b/board/toradex/common/tdx-common.c
@@ -5,7 +5,6 @@
   */
  
  #include 

-#include 
  #include 
  
  #include "tdx-cfg-block.h"

@@ -109,18 +108,6 @@ int show_board_info(void)
return 0;
  }
  
-#ifdef CONFIG_USB_GADGET_DOWNLOAD

-int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
-{
-   unsigned short usb_pid;
-
-   usb_pid = TORADEX_USB_PRODUCT_NUM_OFFSET + tdx_hw_tag.prodid;
-   put_unaligned(usb_pid, &dev->idProduct);
-
-   return 0;
-}
-#endif
-
  #if defined(CONFIG_OF_LIBFDT)
  int ft_common_board_setup(void *blob, bd_t *bd)
  {




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 8/8] fs/fat: fix case for FAT shortnames

2017-09-03 Thread Łukasz Majewski

On 09/02/2017 06:38 PM, Rob Clark wrote:

Noticed when comparing our output to linux.  There are some lcase bits
which control whether filename and/or extension should be downcase'd.


Reviewed-by: Łukasz Majewski 



Signed-off-by: Rob Clark 
---
  fs/fat/fat.c   | 17 -
  fs/fat/fat_write.c |  4 ++--
  include/fat.h  |  3 +++
  3 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index fc3106aacb..ccbf7ba1c8 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -29,11 +29,13 @@ static const int vfat_enabled = 0;
  #endif
  
  /*

- * Convert a string to lowercase.
+ * Convert a string to lowercase.  Converts at most 'len' characters,
+ * 'len' may be larger than the length of 'str' if 'str' is NULL
+ * terminated.
   */
-static void downcase(char *str)
+static void downcase(char *str, size_t len)
  {
-   while (*str != '\0') {
+   while (*str != '\0' && len--) {
*str = tolower(*str);
str++;
}
@@ -131,10 +133,16 @@ static void get_name(dir_entry *dirent, char *s_name)
ptr = s_name;
while (*ptr && *ptr != ' ')
ptr++;
+   if (dirent->lcase & CASE_LOWER_BASE)
+   downcase(s_name, (unsigned)(ptr - s_name));
if (dirent->ext[0] && dirent->ext[0] != ' ') {
+   char *ext;
+
*ptr = '.';
-   ptr++;
+   ext = ++ptr;
memcpy(ptr, dirent->ext, 3);
+   if (dirent->lcase & CASE_LOWER_EXT)
+   downcase(ext, 3);
ptr[3] = '\0';
while (*ptr && *ptr != ' ')
ptr++;
@@ -144,7 +152,6 @@ static void get_name(dir_entry *dirent, char *s_name)
*s_name = '\0';
else if (*s_name == aRING)
*s_name = DELETED_FLAG;
-   downcase(s_name);
  }
  
  static int flush_dirty_fat_buffer(fsdata *mydata);

diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
index 4ca024c208..655ad4ec84 100644
--- a/fs/fat/fat_write.c
+++ b/fs/fat/fat_write.c
@@ -345,7 +345,7 @@ get_long_file_name(fsdata *mydata, int curclust, __u8 
*cluster,
*l_name = '\0';
else if (*l_name == aRING)
*l_name = DELETED_FLAG;
-   downcase(l_name);
+   downcase(l_name, ~0);
  
  	/* Return the real directory entry */

*retdent = realdent;
@@ -981,7 +981,7 @@ static int do_fat_write(const char *filename, void *buffer, 
loff_t size,
  
  	memcpy(l_filename, filename, name_len);

l_filename[name_len] = 0; /* terminate the string */
-   downcase(l_filename);
+   downcase(l_filename, ~0);
  
  	startsect = mydata->rootdir_sect;

retdent = find_directory_entry(mydata, startsect,
diff --git a/include/fat.h b/include/fat.h
index b2d4b952fd..5e4924316a 100644
--- a/include/fat.h
+++ b/include/fat.h
@@ -128,6 +128,9 @@ typedef struct volume_info
/* Boot sign comes last, 2 bytes */
  } volume_info;
  
+#define CASE_LOWER_BASE	8	/* base is lower case */

+#define CASE_LOWER_EXT 16  /* extension is lower case */
+
  typedef struct dir_entry {
charname[8],ext[3]; /* Name and extension */
__u8attr;   /* Attribute bits */




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 7/8] fat/fs: move ls to generic implementation

2017-09-03 Thread Łukasz Majewski

On 09/02/2017 06:38 PM, Rob Clark wrote:

Add a generic implementation of 'ls' using opendir/readdir/closedir, and
replace fat's custom implementation.  Other filesystems should move to
the generic implementation after they add opendir/readdir/closedir
support.



Reviewed-by: Łukasz Majewski 


Signed-off-by: Rob Clark 
---
  fs/fat/fat.c  | 32 
  fs/fs.c   | 35 +--
  include/fat.h |  5 -
  3 files changed, 37 insertions(+), 35 deletions(-)

diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index d30ef3903b..fc3106aacb 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -1002,38 +1002,6 @@ int file_fat_detectfs(void)
return 0;
  }
  
-int file_fat_ls(const char *dir)

-{
-   fsdata fsdata;
-   fat_itr itrblock, *itr = &itrblock;
-   int files = 0, dirs = 0;
-   int ret;
-
-   ret = fat_itr_root(itr, &fsdata);
-   if (ret)
-   return ret;
-
-   ret = fat_itr_resolve(itr, dir, TYPE_DIR);
-   if (ret)
-   return ret;
-
-   while (fat_itr_next(itr)) {
-   if (fat_itr_isdir(itr)) {
-   printf("%s/\n", itr->name);
-   dirs++;
-   } else {
-   printf(" %8u   %s\n",
-  FAT2CPU32(itr->dent->size),
-  itr->name);
-   files++;
-   }
-   }
-
-   printf("\n%d file(s), %d dir(s)\n\n", files, dirs);
-
-   return 0;
-}
-
  int fat_exists(const char *filename)
  {
fsdata fsdata;
diff --git a/fs/fs.c b/fs/fs.c
index 441c880654..716c223ec6 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -37,6 +37,35 @@ static inline int fs_ls_unsupported(const char *dirname)
return -1;
  }
  
+/* generic implementation of ls in terms of opendir/readdir/closedir */

+__maybe_unused
+static int fs_ls_generic(const char *dirname)
+{
+   FS_DIR *dirp;
+   struct fs_dirent *dent;
+   int files = 0, dirs = 0;
+
+   dirp = fs_opendir(dirname);
+   if (!dirp)
+   return -errno;
+
+   while ((dent = fs_readdir(dirp))) {
+   if (dent->type == FS_DT_DIR) {
+   printf("%s/\n", dent->name);
+   dirs++;
+   } else {
+   printf(" %8lld   %s\n", dent->size, dent->name);
+   files++;
+   }
+   }
+
+   fs_closedir(dirp);
+
+   printf("\n%d file(s), %d dir(s)\n\n", files, dirs);
+
+   return 0;
+}
+
  static inline int fs_exists_unsupported(const char *filename)
  {
return 0;
@@ -111,7 +140,7 @@ static struct fstype_info fstypes[] = {
.null_dev_desc_ok = false,
.probe = fat_set_blk_dev,
.close = fat_close,
-   .ls = file_fat_ls,
+   .ls = fs_ls_generic,
.exists = fat_exists,
.size = fat_size,
.read = fat_read_file,
@@ -121,7 +150,9 @@ static struct fstype_info fstypes[] = {
.write = fs_write_unsupported,
  #endif
.uuid = fs_uuid_unsupported,
-   .opendir = fs_opendir_unsupported,
+   .opendir = fat_opendir,
+   .readdir = fat_readdir,
+   .closedir = fat_closedir,
},
  #endif
  #ifdef CONFIG_FS_EXT4
diff --git a/include/fat.h b/include/fat.h
index 1e8bc44e9a..b2d4b952fd 100644
--- a/include/fat.h
+++ b/include/fat.h
@@ -11,6 +11,7 @@
  #define _FAT_H_
  
  #include 

+#include 
  
  #define CONFIG_SUPPORT_VFAT

  /* Maximum Long File Name length supported here is 128 UTF-16 code units */
@@ -172,7 +173,6 @@ typedef struct {
  } fsdata;
  
  int file_fat_detectfs(void);

-int file_fat_ls(const char *dir);
  int fat_exists(const char *filename);
  int fat_size(const char *filename, loff_t *size);
  int file_fat_read_at(const char *filename, loff_t pos, void *buffer,
@@ -185,5 +185,8 @@ int file_fat_write(const char *filename, void *buf, loff_t 
offset, loff_t len,
   loff_t *actwrite);
  int fat_read_file(const char *filename, void *buf, loff_t offset, loff_t len,
  loff_t *actread);
+int fat_opendir(const char *filename, FS_DIR **dirp);
+int fat_readdir(FS_DIR *dirp);
+void fat_closedir(FS_DIR *dirp);
  void fat_close(void);
  #endif /* _FAT_H_ */




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 5/8] fs/fat: implement opendir/readdir/closedir

2017-09-03 Thread Łukasz Majewski

On 09/02/2017 06:38 PM, Rob Clark wrote:

Implement the readdir interface using the directory iterators.



Reviewed-by: Łukasz Majewski 


Signed-off-by: Rob Clark 
---
  fs/fat/fat.c | 56 
  1 file changed, 56 insertions(+)

diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 3193290434..d30ef3903b 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -14,6 +14,7 @@
  #include 
  #include 
  #include 
+#include 
  #include 
  #include 
  #include 
@@ -1119,6 +1120,61 @@ int fat_read_file(const char *filename, void *buf, 
loff_t offset, loff_t len,
return ret;
  }
  
+typedef struct {

+   FS_DIR parent;
+   fsdata fsdata;
+   fat_itr itr;
+} fat_dir;
+
+int fat_opendir(const char *filename, FS_DIR **dirp)
+{
+   fat_dir *dir = malloc(sizeof(*dir));
+   int ret;
+
+   if (!dir)
+   return -ENOMEM;
+
+   ret = fat_itr_root(&dir->itr, &dir->fsdata);
+   if (ret)
+   goto fail;
+
+   ret = fat_itr_resolve(&dir->itr, filename, TYPE_DIR);
+   if (ret)
+   goto fail;
+
+   *dirp = (FS_DIR *)dir;
+   return 0;
+
+fail:
+   free(dir);
+   return ret;
+}
+
+int fat_readdir(FS_DIR *dirp)
+{
+   fat_dir *dir = (fat_dir *)dirp;
+   struct fs_dirent *dent = &dirp->dirent;
+
+   if (!fat_itr_next(&dir->itr))
+   return -ENOENT;
+
+   strcpy(dent->name, dir->itr.name);
+   if (fat_itr_isdir(&dir->itr)) {
+   dent->type = FS_DT_DIR;
+   } else {
+   dent->type = FS_DT_REG;
+   dent->size = FAT2CPU32(dir->itr.dent->size);
+   }
+
+   return 0;
+}
+
+void fat_closedir(FS_DIR *dirp)
+{
+   fat_dir *dir = (fat_dir *)dirp;
+   free(dir);
+}
+
  void fat_close(void)
  {
  }




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 4/8] fs: add fs_readdir()

2017-09-03 Thread Łukasz Majewski

On 09/02/2017 06:37 PM, Rob Clark wrote:

Needed to support efi file protocol.  The fallback.efi loader wants
to be able to read the contents of the /EFI directory to find an OS
to boot.

Modelled after POSIX opendir()/readdir()/closedir().  Unlike the other
fs APIs, this is stateful (ie. state is held in the FS_DIR "directory
stream"), to avoid re-traversing of the directory structure at each
step.  The directory stream must be released with closedir() when it
is no longer needed.



Reviewed-by: Łukasz Majewski 


Signed-off-by: Rob Clark 
---
  disk/part.c| 31 
  fs/fs.c| 91 ++
  include/fs.h   | 55 +++
  include/part.h |  4 +++
  4 files changed, 169 insertions(+), 12 deletions(-)

diff --git a/disk/part.c b/disk/part.c
index c67fdacc79..aa9183d696 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -331,6 +331,24 @@ int part_get_info(struct blk_desc *dev_desc, int part,
return -1;
  }
  
+int part_get_info_whole_disk(struct blk_desc *dev_desc, disk_partition_t *info)

+{
+   info->start = 0;
+   info->size = dev_desc->lba;
+   info->blksz = dev_desc->blksz;
+   info->bootable = 0;
+   strcpy((char *)info->type, BOOT_PART_TYPE);
+   strcpy((char *)info->name, "Whole Disk");
+#if CONFIG_IS_ENABLED(PARTITION_UUIDS)
+   info->uuid[0] = 0;
+#endif
+#ifdef CONFIG_PARTITION_TYPE_GUID
+   info->type_guid[0] = 0;
+#endif
+
+   return 0;
+}
+
  int blk_get_device_by_str(const char *ifname, const char *dev_hwpart_str,
  struct blk_desc **dev_desc)
  {
@@ -523,18 +541,7 @@ int blk_get_device_part_str(const char *ifname, const char 
*dev_part_str,
  
  		(*dev_desc)->log2blksz = LOG2((*dev_desc)->blksz);
  
-		info->start = 0;

-   info->size = (*dev_desc)->lba;
-   info->blksz = (*dev_desc)->blksz;
-   info->bootable = 0;
-   strcpy((char *)info->type, BOOT_PART_TYPE);
-   strcpy((char *)info->name, "Whole Disk");
-#if CONFIG_IS_ENABLED(PARTITION_UUIDS)
-   info->uuid[0] = 0;
-#endif
-#ifdef CONFIG_PARTITION_TYPE_GUID
-   info->type_guid[0] = 0;
-#endif
+   part_get_info_whole_disk(*dev_desc, info);
  
  		ret = 0;

goto cleanup;
diff --git a/fs/fs.c b/fs/fs.c
index 13cd3626c6..441c880654 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -21,6 +21,7 @@
  DECLARE_GLOBAL_DATA_PTR;
  
  static struct blk_desc *fs_dev_desc;

+static int fs_dev_part;
  static disk_partition_t fs_partition;
  static int fs_type = FS_TYPE_ANY;
  
@@ -69,6 +70,11 @@ static inline int fs_uuid_unsupported(char *uuid_str)

return -1;
  }
  
+static inline int fs_opendir_unsupported(const char *filename, FS_DIR **dirp)

+{
+   return -EACCES;
+}
+
  struct fstype_info {
int fstype;
char *name;
@@ -92,6 +98,9 @@ struct fstype_info {
 loff_t len, loff_t *actwrite);
void (*close)(void);
int (*uuid)(char *uuid_str);
+   int (*opendir)(const char *filename, FS_DIR **dirp);
+   int (*readdir)(FS_DIR *dirp);
+   void (*closedir)(FS_DIR *dirp);
  };
  
  static struct fstype_info fstypes[] = {

@@ -112,6 +121,7 @@ static struct fstype_info fstypes[] = {
.write = fs_write_unsupported,
  #endif
.uuid = fs_uuid_unsupported,
+   .opendir = fs_opendir_unsupported,
},
  #endif
  #ifdef CONFIG_FS_EXT4
@@ -131,6 +141,7 @@ static struct fstype_info fstypes[] = {
.write = fs_write_unsupported,
  #endif
.uuid = ext4fs_uuid,
+   .opendir = fs_opendir_unsupported,
},
  #endif
  #ifdef CONFIG_SANDBOX
@@ -146,6 +157,7 @@ static struct fstype_info fstypes[] = {
.read = fs_read_sandbox,
.write = fs_write_sandbox,
.uuid = fs_uuid_unsupported,
+   .opendir = fs_opendir_unsupported,
},
  #endif
  #ifdef CONFIG_CMD_UBIFS
@@ -161,6 +173,7 @@ static struct fstype_info fstypes[] = {
.read = ubifs_read,
.write = fs_write_unsupported,
.uuid = fs_uuid_unsupported,
+   .opendir = fs_opendir_unsupported,
},
  #endif
{
@@ -175,6 +188,7 @@ static struct fstype_info fstypes[] = {
.read = fs_read_unsupported,
.write = fs_write_unsupported,
.uuid = fs_uuid_unsupported,
+   .opendir = fs_opendir_unsupported,
},
  };
  
@@ -228,6 +242,31 @@ int fs_set_blk_dev(const char *ifname, const char *dev_part_str, int fstype)
  
  		if (!info->probe(fs_dev_desc, &fs_partition)) {

fs_type = info->fstype;
+   fs_dev_part = part;
+   return 0;
+   

Re: [U-Boot] [PATCH v2 3/8] fat/fs: convert to directory iterators

2017-09-03 Thread Łukasz Majewski

On 09/02/2017 06:37 PM, Rob Clark wrote:

And drop a whole lot of ugly code!


+1

Reviewed-by: Łukasz Majewski 




Signed-off-by: Rob Clark 
---
  fs/fat/fat.c  | 723 ++
  include/fat.h |   6 -
  2 files changed, 75 insertions(+), 654 deletions(-)

diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index c72d6ca931..3193290434 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -119,22 +119,6 @@ int fat_register_device(struct blk_desc *dev_desc, int 
part_no)
  }
  
  /*

- * Get the first occurence of a directory delimiter ('/' or '\') in a string.
- * Return index into string if found, -1 otherwise.
- */
-static int dirdelim(char *str)
-{
-   char *start = str;
-
-   while (*str != '\0') {
-   if (ISDIRDELIM(*str))
-   return str - start;
-   str++;
-   }
-   return -1;
-}
-
-/*
   * Extract zero terminated short name from a directory entry.
   */
  static void get_name(dir_entry *dirent, char *s_name)
@@ -468,95 +452,6 @@ static int slot2str(dir_slot *slotptr, char *l_name, int 
*idx)
return 0;
  }
  
-/*

- * Extract the full long filename starting at 'retdent' (which is really
- * a slot) into 'l_name'. If successful also copy the real directory entry
- * into 'retdent'
- * Return 0 on success, -1 otherwise.
- */
-static int
-get_vfatname(fsdata *mydata, int curclust, __u8 *cluster,
-dir_entry *retdent, char *l_name)
-{
-   dir_entry *realdent;
-   dir_slot *slotptr = (dir_slot *)retdent;
-   __u8 *buflimit = cluster + mydata->sect_size * ((curclust == 0) ?
-   PREFETCH_BLOCKS :
-   mydata->clust_size);
-   __u8 counter = (slotptr->id & ~LAST_LONG_ENTRY_MASK) & 0xff;
-   int idx = 0;
-
-   if (counter > VFAT_MAXSEQ) {
-   debug("Error: VFAT name is too long\n");
-   return -1;
-   }
-
-   while ((__u8 *)slotptr < buflimit) {
-   if (counter == 0)
-   break;
-   if (((slotptr->id & ~LAST_LONG_ENTRY_MASK) & 0xff) != counter)
-   return -1;
-   slotptr++;
-   counter--;
-   }
-
-   if ((__u8 *)slotptr >= buflimit) {
-   dir_slot *slotptr2;
-
-   if (curclust == 0)
-   return -1;
-   curclust = get_fatent(mydata, curclust);
-   if (CHECK_CLUST(curclust, mydata->fatsize)) {
-   debug("curclust: 0x%x\n", curclust);
-   printf("Invalid FAT entry\n");
-   return -1;
-   }
-
-   if (get_cluster(mydata, curclust, get_contents_vfatname_block,
-   mydata->clust_size * mydata->sect_size) != 0) {
-   debug("Error: reading directory block\n");
-   return -1;
-   }
-
-   slotptr2 = (dir_slot *)get_contents_vfatname_block;
-   while (counter > 0) {
-   if (((slotptr2->id & ~LAST_LONG_ENTRY_MASK)
-   & 0xff) != counter)
-   return -1;
-   slotptr2++;
-   counter--;
-   }
-
-   /* Save the real directory entry */
-   realdent = (dir_entry *)slotptr2;
-   while ((__u8 *)slotptr2 > get_contents_vfatname_block) {
-   slotptr2--;
-   slot2str(slotptr2, l_name, &idx);
-   }
-   } else {
-   /* Save the real directory entry */
-   realdent = (dir_entry *)slotptr;
-   }
-
-   do {
-   slotptr--;
-   if (slot2str(slotptr, l_name, &idx))
-   break;
-   } while (!(slotptr->id & LAST_LONG_ENTRY_MASK));
-
-   l_name[idx] = '\0';
-   if (*l_name == DELETED_FLAG)
-   *l_name = '\0';
-   else if (*l_name == aRING)
-   *l_name = DELETED_FLAG;
-   downcase(l_name);
-
-   /* Return the real directory entry */
-   memcpy(retdent, realdent, sizeof(dir_entry));
-
-   return 0;
-}
-
  /* Calculate short name checksum */
  static __u8 mkcksum(const char name[8], const char ext[3])
  {
@@ -572,170 +467,11 @@ static __u8 mkcksum(const char name[8], const char 
ext[3])
return ret;
  }
  
-/*

- * Get the directory entry associated with 'filename' from the directory
- * starting at 'startsect'
- */
+// These should probably DIAF..
  __u8 get_dentfromdir_block[MAX_CLUSTSIZE]
__aligned(ARCH_DMA_MINALIGN);
-
-static dir_entry *get_dentfromdir(fs

Re: [U-Boot] [PATCH v2 2/8] fs/fat: introduce new director iterators

2017-09-03 Thread Łukasz Majewski

On 09/02/2017 06:37 PM, Rob Clark wrote:

Untangle directory traversal into a simple iterator, to replace the
existing multi-purpose do_fat_read_at() + get_dentfromdir().

Signed-off-by: Rob Clark 


Reviewed-by: Łukasz Majewski 


---
  fs/fat/fat.c | 326 +++
  1 file changed, 326 insertions(+)

diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index e1c0a15dc7..c72d6ca931 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -1245,6 +1245,332 @@ exit:
return ret;
  }
  
+

+/*
+ * Directory iterator, to simplify filesystem traversal
+ */
+
+typedef struct {
+   fsdata*fsdata;
+   unsigned   cursect;
+   dir_entry *dent;
+   intremaining; /* remaining dent's in current cluster */
+   intlast_cluster;
+   intis_root;
+
+   /* current iterator position values: */
+   char   l_name[VFAT_MAXLEN_BYTES];
+   char   s_name[14];
+   char  *name;  /* l_name if there is one, else s_name */
+
+   u8 block[MAX_CLUSTSIZE] __aligned(ARCH_DMA_MINALIGN);
+} fat_itr;
+
+static int fat_itr_isdir(fat_itr *itr);
+
+/**
+ * fat_itr_root() - initialize an iterator to start at the root
+ * directory
+ *
+ * @itr: iterator to initialize
+ * @fsdata: filesystem data for the partition
+ * @return 0 on success, else -errno
+ */
+static int fat_itr_root(fat_itr *itr, fsdata *fsdata)
+{
+   if (get_fs_info(fsdata))
+   return -ENXIO;
+
+   itr->fsdata = fsdata;
+   itr->cursect = fsdata->rootdir_sect;
+   itr->dent = NULL;
+   itr->remaining = 0;
+   itr->last_cluster = 0;
+   itr->is_root = 1;
+
+   return 0;
+}
+
+/**
+ * fat_itr_child() - initialize an iterator to descend into a sub-
+ * directory
+ *
+ * Initializes 'itr' to iterate the contents of the directory at
+ * the current cursor position of 'parent'.  It is an error to
+ * call this if the current cursor of 'parent' is pointing at a
+ * regular file.
+ *
+ * Note that 'itr' and 'parent' can be the same pointer if you do
+ * not need to preserve 'parent' after this call, which is useful
+ * for traversing directory structure to resolve a file/directory.
+ *
+ * @itr: iterator to initialize
+ * @parent: the iterator pointing at a directory entry in the
+ *parent directory of the directory to iterate
+ */
+static void fat_itr_child(fat_itr *itr, fat_itr *parent)
+{
+   fsdata *mydata = parent->fsdata;  /* for silly macros */
+   unsigned clustnum = START(parent->dent);
+
+   assert(fat_itr_isdir(parent));
+
+   itr->fsdata = parent->fsdata;
+   if (clustnum > 0) {
+   itr->cursect = itr->fsdata->data_begin +
+   (clustnum * itr->fsdata->clust_size);
+   } else {
+   itr->cursect = parent->fsdata->rootdir_sect;
+   }
+   itr->dent = NULL;
+   itr->remaining = 0;
+   itr->last_cluster = 0;
+   itr->is_root = 0;
+}
+
+static void *next_cluster(fat_itr *itr)
+{
+   fsdata *mydata = itr->fsdata;  /* for silly macros */
+   int ret;
+
+   /* have we reached the end? */
+   if (itr->last_cluster)
+   return NULL;
+
+   debug("FAT read(sect=%d), clust_size=%d, DIRENTSPERBLOCK=%zd\n",
+ itr->cursect, itr->fsdata->clust_size, DIRENTSPERBLOCK);
+
+   /*
+* NOTE: do_fat_read_at() had complicated logic to deal w/
+* vfat names that span multiple clusters in the fat16 case,
+* which get_dentfromdir() probably also needed (and was
+* missing).  And not entirely sure what fat32 didn't have
+* the same issue..  We solve that by only caring about one
+* dent at a time and iteratively constructing the vfat long
+* name.
+*/
+   ret = disk_read(itr->cursect, itr->fsdata->clust_size,
+   itr->block);
+   if (ret < 0) {
+   debug("Error: reading block\n");
+   return NULL;
+   }
+
+   if (itr->is_root && itr->fsdata->fatsize != 32) {
+   itr->cursect++;
+   if (itr->cursect - itr->fsdata->rootdir_sect >=
+   itr->fsdata->rootdir_size) {
+   debug("cursect: 0x%x\n", itr->cursect);
+   itr->last_cluster = 1;
+   }
+   } else {
+   itr->cursect = get_fatent(itr->fsdata, itr->cursect);
+   if (CHECK_CLUST(itr->cursect, itr->fsdata->fatsize)) {
+   debug("cursect: 0x%x\n", itr->cursect);
+   itr->last_cluster = 1;
+   }
+   }
+
+   return itr->block;
+}
+
+static dir_entry *next_dent(fat_itr 

Re: [U-Boot] [PATCH v2 1/8] fs/fat: split out helper to init fsdata

2017-09-03 Thread Łukasz Majewski

On 09/02/2017 06:37 PM, Rob Clark wrote:

Want to re-use this in fat dirent iterator in next patch.

Signed-off-by: Rob Clark 


Reviewed-by: Łukasz Majewski 


---
  fs/fat/fat.c  | 73 +++
  include/fat.h |  1 +
  2 files changed, 44 insertions(+), 30 deletions(-)

diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 465a6875ed..e1c0a15dc7 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -808,35 +808,17 @@ exit:
return ret;
  }
  
-__u8 do_fat_read_at_block[MAX_CLUSTSIZE]

-   __aligned(ARCH_DMA_MINALIGN);
-
-int do_fat_read_at(const char *filename, loff_t pos, void *buffer,
-  loff_t maxsize, int dols, int dogetsize, loff_t *size)
+static int get_fs_info(fsdata *mydata)
  {
-   char fnamecopy[2048];
boot_sector bs;
volume_info volinfo;
-   fsdata datablock;
-   fsdata *mydata = &datablock;
-   dir_entry *dentptr = NULL;
-   __u16 prevcksum = 0x;
-   char *subname = "";
-   __u32 cursect;
-   int idx, isdir = 0;
-   int files = 0, dirs = 0;
-   int ret = -1;
-   int firsttime;
__u32 root_cluster = 0;
-   __u32 read_blk;
-   int rootdir_size = 0;
-   int buffer_blk_cnt;
-   int do_read;
-   __u8 *dir_ptr;
+   int ret;
  
-	if (read_bootsectandvi(&bs, &volinfo, &mydata->fatsize)) {

+   ret = read_bootsectandvi(&bs, &volinfo, &mydata->fatsize);
+   if (ret) {
debug("Error: reading boot sector\n");
-   return -1;
+   return ret;
}
  
  	if (mydata->fatsize == 32) {

@@ -848,8 +830,7 @@ int do_fat_read_at(const char *filename, loff_t pos, void 
*buffer,
  
  	mydata->fat_sect = bs.reserved;
  
-	cursect = mydata->rootdir_sect

-   = mydata->fat_sect + mydata->fatlength * bs.fats;
+   mydata->rootdir_sect = mydata->fat_sect + mydata->fatlength * bs.fats;
  
  	mydata->sect_size = (bs.sector_size[1] << 8) + bs.sector_size[0];

mydata->clust_size = bs.cluster_size;
@@ -863,12 +844,12 @@ int do_fat_read_at(const char *filename, loff_t pos, void 
*buffer,
mydata->data_begin = mydata->rootdir_sect -
(mydata->clust_size * 2);
} else {
-   rootdir_size = ((bs.dir_entries[1]  * (int)256 +
-bs.dir_entries[0]) *
-sizeof(dir_entry)) /
-mydata->sect_size;
+   mydata->rootdir_size = ((bs.dir_entries[1]  * (int)256 +
+bs.dir_entries[0]) *
+sizeof(dir_entry)) /
+mydata->sect_size;
mydata->data_begin = mydata->rootdir_sect +
-   rootdir_size -
+   mydata->rootdir_size -
(mydata->clust_size * 2);
}
  
@@ -893,6 +874,38 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer,

debug("Sector size: %d, cluster size: %d\n", mydata->sect_size,
  mydata->clust_size);
  
+	return 0;

+}
+
+__u8 do_fat_read_at_block[MAX_CLUSTSIZE]
+   __aligned(ARCH_DMA_MINALIGN);
+
+int do_fat_read_at(const char *filename, loff_t pos, void *buffer,
+  loff_t maxsize, int dols, int dogetsize, loff_t *size)
+{
+   char fnamecopy[2048];
+   fsdata datablock;
+   fsdata *mydata = &datablock;
+   dir_entry *dentptr = NULL;
+   __u16 prevcksum = 0x;
+   char *subname = "";
+   __u32 cursect;
+   int idx, isdir = 0;
+   int files = 0, dirs = 0;
+   int ret = -1;
+   int firsttime;
+   __u32 root_cluster = 0;
+   __u32 read_blk;
+   int rootdir_size = 0;
+   int buffer_blk_cnt;
+   int do_read;
+   __u8 *dir_ptr;
+
+   if (get_fs_info(mydata))
+   return -1;
+
+   cursect = mydata->rootdir_sect;
+
/* "cwd" is always the root... */
while (ISDIRDELIM(*filename))
filename++;
diff --git a/include/fat.h b/include/fat.h
index 71879f01ca..6d3fc8e4a6 100644
--- a/include/fat.h
+++ b/include/fat.h
@@ -174,6 +174,7 @@ typedef struct {
__u16   clust_size; /* Size of clusters in sectors */
int data_begin; /* The sector of the first cluster, can be 
negative */
int fatbufnum;  /* Used by get_fatent, init to -1 */
+   int rootdir_size;
  } fsdata;
  
  typedef int	(file_detectfs_func)(void);





--
Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax

Re: [U-Boot] [PATCH v3 1/1] usb: gadget: g_dnl: Sync internal SN variable with env

2017-09-02 Thread Łukasz Majewski

Hi Heiko,

Would you find some time and run this patch through your test setup?

Thanks in advance.

Best regards,
Łukasz



Since commit 842778a09104 ("usb: gadget: g_dnl: only set iSerialNumber
if we have a serial#") "fastboot devices" stopped to show correct device
serial number for TI boards, showing this line instead:

fastboot

This is because serial# env variable could be set after g_dnl gadget was
initialized (e.g. by using env_set() in the board file).

To fix this, let's update internal serial number variable (g_dnl_serial)
when "serial#" env var is changed.

Signed-off-by: Sam Protsenko 
Cc: Felipe Balbi 
---
 drivers/usb/gadget/g_dnl.c | 15 +++
 include/env_callback.h |  1 +
 2 files changed, 16 insertions(+)

diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
index 0491a0eea9..039331a5af 100644
--- a/drivers/usb/gadget/g_dnl.c
+++ b/drivers/usb/gadget/g_dnl.c
@@ -19,6 +19,8 @@
 #include 
 #include 

+#include 
+
 #include "gadget_chips.h"
 #include "composite.c"

@@ -202,6 +204,19 @@ static int g_dnl_get_bcd_device_number(struct 
usb_composite_dev *cdev)
return g_dnl_get_board_bcd_device_number(gcnum);
 }

+/**
+ * Update internal serial number variable when the "serial#" env var changes.
+ *
+ * Handle all cases, even when flags == H_PROGRAMMATIC or op == env_op_delete.
+ */
+static int on_serialno(const char *name, const char *value, enum env_op op,
+   int flags)
+{
+   g_dnl_set_serialnumber((char *)value);
+   return 0;
+}
+U_BOOT_ENV_CALLBACK(serialno, on_serialno);
+
 static int g_dnl_bind(struct usb_composite_dev *cdev)
 {
struct usb_gadget *gadget = cdev->gadget;
diff --git a/include/env_callback.h b/include/env_callback.h
index 90b95b5e66..5c4a30c2de 100644
--- a/include/env_callback.h
+++ b/include/env_callback.h
@@ -72,6 +72,7 @@
SILENT_CALLBACK \
SPLASHIMAGE_CALLBACK \
"stdin:console,stdout:console,stderr:console," \
+   "serial#:serialno," \
CONFIG_ENV_CALLBACK_LIST_STATIC

 struct env_clbk_tbl {




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable to set g_dnl_serial

2017-09-01 Thread Łukasz Majewski

On 09/01/2017 11:51 AM, Marek Vasut wrote:

On 09/01/2017 10:36 AM, Łukasz Majewski wrote:

On 09/01/2017 10:19 AM, Marek Vasut wrote:

On 08/31/2017 08:20 PM, Sam Protsenko wrote:

Since 842778a09104 commit, "fastboot devices" stopped to show correct
device serial number for TI boards, showing this line instead:

fastboot

This is because serial# env variable could be set after g_dnl gadget was
initialized (e.g. by using env_set() in the board file).

To fix this, before checking g_dnl_serial, let's re-check if we have
valid serial# value. And if so, let's set it as g_dnl_serial value.

Signed-off-by: Sam Protsenko 


Can't we use U_BOOT_ENV_CALLBACK() here instead and set the serial
number when the environment variable is set ?


Hmm... This might work.

However, I'm a bit concerned with having "bound" the one particular env
variable ("serial#" in this case) to generic g_dnl.c code.

That's a separate problem though, we already have this serial# variable
in place.


Do you mean that it is the same of "fixed" variable, as "ipaddr" is for 
network subsytem?







--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable to set g_dnl_serial

2017-09-01 Thread Łukasz Majewski

On 09/01/2017 10:19 AM, Marek Vasut wrote:

On 08/31/2017 08:20 PM, Sam Protsenko wrote:

Since 842778a09104 commit, "fastboot devices" stopped to show correct
device serial number for TI boards, showing this line instead:

fastboot

This is because serial# env variable could be set after g_dnl gadget was
initialized (e.g. by using env_set() in the board file).

To fix this, before checking g_dnl_serial, let's re-check if we have
valid serial# value. And if so, let's set it as g_dnl_serial value.

Signed-off-by: Sam Protsenko 


Can't we use U_BOOT_ENV_CALLBACK() here instead and set the serial
number when the environment variable is set ?


Hmm... This might work.

However, I'm a bit concerned with having "bound" the one particular env 
variable ("serial#" in this case) to generic g_dnl.c code.






---
 drivers/usb/gadget/g_dnl.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
index 0491a0eea9..e4d0289757 100644
--- a/drivers/usb/gadget/g_dnl.c
+++ b/drivers/usb/gadget/g_dnl.c
@@ -226,6 +226,15 @@ static int g_dnl_bind(struct usb_composite_dev *cdev)

g_dnl_bind_fixup(&device_desc, cdev->driver->name);

+   /* First try to obtain serial number from serial# variable */
+   if (strlen(g_dnl_serial) == 0) {
+   const char *s;
+
+   s = env_get("serial#");
+   if (s)
+   g_dnl_set_serialnumber((char *)s);
+   }
+
if (strlen(g_dnl_serial)) {
id = usb_string_id(cdev);
if (id < 0)







--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable to set g_dnl_serial

2017-08-31 Thread Łukasz Majewski

On 08/31/2017 08:45 PM, Sam Protsenko wrote:

On 31 August 2017 at 21:20, Sam Protsenko  wrote:

Since 842778a09104 commit, "fastboot devices" stopped to show correct
device serial number for TI boards, showing this line instead:

fastboot

This is because serial# env variable could be set after g_dnl gadget was
initialized (e.g. by using env_set() in the board file).

To fix this, before checking g_dnl_serial, let's re-check if we have
valid serial# value. And if so, let's set it as g_dnl_serial value.

Signed-off-by: Sam Protsenko 
---
 drivers/usb/gadget/g_dnl.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
index 0491a0eea9..e4d0289757 100644
--- a/drivers/usb/gadget/g_dnl.c
+++ b/drivers/usb/gadget/g_dnl.c
@@ -226,6 +226,15 @@ static int g_dnl_bind(struct usb_composite_dev *cdev)

g_dnl_bind_fixup(&device_desc, cdev->driver->name);

+   /* First try to obtain serial number from serial# variable */
+   if (strlen(g_dnl_serial) == 0) {
+   const char *s;
+
+   s = env_get("serial#");
+   if (s)
+   g_dnl_set_serialnumber((char *)s);
+   }
+
if (strlen(g_dnl_serial)) {
id = usb_string_id(cdev);
if (id < 0)
--
2.14.1



Similar commit: [1]. But I'm not sure that implementing
g_dnl_bind_fixup() in board file is the best way to fix it.

[1] 
http://git.denx.de/?p=u-boot.git;a=commit;h=e91ead868b536d0a0dc49aa48f4d8c80c1a94b79



I would opt for having g_dnl_bind_fixup() since it is generally used for 
tweaking board specific data to gadget subsystem (like vid, pid, serial 
number).



--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2] dm: core: Add livetree documentation

2017-08-31 Thread Łukasz Majewski

On 08/31/2017 02:00 PM, Simon Glass wrote:

On 31 August 2017 at 19:59, Simon Glass  wrote:

Add some documentation for the live device tree support in U-Boot. This
was missing from the initial series.

Signed-off-by: Simon Glass 
Suggested-by: Lukasz Majewski 


Reviewed-by: Łukasz Majewski 

(I hope this is OK, I just fixed the typos)



Thanks :-)

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] am33xx ddr tests

2017-08-29 Thread Łukasz Majewski

On 08/27/2017 03:40 PM, Ryan wrote:

Hello,

I have 2 chips which are 512mb each connected to the AM33xx processor.

I want to check if the base address is configured for each chip in
u-boot or kernel.


Could you be more specific here?

In u-boot (SPL + u-boot.img) the DDRs are configured.

When you boot up your CPU, the SPL is executed in SDRAM (static RAM, not 
DDR). Also in SPL you have DDR initialization (@ 
arch/arm/mach-omap2/emif-common.c).




If it is configured in u-boot can anyone point me to where it is configured.

The problem i am facing is i dont if i need to do a
mtest 0x840 0xC00


If you want to test the DDR memory, you can do it in SPL with POST 
framework.



.
or

mtest 0x840 0xA00.
mtest 0xC00 0xE00


Please also be aware that u-boot relocates itself,so almost always it is 
END_OF_RAM - size of u-boot (including .data, .bss sections).




Also, is 64MB sufficient for u-boot to function. What is the least
starting address i can give for mtest.


Is your u-boot operational?

If yes, then you can use "bdinfo" command.



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




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [GIT] Pull request: u-boot-dfu

2017-08-28 Thread Łukasz Majewski

On 08/28/2017 10:32 PM, Marek Vasut wrote:

On 08/28/2017 09:28 PM, Łukasz Majewski wrote:

Dear Marek,

Those patches are preferably for -next merge widow.



The following changes since commit
ae61b5353b48fa49c66376f273cc53cd3c06b656:

  usb: dwc3: fix Kconfig dependency to accept host driver in
drivers/usb/dwc3 (2017-08-25 11:23:27 +0200)

are available in the git repository at:

  u-boot-denx-dfu/master


Might be a good idea to put it into -next branch then.


+1.

I will create -next branch :-)

BR,
Łukasz



Applied


for you to fetch changes up to 6496bc35d93975f01551dc3960b88807eae9d6fb:

  rockchip: rk3288: enable rockusb support on rk3288 based device
(2017-08-28 21:20:50 +0200)


Eddie Cai (4):
  usb: rockchip: add the rockusb gadget
  usb: rockchip: add rockusb command
  rockchip:usb: add a simple readme for rockusb
  rockchip: rk3288: enable rockusb support on rk3288 based device

 arch/arm/include/asm/arch-rockchip/f_rockusb.h | 132 
 arch/arm/mach-rockchip/Kconfig |   2 +
 cmd/Kconfig|   9 ++
 cmd/Makefile   |   1 +
 cmd/rockusb.c  |  74 
 configs/chromebit_mickey_defconfig |   9 ++
 configs/chromebook_jerry_defconfig |   9 ++
 configs/chromebook_minnie_defconfig|   9 ++
 configs/evb-rk3288_defconfig   |  10 ++
 configs/fennec-rk3288_defconfig|   6 +
 configs/firefly-rk3288_defconfig   |   6 +
 configs/miqi-rk3288_defconfig  |   6 +
 configs/phycore-rk3288_defconfig   |   7 ++
 configs/popmetal-rk3288_defconfig  |   6 +
 configs/rock2_defconfig|  10 ++
 configs/tinker-rk3288_defconfig|   6 +
 doc/README.rockusb |  51 
 drivers/usb/gadget/Kconfig |   8 ++
 drivers/usb/gadget/Makefile|   1 +
 drivers/usb/gadget/f_rockusb.c | 691
+

 include/configs/rk3288_common.h|   7 --
 21 files changed, 1053 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-rockchip/f_rockusb.h
 create mode 100644 cmd/rockusb.c
 create mode 100644 doc/README.rockusb
 create mode 100644 drivers/usb/gadget/f_rockusb.c


Travis-CI output (all clean):

https://travis-ci.org/lmajewski/u-boot-dfu/builds/269119055
https://travis-ci.org/lmajewski/u-boot-dfu/builds/269118570
https://travis-ci.org/lmajewski/u-boot-dfu/builds/269118344
https://travis-ci.org/lmajewski/u-boot-dfu/builds/269117873
https://travis-ci.org/lmajewski/u-boot-dfu/builds/269099287







--
Best regards,

Lukasz Majewski

--

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


[U-Boot] [GIT] Pull request: u-boot-dfu

2017-08-28 Thread Łukasz Majewski

Dear Marek,

Those patches are preferably for -next merge widow.



The following changes since commit ae61b5353b48fa49c66376f273cc53cd3c06b656:

  usb: dwc3: fix Kconfig dependency to accept host driver in 
drivers/usb/dwc3 (2017-08-25 11:23:27 +0200)


are available in the git repository at:

  u-boot-denx-dfu/master

for you to fetch changes up to 6496bc35d93975f01551dc3960b88807eae9d6fb:

  rockchip: rk3288: enable rockusb support on rk3288 based device 
(2017-08-28 21:20:50 +0200)



Eddie Cai (4):
  usb: rockchip: add the rockusb gadget
  usb: rockchip: add rockusb command
  rockchip:usb: add a simple readme for rockusb
  rockchip: rk3288: enable rockusb support on rk3288 based device

 arch/arm/include/asm/arch-rockchip/f_rockusb.h | 132 
 arch/arm/mach-rockchip/Kconfig |   2 +
 cmd/Kconfig|   9 ++
 cmd/Makefile   |   1 +
 cmd/rockusb.c  |  74 
 configs/chromebit_mickey_defconfig |   9 ++
 configs/chromebook_jerry_defconfig |   9 ++
 configs/chromebook_minnie_defconfig|   9 ++
 configs/evb-rk3288_defconfig   |  10 ++
 configs/fennec-rk3288_defconfig|   6 +
 configs/firefly-rk3288_defconfig   |   6 +
 configs/miqi-rk3288_defconfig  |   6 +
 configs/phycore-rk3288_defconfig   |   7 ++
 configs/popmetal-rk3288_defconfig  |   6 +
 configs/rock2_defconfig|  10 ++
 configs/tinker-rk3288_defconfig|   6 +
 doc/README.rockusb |  51 
 drivers/usb/gadget/Kconfig |   8 ++
 drivers/usb/gadget/Makefile|   1 +
 drivers/usb/gadget/f_rockusb.c | 691 
+

 include/configs/rk3288_common.h|   7 --
 21 files changed, 1053 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-rockchip/f_rockusb.h
 create mode 100644 cmd/rockusb.c
 create mode 100644 doc/README.rockusb
 create mode 100644 drivers/usb/gadget/f_rockusb.c


Travis-CI output (all clean):

https://travis-ci.org/lmajewski/u-boot-dfu/builds/269119055
https://travis-ci.org/lmajewski/u-boot-dfu/builds/269118570
https://travis-ci.org/lmajewski/u-boot-dfu/builds/269118344
https://travis-ci.org/lmajewski/u-boot-dfu/builds/269117873
https://travis-ci.org/lmajewski/u-boot-dfu/builds/269099287

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH] imx6: drop duplicated bss memset and board_init_r() call

2017-08-28 Thread Łukasz Majewski

Hi Anatolij,


bss section is cleared in crt0.S. board_init_r() is also
entered from crt0 code.


Reviewed-by: Lukasz Majewski 



Signed-off-by: Anatolij Gustschin 
Cc: Christian Gmeiner 
Cc: Nikita Kiryanov 
Cc: Jagan Teki 
Cc: Tim Harvey 
Cc: Marek Vasut 
Cc: Lukasz Majewski 
Cc: Fabio Estevam 
---
 board/bachmann/ot1200/ot1200_spl.c  | 6 --
 board/compulab/cm_fx6/spl.c | 3 ---
 board/engicam/common/spl.c  | 6 --
 board/gateworks/gw_ventana/gw_ventana_spl.c | 3 ---
 board/kosagi/novena/novena_spl.c| 6 --
 board/liebherr/mccmon6/spl.c| 6 --
 board/udoo/udoo_spl.c   | 6 --
 board/wandboard/spl.c   | 6 --
 8 files changed, 42 deletions(-)

diff --git a/board/bachmann/ot1200/ot1200_spl.c 
b/board/bachmann/ot1200/ot1200_spl.c
index 9d28da4..f3dff95 100644
--- a/board/bachmann/ot1200/ot1200_spl.c
+++ b/board/bachmann/ot1200/ot1200_spl.c
@@ -151,10 +151,4 @@ void board_init_f(ulong dummy)

/* configure MMDC for SDRAM width/size and per-model calibration */
ot1200_spl_dram_init();
-
-   /* Clear the BSS. */
-   memset(__bss_start, 0, __bss_end - __bss_start);
-
-   /* load/boot image from boot device */
-   board_init_r(NULL, 0);
 }
diff --git a/board/compulab/cm_fx6/spl.c b/board/compulab/cm_fx6/spl.c
index bba977f..56aac60 100644
--- a/board/compulab/cm_fx6/spl.c
+++ b/board/compulab/cm_fx6/spl.c
@@ -336,9 +336,6 @@ void board_init_f(ulong dummy)
puts("!!!ERROR!!! DRAM detection failed!!!\n");
hang();
}
-
-   memset(__bss_start, 0, __bss_end - __bss_start);
-   board_init_r(NULL, 0);
 }

 void board_boot_order(u32 *spl_boot_list)
diff --git a/board/engicam/common/spl.c b/board/engicam/common/spl.c
index a8a7cf3..1f2826a 100644
--- a/board/engicam/common/spl.c
+++ b/board/engicam/common/spl.c
@@ -384,10 +384,4 @@ void board_init_f(ulong dummy)

/* DDR initialization */
spl_dram_init();
-
-   /* Clear the BSS. */
-   memset(__bss_start, 0, __bss_end - __bss_start);
-
-   /* load/boot image from boot device */
-   board_init_r(NULL, 0);
 }
diff --git a/board/gateworks/gw_ventana/gw_ventana_spl.c 
b/board/gateworks/gw_ventana/gw_ventana_spl.c
index 9524da7..e107f15 100644
--- a/board/gateworks/gw_ventana/gw_ventana_spl.c
+++ b/board/gateworks/gw_ventana/gw_ventana_spl.c
@@ -637,9 +637,6 @@ void board_init_f(ulong dummy)
spl_dram_init(8 << ventana_info.sdram_width,
  16 << ventana_info.sdram_size,
  board_model);
-
-   /* Clear the BSS. */
-   memset(__bss_start, 0, __bss_end - __bss_start);
 }

 void board_boot_order(u32 *spl_boot_list)
diff --git a/board/kosagi/novena/novena_spl.c b/board/kosagi/novena/novena_spl.c
index 3645b75..ffc99b8 100644
--- a/board/kosagi/novena/novena_spl.c
+++ b/board/kosagi/novena/novena_spl.c
@@ -607,10 +607,4 @@ void board_init_f(ulong dummy)
udelay(100);
mmdc_do_write_level_calibration(&novena_ddr_info);
mmdc_do_dqs_calibration(&novena_ddr_info);
-
-   /* Clear the BSS. */
-   memset(__bss_start, 0, __bss_end - __bss_start);
-
-   /* load/boot image from boot device */
-   board_init_r(NULL, 0);
 }
diff --git a/board/liebherr/mccmon6/spl.c b/board/liebherr/mccmon6/spl.c
index 15844ef..56e7d3b 100644
--- a/board/liebherr/mccmon6/spl.c
+++ b/board/liebherr/mccmon6/spl.c
@@ -307,11 +307,5 @@ void board_init_f(ulong dummy)

/* DDR initialization */
spl_dram_init();
-
-   /* Clear the BSS. */
-   memset(__bss_start, 0, __bss_end - __bss_start);
-
-   /* load/boot image from boot device */
-   board_init_r(NULL, 0);
 }
 #endif
diff --git a/board/udoo/udoo_spl.c b/board/udoo/udoo_spl.c
index e83e7c3..34ef413 100644
--- a/board/udoo/udoo_spl.c
+++ b/board/udoo/udoo_spl.c
@@ -263,11 +263,5 @@ void board_init_f(ulong dummy)

/* DDR initialization */
spl_dram_init();
-
-   /* Clear the BSS. */
-   memset(__bss_start, 0, __bss_end - __bss_start);
-
-   /* load/boot image from boot device */
-   board_init_r(NULL, 0);
 }
 #endif
diff --git a/board/wandboard/spl.c b/board/wandboard/spl.c
index 47082a8..c3f5fff 100644
--- a/board/wandboard/spl.c
+++ b/board/wandboard/spl.c
@@ -311,11 +311,5 @@ void board_init_f(ulong dummy)

/* DDR initialization */
spl_dram_init();
-
-   /* Clear the BSS. */
-   memset(__bss_start, 0, __bss_end - __bss_start);
-
-   /* load/boot image from boot device */
-   board_init_r(NULL, 0);
 }
 #endif




--
Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http

Re: [U-Boot] [RFC PATCH 0/4] usb: net: Migrate USB Ethernet to Kconfig

2017-08-28 Thread Łukasz Majewski

Hi Chris,


I ran into a few problems running moveconfig.py mainly due to boards
that include a common .h file. I'm not confident I've captured all the
defconfigs that need CONFIG_USB_HOST_ETHER or one of the specific
drivers. Is there a more fool-proof way of catching these cases?
Needless to say this probably isn't ready for 2017.09 but hopefully I
can polish it enough for the next release.


Those patches look OK for me.

I've tried to apply them on top of u-boot-usb/master branch [1].

I've succeed with two of them (1,2), but merging third failed.

Could you rebase your patch set on top of [1] ?

Your patches will be probably merged in the next merge window.

[1] http://git.denx.de/?p=u-boot/u-boot-usb.git;a=summary



Chris Packham (4):
  Kconfig: drop CONFIG_USB_ETHER_DM9601
  Kconfig: drop CONFIG_USB_ETHER_RNDIS
  usb: net: migrate CONFIG_USB_HOST_ETHER to Kconfig
  usb: net: migrate USB Ethernet adapters to Kconfig

 configs/apalis_imx6_defconfig  |  1 +
 configs/apalis_imx6_nospl_com_defconfig|  1 +
 configs/apalis_imx6_nospl_it_defconfig |  1 +
 configs/arndale_defconfig  |  5 +++
 configs/bayleybay_defconfig|  3 ++
 configs/beaver_defconfig   |  2 +
 configs/cardhu_defconfig   |  2 +
 configs/cei-tk1-som_defconfig  |  2 +
 configs/cgtqmx6eval_defconfig  |  2 +
 configs/chromebook_link64_defconfig|  3 ++
 configs/chromebook_link_defconfig  |  3 ++
 configs/chromebook_samus_defconfig |  3 ++
 configs/chromebox_panther_defconfig|  3 ++
 configs/cl-som-am57x_defconfig |  4 ++
 configs/cm_t54_defconfig   |  4 ++
 configs/colibri_imx6_defconfig |  1 +
 configs/colibri_imx6_nospl_defconfig   |  1 +
 configs/colibri_t20_defconfig  |  2 +
 configs/colibri_t30_defconfig  |  2 +
 ...conga-qeval20-qa3-e3845-internal-uart_defconfig |  3 ++
 configs/conga-qeval20-qa3-e3845_defconfig  |  3 ++
 configs/coreboot-x86_defconfig |  3 ++
 configs/cougarcanyon2_defconfig|  3 ++
 configs/crownbay_defconfig |  3 ++
 configs/dalmore_defconfig  |  2 +
 configs/dfi-bt700-q7x-151_defconfig|  5 +++
 configs/dragonboard410c_defconfig  |  5 +++
 configs/e2220-1170_defconfig   |  2 +
 configs/evb-rk3399_defconfig   |  6 +++
 configs/fennec-rk3288_defconfig|  3 ++
 configs/firefly-rk3288_defconfig   |  3 ++
 configs/firefly-rk3399_defconfig   |  6 +++
 configs/galileo_defconfig  |  3 ++
 configs/gwventana_emmc_defconfig   |  3 ++
 configs/gwventana_gw5904_defconfig |  3 ++
 configs/gwventana_nand_defconfig   |  3 ++
 configs/harmony_defconfig  |  4 ++
 configs/hikey_defconfig|  3 ++
 configs/jetson-tk1_defconfig   |  2 +
 configs/kylin-rk3036_defconfig |  3 ++
 configs/m53evk_defconfig   |  4 ++
 configs/marsboard_defconfig|  2 +
 configs/mcx_defconfig  |  3 ++
 configs/medcom-wide_defconfig  |  2 +
 configs/minnowmax_defconfig|  3 ++
 configs/miqi-rk3288_defconfig  |  3 ++
 configs/mvebu_db-88f3720_defconfig |  5 +++
 configs/mvebu_db_armada8k_defconfig|  5 +++
 configs/mvebu_espressobin-88f3720_defconfig|  5 +++
 configs/mvebu_mcbin-88f8040_defconfig  |  5 +++
 configs/mx23_olinuxino_defconfig   |  2 +
 configs/mx28evk_auart_console_defconfig|  3 ++
 configs/mx28evk_defconfig  |  3 ++
 configs/mx28evk_nand_defconfig |  3 ++
 configs/mx28evk_spi_defconfig  |  3 ++
 configs/mx51evk_defconfig  |  3 ++
 configs/mx53loco_defconfig |  4 ++
 configs/mx6dlarm2_defconfig|  2 +
 configs/mx6dlarm2_lpddr2_defconfig |  2 +
 configs/mx6qarm2_defconfig |  2 +
 configs/mx6qarm2_lpddr2_defconfig  |  2 +
 configs/mx6qsabrelite_defconfig|  4 ++
 configs/mx6sabreauto_defconfig |  2 +
 configs/mx6sabresd_defconfig   |  2 +
 configs/mx6slevk_defconfig |  2 +
 configs/mx6slevk_spinor_defconfig  |  2 +
 configs/mx6slevk_spl_defconfig |  2 +
 configs/mx6sllevk_defconfig|  3 

Re: [U-Boot] [PATCH v2 5/6] rename GPT partitions to detect boot failure

2017-08-28 Thread Łukasz Majewski

On 08/28/2017 01:02 AM, Chaiken, Alison wrote:

On 2017-05-31 01:12, Lukasz Majewski wrote:

[ . . . ]


And another request -> Could you consider adding tests for those new
gpt commands to the 'sandbox' (sandbox_defconfig) ?

Then you can 'mount' some gpt test image ('host' command) and use it
with:
gpt  host X .


The GPT functionality really cannot be tested without a block device.
We could build the disk.raw described in board/sandbox/README.sandbox
when (CONFIG_UNIT_TEST && CONFIG_CMD_GPT_RENAME) in imitation of the
file helloworld.efi.   There would be no reason for the size to be as
large as 1200M, of course.   256KB appears to be the smallest usable
size for 4 partitions (although trying to partition a 16 KB raw object
with gdisk produces entertaining results).

To create this object for testing, we could use a subdirectory like
lib/efi_loader, but maybe doing so in test/ makes more sense?  If the
build system did create the object, then we could modify
board/sandbox/README.sandbox to so indicate.   Then the test should go
in test/py/tests presumably.


If you have encountered some issues with adding this test to sandbox 
(and those are difficult to solve), then it would be also correct to add 
this test to test/py and run it on a real HW.


Please also keep in mind to provide some kind of verbose in-code 
description or proper documentation entry.




Thanks for feedback,
Alison

---
Alison Chaiken  ali...@she-devel.com
http://{ she-devel.com, exerciseforthereader.org }
"We are giving up our privacy, one convenience at a time." -- Evangelos
Simoudis




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH] fix: fw_env: Prevent writing error message on special files, which don't support fsync

2017-08-27 Thread Łukasz Majewski

Hi Michael,


Hi Lukasz,

Am Sonntag, 27. August 2017, 13:46:22 CEST schrieb Lukasz Majewski:

According to fsync specification [1] some special files (e.g., a pipe, FIFO,
or socket) don't support synchronization and return either EROFS or EINVAL.

On the linux side the sys_fsync -> do_fsync() checks if the requested file
has f_op->fsync defined. If not it returns EINVAL [2].

This commit prevents writing error messages for files (devices), which
do not support fsync().

[1] - http://man7.org/linux/man-pages/man2/fsync.2.html
[2] - http://elixir.free-electrons.com/linux/v4.13-rc6/source/fs/sync.c#L183

Signed-off-by: Lukasz Majewski 
---
 tools/env/fw_env.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index c9c79e0..ab7d85b 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -1088,14 +1088,16 @@ static int flash_io (int mode)

rc = flash_write (fd_current, fd_target, dev_target);

-   if (fsync (fd_current)) {
+   if (fsync(fd_current) &&


nitpick: current coding style seems to be a single whitespace before
the opening bracket


I've run the patch through the ./scripts/checkpatch.pl and it was 
complaining about this space, so I've corrected it.


Does the fw_env.c use another coding style (not from the Linux kernel)?




+   !(errno == EINVAL || errno == EROFS)) {
fprintf (stderr,
 "fsync failed on %s: %s\n",
 DEVNAME (dev_current), strerror (errno));
}

if (HaveRedundEnv) {
-   if (fsync (fd_target)) {
+   if (fsync(fd_target) &&


dito


+   !(errno == EINVAL || errno == EROFS)) {
fprintf (stderr,
 "fsync failed on %s: %s\n",
 DEVNAME (dev_current), strerror 
(errno));


Other than this nitpick:

Acked-by: Michael Heimpold 


Thanks :-)



Regards,
Michael





--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 4/4] rockchip: enable rockusb for all rockchip SoCs

2017-08-26 Thread Łukasz Majewski

On 08/26/2017 02:46 PM, Tom Rini wrote:

On Fri, Aug 25, 2017 at 01:06:55PM +0200, Łukasz Majewski wrote:

Hi Philipp, Andy, Tom



On 25 Aug 2017, at 03:51, Andy Yan  wrote:

Hi Lukasz:

2017-08-22 18:05 GMT+08:00 Łukasz Majewski mailto:lu...@denx.de>>:
Hi Kever,


Philipp,

   I have no idea about the status of rockusb, it has been a long time
on the list.

Maybe Eddie or Lukasz have an answer?

I've asked Eddie to fix issues with breaking other boards when enabling USB 
gadget infrastructure on RK.

No reply since then.



Eddie has fix all the issues he can reproduced on local。 The only problem now 
is that  the rk3036 based boards(evb-rk3036/kylin-rk3036) show compile errors 
on CI[0],


The Travis log shows linker errors for some of the other boards (i.e. not 
evb-rk3036/kylin-rk3036), due to unresolved symbols.


Yes, Indeed.

I've build those boards locally with gcc 6.3 and it was successful.


The same one we use in travis-ci, from Linaro?


I've been using some OE build from yocto 2.3 SDK.

I will try to use the one from Linaro.




Regarding travis CI:

With Eddie's patches it shows error:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/268270904

However, without Eddie's patches travis-CI doesn't show any errors:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/268303030


Let's ask Tom (who has far more experience with travis-CI), if he
saw something like that before.


Well, travis talks about using docker to replicate their environment,
which means someone should be able to do that, get it to fail in a
debugable environment and then move forward.


From the sentence it seems like travis-ci is going to use docker. Is it 
correct?


Is it now possible to download the docker container for build testing?






--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 4/4] rockchip: enable rockusb for all rockchip SoCs

2017-08-26 Thread Łukasz Majewski

Dear All,


Hi Philipp, Andy, Tom



On 25 Aug 2017, at 03:51, Andy Yan  wrote:

Hi Lukasz:

2017-08-22 18:05 GMT+08:00 Łukasz Majewski mailto:lu...@denx.de>>:
Hi Kever,


Philipp,

I have no idea about the status of rockusb, it has been a long time
on the list.

Maybe Eddie or Lukasz have an answer?

I've asked Eddie to fix issues with breaking other boards when
enabling USB gadget infrastructure on RK.

No reply since then.



Eddie has fix all the issues he can reproduced on local。 The only
problem now is that  the rk3036 based boards(evb-rk3036/kylin-rk3036)
show compile errors on CI[0],


The Travis log shows linker errors for some of the other boards (i.e.
not evb-rk3036/kylin-rk3036), due to unresolved symbols.


Yes, Indeed.

I've build those boards locally with gcc 6.3 and it was successful.


And in the meantime - I would like to kindly ask Eddie to rebase this 
patch series on the newest u-boot-usb/master branch.


I will add the code to -dfu and submit a PR when new merge window opens.

Thanks in advance,
Łukasz




Regarding travis CI:

With Eddie's patches it shows error:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/268270904

However, without Eddie's patches travis-CI doesn't show any errors:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/268303030


Let's ask Tom (who has far more experience with travis-CI), if he saw
something like that before.




but when we do the same compile on our local computer, the all
evb-rk3036 and kylin-rk3036 compiled successfully. And we didn't find
anything in Eddie's patch that will trigger such errors. As you
mentationed in the mail[1], you have also build rk3036 successfully
on your local. So maybe there is something different between the CI
and the local build. Could you please give as some directions on this?

[0] https://travis-ci.org/eddiecailinux/u-boot/jobs/23599#L759
<https://travis-ci.org/eddiecailinux/u-boot/jobs/23599#L759>[1]
http://patchwork.ozlabs.org/patch/766901/
<http://patchwork.ozlabs.org/patch/766901/>



I have to use those patches on my local branch, so that we don't have to
enter

bootrom mode for firmware update.

Thanks,
- Kever
On 08/22/2017 04:44 PM, Dr. Philipp Tomsich wrote:
Kever,

I was about to apply the rockusb changes onto next yesterday, when I
realised
that rockusb hadn’t been merged on the USB side…

Do you know the status on the rockusb patches?
I’d like to avoid merging this on our end, before the infrastructure
has been merged.

Regards,
Philipp.

On 22 Aug 2017, at 09:35, Kever Yang mailto:kever.y...@rock-chips.com>> wrote:

Rockusb will be used by all the rockchip SoCs, enable it by
default in Kconfig, and it can be work if USB gadget is available.

Signed-off-by: Kever Yang mailto:kever.y...@rock-chips.com>>
Acked-by: Philipp Tomsich mailto:philipp.toms...@theobroma-systems.com>>
---

Changes in v2: None

arch/arm/Kconfig | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index da9324b..f566d50 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1084,6 +1084,8 @@ config ARCH_ROCKCHIP
select DM_PWM
select DM_REGULATOR
imply FAT_WRITE
+imply USB_FUNCTION_ROCKUSB
+imply CMD_ROCKUSB

config TARGET_THUNDERX_88XX
bool "Support ThunderX 88xx"
--
1.9.1







--
Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10  Fax:
(+49)-8142-66989-80  Email: w...@denx.de
<mailto:w...@denx.de>

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








--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 4/4] rockchip: enable rockusb for all rockchip SoCs

2017-08-25 Thread Łukasz Majewski

Hi Philipp, Andy, Tom



On 25 Aug 2017, at 03:51, Andy Yan  wrote:

Hi Lukasz:

2017-08-22 18:05 GMT+08:00 Łukasz Majewski mailto:lu...@denx.de>>:
Hi Kever,


Philipp,

I have no idea about the status of rockusb, it has been a long time
on the list.

Maybe Eddie or Lukasz have an answer?

I've asked Eddie to fix issues with breaking other boards when enabling USB 
gadget infrastructure on RK.

No reply since then.



Eddie has fix all the issues he can reproduced on local。 The only problem now 
is that  the rk3036 based boards(evb-rk3036/kylin-rk3036) show compile errors 
on CI[0],


The Travis log shows linker errors for some of the other boards (i.e. not 
evb-rk3036/kylin-rk3036), due to unresolved symbols.


Yes, Indeed.

I've build those boards locally with gcc 6.3 and it was successful.


Regarding travis CI:

With Eddie's patches it shows error:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/268270904

However, without Eddie's patches travis-CI doesn't show any errors:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/268303030


Let's ask Tom (who has far more experience with travis-CI), if he saw 
something like that before.





but when we do the same compile on our local computer, the all evb-rk3036 and 
kylin-rk3036 compiled successfully. And we didn't find anything in Eddie's 
patch that will trigger such errors. As you mentationed in the mail[1], you 
have also build rk3036 successfully on your local. So maybe there is something 
different between the CI and the local build. Could you please give as some 
directions on this?

[0] https://travis-ci.org/eddiecailinux/u-boot/jobs/23599#L759 
<https://travis-ci.org/eddiecailinux/u-boot/jobs/23599#L759>[1] 
http://patchwork.ozlabs.org/patch/766901/ <http://patchwork.ozlabs.org/patch/766901/>



I have to use those patches on my local branch, so that we don't have to
enter

bootrom mode for firmware update.

Thanks,
- Kever
On 08/22/2017 04:44 PM, Dr. Philipp Tomsich wrote:
Kever,

I was about to apply the rockusb changes onto next yesterday, when I
realised
that rockusb hadn’t been merged on the USB side…

Do you know the status on the rockusb patches?
I’d like to avoid merging this on our end, before the infrastructure
has been merged.

Regards,
Philipp.

On 22 Aug 2017, at 09:35, Kever Yang mailto:kever.y...@rock-chips.com>> wrote:

Rockusb will be used by all the rockchip SoCs, enable it by
default in Kconfig, and it can be work if USB gadget is available.

Signed-off-by: Kever Yang mailto:kever.y...@rock-chips.com>>
Acked-by: Philipp Tomsich mailto:philipp.toms...@theobroma-systems.com>>
---

Changes in v2: None

arch/arm/Kconfig | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index da9324b..f566d50 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1084,6 +1084,8 @@ config ARCH_ROCKCHIP
select DM_PWM
select DM_REGULATOR
imply FAT_WRITE
+imply USB_FUNCTION_ROCKUSB
+imply CMD_ROCKUSB

config TARGET_THUNDERX_88XX
bool "Support ThunderX 88xx"
--
1.9.1







--
Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10  Fax: (+49)-8142-66989-80 
 Email: w...@denx.de <mailto:w...@denx.de>

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





--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH] imx: imx6: Move gpr_init() function to soc.c

2017-08-24 Thread Łukasz Majewski

On 08/24/2017 03:02 PM, Stefano Babic wrote:

Hi Breno,

On 24/08/2017 15:00, Breno Lima wrote:

Since the gpr_init() function is common for boards using MX6S, MX6DL, MX6D,
MX6Q and MX6QP processors move it to the soc.c file.



Fully agree !

I took a loog a couple of days ago and I saw how much cut&paste code is
in board/. Thanks, that you did it !


Signed-off-by: Breno Lima 
---
 arch/arm/include/asm/mach-imx/sys_proto.h   |  2 ++
 arch/arm/mach-imx/mx6/soc.c | 17 +
 board/bachmann/ot1200/ot1200.c  | 11 ---
 board/barco/platinum/platinum.h | 11 ---
 board/congatec/cgtqmx6eval/cgtqmx6eval.c| 11 ---
 board/el/el6x/el6x.c| 11 ---
 board/engicam/common/spl.c  | 11 ---
 board/freescale/mx6sabreauto/mx6sabreauto.c | 17 -
 board/freescale/mx6sabresd/mx6sabresd.c | 17 -
 board/gateworks/gw_ventana/gw_ventana_spl.c | 11 ---
 board/kosagi/novena/novena_spl.c| 11 ---
 board/liebherr/mccmon6/spl.c| 11 ---
 board/phytec/pcm058/pcm058.c| 12 
 board/phytec/pfla02/pfla02.c| 11 ---
 board/solidrun/mx6cuboxi/mx6cuboxi.c| 11 ---
 board/toradex/apalis_imx6/apalis_imx6.c | 11 ---
 board/toradex/colibri_imx6/colibri_imx6.c   | 11 ---
 board/udoo/udoo_spl.c   | 11 ---
 board/wandboard/spl.c   | 11 ---
 19 files changed, 19 insertions(+), 200 deletions(-)

diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h 
b/arch/arm/include/asm/mach-imx/sys_proto.h
index 046df62..436ba9a 100644
--- a/arch/arm/include/asm/mach-imx/sys_proto.h
+++ b/arch/arm/include/asm/mach-imx/sys_proto.h
@@ -85,6 +85,8 @@ static inline u8 imx6_is_bmode_from_gpr9(void)
 }

 u32 imx6_src_get_boot_mode(void);
+void gpr_init(void);
+
 #endif /* CONFIG_MX6 */

 u32 get_nr_cpus(void);
diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c
index 9ede1f5..f8bc05e 100644
--- a/arch/arm/mach-imx/mx6/soc.c
+++ b/arch/arm/mach-imx/mx6/soc.c
@@ -681,6 +681,23 @@ void imx_setup_hdmi(void)
 }
 #endif

+void gpr_init(void)
+{
+   struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
+
+   /* enable AXI cache for VDOA/VPU/IPU */
+   writel(0xF0CF, &iomux->gpr[4]);
+   if (is_mx6dqp()) {
+   /* set IPU AXI-id1 Qos=0x1 AXI-id0/2/3 Qos=0x7 */
+   writel(0x77177717, &iomux->gpr[6]);
+   writel(0x77177717, &iomux->gpr[7]);
+   } else {
+   /* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */
+   writel(0x007F007F, &iomux->gpr[6]);
+   writel(0x007F007F, &iomux->gpr[7]);
+   }
+}
+
 #ifdef CONFIG_IMX_BOOTAUX
 int arch_auxiliary_core_up(u32 core_id, u32 boot_private_data)
 {
diff --git a/board/bachmann/ot1200/ot1200.c b/board/bachmann/ot1200/ot1200.c
index df10d6a..9465cea 100644
--- a/board/bachmann/ot1200/ot1200.c
+++ b/board/bachmann/ot1200/ot1200.c
@@ -169,17 +169,6 @@ static void ccgr_init(void)
writel(0x03FF, &ccm->CCGR6);
 }

-static void gpr_init(void)
-{
-   struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
-
-   /* enable AXI cache for VDOA/VPU/IPU */
-   writel(0xF0CF, &iomux->gpr[4]);
-   /* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */
-   writel(0x007F007F, &iomux->gpr[6]);
-   writel(0x007F007F, &iomux->gpr[7]);
-}
-
 int board_early_init_f(void)
 {
ccgr_init();
diff --git a/board/barco/platinum/platinum.h b/board/barco/platinum/platinum.h
index d3ea8bd..3013ed9 100644
--- a/board/barco/platinum/platinum.h
+++ b/board/barco/platinum/platinum.h
@@ -75,15 +75,4 @@ static inline void ccgr_init(void)
writel(0x03FF, &ccm->CCGR6);
 }

-static inline void gpr_init(void)
-{
-   struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
-
-   /* enable AXI cache for VDOA/VPU/IPU */
-   writel(0xF0CF, &iomux->gpr[4]);
-   /* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */
-   writel(0x007F007F, &iomux->gpr[6]);
-   writel(0x007F007F, &iomux->gpr[7]);
-}
-
 #endif /* _PLATINUM_H_ */
diff --git a/board/congatec/cgtqmx6eval/cgtqmx6eval.c 
b/board/congatec/cgtqmx6eval/cgtqmx6eval.c
index 8cd0090..2ed66d3 100644
--- a/board/congatec/cgtqmx6eval/cgtqmx6eval.c
+++ b/board/congatec/cgtqmx6eval/cgtqmx6eval.c
@@ -955,17 +955,6 @@ static void ccgr_init(void)
writel(0x03FF, &ccm->CCGR6);
 }

-static void gpr_init(void)
-{
-   struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
-
-   /* enable AXI cache for VDOA/VPU/IPU */
-   writel(0xF0CF, &iomux->gpr[4]);
-   /* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */
-   writel(0x007F007F, &iomux->gpr[6]);
-   writel(0x007F007F, &iomux->gpr[7]);
-}
-
 /* Define a minimal structure so that the part number 

Re: [U-Boot] [PATCH 0/2] board: ti: am57xx: Add DT support for BeagleBoard-X15 revC

2017-08-23 Thread Łukasz Majewski

On 08/23/2017 08:09 AM, Lokesh Vutla wrote:

Now that we have synced DTS from Latest Linux kernel, add dt support
for BeagleBoard-X15 revC. Board detection support is already added for
this board.

Lokesh Vutla (2):
  board: ti: am57xx: Add dt support for BeagleBoard-X15 revC
  env: ti: boot: Select dtb name for X15 revC

 arch/arm/dts/Makefile   | 1 +
 board/ti/am57xx/board.c | 3 +++
 configs/am57xx_evm_defconfig| 2 +-
 configs/am57xx_hs_evm_defconfig | 2 +-
 include/environment/ti/boot.h   | 2 ++
 5 files changed, 8 insertions(+), 2 deletions(-)



Reviewed-by: Łukasz Majewski 

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 4/4] rockchip: enable rockusb for all rockchip SoCs

2017-08-22 Thread Łukasz Majewski

Hi Kever,



Philipp,

I have no idea about the status of rockusb, it has been a long time
on the list.

Maybe Eddie or Lukasz have an answer?


I've asked Eddie to fix issues with breaking other boards when enabling 
USB gadget infrastructure on RK.


No reply since then.



I have to use those patches on my local branch, so that we don't have to
enter

bootrom mode for firmware update.

Thanks,
- Kever
On 08/22/2017 04:44 PM, Dr. Philipp Tomsich wrote:

Kever,

I was about to apply the rockusb changes onto next yesterday, when I
realised
that rockusb hadn’t been merged on the USB side…

Do you know the status on the rockusb patches?
I’d like to avoid merging this on our end, before the infrastructure
has been merged.

Regards,
Philipp.


On 22 Aug 2017, at 09:35, Kever Yang  wrote:

Rockusb will be used by all the rockchip SoCs, enable it by
default in Kconfig, and it can be work if USB gadget is available.

Signed-off-by: Kever Yang 
Acked-by: Philipp Tomsich 
---

Changes in v2: None

arch/arm/Kconfig | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index da9324b..f566d50 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1084,6 +1084,8 @@ config ARCH_ROCKCHIP
select DM_PWM
select DM_REGULATOR
imply FAT_WRITE
+imply USB_FUNCTION_ROCKUSB
+imply CMD_ROCKUSB

config TARGET_THUNDERX_88XX
bool "Support ThunderX 88xx"
--
1.9.1










--
Best regards,

Lukasz Majewski

--

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


[U-Boot] [GIT] Pull request: u-boot-dfu

2017-08-21 Thread Łukasz Majewski

Dear Marek,

The following changes since commit 5b70b1688cdf677563096063e4a48e4bed250a10:

  usb: ehci: Convert CONFIG_USB_EHCI_PCI to Kconfig (2017-08-09 
10:50:08 +0200)


are available in the git repository at:

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

for you to fetch changes up to b14b19e1a96f8b891ed094009204e07af798b137:

  doc: license: Add license header to the README.dfutftp file 
(2017-08-21 11:07:26 +0200)



John Keeping (1):
  fastboot: avoid printing invalid data

Lukasz Majewski (1):
  doc: license: Add license header to the README.dfutftp file

Peter Chubb (1):
  Fix fastboot boot address

Tom Rini (2):
  common/fb_mmc.c: Fix warnings about casts
  fb_mmc.c: Correct blk_dread() return value checks

 common/fb_mmc.c | 8 
 doc/README.dfutftp  | 8 
 drivers/usb/gadget/f_fastboot.c | 4 ++--
 3 files changed, 14 insertions(+), 6 deletions(-)



Test HW: BBB (Beagle Bone Black) (Old dfu tests passed)

Build test:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/266707409

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH] fb_mmc.c: Correct blk_dread() return value checks

2017-08-17 Thread Łukasz Majewski

On 08/15/2017 03:00 AM, Tom Rini wrote:

The function blk_dread will return -ENOSYS on failure or on success the
number of blocks read, which must be the number asked to read (otherwise
it failed somewhere).  Correct this check.

Cc: Lukasz Majewski 
Signed-off-by: Tom Rini 
---
 common/fb_mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/fb_mmc.c b/common/fb_mmc.c
index 2113b6c37239..8cef1c44075c 100644
--- a/common/fb_mmc.c
+++ b/common/fb_mmc.c
@@ -132,7 +132,7 @@ static lbaint_t fb_mmc_get_boot_header(struct blk_desc 
*dev_desc,

/* Read the boot image header */
res = blk_dread(dev_desc, info->start, hdr_sectors, (void *)hdr);
-   if (res == 0) {
+   if (res != hdr_sectors) {
error("cannot read header from boot partition");
fastboot_fail("cannot read header from boot partition");
return 0;
@@ -215,7 +215,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
ramdisk_buffer = (u8 *)hdr + (hdr_sectors * info.blksz);
res = blk_dread(dev_desc, ramdisk_sector_start, ramdisk_sectors,
ramdisk_buffer);
-   if (res == 0) {
+   if (res != ramdisk_sectors) {
error("cannot read ramdisk from boot partition");
fastboot_fail("cannot read ramdisk from boot partition");
    return -1;



Reviewed-by: Łukasz Majewski 

I've applied this patch to -dfu tree.

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v3 3/3] config: move USB_FUNCTION_MASS_STORAGE

2017-08-17 Thread Łukasz Majewski

Hi Philipp,



On 26 July 2017 at 05:22, Philipp Tomsich
 wrote:

With both an imply from CMD_USB to USB_FUNCTION_MASS_STORAGE and with
USB_FUNCTION_MASS_STORAGE moved to Kconfig, we can now run moveconfig.

Signed-off-by: Philipp Tomsich 
---

Changes in v3: None
Changes in v2: None

 configs/CHIP_pro_defconfig | 1 +
 configs/Nintendo_NES_Classic_Edition_defconfig | 1 +
 configs/Sinlinx_SinA33_defconfig   | 1 +
 configs/fennec-rk3288_defconfig| 1 +
 configs/firefly-rk3288_defconfig   | 1 +
 configs/kylin-rk3036_defconfig | 1 +
 configs/miqi-rk3288_defconfig  | 1 +
 configs/parrot_r16_defconfig   | 1 +
 configs/phycore-rk3288_defconfig   | 2 +-
 configs/popmetal-rk3288_defconfig  | 1 +
 configs/smdkv310_defconfig | 1 +
 configs/tinker-rk3288_defconfig| 1 +
 include/configs/advantech_dms-ba16.h   | 1 -
 include/configs/apalis_imx6.h  | 1 -
 include/configs/bav335x.h  | 4 
 include/configs/cgtqmx6eval.h  | 2 --
 include/configs/colibri_imx6.h | 1 -
 include/configs/colibri_imx7.h | 2 --
 include/configs/colibri_vf.h   | 1 -
 include/configs/exynos4-common.h   | 2 --
 include/configs/ge_bx50v3.h| 1 -
 include/configs/gw_ventana.h   | 1 -
 include/configs/ma5d4evk.h | 1 -
 include/configs/mx6sabre_common.h  | 2 --
 include/configs/mx7dsabresd.h  | 2 --
 include/configs/nitrogen6x.h   | 2 --
 include/configs/odroid_xu3.h   | 1 -
 include/configs/opos6uldev.h   | 1 -
 include/configs/pico-imx6ul.h  | 1 -
 include/configs/pico-imx7d.h   | 2 --
 include/configs/rk3036_common.h| 1 -
 include/configs/rk322x_common.h| 1 -
 include/configs/rk3288_common.h| 1 -
 include/configs/s5p_goni.h | 1 -
 include/configs/socfpga_common.h   | 2 --
 include/configs/sunxi-common.h | 1 -
 include/configs/tbs2910.h  | 1 -
 include/configs/tegra-common-usb-gadget.h  | 1 -
 include/configs/warp.h | 2 --
 include/configs/warp7.h| 2 --
 scripts/config_whitelist.txt   | 1 -
 41 files changed, 12 insertions(+), 43 deletions(-)



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



This patch does not apply clearly on the u-boot-usb/master branch (the 
firefly-rk3288_defconfig and configs/kylin-rk3036_defconfig causes problem).



Philipp, would you be so kind and rebase this patch on top of 
u-boot-usb/master ?




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 2/8] usb: gadget: add SDP driver

2017-08-17 Thread Łukasz Majewski

On 08/17/2017 03:54 PM, Marek Vasut wrote:

On 08/17/2017 03:49 PM, Stefano Babic wrote:

On 16/08/2017 20:00, Stefan Agner wrote:

From: Stefan Agner 

Add SDP (Serial Downloader Protocol) implementation for U-Boot. The
protocol is used in NXP SoC's boot ROM and allows to download program
images. Beside that, it can also be used to read/write registers and
download complete Device Configuration Data (DCD) sets. This basic
implementation supports downloading images with the imx header format
reading and writing registers.

Signed-off-by: Stefan Agner 


Reviewed by : Stefano Babic ysba...@denx.de>

Marek, this is related to USB. Anyway, I will prefer that the whole
patchset will be merged at once, and not split between u-boot-imx and
u-boot-usb. If you agree (and after the patchset is ok for you, of
course !), I will propose that I will merge the whole patchset into
u-boot-imx to avoid breakages.


This is gadget stuff, so it's Lukasz's call, not mine.


I'm fine with this approach (as I've already reviewed those patches).

Stefano, please merge it to your's -imx tree.






--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v3 18/19] dfu: fix spl build

2017-08-17 Thread Łukasz Majewski

Hi Paweł,


In current state dfu depends on cmd/mtdparts.c which isn't build in SPL.
This patch resolves it by cutting out unwanted code in SPL build.

Signed-off-by: Paweł Jarosz 
---
Changes since v1:
- none

Changes since v2:
- none

 drivers/dfu/dfu_nand.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/dfu/dfu_nand.c b/drivers/dfu/dfu_nand.c
index 6dc9ff7..a196233 100644
--- a/drivers/dfu/dfu_nand.c
+++ b/drivers/dfu/dfu_nand.c
@@ -192,8 +192,9 @@ unsigned int dfu_polltimeout_nand(struct dfu_entity *dfu)
 int dfu_fill_entity_nand(struct dfu_entity *dfu, char *devstr, char *s)
 {
char *st;
+#ifndef CONFIG_SPL_BUILD
int ret, dev, part;
-
+#endif
dfu->data.nand.ubi = 0;
dfu->dev_type = DFU_DEV_NAND;
st = strsep(&s, " ");
@@ -203,6 +204,7 @@ int dfu_fill_entity_nand(struct dfu_entity *dfu, char 
*devstr, char *s)
s++;
dfu->data.nand.size = simple_strtoul(s, &s, 16);
} else if ((!strcmp(st, "part")) || (!strcmp(st, "partubi"))) {
+#ifndef CONFIG_SPL_BUILD
char mtd_id[32];
struct mtd_device *mtd_dev;
u8 part_num;
@@ -220,6 +222,7 @@ int dfu_fill_entity_nand(struct dfu_entity *dfu, char 
*devstr, char *s)
mtdparts_init();

ret = find_dev_and_part(mtd_id, &mtd_dev, &part_num, &pi);
+


I think that this blank line is not needed.

Otherwise,

Acked-by: Łukasz Majewski 


if (ret != 0) {
printf("Could not locate '%s'\n", mtd_id);
return -1;
@@ -229,6 +232,7 @@ int dfu_fill_entity_nand(struct dfu_entity *dfu, char 
*devstr, char *s)
dfu->data.nand.size = pi->size;
if (!strcmp(st, "partubi"))
dfu->data.nand.ubi = 1;
+#endif
} else {
printf("%s: Memory layout (%s) not supported!\n", __func__, st);
return -1;




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 7/8] apalis/colibri_imx6: use independent USB PID for SPL

2017-08-17 Thread Łukasz Majewski

On 08/16/2017 08:00 PM, Stefan Agner wrote:

From: Stefan Agner 

Use a completely independent USB Product ID for SPL. This allows
to differentiate a SDP running in SPL and SDP running in a U-Boot
which could not read the config block successfully.


Reviewed-by: Łukasz Majewski 



Signed-off-by: Stefan Agner 
Acked-by: Max Krummenacher 
---

Changes in v2: None

 board/toradex/apalis_imx6/apalis_imx6.c   | 13 +
 board/toradex/colibri_imx6/colibri_imx6.c | 13 +
 2 files changed, 26 insertions(+)

diff --git a/board/toradex/apalis_imx6/apalis_imx6.c 
b/board/toradex/apalis_imx6/apalis_imx6.c
index 8e5613cb12..edaca5d346 100644
--- a/board/toradex/apalis_imx6/apalis_imx6.c
+++ b/board/toradex/apalis_imx6/apalis_imx6.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1233,6 +1234,18 @@ void reset_cpu(ulong addr)
 {
 }

+#ifdef CONFIG_SPL_USB_GADGET_SUPPORT
+int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
+{
+   unsigned short usb_pid;
+
+   usb_pid = TORADEX_USB_PRODUCT_NUM_OFFSET + 0xfff;
+   put_unaligned(usb_pid, &dev->idProduct);
+
+   return 0;
+}
+#endif
+
 #endif

 static struct mxc_serial_platdata mxc_serial_plat = {
diff --git a/board/toradex/colibri_imx6/colibri_imx6.c 
b/board/toradex/colibri_imx6/colibri_imx6.c
index cbf7aa952a..0cc958a0a8 100644
--- a/board/toradex/colibri_imx6/colibri_imx6.c
+++ b/board/toradex/colibri_imx6/colibri_imx6.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1118,6 +1119,18 @@ void reset_cpu(ulong addr)
 {
 }

+#ifdef CONFIG_SPL_USB_GADGET_SUPPORT
+int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
+{
+   unsigned short usb_pid;
+
+   usb_pid = TORADEX_USB_PRODUCT_NUM_OFFSET + 0xfff;
+   put_unaligned(usb_pid, &dev->idProduct);
+
+   return 0;
+}
+#endif
+
 #endif

 static struct mxc_serial_platdata mxc_serial_plat = {




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 6/8] doc: add Serial Download Protocol documentation

2017-08-17 Thread Łukasz Majewski

Hi Stefan,


From: Stefan Agner 

Document the U-Boot Serial Download Protocol implementation and
some typical use cases.


Thanks for providing the description :-)

Reviewed-by: Łukasz Majewski 



Signed-off-by: Stefan Agner 
---
This ended up to be almost more a imx_usb documentation. But there
is really not much to document from a U-Boot side since actual usage
heavily depends on host side tooling...

This assumes that the necessary changes will get merged upstream:
https://github.com/toradex/imx_loader/tree/imx_usb_batch_mode_refactored


Changes in v2: None

 doc/README.sdp | 100 +
 1 file changed, 100 insertions(+)
 create mode 100644 doc/README.sdp

diff --git a/doc/README.sdp b/doc/README.sdp
new file mode 100644
index 00..9b438c0746
--- /dev/null
+++ b/doc/README.sdp
@@ -0,0 +1,100 @@
+-
+SDP in U-Boot
+-
+
+SDP stands for serial download protocol. It is the protocol used in NXP's
+i.MX SoCs ROM Serial Downloader and provides means to download a program
+image to the chip over USB and UART serial connection.
+
+The implementation in U-Boot uses the USB Downloader Gadget (g_dnl) to
+provide a SDP implementation over USB. This allows to download program
+images to the target in SPL/U-Boot using the same protocol/tooling the
+SoC's recovery mechanism is using.
+
+The SDP protocol over USB is a USB HID class protocol. USB HID class
+protocols allow to access a USB device without OS specific drivers. The
+U-Boot implementation has primarly been tested using the open source
+imx_loader utility (https://github.com/toradex/imx_loader).
+
+The host side utilities are typically capable to interpret the i.MX
+specific image header (see doc/README.imximage). There are extensions
+for imx_loader's imx_usb utility which allow to interpret the U-Boot
+specific legacy image format (see mkimage(1)). Also the U-Boot side
+support beside the i.MX specific header the U-Boot legacy header.
+
+Usage
+-
+
+This implementation can be started in U-Boot using the sdp command
+(CONFIG_CMD_USB_SDP) or in SPL if Serial Downloader boot mode has been
+detected (CONFIG_SPL_USB_SDP_SUPPORT).
+
+A typical use case is downloading full U-Boot after SPL has been
+downloaded through the boot ROM's Serial Downloader. Using boot mode
+detection the SPL will run the SDP implementation automatically in
+this case:
+
+  # imx_usb SPL
+
+Targets Serial Console:
+
+  Trying to boot from USB SDP
+  SDP: initialize...
+  SDP: handle requests...
+
+At this point the SPL reenumerated as a new HID device and emulating
+the boot ROM's SDP protocol. The USB VID/PID will depend on standard
+U-Boot configurations CONFIG_G_DNL_(VENDOR|PRODUCT)_NUM. Make sure
+imx_usb is aware of the USB VID/PID for your device by adding a
+configuration entry in imx_usb.conf:
+
+  0x1b67:0x4fff, mx6_usb_sdp_spl.conf
+
+And the device specific configuration file mx6_usb_sdp_spl.conf:
+
+  mx6_spl_sdp
+  hid,uboot_header,1024,0x91,0x1000,1G,0x0090,0x4
+
+This allows to download the regular U-Boot with legacy image headers
+(u-boot.img) using a second invocation of imx_usb:
+
+  # imx_usb u-boot.img
+
+Furthermore, when U-Boot is running the sdp command can be used to
+download and run scripts:
+
+  # imx_usb script.scr
+
+imx_usb configuration files can be also used to download multiple
+files and of arbitrary types, e.g.
+
+  mx6_usb_sdp_uboot
+  hid,1024,0x1000,1G,0x00907000,0x31000
+  full.itb:load 0x1210
+  boot.scr:load 0x1200,jump 0x1200
+
+There is also a batch mode which allows imx_usb to handle multiple
+consecutive reenumerations by adding multiple VID/PID specifications
+in imx_usb.conf:
+
+  0x15a2:0x0061, mx6_usb_rom.conf, 0x1b67:0x4fff, mx6_usb_sdp_spl.conf
+
+In this mode the file to download (imx_usb job) needs to be specified
+in the configuration files.
+
+mx6_usb_rom.conf:
+
+  mx6_qsb
+  hid,1024,0x91,0x1000,1G,0x0090,0x4
+  SPL:jump header2
+
+mx6_usb_sdp_spl.conf:
+
+  mx6_spl_sdp
+  hid,uboot_header,1024,0x1000,1G,0x00907000,0x31000
+  u-boot.img:jump header2
+
+With that SPL and U-Boot can be downloaded with a single invocation
+of imx_usb without arguments:
+
+  # imx_usb




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 5/8] spl: add serial download protocol (SDP) support

2017-08-17 Thread Łukasz Majewski

On 08/16/2017 08:00 PM, Stefan Agner wrote:

From: Stefan Agner 

Add USB serial download protocol support to SPL. If the SoC started
in recovery mode the SPL will immediately switch to SDP and wait for
further downloads/commands from the host side.


Reviewed-by: Łukasz Majewski 



Signed-off-by: Stefan Agner 
Reviewed-by: Stefano Babic 
---

Changes in v2:
- Changed function signature of sdp_init/sdp_handle
- Use BOOT_DEVICE_BOARD

 common/spl/Kconfig  |  6 ++
 common/spl/Makefile |  1 +
 common/spl/spl_sdp.c| 37 +
 drivers/usb/gadget/Makefile |  1 +
 4 files changed, 45 insertions(+)
 create mode 100644 common/spl/spl_sdp.c

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 5176857506..b3436b3c28 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -668,6 +668,12 @@ config SPL_DFU_RAM

 endchoice

+config SPL_USB_SDP_SUPPORT
+   bool "Support SDP (Serial Download Protocol)"
+   help
+ Enable Serial Download Protocol (SDP) device support in SPL. This
+ allows to download images into memory and execute (jump to) them
+ using the same protocol as implemented by the i.MX family's boot ROM.
 endif

 config SPL_WATCHDOG_SUPPORT
diff --git a/common/spl/Makefile b/common/spl/Makefile
index 112b3e6022..6255d4f73c 100644
--- a/common/spl/Makefile
+++ b/common/spl/Makefile
@@ -30,4 +30,5 @@ obj-$(CONFIG_$(SPL_TPL_)SATA_SUPPORT) += spl_sata.o
 obj-$(CONFIG_$(SPL_TPL_)DFU_SUPPORT) += spl_dfu.o
 obj-$(CONFIG_$(SPL_TPL_)SPI_LOAD) += spl_spi.o
 obj-$(CONFIG_$(SPL_TPL_)RAM_SUPPORT) += spl_ram.o
+obj-$(CONFIG_$(SPL_TPL_)USB_SDP_SUPPORT) += spl_sdp.o
 endif
diff --git a/common/spl/spl_sdp.c b/common/spl/spl_sdp.c
new file mode 100644
index 00..350bcdb056
--- /dev/null
+++ b/common/spl/spl_sdp.c
@@ -0,0 +1,37 @@
+/*
+ * (C) Copyright 2016 Toradex
+ * Author: Stefan Agner 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static int spl_sdp_load_image(struct spl_image_info *spl_image,
+ struct spl_boot_device *bootdev)
+{
+   int ret;
+   const int controller_index = 0;
+
+   g_dnl_clear_detach();
+   g_dnl_register("usb_dnl_sdp");
+
+   ret = sdp_init(controller_index);
+   if (ret) {
+   error("SDP init failed: %d", ret);
+   return -ENODEV;
+   }
+
+   /* This command typically does not return but jumps to an image */
+   sdp_handle(controller_index);
+   error("SDP ended");
+
+   return -EINVAL;
+}
+SPL_LOAD_IMAGE_METHOD("USB SDP", 0, BOOT_DEVICE_BOARD, spl_sdp_load_image);
diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 6a007d1bcb..7258099c1c 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_USB_ETHER) += epautoconf.o config.o usbstring.o
 ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_SPL_USB_GADGET_SUPPORT) += g_dnl.o
 obj-$(CONFIG_SPL_DFU_SUPPORT) += f_dfu.o
+obj-$(CONFIG_SPL_USB_SDP_SUPPORT) += f_sdp.o
 endif

 # new USB gadget layer dependencies




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v2 2/8] usb: gadget: add SDP driver

2017-08-17 Thread Łukasz Majewski

On 08/16/2017 08:00 PM, Stefan Agner wrote:

From: Stefan Agner 

Add SDP (Serial Downloader Protocol) implementation for U-Boot. The
protocol is used in NXP SoC's boot ROM and allows to download program
images. Beside that, it can also be used to read/write registers and
download complete Device Configuration Data (DCD) sets. This basic
implementation supports downloading images with the imx header format
reading and writing registers.

Signed-off-by: Stefan Agner 


Reviewed-by: Łukasz Majewski 


---

Changes in v2:
- Changed function signature of sdp_init/sdp_handle to allow specifying
  which USB controller should be used.
- Use #defines for security mode
- Improved types used in format strings

 drivers/usb/gadget/Kconfig  |   7 +
 drivers/usb/gadget/Makefile |   1 +
 drivers/usb/gadget/f_sdp.c  | 721 
 include/sdp.h   |  16 +
 4 files changed, 745 insertions(+)
 create mode 100644 drivers/usb/gadget/f_sdp.c
 create mode 100644 include/sdp.h

diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 261ed128ac..225b66bc95 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -103,6 +103,13 @@ config USB_GADGET_DOWNLOAD

 if USB_GADGET_DOWNLOAD

+config USB_FUNCTION_SDP
+   bool "Enable USB SDP (Serial Download Protocol)"
+   help
+ Enable Serial Download Protocol (SDP) device support in U-Boot. This
+ allows to download images into memory and execute (jump to) them
+ using the same protocol as implemented by the i.MX family's boot ROM.
+
 config G_DNL_MANUFACTURER
string "Vendor name of USB device"

diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 5e316a7cff..6a007d1bcb 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -28,6 +28,7 @@ obj-$(CONFIG_USB_FUNCTION_THOR) += f_thor.o
 obj-$(CONFIG_USB_FUNCTION_DFU) += f_dfu.o
 obj-$(CONFIG_USB_FUNCTION_MASS_STORAGE) += f_mass_storage.o
 obj-$(CONFIG_USB_FUNCTION_FASTBOOT) += f_fastboot.o
+obj-$(CONFIG_USB_FUNCTION_SDP) += f_sdp.o
 endif
 endif
 ifdef CONFIG_USB_ETHER
diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c
new file mode 100644
index 00..9d82abcd69
--- /dev/null
+++ b/drivers/usb/gadget/f_sdp.c
@@ -0,0 +1,721 @@
+/*
+ * f_sdp.c -- USB HID Serial Download Protocol
+ *
+ * Copyright (C) 2017 Toradex
+ * Author: Stefan Agner 
+ *
+ * This file implements the Serial Download Protocol (SDP) as specified in
+ * the i.MX 6 Reference Manual. The SDP is a USB HID based protocol and
+ * allows to download images directly to memory. The implementation
+ * works with the imx_loader (imx_usb) USB client software on host side.
+ *
+ * Not all commands are implemented, e.g. WRITE_REGISTER, DCD_WRITE and
+ * SKIP_DCD_HEADER are only stubs.
+ *
+ * Parts of the implementation are based on f_dfu and f_thor.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#define HID_REPORT_ID_MASK 0x00ff
+
+/*
+ * HID class requests
+ */
+#define HID_REQ_GET_REPORT 0x01
+#define HID_REQ_GET_IDLE   0x02
+#define HID_REQ_GET_PROTOCOL   0x03
+#define HID_REQ_SET_REPORT 0x09
+#define HID_REQ_SET_IDLE   0x0A
+#define HID_REQ_SET_PROTOCOL   0x0B
+
+#define HID_USAGE_PAGE_LEN 76
+
+struct hid_report {
+   u8 usage_page[HID_USAGE_PAGE_LEN];
+} __packed;
+
+#define SDP_READ_REGISTER  0x0101
+#define SDP_WRITE_REGISTER 0x0202
+#define SDP_WRITE_FILE 0x0404
+#define SDP_ERROR_STATUS   0x0505
+#define SDP_DCD_WRITE  0x0a0a
+#define SDP_JUMP_ADDRESS   0x0b0b
+#define SDP_SKIP_DCD_HEADER0x0c0c
+
+#define SDP_SECURITY_CLOSED0x12343412
+#define SDP_SECURITY_OPEN  0x56787856
+
+#define SDP_WRITE_FILE_COMPLETE0x
+#define SDP_WRITE_REGISTER_COMPLETE0x128A8A12
+#define SDP_SKIP_DCD_HEADER_COMPLETE   0x900DD009
+#define SDP_ERROR_IMXHEADER0x000a0533
+
+#define SDP_COMMAND_LEN16
+
+struct sdp_command {
+   u16 cmd;
+   u32 addr;
+   u8 format;
+   u32 cnt;
+   u32 data;
+   u8 rsvd;
+} __packed;
+
+enum sdp_state {
+   SDP_STATE_IDLE,
+   SDP_STATE_RX_DCD_DATA,
+   SDP_STATE_RX_FILE_DATA,
+   SDP_STATE_TX_SEC_CONF,
+   SDP_STATE_TX_SEC_CONF_BUSY,
+   SDP_STATE_TX_REGISTER,
+   SDP_STATE_TX_REGISTER_BUSY,
+   SDP_STATE_TX_STATUS,
+   SDP_STATE_TX_STATUS_BUSY,
+   SDP_STATE_JUMP,
+};
+
+struct f_sdp {
+   struct usb_function usb_function;
+
+   struct usb_descriptor_header**function;
+
+   u8  altsetting;
+   enum sdp_state  state;
+   enum sdp_state   

Re: [U-Boot] [PATCH v1 4/7] cmd: add sdp command

2017-08-08 Thread Łukasz Majewski

On 08/05/2017 01:38 AM, Stefan Agner wrote:

From: Stefan Agner 

Add a new command to start USB Serial Download Protocol (SDP)
state machine.

Signed-off-by: Stefan Agner 
---

 cmd/Kconfig  |  7 +++
 cmd/Makefile |  1 +
 cmd/usb_gadget_sdp.c | 53 
 3 files changed, 61 insertions(+)
 create mode 100644 cmd/usb_gadget_sdp.c

diff --git a/cmd/Kconfig b/cmd/Kconfig
index f18efc1e88..87333b3a97 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -665,6 +665,13 @@ config CMD_DFU
  Enables the command "dfu" which is used to have U-Boot create a DFU
  class device via USB.

+config CMD_USB_SDP
+   bool "sdp"
+   select USB_FUNCTION_SDP
+   help
+ Enables the command "sdp" which is used to have U-Boot emulating the
+ Serial Download Protocol (SDP) via USB.
+
 config CMD_USB_MASS_STORAGE
bool "UMS usb mass storage"
help
diff --git a/cmd/Makefile b/cmd/Makefile
index bd231f24d8..e0b5940ba6 100644
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -131,6 +131,7 @@ obj-$(CONFIG_CMD_FASTBOOT) += fastboot.o
 obj-$(CONFIG_CMD_FS_UUID) += fs_uuid.o

 obj-$(CONFIG_CMD_USB_MASS_STORAGE) += usb_mass_storage.o
+obj-$(CONFIG_CMD_USB_SDP) += usb_gadget_sdp.o
 obj-$(CONFIG_CMD_THOR_DOWNLOAD) += thordown.o
 obj-$(CONFIG_CMD_XIMG) += ximg.o
 obj-$(CONFIG_YAFFS2) += yaffs2.o
diff --git a/cmd/usb_gadget_sdp.c b/cmd/usb_gadget_sdp.c
new file mode 100644
index 00..09ddb4f3aa
--- /dev/null
+++ b/cmd/usb_gadget_sdp.c
@@ -0,0 +1,53 @@
+/*
+ * cmd_sdp.c -- sdp command
+ *
+ * Copyright (C) 2016 Toradex
+ * Author: Stefan Agner 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+static int do_sdp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   int ret = CMD_RET_SUCCESS;
+
+   if (argc < 2)
+   return CMD_RET_USAGE;
+
+   char *usb_controller = argv[1];
+   int controller_index = simple_strtoul(usb_controller, NULL, 0);
+   board_usb_init(controller_index, USB_INIT_DEVICE);
+
+   g_dnl_clear_detach();
+   g_dnl_register("usb_dnl_sdp");
+
+   ret = sdp_init();
+   if (ret) {
+   error("SDP init failed: %d", ret);
+   ret = CMD_RET_FAILURE;
+   goto exit;
+   }
+
+   ret = sdp_handle();
+   if (ret) {
+   error("SDP failed: %d", ret);
+   ret = CMD_RET_FAILURE;
+   goto exit;
+   }
+
+exit:
+   g_dnl_unregister();
+
+   return ret;
+}
+
+U_BOOT_CMD(sdp, 2, 1, do_sdp,
+   "Serial Downloader Protocol",
+       "\n"
+   "  - serial downloader protocol via \n"
+);



Reviewed-by: Łukasz Majewski 

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v1 3/7] usb: gadget: sdp: extend images compatible for jumps

2017-08-08 Thread Łukasz Majewski

Hi Stefan,


From: Stefan Agner 

Support U-Boot images in SPL so that u-boot.img files can be
directly downloaded and executed. Furthermore support U-Boot
scripts download and execution in full U-Boot so that custom
recovery actions can be downloaded from the host in a third
step.

Signed-off-by: Stefan Agner 


Reviewed-by: Łukasz Majewski 


---

 drivers/usb/gadget/f_sdp.c | 20 ++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c
index eb89695aaf..9a752843f0 100644
--- a/drivers/usb/gadget/f_sdp.c
+++ b/drivers/usb/gadget/f_sdp.c
@@ -29,6 +29,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 

 #define HID_REPORT_ID_MASK 0x00ff
@@ -672,8 +674,22 @@ static void sdp_handle_in_ep(void)
sdp_func->state = SDP_STATE_TX_REGISTER_BUSY;
break;
case SDP_STATE_JUMP:
-   printf("Checking imxheader at 0x%08x\n", f_sdp->jmp_address);
-   status = sdp_jump_imxheader((void *)f_sdp->jmp_address);
+   printf("Jumping to header at 0x%08x\n", sdp_func->jmp_address);
+   status = sdp_jump_imxheader((void *)sdp_func->jmp_address);
+
+   /* If imx header fails, try some U-Boot specific headers */
+   if (status) {
+#ifdef CONFIG_SPL_BUILD
+   /* In SPL, allow jumps to U-Boot images */
+   struct spl_image_info spl_image = {};
+   spl_parse_image_header(&spl_image,
+   (struct image_header *)sdp_func->jmp_address);
+   jump_to_image_no_args(&spl_image);
+#else
+   /* In U-Boot, allow jumps to scripts */
+   source(sdp_func->jmp_address, "script@1");
+#endif
+   }

sdp_func->next_state = SDP_STATE_IDLE;
sdp_func->error_status = status;




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v1 2/7] usb: gadget: add SDP driver

2017-08-08 Thread Łukasz Majewski

Hi Stefan,


From: Stefan Agner 

Add SDP (Serial Downloader Protocol) implementation for U-Boot. The
protocol is used in NXP SoC's boot ROM and allows to download program
images. Beside that, it can also be used to read/write registers and
download complete Device Configuration Data (DCD) sets. This basic
implementation supports downloading images with the imx header format
and reading registers.

Signed-off-by: Stefan Agner 


Just some minor comments (despite comments from Lothar).


---

 drivers/usb/gadget/Kconfig  |   7 +
 drivers/usb/gadget/Makefile |   1 +
 drivers/usb/gadget/f_sdp.c  | 723 
 include/sdp.h   |  16 +
 4 files changed, 747 insertions(+)
 create mode 100644 drivers/usb/gadget/f_sdp.c
 create mode 100644 include/sdp.h

diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 261ed128ac..225b66bc95 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -103,6 +103,13 @@ config USB_GADGET_DOWNLOAD

 if USB_GADGET_DOWNLOAD

+config USB_FUNCTION_SDP
+   bool "Enable USB SDP (Serial Download Protocol)"
+   help
+ Enable Serial Download Protocol (SDP) device support in U-Boot. This
+ allows to download images into memory and execute (jump to) them
+ using the same protocol as implemented by the i.MX family's boot ROM.
+
 config G_DNL_MANUFACTURER
string "Vendor name of USB device"

diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 5e316a7cff..6a007d1bcb 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -28,6 +28,7 @@ obj-$(CONFIG_USB_FUNCTION_THOR) += f_thor.o
 obj-$(CONFIG_USB_FUNCTION_DFU) += f_dfu.o
 obj-$(CONFIG_USB_FUNCTION_MASS_STORAGE) += f_mass_storage.o
 obj-$(CONFIG_USB_FUNCTION_FASTBOOT) += f_fastboot.o
+obj-$(CONFIG_USB_FUNCTION_SDP) += f_sdp.o
 endif
 endif
 ifdef CONFIG_USB_ETHER
diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c
new file mode 100644
index 00..eb89695aaf
--- /dev/null
+++ b/drivers/usb/gadget/f_sdp.c
@@ -0,0 +1,723 @@
+/*
+ * f_sdp.c -- USB HID Serial Download Protocol
+ *
+ * Copyright (C) 2016 Toradex
		 - minor -> If you are going to prepare v2, please update the 
date.



+ * Author: Stefan Agner 
+ *
+ * This file implements the Serial Download Protocol (SDP) as specified in
+ * the i.MX 6 Reference Manual. The SDP is a USB HID based protocol and
+ * allows to download images directly to memory. The implementation
+ * works with the imx_loader (imx_usb) USB client software on host side.
+ *
+ * Not all commands are implemented, e.g. WRITE_REGISTER, DCD_WRITE and
+ * SKIP_DCD_HEADER are only stubs.
+ *
+ * Parts of the implementation are based on f_dfu and f_thor.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#define HID_REPORT_ID_MASK 0x00ff
+
+/*
+ * HID class requests
+ */
+#define HID_REQ_GET_REPORT 0x01
+#define HID_REQ_GET_IDLE   0x02
+#define HID_REQ_GET_PROTOCOL   0x03
+#define HID_REQ_SET_REPORT 0x09
+#define HID_REQ_SET_IDLE   0x0A
+#define HID_REQ_SET_PROTOCOL   0x0B
+
+#define HID_USAGE_PAGE_LEN 76
+
+struct hid_report {
+   u8 usage_page[HID_USAGE_PAGE_LEN];
+} __packed;
+
+#define SDP_READ_REGISTER  0x0101
+#define SDP_WRITE_REGISTER 0x0202
+#define SDP_WRITE_FILE 0x0404
+#define SDP_ERROR_STATUS   0x0505
+#define SDP_DCD_WRITE  0x0a0a
+#define SDP_JUMP_ADDRESS   0x0b0b
+#define SDP_SKIP_DCD_HEADER0x0c0c
+
+#define SDP_WRITE_FILE_COMPLETE0x
+#define SDP_WRITE_REGISTER_COMPLETE0x128A8A12
+#define SDP_SKIP_DCD_HEADER_COMPLETE   0x900DD009
+#define SDP_ERROR_IMXHEADER0x000a0533
+
+#define SDP_COMMAND_LEN16
+
+struct sdp_command {
+   u16 cmd;
+   u32 addr;
+   u8 format;
+   u32 cnt;
+   u32 data;
+   u8 rsvd;
+} __packed;
+
+enum sdp_state {
+   SDP_STATE_IDLE,
+   SDP_STATE_RX_DCD_DATA,
+   SDP_STATE_RX_FILE_DATA,
+   SDP_STATE_TX_SEC_CONF,
+   SDP_STATE_TX_SEC_CONF_BUSY,
+   SDP_STATE_TX_REGISTER,
+   SDP_STATE_TX_REGISTER_BUSY,
+   SDP_STATE_TX_STATUS,
+   SDP_STATE_TX_STATUS_BUSY,
+   SDP_STATE_JUMP,
+};
+
+struct f_sdp {
+   struct usb_function usb_function;
+
+   struct usb_descriptor_header**function;
+
+   u8  altsetting;
+   enum sdp_state  state;
+   enum sdp_state  next_state;
+   u32 dnl_address;
+   u32 dnl_bytes_remaining;
+   u32 jmp_address;
+   boolalways_send_status;
+   u32 error_stat

Re: [U-Boot] [PATCH v1 1/7] imx: move imximage header to common location

2017-08-08 Thread Łukasz Majewski

On 08/05/2017 01:38 AM, Stefan Agner wrote:

From: Stefan Agner 

Move the imximage.h header file to a common location so we can make
use of it from U-Boot too.

Signed-off-by: Stefan Agner 
---

 {tools => include}/imximage.h | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename {tools => include}/imximage.h (100%)

diff --git a/tools/imximage.h b/include/imximage.h
similarity index 100%
rename from tools/imximage.h
rename to include/imximage.h



Reviewed-by: Łukasz Majewski 

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v1 0/7] imx: add USB Serial Download Protocol (SDP) support

2017-08-08 Thread Łukasz Majewski

Hi Stefan,


From: Stefan Agner 

This series adds NXP's Serial Download Protocol (SDP) support via
USB for SPL/U-Boot. It allows to download U-Boot via USB from a
(recovered) SPL using the same tools used to download SPL itself
(specifically imx_usb, but also sb_loader seems to work).


If I might ask - could you prepare some ./doc/README.sdp entry for v2?

I mean some kind of howto for using this feature?

Nothing long - just the most important commands (imx_usb?) including the 
list of supported (and not) features.




The idea has been brought up when the first targets started to make
use of SPL for DDR initialization, see:
https://lists.denx.de/pipermail/u-boot/2015-July/220330.html

The initial SDP implementation (patch 2) requires the payload to
have the imx specific headers (hence the move of the imx header
file in patch 1).

Patch 3 extends image header support beyond the SDP specification,
specifically implements also support for U-Boot headers. This
allows to use the same SPL/U-Boot binaries for recovery as used on
the regular boot device (SD/eMMC). For that to work also the host
side imx_usb tools needed an extension, currently available here:

https://github.com/toradex/imx_loader/tree/imx_usb_batch_mode_refactored

The full patchset allows to download SPL and U-Boot over USB to a
target in recovery mode using the same usb_imx utility:

The usb_imx utility also has a batch mode which allows to download
multiple artifacts with a single invocation. The details are
outlined in the imx_usb commit message:
https://github.com/toradex/imx_loader/commit/5434415d921f1cc4d22332d9558bed6d42db9f60

In case this patchset gets accepted in U-Boot, I plan to push the
imx_usb changes upstream as well.


Thanks for the patch set. It would definitely facilitate work with IMX SoCs.




Stefan Agner (7):
  imx: move imximage header to common location
  usb: gadget: add SDP driver
  usb: gadget: sdp: extend images compatible for jumps
  cmd: add sdp command
  spl: add serial download protocol (SDP) support
  apalis/colibri_imx6: use independent USB PID for SPL
  apalis/colibri_imx6: enable SDP by default

 board/toradex/apalis_imx6/apalis_imx6.c   |  13 +
 board/toradex/colibri_imx6/colibri_imx6.c |  13 +
 cmd/Kconfig   |   7 +
 cmd/Makefile  |   1 +
 cmd/usb_gadget_sdp.c  |  53 +++
 common/spl/Kconfig|   6 +
 common/spl/Makefile   |   1 +
 common/spl/spl_sdp.c  |  38 ++
 configs/apalis_imx6_defconfig |   4 +
 configs/colibri_imx6_defconfig|   4 +
 drivers/usb/gadget/Kconfig|   7 +
 drivers/usb/gadget/Makefile   |   2 +
 drivers/usb/gadget/f_sdp.c| 739 ++
 {tools => include}/imximage.h |   0
 include/sdp.h |  16 +
 15 files changed, 904 insertions(+)
 create mode 100644 cmd/usb_gadget_sdp.c
 create mode 100644 common/spl/spl_sdp.c
 create mode 100644 drivers/usb/gadget/f_sdp.c
 rename {tools => include}/imximage.h (100%)
 create mode 100644 include/sdp.h




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH 3/3] dm: core: Add livetree documentation

2017-08-08 Thread Łukasz Majewski
uld
+   call an of_...() function. For the flat tree it should call an
+   fdt_...() function. The livetree version will be optimised out at
+   compile time if livetree is not enabled.
+
+   - Add an of_...() function for the livetree implementation. If a similar
+   function is available in Linux, the implementation should be taken
+   from there and modified as little as possible (generally not at all).
+
+
+Future work
+---
+
+Live tree support was introduced in U-Boot 2017.07. There is still quite a bit
+of work to do to flesh this out:
+
+- tests for all access functions
+- support for livetree modification
+- addition of more access functions as needed
+- support for livetree in SPL and before relocation (if desired)
+
+
+--
+Simon Glass 
+5-Aug-17



Thanks Simon for providing such great documentation.

Please find some word misspelled correction.

Reviewed-by: Łukasz Majewski 


--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH] usb: dwc2: Align size of invalidating dcache before starting DMA

2017-07-31 Thread Łukasz Majewski

Hi Seung-Woo,


During using dwc2 usb gadget, if usb message size is too small,
following cache misaligned warning is shown:

   CACHE: Misaligned operation at range [bfdbcb00, bfdbcb04]

Align size of invalidating dcache before starting DMA to remove the
warning.

Signed-off-by: Seung-Woo Kim 
---
 drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c 
b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
index 0d6d2fb..b6164af 100644
--- a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
+++ b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
@@ -111,7 +111,8 @@ static int setdma_rx(struct dwc2_ep *ep, struct 
dwc2_request *req)
ctrl =  readl(®->out_endp[ep_num].doepctl);

invalidate_dcache_range((unsigned long) ep->dma_buf,
-   (unsigned long) ep->dma_buf + ep->len);
+   (unsigned long) ep->dma_buf +
+   ROUND(ep->len, CONFIG_SYS_CACHELINE_SIZE));

writel((unsigned int) ep->dma_buf, ®->out_endp[ep_num].doepdma);
writel(DOEPT_SIZ_PKT_CNT(pktcnt) | DOEPT_SIZ_XFER_SIZE(length),



Reviewed-by: Łukasz Majewski 

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH] Convert CONFIG_USB_ETHER et al to Kconfig

2017-07-28 Thread Łukasz Majewski

On 07/26/2017 07:05 PM, Adam Ford wrote:

This converts the following to Kconfig:
   CONFIG_USB_ETHER
   CONFIG_USB_ETHER_RNDIS

Signed-off-by: Adam Ford 


Acked-by: Łukasz Majewski 

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v3 1/3] usb: gadget: move USB_FUNCTION_MASS_STORAGE to Kconfig

2017-07-28 Thread Łukasz Majewski

Hi Philipp,


In order to easily model a that CMD_USB_MASS_STORAGE implies having
USB_FUNCTION_MASS_STORAGE enabled, we first need to migrate
USB_FUNCTION_MASS_STORAGE to Kconfig.



Thanks for the conversion!


Signed-off-by: Philipp Tomsich 



Acked-by: Łukasz Majewski 


---

Changes in v3: None
Changes in v2:
- ran 'tabify' on newly added lines to fix a spaces vs. tabs issues

 drivers/usb/gadget/Kconfig | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 261ed12..8d1cd57 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -34,6 +34,15 @@ menuconfig USB_GADGET
   peripheral/device side bus controller, and a "gadget driver" for
   your peripheral protocol.

+config USB_FUNCTION_MASS_STORAGE
+   bool "USB mass-storage class implementation"
+   help
+ The Mass Storage Function acts as a USB Mass Storage device
+ appearing to the host as a disk drive or as a CD-ROM drive.
+
+ This is required (and implied) by the USB mass-storage emulation
+ command ('ums').
+
 if USB_GADGET

 config USB_GADGET_ATMEL_USBA




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v5 00/20] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree

2017-07-26 Thread Łukasz Majewski

Hi Simon


This moves four entire boards to use a live device tree as an example of
the impact.


I've grepp'ed the ./doc directory and couldn't find any info regarding 
"livetree" feature.


From patches, I guess that livetree is about preparing DM tree just 
after relocation.


Am I right?

If I may ask - would you be so kind and prepare README entry in ./doc 
directory regarding livetree DM feature?


Thanks in advance,
Łukasz



Nyan-big was chosen because I can easily and boot U-Boot without any
media swapping, etc. Beaver is enabled as well since it failed to boot
with serial v1 due to a disabled console node. Jetson-TK1 is chosen
because I found some USB problems in the v2 patches. Jetson-TX1 is added
because Stephen Warren found some problems with PCI.

Total code size impact on this board is approximately 9KB on U-Boot and
64 bytes on SPL:

27: dm: tegra: nyan-big: Move to livetree
   arm: (for 1/1 boards) all +9264.0 bss -16.0 data +44.0 rodata +92.0
  spl/u-boot-spl:all +326.0 spl/u-boot-spl:rodata +262.0
  spl/u-boot-spl:text +64.0 text +9144.0

Tegra does not use Thumb2, which would likely reduce the code size by about
25%, indicating a code-size impact of perhaps 7KB.

Boot time is affected slightly. For nyan-big the times with flat tree are:

 2,108  dm_r
 7,924  dm_spl
   120,724  dm_f
   171,816  lcd

With the livetree:

   721  dm_r
 3,764  of_live
 7,990  dm_spl
   120,736  dm_f
   168,215  lcd

As expected the spl and pre-relocation times are not affected. In the
post-relocation case, the live tree must be built, which here takes about
3.8ms. Driver-model device creation takes a bit of 1ms less time with the
livetree, so all up the cost is about 2.4ms. After DM init there appears
to be a slight reduction in the time taken to set up devices (from 327ms
to 319ms) so overall the live tree does not appear to be any slower. This
is because pre-parsing the device tree makes reading it later faster.

The use of livetree is controlled by a the CONFIG_OF_LIVE option. When
enabled, U-Boot builds a livetree immediately after relocation and uses
it from then on.

This series is available at u-boot-dm/livet-working

Changes in v5:
- Update the get_enable() functions to use new method signature
- Update tegra-tk1 to port regulator work-around

Changes in v4:
- Add new patch to add ofnode_read_resource()
- Add new patch to fix up ofnode_get_addr_index() for 64-bit values
- Update to use ofnode_read_resource()
- Drop fdtdec.h header
- Update to deal with rename of ofnode_read_prop()
- Rebase to master
- Drop changes already applied
- Fix PCI and i2c init problems on jetson-tx1
- Enable livetree for jetson-tk1 also

Changes in v3:
- Update commit message, enable for all tegra124 boards not just nyan-big
- Add new patch to convert tegra PCI to device tree
- Enable livetree for jetson-tk1 also

Changes in v2:
- Enable livetree for beaver also
- Add timing information

Simon Glass (20):
  dm: core: Add ofnode_read_resource()
  dm: core: Fix up ofnode_get_addr_index() for 64-bit values
  tegra: spl: Enable debug UART
  tegra: tegra124: Add a PMC syscon driver
  dm: tegra: Convert USB setup to livetree
  dm: tegra: Convert clock_decode_periph_id() to support livetree
  dm: video: tegra124: Convert to livetree
  tegra: dts: Move stdout-path to /chosen
  dm: tegra: gpio: Convert to support livetree
  dm: tegra: usb: Convert to livetree
  dm: tegra: spi: Convert to livetree
  dm: tegra: i2c: Convert to livetree
  dm: tegra: pwm: Convert to livetree
  dm: tegra: mmc: Convert to livetree
  dm: tegra: pci: Convert to livetree
  power: Add a regulator driver for the as3722 PMIC
  power: Add a GPIO driver for the as3722 PMIC
  dm: power: Convert as3722 to driver model
  fdtdec: Drop old compatible values
  dm: tegra: Move nyan-big, jetson-tk1/tx1, beaver to livetree

 arch/arm/dts/tegra124-nyan-big.dts|   5 +-
 arch/arm/include/asm/arch-tegra/clock.h   |   2 +-
 arch/arm/include/asm/arch-tegra/tegra.h   |   5 +
 arch/arm/include/asm/arch-tegra/xusb-padctl.h |   2 +-
 arch/arm/mach-tegra/Kconfig   |   2 +
 arch/arm/mach-tegra/board2.c  |   8 +-
 arch/arm/mach-tegra/clock.c   |   5 +-
 arch/arm/mach-tegra/spl.c |   4 +
 arch/arm/mach-tegra/tegra124/Makefile |   1 +
 arch/arm/mach-tegra/tegra124/pmc.c|  19 ++
 arch/arm/mach-tegra/tegra124/xusb-padctl.c|  36 +++-
 arch/arm/mach-tegra/tegra210/xusb-padctl.c|  42 +++-
 arch/arm/mach-tegra/xusb-padctl-common.c  |  60 +++---
 arch/arm/mach-tegra/xusb-padctl-common.h  |   8 +-
 arch/arm/mach-tegra/xusb-padctl-dummy.c   |   2 +-
 board/cei/cei-tk1-som/cei-tk1-som.c   |   2 +
 board/nvidia/jetson-tk1/jetson-tk1.c  |  44 ++--
 board/nvidia/nyan-big/nyan-big.c  |  22 +-
 board/to

Re: [U-Boot] [PATCH] zynq: fb_mmc: Correct cast of address to u32

2017-07-24 Thread Łukasz Majewski

On 07/24/2017 02:53 PM, Marek Vasut wrote:

On 07/24/2017 02:47 PM, Tom Rini wrote:

On Mon, Jul 24, 2017 at 02:09:56PM +0200, Marek Vasut wrote:

On 07/23/2017 05:47 PM, Tom Rini wrote:

On Sun, Jul 23, 2017 at 09:05:31AM -0600, Simon Glass wrote:


This does not work on 64-bit machines. Update it to use ulong.

This fixes the following warnings in some zynq boards;

common/fb_mmc.c: In function 'fb_mmc_update_zimage':
common/fb_mmc.c:188:13: warning: cast from pointer to integer of different
size [-Wpointer-to-int-cast]
common/fb_mmc.c:189:8: warning: cast to pointer from integer of different
size [-Wint-to-pointer-cast]

Signed-off-by: Simon Glass 


I fixed this in a slightly different way a while ago and am waiting for
it to come in via the USB tree currently.


MMC patch via USB ? Anyway, this should use uintptr_t I guess ?


"fastboot" is USB gadget code, and comes via Lukasz.  Unless you want me
to pick it up directly?  Thanks!


The tags didn't indicate any such thing and I didn't see the entire
patch since it was clipped, so ... anyway, if it's fastboot, it indeed
goes via Lukasz.



The fb_mmc.c is a bit misleading.

I will take this patch when we fix issues with u-boot-usb tree.

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [u-boot-denx-usb] Build break on current u-boot-usb master

2017-07-24 Thread Łukasz Majewski

On 07/24/2017 09:02 AM, Bin Meng wrote:

On Mon, Jul 24, 2017 at 2:48 PM, Patrice CHOTARD  wrote:

Hi Marek

On 07/22/2017 08:36 PM, Marek Vasut wrote:

On 07/22/2017 08:18 PM, Łukasz Majewski wrote:

Hi Marek,

When I was "cleaning up" my patchwork todo list I've found following
problem (s):

A lot of boards are broken with message:

   LD  u-boot
drivers/usb/host/built-in.o: In function `xhci_dwc3_remove':
/home/lukma/work/embedded/u-boot-denx/drivers/usb/host/xhci-dwc3.c:161:
undefined reference to `generic_phy_exit'
drivers/usb/host/built-in.o: In function `xhci_dwc3_probe':
/home/lukma/work/embedded/u-boot-denx/drivers/usb/host/xhci-dwc3.c:127:
undefined reference to `generic_phy_get_by_index'
/home/lukma/work/embedded/u-boot-denx/drivers/usb/host/xhci-dwc3.c:134:
undefined reference to `generic_phy_init'
/opt/tfk-sc58x/2.3/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-ld.bfd:
BFD (GNU Binutils) 2.28.0.20170307 assertion fail
../../bfd/elf32-arm.c:9512
/opt/tfk-sc58x/2.3/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-ld.bfd:
BFD (GNU Binutils) 2.28.0.20170307 assertion fail
../../bfd/elf32-arm.c:9512
/opt/tfk-sc58x/2.3/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-ld.bfd:
BFD (GNU Binutils) 2.28.0.20170307 assertion fail
../../bfd/elf32-arm.c:9512
Makefile:1248: recipe for target 'u-boot' failed

The branch is:

u-boot-usb/master


I've tried to do "bisect" but another error showed up:

drivers/usb/host/xhci-dwc3.c: In function ‘xhci_dwc3_probe’:
drivers/usb/host/xhci-dwc3.c:109:29: warning: unused variable ‘plat’
[-Wunused-variable]
   struct xhci_dwc3_platdata *plat = dev_get_platdata(dev);
  ^~~~
drivers/usb/host/xhci-dwc3.c: At top level:
drivers/usb/host/xhci-dwc3.c:143:37: error: invalid application of
‘sizeof’ to incomplete type ‘struct xhci_dwc3_platdata’
   .platdata_auto_alloc_size = sizeof(struct xhci_dwc3_platdata),
  ^~
scripts/Makefile.build:280: recipe for target
'drivers/usb/host/xhci-dwc3.o' failed
make[1]: *** [drivers/usb/host/xhci-dwc3.o] Error 1


Patrice and Bin - please fix those errors and make the u-boot-usb tree
bisectable again.

I believe this is already underway since 2 days ago:
https://www.mail-archive.com/u-boot@lists.denx.de/msg256611.html



Regarding the bisection issue detected by Łukasz, it will imposed to
replace my "Extend xhci-dwc3" series already merged into your
u-boot-usb branch.

How do you want to proceed ?
I can resubmit the full 2 series with all fixes (bisection + compilation
issue) for "usb: Extend ehci and ohci generic driver" and "Extend
xhci-dwc3"


I think Marek can drop your previous series on u-boot-usb/master
completely then reapply your new series. After all, it's not on
u-boot/master yet, so everything can change.


+1



Regards,
Bin




--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH 00/52] Support OF_PLATDATA in TPL, enable RK3368 DRAM init and add RK3368-uQ7

2017-07-24 Thread Łukasz Majewski

On 07/24/2017 10:59 AM, Heiko Stübner wrote:

Am Montag, 24. Juli 2017, 16:38:52 CEST schrieb Andy Yan:

Hi Philipp:

On 2017年07月21日 18:55, Dr. Philipp Tomsich wrote:

On 21 Jul 2017, at 04:33, Andy Yan  wrote:

Hi:

On 2017年07月19日 04:35, Philipp Tomsich wrote:

Here's a series that has a lot going on, but I didn't want to split it
to allow everyone to understand the motivation between some of the
changes to the SPL/TPL framework.  The short summary of this is
"enablement for DRAM init on the RK3368 with everything else that's
necessary to do it using OF_PLATDATA in TPL".

Enabling the RK3368 created a few more challenges that I'd expected:
  - I needed different stack locations, text addresses and sizes for

TPL and SPL

  - the TPL stage was to use OF_PLATDATA and SPL was to use full
  OF_CONTROL
  - with the RK3368 TPL stage, there was a need to extend the
  back-to-bootrom

support for Rockchip to AArch64

  - I wanted to start folding some of the Rockchip specific SPL support

(i.e. back-to-bootrom) back into the general SPL framework to allow
using it as a general boot method


I have a confusion here: according to the README.TPL,  TPL is Third
Program Loader, which loaded by the SPL. So I think it should run after
the SPL. But from RK3188 and RK3368 TPL implementation , they all run
before SPL.Maybe it is my misunderstanding, hope to get some
guidance.:-)>

I think you are right and most Rockchip boards have been using this the
wrong way around.


Actually at first I also had the ordering of SPL -> TPL -> uboot for rk3188
but after discussions with Simon and Tom Rini, the opinion was that TPL
stands for "tiny" program loader and should run before the full SPL.


Has something changed since:

http://www.denx.de/wiki/pub/U-Boot/MiniSummitELCE2013/tpl-presentation.pdf

I've always thought that we do have SPL -> TPL -> u-boot -> Linux

If there was a change, then:

1. The TPL name is a bit misleading (considering the above 
presentation/status)


2. IMHO the code running before SPL (to do some _real_ early init) 
should be named more descriptive like PreSPL.




So I switched that stuff around on rk3188.


Heiko


 Only RK3188 uses TPL now.


With the fine-grained configurability that I created for the RK3368, it
will be easy enough to switch this around on the RK3368. However, this
will then also be done for the other RK3xxx devices to restore
consistency.

I would prefer to first add the RK3368 support with the “backwards
TPL/SPL” (i.e. TPL before SPL) to remain consistent with current
mach-rockchip usage of the TPL/SPL terminology. Once this is merged, we
can then switch this around for each board individually.>

So I ended up separating quite a bit of features between SPL and TPL
while keeping things transparent to the few other boards using TPL (at
least I hope that things are transparent, as we didn't have any of
those in our lab to test on)...

Tested with: RK3368-uQ7, Debian 9, Linux 4.13-rc1.

Just one final remark: the DMC driver for the RK3368 currently covers
the configuration we use on the RK3368-uQ7 (i.e. 32bit wide, 2 ranks)
and is stress-tested (including 8-way SPEC runs) at all 3 supported
speeds.  I've built a bit of infrastructure (e.g. the way the
memory-schedule is determined) that I hope will be a useful
starting-point in unifying the drivers for the various closely related
DRAM controllers (e.g. for the RK3288) for Rockchip devices in the
future.

Klaus Goger (1):
   rockchip: board: puma_rk3399: rename ATF firmware

Philipp Tomsich (51):
   spl: add a 'return to bootrom' boot method
   spl: configure 'return to bootrom' separately for SPL and TPL
   rockchip: back-to-bootrom: add 'back-to-bootrom' support for AArch64
   rockchip: back-to-bootrom: split BACK_TO_BOOTROM for TPL/SPL
   rockchip: back-to-bootrom: simplify the #ifdef-check for LIBGENERIC
   in

 TPL/SPL

   spl: dm: Kconfig: use more specific prereqs for SPL_REGMAP and

 SPL_SYSCON

   spl: dm: Kconfig: split REGMAP/SYSCON support for TPL from SPL
   spl: dm: Kconfig: SPL_RAM depends on SPL_DM
   spl: dm: Kconfig: introduce TPL_RAM (in analogy to SPL_RAM)
   spl: dm: Kconfig: SPL_CLK depens on SPL_DM
   spl: dm: Kconfig: split CLK support for SPL and TPL
   spl: dm: Kconfig: split OF_CONTROL and OF_PLATDATA between SPL and
   TPL
   spl: dm: use CONFIG_IS_ENABLED to test for the DM option
   armv8: remove unused low-level modules from TPL
   armv8: spl: Support separate stack for TPL
   spl: allow a separate TEXT_BASE, LDSCRIPT and MAX_SIZE for TPL
   spl: Kconfig: split SYS_MALLOC_SIMPLE for TPL and SPL
   lib: spl: differentiate between TPL and SPL for

 libfdt/of_control/of_platdata

   spl: consistently use $(SPL_TPL_) to select features for SPL and TPL

 builds

   spl: add TPL_DRIVER_MISC_SUPPORT option
   drivers: spl: consistently use the $(SPL_TPL_) macro
   rockchip: Makefile: allow selective inclusion of sdram_common.o from

 TPL/SPL/U-Boot

   rockchip: rk3368: impr

Re: [U-Boot] [u-boot-denx-usb] Build break on current u-boot-usb master

2017-07-22 Thread Łukasz Majewski

On 07/22/2017 08:36 PM, Marek Vasut wrote:

On 07/22/2017 08:18 PM, Łukasz Majewski wrote:

Hi Marek,

When I was "cleaning up" my patchwork todo list I've found following
problem (s):

A lot of boards are broken with message:

  LD  u-boot
drivers/usb/host/built-in.o: In function `xhci_dwc3_remove':
/home/lukma/work/embedded/u-boot-denx/drivers/usb/host/xhci-dwc3.c:161:
undefined reference to `generic_phy_exit'
drivers/usb/host/built-in.o: In function `xhci_dwc3_probe':
/home/lukma/work/embedded/u-boot-denx/drivers/usb/host/xhci-dwc3.c:127:
undefined reference to `generic_phy_get_by_index'
/home/lukma/work/embedded/u-boot-denx/drivers/usb/host/xhci-dwc3.c:134:
undefined reference to `generic_phy_init'
/opt/tfk-sc58x/2.3/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-ld.bfd:
BFD (GNU Binutils) 2.28.0.20170307 assertion fail
../../bfd/elf32-arm.c:9512
/opt/tfk-sc58x/2.3/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-ld.bfd:
BFD (GNU Binutils) 2.28.0.20170307 assertion fail
../../bfd/elf32-arm.c:9512
/opt/tfk-sc58x/2.3/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-ld.bfd:
BFD (GNU Binutils) 2.28.0.20170307 assertion fail
../../bfd/elf32-arm.c:9512
Makefile:1248: recipe for target 'u-boot' failed

The branch is:

u-boot-usb/master


I've tried to do "bisect" but another error showed up:

drivers/usb/host/xhci-dwc3.c: In function ‘xhci_dwc3_probe’:
drivers/usb/host/xhci-dwc3.c:109:29: warning: unused variable ‘plat’
[-Wunused-variable]
  struct xhci_dwc3_platdata *plat = dev_get_platdata(dev);
 ^~~~
drivers/usb/host/xhci-dwc3.c: At top level:
drivers/usb/host/xhci-dwc3.c:143:37: error: invalid application of
‘sizeof’ to incomplete type ‘struct xhci_dwc3_platdata’
  .platdata_auto_alloc_size = sizeof(struct xhci_dwc3_platdata),
 ^~
scripts/Makefile.build:280: recipe for target
'drivers/usb/host/xhci-dwc3.o' failed
make[1]: *** [drivers/usb/host/xhci-dwc3.o] Error 1


Patrice and Bin - please fix those errors and make the u-boot-usb tree
bisectable again.

I believe this is already underway since 2 days ago:
https://www.mail-archive.com/u-boot@lists.denx.de/msg256611.html


Ok. Good :-) Thanks






--
Best regards,

Lukasz Majewski

--

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


  1   2   >