From: Ian Campbell <ijc@hellion.org.uk>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/6] sunxi: video: Add simplefb support
Date: Sun, 16 Nov 2014 11:50:07 +0000 [thread overview]
Message-ID: <1416138607.25454.13.camel@hellion.org.uk> (raw)
In-Reply-To: <1415984088-6800-6-git-send-email-hdegoede@redhat.com>
On Fri, 2014-11-14 at 17:54 +0100, Hans de Goede wrote:
> From: Luc Verhaegen <libv@skynet.be>
>
> Add simplefb support, note this depends on the kernel having support for
> the clocks property which has recently been added to the simplefb devicetree
> binding.
Link please, Linus's tree[0] doesn't seem to have it yet, I suppose it
is in some maintainer tree at the moment? It's not even in linux-next
yet though[1]. Maybe simple-framebuffer.txt isn't the right place to
look?
[0] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/video/simple-framebuffer.txt
[1] https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/Documentation/devicetree/bindings/video/simple-framebuffer.txt
> +#if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_VIDEO_DT_SIMPLEFB)
> +void
> +sunxi_simplefb_setup(void *blob)
> +{
> + static GraphicDevice *graphic_device = &sunxi_display.graphic_device;
> + const char *node = "/chosen/framebuffer0-hdmi";
> + const char *format = "x8r8g8b8";
The bindings doc currently says:
- format: The format of the framebuffer surface. Valid values are:
- r5g6b5 (16-bit pixels, d[15:11]=r, d[10:5]=g, d[4:0]=b).
- a8b8g8r8 (32-bit pixels, d[31:24]=a, d[23:16]=b, d[15:8]=g, d[7:0]=r).
Perhaps x8r8g8b8 is defined in the updated version?
> + const char *okay = "okay";
> + char name[32];
> + fdt32_t cells[2];
> + int offset, stride, ret;
> +
> + if (!sunxi_display.enabled)
> + return;
> +
> + offset = fdt_path_offset(blob, node);
I think you should use fdt_node_offset_by_compatible here instead of
hardcoding a path. common/lcd.c does it this way too, it also doesn't
appear to use a node under /chosen. Perhaps this is changed in the more
uptodate binding which I've not seen yet.
> + cells[0] = cpu_to_fdt32(gd->fb_base);
> + cells[1] = cpu_to_fdt32(CONFIG_SUNXI_FB_SIZE);
> + ret = fdt_setprop(blob, offset, "reg", cells, sizeof(cells[0]) * 2);
What arranges that #address-cells and #size-cells are both 1 at this
point? Does u-boot not have a helper to setup a cells array including
looking those up?
Also the bindings doc seems to imply that size should be the actual
configured size of the video ram region ("(1600 * 1200 * 2)") rather
than the size of the reserved memory region. Maybe it's not important.
> + ret = fdt_setprop(blob, offset, "format", format, strlen(format) + 1);
> + if (ret < 0)
> + goto error;
> +
> + ret = fdt_setprop(blob, offset, "status", okay, strlen(okay) + 1);
You can use fdt_setprop_string for these two, I think.
Ian.
next prev parent reply other threads:[~2014-11-16 11:50 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-14 16:54 [U-Boot] [PATCH 0/6] sunxi: HDMI (cfb) console support Hans de Goede
2014-11-14 16:54 ` [U-Boot] [PATCH 1/6] sun4i: Rename dram_clk_cfg to dram_clk_gate Hans de Goede
2014-11-16 11:27 ` Ian Campbell
2014-11-14 16:54 ` [U-Boot] [PATCH 2/6] sunxi: Add video pll clock functions Hans de Goede
2014-11-16 11:29 ` Ian Campbell
2014-11-14 16:54 ` [U-Boot] [PATCH 3/6] sunxi: video: Add cfb console driver for sunxi Hans de Goede
2014-11-14 20:17 ` Anatolij Gustschin
2014-11-14 20:24 ` Anatolij Gustschin
2014-11-15 14:58 ` Hans de Goede
2014-11-16 11:35 ` Ian Campbell
2014-11-16 11:39 ` Ian Campbell
2014-11-16 13:15 ` Hans de Goede
2014-11-16 13:34 ` Ian Campbell
2014-11-14 16:54 ` [U-Boot] [PATCH 4/6] sunxi: video: Add sun6i support Hans de Goede
2014-11-14 20:21 ` Anatolij Gustschin
2014-11-16 11:38 ` Ian Campbell
2014-11-14 16:54 ` [U-Boot] [PATCH 5/6] sunxi: video: Add simplefb support Hans de Goede
2014-11-14 22:22 ` Anatolij Gustschin
2014-11-15 14:58 ` Hans de Goede
2014-11-16 11:50 ` Ian Campbell [this message]
2014-11-16 13:52 ` Hans de Goede
2014-11-16 14:38 ` Ian Campbell
2014-11-16 14:38 ` [U-Boot] " Ian Campbell
2014-11-16 15:11 ` Hans de Goede
2014-11-16 15:11 ` [U-Boot] " Hans de Goede
[not found] ` <5468BE9A.8050501-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-16 16:11 ` Ian Campbell
2014-11-16 16:11 ` [U-Boot] " Ian Campbell
[not found] ` <1416154297.25454.24.camel-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>
2014-11-16 17:19 ` Ian Campbell
2014-11-16 17:19 ` Ian Campbell
2014-11-16 17:52 ` Hans de Goede
2014-11-16 17:52 ` [U-Boot] " Hans de Goede
2014-11-17 9:58 ` Grant Likely
2014-11-17 9:58 ` Grant Likely
2014-11-17 10:10 ` Hans de Goede
2014-11-17 10:10 ` [U-Boot] " Hans de Goede
2014-11-17 10:14 ` Ian Campbell
2014-11-17 10:14 ` [U-Boot] " Ian Campbell
[not found] ` <1416219254.27385.15.camel-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>
2014-11-17 15:01 ` Grant Likely
2014-11-17 15:01 ` Grant Likely
2014-11-14 16:54 ` [U-Boot] [PATCH 6/6] sunxi: Add usb keyboard Kconfig option Hans de Goede
2014-11-16 11:55 ` Ian Campbell
2014-11-16 13:28 ` Hans de Goede
2014-11-16 13:37 ` Ian Campbell
2014-11-16 14:03 ` Hans de Goede
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=1416138607.25454.13.camel@hellion.org.uk \
--to=ijc@hellion.org.uk \
--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.