vserver 1.9.5.x5
[linux-2.6.git] / arch / arm / mach-footbridge / cats-hw.c
1 /*
2  * linux/arch/arm/mach-footbridge/cats-hw.c
3  *
4  * CATS machine fixup
5  *
6  * Copyright (C) 1998, 1999 Russell King, Phil Blundell
7  */
8 #include <linux/ioport.h>
9 #include <linux/kernel.h>
10 #include <linux/init.h>
11
12 #include <asm/hardware/dec21285.h>
13 #include <asm/io.h>
14 #include <asm/mach-types.h>
15 #include <asm/setup.h>
16
17 #include <asm/mach/arch.h>
18
19 #include "common.h"
20
21 #define CFG_PORT        0x370
22 #define INDEX_PORT      (CFG_PORT)
23 #define DATA_PORT       (CFG_PORT + 1)
24
25 static int __init cats_hw_init(void)
26 {
27         if (machine_is_cats()) {
28                 /* Set Aladdin to CONFIGURE mode */
29                 outb(0x51, CFG_PORT);
30                 outb(0x23, CFG_PORT);
31
32                 /* Select logical device 3 */
33                 outb(0x07, INDEX_PORT);
34                 outb(0x03, DATA_PORT);
35
36                 /* Set parallel port to DMA channel 3, ECP+EPP1.9, 
37                    enable EPP timeout */
38                 outb(0x74, INDEX_PORT);
39                 outb(0x03, DATA_PORT);
40         
41                 outb(0xf0, INDEX_PORT);
42                 outb(0x0f, DATA_PORT);
43
44                 outb(0xf1, INDEX_PORT);
45                 outb(0x07, DATA_PORT);
46
47                 /* Select logical device 4 */
48                 outb(0x07, INDEX_PORT);
49                 outb(0x04, DATA_PORT);
50
51                 /* UART1 high speed mode */
52                 outb(0xf0, INDEX_PORT);
53                 outb(0x02, DATA_PORT);
54
55                 /* Select logical device 5 */
56                 outb(0x07, INDEX_PORT);
57                 outb(0x05, DATA_PORT);
58
59                 /* UART2 high speed mode */
60                 outb(0xf0, INDEX_PORT);
61                 outb(0x02, DATA_PORT);
62
63                 /* Set Aladdin to RUN mode */
64                 outb(0xbb, CFG_PORT);
65         }
66
67         return 0;
68 }
69
70 __initcall(cats_hw_init);
71
72 /*
73  * CATS uses soft-reboot by default, since
74  * hard reboots fail on early boards.
75  */
76 static void __init
77 fixup_cats(struct machine_desc *desc, struct tag *tags,
78            char **cmdline, struct meminfo *mi)
79 {
80         ORIG_VIDEO_LINES  = 25;
81         ORIG_VIDEO_POINTS = 16;
82         ORIG_Y = 24;
83 }
84
85 MACHINE_START(CATS, "Chalice-CATS")
86         MAINTAINER("Philip Blundell")
87         BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000)
88         BOOT_PARAMS(0x00000100)
89         SOFT_REBOOT
90         FIXUP(fixup_cats)
91         MAPIO(footbridge_map_io)
92         INITIRQ(footbridge_init_irq)
93         .timer          = &isa_timer,
94 MACHINE_END