]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
kernel: i2c-designware: disable core on 32-bit bcm27xx targets on 6.18
authorJoshua Covington <joshuacov@gmail.com>
Mon, 22 Jun 2026 21:53:40 +0000 (21:53 +0000)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Tue, 7 Jul 2026 06:48:40 +0000 (08:48 +0200)
The bcm27xx/bcm2708 all-kmods CI build fails when modpost reaches the
DesignWare I2C core module:

  ERROR: modpost: "__aeabi_uldivmod"
  [drivers/i2c/busses/i2c-designware-core.ko] undefined!

This is triggered by CONFIG_ALL_KMODS=y. The old 32-bit Raspberry Pi
subtargets do not normally select this driver for runtime use, but all-kmods
forces the kmod package to be built anyway. On 32-bit ARM, raw 64-bit
division in a module can cause GCC to emit the ARM EABI helper
__aeabi_uldivmod, which is not available as a kernel module symbol.

The failing reference comes from i2c-designware-master.c, where clock_calc()
uses raw u64 division for SCL timing calculations (introduced with commit
3805d13c3ead21494f7d00aa44f10e3656363d4c in rpi-6.18.y / "i2c: designware:
Support non-standard bus speeds"). That is a kernel-side portability issue,
but these old bcm27xx subtargets do not use DesignWare I2C hardware. They
use the Broadcom I2C controller instead.

The failure is emitted for i2c-designware-core.ko, so guard the hidden core
package itself rather than only guarding the platform or PCI frontend package.
This prevents CONFIG_ALL_KMODS from selecting the failing core module directly
on the affected 32-bit bcm27xx subtargets.

DesignWare I2C is relevant for newer Raspberry Pi 5 / RP1 based systems, so
keep it available for bcm2712.

A similar issue was reported by NixOS for Raspberry Pi ARM builds, where
i2c-designware-core.ko failed with the same unresolved __aeabi_uldivmod symbol.
Their workaround was to disable the DesignWare I2C symbols for older Raspberry
Pi targets that do not need them.
Link: https://github.com/NixOS/nixpkgs/issues/464515
Until the underlying ARM32 kernel-side issue is fixed, avoid building
the DesignWare core package on bcm2708, bcm2709 and bcm2710.

Signed-off-by: Joshua Covington <joshuacov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23703
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
package/kernel/linux/modules/i2c.mk

index e9e4e3965b85a37ada4b8af563903399e5f4d017..74994220294ecabbef359c64dc1a47d7679059cf 100644 (file)
@@ -104,7 +104,9 @@ I2C_DWCORE_MODULES:= \
 define KernelPackage/i2c-designware-core
   $(call i2c_defaults,$(I2C_DWCORE_MODULES),58)
   TITLE:=Synopsys DesignWare I2C core
-  DEPENDS:=+kmod-i2c-core +kmod-regmap-core
+  DEPENDS:= \
+    @!(LINUX_6_18&&(TARGET_bcm27xx_bcm2708||TARGET_bcm27xx_bcm2709||TARGET_bcm27xx_bcm2710)) \
+    +kmod-i2c-core +kmod-regmap-core
   HIDDEN:=y
 endef