All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 0/3] i.MX6 SABRESD improvements (using a Freescale kernel)
@ 2014-10-01 15:03 Luca Ceresoli
  2014-10-01 15:03 ` [Buildroot] [PATCH v2 1/3] freescale/imx6-sabresd: use global patch dir for U-Boot patches Luca Ceresoli
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Luca Ceresoli @ 2014-10-01 15:03 UTC (permalink / raw)
  To: buildroot

Hi,

here are 3 little improvements to the i.MX6 SABRESD board support in Buildroot,
both suggested by Thomas Petazzoni in [1].

This differs from the patchest I sent earlier [2] in the kernel origin:
keep using git.freescale.com instead of switching to a mainline kernel, as
per the discussion in [2].

Patches 1 and 2 are unchanged from v1.
They have been built and run on an i.MX6DL SABRESD board by me and on the
i.MX6Q variant by Vincent Stehl?, so I added his Tested-by tag.

Patch 3 is new in this series and adds a very handy tool to boot a board from
USB.

Luca Ceresoli (3):
  freescale/imx6-sabresd: use global patch dir for U-Boot patches
  freescale/imx6-sabresd: lock down kernel headers to the kernel version
  imx-usb-loader: new package

 ...ommon-boot-Linux-to-init-in-mfgtools-mode.patch | 36 ++++++++++++++++++++++
 ...ommon-boot-Linux-to-init-in-mfgtools-mode.patch | 36 ----------------------
 configs/freescale_imx6dlsabresd_defconfig          |  9 +++++-
 configs/freescale_imx6qsabresd_defconfig           |  9 +++++-
 package/Config.in.host                             |  1 +
 package/imx-usb-loader/Config.in.host              | 14 +++++++++
 package/imx-usb-loader/imx-usb-loader.mk           | 22 +++++++++++++
 7 files changed, 89 insertions(+), 38 deletions(-)
 create mode 100644 board/freescale/imx6sabresd/patches/uboot/uboot-0001-mx6qsabre_common-boot-Linux-to-init-in-mfgtools-mode.patch
 delete mode 100644 board/freescale/imx6sabresd/uboot-0001-mx6qsabre_common-boot-Linux-to-init-in-mfgtools-mode.patch
 create mode 100644 package/imx-usb-loader/Config.in.host
 create mode 100644 package/imx-usb-loader/imx-usb-loader.mk

[1] http://lists.busybox.net/pipermail/buildroot/2014-September/106704.html
[2] http://lists.busybox.net/pipermail/buildroot/2014-September/106972.html

-- 
1.9.1

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v2 1/3] freescale/imx6-sabresd: use global patch dir for U-Boot patches
  2014-10-01 15:03 [Buildroot] [PATCH v2 0/3] i.MX6 SABRESD improvements (using a Freescale kernel) Luca Ceresoli
@ 2014-10-01 15:03 ` Luca Ceresoli
  2014-10-01 15:03 ` [Buildroot] [PATCH v2 2/3] freescale/imx6-sabresd: lock down kernel headers to the kernel version Luca Ceresoli
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Luca Ceresoli @ 2014-10-01 15:03 UTC (permalink / raw)
  To: buildroot

The best practice is to use the BR2_GLOBAL_PATCH_DIR for patches against
U-Boot, not BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Tested-by: Vincent Stehl? <vincent.stehle@freescale.com>
Cc: Gilles Talis <gilles.talis@gmail.com>
Cc: Gary Bisson <bisson.gary@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 ...ot-0001-mx6qsabre_common-boot-Linux-to-init-in-mfgtools-mode.patch | 0
 configs/freescale_imx6dlsabresd_defconfig                             | 4 +++-
 configs/freescale_imx6qsabresd_defconfig                              | 4 +++-
 3 files changed, 6 insertions(+), 2 deletions(-)
 rename board/freescale/imx6sabresd/{ => patches/uboot}/uboot-0001-mx6qsabre_common-boot-Linux-to-init-in-mfgtools-mode.patch (100%)

diff --git a/board/freescale/imx6sabresd/uboot-0001-mx6qsabre_common-boot-Linux-to-init-in-mfgtools-mode.patch b/board/freescale/imx6sabresd/patches/uboot/uboot-0001-mx6qsabre_common-boot-Linux-to-init-in-mfgtools-mode.patch
similarity index 100%
rename from board/freescale/imx6sabresd/uboot-0001-mx6qsabre_common-boot-Linux-to-init-in-mfgtools-mode.patch
rename to board/freescale/imx6sabresd/patches/uboot/uboot-0001-mx6qsabre_common-boot-Linux-to-init-in-mfgtools-mode.patch
diff --git a/configs/freescale_imx6dlsabresd_defconfig b/configs/freescale_imx6dlsabresd_defconfig
index 62caf79..b8c4b22 100644
--- a/configs/freescale_imx6dlsabresd_defconfig
+++ b/configs/freescale_imx6dlsabresd_defconfig
@@ -2,6 +2,9 @@
 BR2_arm=y
 BR2_cortex_a9=y
 
+# patches
+BR2_GLOBAL_PATCH_DIR="board/freescale/imx6sabresd/patches"
+
 # system
 BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0"
 
@@ -25,4 +28,3 @@ BR2_TARGET_UBOOT_FORMAT_IMX=y
 BR2_TARGET_UBOOT_CUSTOM_GIT=y
 BR2_TARGET_UBOOT_CUSTOM_REPO_URL="git://git.freescale.com/imx/uboot-imx.git"
 BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="rel_imx_3.10.17_1.0.0_ga"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="board/freescale/imx6sabresd"
diff --git a/configs/freescale_imx6qsabresd_defconfig b/configs/freescale_imx6qsabresd_defconfig
index bc0aa46..40a9384 100644
--- a/configs/freescale_imx6qsabresd_defconfig
+++ b/configs/freescale_imx6qsabresd_defconfig
@@ -2,6 +2,9 @@
 BR2_arm=y
 BR2_cortex_a9=y
 
+# patches
+BR2_GLOBAL_PATCH_DIR="board/freescale/imx6sabresd/patches"
+
 # system
 BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0"
 
@@ -25,4 +28,3 @@ BR2_TARGET_UBOOT_FORMAT_IMX=y
 BR2_TARGET_UBOOT_CUSTOM_GIT=y
 BR2_TARGET_UBOOT_CUSTOM_REPO_URL="git://git.freescale.com/imx/uboot-imx.git"
 BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="rel_imx_3.10.17_1.0.0_ga"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="board/freescale/imx6sabresd"
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v2 2/3] freescale/imx6-sabresd: lock down kernel headers to the kernel version
  2014-10-01 15:03 [Buildroot] [PATCH v2 0/3] i.MX6 SABRESD improvements (using a Freescale kernel) Luca Ceresoli
  2014-10-01 15:03 ` [Buildroot] [PATCH v2 1/3] freescale/imx6-sabresd: use global patch dir for U-Boot patches Luca Ceresoli
@ 2014-10-01 15:03 ` Luca Ceresoli
  2014-10-01 15:03 ` [Buildroot] [PATCH v2 3/3] imx-usb-loader: new package Luca Ceresoli
  2014-10-01 17:37 ` [Buildroot] [PATCH v2 0/3] i.MX6 SABRESD improvements (using a Freescale kernel) Thomas Petazzoni
  3 siblings, 0 replies; 13+ messages in thread
From: Luca Ceresoli @ 2014-10-01 15:03 UTC (permalink / raw)
  To: buildroot

The current defconfigs for iMX6 SABRESD kernel 3.10.17 from the Freescale
git repository. This kernel is older than the toolchain kernel headers
used in Buildroot (currently 3.16.3).

Explicitly lock down the kernel headers to match the version of the kernel
that is built.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Tested-by: Vincent Stehl? <vincent.stehle@freescale.com>
Cc: Gilles Talis <gilles.talis@gmail.com>
Cc: Gary Bisson <bisson.gary@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 configs/freescale_imx6dlsabresd_defconfig | 5 +++++
 configs/freescale_imx6qsabresd_defconfig  | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/configs/freescale_imx6dlsabresd_defconfig b/configs/freescale_imx6dlsabresd_defconfig
index b8c4b22..680031d 100644
--- a/configs/freescale_imx6dlsabresd_defconfig
+++ b/configs/freescale_imx6dlsabresd_defconfig
@@ -5,6 +5,11 @@ BR2_cortex_a9=y
 # patches
 BR2_GLOBAL_PATCH_DIR="board/freescale/imx6sabresd/patches"
 
+# toolchain
+BR2_KERNEL_HEADERS_VERSION=y
+BR2_DEFAULT_KERNEL_VERSION="3.10.17"
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_10=y
+
 # system
 BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0"
 
diff --git a/configs/freescale_imx6qsabresd_defconfig b/configs/freescale_imx6qsabresd_defconfig
index 40a9384..f2f702e 100644
--- a/configs/freescale_imx6qsabresd_defconfig
+++ b/configs/freescale_imx6qsabresd_defconfig
@@ -5,6 +5,11 @@ BR2_cortex_a9=y
 # patches
 BR2_GLOBAL_PATCH_DIR="board/freescale/imx6sabresd/patches"
 
+# toolchain
+BR2_KERNEL_HEADERS_VERSION=y
+BR2_DEFAULT_KERNEL_VERSION="3.10.17"
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_10=y
+
 # system
 BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0"
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v2 3/3] imx-usb-loader: new package
  2014-10-01 15:03 [Buildroot] [PATCH v2 0/3] i.MX6 SABRESD improvements (using a Freescale kernel) Luca Ceresoli
  2014-10-01 15:03 ` [Buildroot] [PATCH v2 1/3] freescale/imx6-sabresd: use global patch dir for U-Boot patches Luca Ceresoli
  2014-10-01 15:03 ` [Buildroot] [PATCH v2 2/3] freescale/imx6-sabresd: lock down kernel headers to the kernel version Luca Ceresoli
@ 2014-10-01 15:03 ` Luca Ceresoli
  2014-10-01 16:16   ` Thomas Petazzoni
  2014-10-02  9:13   ` Vincent Stehlé
  2014-10-01 17:37 ` [Buildroot] [PATCH v2 0/3] i.MX6 SABRESD improvements (using a Freescale kernel) Thomas Petazzoni
  3 siblings, 2 replies; 13+ messages in thread
From: Luca Ceresoli @ 2014-10-01 15:03 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 package/Config.in.host                   |  1 +
 package/imx-usb-loader/Config.in.host    | 14 ++++++++++++++
 package/imx-usb-loader/imx-usb-loader.mk | 22 ++++++++++++++++++++++
 3 files changed, 37 insertions(+)
 create mode 100644 package/imx-usb-loader/Config.in.host
 create mode 100644 package/imx-usb-loader/imx-usb-loader.mk

diff --git a/package/Config.in.host b/package/Config.in.host
index 2c88c0b..dce209f 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -8,6 +8,7 @@ menu "Host utilities"
 	source "package/genext2fs/Config.in.host"
 	source "package/genimage/Config.in.host"
 	source "package/genpart/Config.in.host"
+	source "package/imx-usb-loader/Config.in.host"
 	source "package/lpc3250loader/Config.in.host"
 	source "package/mtd/Config.in.host"
 	source "package/mtools/Config.in.host"
diff --git a/package/imx-usb-loader/Config.in.host b/package/imx-usb-loader/Config.in.host
new file mode 100644
index 0000000..2540ea9
--- /dev/null
+++ b/package/imx-usb-loader/Config.in.host
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_HOST_IMX_USB_LOADER
+	bool "host imx-usb-loader"
+	depends on BR2_arm || BR2_armeb
+	select BR2_PACKAGE_LIBUSB # libusb >= 1.0 is required
+	help
+	  This utility allows to download and execute code on Freescale
+	  i.MX5/i.MX6 and Vybrid SoCs through the Serial Download Protocol
+	  (SDP). Depending on the board, there is usually some kind of recovery
+	  button to bring the SoC into serial download boot mode, check
+	  documentation of your hardware.
+
+	  The utility support USB and UART as serial link.
+
+	  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
new file mode 100644
index 0000000..48ef35c
--- /dev/null
+++ b/package/imx-usb-loader/imx-usb-loader.mk
@@ -0,0 +1,22 @@
+################################################################################
+#
+# imx-uxb-loader
+#
+################################################################################
+
+IMX_USB_LOADER_VERSION = f96aee286ea17c832b7ec922dd76842deb5ce299
+IMX_USB_LOADER_SITE = $(call github,boundarydevices,imx_usb_loader,$(IMX_USB_LOADER_VERSION))
+IMX_USB_LOADER_LICENSE = LGPLv2.1+, LGPL (getopt.*)
+IMX_USB_LOADER_LICENSE_FILES = COPYING
+IMX_USB_LOADER_DEPENDENCIES = host-libusb
+
+define HOST_IMX_USB_LOADER_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D)
+endef
+
+define HOST_IMX_USB_LOADER_INSTALL_CMDS
+    $(INSTALL) -D -m 0755 $(@D)/imx_usb $(HOST_DIR)/usr/bin
+    $(INSTALL) -D -m 0755 $(@D)/imx_uart $(HOST_DIR)/usr/bin
+endef
+
+$(eval $(host-generic-package))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v2 3/3] imx-usb-loader: new package
  2014-10-01 15:03 ` [Buildroot] [PATCH v2 3/3] imx-usb-loader: new package Luca Ceresoli
@ 2014-10-01 16:16   ` Thomas Petazzoni
  2014-10-01 16:55     ` Eric Nelson
  2014-10-02  8:47     ` Luca Ceresoli
  2014-10-02  9:13   ` Vincent Stehlé
  1 sibling, 2 replies; 13+ messages in thread
From: Thomas Petazzoni @ 2014-10-01 16:16 UTC (permalink / raw)
  To: buildroot

Dear Luca Ceresoli,

On Wed,  1 Oct 2014 17:03:46 +0200, Luca Ceresoli wrote:

> diff --git a/package/imx-usb-loader/Config.in.host b/package/imx-usb-loader/Config.in.host
> new file mode 100644
> index 0000000..2540ea9
> --- /dev/null
> +++ b/package/imx-usb-loader/Config.in.host
> @@ -0,0 +1,14 @@
> +config BR2_PACKAGE_HOST_IMX_USB_LOADER
> +	bool "host imx-usb-loader"
> +	depends on BR2_arm || BR2_armeb
> +	select BR2_PACKAGE_LIBUSB # libusb >= 1.0 is required

Huh, no! BR2_PACKAGE_LIBUSB is the *target* libusb. If you depend on
host-libusb, you don't need to add any select here.

> diff --git a/package/imx-usb-loader/imx-usb-loader.mk b/package/imx-usb-loader/imx-usb-loader.mk
> new file mode 100644
> index 0000000..48ef35c
> --- /dev/null
> +++ b/package/imx-usb-loader/imx-usb-loader.mk
> @@ -0,0 +1,22 @@
> +################################################################################
> +#
> +# imx-uxb-loader
> +#
> +################################################################################
> +
> +IMX_USB_LOADER_VERSION = f96aee286ea17c832b7ec922dd76842deb5ce299
> +IMX_USB_LOADER_SITE = $(call github,boundarydevices,imx_usb_loader,$(IMX_USB_LOADER_VERSION))
> +IMX_USB_LOADER_LICENSE = LGPLv2.1+, LGPL (getopt.*)

LGPL with no version specified?

> +IMX_USB_LOADER_LICENSE_FILES = COPYING
> +IMX_USB_LOADER_DEPENDENCIES = host-libusb
> +
> +define HOST_IMX_USB_LOADER_BUILD_CMDS
> +	$(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D)
> +endef
> +
> +define HOST_IMX_USB_LOADER_INSTALL_CMDS
> +    $(INSTALL) -D -m 0755 $(@D)/imx_usb $(HOST_DIR)/usr/bin
> +    $(INSTALL) -D -m 0755 $(@D)/imx_uart $(HOST_DIR)/usr/bin

Full path as the last argument.

Also: what about having this package enabled by default in the sabresd
defconfigs, if it makes sense to have this host tool enabled for those
configurations?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v2 3/3] imx-usb-loader: new package
  2014-10-01 16:16   ` Thomas Petazzoni
@ 2014-10-01 16:55     ` Eric Nelson
  2014-10-02  8:47     ` Luca Ceresoli
  1 sibling, 0 replies; 13+ messages in thread
From: Eric Nelson @ 2014-10-01 16:55 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On 10/01/2014 09:16 AM, Thomas Petazzoni wrote:
> Dear Luca Ceresoli,
> 
> On Wed,  1 Oct 2014 17:03:46 +0200, Luca Ceresoli wrote:
> 
> <snip>
>
>> +IMX_USB_LOADER_LICENSE_FILES = COPYING
>> +IMX_USB_LOADER_DEPENDENCIES = host-libusb
>> +
>> +define HOST_IMX_USB_LOADER_BUILD_CMDS
>> +	$(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D)
>> +endef
>> +
>> +define HOST_IMX_USB_LOADER_INSTALL_CMDS
>> +    $(INSTALL) -D -m 0755 $(@D)/imx_usb $(HOST_DIR)/usr/bin
>> +    $(INSTALL) -D -m 0755 $(@D)/imx_uart $(HOST_DIR)/usr/bin
> 
> Full path as the last argument.
> 
> Also: what about having this package enabled by default in the sabresd
> defconfigs, if it makes sense to have this host tool enabled for those
> configurations?
> 

Or all i.MX devices. This is known to work with i.MX5x and i.MX6x
boards, and I think I saw some comments from Vybrid users.

That said, it's a bit of an arcane tool that's useful when doing
U-Boot development or unbricking a board.

Regards,


Eric

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v2 0/3] i.MX6 SABRESD improvements (using a Freescale kernel)
  2014-10-01 15:03 [Buildroot] [PATCH v2 0/3] i.MX6 SABRESD improvements (using a Freescale kernel) Luca Ceresoli
                   ` (2 preceding siblings ...)
  2014-10-01 15:03 ` [Buildroot] [PATCH v2 3/3] imx-usb-loader: new package Luca Ceresoli
@ 2014-10-01 17:37 ` Thomas Petazzoni
  3 siblings, 0 replies; 13+ messages in thread
From: Thomas Petazzoni @ 2014-10-01 17:37 UTC (permalink / raw)
  To: buildroot

Dear Luca Ceresoli,

On Wed,  1 Oct 2014 17:03:43 +0200, Luca Ceresoli wrote:

> Luca Ceresoli (3):
>   freescale/imx6-sabresd: use global patch dir for U-Boot patches
>   freescale/imx6-sabresd: lock down kernel headers to the kernel version

Both applied.

>   imx-usb-loader: new package

There are still comments on this one.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v2 3/3] imx-usb-loader: new package
  2014-10-01 16:16   ` Thomas Petazzoni
  2014-10-01 16:55     ` Eric Nelson
@ 2014-10-02  8:47     ` Luca Ceresoli
  2014-10-02  9:17       ` Luca Ceresoli
  2014-10-02  9:52       ` Thomas Petazzoni
  1 sibling, 2 replies; 13+ messages in thread
From: Luca Ceresoli @ 2014-10-02  8:47 UTC (permalink / raw)
  To: buildroot

Dear Thomas,

Thomas Petazzoni wrote:
> Dear Luca Ceresoli,
>
> On Wed,  1 Oct 2014 17:03:46 +0200, Luca Ceresoli wrote:
>
>> diff --git a/package/imx-usb-loader/Config.in.host b/package/imx-usb-loader/Config.in.host
>> new file mode 100644
>> index 0000000..2540ea9
>> --- /dev/null
>> +++ b/package/imx-usb-loader/Config.in.host
>> @@ -0,0 +1,14 @@
>> +config BR2_PACKAGE_HOST_IMX_USB_LOADER
>> +	bool "host imx-usb-loader"
>> +	depends on BR2_arm || BR2_armeb
>> +	select BR2_PACKAGE_LIBUSB # libusb >= 1.0 is required
>
> Huh, no! BR2_PACKAGE_LIBUSB is the *target* libusb. If you depend on
> host-libusb, you don't need to add any select here.

Ops! Will fix!

>
>> diff --git a/package/imx-usb-loader/imx-usb-loader.mk b/package/imx-usb-loader/imx-usb-loader.mk
>> new file mode 100644
>> index 0000000..48ef35c
>> --- /dev/null
>> +++ b/package/imx-usb-loader/imx-usb-loader.mk
>> @@ -0,0 +1,22 @@
>> +################################################################################
>> +#
>> +# imx-uxb-loader
>> +#
>> +################################################################################
>> +
>> +IMX_USB_LOADER_VERSION = f96aee286ea17c832b7ec922dd76842deb5ce299
>> +IMX_USB_LOADER_SITE = $(call github,boundarydevices,imx_usb_loader,$(IMX_USB_LOADER_VERSION))
>> +IMX_USB_LOADER_LICENSE = LGPLv2.1+, LGPL (getopt.*)
>
> LGPL with no version specified?
>

Yes. The only indication in getopt.[hc] is:

   License: LGPL

and nothing else. This means LGPL (ant version), it is the list of
licenses documented on the BR manual.

BTW, the LGPL license is declared in BR for pppd and tslib as well.

>> +IMX_USB_LOADER_LICENSE_FILES = COPYING
>> +IMX_USB_LOADER_DEPENDENCIES = host-libusb
>> +
>> +define HOST_IMX_USB_LOADER_BUILD_CMDS
>> +	$(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D)
>> +endef
>> +
>> +define HOST_IMX_USB_LOADER_INSTALL_CMDS
>> +    $(INSTALL) -D -m 0755 $(@D)/imx_usb $(HOST_DIR)/usr/bin
>> +    $(INSTALL) -D -m 0755 $(@D)/imx_uart $(HOST_DIR)/usr/bin
>
> Full path as the last argument.

Will fix.

>
> Also: what about having this package enabled by default in the sabresd
> defconfigs, if it makes sense to have this host tool enabled for those
> configurations?

My plan is slightly more ambitious indeed. What I have in mind is to:
  1. enable imx-usb-loader for both SABRESD boards;
  2. prepare the configuration files that imx_usb_loader needs to boot
     the device;
  3. document how to boot using imx_usb_loader + the config files.

Step 1 is trivial.

For step 2 I'll have generate two files: imx_usb.conf (the top-level
config file for imx_usb) and mx6_usb_work.conf (different for the two
SoC variants). The former can be taken as is from the imx_usb_loader
sources, the latter must be edited as described in Vincent's tutorial
[1], at section "Prepare your payload and configuration".

I think the best way is to use a post-image script to create these
files in output/images, except they are not images. Does this sound
fine?

If step 2 is well done, the actions to boot the device would be as
simple as:

   ./output/host/usr/bin/imx_usb -c output/images

Then step 3 would be trivial as well.

[1] https://community.freescale.com/docs/DOC-101842
-- 
Luca

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v2 3/3] imx-usb-loader: new package
  2014-10-01 15:03 ` [Buildroot] [PATCH v2 3/3] imx-usb-loader: new package Luca Ceresoli
  2014-10-01 16:16   ` Thomas Petazzoni
@ 2014-10-02  9:13   ` Vincent Stehlé
  2014-10-02 11:43     ` Luca Ceresoli
  1 sibling, 1 reply; 13+ messages in thread
From: Vincent Stehlé @ 2014-10-02  9:13 UTC (permalink / raw)
  To: buildroot

On 10/01/2014 05:03 PM, Luca Ceresoli wrote:
(snip)

Hi Luca,

Thank you for this imx_usb_loader "recipe".

I have just some small remarks for the configuration files (below), but
apart from that I could build the loader ok with 'make
host-imx-usb-loader', and boot through USB just fine. So thanks!

(..)
> diff --git a/package/imx-usb-loader/imx-usb-loader.mk b/package/imx-usb-loader/imx-usb-loader.mk
> new file mode 100644
> index 0000000..48ef35c
> --- /dev/null
> +++ b/package/imx-usb-loader/imx-usb-loader.mk
> @@ -0,0 +1,22 @@
> +################################################################################
> +#
> +# imx-uxb-loader
> +#
> +################################################################################
> +
> +IMX_USB_LOADER_VERSION = f96aee286ea17c832b7ec922dd76842deb5ce299
> +IMX_USB_LOADER_SITE = $(call github,boundarydevices,imx_usb_loader,$(IMX_USB_LOADER_VERSION))
> +IMX_USB_LOADER_LICENSE = LGPLv2.1+, LGPL (getopt.*)
> +IMX_USB_LOADER_LICENSE_FILES = COPYING
> +IMX_USB_LOADER_DEPENDENCIES = host-libusb
> +
> +define HOST_IMX_USB_LOADER_BUILD_CMDS
> +	$(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D)
> +endef
> +
> +define HOST_IMX_USB_LOADER_INSTALL_CMDS
> +    $(INSTALL) -D -m 0755 $(@D)/imx_usb $(HOST_DIR)/usr/bin
> +    $(INSTALL) -D -m 0755 $(@D)/imx_uart $(HOST_DIR)/usr/bin

Wouldn't you want to install the supplied configurations files, too?
Like in:

  $(INSTALL) -D -m 0644 $(@D)/imx_usb.conf $(HOST_DIR)/etc/imx_usb.conf
  $(INSTALL) -D -m 0644 $(@D)/mx6_usb_work.conf
$(HOST_DIR)/etc/mx6_usb_work.conf

I feel they could be used as examples or, at least, starting points.

Maybe you want to patch a bit imx_usb, to change the default
configuration files path? It defaults to '/etc/imx-loader.d/' but I
think we could have something better in the buildroot case, like
"$(HOST_DIR)/etc".

> +endef
> +
> +$(eval $(host-generic-package))

Best regards,

V.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v2 3/3] imx-usb-loader: new package
  2014-10-02  8:47     ` Luca Ceresoli
@ 2014-10-02  9:17       ` Luca Ceresoli
  2014-10-02  9:52       ` Thomas Petazzoni
  1 sibling, 0 replies; 13+ messages in thread
From: Luca Ceresoli @ 2014-10-02  9:17 UTC (permalink / raw)
  To: buildroot

Hi,

Luca Ceresoli wrote:
> Dear Thomas,
>
> Thomas Petazzoni wrote:
>> Dear Luca Ceresoli,
>>
>> On Wed,  1 Oct 2014 17:03:46 +0200, Luca Ceresoli wrote:
...
>>> --- /dev/null
>>> +++ b/package/imx-usb-loader/imx-usb-loader.mk
>>> @@ -0,0 +1,22 @@
>>> +################################################################################
>>>
>>> +#
>>> +# imx-uxb-loader
>>> +#
>>> +################################################################################
>>>
>>> +
>>> +IMX_USB_LOADER_VERSION = f96aee286ea17c832b7ec922dd76842deb5ce299
>>> +IMX_USB_LOADER_SITE = $(call
>>> github,boundarydevices,imx_usb_loader,$(IMX_USB_LOADER_VERSION))
>>> +IMX_USB_LOADER_LICENSE = LGPLv2.1+, LGPL (getopt.*)
>>
>> LGPL with no version specified?
>>
>
> Yes. The only indication in getopt.[hc] is:
>
>    License: LGPL
>
> and nothing else. This means LGPL (ant version), it is the list of
> licenses documented on the BR manual.
>
> BTW, the LGPL license is declared in BR for pppd and tslib as well.

Looking at it a bit closer, getopt.* is not used to build on Linux,
only for Windows.

So I guess I could drop the LGPL part:

   IMX_USB_LOADER_LICENSE = LGPLv2.1+

-- 
Luca

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v2 3/3] imx-usb-loader: new package
  2014-10-02  8:47     ` Luca Ceresoli
  2014-10-02  9:17       ` Luca Ceresoli
@ 2014-10-02  9:52       ` Thomas Petazzoni
  2014-10-02 11:10         ` Luca Ceresoli
  1 sibling, 1 reply; 13+ messages in thread
From: Thomas Petazzoni @ 2014-10-02  9:52 UTC (permalink / raw)
  To: buildroot

Dear Luca Ceresoli,

On Thu, 02 Oct 2014 10:47:44 +0200, Luca Ceresoli wrote:

> Yes. The only indication in getopt.[hc] is:
> 
>    License: LGPL
> 
> and nothing else. This means LGPL (ant version), it is the list of
> licenses documented on the BR manual.
> 
> BTW, the LGPL license is declared in BR for pppd and tslib as well.

Ok.

> > Also: what about having this package enabled by default in the sabresd
> > defconfigs, if it makes sense to have this host tool enabled for those
> > configurations?
> 
> My plan is slightly more ambitious indeed. What I have in mind is to:
>   1. enable imx-usb-loader for both SABRESD boards;
>   2. prepare the configuration files that imx_usb_loader needs to boot
>      the device;
>   3. document how to boot using imx_usb_loader + the config files.

Sounds like a good plan.

> 
> Step 1 is trivial.
> 
> For step 2 I'll have generate two files: imx_usb.conf (the top-level
> config file for imx_usb) and mx6_usb_work.conf (different for the two
> SoC variants). The former can be taken as is from the imx_usb_loader
> sources, the latter must be edited as described in Vincent's tutorial
> [1], at section "Prepare your payload and configuration".
> 
> I think the best way is to use a post-image script to create these
> files in output/images, except they are not images. Does this sound
> fine?

Yes, it sounds fine. From my point of view output/images is not
necessarily strictly limited to binary images. It can also contain
other files that are useful to run/flash the system on the target.

Though do you really need to generate those files? They look like
pretty much static configuration files, that could be put in
board/freescale/<foo>/, no?

> If step 2 is well done, the actions to boot the device would be as
> simple as:
> 
>    ./output/host/usr/bin/imx_usb -c output/images

Cool!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v2 3/3] imx-usb-loader: new package
  2014-10-02  9:52       ` Thomas Petazzoni
@ 2014-10-02 11:10         ` Luca Ceresoli
  0 siblings, 0 replies; 13+ messages in thread
From: Luca Ceresoli @ 2014-10-02 11:10 UTC (permalink / raw)
  To: buildroot

Dear Thomas,

Thomas Petazzoni wrote:
> Dear Luca Ceresoli,
>
> On Thu, 02 Oct 2014 10:47:44 +0200, Luca Ceresoli wrote:
>
...
>>> Also: what about having this package enabled by default in the sabresd
>>> defconfigs, if it makes sense to have this host tool enabled for those
>>> configurations?
>>
>> My plan is slightly more ambitious indeed. What I have in mind is to:
>>    1. enable imx-usb-loader for both SABRESD boards;
>>    2. prepare the configuration files that imx_usb_loader needs to boot
>>       the device;
>>    3. document how to boot using imx_usb_loader + the config files.
>
> Sounds like a good plan.
>
>>
>> Step 1 is trivial.
>>
>> For step 2 I'll have generate two files: imx_usb.conf (the top-level
>> config file for imx_usb) and mx6_usb_work.conf (different for the two
>> SoC variants). The former can be taken as is from the imx_usb_loader
>> sources, the latter must be edited as described in Vincent's tutorial
>> [1], at section "Prepare your payload and configuration".
>>
>> I think the best way is to use a post-image script to create these
>> files in output/images, except they are not images. Does this sound
>> fine?
>
> Yes, it sounds fine. From my point of view output/images is not
> necessarily strictly limited to binary images. It can also contain
> other files that are useful to run/flash the system on the target.
>
> Though do you really need to generate those files? They look like
> pretty much static configuration files, that could be put in
> board/freescale/<foo>/, no?

Probably.

I didn't want to create a lot of almost-equal files: the only
difference between the two boards is the .dtb to use. Hence I thought
of a script producing the config file from a template file.

But since there would be only 2 files for now it may be fine as well to
just have the two files.

I'll choose as soon as I start coding.

-- 
Luca

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v2 3/3] imx-usb-loader: new package
  2014-10-02  9:13   ` Vincent Stehlé
@ 2014-10-02 11:43     ` Luca Ceresoli
  0 siblings, 0 replies; 13+ messages in thread
From: Luca Ceresoli @ 2014-10-02 11:43 UTC (permalink / raw)
  To: buildroot

Dear Vincent,

Vincent Stehl? wrote:
> On 10/01/2014 05:03 PM, Luca Ceresoli wrote:
> (snip)
>
> Hi Luca,
>
> Thank you for this imx_usb_loader "recipe".
>
> I have just some small remarks for the configuration files (below), but
> apart from that I could build the loader ok with 'make
> host-imx-usb-loader', and boot through USB just fine. So thanks!

Thanks for keeping my patches tested!

>
> (..)
>> diff --git a/package/imx-usb-loader/imx-usb-loader.mk b/package/imx-usb-loader/imx-usb-loader.mk
>> new file mode 100644
>> index 0000000..48ef35c
>> --- /dev/null
>> +++ b/package/imx-usb-loader/imx-usb-loader.mk
>> @@ -0,0 +1,22 @@
>> +################################################################################
>> +#
>> +# imx-uxb-loader
>> +#
>> +################################################################################
>> +
>> +IMX_USB_LOADER_VERSION = f96aee286ea17c832b7ec922dd76842deb5ce299
>> +IMX_USB_LOADER_SITE = $(call github,boundarydevices,imx_usb_loader,$(IMX_USB_LOADER_VERSION))
>> +IMX_USB_LOADER_LICENSE = LGPLv2.1+, LGPL (getopt.*)
>> +IMX_USB_LOADER_LICENSE_FILES = COPYING
>> +IMX_USB_LOADER_DEPENDENCIES = host-libusb
>> +
>> +define HOST_IMX_USB_LOADER_BUILD_CMDS
>> +	$(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D)
>> +endef
>> +
>> +define HOST_IMX_USB_LOADER_INSTALL_CMDS
>> +    $(INSTALL) -D -m 0755 $(@D)/imx_usb $(HOST_DIR)/usr/bin
>> +    $(INSTALL) -D -m 0755 $(@D)/imx_uart $(HOST_DIR)/usr/bin
>
> Wouldn't you want to install the supplied configurations files, too?
> Like in:
>
>    $(INSTALL) -D -m 0644 $(@D)/imx_usb.conf $(HOST_DIR)/etc/imx_usb.conf
>    $(INSTALL) -D -m 0644 $(@D)/mx6_usb_work.conf
> $(HOST_DIR)/etc/mx6_usb_work.conf
>
> I feel they could be used as examples or, at least, starting points.
>
> Maybe you want to patch a bit imx_usb, to change the default
> configuration files path? It defaults to '/etc/imx-loader.d/' but I
> think we could have something better in the buildroot case, like
> "$(HOST_DIR)/etc".

This means I would need to patch the imx_usb.c source code, and do it in
a way that is not relocatable.

Actually I have another plan [1]: creating a ready-to-use config file
and document how to use it, without touching how imx_usb works now.
Unless I'm missing something from your e-mail, I find my way cleaner
and more complete.

Users who want to use this tool in a different way can still find the
original files in output/build/imx-usb-loader-*/ of course.

[1] http://lists.busybox.net/pipermail/buildroot/2014-October/107492.html

-- 
Luca

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-10-02 11:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-01 15:03 [Buildroot] [PATCH v2 0/3] i.MX6 SABRESD improvements (using a Freescale kernel) Luca Ceresoli
2014-10-01 15:03 ` [Buildroot] [PATCH v2 1/3] freescale/imx6-sabresd: use global patch dir for U-Boot patches Luca Ceresoli
2014-10-01 15:03 ` [Buildroot] [PATCH v2 2/3] freescale/imx6-sabresd: lock down kernel headers to the kernel version Luca Ceresoli
2014-10-01 15:03 ` [Buildroot] [PATCH v2 3/3] imx-usb-loader: new package Luca Ceresoli
2014-10-01 16:16   ` Thomas Petazzoni
2014-10-01 16:55     ` Eric Nelson
2014-10-02  8:47     ` Luca Ceresoli
2014-10-02  9:17       ` Luca Ceresoli
2014-10-02  9:52       ` Thomas Petazzoni
2014-10-02 11:10         ` Luca Ceresoli
2014-10-02  9:13   ` Vincent Stehlé
2014-10-02 11:43     ` Luca Ceresoli
2014-10-01 17:37 ` [Buildroot] [PATCH v2 0/3] i.MX6 SABRESD improvements (using a Freescale kernel) Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.