Skip to content

Commit

Permalink
bcm27xx/bcm2712: add missing RP1 kmods
Browse files Browse the repository at this point in the history
Add a package to supply the following modules needed by the RP1 I/O
controller: rp1, rp1-mailbox, rp1-pio, and pwm-pio-rp1.

Note - rp1-adc is currently a built-in.

Build system: x86/64
Build-tested: bcm2712/RPi5B
Run-tested: bcm2712/RPi5B

Signed-off-by: John Audia <therealgraysky@proton.me>
  • Loading branch information
graysky2 committed Dec 16, 2024
1 parent a2d6186 commit 7ba0f57
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 1 deletion.
3 changes: 2 additions & 1 deletion target/linux/bcm27xx/image/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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-firmware kmod-rp1-pio kmod-rp1-mailbox
IMAGE/sysupgrade.img.gz := boot-common | sdcard-img | gzip | append-metadata
IMAGE/factory.img.gz := boot-common | sdcard-img | gzip
endef
Expand Down
81 changes: 81 additions & 0 deletions target/linux/bcm27xx/modules/other.mk
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,84 @@ define KernelPackage/smi-bcm2835-dev/description
endef

$(eval $(call KernelPackage,smi-bcm2835-dev))


define KernelPackage/rp1-firmware
TITLE:=RP1 Firmware Driver
KCONFIG:= \
CONFIG_FIRMWARE_RP1 \
CONFIG_MBOX_RP1
FILES:=$(LINUX_DIR)/drivers/firmware/rp1.ko
DEPENDS:=\
@!TARGET_bcm27xx_bcm2708 @!TARGET_bcm27xx_bcm2709 \
@!TARGET_bcm27xx_bcm2710 @!TARGET_bcm27xx_bcm2711 \
@TARGET_bcm27xx +kmod-rp1-firmware
endef

define KernelPackage/rp1-firmware/description
Enables the RP1 chip to function correctly as a co-processor
handling GPIOs, SPI, I2C, and other low-level peripherals.
endef

$(eval $(call KernelPackage,rp1-firmware))


define KernelPackage/rp1-pio
TITLE:=RP1 PIO driver
KCONFIG:=CONFIG_RP1_PIO
FILES:=$(LINUX_DIR)/drivers/misc/rp1-pio.ko
AUTOLOAD:=$(call AutoLoad,10,rp1-pio)
DEPENDS:=\
@!TARGET_bcm27xx_bcm2708 @!TARGET_bcm27xx_bcm2709 \
@!TARGET_bcm27xx_bcm2710 @!TARGET_bcm27xx_bcm2711 \
@TARGET_bcm27xx +kmod-rp1-firmware
endef

define KernelPackage/rp1-pio/description
Allows for custom hardware-accelerated I/O protocols to be
implemented. Ideal for tasks requiring precise timing,
such as generating specific waveforms or handling non-
standard communication protocols.
endef

$(eval $(call KernelPackage,rp1-pio))


define KernelPackage/rp1-mailbox
TITLE:=RP1 mailbox support
FILES:=$(LINUX_DIR)/drivers/mailbox/rp1-mailbox.ko
AUTOLOAD:=$(call AutoLoad,10,rp1-mailbox)
DEPENDS:=\
@!TARGET_bcm27xx_bcm2708 @!TARGET_bcm27xx_bcm2709 \
@!TARGET_bcm27xx_bcm2710 @!TARGET_bcm27xx_bcm2711 \
@TARGET_bcm27xx +kmod-rp1-firmware
endef

define KernelPackage/rp1-mailbox/description
Handles command and control messages exchanged between the
CPU and RP1, enabling efficient coordination for I/O operations,
status monitoring, and peripheral configuration.
endef

$(eval $(call KernelPackage,rp1-mailbox))


define KernelPackage/pwm-pio-rp1
SUBMENU:=$(OTHER_MENU)
TITLE:=RP1 PWM support
KCONFIG:=CONFIG_PWM_PIO_RP1
FILES:=$(LINUX_DIR)/drivers/pwm/pwm-pio-rp1.ko
DEPENDS:=\
@!TARGET_bcm27xx_bcm2708 @!TARGET_bcm27xx_bcm2709 \
@!TARGET_bcm27xx_bcm2710 @!TARGET_bcm27xx_bcm2711 \
@TARGET_bcm27xx +kmod-rp1-pio
endef

define KernelPackage/pwm-pio-rp1/description
Enables precise control of PWM signals for tasks like motor control,
LED dimming, and audio signal generation. Leveraging PIO allows for
higher accuracy and flexibility in PWM signal generation compared
to traditional hardware timers.
endef

$(eval $(call KernelPackage,pwm-pio-rp1))

0 comments on commit 7ba0f57

Please sign in to comment.