IMX6Q Device Tree Binding for ADV7343 Encoder

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

IMX6Q Device Tree Binding for ADV7343 Encoder

ソリューションへジャンプ
31,067件の閲覧回数
tengri
Contributor IV

Hello all,

We intend to use ADV7343 video encoder with IMX6Q (specifically IMX6Q Sabrelite) parallel RGB interface (DISP_DAT). I need to figure out few things on device tree binding and how to adapt it to this encoder. I am using BD Linux Kernel : boundary-imx_3.14.52_1.1.0_ga and the corresponding dts file has the notations of for adv7180 device :-

pinctrl_i2c3: i2c3grp {
fsl,pins = <
MX6QDL_PAD_GPIO_5__I2C3_SCL 0x4001b8b1
MX6QDL_PAD_GPIO_16__I2C3_SDA 0x4001b8b1
#define GPIRQ_I2C3_J7 <&gpio1 9 IRQ_TYPE_EDGE_FALLING>
#define GP_I2C3_J7 <&gpio1 9 GPIO_ACTIVE_LOW>
MX6QDL_PAD_GPIO_9__GPIO1_IO09 0x1b0b0 /* I2C3 J7 interrupt */
>;
};

pinctrl_i2c3_adv7180_gpios: i2c3-adv7180_gpiosgrp {

fsl,pins = <
/* No data enable pin, make sure it is not selected */
MX6QDL_PAD_EIM_DA10__GPIO3_IO10 0x0b0b1
#define GP_ADV7180_PWN <&gpio3 13 GPIO_ACTIVE_LOW>
MX6QDL_PAD_EIM_DA13__GPIO3_IO13 0x0b0b0
#define GP_ADV7180_RESET <&gpio3 14 GPIO_ACTIVE_LOW>
MX6QDL_PAD_EIM_DA14__GPIO3_IO14 0x030b0
#define GPIRQ_ADV7180 <&gpio5 0 IRQ_TYPE_LEVEL_LOW>
MX6QDL_PAD_EIM_WAIT__GPIO5_IO00 0x1b0b0
>;
};

Can some one explain why we have two such nodes for this chip ? Has anyone done this for adv7343 chip ? 

Thanks

ラベル(4)
1 解決策
29,096件の閲覧回数
qiang_li-mpu_se
NXP Employee
NXP Employee

Hi Anuradha Ranasinghe, if you just reference to this media/i2c/adv7343.c driver, it can't combine with the IPU hardware, so there is no real display output from IMX6 to adv7343. You should reference to the mxcfb_sii902x.c, it is more close to your case.

I don't have the mxcfb_adv739x.c code for 3.14.52 kernel, and this driver is for BT656 interface, it is more complicated on IMX6 IPU side.

In another way, you can just use the current mxc_lcdif.c driver and add your display mode into it, such as 1280*720, then set video mode in boot command as followed, after booted, just config the adv7343 with I2C initialization codes. 

video=mxcfb0:dev=lcd, LCD-720P60,if=RGB24,bpp=32

  {

         /* 1280x720p @ 60 Hz , pixel clk @ 74.25MHz */

         "LCD-720P60", 60, 1280, 720, 13468, 220, 110, 20, 5, 40, 5,

         FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,

         FB_VMODE_NONINTERLACED,

         0,},

元の投稿で解決策を見る

29 返答(返信)
2,435件の閲覧回数
tengri
Contributor IV

I'm referring to this driver :

https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.14.52_1.1.0_ga/drivers/media/i2c/a...

And I noticed this driver has enumerated a /dev/video16 and with command v4l2-ctl -d /dev/video16 -all, I am receiving following output in the terminal :

Driver Info (not using libv4l2):
   Driver name : mxc_vout
   Card type : DISP4 BG
   Bus info :
   Driver version: 3.14.52
   Capabilities : 0x04000002
   Video Output
   Streaming
Format Video Output:
   Width/Height : 320/240
   Pixel Format : ''
   Field : Any
   Bytes per Line: 0
   Size Image : 76800
   Colorspace : Unknown (00000000)
Crop Capability Video Output:
   Bounds : Left 0, Top 0, Width 1280, Height 720
   Default : Left 0, Top 0, Width 1280, Height 720
   Pixel Aspect: 0/0
   horizontal_flip (bool) : default=0 value=0
   vertical_flip (bool) : default=0 value=0
   rotate (int) : min=0 max=270 step=90 default=0 value=0

and for cat /sys/class/graphics/fb0/modes I get various video format information as follows ->

U:1280x720p-60

S:640x480p-60

.

.

V:640x480p-60

What I do not understand is how to get this enumerated device work for encoder output and to get the cvbs signal..... 

https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.14.52_1.1.0_ga/drivers/media/i2c/a...

0 件の賞賛
返信
29,097件の閲覧回数
qiang_li-mpu_se
NXP Employee
NXP Employee

Hi Anuradha Ranasinghe, if you just reference to this media/i2c/adv7343.c driver, it can't combine with the IPU hardware, so there is no real display output from IMX6 to adv7343. You should reference to the mxcfb_sii902x.c, it is more close to your case.

I don't have the mxcfb_adv739x.c code for 3.14.52 kernel, and this driver is for BT656 interface, it is more complicated on IMX6 IPU side.

In another way, you can just use the current mxc_lcdif.c driver and add your display mode into it, such as 1280*720, then set video mode in boot command as followed, after booted, just config the adv7343 with I2C initialization codes. 

video=mxcfb0:dev=lcd, LCD-720P60,if=RGB24,bpp=32

  {

         /* 1280x720p @ 60 Hz , pixel clk @ 74.25MHz */

         "LCD-720P60", 60, 1280, 720, 13468, 220, 110, 20, 5, 40, 5,

         FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,

         FB_VMODE_NONINTERLACED,

         0,},

1,774件の閲覧回数
tengri
Contributor IV

Dear Qiang_FSL, Well I thought about that too. So that this initialization code can be placed in our user application to set the encoder settings. But having a driver is genuine though. Thanks alot for your suggestions and support on this. I'll try writing the mxcfb driver for the encoder, Btw do we have other dependencies (files depend on FBs and IPUv3) of assigning mxc_frame buffers for the encoder ? And If I load the modified mxcfb_lcd code or (mxc_adv7343 which I write) and add it as an external driver module, would the driver work or should it be built with kernel ?

0 件の賞賛
返信
1,774件の閲覧回数
qiang_li-mpu_se
NXP Employee
NXP Employee

The module mode driver of mxc_adv7343 is OK too.

1,774件の閲覧回数
tengri
Contributor IV

Qiang_FSL‌ : Dear Qiang, I saw an excellent post you've made on cvbs output of imx6. Would you be able to give a hint on this ? Can we adapt adv739x for this encoder ?

0 件の賞賛
返信
1,774件の閲覧回数
qiang_li-mpu_se
NXP Employee
NXP Employee

Hi Anuradha Ranasinghe, the adv7343 can work in VSYNC/HSYNC mode, so you can reference to mxc_lcdif.c to create a new fb driver.

Here is an example, IMX6 LCDIF output VSYNC/HSYNC display data to SII902x chip, which will convert the parallel LCD input to HDMI output.

https://community.nxp.com/docs/DOC-329734

1,774件の閲覧回数
tengri
Contributor IV

Hi,

Thanks for your input Qiang_FSL‌, I think you had used similar routines in mxcfb_adv739x.c as well. And the both sources are really helpful at this point. But I have to figure out one thing : the available linux driver for adv7343.c has only v4l2 routines (no frame buffer usage) for v4l2-subdev, so does this enumerate the encoder as a video device ? I'm trying to understand how this driver supposes to forward encoder calls. Particularly for my application is this driver usable ?

Thank you all

0 件の賞賛
返信
1,774件の閲覧回数
tengri
Contributor IV

Hi Igor and All, 

Thanks for your reply. Well I just put the above code to get the DTS notation cleared. I think I have figured out the pinctrl function and how to make an entry for ADV7343 in dts as an i2c node. So the modifications I made (in bold) in my dts (imx6q-sabrelite.dts) file and dtsi file (imx6qdl-sabrelite.dtsi which the dts includes) look like this :

IN IMX6QDL-SABRELITE.DTSI  ----->

pinctrl_i2c3_adv7180: i2c3-adv7180grp {
   /* parallel camera on CSI1, pins differ for iMX6Q/iMX6DL */
};


pinctrl_i2c3_adv7343: i2c3-adv7343grp {

};

aliases {
   backlight_lcd = &backlight_lcd;
   backlight_lvds = &backlight_lvds;
   fb_hdmi = &fb_hdmi;
   fb_lcd = &fb_lcd;
   fb_lvds = &fb_lvds;
   fb_adv7343 = &fb_adv7343; 
   lcd = &lcd;
   ldb = &ldb;
   mmc0 = &usdhc3;
   mmc1 = &usdhc4;
   mmc2 = &usdhc2;
   mxcfb0 = &fb_hdmi;
   mxcfb1 = &fb_lvds;
   mxcfb2 = &fb_lcd;
   mxcfb3 = &fb_adv7343; 
   pwm_lcd = &pwm1;
   pwm_lvds = &pwm4;
   t_lvds = &t_lvds;
};

fb_lcd: fb@2 {
   compatible = "fsl,mxc_sdc_fb";
   disp_dev = "lcd";
   interface_pix_fmt = "RGB666";
   default_bpp = <16>;
   int_clk = <0>;
   late_init = <0>;
   status = "disabled";
};

fb_adv7343: fb@3 {
   compatible = "fsl,mxc_sdc_fb";
   disp_dev = "adv7343";
   interface_pix_fmt = "RGB24";
   default_bpp = <32>;
   int_clk = <0>;
   late_init = <0>;
   status = "okay";
};

IN IMX6Q-SABRELITE.DTS  ----->

&pinctrl_i2c3_adv7343 { 
   fsl,pins = <
    MX6QDL_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK 0x10
   MX6QDL_PAD_DI0_PIN15__IPU1_DI0_PIN15 0x10
   MX6QDL_PAD_DI0_PIN2__IPU1_DI0_PIN02 0x10
   MX6QDL_PAD_DI0_PIN3__IPU1_DI0_PIN03 0x10
   MX6QDL_PAD_DISP0_DAT0__IPU1_DISP0_DATA00 0x10
   MX6QDL_PAD_DISP0_DAT1__IPU1_DISP0_DATA01 0x10
   MX6QDL_PAD_DISP0_DAT2__IPU1_DISP0_DATA02 0x10
   MX6QDL_PAD_DISP0_DAT3__IPU1_DISP0_DATA03 0x10
   MX6QDL_PAD_DISP0_DAT4__IPU1_DISP0_DATA04 0x10
   MX6QDL_PAD_DISP0_DAT5__IPU1_DISP0_DATA05 0x10
   MX6QDL_PAD_DISP0_DAT6__IPU1_DISP0_DATA06 0x10
   MX6QDL_PAD_DISP0_DAT7__IPU1_DISP0_DATA07 0x10
   MX6QDL_PAD_DISP0_DAT8__IPU1_DISP0_DATA08 0x10
   MX6QDL_PAD_DISP0_DAT9__IPU1_DISP0_DATA09 0x10
   MX6QDL_PAD_DISP0_DAT10__IPU1_DISP0_DATA10 0x10
   MX6QDL_PAD_DISP0_DAT11__IPU1_DISP0_DATA11 0x10
   MX6QDL_PAD_DISP0_DAT12__IPU1_DISP0_DATA12 0x10
   MX6QDL_PAD_DISP0_DAT13__IPU1_DISP0_DATA13 0x10
   MX6QDL_PAD_DISP0_DAT14__IPU1_DISP0_DATA14 0x10
   MX6QDL_PAD_DISP0_DAT15__IPU1_DISP0_DATA15 0x10
   MX6QDL_PAD_DISP0_DAT16__IPU1_DISP0_DATA16 0x10
   MX6QDL_PAD_DISP0_DAT17__IPU1_DISP0_DATA17 0x10
   MX6QDL_PAD_DISP0_DAT18__IPU1_DISP0_DATA18 0x10
   MX6QDL_PAD_DISP0_DAT19__IPU1_DISP0_DATA19 0x10
   MX6QDL_PAD_DISP0_DAT20__IPU1_DISP0_DATA20 0x10
   MX6QDL_PAD_DISP0_DAT21__IPU1_DISP0_DATA21 0x10
   MX6QDL_PAD_DISP0_DAT22__IPU1_DISP0_DATA22 0x10
   MX6QDL_PAD_DISP0_DAT23__IPU1_DISP0_DATA23 0x10
   >;
};

&i2c3 {
   clock-frequency = <100000>;       
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_i2c3>;
   status = "okay";

   adv7343: adv7343@2D {               //0x2D is I2C address of encoder
         compatible = "adv,adv7343";
         reg = <0x2D>;
         pinctrl-names = "default";
         pinctrl-0 = <&pinctrl_i2c3_adv7343>;
         DOVDD-supply = <&reg_3p3v>; /* 3.3v */
         AVDD-supply = <&reg_3p3v>; /* 3.3v */
         DVDD-supply = <&reg_1p8v>; /* 1.8v */
         PVDD-supply = <&reg_1p8v>; /* 1.8v */
         ipu_id = <0>;
         disp_id = <0>;
         default_ifmt = "RGB24";
         status = "okay";
      };
};


&fb_adv7343 { 
     status = "okay";
};

This was written assuming that the Parallel RGB to encoder behaves in the same way as a display device (but i am not sure whether this binding is correct). Anyway I am still unable to get the output available. I installed the adv7343 driver as an external module in imx6 and the module is visible under lsmod. Before installing the driver I was also able to communicate to the encoder through raw IMX6 I2C data, so the i2c address seems to be correct. And when the driver module is loaded, the i2c bus gets busy and my assumption is the imx6 is trying to communicate with encoder through the driver. Another thing I am not certain is how to use the fbs (frame buffers I guess) and mxcfbs with this encoder. Any hints on this ?  

0 件の賞賛
返信
1,774件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi Anuradha

as adv7343 chip is used instead LCD (not as adv7180 which is sensor),

please check BD blog for various LCDs connections:

https://boundarydevices.com/configuring-i-mx6-machines-different-screens-nitrogen6x-sabre-lite/ 

so one will have to adapt resolutions and timings for ADV7343.

For dts customizations one can look at

http://boundarydevices.com/mx6-device-tree-customization/

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------