2 * linux/arch/arm/mach-rpc/riscpc.c
4 * Copyright (C) 1998-2001 Russell King
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * Architecture specific fixups.
12 #include <linux/kernel.h>
13 #include <linux/tty.h>
14 #include <linux/delay.h>
16 #include <linux/init.h>
17 #include <linux/sched.h>
18 #include <linux/device.h>
19 #include <linux/serial_8250.h>
20 #include <linux/ata_platform.h>
22 #include <linux/i2c.h>
25 #include <asm/mach-types.h>
26 #include <mach/hardware.h>
27 #include <asm/hardware/iomd.h>
29 #include <asm/domain.h>
30 #include <asm/setup.h>
31 #include <asm/system_misc.h>
33 #include <asm/mach/map.h>
34 #include <asm/mach/arch.h>
35 #include <asm/mach/time.h>
37 extern void rpc_init_irq(void);
39 unsigned int vram_size;
40 unsigned int memc_ctrl_reg;
41 unsigned int number_mfm_drives;
43 static int __init parse_tag_acorn(const struct tag *tag)
45 memc_ctrl_reg = tag->u.acorn.memc_control_reg;
46 number_mfm_drives = tag->u.acorn.adfsdrives;
48 switch (tag->u.acorn.vram_pages) {
50 vram_size += PAGE_SIZE * 256;
52 vram_size += PAGE_SIZE * 256;
58 desc->video_start = 0x02000000;
59 desc->video_end = 0x02000000 + vram_size;
65 __tagtable(ATAG_ACORN, parse_tag_acorn);
67 static struct map_desc rpc_io_desc[] __initdata = {
69 .virtual = SCREEN_BASE,
70 .pfn = __phys_to_pfn(SCREEN_START),
74 .virtual = (u32)IO_BASE,
75 .pfn = __phys_to_pfn(IO_START),
79 .virtual = (unsigned long)EASI_BASE,
80 .pfn = __phys_to_pfn(EASI_START),
86 static void __init rpc_map_io(void)
88 iotable_init(rpc_io_desc, ARRAY_SIZE(rpc_io_desc));
93 writeb(0xc, PCIO_BASE + (0x3f2 << 2));
96 * RiscPC can't handle half-word loads and stores
98 elf_hwcap &= ~HWCAP_HALF;
101 static struct resource acornfb_resources[] = {
105 .flags = IORESOURCE_MEM,
107 .start = IRQ_VSYNCPULSE,
108 .end = IRQ_VSYNCPULSE,
109 .flags = IORESOURCE_IRQ,
113 static struct platform_device acornfb_device = {
117 .coherent_dma_mask = 0xffffffff,
119 .num_resources = ARRAY_SIZE(acornfb_resources),
120 .resource = acornfb_resources,
123 static struct resource iomd_resources[] = {
127 .flags = IORESOURCE_MEM,
131 static struct platform_device iomd_device = {
134 .num_resources = ARRAY_SIZE(iomd_resources),
135 .resource = iomd_resources,
138 static struct platform_device kbd_device = {
142 .parent = &iomd_device.dev,
146 static struct plat_serial8250_port serial_platform_data[] = {
148 .mapbase = 0x03010fe0,
153 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SKIP_TEST,
158 static struct platform_device serial_device = {
159 .name = "serial8250",
160 .id = PLAT8250_DEV_PLATFORM,
162 .platform_data = serial_platform_data,
166 static struct pata_platform_info pata_platform_data = {
170 static struct resource pata_resources[] = {
174 .flags = IORESOURCE_MEM,
179 .flags = IORESOURCE_MEM,
182 .start = IRQ_HARDDISK,
184 .flags = IORESOURCE_IRQ,
188 static struct platform_device pata_device = {
189 .name = "pata_platform",
191 .num_resources = ARRAY_SIZE(pata_resources),
192 .resource = pata_resources,
194 .platform_data = &pata_platform_data,
195 .coherent_dma_mask = ~0, /* grumble */
199 static struct platform_device *devs[] __initdata = {
207 static struct i2c_board_info i2c_rtc = {
208 I2C_BOARD_INFO("pcf8583", 0x50)
211 static int __init rpc_init(void)
213 i2c_register_board_info(0, &i2c_rtc, 1);
214 return platform_add_devices(devs, ARRAY_SIZE(devs));
217 arch_initcall(rpc_init);
219 static void rpc_restart(char mode, const char *cmd)
221 iomd_writeb(0, IOMD_ROMCR0);
229 extern struct sys_timer ioc_timer;
231 MACHINE_START(RISCPC, "Acorn-RiscPC")
232 /* Maintainer: Russell King */
233 .atag_offset = 0x100,
236 .map_io = rpc_map_io,
237 .init_irq = rpc_init_irq,
239 .restart = rpc_restart,