aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Medhurst <tixy@linaro.org>2012-06-13 10:01:28 +0100
committerJon Medhurst <tixy@linaro.org>2012-07-16 14:21:45 +0100
commite9bca576ea7f466a5ca741be48dbba27a9e5f706 (patch)
treee88cc518e9d6feb8bee22e368196f89b1a235288
parent89b76d223103b599d5690b59ea8a2e4580f5a862 (diff)
ARM: vexpress: Add support for HDLCD
This is a temporary solution to get everything running. Signed-off-by: Jon Medhurst <tixy@linaro.org>
-rw-r--r--arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts5
-rw-r--r--arch/arm/boot/dts/vexpress-v2p-ca5s.dts5
-rw-r--r--arch/arm/mach-vexpress/v2m.c43
3 files changed, 53 insertions, 0 deletions
diff --git a/arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts b/arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts
index 7e1091d91af..20c2ac6fd59 100644
--- a/arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts
+++ b/arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts
@@ -9,6 +9,8 @@
/dts-v1/;
+/memreserve/ 0xbf000000 0x01000000;
+
/ {
model = "V2P-CA15";
arm,hbi = <0x237>;
@@ -54,6 +56,9 @@
compatible = "arm,hdlcd";
reg = <0x2b000000 0x1000>;
interrupts = <0 85 4>;
+ mode = "1024x768-16@60";
+ arm,vexpress-osc = <5>;
+ framebuffer = <0xbf000000 0x01000000>;
};
memory-controller@2b0a0000 {
diff --git a/arch/arm/boot/dts/vexpress-v2p-ca5s.dts b/arch/arm/boot/dts/vexpress-v2p-ca5s.dts
index 18917a0f860..dc016b7b4ed 100644
--- a/arch/arm/boot/dts/vexpress-v2p-ca5s.dts
+++ b/arch/arm/boot/dts/vexpress-v2p-ca5s.dts
@@ -9,6 +9,8 @@
/dts-v1/;
+/memreserve/ 0xbf000000 0x01000000;
+
/ {
model = "V2P-CA5s";
arm,hbi = <0x225>;
@@ -56,6 +58,9 @@
compatible = "arm,hdlcd";
reg = <0x2a110000 0x1000>;
interrupts = <0 85 4>;
+ mode = "640x480-16@60";
+ arm,vexpress-osc = <3>;
+ framebuffer = <0xbf000000 0x01000000>;
};
memory-controller@2a150000 {
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index 8343f78d9cb..4a9168c4873 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -6,6 +6,7 @@
#include <linux/amba/mmci.h>
#include <linux/io.h>
#include <linux/init.h>
+#include <linux/memblock.h>
#include <linux/of_address.h>
#include <linux/of_fdt.h>
#include <linux/of_irq.h>
@@ -532,6 +533,40 @@ MACHINE_END
#if defined(CONFIG_ARCH_VEXPRESS_DT)
+static struct v2m_osc v2m_dt_hdlcd_osc = {
+ .rate_min = 10000000,
+ .rate_max = 165000000,
+ .rate_default = 23750000,
+};
+
+static void __init v2m_dt_hdlcd_init(void)
+{
+ struct device_node *node;
+ u32 framebuffer[2];
+ u32 osc;
+
+ node = of_find_compatible_node(NULL, NULL, "arm,hdlcd");
+ if (!node)
+ return;
+
+ if (WARN_ON(of_property_read_u32_array(node, "framebuffer",
+ framebuffer, ARRAY_SIZE(framebuffer))))
+ return;
+
+ if (WARN_ON(of_property_read_u32(node, "arm,vexpress-osc", &osc)))
+ return;
+
+ v2m_dt_hdlcd_osc.site = v2m_get_master_site();
+ v2m_dt_hdlcd_osc.osc = osc;
+
+ if (WARN_ON(memblock_remove(framebuffer[0], framebuffer[1])))
+ return;
+
+ v2m_cfg_write(SYS_CFG_MUXFPGA | SYS_CFG_SITE(SYS_CFG_SITE_MB),
+ v2m_get_master_site());
+};
+
+
static struct map_desc v2m_rs1_io_desc __initdata = {
.virtual = V2M_PERIPH,
.pfn = __phys_to_pfn(0x1c000000),
@@ -589,6 +624,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 struct of_device_id vexpress_irq_match[] __initdata = {
@@ -606,6 +643,7 @@ static void __init v2m_dt_timer_init(void)
struct device_node *node;
const char *path;
int err;
+ struct clk *clk;
node = of_find_compatible_node(NULL, NULL, "arm,sp810");
v2m_sysctl_init(of_iomap(node, 0));
@@ -622,6 +660,11 @@ static void __init v2m_dt_timer_init(void)
if (arch_timer_sched_clock_init() != 0)
versatile_sched_clock_init(v2m_sysreg_base + V2M_SYS_24MHZ, 24000000);
+
+ if (v2m_dt_hdlcd_osc.site) {
+ clk = v2m_osc_register("hdlcd", &v2m_dt_hdlcd_osc);
+ clk_register_clkdev(clk, NULL, "hdlcd");
+ }
}
static struct sys_timer v2m_dt_timer = {