blob: 25b453601accc98e403f061b66762df8be65389f [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>
Russell King70d13e02008-12-06 08:25:16 +000013#include <linux/spinlock.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
15#include <asm/hardware/dec21285.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070016#include <asm/mach-types.h>
17#include <asm/setup.h>
18
19#include <asm/mach/arch.h>
20
21#include "common.h"
22
23#define CFG_PORT 0x370
24#define INDEX_PORT (CFG_PORT)
25#define DATA_PORT (CFG_PORT + 1)
26
27static int __init cats_hw_init(void)
28{
29 if (machine_is_cats()) {
30 /* Set Aladdin to CONFIGURE mode */
31 outb(0x51, CFG_PORT);
32 outb(0x23, CFG_PORT);
33
34 /* Select logical device 3 */
35 outb(0x07, INDEX_PORT);
36 outb(0x03, DATA_PORT);
37
38 /* Set parallel port to DMA channel 3, ECP+EPP1.9,
39 enable EPP timeout */
40 outb(0x74, INDEX_PORT);
41 outb(0x03, DATA_PORT);
42
43 outb(0xf0, INDEX_PORT);
44 outb(0x0f, DATA_PORT);
45
46 outb(0xf1, INDEX_PORT);
47 outb(0x07, DATA_PORT);
48
49 /* Select logical device 4 */
50 outb(0x07, INDEX_PORT);
51 outb(0x04, DATA_PORT);
52
53 /* UART1 high speed mode */
54 outb(0xf0, INDEX_PORT);
55 outb(0x02, DATA_PORT);
56
57 /* Select logical device 5 */
58 outb(0x07, INDEX_PORT);
59 outb(0x05, DATA_PORT);
60
61 /* UART2 high speed mode */
62 outb(0xf0, INDEX_PORT);
63 outb(0x02, DATA_PORT);
64
65 /* Set Aladdin to RUN mode */
66 outb(0xbb, CFG_PORT);
67 }
68
69 return 0;
70}
71
72__initcall(cats_hw_init);
73
74/*
75 * CATS uses soft-reboot by default, since
76 * hard reboots fail on early boards.
77 */
78static void __init
Russell King0744a3e2010-12-20 10:37:50 +000079fixup_cats(struct tag *tags, char **cmdline, struct meminfo *mi)
Linus Torvalds1da177e2005-04-16 15:20:36 -070080{
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 */
Nicolas Pitre93ef8882011-07-05 22:38:11 -040088 .atag_offset = 0x100,
Russell Kingb44c3502011-11-01 14:27:33 +000089 .restart_mode = 's',
Russell Kinge9dea0c2005-07-03 17:38:58 +010090 .fixup = fixup_cats,
91 .map_io = footbridge_map_io,
92 .init_irq = footbridge_init_irq,
Linus Torvalds1da177e2005-04-16 15:20:36 -070093 .timer = &isa_timer,
Russell King6fca1e172011-11-03 19:47:54 +000094 .restart = footbridge_restart,
Linus Torvalds1da177e2005-04-16 15:20:36 -070095MACHINE_END