blob: e72cc47de33b64eb8bf1d5664b861fe79e090f57 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Definitions for PCDP-defined console devices
3 *
4 * v1.0a: http://www.dig64.org/specifications/DIG64_HCDPv10a_01.pdf
Bjorn Helgaas280dedb2005-06-23 00:10:16 -07005 * v2.0: http://www.dig64.org/specifications/DIG64_PCDPv20.pdf
Linus Torvalds1da177e2005-04-16 15:20:36 -07006 *
7 * (c) Copyright 2002, 2004 Hewlett-Packard Development Company, L.P.
8 * Khalid Aziz <khalid.aziz@hp.com>
9 * Bjorn Helgaas <bjorn.helgaas@hp.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15
16#define PCDP_CONSOLE 0
17#define PCDP_DEBUG 1
18#define PCDP_CONSOLE_OUTPUT 2
19#define PCDP_CONSOLE_INPUT 3
20
21#define PCDP_UART (0 << 3)
22#define PCDP_VGA (1 << 3)
23#define PCDP_USB (2 << 3)
24
25/* pcdp_uart.type and pcdp_device.type */
26#define PCDP_CONSOLE_UART (PCDP_UART | PCDP_CONSOLE)
27#define PCDP_DEBUG_UART (PCDP_UART | PCDP_DEBUG)
28#define PCDP_CONSOLE_VGA (PCDP_VGA | PCDP_CONSOLE_OUTPUT)
29#define PCDP_CONSOLE_USB (PCDP_USB | PCDP_CONSOLE_INPUT)
30
31/* pcdp_uart.flags */
32#define PCDP_UART_EDGE_SENSITIVE (1 << 0)
33#define PCDP_UART_ACTIVE_LOW (1 << 1)
34#define PCDP_UART_PRIMARY_CONSOLE (1 << 2)
35#define PCDP_UART_IRQ (1 << 6) /* in pci_func for rev < 3 */
36#define PCDP_UART_PCI (1 << 7) /* in pci_func for rev < 3 */
37
38struct pcdp_uart {
39 u8 type;
40 u8 bits;
41 u8 parity;
42 u8 stop_bits;
43 u8 pci_seg;
44 u8 pci_bus;
45 u8 pci_dev;
46 u8 pci_func;
47 u64 baud;
48 struct acpi_generic_address addr;
49 u16 pci_dev_id;
50 u16 pci_vendor_id;
51 u32 gsi;
52 u32 clock_rate;
53 u8 pci_prog_intfc;
54 u8 flags;
Mark Maule66b7f8a2005-04-25 13:51:00 -070055} __attribute__((packed));
56
57#define PCDP_IF_PCI 1
58
59/* pcdp_if_pci.trans */
60#define PCDP_PCI_TRANS_IOPORT 0x02
61#define PCDP_PCI_TRANS_MMIO 0x01
62
63struct pcdp_if_pci {
64 u8 interconnect;
65 u8 reserved;
66 u16 length;
67 u8 segment;
68 u8 bus;
69 u8 dev;
70 u8 fun;
71 u16 dev_id;
72 u16 vendor_id;
73 u32 acpi_interrupt;
74 u64 mmio_tra;
75 u64 ioport_tra;
76 u8 flags;
77 u8 trans;
78} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070079
80struct pcdp_vga {
81 u8 count; /* address space descriptors */
Mark Maule66b7f8a2005-04-25 13:51:00 -070082} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070083
84/* pcdp_device.flags */
85#define PCDP_PRIMARY_CONSOLE 1
86
87struct pcdp_device {
88 u8 type;
89 u8 flags;
90 u16 length;
91 u16 efi_index;
Mark Maule66b7f8a2005-04-25 13:51:00 -070092 /* next data is pcdp_if_pci or pcdp_if_acpi (not yet supported) */
93 /* next data is device specific type (currently only pcdp_vga) */
94} __attribute__((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070095
96struct pcdp {
97 u8 signature[4];
98 u32 length;
99 u8 rev; /* PCDP v2.0 is rev 3 */
100 u8 chksum;
101 u8 oemid[6];
102 u8 oem_tabid[8];
103 u32 oem_rev;
104 u8 creator_id[4];
105 u32 creator_rev;
106 u32 num_uarts;
107 struct pcdp_uart uart[0]; /* actual size is num_uarts */
108 /* remainder of table is pcdp_device structures */
Mark Maule66b7f8a2005-04-25 13:51:00 -0700109} __attribute__((packed));