ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[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/io.h>
13 #include <asm/mach-types.h>
14
15 #define CFG_PORT        0x370
16 #define INDEX_PORT      (CFG_PORT)
17 #define DATA_PORT       (CFG_PORT + 1)
18
19 static int __init cats_hw_init(void)
20 {
21         if (machine_is_cats()) {
22                 /* Set Aladdin to CONFIGURE mode */
23                 outb(0x51, CFG_PORT);
24                 outb(0x23, CFG_PORT);
25
26                 /* Select logical device 3 */
27                 outb(0x07, INDEX_PORT);
28                 outb(0x03, DATA_PORT);
29
30                 /* Set parallel port to DMA channel 3, ECP+EPP1.9, 
31                    enable EPP timeout */
32                 outb(0x74, INDEX_PORT);
33                 outb(0x03, DATA_PORT);
34         
35                 outb(0xf0, INDEX_PORT);
36                 outb(0x0f, DATA_PORT);
37
38                 outb(0xf1, INDEX_PORT);
39                 outb(0x07, DATA_PORT);
40
41                 /* Select logical device 4 */
42                 outb(0x07, INDEX_PORT);
43                 outb(0x04, DATA_PORT);
44
45                 /* UART1 high speed mode */
46                 outb(0xf0, INDEX_PORT);
47                 outb(0x02, DATA_PORT);
48
49                 /* Select logical device 5 */
50                 outb(0x07, INDEX_PORT);
51                 outb(0x05, DATA_PORT);
52
53                 /* UART2 high speed mode */
54                 outb(0xf0, INDEX_PORT);
55                 outb(0x02, DATA_PORT);
56
57                 /* Set Aladdin to RUN mode */
58                 outb(0xbb, CFG_PORT);
59         }
60
61         return 0;
62 }
63
64 __initcall(cats_hw_init);