Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | /* |
| 3 | * linux/arch/arm/mach-footbridge/cats-hw.c |
| 4 | * |
| 5 | * CATS machine fixup |
| 6 | * |
| 7 | * Copyright (C) 1998, 1999 Russell King, Phil Blundell |
| 8 | */ |
| 9 | #include <linux/ioport.h> |
| 10 | #include <linux/kernel.h> |
| 11 | #include <linux/init.h> |
Russell King | b1c495f | 2006-07-14 16:23:33 +0100 | [diff] [blame] | 12 | #include <linux/screen_info.h> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 13 | #include <linux/io.h> |
Russell King | 70d13e0 | 2008-12-06 08:25:16 +0000 | [diff] [blame] | 14 | #include <linux/spinlock.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | |
| 16 | #include <asm/hardware/dec21285.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | #include <asm/mach-types.h> |
| 18 | #include <asm/setup.h> |
| 19 | |
| 20 | #include <asm/mach/arch.h> |
| 21 | |
| 22 | #include "common.h" |
| 23 | |
| 24 | #define CFG_PORT 0x370 |
| 25 | #define INDEX_PORT (CFG_PORT) |
| 26 | #define DATA_PORT (CFG_PORT + 1) |
| 27 | |
| 28 | static int __init cats_hw_init(void) |
| 29 | { |
| 30 | if (machine_is_cats()) { |
| 31 | /* Set Aladdin to CONFIGURE mode */ |
| 32 | outb(0x51, CFG_PORT); |
| 33 | outb(0x23, CFG_PORT); |
| 34 | |
| 35 | /* Select logical device 3 */ |
| 36 | outb(0x07, INDEX_PORT); |
| 37 | outb(0x03, DATA_PORT); |
| 38 | |
| 39 | /* Set parallel port to DMA channel 3, ECP+EPP1.9, |
| 40 | enable EPP timeout */ |
| 41 | outb(0x74, INDEX_PORT); |
| 42 | outb(0x03, DATA_PORT); |
| 43 | |
| 44 | outb(0xf0, INDEX_PORT); |
| 45 | outb(0x0f, DATA_PORT); |
| 46 | |
| 47 | outb(0xf1, INDEX_PORT); |
| 48 | outb(0x07, DATA_PORT); |
| 49 | |
| 50 | /* Select logical device 4 */ |
| 51 | outb(0x07, INDEX_PORT); |
| 52 | outb(0x04, DATA_PORT); |
| 53 | |
| 54 | /* UART1 high speed mode */ |
| 55 | outb(0xf0, INDEX_PORT); |
| 56 | outb(0x02, DATA_PORT); |
| 57 | |
| 58 | /* Select logical device 5 */ |
| 59 | outb(0x07, INDEX_PORT); |
| 60 | outb(0x05, DATA_PORT); |
| 61 | |
| 62 | /* UART2 high speed mode */ |
| 63 | outb(0xf0, INDEX_PORT); |
| 64 | outb(0x02, DATA_PORT); |
| 65 | |
| 66 | /* Set Aladdin to RUN mode */ |
| 67 | outb(0xbb, CFG_PORT); |
| 68 | } |
| 69 | |
| 70 | return 0; |
| 71 | } |
| 72 | |
| 73 | __initcall(cats_hw_init); |
| 74 | |
| 75 | /* |
| 76 | * CATS uses soft-reboot by default, since |
| 77 | * hard reboots fail on early boards. |
| 78 | */ |
| 79 | static void __init |
Laura Abbott | 1c2f87c | 2014-04-13 22:54:58 +0100 | [diff] [blame] | 80 | fixup_cats(struct tag *tags, char **cmdline) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | { |
Arnd Bergmann | 617d146 | 2014-03-15 11:30:18 +0100 | [diff] [blame] | 82 | #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE) |
H. Peter Anvin | 3ea3351 | 2007-10-16 22:36:04 -0700 | [diff] [blame] | 83 | screen_info.orig_video_lines = 25; |
| 84 | screen_info.orig_video_points = 16; |
| 85 | screen_info.orig_y = 24; |
Arnd Bergmann | 617d146 | 2014-03-15 11:30:18 +0100 | [diff] [blame] | 86 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | } |
| 88 | |
| 89 | MACHINE_START(CATS, "Chalice-CATS") |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 90 | /* Maintainer: Philip Blundell */ |
Nicolas Pitre | 93ef888 | 2011-07-05 22:38:11 -0400 | [diff] [blame] | 91 | .atag_offset = 0x100, |
Robin Holt | 16d6d5b | 2013-07-08 16:01:39 -0700 | [diff] [blame] | 92 | .reboot_mode = REBOOT_SOFT, |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 93 | .fixup = fixup_cats, |
| 94 | .map_io = footbridge_map_io, |
| 95 | .init_irq = footbridge_init_irq, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 96 | .init_time = isa_timer_init, |
Russell King | 6fca1e1 | 2011-11-03 19:47:54 +0000 | [diff] [blame] | 97 | .restart = footbridge_restart, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | MACHINE_END |