aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-versatile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-versatile')
-rw-r--r--arch/arm/mach-versatile/core.c18
-rw-r--r--arch/arm/mach-versatile/versatile_pb.c18
2 files changed, 19 insertions, 17 deletions
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 3b8576111c16..57196947559f 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -27,6 +27,7 @@
27#include <linux/amba/bus.h> 27#include <linux/amba/bus.h>
28#include <linux/amba/clcd.h> 28#include <linux/amba/clcd.h>
29 29
30#include <asm/cnt32_to_63.h>
30#include <asm/system.h> 31#include <asm/system.h>
31#include <asm/hardware.h> 32#include <asm/hardware.h>
32#include <asm/io.h> 33#include <asm/io.h>
@@ -77,7 +78,7 @@ static struct irq_chip sic_chip = {
77}; 78};
78 79
79static void 80static void
80sic_handle_irq(unsigned int irq, struct irqdesc *desc) 81sic_handle_irq(unsigned int irq, struct irq_desc *desc)
81{ 82{
82 unsigned long status = readl(VA_SIC_BASE + SIC_IRQ_STATUS); 83 unsigned long status = readl(VA_SIC_BASE + SIC_IRQ_STATUS);
83 84
@@ -123,7 +124,7 @@ void __init versatile_init_irq(void)
123 for (i = IRQ_SIC_START; i <= IRQ_SIC_END; i++) { 124 for (i = IRQ_SIC_START; i <= IRQ_SIC_END; i++) {
124 if ((PIC_MASK & (1 << (i - IRQ_SIC_START))) == 0) { 125 if ((PIC_MASK & (1 << (i - IRQ_SIC_START))) == 0) {
125 set_irq_chip(i, &sic_chip); 126 set_irq_chip(i, &sic_chip);
126 set_irq_handler(i, do_level_IRQ); 127 set_irq_handler(i, handle_level_irq);
127 set_irq_flags(i, IRQF_VALID | IRQF_PROBE); 128 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
128 } 129 }
129 } 130 }
@@ -228,14 +229,19 @@ void __init versatile_map_io(void)
228 229
229/* 230/*
230 * This is the Versatile sched_clock implementation. This has 231 * This is the Versatile sched_clock implementation. This has
231 * a resolution of 41.7ns, and a maximum value of about 179s. 232 * a resolution of 41.7ns, and a maximum value of about 35583 days.
233 *
234 * The return value is guaranteed to be monotonic in that range as
235 * long as there is always less than 89 seconds between successive
236 * calls to this function.
232 */ 237 */
233unsigned long long sched_clock(void) 238unsigned long long sched_clock(void)
234{ 239{
235 unsigned long long v; 240 unsigned long long v = cnt32_to_63(readl(VERSATILE_REFCOUNTER));
236 241
237 v = (unsigned long long)readl(VERSATILE_REFCOUNTER) * 125; 242 /* the <<1 gets rid of the cnt_32_to_63 top bit saving on a bic insn */
238 do_div(v, 3); 243 v *= 125<<1;
244 do_div(v, 3<<1);
239 245
240 return v; 246 return v;
241} 247}
diff --git a/arch/arm/mach-versatile/versatile_pb.c b/arch/arm/mach-versatile/versatile_pb.c
index 503725b166fc..be439bb9d450 100644
--- a/arch/arm/mach-versatile/versatile_pb.c
+++ b/arch/arm/mach-versatile/versatile_pb.c
@@ -81,22 +81,18 @@ static struct amba_device *amba_devs[] __initdata = {
81 &mmc1_device, 81 &mmc1_device,
82}; 82};
83 83
84static int __init versatile_pb_init(void) 84static void __init versatile_pb_init(void)
85{ 85{
86 int i; 86 int i;
87 87
88 if (machine_is_versatile_pb()) { 88 versatile_init();
89 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
90 struct amba_device *d = amba_devs[i];
91 amba_device_register(d, &iomem_resource);
92 }
93 }
94 89
95 return 0; 90 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
91 struct amba_device *d = amba_devs[i];
92 amba_device_register(d, &iomem_resource);
93 }
96} 94}
97 95
98arch_initcall(versatile_pb_init);
99
100MACHINE_START(VERSATILE_PB, "ARM-Versatile PB") 96MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
101 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 97 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
102 .phys_io = 0x101f1000, 98 .phys_io = 0x101f1000,
@@ -105,5 +101,5 @@ MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
105 .map_io = versatile_map_io, 101 .map_io = versatile_map_io,
106 .init_irq = versatile_init_irq, 102 .init_irq = versatile_init_irq,
107 .timer = &versatile_timer, 103 .timer = &versatile_timer,
108 .init_machine = versatile_init, 104 .init_machine = versatile_pb_init,
109MACHINE_END 105MACHINE_END