Dear All,
Currently, I'm using i.Mx8QxP based custom board.
There, I need to configure M4-i2c in A35 domain.
I'm able to configure and access M4-i2c from Linux Kernel. Both i2c read and write are working fine.
But I'm facing issue in accessing M4 i2c from u-boot.
We are getting below error with u-boot i2c utils.
> i2c probe
No I2C bus selected
> i2c bus
Bus -1: i2c@37230000
Please find the configuration done in u-boot dts file.
&intmux_cm40 {
status = "okay";
};
&pd_cm40_intmux {
early_power_on;
};
&i2c0_cm40 {
#address-cells = <1>;
#size-cells = <0>;
pinctrl-0 = <&pinctrl_i2c0>;
pinctrl-names = "default";
clock-frequency = <100000>;
status = "okay";
pca9535: pca9535e@21 {
reg = <0x21>;
};
};
pinctrl_i2c0: i2c0m40grp {
fsl,pins = <
SC_P_ADC_IN1_M40_I2C0_SDA 0x0600004c
SC_P_ADC_IN0_M40_I2C0_SCL 0x0600004c
>;
};
As this i2C is M4 dedicated i2c, I believe that M4 should be powered ON before access.
So I also added below code in board.c in board_early_init() function. (We have also tried in board_late_init() - But same result).
if (sc_pm_set_resource_power_mode(ipcHndl, SC_R_M4_0_PID0, SC_PM_PW_MODE_ON) != SC_ERR_NONE)
return 0;
if (sc_pm_set_resource_power_mode(ipcHndl, SC_R_M4_0_MU_1A, SC_PM_PW_MODE_ON) != SC_ERR_NONE)
return 0;
/* Power up M4 I2C */
if (sc_pm_set_resource_power_mode(ipcHndl, SC_R_M4_0_I2C, SC_PM_PW_MODE_ON) != SC_ERR_NONE)
return 0;
if (sc_pm_clock_enable(ipcHndl, SC_R_M4_0_I2C, SC_PM_CLK_PER, true, false) != SC_ERR_NONE)
return 0;
if (sc_pm_set_clock_rate(ipcHndl, SC_R_M4_0_I2C, SC_PM_CLK_PER, &src_rate) != SC_ERR_NONE)
return 0;
U-boot is able to identify and access lpi2c (if configured in dts); But facing issues in M4-i2c access.
Let us know if any specific sequence to be followed to access M4 i2C in u-boot.
Please guide me to move further.
Thank You.
Best Regards,
J.P.Raja