RK3568 XS9922调试
内核的DTS配置
&i2c2 {
clock-frequency = <200000>;
xs9922: xs9922@30 {
status = "okay";
compatible = "xs9922";
reg = <0x30>;
clocks = <&cru 214>;
clock-names = "xvclk";
power-domains = <&power 8>;
pinctrl-names = "default";
pinctrl-0 = <&cif_clk>;
reset-gpios = <&gpio3 RK_PD4 GPIO_ACTIVE_HIGH>;
power-gpios = <&gpio0 RK_PB0 GPIO_ACTIVE_HIGH>;
camera-gpios = <&gpio4 18 0>;
rockchip,camera-module-index = <1>;
rockchip,camera-module-name = "xs9922";
rockchip,camera-module-lens-name = "xs9922";
port {
xs9922_ucam_out: endpoint {
remote-endpoint = <&xs9922_mipi_in_ucam>;
data-lanes = <1 2 3 4>;
};
};
};
};
&combphy0_us {
status = "okay";
};
&combphy1_usq {
status = "okay";
};
&combphy2_psq {
status = "okay";
};
&csi2_dphy_hw {
status = "okay";
};
&csi2_dphy0 {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
xs9922_mipi_in_ucam: endpoint@1 {
reg = <1>;
remote-endpoint = <&xs9922_ucam_out>;
data-lanes = <1 2 3 4>;
};
};
port@1 {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
xs9922_csi2dphy_out: endpoint@1 {
reg = <1>;
remote-endpoint = <&xs9922_mipi_csi2_input>;
data-lanes = <1 2 3 4>;
};
};
};
};
&mipi_csi2 {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
xs9922_mipi_csi2_input: endpoint@1 {
reg = <1>;
remote-endpoint = <&xs9922_csi2dphy_out>;
data-lanes = <1 2 3 4>;
};
};
port@1 {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
mipi_csi2_output: endpoint@0 {
reg = <0>;
remote-endpoint = <&cif_mipi_in>;
data-lanes = <1 2 3 4>;
};
};
};
};
&rkcif_mipi_lvds {
status = "okay";
port {
cif_mipi_in: endpoint {
remote-endpoint = <&mipi_csi2_output>;
data-lanes = <1 2 3 4>;
};
};
};
&reserved_memory {
cif_reserved: vicap@80000000 {
compatible = "shared-dma-pool";
inactive;
reusable;
reg = <0x0 0x40000000 0x0 0x10000000>; //1G ~ 1G+256MB
//reg = <0x0 0x60000000 0x0 0x8000000>; //1.5G ~ 1.5G+128MB
};
};
&rkcif {
status = "okay";
memory-region = <&cif_reserved>;
};
&rkcif_mmu {
status = "okay";
};
&rkisp_vir0 {
status = "disabled";
port {
#address-cells = <1>;
#size-cells = <0>;
isp0_vir0: endpoint@0 {
reg = <0>;
remote-endpoint = <&mipi_lvds_sditf>;
};
};
};
&rkcif_mipi_lvds_sditf {
status = "disabled";
port {
mipi_lvds_sditf: endpoint {
remote-endpoint = <&isp0_vir0>;
};
};
};
&rkisp {
status = "disabled";
};
&rkisp_mmu {
status = "disabled";
};
1. xs9922 是I2c设备,所以第一步确认i2c通信是否正常
可以通过回读chip id log:
chip_id : 0x9922
说明i2c 通信正常
xs9922_read_reg(client, NI_40F0_DEVICE_ID_1, XS9922_REG_VALUE_08BIT, &chip_id1);
xs9922_read_reg(client, NI_40F1_DEVICE_ID_0, XS9922_REG_VALUE_08BIT, &chip_id0);
[ 1.033027] xs9922 2-0030: chip_id : 0x9922
[ 1.033227] input: xs9922_input_event as /devices/platform/fe5b0000.i2c/i2c-2/2-0030/input/input1
[ 1.033612] xs9922 2-0030: xs9922_probe run here
[ 1.033614] __xs9922_init in \x0a=======================================================\x0a\x0a
[ 1.034063] xs9922_write_reg xs9922 write reg(0x4200) : 0x3f!
[ 1.034075] xs9922_write_array xs9922 write reg(0x4200) : 0x3f!
[ 1.034445] iommu: Adding device fdfe0000.rkcif to group 7
[ 1.034482] rkcifhw fdfe0000.rkcif: Linked as a consumer to fdfe0800.iommu
[ 1.034512] xs9922_wri