mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: gianluca <gianlucarenzi@eurekelettronica.it>
To: barebox@lists.infradead.org
Subject: Re: Using LVDS in a iMX6Q/D from Barebox
Date: Wed, 22 Feb 2017 10:05:08 +0100	[thread overview]
Message-ID: <1436340e-ad34-f6e2-94e8-33885934fb92@eurekelettronica.it> (raw)
In-Reply-To: <75ff7d5a-8952-590f-c6b4-9fc3d4c17753@eurekelettronica.it>

>>>
>>>>             /* DISPLAY 1280x800 AMPIRE AM1280800N3TZ */
>>>>             am128080n3tz: am1280800n3tz {
>>>>                 clock-frequency = <71000000>;
>>>>                 hactive = <1280>;
>>>>                 vactive = <800>;
>>>>                 hback-porch = <50>;
>>>>                 hfront-porch = <50>;
>>>>                 vback-porch = <5>;
>>>>                 vfront-porch = <5>;
>>>>                 hsync-len = <60>;
>>>>                 vsync-len = <13>;
>>>>                 hsync-active = <0>;
>>>>                 vsync-active = <0>;
>>>>                 de-active = <1>;
>>>>                 pixelclk-active = <0>;
>>>>             };
>>>>             /* DISPLAY 1024x600 AMPIRE AM-1024600LTM LVDS */
>>>>             am1024600l: am1024600l {
>>>>                 clock-frequency = <51200000>;
>>>>                 hactive = <1024>;
>>>>                 vactive = <600>;
>>>>                 hback-porch = <0>;
>>>>                 hfront-porch = <320>;
>>>>                 vback-porch = <0>;
>>>>                 vfront-porch = <35>;
>>>>                 hsync-len = <1>;
>>>>                 vsync-len = <1>;
>>>>                 hsync-active = <0>;
>>>>                 vsync-active = <0>;
>>>>                 de-active = <1>;
>>>>                 pixelclk-active = <0>;
>>>>             };
>>>>             /* DISPLAY 800x480 */
>>>>             ph800480t013: ph800480t013 {
>>>>                 clock-frequency = <33300000>;
>>>>                 hactive = <800>;
>>>>                 vactive = <480>;
>>>>                 hback-porch = <46>;
>>>>                 hfront-porch = <210>;
>>>>                 vback-porch = <23>;
>>>>                 vfront-porch = <22>;
>>>>                 hsync-len = <1>;
>>>>                 vsync-len = <1>;
>>>>                 hsync-active = <0>;
>>>>                 vsync-active = <0>;
>>>>                 de-active = <1>;
>>>>                 pixelclk-active = <0>;
>>>>             };
>>>>         };
>>>>
>>>>         port@4 {
>>>>             reg = <4>;
>>>>             lvds0_out: endpoint {
>>>>                 remote-endpoint = <&in_lvds0>;
>>>>             };
>>>>         };
>>>>
>>>>     };
>>>> };
>>>

> Anyway, now I am doing the same stuff for compatibile property of the
> panel, because Linux wants to have a timing hardcoded in the
> panel-simple instead of getting them from the timing section of the
> device-tree.
>
> This is a very lack of feature to me. But now, it is quicker to use the
> bootloader to compile the correctness of the compatible property to a
> almost-identical-timings found in the panel-simple.c...
>
> The other way is to add a edid chip (@ 0x50) for every panel I add, so
> to let the EDID stuff to discover what is connected or not to the lvds
> board.
>
> This issue can not simply solved in this board, because I do have an
> internal eeprom at address 0x50, but it can not be usable for EDID stuff.
>
> So I have two options:
>
> 1- let the imx-ldb.c code in the kernel to probe (simple-panel and edid)
> and *add* a way to parse the device-tree for adding mode timing property
> using the display-timing stuff. (this means kernel patch)
>
> 2- look for a common timings from an existing displays in simple-panel.c
> and pass them to the compatibile property of the panel in the
> device-tree via bootloader.
>
> The step no.2 is the quickest to me. But the ugliest too. ;-)
>
> Any hint?
> Regards,


Looking at the parallel-display.c (drivers/gpu/drm/imx) in the function 
imx_pd_connector_get_modes() there are 3 ways of defining the 
display-timing:

> 	struct imx_parallel_display *imxpd = con_to_imxpd(connector);
> 	struct device_node *np = imxpd->dev->of_node;
> 	int num_modes = 0;
>

1st mode: getting mode from panel compatibile string, i.e. like having:
	compatible = "innolux,g101ice_l01", "simple-panel";
in the device-tree.


> 	if (imxpd->panel && imxpd->panel->funcs &&
> 	    imxpd->panel->funcs->get_modes) {
> 		num_modes = imxpd->panel->funcs->get_modes(imxpd->panel);
> 		if (num_modes > 0)
> 			return num_modes;
> 	}
>

2nd mode: having a edid eeprom somewhere connected to the parallel 
display on i2c.


> 	if (imxpd->edid) {
> 		drm_mode_connector_update_edid_property(connector, imxpd->edid);
> 		num_modes = drm_add_edid_modes(connector, imxpd->edid);
> 	}
>

3rd mode: parsing the device-tree for a node with display mode of native 
mode property.

> 	if (np) {
> 		struct drm_display_mode *mode = drm_mode_create(connector->dev);
> 		int ret;
>
> 		if (!mode)
> 			return -EINVAL;
>
> 		ret = of_get_drm_display_mode(np, &imxpd->mode,
> 					      &imxpd->bus_flags,
> 					      OF_USE_NATIVE_MODE);
> 		if (ret)
> 			return ret;
>
> 		drm_mode_copy(mode, &imxpd->mode);
> 		mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
> 		drm_mode_probed_add(connector, mode);
> 		num_modes++;
> 	}
>
> 	return num_modes;


The 3rd option lacks in the imx-ldb.c device drivers.

If added this could be a simple way of using the correct timings in the 
device-tree to pass to panel in ldb device driver.

Any comment?
-- 
Eurek s.r.l.                          |
Electronic Engineering                | http://www.eurek.it
via Celletta 8/B, 40026 Imola, Italy  | Phone: +39-(0)542-609120
p.iva 00690621206 - c.f. 04020030377  | Fax:   +39-(0)542-609212

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2017-02-22  9:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-09 14:37 gianluca
2017-02-10  7:35 ` Sascha Hauer
2017-02-14 10:32   ` gianluca
2017-02-14 10:59     ` gianluca
2017-02-15 10:07       ` gianluca
2017-02-15 11:51     ` Sascha Hauer
2017-02-15 14:34       ` gianluca
2017-02-16  7:28         ` Sascha Hauer
2017-02-16  9:07           ` gianluca
2017-02-16 14:43           ` gianluca
2017-02-16 15:50             ` Lucas Stach
2017-02-17 15:38               ` gianluca
2017-02-22  8:00                 ` Sascha Hauer
2017-02-22  8:26                   ` gianluca
2017-02-22  9:05                     ` gianluca [this message]
2017-02-22  9:40                     ` Sascha Hauer
2017-02-23 12:10                       ` gianluca

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1436340e-ad34-f6e2-94e8-33885934fb92@eurekelettronica.it \
    --to=gianlucarenzi@eurekelettronica.it \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox