From: Thierry Reding <thierry.reding@avionic-design.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 08/18] tegra: Add SOC support for display/lcd
Date: Thu, 19 Jul 2012 09:37:07 +0200 [thread overview]
Message-ID: <20120719073707.GA27742@avionic-0098.mockup.avionic-design.de> (raw)
In-Reply-To: <1342106718-3058-9-git-send-email-sjg@chromium.org>
On Thu, Jul 12, 2012 at 08:25:08AM -0700, Simon Glass wrote:
> From: Wei Ni <wni@nvidia.com>
>
> Add support for the LCD peripheral at the Tegra2 SOC level. A separate
> LCD driver will use this functionality to configure the display.
>
> Mayuresh Kulkarni:
> - changes to remove bitfields and clean up for submission
>
> Simon Glass:
> - simplify code, move clock control into here, clean-up
>
> Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> Changes in v3:
> - Add probe function to read in fdt parameters in display driver
> - Separate display driver and LCD driver more in fdt
>
> arch/arm/cpu/armv7/tegra2/Makefile | 2 +-
> arch/arm/cpu/armv7/tegra2/display.c | 389 ++++++++++++++++++++
> arch/arm/include/asm/arch-tegra2/dc.h | 544 ++++++++++++++++++++++++++++
> arch/arm/include/asm/arch-tegra2/display.h | 152 ++++++++
> include/fdtdec.h | 1 +
> lib/fdtdec.c | 1 +
> 6 files changed, 1088 insertions(+), 1 deletions(-)
> create mode 100644 arch/arm/cpu/armv7/tegra2/display.c
> create mode 100644 arch/arm/include/asm/arch-tegra2/dc.h
> create mode 100644 arch/arm/include/asm/arch-tegra2/display.h
>
[...]
> diff --git a/arch/arm/cpu/armv7/tegra2/display.c b/arch/arm/cpu/armv7/tegra2/display.c
[...]
> +int setup_window(struct disp_ctl_win *win, struct fdt_disp_config *config)
> +{
> + win->x = 0;
> + win->y = 0;
> + win->w = config->width;
> + win->h = config->height;
> + win->out_x = 0;
> + win->out_y = 0;
> + win->out_w = config->width;
> + win->out_h = config->height;
> + win->phys_addr = config->frame_buffer;
> + win->stride = config->width * (1 << config->log2_bpp) / 8;
> + debug("%s: depth = %d\n", __func__, config->log2_bpp);
> + switch (config->log2_bpp) {
> + case 5:
> + case 24:
What's the 24 doing here?
[...]
> +static int tegra_display_decode_config(const void *blob,
> + struct fdt_disp_config *config)
> +{
> + int front, back, ref;
> + int node, rgb;
> + int bpp, bit;
> +
> + node = fdtdec_next_compatible(blob, 0, COMPAT_NVIDIA_TEGRA20_DC);
> + if (node < 0) {
> + debug("%s: Cannot find display controller node in fdt\n",
> + __func__);
> + return node;
> + }
> + config->disp = (struct disp_ctlr *)fdtdec_get_addr(blob, node, "reg");
> + if (!config->disp) {
> + debug("%s: No display controller address\n", __func__);
> + return -1;
> + }
> +
> + rgb = fdt_subnode_offset(blob, node, "rgb");
> +
> + config->frame_buffer = fdtdec_get_addr(blob, rgb,
> + "nvidia,frame-buffer");
> + config->width = fdtdec_get_int(blob, rgb, "xres", -1);
> + config->height = fdtdec_get_int(blob, rgb, "yres", -1);
> + bpp = fdtdec_get_int(blob, rgb, "nvidia,bits-per-pixel", -1);
> + bit = ffs(bpp) - 1;
> + if (bpp == (1 << bit))
> + config->log2_bpp = bit;
> + else
> + config->log2_bpp = bpp;
> + config->bpp = bpp;
> + config->pixel_clock = fdtdec_get_int(blob, rgb, "clock", 0);
> + if (!config->pixel_clock || bpp == -1 ||
> + config->width == -1 || config->height == -1) {
> + debug("%s: Pixel parameters missing\n", __func__);
> + return -FDT_ERR_NOTFOUND;
> + }
> +
> + /* Use a ref-to-sync of 1 always, and take this from the front porch */
> + back = fdtdec_get_int(blob, rgb, "left-margin", -1);
> + front = fdtdec_get_int(blob, rgb, "right-margin", -1);
> + ref = fdtdec_get_int(blob, rgb, "hsync-len", -1);
> + if ((back | front | ref) == -1) {
> + debug("%s: Horizontal parameters missing\n", __func__);
> + return -FDT_ERR_NOTFOUND;
> + }
> + config->horiz_timing[FDT_LCD_TIMING_REF_TO_SYNC] = 11;
The comment above says this should be 1.
> + config->horiz_timing[FDT_LCD_TIMING_SYNC_WIDTH] = ref;
> + config->horiz_timing[FDT_LCD_TIMING_BACK_PORCH] = back;
> + config->horiz_timing[FDT_LCD_TIMING_FRONT_PORCH] = front -
> + config->horiz_timing[FDT_LCD_TIMING_REF_TO_SYNC];
> + debug_timing("horiz", config->horiz_timing);
> +
> + back = fdtdec_get_int(blob, rgb, "upper-margin", -1);
> + front = fdtdec_get_int(blob, rgb, "lower-margin", -1);
> + ref = fdtdec_get_int(blob, rgb, "vsync-len", -1);
> + if ((back | front | ref) == -1) {
> + debug("%s: Vertical parameters missing\n", __func__);
> + return -FDT_ERR_NOTFOUND;
> + }
> + config->vert_timing[FDT_LCD_TIMING_REF_TO_SYNC] = 1;
> + config->vert_timing[FDT_LCD_TIMING_SYNC_WIDTH] = ref;
> + config->vert_timing[FDT_LCD_TIMING_BACK_PORCH] = back;
> + config->vert_timing[FDT_LCD_TIMING_FRONT_PORCH] = front -
> + config->vert_timing[FDT_LCD_TIMING_REF_TO_SYNC];
> + debug_timing("vert", config->horiz_timing);
This should probably be config->vert_timing.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120719/4e7a7949/attachment.pgp>
next prev parent reply other threads:[~2012-07-19 7:37 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-12 15:25 [U-Boot] [PATCH v3 0/18] tegra: Add display driver and LCD support for Seaboard Simon Glass
2012-07-12 15:25 ` [U-Boot] [PATCH v3 01/18] fdt: Tidy debugging, add to fdtdec_get_int/addr() Simon Glass
2012-09-21 20:06 ` Anatolij Gustschin
2012-07-12 15:25 ` [U-Boot] [PATCH v3 02/18] fdt: Add header guard to fdtdec.h Simon Glass
2012-07-19 13:49 ` Mike Frysinger
2012-09-21 20:08 ` Anatolij Gustschin
2012-07-12 15:25 ` [U-Boot] [PATCH v3 03/18] tegra: Use const for pinmux_config_pingroup/table() Simon Glass
2012-07-19 13:53 ` Mike Frysinger
2012-07-12 15:25 ` [U-Boot] [PATCH v3 04/18] tegra: Add display support to funcmux Simon Glass
2012-07-19 13:54 ` Mike Frysinger
2012-07-12 15:25 ` [U-Boot] [PATCH v3 05/18] tegra: fdt: Add pwm binding and node Simon Glass
2012-07-12 15:25 ` [U-Boot] [PATCH v3 06/18] tegra: fdt: Add LCD definitions for Tegra Simon Glass
2012-07-31 9:27 ` Simon Glass
2012-07-31 9:51 ` Thierry Reding
2012-09-27 19:44 ` Simon Glass
2012-07-31 16:12 ` Stephen Warren
2012-09-27 13:58 ` Simon Glass
2012-09-27 15:49 ` Stephen Warren
2012-09-27 20:27 ` Simon Glass
2012-09-27 23:21 ` Stephen Warren
2012-09-27 23:37 ` Simon Glass
2012-09-28 5:42 ` Thierry Reding
2012-07-12 15:25 ` [U-Boot] [PATCH v3 07/18] tegra: Add support for PWM Simon Glass
2012-07-19 13:55 ` Mike Frysinger
2012-09-27 13:51 ` Simon Glass
2012-07-12 15:25 ` [U-Boot] [PATCH v3 08/18] tegra: Add SOC support for display/lcd Simon Glass
2012-07-19 7:37 ` Thierry Reding [this message]
2012-07-19 8:24 ` Adam Jiang
2012-07-19 8:28 ` Thierry Reding
2012-07-19 8:03 ` Adam Jiang
2012-07-19 14:13 ` Mike Frysinger
2012-09-27 17:44 ` Simon Glass
2012-07-12 15:25 ` [U-Boot] [PATCH v3 09/18] tegra: Add LCD driver Simon Glass
2012-07-19 7:41 ` Thierry Reding
2012-09-27 17:28 ` Simon Glass
2012-07-12 15:25 ` [U-Boot] [PATCH v3 10/18] tegra: Add LCD support to Nvidia boards Simon Glass
2012-07-12 15:25 ` [U-Boot] [PATCH v3 11/18] arm: Add control over cachability of memory regions Simon Glass
2012-07-12 18:12 ` Albert ARIBAUD
2012-07-19 14:10 ` Mike Frysinger
2012-09-27 17:54 ` Simon Glass
2012-07-12 15:25 ` [U-Boot] [PATCH v3 12/18] lcd: Add CONFIG_LCD_ALIGNMENT to select frame buffer alignment Simon Glass
2012-07-19 13:59 ` Mike Frysinger
2012-09-27 19:20 ` Simon Glass
2012-07-12 15:25 ` [U-Boot] [PATCH v3 13/18] lcd: Add support for flushing LCD fb from dcache after update Simon Glass
2012-07-19 14:01 ` Mike Frysinger
2012-07-19 16:52 ` Mike Frysinger
2012-08-09 7:43 ` Lukasz Majewski
2012-10-16 18:16 ` Simon Glass
2012-10-17 10:38 ` Lukasz Majewski
2012-10-17 15:34 ` Eric Nelson
2012-10-17 22:07 ` Simon Glass
2012-10-18 0:41 ` Eric Nelson
2012-10-18 0:50 ` Simon Glass
2012-10-18 1:07 ` Eric Nelson
2012-10-19 23:49 ` Simon Glass
2012-07-12 15:25 ` [U-Boot] [PATCH v3 14/18] tegra: Align LCD frame buffer to section boundary Simon Glass
2012-07-19 14:01 ` Mike Frysinger
2012-07-12 15:25 ` [U-Boot] [PATCH v3 15/18] tegra: Support control of cache settings for LCD Simon Glass
2012-07-12 15:25 ` [U-Boot] [PATCH v3 16/18] tegra: fdt: Add LCD definitions for Seaboard Simon Glass
2012-07-12 15:25 ` [U-Boot] [PATCH v3 17/18] lcd: Add CONSOLE_SCROLL_LINES option to speed console Simon Glass
2012-07-19 14:04 ` Mike Frysinger
2012-09-27 19:23 ` Simon Glass
2012-07-12 15:25 ` [U-Boot] [PATCH v3 18/18] tegra: Enable display/lcd support on Seaboard Simon Glass
2012-07-19 7:58 ` [U-Boot] [PATCH v3 0/18] tegra: Add display driver and LCD support for Seaboard Thierry Reding
2012-07-31 9:28 ` Simon Glass
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=20120719073707.GA27742@avionic-0098.mockup.avionic-design.de \
--to=thierry.reding@avionic-design.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox