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>
23 #include <linux/reboot.h>
26 #include <asm/mach-types.h>
27 #include <mach/hardware.h>
28 #include <asm/hardware/iomd.h>
30 #include <asm/domain.h>
31 #include <asm/setup.h>
32 #include <asm/system_misc.h>
34 #include <asm/mach/map.h>
35 #include <asm/mach/arch.h>
36 #include <asm/mach/time.h>
38 extern void rpc_init_irq(void);
40 unsigned int vram_size;
41 unsigned int memc_ctrl_reg;
42 unsigned int number_mfm_drives;
44 static int __init parse_tag_acorn(const struct tag *tag)
46 memc_ctrl_reg = tag->u.acorn.memc_control_reg;
47 number_mfm_drives = tag->u.acorn.adfsdrives;
49 switch (tag->u.acorn.vram_pages) {
51 vram_size += PAGE_SIZE * 256;
53 vram_size += PAGE_SIZE * 256;
59 desc->video_start = 0x02000000;
60 desc->video_end = 0x02000000 + vram_size;
66 __tagtable(ATAG_ACORN, parse_tag_acorn);
68 static struct map_desc rpc_io_desc[] __initdata = {
70 .virtual = SCREEN_BASE,
71 .pfn = __phys_to_pfn(SCREEN_START),
75 .virtual = (u32)IO_BASE,
76 .pfn = __phys_to_pfn(IO_START),
80 .virtual = (unsigned long)EASI_BASE,
81 .pfn = __phys_to_pfn(EASI_START),
87 static void __init rpc_map_io(void)
89 iotable_init(rpc_io_desc, ARRAY_SIZE(rpc_io_desc));
94 writeb(0xc, PCIO_BASE + (0x3f2 << 2));
97 * RiscPC can't handle half-word loads and stores
99 elf_hwcap &= ~HWCAP_HALF;
102 static struct resource acornfb_resources[] = {
104 DEFINE_RES_MEM(0x03400000, 0x00200000),
105 DEFINE_RES_IRQ(IRQ_VSYNCPULSE),
108 static struct platform_device acornfb_device = {
112 .coherent_dma_mask = 0xffffffff,
114 .num_resources = ARRAY_SIZE(acornfb_resources),
115 .resource = acornfb_resources,
118 static struct resource iomd_resources[] = {
119 DEFINE_RES_MEM(0x03200000, 0x10000),
122 static struct platform_device iomd_device = {
125 .num_resources = ARRAY_SIZE(iomd_resources),
126 .resource = iomd_resources,
129 static struct resource iomd_kart_resources[] = {
130 DEFINE_RES_IRQ(IRQ_KEYBOARDRX),
131 DEFINE_RES_IRQ(IRQ_KEYBOARDTX),
134 static struct platform_device kbd_device = {
138 .parent = &iomd_device.dev,
140 .num_resources = ARRAY_SIZE(iomd_kart_resources),
141 .resource = iomd_kart_resources,
144 static struct plat_serial8250_port serial_platform_data[] = {
146 .mapbase = 0x03010fe0,
147 .irq = IRQ_SERIALPORT,
151 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SKIP_TEST,
156 static struct platform_device serial_device = {
157 .name = "serial8250",
158 .id = PLAT8250_DEV_PLATFORM,
160 .platform_data = serial_platform_data,
164 static struct pata_platform_info pata_platform_data = {
168 static struct resource pata_resources[] = {
169 DEFINE_RES_MEM(0x030107c0, 0x20),
170 DEFINE_RES_MEM(0x03010fd8, 0x04),
171 DEFINE_RES_IRQ(IRQ_HARDDISK),
174 static struct platform_device pata_device = {
175 .name = "pata_platform",
177 .num_resources = ARRAY_SIZE(pata_resources),
178 .resource = pata_resources,
180 .platform_data = &pata_platform_data,
181 .coherent_dma_mask = ~0, /* grumble */
185 static struct platform_device *devs[] __initdata = {
193 static struct i2c_board_info i2c_rtc = {
194 I2C_BOARD_INFO("pcf8583", 0x50)
197 static int __init rpc_init(void)
199 i2c_register_board_info(0, &i2c_rtc, 1);
200 return platform_add_devices(devs, ARRAY_SIZE(devs));
203 arch_initcall(rpc_init);
205 static void rpc_restart(enum reboot_mode mode, const char *cmd)
207 iomd_writeb(0, IOMD_ROMCR0);
215 void ioc_timer_init(void);
217 MACHINE_START(RISCPC, "Acorn-RiscPC")
218 /* Maintainer: Russell King */
219 .atag_offset = 0x100,
222 .map_io = rpc_map_io,
223 .init_irq = rpc_init_irq,
224 .init_time = ioc_timer_init,
225 .restart = rpc_restart,