summaryrefslogtreecommitdiffstats
path: root/private/ntos/nthals/halr98mp/mips/jxmapio.c
blob: 6304228b11d6790c20cd46ec73e314abbd089856 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#ident	"@(#) NEC jxmapio.c 1.6 94/10/17 11:37:41"
/*++

Copyright (c) 1991-1994  Microsoft Corporation

Module Name:

    jxmapio.c

Abstract:

    This module implements the mapping of HAL I/O space a MIPS R3000
    or R4000 Jazz system.

Environment:

    Kernel mode

Revision History:

--*/

/*
 *	Original source: Build Number 1.612
 *
 *	Modify for R98(MIPS/R4400)
 *
 ***********************************************************************
 *
 * S001		94.06/02		T.Samezima
 *
 *	Del	I/O space mapping
 *
 *	Add	set kseg1 base I/O address 
 *
 ***********************************************************************
 *
 * S002		94.6/10			T.Samezima
 *
 *	Del	Compile err
 *
 ***********************************************************************
 *
 * S003		94.7/5			T.Samezima
 *
 *	Del	Error check
 *
 * K000		94/10/11		N.Kugimoto
 *	Fix	807 Base
 */

#include "halp.h"

//
// Put all code for HAL initialization in the INIT section. It will be
// deallocated by memory management when phase 1 initialization is
// completed.
//

#if defined(ALLOC_PRAGMA)

#pragma alloc_text(INIT, HalpMapIoSpace)

#endif

//
// Define global data used to locate the EISA control space and the realtime
// clock registers.
//

PVOID HalpEisaControlBase;
PVOID HalpEisaMemoryBase;	//K000
PVOID HalpRealTimeClockBase;

BOOLEAN
HalpMapIoSpace (
    VOID
    )

/*++

Routine Description:

    This routine maps the HAL I/O space for a MIPS R3000 or R4000 Jazz
    system.

Arguments:

    None.

Return Value:

    If the initialization is successfully completed, than a value of TRUE
    is returned. Otherwise, a value of FALSE is returned.

--*/

{
    /* Start M001 */
#if !defined(_R98_)
    PHYSICAL_ADDRESS physicalAddress;

    //
    // Map EISA control space. Map all 16 slots.  This is done so the NMI
    // code can probe the cards.
    //

    physicalAddress.HighPart = 0;
    physicalAddress.LowPart = EISA_CONTROL_PHYSICAL_BASE;
    HalpEisaControlBase = MmMapIoSpace(physicalAddress,
                                       PAGE_SIZE * 16,
                                       FALSE);

    //
    // Map realtime clock registers.
    //

    physicalAddress.LowPart = RTCLOCK_PHYSICAL_BASE;
    HalpRealTimeClockBase = MmMapIoSpace(physicalAddress,
                                         PAGE_SIZE,
                                         FALSE);
#else // #if !defined(_R98_)

    //
    // set EISA control space.
    //

    HalpEisaControlBase = (PVOID)(KSEG1_BASE + EISA_CONTROL_PHYSICAL_BASE); // S002

    //
    // set realtime clock registers.
    //

    HalpRealTimeClockBase = (PVOID)(KSEG1_BASE + RTCLOCK_PHYSICAL_BASE); // S002

#endif // #if !defined(_R98_)
    /* End M001 */

    //
    // If either mapped address is NULL, then return FALSE as the function
    // value. Otherwise, return TRUE.
    //

    /* Start S003 */
//    if ((HalpEisaControlBase == NULL) ||
//        (HalpRealTimeClockBase == NULL)) {
//        return FALSE;
//    } else {
//        return TRUE;
//    }
    return TRUE;
    /* End S003 */
}