pcdp.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * Definitions for PCDP-defined console devices
  3. *
  4. * v1.0a: http://www.dig64.org/specifications/DIG64_HCDPv10a_01.pdf
  5. * v2.0: http://www.dig64.org/specifications/DIG64_PCDPv20.pdf
  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. };
  51. struct pcdp_vga {
  52. u8 count; /* address space descriptors */
  53. };
  54. /* pcdp_device.flags */
  55. #define PCDP_PRIMARY_CONSOLE 1
  56. struct pcdp_device {
  57. u8 type;
  58. u8 flags;
  59. u16 length;
  60. u16 efi_index;
  61. };
  62. struct pcdp {
  63. u8 signature[4];
  64. u32 length;
  65. u8 rev; /* PCDP v2.0 is rev 3 */
  66. u8 chksum;
  67. u8 oemid[6];
  68. u8 oem_tabid[8];
  69. u32 oem_rev;
  70. u8 creator_id[4];
  71. u32 creator_rev;
  72. u32 num_uarts;
  73. struct pcdp_uart uart[0]; /* actual size is num_uarts */
  74. /* remainder of table is pcdp_device structures */
  75. };