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>
28 #include <asm/domain.h>
29 #include <asm/setup.h>
31 #include <asm/mach/map.h>
32 #include <asm/mach/arch.h>
33 #include <asm/mach/time.h>
35 extern void rpc_init_irq(void);
37 unsigned int vram_size
;
38 unsigned int memc_ctrl_reg
;
39 unsigned int number_mfm_drives
;
41 static int __init
parse_tag_acorn(const struct tag
*tag
)
43 memc_ctrl_reg
= tag
->u
.acorn
.memc_control_reg
;
44 number_mfm_drives
= tag
->u
.acorn
.adfsdrives
;
46 switch (tag
->u
.acorn
.vram_pages
) {
48 vram_size
+= PAGE_SIZE
* 256;
50 vram_size
+= PAGE_SIZE
* 256;
56 desc
->video_start
= 0x02000000;
57 desc
->video_end
= 0x02000000 + vram_size
;
63 __tagtable(ATAG_ACORN
, parse_tag_acorn
);
65 static struct map_desc rpc_io_desc
[] __initdata
= {
67 .virtual = SCREEN_BASE
,
68 .pfn
= __phys_to_pfn(SCREEN_START
),
72 .virtual = (u32
)IO_BASE
,
73 .pfn
= __phys_to_pfn(IO_START
),
77 .virtual = (unsigned long)EASI_BASE
,
78 .pfn
= __phys_to_pfn(EASI_START
),
84 static void __init
rpc_map_io(void)
86 iotable_init(rpc_io_desc
, ARRAY_SIZE(rpc_io_desc
));
91 writeb(0xc, PCIO_BASE
+ (0x3f2 << 2));
94 * RiscPC can't handle half-word loads and stores
96 elf_hwcap
&= ~HWCAP_HALF
;
99 static struct resource acornfb_resources
[] = {
103 .flags
= IORESOURCE_MEM
,
105 .start
= IRQ_VSYNCPULSE
,
106 .end
= IRQ_VSYNCPULSE
,
107 .flags
= IORESOURCE_IRQ
,
111 static struct platform_device acornfb_device
= {
115 .coherent_dma_mask
= 0xffffffff,
117 .num_resources
= ARRAY_SIZE(acornfb_resources
),
118 .resource
= acornfb_resources
,
121 static struct resource iomd_resources
[] = {
125 .flags
= IORESOURCE_MEM
,
129 static struct platform_device iomd_device
= {
132 .num_resources
= ARRAY_SIZE(iomd_resources
),
133 .resource
= iomd_resources
,
136 static struct platform_device kbd_device
= {
140 .parent
= &iomd_device
.dev
,
144 static struct plat_serial8250_port serial_platform_data
[] = {
146 .mapbase
= 0x03010fe0,
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
[] = {
172 .flags
= IORESOURCE_MEM
,
177 .flags
= IORESOURCE_MEM
,
180 .start
= IRQ_HARDDISK
,
182 .flags
= IORESOURCE_IRQ
,
186 static struct platform_device pata_device
= {
187 .name
= "pata_platform",
189 .num_resources
= ARRAY_SIZE(pata_resources
),
190 .resource
= pata_resources
,
192 .platform_data
= &pata_platform_data
,
193 .coherent_dma_mask
= ~0, /* grumble */
197 static struct platform_device
*devs
[] __initdata
= {
205 static struct i2c_board_info i2c_rtc
= {
206 I2C_BOARD_INFO("pcf8583", 0x50)
209 static int __init
rpc_init(void)
211 i2c_register_board_info(0, &i2c_rtc
, 1);
212 return platform_add_devices(devs
, ARRAY_SIZE(devs
));
215 arch_initcall(rpc_init
);
217 extern struct sys_timer ioc_timer
;
219 MACHINE_START(RISCPC
, "Acorn-RiscPC")
220 /* Maintainer: Russell King */
221 .boot_params
= 0x10000100,
224 .map_io
= rpc_map_io
,
225 .init_irq
= rpc_init_irq
,