http://downloads.netgear.com/files/GPL/GPL_Source_V361j_DM111PSP_series_consumer_rele...
[bcm963xx.git] / kernel / linux / arch / arm / mach-rpc / riscpc.c
1 /*
2  *  linux/arch/arm/mach-rpc/riscpc.c
3  *
4  *  Copyright (C) 1998-2001 Russell King
5  *
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.
9  *
10  *  Architecture specific fixups.
11  */
12 #include <linux/kernel.h>
13 #include <linux/tty.h>
14 #include <linux/delay.h>
15 #include <linux/pm.h>
16 #include <linux/init.h>
17 #include <linux/sched.h>
18 #include <linux/interrupt.h>
19
20 #include <asm/elf.h>
21 #include <asm/io.h>
22 #include <asm/mach-types.h>
23 #include <asm/hardware.h>
24 #include <asm/page.h>
25 #include <asm/domain.h>
26 #include <asm/setup.h>
27
28 #include <asm/mach/map.h>
29 #include <asm/mach/arch.h>
30 #include <asm/mach/time.h>
31
32 extern void rpc_init_irq(void);
33
34 extern unsigned int vram_size;
35
36 #if 0
37
38 unsigned int memc_ctrl_reg;
39 unsigned int number_mfm_drives;
40
41 static int __init parse_tag_acorn(const struct tag *tag)
42 {
43         memc_ctrl_reg = tag->u.acorn.memc_control_reg;
44         number_mfm_drives = tag->u.acorn.adfsdrives;
45
46         switch (tag->u.acorn.vram_pages) {
47         case 512:
48                 vram_size += PAGE_SIZE * 256;
49         case 256:
50                 vram_size += PAGE_SIZE * 256;
51         default:
52                 break;
53         }
54 #if 0
55         if (vram_size) {
56                 desc->video_start = 0x02000000;
57                 desc->video_end   = 0x02000000 + vram_size;
58         }
59 #endif
60         return 0;
61 }
62
63 __tagtable(ATAG_ACORN, parse_tag_acorn);
64
65 #endif
66
67 static struct map_desc rpc_io_desc[] __initdata = {
68  { SCREEN_BASE, SCREEN_START,   2*1048576, MT_DEVICE }, /* VRAM         */
69  { IO_BASE,     IO_START,       IO_SIZE  , MT_DEVICE }, /* IO space             */
70  { EASI_BASE,   EASI_START,     EASI_SIZE, MT_DEVICE }  /* EASI space   */
71 };
72
73 void __init rpc_map_io(void)
74 {
75         iotable_init(rpc_io_desc, ARRAY_SIZE(rpc_io_desc));
76
77         /*
78          * Turn off floppy.
79          */
80         outb(0xc, 0x3f2);
81
82         /*
83          * RiscPC can't handle half-word loads and stores
84          */
85         elf_hwcap &= ~HWCAP_HALF;
86 }
87
88 static irqreturn_t
89 rpc_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
90 {
91         timer_tick(regs);
92
93         return IRQ_HANDLED;
94 }
95
96 static struct irqaction rpc_timer_irq = {
97         .name           = "RiscPC Timer Tick",
98         .flags          = SA_INTERRUPT,
99         .handler        = rpc_timer_interrupt
100 };
101
102 /*
103  * Set up timer interrupt.
104  */
105 void __init rpc_init_time(void)
106 {
107         extern void ioctime_init(void);
108         ioctime_init();
109
110         setup_irq(IRQ_TIMER, &rpc_timer_irq);
111 }
112
113 MACHINE_START(RISCPC, "Acorn-RiscPC")
114         MAINTAINER("Russell King")
115         BOOT_MEM(0x10000000, 0x03000000, 0xe0000000)
116         BOOT_PARAMS(0x10000100)
117         DISABLE_PARPORT(0)
118         DISABLE_PARPORT(1)
119         MAPIO(rpc_map_io)
120         INITIRQ(rpc_init_irq)
121         INITTIME(rpc_init_time)
122 MACHINE_END