ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / drivers / serial / 8250_hcdp.h
1 /*
2  * drivers/serial/8250_hcdp.h
3  *
4  * Copyright (C) 2002 Hewlett-Packard Co.
5  *      Khalid Aziz <khalid_aziz@hp.com>
6  *
7  * Definitions for HCDP defined serial ports (Serial console and debug
8  * ports)
9  */
10
11 /* ACPI table signatures */
12 #define HCDP_SIG_LEN            4
13 #define HCDP_SIGNATURE          "HCDP"
14
15 /* Space ID as defined in ACPI generic address structure */
16 #define ACPI_MEM_SPACE          0
17 #define ACPI_IO_SPACE           1
18 #define ACPI_PCICONF_SPACE      2
19
20 /*
21  * Maximum number of HCDP devices we want to read in
22  */
23 #define MAX_HCDP_DEVICES        6
24
25 /*
26  * Default UART clock rate if clock rate is 0 in HCDP table.
27  */
28 #define DEFAULT_UARTCLK         115200
29
30 /*
31  * ACPI Generic Address Structure
32  */
33 typedef struct {
34         u8  space_id;
35         u8  bit_width;
36         u8  bit_offset;
37         u8  resv;
38         u32 addrlo;
39         u32 addrhi;
40 } acpi_gen_addr;
41
42 /* HCDP Device descriptor entry types */
43 #define HCDP_DEV_CONSOLE        0
44 #define HCDP_DEV_DEBUG          1
45
46 /* HCDP Device descriptor type */
47 typedef struct {
48         u8      type;
49         u8      bits;
50         u8      parity;
51         u8      stop_bits;
52         u8      pci_seg;
53         u8      pci_bus;
54         u8      pci_dev;
55         u8      pci_func;
56         u64     baud;
57         acpi_gen_addr   base_addr;
58         u16     pci_dev_id;
59         u16     pci_vendor_id;
60         u32     global_int;
61         u32     clock_rate;
62         u8      pci_prog_intfc;
63         u8      resv;
64 } hcdp_dev_t;
65
66 /* HCDP Table format */
67 typedef struct {
68         u8      signature[4];
69         u32     len;
70         u8      rev;
71         u8      chksum;
72         u8      oemid[6];
73         u8      oem_tabid[8];
74         u32     oem_rev;
75         u8      creator_id[4];
76         u32     creator_rev;
77         u32     num_entries;
78         hcdp_dev_t      hcdp_dev[MAX_HCDP_DEVICES];
79 } hcdp_t;
80
81 #define HCDP_PCI_UART(x) (x->pci_func & 1UL<<7)
82 #define HCDP_IRQ_SUPPORTED(x) (x->pci_func & 1UL<<6)