Remove bcm_host dependency #533
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Remove dependency on
bcm_hostlibrary (libraspberrypi-dev) for VideoCore GPU FFT builds.Problem
The
libraspberrypi-devpackage came from the raspberrypi/userland repository, which is now archived and marked as "ancient and deprecated." The package is not available in Trixie and is being phased out on Bookworm through package replacement. Thelibraspberrypi-devpackage provided thebcm_hostlibrary. With it gone, builds withPLATFORM=rpiv2will fail on recent Raspberry Pi OS distributions becausegpu_fft_base.cdepends on:bcm_host_get_peripheral_address()bcm_host_get_peripheral_size()bcm_host_get_sdram_address()Solution
Query the board revision directly via the VideoCore mailbox interface (which is already used by gpu_fft for other purposes), and derive the peripheral address and memory flags from the processor type encoded in the revision bits.
I also considered an alternative approach using the device tree (
/proc/device-tree/soc/ranges) to obtain the peripheral address, available in theremove-bcm-host-device-treebranch. I chose the mailbox approach because it fits better with the existing gpu_fft code.Alternatives
If this change is not desired, users can work around the issue by building and installing bcm-host-shim, which provides stub implementations of the required bcm_host functions.
Testing
Tested on Raspberry Pi 2 Model B Rev 1.1 running Raspberry Pi OS Trixie.