All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] linux: install firmware to staging.
@ 2013-07-07 23:31 Spenser Gilliland
  2013-07-07 23:31 ` [Buildroot] [PATCH 2/2] beagle-capes: new package Spenser Gilliland
  2013-07-08 17:52 ` [Buildroot] [PATCH 1/2] linux: install firmware to staging Yann E. MORIN
  0 siblings, 2 replies; 14+ messages in thread
From: Spenser Gilliland @ 2013-07-07 23:31 UTC (permalink / raw)
  To: buildroot

Install firmware to staging when the hidden option
BR2_LINUX_KERNEL_INSTALL_FIRMWARE is selected.  This allows parts of the
firmware provided by the linux kernel to be installed in the target.

Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
---
 linux/Config.in |  5 +++++
 linux/linux.mk  | 13 +++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/linux/Config.in b/linux/Config.in
index f58e714..b733019 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -297,6 +297,11 @@ config BR2_LINUX_KERNEL_INSTALL_TARGET
 	  /boot in the target root filesystem, as is typically done on
 	  x86/x86_64 systems.
 
+# This option is used to install firmware to staging. Other packages such as
+# beagle-capes then install the firmware into the target. This avoids
+# installing all linux firmware.
+config BR2_LINUX_KERNEL_INSTALL_FIRMWARE
+	bool
 
 # Linux extensions
 source "linux/Config.ext.in"
diff --git a/linux/linux.mk b/linux/linux.mk
index befef16..88c954d 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -256,6 +256,15 @@ define LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET
 endef
 endif
 
+ifeq ($(BR2_LINUX_KERNEL_INSTALL_FIRMWARE),y)
+
+LINUX_INSTALL_STAGING = YES
+
+define LINUX_INSTALL_FIRMWARE_TO_STAGING
+	$(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) firmware_install \
+		INSTALL_FW_PATH=$(STAGING_DIR)/lib/firmware/
+endef
+endif
 
 define LINUX_INSTALL_HOST_TOOLS
 	# Installing dtc (device tree compiler) as host tool, if selected
@@ -269,6 +278,10 @@ define LINUX_INSTALL_IMAGES_CMDS
 	cp $(LINUX_IMAGE_PATH) $(BINARIES_DIR)
 endef
 
+define LINUX_INSTALL_STAGING_CMDS
+	$(LINUX_INSTALL_FIRMWARE_TO_STAGING)
+endef
+
 define LINUX_INSTALL_TARGET_CMDS
 	$(LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET)
 	$(LINUX_INSTALL_DTB)
-- 
1.8.1.2

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

* [Buildroot] [PATCH 2/2] beagle-capes: new package
  2013-07-07 23:31 [Buildroot] [PATCH 1/2] linux: install firmware to staging Spenser Gilliland
@ 2013-07-07 23:31 ` Spenser Gilliland
  2013-07-08  0:43   ` Frank Hunleth
                     ` (2 more replies)
  2013-07-08 17:52 ` [Buildroot] [PATCH 1/2] linux: install firmware to staging Yann E. MORIN
  1 sibling, 3 replies; 14+ messages in thread
From: Spenser Gilliland @ 2013-07-07 23:31 UTC (permalink / raw)
  To: buildroot

installs cape dtbos from the kernel firmware into the target system.

Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
---
 package/Config.in                    |  1 +
 package/beagle-capes/Config.in       | 12 ++++++++++++
 package/beagle-capes/beagle-capes.mk | 15 +++++++++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 package/beagle-capes/Config.in
 create mode 100644 package/beagle-capes/beagle-capes.mk

diff --git a/package/Config.in b/package/Config.in
index 4df48ba..3b06f98 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -226,6 +226,7 @@ source "package/rpi-firmware/Config.in"
 source "package/sunxi-boards/Config.in"
 source "package/ux500-firmware/Config.in"
 source "package/zd1211-firmware/Config.in"
+source "package/beagle-capes/Config.in"
 endmenu
 source "package/freescale-imx/Config.in"
 source "package/acpid/Config.in"
diff --git a/package/beagle-capes/Config.in b/package/beagle-capes/Config.in
new file mode 100644
index 0000000..568e84f
--- /dev/null
+++ b/package/beagle-capes/Config.in
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_BEAGLE_CAPES
+	bool "beagle-capes"
+	depends on BR2_LINUX_KERNEL && BR2_arm
+	select BR2_LINUX_KERNEL_INSTALL_FIRMWARE
+	help
+	  Installs beaglebone capes firmware from the kernel source.
+
+	  This package requires that a kernel with beaglebone capes firmware is
+	  selected.
+
+comment "requires the linux kernel"
+	depends on !(BR2_LINUX_KERNEL)
diff --git a/package/beagle-capes/beagle-capes.mk b/package/beagle-capes/beagle-capes.mk
new file mode 100644
index 0000000..5b6f121
--- /dev/null
+++ b/package/beagle-capes/beagle-capes.mk
@@ -0,0 +1,15 @@
+################################################################################
+#
+# beagle-capes 
+#
+################################################################################
+
+BEAGLE_CAPES_SOURCE =
+
+BEAGLE_CAPES_DEPENDENCIES = linux
+
+define BEAGLE_CAPES_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 644 $(STAGING_DIR)/lib/firmware/*.dtbo $(TARGET_DIR)/lib/firmware/
+endef
+
+$(eval $(generic-package))
-- 
1.8.1.2

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

* [Buildroot] [PATCH 2/2] beagle-capes: new package
  2013-07-07 23:31 ` [Buildroot] [PATCH 2/2] beagle-capes: new package Spenser Gilliland
@ 2013-07-08  0:43   ` Frank Hunleth
  2013-07-08  3:08     ` Spenser Gilliland
  2013-07-08 17:47   ` Yann E. MORIN
  2013-10-27 11:22   ` Arnout Vandecappelle
  2 siblings, 1 reply; 14+ messages in thread
From: Frank Hunleth @ 2013-07-08  0:43 UTC (permalink / raw)
  To: buildroot

Hi Spenser,

On Sun, Jul 7, 2013 at 7:31 PM, Spenser Gilliland
<spenser@gillilanding.com> wrote:
> installs cape dtbos from the kernel firmware into the target system.
>

Slightly off topic, but did you run into any issues with the eMMC
virtual cape when you did this? The cape manager requests the eMMC
cape dtbo before the root file system is mounted. When mdev was
finally run from the init scripts, it didn't satisfy that request (I
quickly looked through the mdev source, and I didn't see any code to
do this. mdev seems to only handle "hotplug" firmware requests). If I
manually loaded the eMMC virtual cape dtbo file before the timeout, I
could get things to work. I ended up compiling the dtbos into the
kernel, but if your br configuration doesn't need to do this, then
could you share?

Also, and this is just to understand things better, but if you don't
want a firmware file copied to the target, wouldn't you just turn it
off in the kernel's configuration?

Or were you motivated by the shear volume of dtbo files that you get
when you turn on Beaglebone cape support? I was thinking that I wanted
finer grain configuration in the Linux kernel so that I could select
whether or not I wanted "cape-bone-exptest.dtbo" or
"cape-bone-adafruit-lcd", etc., but I don't think that's a br problem.
Prior to the Beaglebone capes, I had not seen so many firmware files
that I didn't need.

Thanks,
Frank

p.s. thanks for the opengl work. I have a project coming up in the
fall that will need it, so your commits are very timely.

> Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
> ---
>  package/Config.in                    |  1 +
>  package/beagle-capes/Config.in       | 12 ++++++++++++
>  package/beagle-capes/beagle-capes.mk | 15 +++++++++++++++
>  3 files changed, 28 insertions(+)
>  create mode 100644 package/beagle-capes/Config.in
>  create mode 100644 package/beagle-capes/beagle-capes.mk
>
> diff --git a/package/Config.in b/package/Config.in
> index 4df48ba..3b06f98 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -226,6 +226,7 @@ source "package/rpi-firmware/Config.in"
>  source "package/sunxi-boards/Config.in"
>  source "package/ux500-firmware/Config.in"
>  source "package/zd1211-firmware/Config.in"
> +source "package/beagle-capes/Config.in"
>  endmenu
>  source "package/freescale-imx/Config.in"
>  source "package/acpid/Config.in"
> diff --git a/package/beagle-capes/Config.in b/package/beagle-capes/Config.in
> new file mode 100644
> index 0000000..568e84f
> --- /dev/null
> +++ b/package/beagle-capes/Config.in
> @@ -0,0 +1,12 @@
> +config BR2_PACKAGE_BEAGLE_CAPES
> +       bool "beagle-capes"
> +       depends on BR2_LINUX_KERNEL && BR2_arm
> +       select BR2_LINUX_KERNEL_INSTALL_FIRMWARE
> +       help
> +         Installs beaglebone capes firmware from the kernel source.
> +
> +         This package requires that a kernel with beaglebone capes firmware is
> +         selected.
> +
> +comment "requires the linux kernel"
> +       depends on !(BR2_LINUX_KERNEL)
> diff --git a/package/beagle-capes/beagle-capes.mk b/package/beagle-capes/beagle-capes.mk
> new file mode 100644
> index 0000000..5b6f121
> --- /dev/null
> +++ b/package/beagle-capes/beagle-capes.mk
> @@ -0,0 +1,15 @@
> +################################################################################
> +#
> +# beagle-capes
> +#
> +################################################################################
> +
> +BEAGLE_CAPES_SOURCE =
> +
> +BEAGLE_CAPES_DEPENDENCIES = linux
> +
> +define BEAGLE_CAPES_INSTALL_TARGET_CMDS
> +       $(INSTALL) -m 644 $(STAGING_DIR)/lib/firmware/*.dtbo $(TARGET_DIR)/lib/firmware/
> +endef
> +
> +$(eval $(generic-package))
> --
> 1.8.1.2
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 2/2] beagle-capes: new package
  2013-07-08  0:43   ` Frank Hunleth
@ 2013-07-08  3:08     ` Spenser Gilliland
  2013-07-08 13:02       ` Frank Hunleth
  0 siblings, 1 reply; 14+ messages in thread
From: Spenser Gilliland @ 2013-07-08  3:08 UTC (permalink / raw)
  To: buildroot

Hi Frank,

Your buildroot-bbb repo has been a great reference that helped me get
this all up and running.


> Slightly off topic, but did you run into any issues with the eMMC
> virtual cape when you did this? The cape manager requests the eMMC
> cape dtbo before the root file system is mounted. When mdev was
> finally run from the init scripts, it didn't satisfy that request (I
> quickly looked through the mdev source, and I didn't see any code to
> do this. mdev seems to only handle "hotplug" firmware requests). If I
> manually loaded the eMMC virtual cape dtbo file before the timeout, I
> could get things to work. I ended up compiling the dtbos into the
> kernel, but if your br configuration doesn't need to do this, then
> could you share?

Although, this is not a significant part of my testing (mainly focused
on hdmi support.) I can say that the emmc is detected very early in
the boot process and the following is shown during boot.

[    2.064491] mmc1: BKOPS_EN bit is not set
[    2.071345] mmc1: new high speed MMC card at address 0001
[    2.078050] mmcblk1: mmc1:0001 MMC02G 1.78 GiB
[    2.083224] mmcblk1boot0: mmc1:0001 MMC02G partition 1 1.00 MiB
[    2.089812] mmcblk1boot1: mmc1:0001 MMC02G partition 2 1.00 MiB
[    2.098715]  mmcblk1: p1 p2
[    2.106001]  mmcblk1boot1: unknown partition table
[    2.113814]  mmcblk1boot0: unknown partition table

Also, just an fyi to everyone with respect to hdmi output, you must
have beagle-capes enabled to allow HDMI output as HDMI is implemented
as a cape. Also, for any capes to work patch [1] is required.

[1] https://github.com/fhunleth/buildroot-bbb/blob/bbb/board/beagleboneblack/linux-0001-Add-missing-DTC-flags.patch

> Also, and this is just to understand things better, but if you don't
> want a firmware file copied to the target, wouldn't you just turn it
> off in the kernel's configuration?

No, by default Buildroot does not install use the firmware_install
target.  This is for reasons of disk space usage. The kernel, by
default, likes to install a lot of firmware.  Additionally, there is a
linux-firmware package for installing most of this firmware and has
much more granular control.

> Or were you motivated by the shear volume of dtbo files that you get
> when you turn on Beaglebone cape support? I was thinking that I wanted
> finer grain configuration in the Linux kernel so that I could select
> whether or not I wanted "cape-bone-exptest.dtbo" or
> "cape-bone-adafruit-lcd", etc., but I don't think that's a br problem.
> Prior to the Beaglebone capes, I had not seen so many firmware files
> that I didn't need.

I thought about doing individual capes but the constantly changing
nature of these capes would require lots of updates and special cases.
However, the size of dtbo's are negligible so I just installed them
all.

> Thanks,
> Frank
>
> p.s. thanks for the opengl work. I have a project coming up in the
> fall that will need it, so your commits are very timely.

Great to hear.  Hopefully, the Beaglebone Black will be a possible target soon.

Thanks,
Spenser

--
Spenser Gilliland
Computer Engineer
Doctoral Candidate

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

* [Buildroot] [PATCH 2/2] beagle-capes: new package
  2013-07-08  3:08     ` Spenser Gilliland
@ 2013-07-08 13:02       ` Frank Hunleth
  0 siblings, 0 replies; 14+ messages in thread
From: Frank Hunleth @ 2013-07-08 13:02 UTC (permalink / raw)
  To: buildroot

Hi Spenser,

On Sun, Jul 7, 2013 at 11:08 PM, Spenser Gilliland
<spenser@gillilanding.com> wrote:
> Hi Frank,
>
> Your buildroot-bbb repo has been a great reference that helped me get
> this all up and running.
>
>
>> Slightly off topic, but did you run into any issues with the eMMC
>> virtual cape when you did this? The cape manager requests the eMMC
>> cape dtbo before the root file system is mounted. When mdev was
>> finally run from the init scripts, it didn't satisfy that request (I
>> quickly looked through the mdev source, and I didn't see any code to
>> do this. mdev seems to only handle "hotplug" firmware requests). If I
>> manually loaded the eMMC virtual cape dtbo file before the timeout, I
>> could get things to work. I ended up compiling the dtbos into the
>> kernel, but if your br configuration doesn't need to do this, then
>> could you share?
>
> Although, this is not a significant part of my testing (mainly focused
> on hdmi support.) I can say that the emmc is detected very early in
> the boot process and the following is shown during boot.

Cool. I won't be touching HDMI since my cape conflicts with it, so
it's good to know that the HDMI support is being exercised.

>
> [    2.064491] mmc1: BKOPS_EN bit is not set
> [    2.071345] mmc1: new high speed MMC card at address 0001
> [    2.078050] mmcblk1: mmc1:0001 MMC02G 1.78 GiB
> [    2.083224] mmcblk1boot0: mmc1:0001 MMC02G partition 1 1.00 MiB
> [    2.089812] mmcblk1boot1: mmc1:0001 MMC02G partition 2 1.00 MiB
> [    2.098715]  mmcblk1: p1 p2
> [    2.106001]  mmcblk1boot1: unknown partition table
> [    2.113814]  mmcblk1boot0: unknown partition table

It certainly looks like the eMMC is working for you. I'll retest.

> Also, just an fyi to everyone with respect to hdmi output, you must
> have beagle-capes enabled to allow HDMI output as HDMI is implemented
> as a cape. Also, for any capes to work patch [1] is required.
>
> [1] https://github.com/fhunleth/buildroot-bbb/blob/bbb/board/beagleboneblack/linux-0001-Add-missing-DTC-flags.patch

Just as an update on this patch, I've since found out that this
particular patch does exist in Robert Nelson's kernel patch repo.
However, it is specifically not applied to his Debian builds. I'm
checking into this. He also doesn't apply a few other patches. One
notable one is the am335x power management patch since buildroot has
some support for building and loading the power management firmware. I
don't know what the story is there, but the buildroot power management
package can't be used for the bbb at the moment.

>
>> Also, and this is just to understand things better, but if you don't
>> want a firmware file copied to the target, wouldn't you just turn it
>> off in the kernel's configuration?
>
> No, by default Buildroot does not install use the firmware_install
> target.  This is for reasons of disk space usage. The kernel, by
> default, likes to install a lot of firmware.  Additionally, there is a
> linux-firmware package for installing most of this firmware and has
> much more granular control.

Ugh. I didn't realized that. I understand your patch now. Thanks.

>
>> Or were you motivated by the shear volume of dtbo files that you get
>> when you turn on Beaglebone cape support? I was thinking that I wanted
>> finer grain configuration in the Linux kernel so that I could select
>> whether or not I wanted "cape-bone-exptest.dtbo" or
>> "cape-bone-adafruit-lcd", etc., but I don't think that's a br problem.
>> Prior to the Beaglebone capes, I had not seen so many firmware files
>> that I didn't need.
>
> I thought about doing individual capes but the constantly changing
> nature of these capes would require lots of updates and special cases.
> However, the size of dtbo's are negligible so I just installed them
> all.

Sounds good.

>
>> Thanks,
>> Frank
>>
>> p.s. thanks for the opengl work. I have a project coming up in the
>> fall that will need it, so your commits are very timely.
>
> Great to hear.  Hopefully, the Beaglebone Black will be a possible target soon.
>
> Thanks,
> Spenser
>
> --
> Spenser Gilliland
> Computer Engineer
> Doctoral Candidate



--
Frank Hunleth
Troodon Software LLC
http://troodon-software.com/

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

* [Buildroot] [PATCH 2/2] beagle-capes: new package
  2013-07-07 23:31 ` [Buildroot] [PATCH 2/2] beagle-capes: new package Spenser Gilliland
  2013-07-08  0:43   ` Frank Hunleth
@ 2013-07-08 17:47   ` Yann E. MORIN
  2013-07-09 15:34     ` Spenser Gilliland
  2013-10-27 11:22   ` Arnout Vandecappelle
  2 siblings, 1 reply; 14+ messages in thread
From: Yann E. MORIN @ 2013-07-08 17:47 UTC (permalink / raw)
  To: buildroot

Spenser, All,

On 2013-07-07 18:31 -0500, Spenser Gilliland spake thusly:
> installs cape dtbos from the kernel firmware into the target system.

I know it was me suggesting this new package, but in the end, wouldn't
this be better handled with a post-build script?

A post-build script would also have all lattitude to decide what exact
.dtbo files to copy over, not just everything.

Not saying we should drop this package, but there really are a few
options here, and I don't really know what's better.

> Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
> ---
>  package/Config.in                    |  1 +
>  package/beagle-capes/Config.in       | 12 ++++++++++++
>  package/beagle-capes/beagle-capes.mk | 15 +++++++++++++++
>  3 files changed, 28 insertions(+)
>  create mode 100644 package/beagle-capes/Config.in
>  create mode 100644 package/beagle-capes/beagle-capes.mk
> 
> diff --git a/package/Config.in b/package/Config.in
> index 4df48ba..3b06f98 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -226,6 +226,7 @@ source "package/rpi-firmware/Config.in"
>  source "package/sunxi-boards/Config.in"
>  source "package/ux500-firmware/Config.in"
>  source "package/zd1211-firmware/Config.in"
> +source "package/beagle-capes/Config.in"

Alphabetical order, please.

>  endmenu
>  source "package/freescale-imx/Config.in"
>  source "package/acpid/Config.in"
> diff --git a/package/beagle-capes/Config.in b/package/beagle-capes/Config.in
> new file mode 100644
> index 0000000..568e84f
> --- /dev/null
> +++ b/package/beagle-capes/Config.in
> @@ -0,0 +1,12 @@
> +config BR2_PACKAGE_BEAGLE_CAPES
> +	bool "beagle-capes"
> +	depends on BR2_LINUX_KERNEL && BR2_arm
> +	select BR2_LINUX_KERNEL_INSTALL_FIRMWARE
> +	help
> +	  Installs beaglebone capes firmware from the kernel source.

The comment is mis-leading: the firmware files are not copied from the
kernel source tree, but from staging. I would not state where they are
copied from, so I'd say something along those lines:

    Install BeagleBone capes firmwares.

    These firmwares are bundled in the TI fork on the Linux kernel for
    the BegaleBone, so you'll need to configure Buildroot to use such a
    kernel.

> +	  This package requires that a kernel with beaglebone capes firmware is
> +	  selected.
> +
> +comment "requires the linux kernel"

comment "beagle-capes requires a Linux kernel"

> +	depends on !(BR2_LINUX_KERNEL)
> diff --git a/package/beagle-capes/beagle-capes.mk b/package/beagle-capes/beagle-capes.mk
> new file mode 100644
> index 0000000..5b6f121
> --- /dev/null
> +++ b/package/beagle-capes/beagle-capes.mk
> @@ -0,0 +1,15 @@
> +################################################################################
> +#
> +# beagle-capes 
> +#
> +################################################################################
> +
> +BEAGLE_CAPES_SOURCE =
> +
> +BEAGLE_CAPES_DEPENDENCIES = linux
> +
> +define BEAGLE_CAPES_INSTALL_TARGET_CMDS
> +	$(INSTALL) -m 644 $(STAGING_DIR)/lib/firmware/*.dtbo $(TARGET_DIR)/lib/firmware/
> +endef
> +
> +$(eval $(generic-package))

Otherwise, LGTM.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 1/2] linux: install firmware to staging.
  2013-07-07 23:31 [Buildroot] [PATCH 1/2] linux: install firmware to staging Spenser Gilliland
  2013-07-07 23:31 ` [Buildroot] [PATCH 2/2] beagle-capes: new package Spenser Gilliland
@ 2013-07-08 17:52 ` Yann E. MORIN
  2013-07-09 10:54   ` Thomas Petazzoni
  1 sibling, 1 reply; 14+ messages in thread
From: Yann E. MORIN @ 2013-07-08 17:52 UTC (permalink / raw)
  To: buildroot

On 2013-07-07 18:31 -0500, Spenser Gilliland spake thusly:
> Install firmware to staging when the hidden option
> BR2_LINUX_KERNEL_INSTALL_FIRMWARE is selected.  This allows parts of the
> firmware provided by the linux kernel to be installed in the target.
> 
> Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
> ---
>  linux/Config.in |  5 +++++
>  linux/linux.mk  | 13 +++++++++++++
>  2 files changed, 18 insertions(+)
> 
> diff --git a/linux/Config.in b/linux/Config.in
> index f58e714..b733019 100644
> --- a/linux/Config.in
> +++ b/linux/Config.in
> @@ -297,6 +297,11 @@ config BR2_LINUX_KERNEL_INSTALL_TARGET
>  	  /boot in the target root filesystem, as is typically done on
>  	  x86/x86_64 systems.
>  
> +# This option is used to install firmware to staging. Other packages such as
> +# beagle-capes then install the firmware into the target. This avoids
> +# installing all linux firmware.

I would also states that this applies to special firmware files that are
*not* distributed with the linux-firmware package. All 'standard'
firmwares should be installed via linux-firmware. This knob is for very
special cases such as the BBB capes. Waht about:

# This option can be selected by other packages that require special
# firmwares bundled in some fiorks of the Linux kernell (eg. the BBB
# capes firmwares (.dtbo) as distributed in the TI Linux kernel fork).
# To install other firmwares, please use the linux-firmware package.

> +config BR2_LINUX_KERNEL_INSTALL_FIRMWARE
> +	bool
>  
>  # Linux extensions
>  source "linux/Config.ext.in"
> diff --git a/linux/linux.mk b/linux/linux.mk
> index befef16..88c954d 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -256,6 +256,15 @@ define LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET
>  endef
>  endif
>  
> +ifeq ($(BR2_LINUX_KERNEL_INSTALL_FIRMWARE),y)
> +
> +LINUX_INSTALL_STAGING = YES
> +
> +define LINUX_INSTALL_FIRMWARE_TO_STAGING
> +	$(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) firmware_install \
> +		INSTALL_FW_PATH=$(STAGING_DIR)/lib/firmware/
> +endef
> +endif
>  
>  define LINUX_INSTALL_HOST_TOOLS
>  	# Installing dtc (device tree compiler) as host tool, if selected
> @@ -269,6 +278,10 @@ define LINUX_INSTALL_IMAGES_CMDS
>  	cp $(LINUX_IMAGE_PATH) $(BINARIES_DIR)
>  endef
>  
> +define LINUX_INSTALL_STAGING_CMDS
> +	$(LINUX_INSTALL_FIRMWARE_TO_STAGING)
> +endef
> +
>  define LINUX_INSTALL_TARGET_CMDS
>  	$(LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET)
>  	$(LINUX_INSTALL_DTB)

Otherwise, LGTM.

Peter, Thomas, what do you thiink of this scheme? Should we puruse this
series, or do you have a better idea?

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 1/2] linux: install firmware to staging.
  2013-07-08 17:52 ` [Buildroot] [PATCH 1/2] linux: install firmware to staging Yann E. MORIN
@ 2013-07-09 10:54   ` Thomas Petazzoni
  2013-07-09 14:03     ` Spenser Gilliland
  0 siblings, 1 reply; 14+ messages in thread
From: Thomas Petazzoni @ 2013-07-09 10:54 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Mon, 8 Jul 2013 19:52:21 +0200, Yann E. MORIN wrote:

> > +# This option is used to install firmware to staging. Other packages such as
> > +# beagle-capes then install the firmware into the target. This avoids
> > +# installing all linux firmware.
> 
> I would also states that this applies to special firmware files that are
> *not* distributed with the linux-firmware package. All 'standard'
> firmwares should be installed via linux-firmware. This knob is for very
> special cases such as the BBB capes. Waht about:
> 
> # This option can be selected by other packages that require special
> # firmwares bundled in some fiorks of the Linux kernell (eg. the BBB
> # capes firmwares (.dtbo) as distributed in the TI Linux kernel fork).
> # To install other firmwares, please use the linux-firmware package.

The thing that worries me here is that this .dtbo thing for capes is
custom to the BBB kernel, and as far as I know, not in the upstream
kernel. So it annoys me a bit to have this within the linux/linux.mk
logic, because if we started to add vendor-specific logic in this
generic kernel .mk file, where are we going to end?

In order to have a better understanding of the problem, could someone
summarize how things work with those .dtbo? Where are they located
source wise, how they are built, where they should be installed,
how/when they are loaded/used in the system, etc.

Thanks,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH 1/2] linux: install firmware to staging.
  2013-07-09 10:54   ` Thomas Petazzoni
@ 2013-07-09 14:03     ` Spenser Gilliland
  0 siblings, 0 replies; 14+ messages in thread
From: Spenser Gilliland @ 2013-07-09 14:03 UTC (permalink / raw)
  To: buildroot

Dear Thomas,

>> # This option can be selected by other packages that require special
>> # firmwares bundled in some fiorks of the Linux kernell (eg. the BBB
>> # capes firmwares (.dtbo) as distributed in the TI Linux kernel fork).
>> # To install other firmwares, please use the linux-firmware package.
>
> The thing that worries me here is that this .dtbo thing for capes is
> custom to the BBB kernel, and as far as I know, not in the upstream
> kernel. So it annoys me a bit to have this within the linux/linux.mk
> logic, because if we started to add vendor-specific logic in this
> generic kernel .mk file, where are we going to end?

This should be the only change required to support any in-kernel
firmware.  It's very vendor agnostic and can be useful for more than
just beagle-capes.  This also establishes precedent for how to handle
non-mainlined in-kernel firmware.

> In order to have a better understanding of the problem, could someone
> summarize how things work with those .dtbo? Where are they located
> source wise, how they are built, where they should be installed,
> how/when they are loaded/used in the system, etc.

The .dtbo are device tree overlay files, the device tree sources from
which they are made are located in <kernel>/firmware/capes.  They are
built using the device tree compiler (dtc). They should be installed
in /lib/firmware and are used by the in-kernel capebus manager on boot
to add support for the capes.  The kernel installs these dtbo when the
firmware_install target is built.

In the kernel, the capebus manager uses eeproms to determine which
capes are installed on the target and installs the needed dtbo for the
cape.  This creates the needed platform devices in the kernel.

Thanks,
Spenser


--
Spenser Gilliland
Computer Engineer
Doctoral Candidate

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

* [Buildroot] [PATCH 2/2] beagle-capes: new package
  2013-07-08 17:47   ` Yann E. MORIN
@ 2013-07-09 15:34     ` Spenser Gilliland
  2013-07-09 16:07       ` Yann E. MORIN
  0 siblings, 1 reply; 14+ messages in thread
From: Spenser Gilliland @ 2013-07-09 15:34 UTC (permalink / raw)
  To: buildroot

Yann,

> I know it was me suggesting this new package, but in the end, wouldn't
> this be better handled with a post-build script?

If it's handled with a post script; then the kconfig option for
installing firmware would need to be visible to the user.

> A post-build script would also have all lattitude to decide what exact
> .dtbo files to copy over, not just everything.
>
> Not saying we should drop this package, but there really are a few
> options here, and I don't really know what's better.
>
> Alphabetical order, please.

Will fix.

> The comment is mis-leading: the firmware files are not copied from the
> kernel source tree, but from staging. I would not state where they are
> copied from, so I'd say something along those lines:
>
>     Install BeagleBone capes firmwares.
>
>     These firmwares are bundled in the TI fork on the Linux kernel for
>     the BegaleBone, so you'll need to configure Buildroot to use such a
>     kernel.

Will fix.

>> +
>> +comment "requires the linux kernel"
>
> comment "beagle-capes requires a Linux kernel"

Will fix.

Thanks,
Spenser


--
Spenser Gilliland
Computer Engineer
Doctoral Candidate

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

* [Buildroot] [PATCH 2/2] beagle-capes: new package
  2013-07-09 15:34     ` Spenser Gilliland
@ 2013-07-09 16:07       ` Yann E. MORIN
  0 siblings, 0 replies; 14+ messages in thread
From: Yann E. MORIN @ 2013-07-09 16:07 UTC (permalink / raw)
  To: buildroot

Spenser, All,

On 2013-07-09 10:34 -0500, Spenser Gilliland spake thusly:
> > I know it was me suggesting this new package, but in the end, wouldn't
> > this be better handled with a post-build script?
> 
> If it's handled with a post script; then the kconfig option for
> installing firmware would need to be visible to the user.

Indeed, I was just thinking aloud. Disregard my comment, then. ;-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 2/2] beagle-capes: new package
  2013-07-07 23:31 ` [Buildroot] [PATCH 2/2] beagle-capes: new package Spenser Gilliland
  2013-07-08  0:43   ` Frank Hunleth
  2013-07-08 17:47   ` Yann E. MORIN
@ 2013-10-27 11:22   ` Arnout Vandecappelle
  2013-10-27 20:43     ` Spenser Gilliland
  2 siblings, 1 reply; 14+ messages in thread
From: Arnout Vandecappelle @ 2013-10-27 11:22 UTC (permalink / raw)
  To: buildroot

On 08/07/13 01:31, Spenser Gilliland wrote:
> installs cape dtbos from the kernel firmware into the target system.
> 
> Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
> ---
>   package/Config.in                    |  1 +
>   package/beagle-capes/Config.in       | 12 ++++++++++++
>   package/beagle-capes/beagle-capes.mk | 15 +++++++++++++++
>   3 files changed, 28 insertions(+)
>   create mode 100644 package/beagle-capes/Config.in
>   create mode 100644 package/beagle-capes/beagle-capes.mk
> 
> diff --git a/package/Config.in b/package/Config.in
> index 4df48ba..3b06f98 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -226,6 +226,7 @@ source "package/rpi-firmware/Config.in"
>   source "package/sunxi-boards/Config.in"
>   source "package/ux500-firmware/Config.in"
>   source "package/zd1211-firmware/Config.in"
> +source "package/beagle-capes/Config.in"
>   endmenu
>   source "package/freescale-imx/Config.in"
>   source "package/acpid/Config.in"
> diff --git a/package/beagle-capes/Config.in b/package/beagle-capes/Config.in
> new file mode 100644
> index 0000000..568e84f
> --- /dev/null
> +++ b/package/beagle-capes/Config.in
> @@ -0,0 +1,12 @@
> +config BR2_PACKAGE_BEAGLE_CAPES
> +	bool "beagle-capes"
> +	depends on BR2_LINUX_KERNEL && BR2_arm
> +	select BR2_LINUX_KERNEL_INSTALL_FIRMWARE
> +	help
> +	  Installs beaglebone capes firmware from the kernel source.
> +
> +	  This package requires that a kernel with beaglebone capes firmware is
> +	  selected.
> +
> +comment "requires the linux kernel"
> +	depends on !(BR2_LINUX_KERNEL)
> diff --git a/package/beagle-capes/beagle-capes.mk b/package/beagle-capes/beagle-capes.mk
> new file mode 100644
> index 0000000..5b6f121
> --- /dev/null
> +++ b/package/beagle-capes/beagle-capes.mk
> @@ -0,0 +1,15 @@
> +################################################################################
> +#
> +# beagle-capes
> +#
> +################################################################################
> +
> +BEAGLE_CAPES_SOURCE =
> +
> +BEAGLE_CAPES_DEPENDENCIES = linux
> +
> +define BEAGLE_CAPES_INSTALL_TARGET_CMDS
> +	$(INSTALL) -m 644 $(STAGING_DIR)/lib/firmware/*.dtbo $(TARGET_DIR)/lib/firmware/
> +endef

 Hi Spenser,

 We had a discussion at the Buildroot developer meeting, and finally
found a solution which may be better...

 Instead of doing the firmware_install from the linux package, you can
do it from the beagle-capes package, i.e.:

define BEAGLE_CAPES_BUILD_CMDS
	$(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) \
		firmware_install INSTALL_FW_PATH=$(@D)
endef

define BEAGLE_CAPES_INSTALL_TARGET_CMDS
	$(INSTALL) -m 644 $(@D)/*.dtbo $(TARGET_DIR)/lib/firmware/
endef


 We don't expect that this 'install firmware to staging' feature would
ever be used by any other package, that's why we prefer not to have it
in the linux.mk.


 By the way, this will only work for a beaglebone-specific kernel, of
course. Is there any way to check for that and error out with a clear error
message?


 Regards,
 Arnout

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


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

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

* [Buildroot] [PATCH 2/2] beagle-capes: new package
  2013-10-27 11:22   ` Arnout Vandecappelle
@ 2013-10-27 20:43     ` Spenser Gilliland
  0 siblings, 0 replies; 14+ messages in thread
From: Spenser Gilliland @ 2013-10-27 20:43 UTC (permalink / raw)
  To: buildroot

Hi Arnout,

>  We had a discussion at the Buildroot developer meeting, and finally
> found a solution which may be better...
>
>  Instead of doing the firmware_install from the linux package, you can
> do it from the beagle-capes package, i.e.:
>
> define BEAGLE_CAPES_BUILD_CMDS
>         $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) \
>                 firmware_install INSTALL_FW_PATH=$(@D)
> endef
>
> define BEAGLE_CAPES_INSTALL_TARGET_CMDS
>         $(INSTALL) -m 644 $(@D)/*.dtbo $(TARGET_DIR)/lib/firmware/
> endef
>
>
>  We don't expect that this 'install firmware to staging' feature would
> ever be used by any other package, that's why we prefer not to have it
> in the linux.mk.

I agree.  I'll create a new patch and resubmit.

>
>  By the way, this will only work for a beaglebone-specific kernel, of
> course. Is there any way to check for that and error out with a clear error
> message?

We can check if any dts files exist in the firmware dir of the kernel.
 I'll write up a patch.

Thanks,
Spenser

-- 
Spenser Gilliland
Computer Engineer
Doctoral Candidate

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

* [Buildroot] [PATCH 2/2] beagle-capes: new package
  2013-07-09 17:00 [Buildroot] [PATCH v2 " Spenser Gilliland
@ 2013-07-09 17:00 ` Spenser Gilliland
  0 siblings, 0 replies; 14+ messages in thread
From: Spenser Gilliland @ 2013-07-09 17:00 UTC (permalink / raw)
  To: buildroot

installs the beaglebone cape dtbos.

Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Cc: Yann E. Morin <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
v1 -> v2:
  - alpha order in ../Config.in
  - clarify Config.in 
---
 package/Config.in                    |  1 +
 package/beagle-capes/Config.in       | 13 +++++++++++++
 package/beagle-capes/beagle-capes.mk | 15 +++++++++++++++
 3 files changed, 29 insertions(+)
 create mode 100644 package/beagle-capes/Config.in
 create mode 100644 package/beagle-capes/beagle-capes.mk

diff --git a/package/Config.in b/package/Config.in
index 4df48ba..d038c2d 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -220,6 +220,7 @@ endmenu
 menu "Hardware handling"
 menu "Misc devices firmwares"
 source "package/am33x-cm3/Config.in"
+source "package/beagle-capes/Config.in"
 source "package/b43-firmware/Config.in"
 source "package/linux-firmware/Config.in"
 source "package/rpi-firmware/Config.in"
diff --git a/package/beagle-capes/Config.in b/package/beagle-capes/Config.in
new file mode 100644
index 0000000..90482ec
--- /dev/null
+++ b/package/beagle-capes/Config.in
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_BEAGLE_CAPES
+	bool "beagle-capes"
+	depends on BR2_LINUX_KERNEL && BR2_arm
+	select BR2_LINUX_KERNEL_INSTALL_FIRMWARE
+	help
+	  Installs beaglebone capes firmwares.
+
+	  These firmwares are bundled in the TI fork on the Linux kernel for the
+	  BeagleBone; therefore, a kernel with these firmwares must be configured in
+	  the Kernel Configuration section of Buildroot.
+
+comment "beagle-capes requires a Linux kernel"
+	depends on !(BR2_LINUX_KERNEL)
diff --git a/package/beagle-capes/beagle-capes.mk b/package/beagle-capes/beagle-capes.mk
new file mode 100644
index 0000000..5b6f121
--- /dev/null
+++ b/package/beagle-capes/beagle-capes.mk
@@ -0,0 +1,15 @@
+################################################################################
+#
+# beagle-capes 
+#
+################################################################################
+
+BEAGLE_CAPES_SOURCE =
+
+BEAGLE_CAPES_DEPENDENCIES = linux
+
+define BEAGLE_CAPES_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 644 $(STAGING_DIR)/lib/firmware/*.dtbo $(TARGET_DIR)/lib/firmware/
+endef
+
+$(eval $(generic-package))
-- 
1.8.1.2

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

end of thread, other threads:[~2013-10-27 20:43 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-07 23:31 [Buildroot] [PATCH 1/2] linux: install firmware to staging Spenser Gilliland
2013-07-07 23:31 ` [Buildroot] [PATCH 2/2] beagle-capes: new package Spenser Gilliland
2013-07-08  0:43   ` Frank Hunleth
2013-07-08  3:08     ` Spenser Gilliland
2013-07-08 13:02       ` Frank Hunleth
2013-07-08 17:47   ` Yann E. MORIN
2013-07-09 15:34     ` Spenser Gilliland
2013-07-09 16:07       ` Yann E. MORIN
2013-10-27 11:22   ` Arnout Vandecappelle
2013-10-27 20:43     ` Spenser Gilliland
2013-07-08 17:52 ` [Buildroot] [PATCH 1/2] linux: install firmware to staging Yann E. MORIN
2013-07-09 10:54   ` Thomas Petazzoni
2013-07-09 14:03     ` Spenser Gilliland
2013-07-09 17:00 [Buildroot] [PATCH v2 " Spenser Gilliland
2013-07-09 17:00 ` [Buildroot] [PATCH 2/2] beagle-capes: new package Spenser Gilliland

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.