i.MX7 and i.MX8M MIPI Phy Voltage Mismatch in shared driver

cancel
Showing results for 
Search instead for 
Did you mean: 

i.MX7 and i.MX8M MIPI Phy Voltage Mismatch in shared driver

157 Views
jxb4256
Contributor II

The i.MX8M Mini CSI interface is defined as follows in the imx8mm.dtsi from NXP:

 

mipi_csi_1: mipi_csi@32e30000 {
				compatible = "fsl,imx8mm-mipi-csi";
				reg = <0x32e30000 0x1000>;
				interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
				clock-frequency = <333000000>;
				clocks = <&clk IMX8MM_CLK_CSI1_CORE>,
					<&clk IMX8MM_CLK_CSI1_PHY_REF>,
					<&clk IMX8MM_CLK_DISP_AXI_ROOT>,
					<&clk IMX8MM_CLK_DISP_APB_ROOT>;
				clock-names = "mipi_clk", "phy_clk", "disp_axi", "disp_apb";
				bus-width = <4>;
				power-domains = <&mipi_pd>;
				status = "disabled";
			};

 

This appears to load this driver: mxc_mipi_csi.c

I noticed that the following message appears in the dmesg logs, which I'd like to resolve:

 

mxc_mipi-csi 32e30000.mipi_csi: supply mipi-phy not found, using dummy regulator

 

So, I figured I should specify the the actual MIPI phy supply by defining the following additional line in the parent device tree file for this node:

 

mipi-phy-supply = <&reg_ldo4>;

 

LDO4 is provided by the PCA9450 PMIC, and is always-on, and is locked to 0.9V Max/Min because that is the voltage that the i.MX8MM wants for this rail.

The driver, however (mxc_mipi_csi.c), appears to have been written for the i.MX7, which wants a voltage of 1.0V for the MIPI Phy. Thus, the following lines can be found in that driver file:

 

static int mipi_csis_phy_init(struct csi_state *state)
{
	int ret;
	state->mipi_phy_regulator = devm_regulator_get(state->dev, "mipi-phy");
	ret = regulator_set_voltage(state->mipi_phy_regulator, 1000000, 1000000);
	return ret;
}

 

This (thankfully) fails because I have specified a min/max of 0.9V on the pmic LDO4 device tree node with this error:

 

LDO4: voltage operation not allowed

 

 

So, given all the above, I have a few questions:

It seems clearly wrong to point the imx8mm csi node at the imx7 driver, or at least an unmodified version of the imx7 driver due to the voltage requirement mismatch between these two chips, but this is how it appears to work in the sample implementations. The voltage difference is "solved" by not specifying the supply, but this is a hacky work-around in my opinion that results in kernel warnings. Can you explain how compatible = "fsl,imx8mm-mipi-csi"; resolves to mxc_mipi_csi.c? Where is that relationship defined such that this is the driver that gets loaded? If I know this, I could create an alternative driver file that specifies voltage correctly.

It seems like the mxc_mipi_csi.c file could be updated to change the specified voltage based on which processor type is in use, but I am not certain of the best way to do this, as this is a little beyond my experience. Is this something that NXP would do? Or would you direct me in the proper way to do this?

Alternatively, it seems like another driver file could be made that is a copy of mxc_mipi_csi.c but tweaked for the imx8m (namely by changing this voltage from 1.0V to 0.9V).

Or, another parameter could be added to specify the supply voltage - it could default to 1.0V if not specified so as to not break backwards compatibility with imx7 devices, but specifying it would overwrite the voltage that the driver tries to apply.

So, what is the right option? Or do you think there is something else that I should be doing entirely? Or maybe I'm misinterpreting the problem entirely! Please let me know.

Labels (1)
0 Kudos
0 Replies