1
2
3
4
5
6
7
8
9
10
11
12
13 #define PCDP_CONSOLE 0
14 #define PCDP_DEBUG 1
15 #define PCDP_CONSOLE_OUTPUT 2
16 #define PCDP_CONSOLE_INPUT 3
17
18 #define PCDP_UART (0 << 3)
19 #define PCDP_VGA (1 << 3)
20 #define PCDP_USB (2 << 3)
21
22
23 #define PCDP_CONSOLE_UART (PCDP_UART | PCDP_CONSOLE)
24 #define PCDP_DEBUG_UART (PCDP_UART | PCDP_DEBUG)
25 #define PCDP_CONSOLE_VGA (PCDP_VGA | PCDP_CONSOLE_OUTPUT)
26 #define PCDP_CONSOLE_USB (PCDP_USB | PCDP_CONSOLE_INPUT)
27
28
29 #define PCDP_UART_EDGE_SENSITIVE (1 << 0)
30 #define PCDP_UART_ACTIVE_LOW (1 << 1)
31 #define PCDP_UART_PRIMARY_CONSOLE (1 << 2)
32 #define PCDP_UART_IRQ (1 << 6)
33 #define PCDP_UART_PCI (1 << 7)
34
35 struct pcdp_uart {
36 u8 type;
37 u8 bits;
38 u8 parity;
39 u8 stop_bits;
40 u8 pci_seg;
41 u8 pci_bus;
42 u8 pci_dev;
43 u8 pci_func;
44 u64 baud;
45 struct acpi_generic_address addr;
46 u16 pci_dev_id;
47 u16 pci_vendor_id;
48 u32 gsi;
49 u32 clock_rate;
50 u8 pci_prog_intfc;
51 u8 flags;
52 u16 conout_index;
53 u32 reserved;
54 } __attribute__((packed));
55
56 #define PCDP_IF_PCI 1
57
58
59 #define PCDP_PCI_TRANS_IOPORT 0x02
60 #define PCDP_PCI_TRANS_MMIO 0x01
61
62 struct pcdp_if_pci {
63 u8 interconnect;
64 u8 reserved;
65 u16 length;
66 u8 segment;
67 u8 bus;
68 u8 dev;
69 u8 fun;
70 u16 dev_id;
71 u16 vendor_id;
72 u32 acpi_interrupt;
73 u64 mmio_tra;
74 u64 ioport_tra;
75 u8 flags;
76 u8 trans;
77 } __attribute__((packed));
78
79 struct pcdp_vga {
80 u8 count;
81 } __attribute__((packed));
82
83
84 #define PCDP_PRIMARY_CONSOLE 1
85
86 struct pcdp_device {
87 u8 type;
88 u8 flags;
89 u16 length;
90 u16 efi_index;
91
92
93 } __attribute__((packed));
94
95 struct pcdp {
96 u8 signature[4];
97 u32 length;
98 u8 rev;
99 u8 chksum;
100 u8 oemid[6];
101 u8 oem_tabid[8];
102 u32 oem_rev;
103 u8 creator_id[4];
104 u32 creator_rev;
105 u32 num_uarts;
106 struct pcdp_uart uart[0];
107
108 } __attribute__((packed));