imx6q port lvds lcd in linux-4.1.15

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx6q port lvds lcd in linux-4.1.15

8,351 Views
fulinux
Contributor IV

Dear Community,

I'm in trouble,The question is as follows:

i added and modified nodes in arch/arm/boot/dts/imx6qdl-sabresd.dtsi:

        mxcfb1: fb@0 {

                compatible = "fsl,mxc_sdc_fb";

                disp_dev = "ldb";

                /*interface_pix_fmt = "RGB666";*/

                interface_pix_fmt = "RGB24";

                mode_str ="LDB-1080P60";

                default_bpp = <32>;

                int_clk = <0>;

                late_init = <0>;

               pwn-gpios = <&gpio1 2 1>;

               en-gpios = <&gpio4 5 GPIO_ACTIVE_LOW>;

                status = "okay";

        };

...

&ldb {

        status = "okay";

        lvds-channel@0 {

                fsl,data-mapping = "spwg";

                fsl,data-width = <18>;

                status = "okay";

                display-timings {

                        native-mode = <&timing0>;

                        timing0: hsd100pxn1 {

                                clock-frequency = <83000000>;

                                hactive = <1920>;

                                vactive = <1080>;

                                hback-porch = <80>;

                                hfront-porch = <68>;

                                vback-porch = <15>;

                                vfront-porch = <15>;

                                hsync-len = <12>;

                                vsync-len = <8>;

                        };

                };

        };

        lvds-channel@1 {

                              ...(omitted)

                        };

                };

        };

};

and cat arch/arm/boot/dts/imx6q-sabresd.dts

&ldb {

        lvds-channel@0 {

                crtc = "ipu1-di0";//ipu2-di0 is it mind about this?

        };

        lvds-channel@1 {

                crtc = "ipu1-di1";//ipu2-di1

        };

};

&mxcfb1 {

        status = "okay";

};

&mxcfb2 {

        status = "disabled"; //okay

};

then the kernel log is:

....

MIPI DSI driver module loaded

mxc_sdc_fb fb@0: registered mxc display driver ldb

imx-ipuv3 2400000.ipu: IPU DMFC DP HIGH RESOLUTION: 1(0,1), 5B(2~5), 5F(6,7)

...

it's black on the screen, no penguins logo. i thank is power sequence problem. my old kernel is linux-3.0, it is code have this in arch/arm/mach-mx6/board-mx6q_sabresd.c:

#define SABRESD_LCD_POWER_ON    IMX_GPIO_NR(1, 2)

#define SABRESD_LCD_BKLIGHT_PWN IMX_GPIO_NR(1, 7)

#define SABRESD_LCD_EN      IMX_GPIO_NR(4, 5)

static void lvdsPower(void) {

    gpio_request(SABRESD_LCD_POWER_ON, "lcd_power_on");

    gpio_direction_output(SABRESD_LCD_POWER_ON, 1);

    msleep(10);

    gpio_set_value(SABRESD_LCD_POWER_ON, 0);

    msleep(10);

    gpio_set_value(SABRESD_LCD_POWER_ON, 1);

   

    gpio_request(SABRESD_LCD_EN, "lcd_en");

    gpio_direction_output(SABRESD_LCD_EN, 1);

    gpio_set_value(SABRESD_LCD_EN, 1);

    gpio_export(SABRESD_LCD_EN,false);

    //gpio_request(PWM1_OUT, "pwm1_out");

    //gpio_direction_output(PWM1_OUT, 1);

    //gpio_set_value(PWM1_OUT, 1);

    gpio_request(SABRESD_LCD_BKLIGHT_PWN, "lcd_bl_on");

    gpio_direction_output(SABRESD_LCD_BKLIGHT_PWN, 0);

    gpio_set_value(SABRESD_LCD_BKLIGHT_PWN, 0);

}

static void __init mx6_sabresd_board_init(void)

{

...

     lvdsPower();

...

}

but i haven't seen any gpio sets of power sequence in dts file, our board have no Power management chip, where should i add gpios of power on and lcd en?

and i had used usdh0 for my sd card, so backlight_pwm:

        pinctrl_pwm1: pwm1grp {

            fsl,pins = <

               /*MX6QDL_PAD_SD1_DAT3__PWM1_OUT     0x1b0b1*/  i had commented out

            >;

        };

old code in linux-3.0:

    imx6q_add_mxc_pwm(0);

    imx6q_add_mxc_pwm(1);

    imx6q_add_mxc_pwm(2);

    imx6q_add_mxc_pwm(3);

    imx6q_add_mxc_pwm_backlight(0, &mx6_sabresd_pwm_backlight_data);

how to set fsl,pins of  pinctrl_pwm1?

My question is a bit of a mess, i am a new hand.

Looking forward to your reply!

thank you,

fulinux.

Labels (2)
6 Replies

2,172 Views
fulinux
Contributor IV

anybody can give me some advices?

need help?

0 Kudos

2,172 Views
igorpadykov
NXP Employee
NXP Employee

Hi fulinux

for 1080 resolution lvds lcd please look at split mode patch

imx6q and lvds.

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

2,172 Views
fulinux
Contributor IV

Dear igor,

i modify my board dts file to control three gpios output:

&iomuxc {

    pinctrl-names = "default";

    pinctrl-0 = <&pinctrl_hog>;

    pinctrl-1 = <&pinctrl_lcd_pwr>;

    status = "okay";

    imx6qdl-sabresd {

        pinctrl_hog: hoggrp {

            fsl,pins = <

                MX6QDL_PAD_GPIO_0__CCM_CLKO1    0x130b0

            >;

        };

       pinctrl_lcd_pwr: lcd-pwrgrp {

            fsl,pins = <

                MX6QDL_PAD_GPIO_2__GPIO1_IO02  0x1b0b1

                MX6QDL_PAD_GPIO_7__GPIO1_IO07  0x1b0b1

                MX6QDL_PAD_GPIO_19__GPIO4_IO05  0x1b0b1

            >;

        };

    backlight {

        compatible = "pwm-backlight";

        pwms = <&pwm1 0 50000>;

        brightness-levels = <0 4 8 16 32 64 128 255>;

        default-brightness-level = <7>;

        enable-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;

        power-supply = <&reg_lcd_pwr>;

        status = "okay";

    };

    regulators {

        compatible = "simple-bus";

        #address-cells = <1>;

        #size-cells = <0>;

        reg_lcd_pwr: regulator@0 {

            compatible = "regulator-fixed";

            reg = <0>;

            regulator-name = "LCD POWER";

            /*regulator-min-microvolt = <5000000>;

            regulator-max-microvolt = <5000000>;

            pwr-gpio = <&gpio1 2 GPIO_ACTIVE_LOW>;*/

            gpio = <&gpio4 5 GPIO_ACTIVE_HIGH>;

            /*regulator-boot-on;

            regulator-always-on;*/

        };

    };

i has modified "gpio = <&gpio4 5 GPIO_ACTIVE_HIGH>;" to "gpio = <&gpio4 5 GPIO_ACTIVE_LOW>;",but i test voltage of gpio4_5 output always high with 3.44V by oscilloscope.

is it wrong with my device tree configures?

need you reply!

thank you!

fulinux.

0 Kudos

2,172 Views
fulinux
Contributor IV

hi,this is kernel log:

....

MIPI DSI driver module loaded

MIPI DSI driver module loaded

ldb 2000000.aips-bus:ldb@020e0008: split mode

ldb 2000000.aips-bus:ldb@020e0008: split mode or dual mode, ignoring second output

mxc_sdc_fb fb@0: registered mxc display driver ldb

imx-ipuv3 2800000.ipu: IPU DMFC DP HIGH RESOLUTION: 1(0,1), 5B(2~5), 5F(6,7)

...

0 Kudos

2,172 Views
fulinux
Contributor IV

Dear igor,

this is my board dts file:

/dts-v1/;

#include "imx6q.dtsi"

#include <dt-bindings/gpio/gpio.h>

#include <dt-bindings/input/input.h>

/ {

    model = "Freescale i.MX6 Quad SABRE Smart Device Board";

    compatible = "fsl,imx6q-sabresd", "fsl,imx6q";

    aliases {

        mxcfb0 = &mxcfb1;

    };

    chosen {

        /*bootargs = "console=ttymxc0,115200";*/

        stdout-path = &uart1;

    };

    memory: memory {

        reg = <0x10000000 0x40000000>;

    };

    backlight {

                compatible = "pwm-backlight";

                pwms = <&pwm1 0 50000>;

                brightness-levels = <0 4 8 16 32 64 128 255>;

                default-brightness-level = <7>;

                enable-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;

                power-supply = <&reg_lcd_pwr>;

                status = "okay";

    };

    regulators {

        compatible = "simple-bus";

        #address-cells = <1>;

        #size-cells = <0>;

        reg_lcd_pwr: regulator@0 {

                        compatible = "regulator-fixed";

                        reg = <0>;

                        regulator-name = "LCD POWER";

                        /*regulator-min-microvolt = <5000000>;

                        regulator-max-microvolt = <5000000>;*/

                        pwr-gpio = <&gpio1 2 GPIO_ACTIVE_LOW>;

                        en-gpio = <&gpio4 5 GPIO_ACTIVE_HIGH>;

                        regulator-boot-on;

                        regulator-always-on;

        };

    };

    mxcfb1: fb@0 {

            compatible = "fsl,mxc_sdc_fb";

            disp_dev = "ldb";

            interface_pix_fmt = "RGB24";

            mode_str ="LDB-1080P60";

            default_bpp = <32>;

            int_clk = <0>;

            late_init = <0>;

            status = "okay";

    };

};

&pwm1 {

        pinctrl-names = "default";

        pinctrl-0 = <&pinctrl_pwm1>;

    status = "okay";

};

&uart1 {

        pinctrl-names = "default";

        pinctrl-0 = <&pinctrl_uart1>;

        status = "okay";

};

&usdhc1 {

        pinctrl-names = "default";

        pinctrl-0 = <&pinctrl_usdhc1>;

        bus-width = <8>;

        no-1-8-v;

        keep-power-in-suspend;

        enable-sdio-wakeup;

        status = "okay";

};

&ldb {

        status = "okay";

    split-mode;

        lvds-channel@0 {

                fsl,data-mapping = "spwg";

                fsl,data-width = <24>;

        crtc = "ipu2-di0";

                status = "okay";

                display-timings {

                        native-mode = <&timing0>;

                        timing0: hsd100pxn1 {

                                clock-frequency = <83000000>;

                                hactive = <1920>;

                                vactive = <1080>;

                                hback-porch = <80>;

                                hfront-porch = <68>;

                                vback-porch = <15>;

                                vfront-porch = <15>;

                                hsync-len = <12>;

                                vsync-len = <8>;

                        };

                };

        };

        lvds-channel@1 {

                fsl,data-mapping = "spwg";

                fsl,data-width = <24>;

        crtc = "ipu2-di1";

                primary;

                status = "okay";

                display-timings {

                        native-mode = <&timing1>;

                        timing1: hsd100pxn1 {

                                clock-frequency = <83000000>;

                                hactive = <1920>;

                                vactive = <1080>;

                                hback-porch = <80>;

                                hfront-porch = <68>;

                                vback-porch = <15>;

                                vfront-porch = <15>;

                                hsync-len = <12>;

                                vsync-len = <8>;

                        };

                };

        };

};

&iomuxc {

        pinctrl-names = "default";

        pinctrl-0 = <&pinctrl_hog>;

        imx6q-sabresd {

                pinctrl_hog: hoggrp {

                        fsl,pins = <

                        >;

                };

        pinctrl_lcd_pwr: lcd-pwrgrp {

            fsl,pins = <

            >;

        };

                pinctrl_pwm1: pwm1grp {

                        fsl,pins = <

                                /*MX6QDL_PAD_SD1_DAT3__PWM1_OUT         0x1b0b1*/

                /*MX6QDL_PAD_GPIO_9__PWM1_OUT     0x1b0b1*/

                        >;

                };

                pinctrl_uart1: uart1grp {

                        fsl,pins = <

                                MX6QDL_PAD_CSI0_DAT10__UART1_TX_DATA    0x1b0b1

                                MX6QDL_PAD_CSI0_DAT11__UART1_RX_DATA    0x1b0b1

                        >;

                };

                pinctrl_usdhc1: usdhc1grp {

                        fsl,pins = <

                                MX6QDL_PAD_SD1_CMD__SD1_CMD             0x17059

                                MX6QDL_PAD_SD1_CLK__SD1_CLK             0x10059

                                MX6QDL_PAD_SD1_DAT0__SD1_DATA0          0x17059

                                MX6QDL_PAD_SD1_DAT1__SD1_DATA1          0x17059

                                MX6QDL_PAD_SD1_DAT2__SD1_DATA2          0x17059

                                MX6QDL_PAD_SD1_DAT3__SD1_DATA3          0x17059

                                MX6QDL_PAD_NANDF_D0__SD1_DATA4          0x17059

                                MX6QDL_PAD_NANDF_D1__SD1_DATA5          0x17059

                                MX6QDL_PAD_NANDF_D2__SD1_DATA6          0x17059

                                MX6QDL_PAD_NANDF_D3__SD1_DATA7          0x17059

                        >;

                };

    };

};

my lcd always black, it is maybe wrong of the backlight power sequence, can you give me some suggest to my device tree configure.

Looking forward to your reply!

thank you,

fulinux.

0 Kudos

2,172 Views
fulinux
Contributor IV

thank you for you reply

0 Kudos