linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: agust@denx.de (Anatolij Gustschin)
To: linux-arm-kernel@lists.infradead.org
Subject: How to select between different display timings?
Date: Fri, 14 Feb 2014 21:06:35 +0100	[thread overview]
Message-ID: <20140214210635.1561d4b6@crub> (raw)
In-Reply-To: <52FE53DD.7040102@gmail.com>

On Fri, 14 Feb 2014 18:35:25 +0100
Dirk Behme <dirk.behme@gmail.com> wrote:
...
> > You need to set the property 'native-mode' to the phandle of the
> > display-timings entry like marked above.
> 
> Hmm, let's see if we talk about the same thing ;) Let me rephrase my 
> questions:
> 
> Using above example and booting a system with the resulting .dtb, 
> timing5 is selected at boot time, correct?

yes.

> Assuming I want to use timing1 instead: who would set when the 
> property 'native-mode' to &timing1?
> 
> Can the switch to
> 
> native-mode = <&timing1>;
> 
> only be done at compile time of the dts -> dtb? Or can this be done at 
> boot/kernel run time, too?

it could be done in U-Boot before booting the kernel. You can load
the dtb and patch the property as needed, i.e.:

U-Boot > tftp 107f0000 ${fdtfile}
U-Boot > fdt addr 107f0000
U-Boot > fdt pri /soc/aips-bus at 02000000/ldb at 020e0008/lvds-channel at 0/display-timings
display-timings {
	native-mode = <0x0000000d>;
	hsd100pxn1 {
		clock-frequency = <0x03dfd240>;
		hactive = <0x00000400>;
		vactive = <0x00000300>;
		hback-porch = <0x000000dc>;
		hfront-porch = <0x00000028>;
		vback-porch = <0x00000015>;
		vfront-porch = <0x00000007>;
		hsync-len = <0x0000003c>;
		vsync-len = <0x0000000a>;
		linux,phandle = <0x0000000d>;
		phandle = <0x0000000d>;
	};
	wvga {
		clock-frequency = <0x019bfcc0>;
		hactive = <0x00000320>;
		vactive = <0x000001e0>;
		hback-porch = <0x00000028>;
		hfront-porch = <0x0000003c>;
		vback-porch = <0x0000000a>;
		vfront-porch = <0x0000000a>;
		hsync-len = <0x00000014>;
		vsync-len = <0x0000000a>;
		hsync-active = <0x00000000>;
		vsync-active = <0x00000000>;
		de-active = <0x00000001>;
		pixelclk-active = <0x00000000>;
		linux,phandle = <0x0000000e>;
		phandle = <0x0000000e>;
	};
};

U-Boot > fdt set /soc/aips-bus at 02000000/ldb at 020e0008/lvds-channel at 0/display-timings native-mode <0x0000000e>

U-Boot > fdt list /soc/aips-bus at 02000000/ldb at 020e0008/lvds-channel at 0/display-timings/          
display-timings {
	native-mode = <0x0000000e>;
	hsd100pxn1 {
	};
	wvga {
	};
};

native-mode is referencing second timing node now.

But note that dtc could eliminate the phandles in the nodes if
these are not referenced in dts. To avoid this, the nodes could
contain a self-reference:

 timing1: wvga {
   ...
   linux,phandle = <&timing1>;
 };

> In the end, I'm looking for a way to have several timings like above 
> in the device tree, and select one at kernel boot time based on the 
> display detected. Would this be possible?

You could add a function in U-Boot to detect the display and
update the dtb before booting. This function can be called
before booting if you define CONFIG_OF_BOARD_SETUP in the
U-Boot config file for your board and provide ft_board_setup()
in your board code.

HTH,

Anatolij

  reply	other threads:[~2014-02-14 20:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-08 12:51 [PATCH 0/10] ARM: mxs: update board support for TX28 Lothar Waßmann
2013-08-08 12:51 ` [PATCH 1/8] ARM: dts: mxs: whitespace cleanup Lothar Waßmann
2013-08-08 12:51 ` [PATCH 2/8] ARM: dts: mxs: add labels to most nodes for easier reference Lothar Waßmann
2013-08-08 12:51 ` [PATCH 3/8] ARM: dts: mxs: add another set of saif0_pins (without MCLK) Lothar Waßmann
2013-08-08 12:51 ` [PATCH 4/8] ARM: dts: mxs: add pin config for SSP3 interface Lothar Waßmann
2013-08-08 12:51 ` [PATCH 5/8] ARM: dts: mxs: add pin config for LCD sync and clock pins Lothar Waßmann
2013-08-12  9:16   ` Shawn Guo
2013-08-08 12:51 ` [PATCH 6/8] ARM: dts: mxs: add pin config options for usbphy pins Lothar Waßmann
2013-08-12  9:17   ` Shawn Guo
2013-08-08 12:51 ` [PATCH 7/8] ARM: dts: tx28: restructure and update DTS file Lothar Waßmann
2014-02-14 13:50   ` How to select between different display timings? (was: [PATCH 7/8] ARM: dts: tx28: restructure and update DTS file) Dirk Behme
2014-02-14 14:02     ` Lothar Waßmann
2014-02-14 17:35       ` How to select between different display timings? Dirk Behme
2014-02-14 20:06         ` Anatolij Gustschin [this message]
2013-08-08 12:51 ` [PATCH 8/8] ARM: mxs: Add TX28 defconfigs Lothar Waßmann
2013-08-12 10:58   ` Shawn Guo

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=20140214210635.1561d4b6@crub \
    --to=agust@denx.de \
    --cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).