From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/5] fdt: add fdt_add_display_timings(..)
Date: Wed, 08 Jan 2014 11:53:39 +0100 [thread overview]
Message-ID: <52CD2E33.8000409@denx.de> (raw)
In-Reply-To: <1389165866-17509-3-git-send-email-christian.gmeiner@gmail.com>
Hi Christian,
On 08/01/2014 08:24, Christian Gmeiner wrote:
> This new function is used to set all display-timings
> properties based on fb_videomode.
>
> display-timings {
> timing0 {
> clock-frequency = <25000000>;
> hactive = <640>;
> vactive = <480>;
> hback-porch = <48>;
> hfront-porch = <16>;
> vback-porch = <31>;
> vfront-porch = <12>;
> hsync-len = <96>;
> vsync-len = <2>;
> };
> };
>
> Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
> ---
> common/fdt_support.c | 23 +++++++++++++++++++++++
> include/fdt_support.h | 3 +++
> 2 files changed, 26 insertions(+)
>
> diff --git a/common/fdt_support.c b/common/fdt_support.c
> index 4e32b02..cf81a4b 100644
> --- a/common/fdt_support.c
> +++ b/common/fdt_support.c
> @@ -11,6 +11,7 @@
> #include <stdio_dev.h>
> #include <linux/ctype.h>
> #include <linux/types.h>
> +#include <linux/fb.h>
> #include <asm/global_data.h>
> #include <libfdt.h>
> #include <fdt_support.h>
> @@ -1342,6 +1343,28 @@ err_size:
> #endif
>
> /*
> + * fdt_add_display_timings: add display-timings properties
> + *
> + * @fdt: ptr to device tree
> + * @noff: node to update
> + * @mode: ptr to b_videomode
> + */
> +void fdt_add_display_timings(void *fdt, int noff, struct fb_videomode *mode)
> +{
> + if (noff != -FDT_ERR_NOTFOUND) {
> + fdt_setprop_u32(fdt, noff, "clock-frequency", mode->pixclock);
> + fdt_setprop_u32(fdt, noff, "hactive", mode->xres);
> + fdt_setprop_u32(fdt, noff, "vactive", mode->yres);
> + fdt_setprop_u32(fdt, noff, "hback-porch", mode->left_margin);
> + fdt_setprop_u32(fdt, noff, "hfront-porch", mode->right_margin);
> + fdt_setprop_u32(fdt, noff, "vback-porch", mode->upper_margin);
> + fdt_setprop_u32(fdt, noff, "vfront-porch", mode->lower_margin);
> + fdt_setprop_u32(fdt, noff, "hsync-len", mode->hsync_len);
> + fdt_setprop_u32(fdt, noff, "vsync-len", mode->vsync_len);
> + }
> +}
> +
> +/*
> * Verify the physical address of device tree node for a given alias
> *
> * This function locates the device tree node of a given alias, and then
> diff --git a/include/fdt_support.h b/include/fdt_support.h
> index 9871e2f..1c54880 100644
> --- a/include/fdt_support.h
> +++ b/include/fdt_support.h
> @@ -82,6 +82,9 @@ int fdt_set_phandle(void *fdt, int nodeoffset, uint32_t phandle);
> unsigned int fdt_create_phandle(void *fdt, int nodeoffset);
> int fdt_add_edid(void *blob, const char *compat, unsigned char *buf);
>
> +struct fb_videomode;
> +void fdt_add_display_timings(void *blob, int noff, struct fb_videomode *mode);
> +
> int fdt_verify_alias_address(void *fdt, int anode, const char *alias,
> u64 addr);
> u64 fdt_get_base_address(void *fdt, int node);
>
Agree that we have to sync u-boot and kernel, and this can be a way in
the short term.
I am asking if this is in the long term the best way to do it. You are
converting EDID values to fb_videomode *mode, and then again to the
device node as required by DT.
We have already had some talks about moving U-Boot configuration to DT,
that is U-Boot can be also configured by a DT file (see for example
support for Nvidia processors, they already support DT in U-Boot).
Anatolji, what do you think as best solution we have to follow for
display setting ?
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
next prev parent reply other threads:[~2014-01-08 10:53 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-08 7:24 [U-Boot] [PATCH 1/5] edid: add function to convert edid to fb_videomode Christian Gmeiner
2014-01-08 7:24 ` [U-Boot] [PATCH 2/5] imx: mx6q_4x_mt41j128.cfg: enable ecspi3 clocks Christian Gmeiner
2014-01-08 10:44 ` Stefano Babic
2014-01-08 14:45 ` Christian Gmeiner
2014-01-09 7:07 ` Christian Gmeiner
2014-01-09 10:41 ` Stefano Babic
2014-01-08 7:24 ` [U-Boot] [PATCH 3/5] fdt: add fdt_add_display_timings(..) Christian Gmeiner
2014-01-08 10:53 ` Stefano Babic [this message]
2014-01-09 7:12 ` Christian Gmeiner
2014-01-09 10:44 ` Stefano Babic
2014-01-09 14:52 ` Eric Nelson
2014-01-09 15:06 ` Stefano Babic
2014-01-09 17:00 ` Stephen Warren
2014-01-09 17:19 ` Christian Gmeiner
2014-01-12 21:21 ` Anatolij Gustschin
2014-01-14 7:58 ` Christian Gmeiner
2014-01-16 11:44 ` Christian Gmeiner
2014-09-15 12:27 ` Christian Gmeiner
2014-01-08 7:24 ` [U-Boot] [PATCH 4/5] imx6: add ot1200 mr board Christian Gmeiner
2014-01-08 11:21 ` Stefano Babic
2014-01-08 14:53 ` Christian Gmeiner
2014-01-08 7:24 ` [U-Boot] [PATCH 5/5] imx6: make use of lldiv(..) Christian Gmeiner
2014-01-08 10:54 ` Stefano Babic
2014-01-08 14:46 ` Christian Gmeiner
2014-01-13 10:57 ` Stefano Babic
2014-01-08 10:40 ` [U-Boot] [PATCH 1/5] edid: add function to convert edid to fb_videomode Stefano Babic
2014-01-10 21:36 ` Eric Nelson
2014-01-14 0:36 ` Fabio Estevam
2014-01-14 2:55 ` Eric Nelson
2014-01-12 20:34 ` Anatolij Gustschin
2014-01-14 7:56 ` Christian Gmeiner
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=52CD2E33.8000409@denx.de \
--to=sbabic@denx.de \
--cc=u-boot@lists.denx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.