summaryrefslogtreecommitdiff
path: root/Vlv2TbltDevicePkg/Wpce791/LpcSio.h
blob: 52c1499e3d865f66bee0ff7c62b6b5e819f1d720 (plain)
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
/*++

  Copyright (c) 2004  - 2014, Intel Corporation. All rights reserved.<BR>
                                                                                   

  SPDX-License-Identifier: BSD-2-Clause-Patent

                                                                                   


Module Name:

    LpcSio.h

Abstract:

    Lpc driver's sio interface



--*/

#ifndef _LPC_SIO_H
#define _LPC_SIO_H

#include "Protocol/PciRootBridgeIo.h"

#define VARSIOINSTALLED L"VarSIOProcotolInstalled"

//
// Port address
//
#define CONFIG_PORT               0x04E
#define INDEX_PORT                0x04E
#define DATA_PORT                 INDEX_PORT + 1

//
// Logical Device
//
#define SIO_COM                   0x3
#define SIO_MSWC                  0x4
#define SIO_MOUSE                 0x5
#define SIO_KEYBOARD              0x6
#define SIO_SHM                   0xF
#define SIO_PM1                   0x11
#define SIO_PM2                   0x12
#define SIO_PM3                   0x17
#define SIO_ESHM                  0x1D

//
// Global register
//
#define REG_LOGICAL_DEVICE        0x07
#define REG_DEVICE_ID             0x20
#define SIO_CONFIG_1              0x21
#define REG_CHIP_REV              0x24
#define SIO_CONFIG_5              0x25
#define SIO_CONFIG_6              0x26
#define REG_DEVICE_REV            0x27
#define SIO_CONFIG_9              0x29
#define SIO_CONFIG_D              0x2D

#define ACTIVATE                  0x30
#define BASE_ADDRESS_HIGH         0x60
#define BASE_ADDRESS_LOW          0x61
#define BASE_ADDRESS_HIGH2        0x62
#define BASE_ADDRESS_LOW2         0x63
#define PRIMARY_INTERRUPT_SELECT  0x70
#define DMA_CHANNEL_SELECT        0x74

EFI_STATUS
InitializeLpcSio (
  IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL  *RootBridgeIo
  );

//
// Prototypes for the sio internal function
//
//
// Internal function
//
VOID
LPCWPCE791SetDefault (
  VOID
  );

VOID
WriteRegisterAndSaveToScript (
  IN  UINT8   Index,
  IN  UINT8   Data
  );

VOID
FloppyWriteProtect (
  VOID
  );

VOID
DisableLogicalDevice (
  UINT8       DeviceId
  );

#endif