MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / arch / arm / mach-footbridge / cats-hw.c
blob0aec69fb00ad3aec5620d7449426b4292ca95f9c
1 /*
2 * linux/arch/arm/mach-footbridge/cats-hw.c
4 * CATS machine fixup
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>
12 #include <asm/io.h>
13 #include <asm/mach-types.h>
15 #define CFG_PORT 0x370
16 #define INDEX_PORT (CFG_PORT)
17 #define DATA_PORT (CFG_PORT + 1)
19 static int __init cats_hw_init(void)
21 if (machine_is_cats()) {
22 /* Set Aladdin to CONFIGURE mode */
23 outb(0x51, CFG_PORT);
24 outb(0x23, CFG_PORT);
26 /* Select logical device 3 */
27 outb(0x07, INDEX_PORT);
28 outb(0x03, DATA_PORT);
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);
35 outb(0xf0, INDEX_PORT);
36 outb(0x0f, DATA_PORT);
38 outb(0xf1, INDEX_PORT);
39 outb(0x07, DATA_PORT);
41 /* Select logical device 4 */
42 outb(0x07, INDEX_PORT);
43 outb(0x04, DATA_PORT);
45 /* UART1 high speed mode */
46 outb(0xf0, INDEX_PORT);
47 outb(0x02, DATA_PORT);
49 /* Select logical device 5 */
50 outb(0x07, INDEX_PORT);
51 outb(0x05, DATA_PORT);
53 /* UART2 high speed mode */
54 outb(0xf0, INDEX_PORT);
55 outb(0x02, DATA_PORT);
57 /* Set Aladdin to RUN mode */
58 outb(0xbb, CFG_PORT);
61 return 0;
64 __initcall(cats_hw_init);