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