Hello,
I'm trying to apply a device tree overlay on the NXP kernel version lf-6.12.20-2.0.0 for the i.MX8MP.
To apply the overlay, I’m using a simple kernel module: https://github.com/ikwzm/dtbocfg
The device tree is loaded after Linux kernel is started.
When I try to activate this overlay:
/dts-v1/;
/plugin/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include "../freescale/imx8mp-pinfunc.h"
/ {
compatible = "fsl,imx8mp";
// IOMUX
fragment@iomuxc {
target = <&iomuxc>;
__overlay__ {
pinctrl_i2c2: pinctrl_i2c2 {
fsl,pins = <
MX8MP_IOMUXC_SD1_DATA6__I2C2_SCL 0x400001c3 // KPAD_BAT_I2C2_SCL: J2.J78
MX8MP_IOMUXC_SD1_DATA7__I2C2_SDA 0x400001c3 // KPAD_BAT_I2C2_SDA: J2.J80
>;
};
};
};
fragment@i2c2 {
target = <&i2c2>;
__overlay__ {
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c2>;
status = "okay";
eeprom_keypad: eeprom@50 {
compatible = "microchip,24c02";
reg = <0x50>;
pagesize = <16>;
vcc-supply = <®_vref_3v3>;
};
};
};
};
The following error message is shown:
imx8mp-pinctrl 30330000.pinctrl: invalid group "pinctrl_i2c2" for function "pinctrl"
I checked the phandle references in the base device tree (imx8mp.dtsi) and everything looks correct.
This issue occurs only with pinctrl references; other phandle references work fine.
The device overlay is compiled with the -@ option for dtc.
A similar message occurs on the mainline kernel 6.12.36:
imx8mp-pinctrl 30330000.pinctrl: unable to find group for node pinctrl_i2c2
So it seems that pinmuxing is not possible when provided via a device tree overlay.
Is there a solution for this?
Thanks for your help,
Sven