12 #include <linux/kernel.h>
19 #include <mach/hardware.h>
21 #include <asm/setup.h>
23 #include <asm/pgtable.h>
25 #include <asm/system_misc.h>
35 static void ebsa110_mask_irq(
struct irq_data *
d)
40 static void ebsa110_unmask_irq(
struct irq_data *
d)
45 static struct irq_chip ebsa110_irq_chip = {
46 .irq_ack = ebsa110_mask_irq,
47 .irq_mask = ebsa110_mask_irq,
48 .irq_unmask = ebsa110_unmask_irq,
51 static void __init ebsa110_init_irq(
void)
65 for (irq = 0; irq <
NR_IRQS; irq++) {
66 irq_set_chip_and_handler(irq, &ebsa110_irq_chip,
114 static void __init ebsa110_map_io(
void)
120 unsigned int flags,
void *
caller)
128 static void __init ebsa110_init_early(
void)
134 #define PIT_CTRL (PIT_BASE + 0x0d)
135 #define PIT_T2 (PIT_BASE + 0x09)
136 #define PIT_T1 (PIT_BASE + 0x05)
137 #define PIT_T0 (PIT_BASE + 0x01)
144 #define MCLK 47894000
149 #define CLKBY7 (MCLK / 7)
154 #define COUNT ((CLKBY7 + (HZ / 2)) / HZ)
161 static unsigned long ebsa110_gettimeoffset(
void)
182 offset = offset * (1000000 /
HZ) /
COUNT;
188 ebsa110_timer_interrupt(
int irq,
void *
dev_id)
207 static struct irqaction ebsa110_timer_irq = {
208 .name =
"EBSA110 Timer Tick",
210 .handler = ebsa110_timer_interrupt,
216 static void __init ebsa110_timer_init(
void)
228 static struct sys_timer ebsa110_timer = {
229 .init = ebsa110_timer_init,
230 .offset = ebsa110_gettimeoffset,
254 .name =
"serial8250",
257 .platform_data = serial_platform_data,
261 static struct resource am79c961_resources[] = {
276 .num_resources =
ARRAY_SIZE(am79c961_resources),
277 .resource = am79c961_resources,
295 static void ebsa110_idle(
void)
297 const char *
irq_stat = (
char *)0xff000000;
300 asm volatile (
"mcr p15, 0, ip, c15, c2, 2" : : :
"cc");
306 asm volatile (
"mcr p15, 0, ip, c15, c1, 2" : : :
"cc");
309 static int __init ebsa110_init(
void)
317 static void ebsa110_restart(
char mode,
const char *
cmd)
324 .atag_offset = 0x400,
328 .map_io = ebsa110_map_io,
329 .init_early = ebsa110_init_early,
330 .init_irq = ebsa110_init_irq,
331 .timer = &ebsa110_timer,
332 .restart = ebsa110_restart,