I am having an issue using the I2C4 on the Apalis IMX8QM module on BSP version 5.0 and above.
I am able to get I2C4 to work on the Boot to Qt for Embedded Linux 3.0.3 b2qt-apalis-imx8. I am using linux-toradex_BSP_3.04.-4 DTS file fsl-imx8qm-apalis-v1.1.dtsi by adding the following:
pinctrl_lpi2c4: lpi2c4grp {
fsl,pins = <
SC_P_ENET1_MDC_DMA_I2C4_SCL 0x04000020
SC_P_ENET1_MDIO_DMA_I2C4_SDA 0x04000020
>;
};
&i2c4 {
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_lpi2c4>;
#address-cells = <1>;
#size-cells = <0>;
clock-frequency = <100000>;
status = “okay”;
};
With the above compiled .dtb and running…
i2cdetect -l Returns the following (i2c-6 is new i.e. I2C4)
i2c-3 i2c 5a810000.i2c I2C adapter
i2c-6 i2c 5a840000.i2c I2C adapter
i2c-4 i2c 5a820000.i2c I2C adapter
i2c-2 i2c 5a800000.i2c I2C adapter
i2c-5 i2c 5a830000.i2c I2C adapter
I tried the same basic commands (suitable for BSP 5) and the compile fails with “label i2c4 missing”.
I found the following missing in: imx8-ss-dma.dtsi
i2c4_lpcg: clock-controller@5ac40000 {
compatible = "fsl,imx8qxp-lpcg";
reg = <0x5ac40000 0x10000>;
#clock-cells = <1>;
clocks = <&clk IMX_SC_R_I2C_4 IMX_SC_PM_CLK_PER>,
<&dma_ipg_clk>;
bit-offset = <0 16>;
clock-output-names = "i2c4_lpcg_clk",
"i2c4_lpcg_ipg_clk";
power-domains = <&pd IMX_SC_R_I2C_4>;
};
i2c4: i2c@5a840000 {
reg = <0x5a840000 0x4000>;
interrupts = <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&gic>;
clocks = <&i2c4_lpcg 0>,
<&i2c4_lpcg 1>;
clock-names = "per", "ipg";
assigned-clocks = <&clk IMX_SC_R_I2C_4 IMX_SC_PM_CLK_PER>;
assigned-clock-rates = <24000000>;
power-domains = <&pd IMX_SC_R_I2C_4>;
status = "disabled";
};
With the sections added in imx8-ss-dma.dtsi the DTB would now compile, but i2cdetect -l does Not return: 2c-6 i2c 5a840000.i2c
What am I missing?