diff mbox series

imx_usb_loader: Allow target build

Message ID 1526462165-1544-1-git-send-email-vincent.prince.fr@gmail.com
State Accepted
Headers show
Series imx_usb_loader: Allow target build | expand

Commit Message

Vincent Prince May 16, 2018, 9:16 a.m. UTC
Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
---
 package/Config.in                        |  1 +
 package/imx-usb-loader/Config.in         | 10 ++++++++++
 package/imx-usb-loader/imx-usb-loader.mk |  8 ++++++++
 3 files changed, 19 insertions(+)
 create mode 100644 package/imx-usb-loader/Config.in

Comments

Thomas Petazzoni May 19, 2018, 12:29 p.m. UTC | #1
Hello,

On Wed, 16 May 2018 11:16:05 +0200, Vincent Prince wrote:
> Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>

Could you give some details on the use case for having a target package
for the imx_usb_loader ? Are you building a system with Buildroot that
itself is responsible for loading a bootloader over USB to a separate
i.MX6 target ? If not, what is your use case ?

> diff --git a/package/imx-usb-loader/Config.in b/package/imx-usb-loader/Config.in
> new file mode 100644
> index 0000000..41585e2
> --- /dev/null
> +++ b/package/imx-usb-loader/Config.in
> @@ -0,0 +1,10 @@
> +config BR2_PACKAGE_IMX_USB_LOADER
> +	bool "imx-usb-loader"
> +	depends on BR2_arm

Why do you have this dependency ? If your use case is as explained
above to build a Buildroot system that itself will be responsible for
loading over USB the bootloader of a separate i.MX6 device, then this
system may be running on something else than an ARM platform.

> +    select BR2_PACKAGE_LIBUSB

Indentation is wrong for this line, it should be indented with one tab.
I can fix this up when applying once the use case is clearer.

Best regards,

Thomas
Vincent Prince May 19, 2018, 5:34 p.m. UTC | #2
Hi Thomas,

For automatic testing purpose, I use an intermediate target (arm) between
host and DUT.
It uses imx_usb_loader and otp_com (https://github.com/ixonos/utp_com) as
described here:
https://community.nxp.com/thread/441563 to flash imx6 DUT with labgrid.

Indeed, extra arm depends is a mistake.

Sorry for indentation,

Best regards,
Vincent

2018-05-19 14:29 GMT+02:00 Thomas Petazzoni <thomas.petazzoni@bootlin.com>:

> Hello,
>
> On Wed, 16 May 2018 11:16:05 +0200, Vincent Prince wrote:
> > Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
>
> Could you give some details on the use case for having a target package
> for the imx_usb_loader ? Are you building a system with Buildroot that
> itself is responsible for loading a bootloader over USB to a separate
> i.MX6 target ? If not, what is your use case ?
>
> > diff --git a/package/imx-usb-loader/Config.in b/package/imx-usb-loader/
> Config.in
> > new file mode 100644
> > index 0000000..41585e2
> > --- /dev/null
> > +++ b/package/imx-usb-loader/Config.in
> > @@ -0,0 +1,10 @@
> > +config BR2_PACKAGE_IMX_USB_LOADER
> > +     bool "imx-usb-loader"
> > +     depends on BR2_arm
>
> Why do you have this dependency ? If your use case is as explained
> above to build a Buildroot system that itself will be responsible for
> loading over USB the bootloader of a separate i.MX6 device, then this
> system may be running on something else than an ARM platform.
>
> > +    select BR2_PACKAGE_LIBUSB
>
> Indentation is wrong for this line, it should be indented with one tab.
> I can fix this up when applying once the use case is clearer.
>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
<div dir="ltr">Hi Thomas, <br><br>For automatic testing purpose, I use an intermediate target (arm) between host and DUT.<br>It uses imx_usb_loader and otp_com (<a href="https://github.com/ixonos/utp_com">https://github.com/ixonos/utp_com</a>) as described here:<br><a href="https://community.nxp.com/thread/441563">https://community.nxp.com/thread/441563</a> to flash imx6 DUT with labgrid. <br><br>Indeed, extra arm depends is a mistake. <br><br>Sorry for indentation,<br><br>Best regards,<br>Vincent</div><div class="gmail_extra"><br><div class="gmail_quote">2018-05-19 14:29 GMT+02:00 Thomas Petazzoni <span dir="ltr">&lt;<a href="mailto:thomas.petazzoni@bootlin.com" target="_blank">thomas.petazzoni@bootlin.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
On Wed, 16 May 2018 11:16:05 +0200, Vincent Prince wrote:<br>
&gt; Signed-off-by: Vincent Prince &lt;<a href="mailto:vincent.prince.fr@gmail.com">vincent.prince.fr@gmail.com</a>&gt;<br>
<br>
Could you give some details on the use case for having a target package<br>
for the imx_usb_loader ? Are you building a system with Buildroot that<br>
itself is responsible for loading a bootloader over USB to a separate<br>
i.MX6 target ? If not, what is your use case ?<br>
<span class=""><br>
&gt; diff --git a/package/imx-usb-loader/<wbr>Config.in b/package/imx-usb-loader/<wbr>Config.in<br>
&gt; new file mode 100644<br>
&gt; index 0000000..41585e2<br>
&gt; --- /dev/null<br>
&gt; +++ b/package/imx-usb-loader/<wbr>Config.in<br>
&gt; @@ -0,0 +1,10 @@<br>
&gt; +config BR2_PACKAGE_IMX_USB_LOADER<br>
&gt; +     bool &quot;imx-usb-loader&quot;<br>
&gt; +     depends on BR2_arm<br>
<br>
</span>Why do you have this dependency ? If your use case is as explained<br>
above to build a Buildroot system that itself will be responsible for<br>
loading over USB the bootloader of a separate i.MX6 device, then this<br>
system may be running on something else than an ARM platform.<br>
<br>
&gt; +    select BR2_PACKAGE_LIBUSB<br>
<br>
Indentation is wrong for this line, it should be indented with one tab.<br>
I can fix this up when applying once the use case is clearer.<br>
<br>
Best regards,<br>
<br>
Thomas<br>
<span class="HOEnZb"><font color="#888888">-- <br>
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)<br>
Embedded Linux and Kernel engineering<br>
<a href="https://bootlin.com" rel="noreferrer" target="_blank">https://bootlin.com</a><br>
</font></span></blockquote></div><br></div>
Thomas Petazzoni May 19, 2018, 8:43 p.m. UTC | #3
Hello,

On Wed, 16 May 2018 11:16:05 +0200, Vincent Prince wrote:
> Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
> ---
>  package/Config.in                        |  1 +
>  package/imx-usb-loader/Config.in         | 10 ++++++++++
>  package/imx-usb-loader/imx-usb-loader.mk |  8 ++++++++
>  3 files changed, 19 insertions(+)
>  create mode 100644 package/imx-usb-loader/Config.in

I've applied to next, after doing the following changes:

    [Thomas:
     - improve commit log
     - fix indentation
     - drop BR2_arm dependency
     - add missing host-pkgconf dependency
     - fix prefix variable to install in $(TARGET_DIR)/usr]

Thanks!

Thomas
diff mbox series

Patch

diff --git a/package/Config.in b/package/Config.in
index 2be6c64..3cf53ed 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -186,6 +186,7 @@  menu "Filesystem and flash utilities"
 	source "package/genext2fs/Config.in"
 	source "package/genpart/Config.in"
 	source "package/genromfs/Config.in"
+	source "package/imx-usb-loader/Config.in"
 	source "package/mfgtools/Config.in"
 	source "package/mmc-utils/Config.in"
 	source "package/mtd/Config.in"
diff --git a/package/imx-usb-loader/Config.in b/package/imx-usb-loader/Config.in
new file mode 100644
index 0000000..41585e2
--- /dev/null
+++ b/package/imx-usb-loader/Config.in
@@ -0,0 +1,10 @@ 
+config BR2_PACKAGE_IMX_USB_LOADER
+	bool "imx-usb-loader"
+	depends on BR2_arm
+    select BR2_PACKAGE_LIBUSB
+	help
+	  This package contains tools to download and execute code
+	  on Freescale i.MX5/i.MX6 and Vybrid SoCs through the
+	  Serial Download Protocol.
+
+	  https://github.com/boundarydevices/imx_usb_loader
diff --git a/package/imx-usb-loader/imx-usb-loader.mk b/package/imx-usb-loader/imx-usb-loader.mk
index 946a1f3..22698dd 100644
--- a/package/imx-usb-loader/imx-usb-loader.mk
+++ b/package/imx-usb-loader/imx-usb-loader.mk
@@ -8,14 +8,22 @@  IMX_USB_LOADER_VERSION = 7e77787c83288a421080a9bf2f67063931f561be
 IMX_USB_LOADER_SITE = $(call github,boundarydevices,imx_usb_loader,$(IMX_USB_LOADER_VERSION))
 IMX_USB_LOADER_LICENSE = LGPL-2.1+
 IMX_USB_LOADER_LICENSE_FILES = COPYING
+IMX_USB_LOADER_DEPENDENCIES = libusb 
 HOST_IMX_USB_LOADER_DEPENDENCIES = host-libusb host-pkgconf
 
+define IMX_USB_LOADER_BUILD_CMDS
+	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)
+endef
 define HOST_IMX_USB_LOADER_BUILD_CMDS
 	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D)
 endef
 
+define IMX_USB_LOADER_INSTALL_TARGET_CMDS
+	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) prefix=$(TARGET_DIR) install
+endef
 define HOST_IMX_USB_LOADER_INSTALL_CMDS
 	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) prefix=$(HOST_DIR) install
 endef
 
+$(eval $(generic-package))
 $(eval $(host-generic-package))