OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [arch/] [mips/] [sni/] [setup.c] - Blame information for rev 1275

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
/*
2
 * Setup pointers to hardware-dependent routines.
3
 *
4
 * This file is subject to the terms and conditions of the GNU General Public
5
 * License.  See the file "COPYING" in the main directory of this archive
6
 * for more details.
7
 *
8
 * Copyright (C) 1996, 1997, 1998, 2000 by Ralf Baechle
9
 */
10
#include <asm/ptrace.h>
11
#include <linux/config.h>
12
#include <linux/hdreg.h>
13
#include <linux/ioport.h>
14
#include <linux/sched.h>
15
#include <linux/init.h>
16
#include <linux/interrupt.h>
17
#include <linux/timex.h>
18
#include <linux/pci.h>
19
#include <linux/mc146818rtc.h>
20
#include <linux/console.h>
21
#include <linux/fb.h>
22
#include <linux/pc_keyb.h>
23
#include <linux/ide.h>
24
 
25
#include <asm/bcache.h>
26
#include <asm/bootinfo.h>
27
#include <asm/keyboard.h>
28
#include <asm/io.h>
29
#include <asm/irq.h>
30
#include <asm/processor.h>
31
#include <asm/reboot.h>
32
#include <asm/sni.h>
33
#include <asm/time.h>
34
#include <asm/traps.h>
35
 
36
extern void sni_machine_restart(char *command);
37
extern void sni_machine_halt(void);
38
extern void sni_machine_power_off(void);
39
 
40
extern struct ide_ops std_ide_ops;
41
extern struct rtc_ops std_rtc_ops;
42
extern struct kbd_ops std_kbd_ops;
43
 
44
static void __init sni_rm200_pci_time_init(struct irqaction *irq)
45
{
46
        /* set the clock to 100 Hz */
47
        outb_p(0x34,0x43);              /* binary, mode 2, LSB/MSB, ch 0 */
48
        outb_p(LATCH & 0xff , 0x40);    /* LSB */
49
        outb(LATCH >> 8 , 0x40);        /* MSB */
50
        setup_irq(0, irq);
51
}
52
 
53
 
54
extern unsigned char sni_map_isa_cache;
55
 
56
/*
57
 * A bit more gossip about the iron we're running on ...
58
 */
59
static inline void sni_pcimt_detect(void)
60
{
61
        char boardtype[80];
62
        unsigned char csmsr;
63
        char *p = boardtype;
64
        unsigned int asic;
65
 
66
        csmsr = *(volatile unsigned char *)PCIMT_CSMSR;
67
 
68
        p += sprintf(p, "%s PCI", (csmsr & 0x80) ? "RM200" : "RM300");
69
        if ((csmsr & 0x80) == 0)
70
                p += sprintf(p, ", board revision %s",
71
                             (csmsr & 0x20) ? "D" : "C");
72
        asic = csmsr & 0x80;
73
        asic = (csmsr & 0x08) ? asic : !asic;
74
        p += sprintf(p, ", ASIC PCI Rev %s", asic ? "1.0" : "1.1");
75
        printk("%s.\n", boardtype);
76
}
77
 
78
void __init sni_rm200_pci_setup(void)
79
{
80
        sni_pcimt_detect();
81
        sni_pcimt_sc_init();
82
 
83
        set_io_port_base(SNI_PORT_BASE);
84
 
85
        /*
86
         * Setup (E)ISA I/O memory access stuff
87
         */
88
        isa_slot_offset = 0xb0000000;
89
        // sni_map_isa_cache = 0;
90
        EISA_bus = 1;
91
 
92
        request_region(0x00,0x20,"dma1");
93
        request_region(0x40,0x20,"timer");
94
        /* XXX FIXME: CONFIG_RTC */
95
        request_region(0x70,0x10,"rtc");
96
        request_region(0x80,0x10,"dma page reg");
97
        request_region(0xc0,0x20,"dma2");
98
        board_time_init = sni_rm200_pci_time_init;
99
 
100
        _machine_restart = sni_machine_restart;
101
        _machine_halt = sni_machine_halt;
102
        _machine_power_off = sni_machine_power_off;
103
 
104
        aux_device_present = 0xaa;
105
 
106
        /*
107
         * Some cluefull person has placed the PCI config data directly in
108
         * the I/O port space ...
109
         */
110
        request_region(0xcfc,0x04,"PCI config data");
111
 
112
#ifdef CONFIG_BLK_DEV_IDE
113
        ide_ops = &std_ide_ops;
114
#endif
115
        conswitchp = &vga_con;
116
 
117
        screen_info = (struct screen_info) {
118
                0, 0,             /* orig-x, orig-y */
119
                0,               /* unused */
120
                52,             /* orig_video_page */
121
                3,              /* orig_video_mode */
122
                80,             /* orig_video_cols */
123
                4626, 3, 9,     /* unused, ega_bx, unused */
124
                50,             /* orig_video_lines */
125
                0x22,           /* orig_video_isVGA */
126
                16              /* orig_video_points */
127
        };
128
 
129
        rtc_ops = &std_rtc_ops;
130
        kbd_ops = &std_kbd_ops;
131
#ifdef CONFIG_PSMOUSE
132
        aux_device_present = 0xaa;
133
#endif
134
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.