Check in patch to refine DevicePath Module and USB2HostController Module.
[mirror_edk2.git] / EdkModulePkg / Bus / Pci / CirrusLogic / Dxe / CirrusLogic5430.h
CommitLineData
ed72955c 1/** @file\r
878ddf1f 2 Cirrus Logic 5430 Controller Driver\r
3\r
ed72955c 4 Copyright (c) 2006, Intel Corporation \r
5 All rights reserved. This program and the accompanying materials \r
6 are licensed and made available under the terms and conditions of the BSD License \r
7 which accompanies this distribution. The full text of the license may be found at \r
8 http://opensource.org/licenses/bsd-license.php \r
878ddf1f 9\r
ed72955c 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
12\r
13**/\r
878ddf1f 14\r
15//\r
16// Cirrus Logic 5430 Controller Driver\r
17//\r
18\r
19#ifndef _CIRRUS_LOGIC_5430_H_\r
20#define _CIRRUS_LOGIC_5430_H_\r
21\r
22\r
f0ec738d 23#include <IndustryStandard/pci22.h>\r
878ddf1f 24//\r
25// Cirrus Logic 5430 PCI Configuration Header values\r
26//\r
27#define CIRRUS_LOGIC_VENDOR_ID 0x1013\r
28#define CIRRUS_LOGIC_5430_DEVICE_ID 0x00a8\r
29#define CIRRUS_LOGIC_5430_ALTERNATE_DEVICE_ID 0x00a0\r
30#define CIRRUS_LOGIC_5446_DEVICE_ID 0x00b8\r
31\r
32//\r
33// Cirrus Logic Graphical Mode Data\r
34//\r
35#define CIRRUS_LOGIC_5430_UGA_DRAW_MODE_COUNT 3\r
36\r
37typedef struct {\r
38 UINT32 HorizontalResolution;\r
39 UINT32 VerticalResolution;\r
40 UINT32 ColorDepth;\r
41 UINT32 RefreshRate;\r
42} CIRRUS_LOGIC_5430_UGA_DRAW_MODE_DATA;\r
43\r
44//\r
45// Cirrus Logic 5440 Private Data Structure\r
46//\r
47#define CIRRUS_LOGIC_5430_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('C', 'L', '5', '4')\r
48\r
49typedef struct {\r
50 UINT64 Signature;\r
51 EFI_HANDLE Handle;\r
52 EFI_PCI_IO_PROTOCOL *PciIo;\r
53 EFI_UGA_DRAW_PROTOCOL UgaDraw;\r
54\r
55 //\r
56 // UGA Draw Private Data\r
57 //\r
58 BOOLEAN HardwareNeedsStarting;\r
59 UINTN CurrentMode;\r
60 UINTN MaxMode;\r
61 CIRRUS_LOGIC_5430_UGA_DRAW_MODE_DATA ModeData[CIRRUS_LOGIC_5430_UGA_DRAW_MODE_COUNT];\r
62 UINT8 *LineBuffer;\r
63} CIRRUS_LOGIC_5430_PRIVATE_DATA;\r
64\r
65#define CIRRUS_LOGIC_5430_PRIVATE_DATA_FROM_UGA_DRAW_THIS(a) \\r
66 CR(a, CIRRUS_LOGIC_5430_PRIVATE_DATA, UgaDraw, CIRRUS_LOGIC_5430_PRIVATE_DATA_SIGNATURE)\r
67\r
68//\r
69// Global Variables\r
70//\r
71extern EFI_DRIVER_BINDING_PROTOCOL gCirrusLogic5430DriverBinding;\r
72extern EFI_COMPONENT_NAME_PROTOCOL gCirrusLogic5430ComponentName;\r
73\r
74//\r
75// Io Registers defined by VGA\r
76//\r
77#define CRTC_ADDRESS_REGISTER 0x3d4\r
78#define CRTC_DATA_REGISTER 0x3d5\r
79#define SEQ_ADDRESS_REGISTER 0x3c4\r
80#define SEQ_DATA_REGISTER 0x3c5\r
81#define GRAPH_ADDRESS_REGISTER 0x3ce\r
82#define GRAPH_DATA_REGISTER 0x3cf\r
83#define ATT_ADDRESS_REGISTER 0x3c0\r
84#define MISC_OUTPUT_REGISTER 0x3c2\r
85#define INPUT_STATUS_1_REGISTER 0x3da\r
86#define DAC_PIXEL_MASK_REGISTER 0x3c6\r
87#define PALETTE_INDEX_REGISTER 0x3c8\r
88#define PALETTE_DATA_REGISTER 0x3c9\r
89\r
90//\r
91// UGA Draw Hardware abstraction internal worker functions\r
92//\r
ed72955c 93/**\r
94 TODO: Add function description\r
95\r
96 @param Private TODO: add argument description\r
97\r
98 TODO: add return values\r
99\r
100**/\r
878ddf1f 101EFI_STATUS\r
102CirrusLogic5430UgaDrawConstructor (\r
103 CIRRUS_LOGIC_5430_PRIVATE_DATA *Private\r
104 )\r
ed72955c 105;\r
878ddf1f 106\r
ed72955c 107/**\r
878ddf1f 108 TODO: Add function description\r
109\r
ed72955c 110 @param Private TODO: add argument description\r
878ddf1f 111\r
112 TODO: add return values\r
113\r
ed72955c 114**/\r
878ddf1f 115EFI_STATUS\r
116CirrusLogic5430UgaDrawDestructor (\r
117 CIRRUS_LOGIC_5430_PRIVATE_DATA *Private\r
118 )\r
ed72955c 119;\r
878ddf1f 120\r
ed72955c 121//\r
122// EFI 1.1 driver model prototypes for Cirrus Logic 5430 UGA Draw\r
123//\r
124/**\r
878ddf1f 125 TODO: Add function description\r
126\r
ed72955c 127 @param ImageHandle TODO: add argument description\r
128 @param SystemTable TODO: add argument description\r
878ddf1f 129\r
130 TODO: add return values\r
131\r
ed72955c 132**/\r
878ddf1f 133EFI_STATUS\r
134EFIAPI\r
135CirrusLogic5430DriverEntryPoint (\r
136 IN EFI_HANDLE ImageHandle,\r
137 IN EFI_SYSTEM_TABLE *SystemTable\r
138 )\r
ed72955c 139;\r
878ddf1f 140\r
ed72955c 141//\r
142// EFI_DRIVER_BINDING_PROTOCOL Protocol Interface\r
143//\r
144/**\r
878ddf1f 145 TODO: Add function description\r
146\r
ed72955c 147 @param This TODO: add argument description\r
148 @param Controller TODO: add argument description\r
149 @param RemainingDevicePath TODO: add argument description\r
878ddf1f 150\r
151 TODO: add return values\r
152\r
ed72955c 153**/\r
878ddf1f 154EFI_STATUS\r
155EFIAPI\r
156CirrusLogic5430ControllerDriverSupported (\r
157 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
158 IN EFI_HANDLE Controller,\r
159 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
160 )\r
ed72955c 161;\r
878ddf1f 162\r
ed72955c 163/**\r
878ddf1f 164 TODO: Add function description\r
165\r
ed72955c 166 @param This TODO: add argument description\r
167 @param Controller TODO: add argument description\r
168 @param RemainingDevicePath TODO: add argument description\r
878ddf1f 169\r
170 TODO: add return values\r
171\r
ed72955c 172**/\r
878ddf1f 173EFI_STATUS\r
174EFIAPI\r
175CirrusLogic5430ControllerDriverStart (\r
176 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
177 IN EFI_HANDLE Controller,\r
178 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
179 )\r
ed72955c 180;\r
878ddf1f 181\r
ed72955c 182/**\r
878ddf1f 183 TODO: Add function description\r
184\r
ed72955c 185 @param This TODO: add argument description\r
186 @param Controller TODO: add argument description\r
187 @param NumberOfChildren TODO: add argument description\r
188 @param ChildHandleBuffer TODO: add argument description\r
878ddf1f 189\r
190 TODO: add return values\r
191\r
ed72955c 192**/\r
878ddf1f 193EFI_STATUS\r
194EFIAPI\r
195CirrusLogic5430ControllerDriverStop (\r
196 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
197 IN EFI_HANDLE Controller,\r
198 IN UINTN NumberOfChildren,\r
199 IN EFI_HANDLE *ChildHandleBuffer\r
200 )\r
878ddf1f 201;\r
202\r
203#endif\r