Re: [U-Boot] [PATCH v2 0/8] imx: add USB Serial Download Protocol (SDP) support

2017-09-11 Thread Stefan Agner
On 2017-09-11 07:15, Vincent Prince wrote:
> Hi Stefan,
> 
> It was probably a Windows bug as it is almost working now.

Yeah with Windows the multiple re-enumeration is sometimes a bit
strange, it leads to rather long running driver search on first connect.

> I was wondering why sdp command is expecting a jump ?
> Is it necessary to jump after USB transfer, or we should download
> anything we want and jump if asked ?

You don't have to jump, you can also go back to the console using
Ctrl+C. The jump just allows you to remotely continue booting with a
specific script...

--
Stefan

> 
> Regards,
> Vincent
> 
> 
> 2017-09-08 18:37 GMT+02:00 Stefan Agner :
>> Hi Vincent,
>>
>> On 2017-09-08 01:27, Vincent Prince wrote:
>>> Hi everyone,
>>>
>>> I managed to get SDP protocol to work with on my custom i.MX6 board,
>>> so big thanks to Stefan for your work!
>>>
>>> I'm now trying to load swupdate ramdisk with u-boot sdp command,
>>> without success.
>>> Is it a possible use case ?
>>
>> Yes it should work, we use the U-Boot sdp command to download a squashfs
>> based ramdisk in our Toradex Easy Installer:
>> http://developer.toradex.com/software/toradex-easy-installer
>>
>>>
>>> Here my steps:
>>>
>>> In u-boot:
>>> => sdp 0
>>>
>>> On Host,
>>> $ imx_usb
>>>
>>> config file 
>>> vid=0x15a2 pid=0x0061 file_name=mx6_usb_rom.conf -> vid=0x0525
>>> pid=0xb4a4 file_name=mx6_usb_sdp_spl.conf
>>> vid=0x0525 pid=0xa4a5 file_name=mx6_usb_uboot.conf
>>> config file 
>>> parse C:\Users\vpr\IMXUSBLOADER2\delivery\\mx6_usb_uboot.conf
>>> Trying to open device vid=0x0525 pid=0xa4a5.
>>> Could not open device vid=0x0525 pid=0xa4a5
>>
>> Is VID/PID showing up in Device Manager?
>>
>> We did saw some problems with certain USB host implementation, so it
>> might be a device dependency... I would also try a different
>> machine/maybe Linux machine...
>>
>>>
>>> VID/PID in imx_usb.conf are correctly detected, and correct
>>> configuration file is launched (mx6_usb_uboot.conf),
>>> it contains:
>>>
>>> mx6_usb_sdp_uboot
>>> hid,1024,0x1000,1G,0x00907000,0x31000
>>> test.txt:load 0x1210
>>>
>>> My imx_usb.conf is the following:
>>>
>>> #vid:pid, config_file
>>> 0x15a2:0x0061, mx6_usb_rom.conf, 0x0525:0xb4a4, mx6_usb_sdp_spl.conf
>>> 0x0525:0xa4a5, mx6_usb_uboot.conf
>>
>> Yeah assuming you use the Toradex branch of imx_loader currently this
>> should work.
>>
>> Our script looks like this:
>> mx6_usb_sdp_uboot
>> #hid/bulk,[old_header,]max packet size, {ram start, ram size}(repeat
>> valid ram areas)
>> hid,1024,0x1000,1G,0x00907000,0x31000
>> #Load complete FIT image to $ramdisk_addr_r
>> tezi.itb:load 0x1210
>> #Load script to $loadaddr and jump to it
>> boot-sdp.scr:load 0x1200,jump 0x1200
>>
>> --
>> Stefan
>>
>>
>>>
>>> Am I missing something,
>>> Thanks,
>>> Vincent
>>>
>>> 2017-09-01 22:09 GMT+02:00 Stefan Agner :


 On September 1, 2017 12:25:44 PM PDT, Fabio Estevam  
 wrote:
>On Fri, Sep 1, 2017 at 3:54 PM, Fabio Estevam 
>wrote:
>
>> I have tested this method and it works, thanks.
>>
>> Do you plan to usptream this method?
>
>Or I can also put your patch as part of my series that adds SDP
>support for imx6qsabresd if you prefer.

 Let me do a separate, I guess it could be controversial...

 --
 Stefan
 --
 Sent from my Android device with K-9 Mail. Please excuse my brevity.
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 https://lists.denx.de/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 0/8] imx: add USB Serial Download Protocol (SDP) support

2017-09-08 Thread Stefan Agner
Hi Vincent,

On 2017-09-08 01:27, Vincent Prince wrote:
> Hi everyone,
> 
> I managed to get SDP protocol to work with on my custom i.MX6 board,
> so big thanks to Stefan for your work!
> 
> I'm now trying to load swupdate ramdisk with u-boot sdp command,
> without success.
> Is it a possible use case ?

Yes it should work, we use the U-Boot sdp command to download a squashfs
based ramdisk in our Toradex Easy Installer:
http://developer.toradex.com/software/toradex-easy-installer

> 
> Here my steps:
> 
> In u-boot:
> => sdp 0
> 
> On Host,
> $ imx_usb
> 
> config file 
> vid=0x15a2 pid=0x0061 file_name=mx6_usb_rom.conf -> vid=0x0525
> pid=0xb4a4 file_name=mx6_usb_sdp_spl.conf
> vid=0x0525 pid=0xa4a5 file_name=mx6_usb_uboot.conf
> config file 
> parse C:\Users\vpr\IMXUSBLOADER2\delivery\\mx6_usb_uboot.conf
> Trying to open device vid=0x0525 pid=0xa4a5.
> Could not open device vid=0x0525 pid=0xa4a5

Is VID/PID showing up in Device Manager?

We did saw some problems with certain USB host implementation, so it
might be a device dependency... I would also try a different
machine/maybe Linux machine...

> 
> VID/PID in imx_usb.conf are correctly detected, and correct
> configuration file is launched (mx6_usb_uboot.conf),
> it contains:
> 
> mx6_usb_sdp_uboot
> hid,1024,0x1000,1G,0x00907000,0x31000
> test.txt:load 0x1210
> 
> My imx_usb.conf is the following:
> 
> #vid:pid, config_file
> 0x15a2:0x0061, mx6_usb_rom.conf, 0x0525:0xb4a4, mx6_usb_sdp_spl.conf
> 0x0525:0xa4a5, mx6_usb_uboot.conf

Yeah assuming you use the Toradex branch of imx_loader currently this
should work.

Our script looks like this:
mx6_usb_sdp_uboot
#hid/bulk,[old_header,]max packet size, {ram start, ram size}(repeat
valid ram areas)
hid,1024,0x1000,1G,0x00907000,0x31000
#Load complete FIT image to $ramdisk_addr_r
tezi.itb:load 0x1210
#Load script to $loadaddr and jump to it
boot-sdp.scr:load 0x1200,jump 0x1200

--
Stefan


> 
> Am I missing something,
> Thanks,
> Vincent
> 
> 2017-09-01 22:09 GMT+02:00 Stefan Agner :
>>
>>
>> On September 1, 2017 12:25:44 PM PDT, Fabio Estevam  
>> wrote:
>>>On Fri, Sep 1, 2017 at 3:54 PM, Fabio Estevam 
>>>wrote:
>>>
 I have tested this method and it works, thanks.

 Do you plan to usptream this method?
>>>
>>>Or I can also put your patch as part of my series that adds SDP
>>>support for imx6qsabresd if you prefer.
>>
>> Let me do a separate, I guess it could be controversial...
>>
>> --
>> Stefan
>> --
>> Sent from my Android device with K-9 Mail. Please excuse my brevity.
>> ___
>> U-Boot mailing list
>> U-Boot@lists.denx.de
>> https://lists.denx.de/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 0/8] imx: add USB Serial Download Protocol (SDP) support

2017-09-08 Thread Vincent Prince
Hi everyone,

I managed to get SDP protocol to work with on my custom i.MX6 board,
so big thanks to Stefan for your work!

I'm now trying to load swupdate ramdisk with u-boot sdp command,
without success.
Is it a possible use case ?

Here my steps:

In u-boot:
=> sdp 0

On Host,
$ imx_usb

config file 
vid=0x15a2 pid=0x0061 file_name=mx6_usb_rom.conf -> vid=0x0525
pid=0xb4a4 file_name=mx6_usb_sdp_spl.conf
vid=0x0525 pid=0xa4a5 file_name=mx6_usb_uboot.conf
config file 
parse C:\Users\vpr\IMXUSBLOADER2\delivery\\mx6_usb_uboot.conf
Trying to open device vid=0x0525 pid=0xa4a5.
Could not open device vid=0x0525 pid=0xa4a5

VID/PID in imx_usb.conf are correctly detected, and correct
configuration file is launched (mx6_usb_uboot.conf),
it contains:

mx6_usb_sdp_uboot
hid,1024,0x1000,1G,0x00907000,0x31000
test.txt:load 0x1210

My imx_usb.conf is the following:

#vid:pid, config_file
0x15a2:0x0061, mx6_usb_rom.conf, 0x0525:0xb4a4, mx6_usb_sdp_spl.conf
0x0525:0xa4a5, mx6_usb_uboot.conf

Am I missing something,
Thanks,
Vincent

2017-09-01 22:09 GMT+02:00 Stefan Agner :
>
>
> On September 1, 2017 12:25:44 PM PDT, Fabio Estevam  
> wrote:
>>On Fri, Sep 1, 2017 at 3:54 PM, Fabio Estevam 
>>wrote:
>>
>>> I have tested this method and it works, thanks.
>>>
>>> Do you plan to usptream this method?
>>
>>Or I can also put your patch as part of my series that adds SDP
>>support for imx6qsabresd if you prefer.
>
> Let me do a separate, I guess it could be controversial...
>
> --
> Stefan
> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 0/8] imx: add USB Serial Download Protocol (SDP) support

2017-09-01 Thread Stefan Agner


On September 1, 2017 12:25:44 PM PDT, Fabio Estevam  wrote:
>On Fri, Sep 1, 2017 at 3:54 PM, Fabio Estevam 
>wrote:
>
>> I have tested this method and it works, thanks.
>>
>> Do you plan to usptream this method?
>
>Or I can also put your patch as part of my series that adds SDP
>support for imx6qsabresd if you prefer.

Let me do a separate, I guess it could be controversial...

--
Stefan
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 0/8] imx: add USB Serial Download Protocol (SDP) support

2017-09-01 Thread Fabio Estevam
On Fri, Sep 1, 2017 at 3:54 PM, Fabio Estevam  wrote:

> I have tested this method and it works, thanks.
>
> Do you plan to usptream this method?

Or I can also put your patch as part of my series that adds SDP
support for imx6qsabresd if you prefer.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 0/8] imx: add USB Serial Download Protocol (SDP) support

2017-09-01 Thread Fabio Estevam
Hi Stefan,

On Fri, Sep 1, 2017 at 3:19 PM, Stefan Agner  wrote:

> That is the issue I am describing here:
> https://lists.denx.de/pipermail/u-boot/2017-August/301952.html
>
> Either enter recovery mode explicitly (by setting the BMODE pins or
> using the bmode command)

On imx6qsabresd it is not possible to put the boot pins into serial
download mode.

>
> Or you can use the USB PHY method which indicates whether the ROM used
> serial downloader. We use this in our downstream U-Boot (NXP used that
> method to go into "mgfr" mode...)
> http://git.toradex.com/cgit/u-boot-toradex.git/commit/?h=2016.11-toradex-next=0d069117614b590848b490e348488362443c5547
> http://git.toradex.com/cgit/u-boot-toradex.git/commit/?h=2016.11-toradex-next=80c3bd6c2750c3c2843537f015c0d675b1b74a58

I have tested this method and it works, thanks.

Do you plan to usptream this method?

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


Re: [U-Boot] [PATCH v2 0/8] imx: add USB Serial Download Protocol (SDP) support

2017-09-01 Thread Stefan Agner
On 2017-09-01 09:48, Fabio Estevam wrote:
> Hi Stefan,
> 
> On Wed, Aug 16, 2017 at 3:00 PM, Stefan Agner  wrote:
>> 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).
>>
>> 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
>>
>> (in case this patchset gets accepted in U-Boot, I plan to push
>> these imx_usb changes upstream as well)
>>
>> The full patchset allows to download SPL and U-Boot over USB to a
>> target in recovery mode using the same usb_imx utility. Refer to
>> the new README.sdp for details how to use usb_imx in combination
>> with this implementation.
> 
> I am trying to use this feature on a imx6qsabresd board.
> 
> Here are the changes I made (against u-boot-imx latest tree):
> 
> diff --git a/board/freescale/mx6sabresd/mx6sabresd.c
> b/board/freescale/mx6sabresd/mx6sabresd.c
> index 5b50bc8..6ca2485 100644
> --- a/board/freescale/mx6sabresd/mx6sabresd.c
> +++ b/board/freescale/mx6sabresd/mx6sabresd.c
> @@ -29,6 +29,7 @@
>  #include 
>  #include "../common/pfuze.h"
>  #include 
> +#include 
> 
>  DECLARE_GLOBAL_DATA_PTR;
> 
> @@ -1033,6 +1034,19 @@ static void spl_dram_init(void)
> ddr_init(mx6dl_dcd_table, ARRAY_SIZE(mx6dl_dcd_table));
>  }
> 
> +#ifdef CONFIG_SPL_USB_GADGET_SUPPORT
> +#define FSL_USB_PRODUCT_NUM_OFFSET0xa4a5
> +int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
> +{
> +   unsigned short usb_pid;
> +
> +   usb_pid = FSL_USB_PRODUCT_NUM_OFFSET + 0xff;
> +   put_unaligned(usb_pid, >idProduct);
> +
> +   return 0;
> +}
> +#endif
> +
>  void board_init_f(ulong dummy)
>  {
> /* DDR initialization */
> diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
> index 7949c5e..1c08639 100644
> --- a/configs/mx6sabresd_defconfig
> +++ b/configs/mx6sabresd_defconfig
> @@ -19,6 +19,9 @@ CONFIG_SPL=y
>  CONFIG_SPL_EXT_SUPPORT=y
>  CONFIG_SPL_I2C_SUPPORT=y
>  CONFIG_SPL_OS_BOOT=y
> +CONFIG_SPL_USB_HOST_SUPPORT=y
> +CONFIG_SPL_USB_GADGET_SUPPORT=y
> +CONFIG_SPL_USB_SDP_SUPPORT=y
>  CONFIG_HUSH_PARSER=y
>  CONFIG_CMD_BOOTZ=y
>  # CONFIG_CMD_IMLS is not set
> @@ -32,6 +35,7 @@ CONFIG_CMD_PART=y
>  CONFIG_CMD_PCI=y
>  CONFIG_CMD_SF=y
>  CONFIG_CMD_USB=y
> +CONFIG_CMD_USB_SDP=y
>  CONFIG_CMD_DHCP=y
>  CONFIG_CMD_MII=y
>  CONFIG_CMD_PING=y
> 
> Then I use the imx_usb tool from
> https://github.com/toradex/imx_loader/tree/imx_usb_batch_mode_refactored
> 
> I remove the SD card, so that the board goes to SDP and then run:
> 
> sudo ./imx_usb SPL
> 
> and then I see in the board console:
> 
> U-Boot SPL 2017.09-rc2-36996-g63af4b0-dirty (Sep 01 2017 - 13:42:55)
> Trying to boot from MMC1
> MMC: no card present
> mmc_init: -123, time 1
> spl: mmc init failed with error: -123
> SPL: failed to boot from all boot devices
> ### ERROR ### Please RESET the board ###
> 
> I was expecting to see:
> 
>   Trying to boot from USB SDP
>   SDP: initialize...
>   SDP: handle requests...
> 
> as per the README.sdp
> 
> Any ideas as to what I am missing?


That is the issue I am describing here:
https://lists.denx.de/pipermail/u-boot/2017-August/301952.html

Either enter recovery mode explicitly (by setting the BMODE pins or
using the bmode command)

Or you can use the USB PHY method which indicates whether the ROM used
serial downloader. We use this in our downstream U-Boot (NXP used that
method to go into "mgfr" mode...)
http://git.toradex.com/cgit/u-boot-toradex.git/commit/?h=2016.11-toradex-next=0d069117614b590848b490e348488362443c5547
http://git.toradex.com/cgit/u-boot-toradex.git/commit/?h=2016.11-toradex-next=80c3bd6c2750c3c2843537f015c0d675b1b74a58

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


Re: [U-Boot] [PATCH v2 0/8] imx: add USB Serial Download Protocol (SDP) support

2017-09-01 Thread Fabio Estevam
Hi Stefan,

On Wed, Aug 16, 2017 at 3:00 PM, Stefan Agner  wrote:
> 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).
>
> 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
>
> (in case this patchset gets accepted in U-Boot, I plan to push
> these imx_usb changes upstream as well)
>
> The full patchset allows to download SPL and U-Boot over USB to a
> target in recovery mode using the same usb_imx utility. Refer to
> the new README.sdp for details how to use usb_imx in combination
> with this implementation.

I am trying to use this feature on a imx6qsabresd board.

Here are the changes I made (against u-boot-imx latest tree):

diff --git a/board/freescale/mx6sabresd/mx6sabresd.c
b/board/freescale/mx6sabresd/mx6sabresd.c
index 5b50bc8..6ca2485 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -29,6 +29,7 @@
 #include 
 #include "../common/pfuze.h"
 #include 
+#include 

 DECLARE_GLOBAL_DATA_PTR;

@@ -1033,6 +1034,19 @@ static void spl_dram_init(void)
ddr_init(mx6dl_dcd_table, ARRAY_SIZE(mx6dl_dcd_table));
 }

+#ifdef CONFIG_SPL_USB_GADGET_SUPPORT
+#define FSL_USB_PRODUCT_NUM_OFFSET0xa4a5
+int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
+{
+   unsigned short usb_pid;
+
+   usb_pid = FSL_USB_PRODUCT_NUM_OFFSET + 0xff;
+   put_unaligned(usb_pid, >idProduct);
+
+   return 0;
+}
+#endif
+
 void board_init_f(ulong dummy)
 {
/* DDR initialization */
diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index 7949c5e..1c08639 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -19,6 +19,9 @@ CONFIG_SPL=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
+CONFIG_SPL_USB_HOST_SUPPORT=y
+CONFIG_SPL_USB_GADGET_SUPPORT=y
+CONFIG_SPL_USB_SDP_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
@@ -32,6 +35,7 @@ CONFIG_CMD_PART=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
+CONFIG_CMD_USB_SDP=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y

Then I use the imx_usb tool from
https://github.com/toradex/imx_loader/tree/imx_usb_batch_mode_refactored

I remove the SD card, so that the board goes to SDP and then run:

sudo ./imx_usb SPL

and then I see in the board console:

U-Boot SPL 2017.09-rc2-36996-g63af4b0-dirty (Sep 01 2017 - 13:42:55)
Trying to boot from MMC1
MMC: no card present
mmc_init: -123, time 1
spl: mmc init failed with error: -123
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

I was expecting to see:

  Trying to boot from USB SDP
  SDP: initialize...
  SDP: handle requests...

as per the README.sdp

Any ideas as to what I am missing?

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


Re: [U-Boot] [PATCH v2 0/8] imx: add USB Serial Download Protocol (SDP) support

2017-08-23 Thread Fabio Estevam
On Wed, Aug 23, 2017 at 5:43 AM, Stefano Babic  wrote:

> I have merged the whole series to u-boot-imx. Many thanks for your
> effort, this was in the TODO list for i.MX since a long time !

Yes, very nice job, Stefan!

I will be using it soon on mx6sabresd, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 0/8] imx: add USB Serial Download Protocol (SDP) support

2017-08-23 Thread Stefano Babic
Hi Stefan,

On 16/08/2017 20:00, Stefan Agner wrote:
> 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).
> 
> 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
> 
> (in case this patchset gets accepted in U-Boot, I plan to push
> these imx_usb changes upstream as well)
> 
> The full patchset allows to download SPL and U-Boot over USB to a
> target in recovery mode using the same usb_imx utility. Refer to
> the new README.sdp for details how to use usb_imx in combination
> with this implementation.
> 
> 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
> - Changed function signature of sdp_init/sdp_handle
> - Use BOOT_DEVICE_BOARD
> 
> Stefan Agner (8):
>   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
>   doc: add Serial Download Protocol documentation
>   apalis/colibri_imx6: use independent USB PID for SPL
>   apalis/colibri_imx6: enable SDP by default
> 

I have merged the whole series to u-boot-imx. Many thanks for your
effort, this was in the TODO list for i.MX since a long time !

Best regards,
Stefano Babic

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


[U-Boot] [PATCH v2 0/8] imx: add USB Serial Download Protocol (SDP) support

2017-08-16 Thread Stefan Agner
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).

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

(in case this patchset gets accepted in U-Boot, I plan to push
these imx_usb changes upstream as well)

The full patchset allows to download SPL and U-Boot over USB to a
target in recovery mode using the same usb_imx utility. Refer to
the new README.sdp for details how to use usb_imx in combination
with this implementation.

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
- Changed function signature of sdp_init/sdp_handle
- Use BOOT_DEVICE_BOARD

Stefan Agner (8):
  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
  doc: add Serial Download Protocol documentation
  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  |  50 ++
 common/spl/Kconfig|   6 +
 common/spl/Makefile   |   1 +
 common/spl/spl_sdp.c  |  37 ++
 configs/apalis_imx6_defconfig |   4 +
 configs/colibri_imx6_defconfig|   4 +
 doc/README.sdp| 100 
 drivers/usb/gadget/Kconfig|   7 +
 drivers/usb/gadget/Makefile   |   2 +
 drivers/usb/gadget/f_sdp.c| 737 ++
 {tools => include}/imximage.h |   0
 include/sdp.h |  16 +
 16 files changed, 998 insertions(+)
 create mode 100644 cmd/usb_gadget_sdp.c
 create mode 100644 common/spl/spl_sdp.c
 create mode 100644 doc/README.sdp
 create mode 100644 drivers/usb/gadget/f_sdp.c
 rename {tools => include}/imximage.h (100%)
 create mode 100644 include/sdp.h

-- 
2.14.1

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