pcdp.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * Definitions for PCDP-defined console devices
  3. *
  4. * For DIG64_HCDPv10a_01.pdf and DIG64_PCDPv20.pdf (v1.0a and v2.0 resp.),
  5. * please see <http://www.dig64.org/specifications/>
  6. *
  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. #define PCDP_CONSOLE 0
  16. #define PCDP_DEBUG 1
  17. #define PCDP_CONSOLE_OUTPUT 2
  18. #define PCDP_CONSOLE_INPUT 3
  19. #define PCDP_UART (0 << 3)
  20. #define PCDP_VGA (1 << 3)
  21. #define PCDP_USB (2 << 3)
  22. /* pcdp_uart.type and pcdp_device.type */
  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. /* pcdp_uart.flags */
  28. #define PCDP_UART_EDGE_SENSITIVE (1 << 0)
  29. #define PCDP_UART_ACTIVE_LOW (1 << 1)
  30. #define PCDP_UART_PRIMARY_CONSOLE (1 << 2)
  31. #define PCDP_UART_IRQ (1 << 6) /* in pci_func for rev < 3 */
  32. #define PCDP_UART_PCI (1 << 7) /* in pci_func for rev < 3 */
  33. struct pcdp_uart {
  34. u8 type;
  35. u8 bits;
  36. u8 parity;
  37. u8 stop_bits;
  38. u8 pci_seg;
  39. u8 pci_bus;
  40. u8 pci_dev;
  41. u8 pci_func;
  42. u64 baud;
  43. struct acpi_generic_address addr;
  44. u16 pci_dev_id;
  45. u16 pci_vendor_id;
  46. u32 gsi;
  47. u32 clock_rate;
  48. u8 pci_prog_intfc;
  49. u8 flags;
  50. u16 conout_index;
  51. u32 reserved;
  52. } __attribute__((packed));
  53. #define PCDP_IF_PCI 1
  54. /* pcdp_if_pci.trans */
  55. #define PCDP_PCI_TRANS_IOPORT 0x02
  56. #define PCDP_PCI_TRANS_MMIO 0x01
  57. struct pcdp_if_pci {
  58. u8 interconnect;
  59. u8 reserved;
  60. u16 length;
  61. u8 segment;
  62. u8 bus;
  63. u8 dev;
  64. u8 fun;
  65. u16 dev_id;
  66. u16 vendor_id;
  67. u32 acpi_interrupt;
  68. u64 mmio_tra;
  69. u64 ioport_tra;
  70. u8 flags;
  71. u8 trans;
  72. } __attribute__((packed));
  73. struct pcdp_vga {
  74. u8 count; /* address space descriptors */
  75. } __attribute__((packed));
  76. /* pcdp_device.flags */
  77. #define PCDP_PRIMARY_CONSOLE 1
  78. struct pcdp_device {
  79. u8 type;
  80. u8 flags;
  81. u16 length;
  82. u16 efi_index;
  83. /* next data is pcdp_if_pci or pcdp_if_acpi (not yet supported) */
  84. /* next data is device specific type (currently only pcdp_vga) */
  85. } __attribute__((packed));
  86. struct pcdp {
  87. u8 signature[4];
  88. u32 length;
  89. u8 rev; /* PCDP v2.0 is rev 3 */
  90. u8 chksum;
  91. u8 oemid[6];
  92. u8 oem_tabid[8];
  93. u32 oem_rev;
  94. u8 creator_id[4];
  95. u32 creator_rev;
  96. u32 num_uarts;
  97. struct pcdp_uart uart[0]; /* actual size is num_uarts */
  98. /* remainder of table is pcdp_device structures */
  99. } __attribute__((packed));