import of upstream 2.4.34.4 from kernel.org
[linux-2.4.git] / arch / arm / mach-footbridge / arch.c
1 /*
2  * linux/arch/arm/mach-footbridge/arch.c
3  *
4  * Architecture specific fixups.  This is where any
5  * parameters in the params struct are fixed up, or
6  * any additional architecture specific information
7  * is pulled from the params struct.
8  */
9 #include <linux/config.h>
10 #include <linux/module.h>
11 #include <linux/tty.h>
12 #include <linux/delay.h>
13 #include <linux/pm.h>
14 #include <linux/init.h>
15
16 #include <asm/hardware/dec21285.h>
17 #include <asm/elf.h>
18 #include <asm/setup.h>
19 #include <asm/mach-types.h>
20
21 #include <asm/mach/arch.h>
22
23 extern void footbridge_map_io(void);
24 extern void footbridge_init_irq(void);
25
26 unsigned int mem_fclk_21285 = 50000000;
27
28 EXPORT_SYMBOL(mem_fclk_21285);
29
30 static int __init parse_tag_memclk(const struct tag *tag)
31 {
32         mem_fclk_21285 = tag->u.memclk.fmemclk;
33         return 0;
34 }
35
36 __tagtable(ATAG_MEMCLK, parse_tag_memclk);
37
38 #ifdef CONFIG_ARCH_EBSA285
39
40 static void __init
41 fixup_ebsa285(struct machine_desc *desc, struct param_struct *params,
42               char **cmdline, struct meminfo *mi)
43 {
44 #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
45         ORIG_X           = params->u1.s.video_x;
46         ORIG_Y           = params->u1.s.video_y;
47         ORIG_VIDEO_COLS  = params->u1.s.video_num_cols;
48         ORIG_VIDEO_LINES = params->u1.s.video_num_rows;
49 #endif
50 }
51
52 MACHINE_START(EBSA285, "EBSA285")
53         MAINTAINER("Russell King")
54         BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000)
55         BOOT_PARAMS(0x00000100)
56         VIDEO(0x000a0000, 0x000bffff)
57         FIXUP(fixup_ebsa285)
58         MAPIO(footbridge_map_io)
59         INITIRQ(footbridge_init_irq)
60 MACHINE_END
61 #endif
62
63 #ifdef CONFIG_ARCH_NETWINDER
64 /*
65  * Older NeTTroms either do not provide a parameters
66  * page, or they don't supply correct information in
67  * the parameter page.
68  */
69 static void __init
70 fixup_netwinder(struct machine_desc *desc, struct param_struct *params,
71                 char **cmdline, struct meminfo *mi)
72 {
73 #ifdef CONFIG_ISAPNP
74         extern int isapnp_disable;
75
76         /*
77          * We must not use the kernels ISAPnP code
78          * on the NetWinder - it will reset the settings
79          * for the WaveArtist chip and render it inoperable.
80          */
81         isapnp_disable = 1;
82 #endif
83
84         if (params->u1.s.nr_pages != 0x02000 &&
85             params->u1.s.nr_pages != 0x04000 &&
86             params->u1.s.nr_pages != 0x08000 &&
87             params->u1.s.nr_pages != 0x10000) {
88                 printk(KERN_WARNING "Warning: bad NeTTrom parameters "
89                        "detected, using defaults\n");
90
91                 params->u1.s.nr_pages = 0x1000; /* 16MB */
92                 params->u1.s.ramdisk_size = 0;
93                 params->u1.s.flags = FLAG_READONLY;
94                 params->u1.s.initrd_start = 0;
95                 params->u1.s.initrd_size = 0;
96                 params->u1.s.rd_start = 0;
97         }
98 }
99
100 MACHINE_START(NETWINDER, "Rebel-NetWinder")
101         MAINTAINER("Russell King/Rebel.com")
102         BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000)
103         BOOT_PARAMS(0x00000100)
104         VIDEO(0x000a0000, 0x000bffff)
105         DISABLE_PARPORT(0)
106         DISABLE_PARPORT(2)
107         FIXUP(fixup_netwinder)
108         MAPIO(footbridge_map_io)
109         INITIRQ(footbridge_init_irq)
110 MACHINE_END
111 #endif
112
113 #ifdef CONFIG_ARCH_CATS
114 /*
115  * CATS uses soft-reboot by default, since
116  * hard reboots fail on early boards.
117  */
118 static void __init
119 fixup_cats(struct machine_desc *desc, struct param_struct *unused,
120            char **cmdline, struct meminfo *mi)
121 {
122         ORIG_VIDEO_LINES  = 25;
123         ORIG_VIDEO_POINTS = 16;
124         ORIG_Y = 24;
125 }
126
127 MACHINE_START(CATS, "Chalice-CATS")
128         MAINTAINER("Philip Blundell")
129         BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000)
130         BOOT_PARAMS(0x00000100)
131         SOFT_REBOOT
132         FIXUP(fixup_cats)
133         MAPIO(footbridge_map_io)
134         INITIRQ(footbridge_init_irq)
135 MACHINE_END
136 #endif
137
138 #ifdef CONFIG_ARCH_CO285
139
140 static void __init
141 fixup_coebsa285(struct machine_desc *desc, struct param_struct *unused,
142                 char **cmdline, struct meminfo *mi)
143 {
144         extern unsigned long boot_memory_end;
145         extern char boot_command_line[];
146
147         mi->nr_banks      = 1;
148         mi->bank[0].start = PHYS_OFFSET;
149         mi->bank[0].size  = boot_memory_end;
150         mi->bank[0].node  = 0;
151
152         *cmdline = boot_command_line;
153 }
154
155 MACHINE_START(CO285, "co-EBSA285")
156         MAINTAINER("Mark van Doesburg")
157         BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0x7cf00000)
158         FIXUP(fixup_coebsa285)
159         MAPIO(footbridge_map_io)
160         INITIRQ(footbridge_init_irq)
161 MACHINE_END
162 #endif
163
164 #ifdef CONFIG_ARCH_PERSONAL_SERVER
165 MACHINE_START(PERSONAL_SERVER, "Compaq-PersonalServer")
166         MAINTAINER("Jamey Hicks / George France")
167         BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000)
168         BOOT_PARAMS(0x00000100)
169         MAPIO(footbridge_map_io)
170         INITIRQ(footbridge_init_irq)
171 MACHINE_END
172 #endif