bcm27xx/bcm2712: Fix-up RP1 modules

Correct a few mistakes around dependencies and naming and unset
CONFIG_FIRMWARE_RP1 in RPi5B's config and instead of a builtin, build it
as a module.

Without this change, there are two entries for rp1.ko in
/lib/modules/$(uname -r)/modules.builtin due to how we strip the leading
directories when we generate it. See: package/kernel/linux/Makefile
around line 63.

  % grep rp1.ko /lib/modules/$(uname -r)/modules.builtin
  pwm-rp1.ko
  clk-rp1.ko
  rp1.ko
  rp1.ko

The kernel log gets spammed with tons of superfluous warnings as a
results of the double entry:

  daemon.warn modprobe: found duplicate builtin module rp1

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/17461
Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit f105d1a9a9)
This commit is contained in:
John Audia 2025-01-02 07:50:26 -05:00 committed by Álvaro Fernández Rojas
parent 2f60e7f006
commit 7a112661d5
4 changed files with 92 additions and 7 deletions

View File

@ -239,7 +239,7 @@ CONFIG_FB_DEVICE=y
CONFIG_FB_IOMEM_FOPS=y
CONFIG_FB_IOMEM_HELPERS=y
CONFIG_FB_SIMPLE=y
CONFIG_FIRMWARE_RP1=y
# CONFIG_FIRMWARE_RP1 is not set
CONFIG_FIXED_PHY=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_FONT_8x16=y
@ -372,7 +372,7 @@ CONFIG_MAGIC_SYSRQ=y
CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1f6
CONFIG_MAILBOX=y
# CONFIG_MAILBOX_TEST is not set
CONFIG_MBOX_RP1=y
# CONFIG_MBOX_RP1 is not set
CONFIG_MDIO_BCM_UNIMAC=y
CONFIG_MDIO_BUS=y
CONFIG_MDIO_DEVICE=y
@ -537,7 +537,7 @@ CONFIG_RESET_RASPBERRYPI=y
CONFIG_RESET_SIMPLE=y
CONFIG_RFS_ACCEL=y
CONFIG_RODATA_FULL_DEFAULT_ENABLED=y
CONFIG_RP1_PIO=y
# CONFIG_RP1_PIO is not set
# CONFIG_RPI_POE_POWER is not set
CONFIG_RPS=y
CONFIG_RTC_CLASS=y
@ -550,7 +550,7 @@ CONFIG_SCSI_COMMON=y
# CONFIG_SCSI_LOWLEVEL is not set
# CONFIG_SCSI_PROC_FS is not set
CONFIG_SENSORS_RASPBERRYPI_HWMON=y
CONFIG_SENSORS_RP1_ADC=y
# CONFIG_SENSORS_RP1_ADC is not set
CONFIG_SERIAL_8250_BCM2835AUX=y
CONFIG_SERIAL_8250_BCM7271=y
# CONFIG_SERIAL_8250_DMA is not set

View File

@ -2,6 +2,23 @@
#
# Copyright (C) 2019 OpenWrt.org
define KernelPackage/rp1-adc
SUBMENU:=$(OTHER_MENU)
TITLE:=RP1 ADC and temperature sensor driver
KCONFIG:=CONFIG_SENSORS_RP1_ADC
FILES:=$(LINUX_DIR)/drivers/hwmon/rp1-adc.ko
AUTOLOAD:=$(call AutoLoad,21,rp1-adc)
DEPENDS:=@TARGET_bcm27xx_bcm2712
endef
define KernelPackage/rp1-adc/description
Kernel module for RP1 silicon providing ADC and
temperature monitoring.
endef
$(eval $(call KernelPackage,rp1-adc))
define KernelPackage/hwmon-raspberrypi
TITLE:=Raspberry Pi voltage monitor
KCONFIG:=CONFIG_SENSORS_RASPBERRYPI_HWMON
@ -15,3 +32,5 @@ define KernelPackage/hwmon-raspberrypi/description
endef
$(eval $(call KernelPackage,hwmon-raspberrypi))

View File

@ -55,13 +55,46 @@ endef
$(eval $(call KernelPackage,smi-bcm2835-dev))
define KernelPackage/rp1
SUBMENU:=$(OTHER_MENU)
TITLE:=RP1 firmware
KCONFIG:=CONFIG_FIRMWARE_RP1
FILES:=$(LINUX_DIR)/drivers/firmware/rp1.ko
AUTOLOAD:=$(call AutoLoad,21,rp1)
DEPENDS:=@TARGET_bcm27xx_bcm2712
endef
define KernelPackage/rp1/description
This driver provides a firmware interface to the RP1 processor using shared
memory and a mailbox.
endef
$(eval $(call KernelPackage,rp1))
define KernelPackage/rp1-pio
SUBMENU:=$(OTHER_MENU)
TITLE:=RP1 PIO block support
KCONFIG:=CONFIG_RP1_PIO
FILES:=$(LINUX_DIR)/drivers/misc/rp1-pio.ko
AUTOLOAD:=$(call AutoLoad,21,rp1-pio)
DEPENDS:=@TARGET_bcm27xx_bcm2712 +kmod-rp1
endef
define KernelPackage/rp1-pio/description
Driver providing control of the Raspberry Pi PIO block, as found in RP1
endef
$(eval $(call KernelPackage,rp1-pio))
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
AUTOLOAD:=$(call AutoLoad,21,pwm-pio-rp1)
DEPENDS:=@TARGET_bcm27xx_bcm2712
DEPENDS:=@TARGET_bcm27xx_bcm2712 +kmod-rp1-pio
endef
define KernelPackage/pwm-pio-rp1/description
@ -80,7 +113,7 @@ define KernelPackage/ws2812-pio-rp1
KCONFIG:=CONFIG_WS2812_PIO_RP1
FILES:=$(LINUX_DIR)/drivers/misc/ws2812-pio-rp1.ko
AUTOLOAD:=$(call AutoLoad,21,ws2812-pio-rp1)
DEPENDS:=@TARGET_bcm27xx_bcm2712
DEPENDS:=@TARGET_bcm27xx_bcm2712 +kmod-rp1-pio
endef
define KernelPackage/ws2812-pio-rp1/description
@ -90,3 +123,36 @@ define KernelPackage/ws2812-pio-rp1/description
endef
$(eval $(call KernelPackage,ws2812-pio-rp1))
define KernelPackage/rp1-mailbox
SUBMENU:=$(OTHER_MENU)
TITLE:=RP1 mailbox IPC driver
KCONFIG:=CONFIG_MBOX_RP1
FILES:=$(LINUX_DIR)/drivers/mailbox/rp1-mailbox.ko
AUTOLOAD:=$(call AutoLoad,21,rp1-mailbox)
DEPENDS:=@TARGET_bcm27xx_bcm2712
endef
define KernelPackage/rp1-mailbox/description
This is a RP1 mailbox IPC driver.
endef
$(eval $(call KernelPackage,rp1-mailbox))
define KernelPackage/rp1-pio
SUBMENU:=$(OTHER_MENU)
TITLE:=RP1 PIO driver
KCONFIG:=CONFIG_RP1_PIO
FILES:=$(LINUX_DIR)/drivers/misc/rp1-pio.ko
AUTOLOAD:=$(call AutoLoad,21,rp1-pio)
DEPENDS:=@TARGET_bcm27xx_bcm2712 +kmod-rp1
endef
define KernelPackage/rp1-pio/description
Driver for the RP1 PIO.
endef
$(eval $(call KernelPackage,rp1-pio))

View File

@ -156,7 +156,7 @@ define KernelPackage/drm-rp1-dpi
CONFIG_DRM_TTM_HELPER=n
FILES:=$(LINUX_DIR)/drivers/gpu/drm/rp1/rp1-dpi/drm-rp1-dpi.ko
AUTOLOAD:=$(call AutoLoad,67,drm-rp1-dpi)
DEPENDS:=@TARGET_bcm27xx_bcm2712 +kmod-drm-vc4
DEPENDS:=@TARGET_bcm27xx_bcm2712 +kmod-drm-vc4 +kmod-rp1-pio
endef
define KernelPackage/drm-rp1-dpi/description