Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * linux/arch/arm/mach-footbridge/cats-hw.c
0004  *
0005  * CATS machine fixup
0006  *
0007  * Copyright (C) 1998, 1999 Russell King, Phil Blundell
0008  */
0009 #include <linux/ioport.h>
0010 #include <linux/kernel.h>
0011 #include <linux/init.h>
0012 #include <linux/screen_info.h>
0013 #include <linux/io.h>
0014 #include <linux/spinlock.h>
0015 
0016 #include <asm/hardware/dec21285.h>
0017 #include <asm/mach-types.h>
0018 #include <asm/setup.h>
0019 
0020 #include <asm/mach/arch.h>
0021 
0022 #include "common.h"
0023 
0024 #define CFG_PORT    0x370
0025 #define INDEX_PORT  (CFG_PORT)
0026 #define DATA_PORT   (CFG_PORT + 1)
0027 
0028 static int __init cats_hw_init(void)
0029 {
0030     if (machine_is_cats()) {
0031         /* Set Aladdin to CONFIGURE mode */
0032         outb(0x51, CFG_PORT);
0033         outb(0x23, CFG_PORT);
0034 
0035         /* Select logical device 3 */
0036         outb(0x07, INDEX_PORT);
0037         outb(0x03, DATA_PORT);
0038 
0039         /* Set parallel port to DMA channel 3, ECP+EPP1.9, 
0040            enable EPP timeout */
0041         outb(0x74, INDEX_PORT);
0042         outb(0x03, DATA_PORT);
0043     
0044         outb(0xf0, INDEX_PORT);
0045         outb(0x0f, DATA_PORT);
0046 
0047         outb(0xf1, INDEX_PORT);
0048         outb(0x07, DATA_PORT);
0049 
0050         /* Select logical device 4 */
0051         outb(0x07, INDEX_PORT);
0052         outb(0x04, DATA_PORT);
0053 
0054         /* UART1 high speed mode */
0055         outb(0xf0, INDEX_PORT);
0056         outb(0x02, DATA_PORT);
0057 
0058         /* Select logical device 5 */
0059         outb(0x07, INDEX_PORT);
0060         outb(0x05, DATA_PORT);
0061 
0062         /* UART2 high speed mode */
0063         outb(0xf0, INDEX_PORT);
0064         outb(0x02, DATA_PORT);
0065 
0066         /* Set Aladdin to RUN mode */
0067         outb(0xbb, CFG_PORT);
0068     }
0069 
0070     return 0;
0071 }
0072 
0073 __initcall(cats_hw_init);
0074 
0075 /*
0076  * CATS uses soft-reboot by default, since
0077  * hard reboots fail on early boards.
0078  */
0079 static void __init
0080 fixup_cats(struct tag *tags, char **cmdline)
0081 {
0082 #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
0083     screen_info.orig_video_lines  = 25;
0084     screen_info.orig_video_points = 16;
0085     screen_info.orig_y = 24;
0086 #endif
0087 }
0088 
0089 MACHINE_START(CATS, "Chalice-CATS")
0090     /* Maintainer: Philip Blundell */
0091     .atag_offset    = 0x100,
0092     .reboot_mode    = REBOOT_SOFT,
0093     .fixup      = fixup_cats,
0094     .map_io     = footbridge_map_io,
0095     .init_irq   = footbridge_init_irq,
0096     .init_time  = isa_timer_init,
0097     .restart    = footbridge_restart,
0098 MACHINE_END