shpchprm_legacy.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * SHPCHPRM Legacy: PHP Resource Manager for Non-ACPI/Legacy platform using HRT
  3. *
  4. * Copyright (C) 1995,2001 Compaq Computer Corporation
  5. * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com)
  6. * Copyright (C) 2001 IBM Corp.
  7. * Copyright (C) 2003-2004 Intel Corporation
  8. *
  9. * All rights reserved.
  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 as published by
  13. * the Free Software Foundation; either version 2 of the License, or (at
  14. * your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful, but
  17. * WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  19. * NON INFRINGEMENT. See the GNU General Public License for more
  20. * details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program; if not, write to the Free Software
  24. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  25. *
  26. * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com>
  27. *
  28. */
  29. #ifndef _SHPCHPRM_LEGACY_H_
  30. #define _SHPCHPRM_LEGACY_H_
  31. #define ROM_PHY_ADDR 0x0F0000
  32. #define ROM_PHY_LEN 0x00FFFF
  33. struct slot_rt {
  34. u8 dev_func;
  35. u8 primary_bus;
  36. u8 secondary_bus;
  37. u8 max_bus;
  38. u16 io_base;
  39. u16 io_length;
  40. u16 mem_base;
  41. u16 mem_length;
  42. u16 pre_mem_base;
  43. u16 pre_mem_length;
  44. } __attribute__ ((packed));
  45. /* offsets to the hotplug slot resource table registers based on the above structure layout */
  46. enum slot_rt_offsets {
  47. DEV_FUNC = offsetof(struct slot_rt, dev_func),
  48. PRIMARY_BUS = offsetof(struct slot_rt, primary_bus),
  49. SECONDARY_BUS = offsetof(struct slot_rt, secondary_bus),
  50. MAX_BUS = offsetof(struct slot_rt, max_bus),
  51. IO_BASE = offsetof(struct slot_rt, io_base),
  52. IO_LENGTH = offsetof(struct slot_rt, io_length),
  53. MEM_BASE = offsetof(struct slot_rt, mem_base),
  54. MEM_LENGTH = offsetof(struct slot_rt, mem_length),
  55. PRE_MEM_BASE = offsetof(struct slot_rt, pre_mem_base),
  56. PRE_MEM_LENGTH = offsetof(struct slot_rt, pre_mem_length),
  57. };
  58. struct hrt {
  59. char sig0;
  60. char sig1;
  61. char sig2;
  62. char sig3;
  63. u16 unused_IRQ;
  64. u16 PCIIRQ;
  65. u8 number_of_entries;
  66. u8 revision;
  67. u16 reserved1;
  68. u32 reserved2;
  69. } __attribute__ ((packed));
  70. /* offsets to the hotplug resource table registers based on the above structure layout */
  71. enum hrt_offsets {
  72. SIG0 = offsetof(struct hrt, sig0),
  73. SIG1 = offsetof(struct hrt, sig1),
  74. SIG2 = offsetof(struct hrt, sig2),
  75. SIG3 = offsetof(struct hrt, sig3),
  76. UNUSED_IRQ = offsetof(struct hrt, unused_IRQ),
  77. PCIIRQ = offsetof(struct hrt, PCIIRQ),
  78. NUMBER_OF_ENTRIES = offsetof(struct hrt, number_of_entries),
  79. REVISION = offsetof(struct hrt, revision),
  80. HRT_RESERVED1 = offsetof(struct hrt, reserved1),
  81. HRT_RESERVED2 = offsetof(struct hrt, reserved2),
  82. };
  83. struct irq_info {
  84. u8 bus, devfn; /* bus, device and function */
  85. struct {
  86. u8 link; /* IRQ line ID, chipset dependent, 0=not routed */
  87. u16 bitmap; /* Available IRQs */
  88. } __attribute__ ((packed)) irq[4];
  89. u8 slot; /* slot number, 0=onboard */
  90. u8 rfu;
  91. } __attribute__ ((packed));
  92. struct irq_routing_table {
  93. u32 signature; /* PIRQ_SIGNATURE should be here */
  94. u16 version; /* PIRQ_VERSION */
  95. u16 size; /* Table size in bytes */
  96. u8 rtr_bus, rtr_devfn; /* Where the interrupt router lies */
  97. u16 exclusive_irqs; /* IRQs devoted exclusively to PCI usage */
  98. u16 rtr_vendor, rtr_device; /* Vendor and device ID of interrupt router */
  99. u32 miniport_data; /* Crap */
  100. u8 rfu[11];
  101. u8 checksum; /* Modulo 256 checksum must give zero */
  102. struct irq_info slots[0];
  103. } __attribute__ ((packed));
  104. #endif /* _SHPCHPRM_LEGACY_H_ */