2 * linux/arch/arm/mach-shark/arch.c
4 * Architecture specific stuff.
6 #include <linux/kernel.h>
7 #include <linux/init.h>
8 #include <linux/interrupt.h>
10 #include <linux/sched.h>
11 #include <linux/serial_8250.h>
14 #include <asm/setup.h>
15 #include <asm/mach-types.h>
17 #include <asm/param.h>
19 #include <asm/mach/map.h>
20 #include <asm/mach/arch.h>
21 #include <asm/mach/time.h>
23 #define IO_BASE 0xe0000000
24 #define IO_SIZE 0x08000000
25 #define IO_START 0x40000000
26 #define ROMCARD_SIZE 0x08000000
27 #define ROMCARD_START 0x10000000
29 static void shark_restart(char mode
, const char *cmd
)
32 /* Reset the Machine via pc[3] of the sequoia chipset */
35 temp
= temp
| (1<<3) | (1<<10);
40 static struct plat_serial8250_port serial_platform_data
[] = {
47 .flags
= UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
,
55 .flags
= UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
,
60 static struct platform_device serial_device
= {
62 .id
= PLAT8250_DEV_PLATFORM
,
64 .platform_data
= serial_platform_data
,
68 static struct resource rtc_resources
[] = {
72 .flags
= IORESOURCE_IO
,
75 .start
= IRQ_ISA_RTC_ALARM
,
76 .end
= IRQ_ISA_RTC_ALARM
,
77 .flags
= IORESOURCE_IRQ
,
81 static struct platform_device rtc_device
= {
84 .resource
= rtc_resources
,
85 .num_resources
= ARRAY_SIZE(rtc_resources
),
88 static int __init
shark_init(void)
92 if (machine_is_shark())
94 ret
= platform_device_register(&rtc_device
);
95 if (ret
) printk(KERN_ERR
"Unable to register RTC device: %d\n", ret
);
96 ret
= platform_device_register(&serial_device
);
97 if (ret
) printk(KERN_ERR
"Unable to register Serial device: %d\n", ret
);
102 arch_initcall(shark_init
);
104 extern void shark_init_irq(void);
106 static struct map_desc shark_io_desc
[] __initdata
= {
109 .pfn
= __phys_to_pfn(IO_START
),
115 static void __init
shark_map_io(void)
117 iotable_init(shark_io_desc
, ARRAY_SIZE(shark_io_desc
));
121 #define HZ_TIME ((1193180 + HZ/2) / HZ)
124 shark_timer_interrupt(int irq
, void *dev_id
)
130 static struct irqaction shark_timer_irq
= {
131 .name
= "Shark Timer Tick",
132 .flags
= IRQF_DISABLED
| IRQF_TIMER
| IRQF_IRQPOLL
,
133 .handler
= shark_timer_interrupt
,
137 * Set up timer interrupt, and return the current time in seconds.
139 static void __init
shark_timer_init(void)
141 outb(0x34, 0x43); /* binary, mode 0, LSB/MSB, Ch 0 */
142 outb(HZ_TIME
& 0xff, 0x40); /* LSB of count */
143 outb(HZ_TIME
>> 8, 0x40);
145 setup_irq(IRQ_TIMER
, &shark_timer_irq
);
148 static struct sys_timer shark_timer
= {
149 .init
= shark_timer_init
,
152 MACHINE_START(SHARK
, "Shark")
153 /* Maintainer: Alexander Schulz */
154 .atag_offset
= 0x3000,
155 .map_io
= shark_map_io
,
156 .init_irq
= shark_init_irq
,
157 .timer
= &shark_timer
,
158 .dma_zone_size
= SZ_4M
,
159 .restart
= shark_restart
,