#include <asm/hardware/gic.h>
#include <asm/hardware/timer-sp.h>
#include <asm/hardware/sp810.h>
+#include <asm/arch_timer.h>
#include <mach/ct-ca9x4.h>
#include <mach/motherboard.h>
writel(scctrl, base + SCCTRL);
}
+#ifndef CONFIG_ARM_ARCH_TIMER
static void __init v2m_sp804_init(void __iomem *base, unsigned int irq)
{
if (WARN_ON(!base || irq == NO_IRQ))
sp804_clocksource_init(base + TIMER_2_BASE, "v2m-timer1");
sp804_clockevents_init(base + TIMER_1_BASE, irq, "v2m-timer0");
}
+#endif
static void __init v2m_timer_init(void)
{
+#ifndef CONFIG_ARM_ARCH_TIMER
v2m_sysctl_init(ioremap(V2M_SYSCTL, SZ_4K));
v2m_sp804_init(ioremap(V2M_TIMER01, SZ_4K), IRQ_V2M_TIMER0);
+#endif
}
static struct sys_timer v2m_timer = {
static AMBA_DEVICE(kmi1, "mb:kmi1", V2M_KMI1, NULL);
static AMBA_DEVICE(uart0, "mb:uart0", V2M_UART0, NULL);
static AMBA_DEVICE(uart1, "mb:uart1", V2M_UART1, NULL);
-static AMBA_DEVICE(uart2, "mb:uart2", V2M_UART2, NULL);
-static AMBA_DEVICE(uart3, "mb:uart3", V2M_UART3, NULL);
+//static AMBA_DEVICE(uart2, "mb:uart2", V2M_UART2, NULL);
+//static AMBA_DEVICE(uart3, "mb:uart3", V2M_UART3, NULL);
static AMBA_DEVICE(wdt, "mb:wdt", V2M_WDT, NULL);
static AMBA_DEVICE(rtc, "mb:rtc", V2M_RTC, NULL);
&kmi1_device,
&uart0_device,
&uart1_device,
- &uart2_device,
- &uart3_device,
+// &uart2_device,
+// &uart3_device,
&wdt_device,
&rtc_device,
};
}, { /* UART1 */
.dev_id = "mb:uart1",
.clk = &osc2_clk,
- }, { /* UART2 */
- .dev_id = "mb:uart2",
- .clk = &osc2_clk,
- }, { /* UART3 */
- .dev_id = "mb:uart3",
- .clk = &osc2_clk,
+// }, { /* UART2 */
+// .dev_id = "mb:uart2",
+// .clk = &osc2_clk,
+// }, { /* UART3 */
+// .dev_id = "mb:uart3",
+// .clk = &osc2_clk,
}, { /* KMI0 */
.dev_id = "mb:kmi0",
.clk = &osc2_clk,
{
ct_desc->init_early();
clkdev_add_table(v2m_lookups, ARRAY_SIZE(v2m_lookups));
+#ifdef CONFIG_ARM_ARCH_TIMER
+ arch_timer_sched_clock_init();
+#else
versatile_sched_clock_init(v2m_sysreg_base + V2M_SYS_24MHZ, 24000000);
+#endif
}
static void v2m_power_off(void)
}, { /* PL011 UART1 */
.dev_id = "1000a000.uart",
.clk = &osc2_clk,
- }, { /* PL011 UART2 */
- .dev_id = "1000b000.uart",
- .clk = &osc2_clk,
- }, { /* PL011 UART3 */
- .dev_id = "1000c000.uart",
- .clk = &osc2_clk,
+// }, { /* PL011 UART2 */
+// .dev_id = "1000b000.uart",
+// .clk = &osc2_clk,
+// }, { /* PL011 UART3 */
+// .dev_id = "1000c000.uart",
+// .clk = &osc2_clk,
}, { /* SP805 WDT */
.dev_id = "1000f000.wdt",
.clk = &v2m_ref_clk,
}, { /* PL011 UART1 */
.dev_id = "1c0a0000.uart",
.clk = &osc2_clk,
- }, { /* PL011 UART2 */
- .dev_id = "1c0b0000.uart",
- .clk = &osc2_clk,
- }, { /* PL011 UART3 */
- .dev_id = "1c0c0000.uart",
- .clk = &osc2_clk,
+// }, { /* PL011 UART2 */
+// .dev_id = "1c0b0000.uart",
+// .clk = &osc2_clk,
+// }, { /* PL011 UART3 */
+// .dev_id = "1c0c0000.uart",
+// .clk = &osc2_clk,
}, { /* SP805 WDT */
.dev_id = "1c0f0000.wdt",
.clk = &v2m_ref_clk,
node = of_find_compatible_node(NULL, NULL, "arm,vexpress-sysreg");
reg = of_get_property(node, "reg", NULL);
- if (WARN_ON(!reg))
- return;
+ WARN_ON(!reg);
- v2m_sysreg_base = V2M_PERIPH + be32_to_cpup(reg);
+ if (reg) {
+ v2m_sysreg_base = V2M_PERIPH + be32_to_cpup(reg);
- /* Confirm board type against DT property, if available */
- if (of_property_read_u32(allnodes, "arm,hbi", &dt_hbi) == 0) {
- u32 misc = readl(v2m_sysreg_base + V2M_SYS_MISC);
- u32 id = readl(v2m_sysreg_base + (misc & SYS_MISC_MASTERSITE ?
- V2M_SYS_PROCID1 : V2M_SYS_PROCID0));
- u32 hbi = id & SYS_PROCIDx_HBI_MASK;
+ /* Confirm board type against DT property, if available */
+ if (of_property_read_u32(allnodes, "arm,hbi", &dt_hbi) == 0) {
+ u32 misc = readl(v2m_sysreg_base + V2M_SYS_MISC);
+ u32 id = readl(v2m_sysreg_base + (misc & SYS_MISC_MASTERSITE ?
+ V2M_SYS_PROCID1 : V2M_SYS_PROCID0));
+ u32 hbi = id & SYS_PROCIDx_HBI_MASK;
- if (WARN_ON(dt_hbi != hbi))
- pr_warning("vexpress: DT HBI (%x) is not matching "
- "hardware (%x)!\n", dt_hbi, hbi);
- }
+ if (WARN_ON(dt_hbi != hbi))
+ pr_warning("vexpress: DT HBI (%x) is not matching "
+ "hardware (%x)!\n", dt_hbi, hbi);
+ }
- clkdev_add_table(v2m_dt_lookups, ARRAY_SIZE(v2m_dt_lookups));
+ clkdev_add_table(v2m_dt_lookups, ARRAY_SIZE(v2m_dt_lookups));
+ }
+#ifdef CONFIG_ARM_ARCH_TIMER
+ arch_timer_sched_clock_init();
+#else
versatile_sched_clock_init(v2m_sysreg_base + V2M_SYS_24MHZ, 24000000);
+#endif
+ //if (reg) {
pm_power_off = v2m_power_off;
arm_pm_restart = v2m_restart;
+ //}
}
static struct of_device_id vexpress_irq_match[] __initdata = {
static void __init v2m_dt_timer_init(void)
{
struct device_node *node;
+#ifndef CONFIG_ARM_ARCH_TIMER
const char *path;
+#endif
int err;
node = of_find_compatible_node(NULL, NULL, "arm,sp810");
v2m_sysctl_init(of_iomap(node, 0));
+#ifdef CONFIG_ARM_ARCH_TIMER
+ err = arch_timer_register(NULL);
+ if (WARN_ON(err))
+ return;
+#else
err = of_property_read_string(of_aliases, "arm,v2m_timer", &path);
if (WARN_ON(err))
return;
node = of_find_node_by_path(path);
v2m_sp804_init(of_iomap(node, 0), irq_of_parse_and_map(node, 0));
+#endif
}
static struct sys_timer v2m_dt_timer = {