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/pata_platform.h>
24 #include <asm/mach-types.h>
25 #include <asm/hardware.h>
27 #include <asm/domain.h>
28 #include <asm/setup.h>
30 #include <asm/mach/map.h>
31 #include <asm/mach/arch.h>
32 #include <asm/mach/time.h>
34 extern void rpc_init_irq(void);
36 unsigned int vram_size
;
37 unsigned int memc_ctrl_reg
;
38 unsigned int number_mfm_drives
;
40 static int __init
parse_tag_acorn(const struct tag
*tag
)
42 memc_ctrl_reg
= tag
->u
.acorn
.memc_control_reg
;
43 number_mfm_drives
= tag
->u
.acorn
.adfsdrives
;
45 switch (tag
->u
.acorn
.vram_pages
) {
47 vram_size
+= PAGE_SIZE
* 256;
49 vram_size
+= PAGE_SIZE
* 256;
55 desc
->video_start
= 0x02000000;
56 desc
->video_end
= 0x02000000 + vram_size
;
62 __tagtable(ATAG_ACORN
, parse_tag_acorn
);
64 static struct map_desc rpc_io_desc
[] __initdata
= {
66 .virtual = SCREEN_BASE
,
67 .pfn
= __phys_to_pfn(SCREEN_START
),
71 .virtual = (u32
)IO_BASE
,
72 .pfn
= __phys_to_pfn(IO_START
),
77 .pfn
= __phys_to_pfn(EASI_START
),
83 static void __init
rpc_map_io(void)
85 iotable_init(rpc_io_desc
, ARRAY_SIZE(rpc_io_desc
));
93 * RiscPC can't handle half-word loads and stores
95 elf_hwcap
&= ~HWCAP_HALF
;
98 static struct resource acornfb_resources
[] = {
102 .flags
= IORESOURCE_MEM
,
104 .start
= IRQ_VSYNCPULSE
,
105 .end
= IRQ_VSYNCPULSE
,
106 .flags
= IORESOURCE_IRQ
,
110 static struct platform_device acornfb_device
= {
114 .coherent_dma_mask
= 0xffffffff,
116 .num_resources
= ARRAY_SIZE(acornfb_resources
),
117 .resource
= acornfb_resources
,
120 static struct resource iomd_resources
[] = {
124 .flags
= IORESOURCE_MEM
,
128 static struct platform_device iomd_device
= {
131 .num_resources
= ARRAY_SIZE(iomd_resources
),
132 .resource
= iomd_resources
,
135 static struct platform_device kbd_device
= {
139 .parent
= &iomd_device
.dev
,
143 static struct plat_serial8250_port serial_platform_data
[] = {
145 .mapbase
= 0x03010fe0,
150 .flags
= UPF_BOOT_AUTOCONF
| UPF_IOREMAP
| UPF_SKIP_TEST
,
155 static struct platform_device serial_device
= {
156 .name
= "serial8250",
157 .id
= PLAT8250_DEV_PLATFORM
,
159 .platform_data
= serial_platform_data
,
163 static struct pata_platform_info pata_platform_data
= {
167 static struct resource pata_resources
[] = {
171 .flags
= IORESOURCE_MEM
,
176 .flags
= IORESOURCE_MEM
,
179 .start
= IRQ_HARDDISK
,
181 .flags
= IORESOURCE_IRQ
,
185 static struct platform_device pata_device
= {
186 .name
= "pata_platform",
188 .num_resources
= ARRAY_SIZE(pata_resources
),
189 .resource
= pata_resources
,
191 .platform_data
= &pata_platform_data
,
192 .coherent_dma_mask
= ~0, /* grumble */
196 static struct platform_device
*devs
[] __initdata
= {
204 static int __init
rpc_init(void)
206 return platform_add_devices(devs
, ARRAY_SIZE(devs
));
209 arch_initcall(rpc_init
);
211 extern struct sys_timer ioc_timer
;
213 MACHINE_START(RISCPC
, "Acorn-RiscPC")
214 /* Maintainer: Russell King */
215 .phys_io
= 0x03000000,
216 .io_pg_offst
= ((0xe0000000) >> 18) & 0xfffc,
217 .boot_params
= 0x10000100,
220 .map_io
= rpc_map_io
,
221 .init_irq
= rpc_init_irq
,