I'd like to add support for rp1 modules for RPi5B

Can someone point me to a file I can use as a model to add a new package to supply the needed modules for the rp1 chip on the RPi5B?

I think I need to define a new package, say kmod-rp1?

Just grepping around, I think I need to first add this to target/linux/bcm27xx/image/Makefile

--- a/target/linux/bcm27xx/image/Makefile
+++ b/target/linux/bcm27xx/image/Makefile
@@ -201,7 +201,8 @@ define Device/rpi-5
        cypress-firmware-43455-sdio \
        brcmfmac-nvram-43455-sdio \
        kmod-brcmfmac wpad-basic-mbedtls \
-       kmod-hwmon-pwmfan kmod-thermal
+       kmod-hwmon-pwmfan kmod-thermal \
+       kmod-rp1
   IMAGE/sysupgrade.img.gz := boot-common | sdcard-img | gzip | append-metadata
   IMAGE/factory.img.gz := boot-common | sdcard-img | gzip
 endef

Is the next step to create a Makefile to package the modules? Running on Arch ARM as model system, These seem to be the ones needed:

% lsmod | grep -i rp1
rp1_pio                36864  0
rp1_adc                12288  0
rp1                    16384  1 rp1_pio
rp1_mailbox            12288  1

First step is to package modules, since pi1 is not present on older models you have to disperse pi5 in separate profile section.

I not not sure where I need to define the modules for the package.

Start with searching for e.g. igb across the tree, all kmods are emitted by kernel build.

I am on the right track?

1 Like

Thats correct, probably dont add it to image profile first.

OK! I made some significant progress. Now I am wondering how to correctly distribute these into the various files within package/kernel/linux/modules/*.mk

bcm27xx modules a located in target/linux/bcm27xx/modules/*.mk

2 Likes

Thanks @Ieo - that did the trick

One more question: since this module is unique to only bcm27xx/bcm2712 and none of the other subtargets, what is the correct syntax to prevent the package building on them?

This does not seem valid:

DEPENDS:=@TARGET_bcm27xx/bcm2712

I think is
DEPENDS:=@TARGET_bcm27xx_bcm2712

1 Like