Hi all,
I know that we cannot use dual camera with MIPI-CSI as IMX8MM has only one virtual channel support. I want to use single virtual channel for two cameras. Two camera mipi lines are handled by multiplexer in hardware. So at a time only one camera will be active.
I will have only one camera entry in dts file. So theoretically processor will connect with single mipi-csi camera. I have made OV5640 and OV7251 camera modules as loadable kernel module. Both will operate on single lane mipi. I will keep same compatible field, same driver file name and compile them differently. So I will have two ex. "cam.ko" files with same compatible field but different driver code inside. I can rename few function names if needed.
Q.1) is this achievable?
I have tried loading loadable kernel module after kernel bootup. When I insert it manually it gets register with MIPI-CSI. While removing with "rmmod" it gives error as
"rmmod: ERROR: Module cam.ko is builtin"Q.2) How can we de-register / remove kernel module so that another kernel module can get inserted? Switching between two kernel with selection of multiplexer channel will be done by user application.
Thanks,
Ajita
#IMX8MM MIPI-CAMERA #LINUX
Hi @Chavira ,
I have successfully implemented single virtual channel for two cameras. Two camera MIPI lines are handled by multiplexer in hardware. So at a time only one camera will be active. DTS contains only one entry of camera as follow:
ov5640_mipi: ov5640@70 {
#compatible = "ovti,ov5640";
compatible = "ovti,ov5640_mipi";
reg = <0x70>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_csi_pwn>, <&pinctrl_csi_rst_ov7251>, <&pinctrl_csi_led>;
clocks = <&clk IMX8MM_CLK_CLKO1>;
#clock-names = "xclk";
clock-names = "csi_mclk";
assigned-clocks = <&clk IMX8MM_CLK_CLKO1>;
assigned-clock-parents = <&clk IMX8MM_CLK_24M>;
assigned-clock-rates = <24000000>;
csi_id = <0>;
//reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
rst-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
pwn-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
clock-frequency = <24000000>;
#csi_mclk = <24000000>;
mclk = <24000000>;
mclk_source = <0>;
port {
ov5640_mipi1_ep: endpoint {
remote-endpoint = <&ov5640_0_ep>;
clock-lanes = <0>;
data-lanes = <1>;
};
};
};
&mipi_csi_1 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
port {
ov5640_0_ep: endpoint@1 {
remote-endpoint = <&ov5640_mipi1_ep>;
data-lanes = <1>;
csis-hs-settle = <13>;
csis-clk-settle = <2>;
csis-wclk;
};
csi1_mipi_ep: endpoint@2 {
remote-endpoint = <&csi1_ep>;
};
};
};0x70 is I2C address of OV7251. Change OV5640's I2C address in it's probe function to 0x3C and In it's remove function again assign address back to 0x3C. Make reset changes according to dts in both files. Both OV5640 and OV7251 must have same reset, pwn and MIPI lanes common. :
Make "CONFIG_MODULE_FORCE_UNLOAD" flag enable in menuconfig and "CONFIG_MXC_CAMERA_OV5640_MIPI_V2" as m.
First compile code for OV5640. Keep generated "ov5640_camera_mipi_v2.ko" aside. Now Copy OV7251's driver code in OV5640's file. Keep compatible same as OV5640's compatible name. Rename generated "ov5640_camera_mipi_v2.ko" to "ov7251.ko". Copy these two kernel modules to IMX8MM.
To insert kernel module use "insmod
I know this is standard way but It works
Thanks,
Ajita
HI @ajita02!
Hi,
Mentioned link won't work as it is with respect to IMX8MP which has two MIPI-CSI interface. We have tried this link before posting this issue. Those mentioned files/controller is not present on IMX8MM. IMX8MM cannot register two endpoints.
Thanks,
Ajita
HI @ajita02!
Thank you for contacting NXP Support!
We don´t have documentation for that specific use case but you can take as a reference the next community post where we bring up dual Camera under single mipi csi using the iMX8MP with OV5640 + os08a20.
Best Regards!
Chavira
This is the only post that we have for the use case that you want to achieve.
Best regards!
Chavira