summaryrefslogtreecommitdiffstats
path: root/private/ntos/fw/mips/jxsysid.c
blob: 0c04e41df648c970021879bf18ddc9245c75025f (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
#if defined(JAZZ)

/*++

Copyright (c) 1991  Microsoft Corporation

Module Name:

    jxsysid.c

Abstract:

    This module implements the ARC firmware System ID Query functions as
    described in the Advanced Risc Computing Specification (Revision 1.00),
    section 3.3.3.5, for a MIPS R3000 or R4000 Jazz system.

Author:

    David M. Robinson (davidro) 11-July-1991


Revision History:

--*/

#include "fwp.h"

//
// Define the system identifier.
//

SYSTEM_ID SystemId;

VOID
FwSystemIdInitialize (
    VOID
    )

/*++

Routine Description:

    This routine initializes the system identifer routine address.

Arguments:

    None.

Return Value:

    None.

--*/
{
    //
    // Initialize the system identifier routine address in the system
    // parameter block.
    //

    (PARC_GET_SYSTEM_ID_ROUTINE)SYSTEM_BLOCK->FirmwareVector[GetSystemIdRoutine] =
                                                            FwGetSystemId;

    (PARC_FLUSH_ALL_CACHES_ROUTINE)SYSTEM_BLOCK->FirmwareVector[FlushAllCachesRoutine] =
                                                            FwFlushAllCaches;

    return;
}


PSYSTEM_ID
FwGetSystemId (
    VOID
    )

/*++

Routine Description:

    This function returns the system ID, which consists of an eight byte
    VendorId and an eight byte ProductId (in this case the ethernet address).

Arguments:

    None.

Return Value:

    Returns a pointer to a buffer containing the system id structure.  This
    structure is initialized on each call to prevent programs from changing
    the value.

--*/

{
    PUCHAR NvramSystemId;
    ULONG Index;

#ifdef DUO
    CHAR SystemIdString[] = "MIPS DUO";
#else
    CHAR SystemIdString[] = "MIPS MAG";
#endif

    NvramSystemId = (PUCHAR)NVRAM_SYSTEM_ID;

    for ( Index = 0 ; Index < 8 ; Index++ ) {
        SystemId.ProductId[Index] = *NvramSystemId++;
    }

    for ( Index = 0 ; Index < 8 ; Index++ ) {
        SystemId.VendorId[Index] = SystemIdString[Index];
    }

    return &SystemId;
}


VOID
FwFlushAllCaches (
    VOID
    )

/*++

Routine Description:

    TEMPTEMP Fix this up soon!!
Arguments:

    None.

Return Value:


--*/

{

    HalSweepIcache();
    HalSweepDcache();
    return;
}

#endif