ReactOS 0.4.15-dev-7842-g558ab78
superio.h
Go to the documentation of this file.
1/*
2 * PROJECT: Original Xbox onboard hardware
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: SMSC LPC47M157 (Super I/O) header file
5 * COPYRIGHT: Copyright 2020 Stanislav Motylkov (x86corez@gmail.com)
6 */
7
8#ifndef _SUPERIO_H_
9#define _SUPERIO_H_
10
11#pragma once
12
13/*
14 * Registers and definitions
15 */
16#define LPC_IO_BASE 0x2E
17
18#define LPC_ENTER_CONFIG_KEY 0x55
19#define LPC_EXIT_CONFIG_KEY 0xAA
20
21#define LPC_DEVICE_FDD 0x0
22#define LPC_DEVICE_PARALLEL_PORT 0x3
23#define LPC_DEVICE_SERIAL_PORT_1 0x4
24#define LPC_DEVICE_SERIAL_PORT_2 0x5
25#define LPC_DEVICE_KEYBOARD 0x7
26#define LPC_DEVICE_GAME_PORT 0x9
27#define LPC_DEVICE_PME 0xA
28#define LPC_DEVICE_MPU_401 0xB
29
30#define LPC_CONFIG_DEVICE_NUMBER 0x07
31#define LPC_CONFIG_DEVICE_ACTIVATE 0x30
32#define LPC_CONFIG_DEVICE_BASE_ADDRESS_HIGH 0x60
33#define LPC_CONFIG_DEVICE_BASE_ADDRESS_LOW 0x61
34#define LPC_CONFIG_DEVICE_INTERRUPT_PRIMARY 0x70
35#define LPC_CONFIG_DEVICE_INTERRUPT_SECONDARY 0x72
36#define LPC_CONFIG_DEVICE_DMA_CHANNEL 0x74
37
38/*
39 * Functions
40 */
42VOID
44{
45 /* Enter Configuration */
47}
48
50VOID
52{
53 /* Exit Configuration */
55}
56
60{
62 return READ_PORT_UCHAR((PUCHAR)(LPC_IO_BASE + 1));
63}
64
66VOID
68{
71}
72
73#ifndef _BLDR_
77{
79
81
83 return 0;
84
86 return 0;
87
89
90 return LPC_IO_BASE;
91}
92#endif
93
97{
98 ULONG Base = 0;
99
100 // Read LSB
102 // Read MSB
104
105 return Base;
106}
107
108#ifndef _BLDR_
110ULONG
112{
113 ULONG Base = 0;
114
115 // Read LSB
117 // Read MSB
119
120 return Base;
121}
122#endif
123
125ULONG
127{
129}
130
131#ifndef _BLDR_
133ULONG
135{
137}
138
140ULONG
142{
144}
145#endif
146
147#endif /* _SUPERIO_H_ */
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2439
#define READ_PORT_UCHAR(p)
Definition: pc98vid.h:22
#define WRITE_PORT_UCHAR(p, d)
Definition: pc98vid.h:21
#define LPC_EXIT_CONFIG_KEY
Definition: superio.h:19
#define LPC_CONFIG_DEVICE_NUMBER
Definition: superio.h:30
FORCEINLINE ULONG LpcDetectSuperIO(VOID)
Definition: superio.h:76
#define LPC_CONFIG_DEVICE_BASE_ADDRESS_LOW
Definition: superio.h:33
#define LPC_CONFIG_DEVICE_ACTIVATE
Definition: superio.h:31
FORCEINLINE ULONG LpcGetIoBase(VOID)
Definition: superio.h:96
FORCEINLINE ULONG LpcGetIoBaseMPU(VOID)
Definition: superio.h:111
#define LPC_CONFIG_DEVICE_INTERRUPT_SECONDARY
Definition: superio.h:35
FORCEINLINE ULONG LpcGetIrqPrimary(VOID)
Definition: superio.h:126
#define LPC_CONFIG_DEVICE_DMA_CHANNEL
Definition: superio.h:36
#define LPC_CONFIG_DEVICE_INTERRUPT_PRIMARY
Definition: superio.h:34
#define LPC_ENTER_CONFIG_KEY
Definition: superio.h:18
FORCEINLINE ULONG LpcGetDmaChannel(VOID)
Definition: superio.h:141
FORCEINLINE UCHAR LpcReadRegister(UCHAR Register)
Definition: superio.h:59
#define LPC_CONFIG_DEVICE_BASE_ADDRESS_HIGH
Definition: superio.h:32
FORCEINLINE ULONG LpcGetIrqSecondary(VOID)
Definition: superio.h:134
#define LPC_DEVICE_SERIAL_PORT_1
Definition: superio.h:23
FORCEINLINE VOID LpcWriteRegister(UCHAR Register, UCHAR Value)
Definition: superio.h:67
FORCEINLINE VOID LpcExitConfig(VOID)
Definition: superio.h:51
FORCEINLINE VOID LpcEnterConfig(VOID)
Definition: superio.h:43
#define LPC_IO_BASE
Definition: superio.h:16
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
#define FORCEINLINE
Definition: wdftypes.h:67
unsigned char UCHAR
Definition: xmlstorage.h:181