diff options
author | Jon Medhurst <tixy@linaro.org> | 2012-07-18 18:59:52 +0100 |
---|---|---|
committer | Jon Medhurst <tixy@linaro.org> | 2012-07-18 18:59:52 +0100 |
commit | 200f50b540e8fc7ce3a23f84c0cc06115b95edb2 (patch) | |
tree | d03d7848b89d0757cbc650f77bb82ed1dfee155f /arch | |
parent | f30d1870280ffe7547c1076058c772bd20f273a9 (diff) | |
parent | 806551db3ecf94353e8e3c1719e42d774c795a1b (diff) |
Merge branch 'tracking-armlt-hdlcd' into integration-linux-vexpress
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts | 5 | ||||
-rw-r--r-- | arch/arm/boot/dts/vexpress-v2p-ca5s.dts | 5 | ||||
-rw-r--r-- | arch/arm/mach-vexpress/v2m.c | 57 |
3 files changed, 67 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..2371eb76c90 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> @@ -530,8 +531,56 @@ MACHINE_START(VEXPRESS, "ARM-Versatile Express") .restart = v2m_restart, MACHINE_END +int set_dvi_mode(int mode) +{ + /* mode is a value from: + 0 = VGA + 1 = SVGA + 2 = XGA + 3 = SXGA + 4 = UXGA + 5 = WUXGA + */ + v2m_cfg_write(SYS_CFG_DVIMODE, mode); + return 0; +} + #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 +638,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 +657,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 +674,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 = { |