Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: cleanup of linux-firmware #149

Draft
wants to merge 1 commit into
base: kirkstone
Choose a base branch
from

Conversation

kvberge
Copy link

@kvberge kvberge commented Feb 17, 2023

Hi @superna9999 - this PR is just a start, mostly to be used as a discussion point on how to move forward 'cleaning' up the linux-firmware section of this repository.

It should be noted that because other than the amlogic-image-bootstrap image, the changes in this PR are sort of masked because the other image recipes explicitly include the linux-firmware package, which basically installs all Linux firmware(s) into the image.

I have verified the changes I've made here on my radxa-zero, using a custom image which enables wifi/bt for the radxa zero and only installs the required firmware for the given hardware.

Known Issues

Currently this code only builds completely for the radxa-zero hardware (if you uncomment the MACHINE_ESSENTIAL_EXTRA_RDEPENDS in amlogic-meson.inc) . I have locally one flavor of the radxa-zero hardware that requires the linux-firmware-bcm43455 while a developer working with me in China has a radxa-zero that requires linux-firmware-bcm43456 (AP6256 WiFi Module). These changes have been confirmed to work on both those boards. I do not have another amlogic based devices to test on.

TODO

  • Figure out what firmware(s) belong on which hardware (both wifi and bluetooth)
  • Determine if it's more idoimatic to include, by way of machine overrides, the firmware in amlogic-meson.inc or push the firmware inclusion into the <machine_name>.conf file
  • Figure out why a nothing provides linux-firmware-bcmxxx appears for some builds (as noted in the comments of amlogic-meson.inc

Signed-off-by: Kevin Vanden Berge <[email protected]>
@kvberge kvberge marked this pull request as draft February 17, 2023 21:48
@superna9999
Copy link
Owner

Thanks, it goes in the right direction, now indeed we must figure out the exact needed firmwares.

But in the meantime a generic conf/machine/include/amlogic-meson-firmwares.inc could be added which adds all the BT + Wifi firmwares, so we can update board per board by either including amlogic-meson-firmwares.inc or adding the right dependencies.

@kvberge
Copy link
Author

kvberge commented Apr 12, 2023

Hi @superna9999 , my apologies this appeared to go stale, my real job started consuming more of my time. I intend to make more progress on this. I like the idea you suggested of having a generic include for all the firmwares and then updating board by board. I'll head down that road and update this draft.

Great suggestion, thank you!

Copy link

@philippgl philippgl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, overall this is only a minor improvement, but still nice to have. With this I miss the linux-firmware-bcm43430 to use the wifi on my radxa-zero (and without this wifi does not work on the larger radxa-zeros).

I am out of office for the next two week, but then I might try something like this myself. Unfortunately I do not have other meson based devices, so I do not know, how much will break, if the firmware packages are removed from the amlogic-meson.inc

# Bascally including either of these in MACHINE_ESSENTIAL_EXTRA_RDEPENDS causes the above error
# MACHINE_ESSENTIAL_EXTRA_RDEPENDS += " \
# ${@bb.utils.contains("MACHINE_FEATURES", "wifi", "linux-firmware-bcm43430", "",d)} \
# ${@bb.utils.contains("MACHINE_FEATURES", "wifi", "linux-firmware-bcm43430a0", "",d)} \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This package is never created, b/c it is empty as all files, that should go into it, are part of the linux-firmware-bcm43430 package (see the other comment).

Comment on lines +40 to 41
FILES:${PN}-bcm43430 += " \
${nonarch_base_libdir}/firmware/brcm/brcmfmac43430* \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This leaves the -bcm43430a0 package empty and so it is never created causing the error mentioned above. It should be at least ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-*

Comment on lines +17 to +22
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += " \
linux-firmware-bcm43455 \
linux-firmware-bcm43456 \
linux-firmware-bcm4345c0-hcd \
linux-firmware-bcm4345c5-hcd \
"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, this should guarded by the wifi MACHINE_FEATURES and the MACHINE_FEATURES above should contain wifi Some variants do not have an antenna, but the wifi/bt chip is always there.

The smaller radxa-zero models need linux-firmware-bcm43430, so this should be here as well (if it is removed from the amlogic-meson.inc)

@superna9999
Copy link
Owner

I think, overall this is only a minor improvement, but still nice to have. With this I miss the linux-firmware-bcm43430 to use the wifi on my radxa-zero (and without this wifi does not work on the larger radxa-zeros).

I am out of office for the next two week, but then I might try something like this myself. Unfortunately I do not have other meson based devices, so I do not know, how much will break, if the firmware packages are removed from the amlogic-meson.inc

The current state is a mess, any fix is welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants