blob: 6a5b437ab86ffdfd03c66527ea2331bfa4f4c7d9 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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>
Russell Kingb1c495f2006-07-14 16:23:33 +010011#include <linux/screen_info.h>
Russell Kingfced80c2008-09-06 12:10:45 +010012#include <linux/io.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
14#include <asm/hardware/dec21285.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#include <asm/mach-types.h>
16#include <asm/setup.h>
17
18#include <asm/mach/arch.h>
19
20#include "common.h"
21
22#define CFG_PORT 0x370
23#define INDEX_PORT (CFG_PORT)
24#define DATA_PORT (CFG_PORT + 1)
25
26static int __init cats_hw_init(void)
27{
28 if (machine_is_cats()) {
29 /* Set Aladdin to CONFIGURE mode */
30 outb(0x51, CFG_PORT);
31 outb(0x23, CFG_PORT);
32
33 /* Select logical device 3 */
34 outb(0x07, INDEX_PORT);
35 outb(0x03, DATA_PORT);
36
37 /* Set parallel port to DMA channel 3, ECP+EPP1.9,
38 enable EPP timeout */
39 outb(0x74, INDEX_PORT);
40 outb(0x03, DATA_PORT);
41
42 outb(0xf0, INDEX_PORT);
43 outb(0x0f, DATA_PORT);
44
45 outb(0xf1, INDEX_PORT);
46 outb(0x07, DATA_PORT);
47
48 /* Select logical device 4 */
49 outb(0x07, INDEX_PORT);
50 outb(0x04, DATA_PORT);
51
52 /* UART1 high speed mode */
53 outb(0xf0, INDEX_PORT);
54 outb(0x02, DATA_PORT);
55
56 /* Select logical device 5 */
57 outb(0x07, INDEX_PORT);
58 outb(0x05, DATA_PORT);
59
60 /* UART2 high speed mode */
61 outb(0xf0, INDEX_PORT);
62 outb(0x02, DATA_PORT);
63
64 /* Set Aladdin to RUN mode */
65 outb(0xbb, CFG_PORT);
66 }
67
68 return 0;
69}
70
71__initcall(cats_hw_init);
72
73/*
74 * CATS uses soft-reboot by default, since
75 * hard reboots fail on early boards.
76 */
77static void __init
78fixup_cats(struct machine_desc *desc, struct tag *tags,
79 char **cmdline, struct meminfo *mi)
80{
H. Peter Anvin3ea33512007-10-16 22:36:04 -070081 screen_info.orig_video_lines = 25;
82 screen_info.orig_video_points = 16;
83 screen_info.orig_y = 24;
Linus Torvalds1da177e2005-04-16 15:20:36 -070084}
85
86MACHINE_START(CATS, "Chalice-CATS")
Russell Kinge9dea0c2005-07-03 17:38:58 +010087 /* Maintainer: Philip Blundell */
Russell Kinge9dea0c2005-07-03 17:38:58 +010088 .phys_io = DC21285_ARMCSR_BASE,
89 .io_pg_offst = ((0xfe000000) >> 18) & 0xfffc,
90 .boot_params = 0x00000100,
91 .soft_reboot = 1,
92 .fixup = fixup_cats,
93 .map_io = footbridge_map_io,
94 .init_irq = footbridge_init_irq,
Linus Torvalds1da177e2005-04-16 15:20:36 -070095 .timer = &isa_timer,
96MACHINE_END