From 376b2242ab3687bb2bfc3aceb47a64260c991044 Mon Sep 17 00:00:00 2001 From: John Audia Date: Wed, 11 Dec 2024 15:06:30 -0500 Subject: [PATCH] bcm27xx/bcm2712: add missing RP1 kmods 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 --- target/linux/bcm27xx/image/Makefile | 3 +- target/linux/bcm27xx/modules/other.mk | 66 +++++++++++++++++++++++++-- 2 files changed, 65 insertions(+), 4 deletions(-) diff --git a/target/linux/bcm27xx/image/Makefile b/target/linux/bcm27xx/image/Makefile index 23bc3a35c9edd8..1061c12ef6565d 100644 --- 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-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 diff --git a/target/linux/bcm27xx/modules/other.mk b/target/linux/bcm27xx/modules/other.mk index 99b71d4d695af1..c42533756ced20 100644 --- a/target/linux/bcm27xx/modules/other.mk +++ b/target/linux/bcm27xx/modules/other.mk @@ -10,7 +10,7 @@ define KernelPackage/pwm-raspberrypi-poe CONFIG_PWM_RASPBERRYPI_POE FILES:=$(LINUX_DIR)/drivers/pwm/pwm-raspberrypi-poe.ko AUTOLOAD:=$(call AutoLoad,20,pwm-raspberrypi-poe) - DEPENDS:=@TARGET_bcm27xx +kmod-hwmon-pwmfan + DEPENDS:=@TARGET_bcm27xx_bcm2712 +kmod-hwmon-pwmfan endef define KernelPackage/pwm-raspberrypi-poe/description @@ -26,7 +26,7 @@ define KernelPackage/smi-bcm2835 KCONFIG:=CONFIG_BCM2835_SMI FILES:=$(LINUX_DIR)/drivers/misc/bcm2835_smi.ko AUTOLOAD:=$(call AutoLoad,20,bcm2835_smi) - DEPENDS:=@TARGET_bcm27xx + DEPENDS:=@TARGET_bcm27xx_bcm2712 endef define KernelPackage/smi-bcm2835/description @@ -43,7 +43,7 @@ define KernelPackage/smi-bcm2835-dev KCONFIG:=CONFIG_BCM2835_SMI_DEV FILES:=$(LINUX_DIR)/drivers/char/broadcom/bcm2835_smi_dev.ko AUTOLOAD:=$(call AutoLoad,21,bcm2835_smi_dev) - DEPENDS:=@TARGET_bcm27xx +kmod-smi-bcm2835 + DEPENDS:=@TARGET_bcm27xx_bcm2712 +kmod-smi-bcm2835 endef define KernelPackage/smi-bcm2835-dev/description @@ -53,3 +53,63 @@ 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_bcm2712 +endef + +define KernelPackage/rp1-firmware/description + Firmware driver for RP1 silicon +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_bcm2712 +kmod-rp1-firmware +endef + +define KernelPackage/rp1-pio/description + RP1 PIO driver +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_bcm2712 +endef + +define KernelPackage/rp1-mailbox/description + Mailbox hardware support for RP1 +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_bcm2712 +kmod-rp1-pio +endef + +define KernelPackage/pwm-pio-rp1/description + Pulse-Width Modulation (PWM) Support for RP1 chip +endef + +$(eval $(call KernelPackage,pwm-pio-rp1))