ARM: vexpress: Add support for HDLCD
authorJon Medhurst <tixy@linaro.org>
Wed, 13 Jun 2012 09:01:28 +0000 (10:01 +0100)
committerJon Medhurst <tixy@linaro.org>
Mon, 1 Jul 2013 10:04:26 +0000 (11:04 +0100)
This is a temporary solution to get everything running.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts
arch/arm/boot/dts/vexpress-v2p-ca5s.dts
arch/arm/mach-vexpress/v2m.c

index 9420053acc14639ffa24e992dfb3bd3eaf5d9071..cc6a8c0cfe33bc99407ccbf64de783e7514b14d5 100644 (file)
@@ -9,6 +9,8 @@
 
 /dts-v1/;
 
+/memreserve/ 0xbf000000 0x01000000;
+
 / {
        model = "V2P-CA15";
        arm,hbi = <0x237>;
@@ -57,6 +59,8 @@
                interrupts = <0 85 4>;
                clocks = <&oscclk5>;
                clock-names = "pxlclk";
+               mode = "1024x768-16@60";
+               framebuffer = <0 0xff000000 0 0x01000000>;
        };
 
        memory-controller@2b0a0000 {
index c544a55045918ee1879d59b0282c37bd23d402eb..cf633ed6a1b485b2fd2c1d0cb6fa19b895fbd770 100644 (file)
@@ -9,6 +9,8 @@
 
 /dts-v1/;
 
+/memreserve/ 0xbf000000 0x01000000;
+
 / {
        model = "V2P-CA5s";
        arm,hbi = <0x225>;
@@ -59,6 +61,8 @@
                interrupts = <0 85 4>;
                clocks = <&oscclk3>;
                clock-names = "pxlclk";
+               mode = "640x480-16@60";
+               framebuffer = <0xbf000000 0x01000000>;
        };
 
        memory-controller@2a150000 {
index 8802030df98d0fbac53f4cd1f01df30f598f1773..c227959e5e4d26ab5d9bb86741f363cfa1e8bac8 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/smp.h>
 #include <linux/init.h>
 #include <linux/irqchip.h>
+#include <linux/memblock.h>
 #include <linux/of_address.h>
 #include <linux/of_fdt.h>
 #include <linux/of_irq.h>
@@ -373,6 +374,31 @@ MACHINE_START(VEXPRESS, "ARM-Versatile Express")
        .init_machine   = v2m_init,
 MACHINE_END
 
+static void __init v2m_dt_hdlcd_init(void)
+{
+       struct device_node *node;
+       int len, na, ns;
+       const __be32 *prop;
+       phys_addr_t fb_base, fb_size;
+
+       node = of_find_compatible_node(NULL, NULL, "arm,hdlcd");
+       if (!node)
+               return;
+
+       na = of_n_addr_cells(node);
+       ns = of_n_size_cells(node);
+
+       prop = of_get_property(node, "framebuffer", &len);
+       if (WARN_ON(!prop || len < (na + ns) * sizeof(*prop)))
+               return;
+
+       fb_base = of_read_number(prop, na);
+       fb_size = of_read_number(prop + na, ns);
+
+       if (WARN_ON(memblock_remove(fb_base, fb_size)))
+               return;
+};
+
 static struct map_desc v2m_rs1_io_desc __initdata = {
        .virtual        = V2M_PERIPH,
        .pfn            = __phys_to_pfn(0x1c000000),
@@ -423,6 +449,8 @@ void __init v2m_dt_init_early(void)
                        pr_warning("vexpress: DT HBI (%x) is not matching "
                                        "hardware (%x)!\n", dt_hbi, hbi);
        }
+
+       v2m_dt_hdlcd_init();
 }
 
 static void __init v2m_dt_timer_init(void)