2 * Copyright (c) 1996, by Steve Passe
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. The name of the developer may NOT be used to endorse or promote products
11 * derived from this software without specific prior written permission.
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 #ifndef __MACHINE_MPTABLE_H__
29 #define __MACHINE_MPTABLE_H__
41 UNKNOWN_BUSTYPE = 0xff
44 /* MP Floating Pointer Structure */
45 typedef struct MPFPS {
58 #define MPFB2_IMCR_PRESENT 0x80
59 #define MPFB2_MUL_CLK_SRCS 0x40
61 /* MP Configuration Table Header */
62 typedef struct MPCTH {
64 uint16_t base_table_length;
68 uint8_t product_id[12];
69 uint32_t oem_table_pointer;
70 uint16_t oem_table_size;
72 uint32_t apic_address;
73 uint16_t extended_table_length;
74 uint8_t extended_table_checksum;
78 /* Base table entries */
80 #define MPCT_ENTRY_PROCESSOR 0
81 #define MPCT_ENTRY_BUS 1
82 #define MPCT_ENTRY_IOAPIC 2
83 #define MPCT_ENTRY_INT 3
84 #define MPCT_ENTRY_LOCAL_INT 4
86 typedef struct PROCENTRY {
91 uint32_t cpu_signature;
92 uint32_t feature_flags;
95 } __packed *proc_entry_ptr;
97 #define PROCENTRY_FLAG_EN 0x01
98 #define PROCENTRY_FLAG_BP 0x02
100 typedef struct BUSENTRY {
104 } __packed *bus_entry_ptr;
106 typedef struct IOAPICENTRY {
109 uint8_t apic_version;
111 uint32_t apic_address;
112 } __packed *io_apic_entry_ptr;
114 #define IOAPICENTRY_FLAG_EN 0x01
116 typedef struct INTENTRY {
123 uint8_t dst_apic_int;
124 } __packed *int_entry_ptr;
126 #define INTENTRY_TYPE_INT 0
127 #define INTENTRY_TYPE_NMI 1
128 #define INTENTRY_TYPE_SMI 2
129 #define INTENTRY_TYPE_EXTINT 3
131 #define INTENTRY_FLAGS_POLARITY 0x3
132 #define INTENTRY_FLAGS_POLARITY_CONFORM 0x0
133 #define INTENTRY_FLAGS_POLARITY_ACTIVEHI 0x1
134 #define INTENTRY_FLAGS_POLARITY_ACTIVELO 0x3
135 #define INTENTRY_FLAGS_TRIGGER 0xc
136 #define INTENTRY_FLAGS_TRIGGER_CONFORM 0x0
137 #define INTENTRY_FLAGS_TRIGGER_EDGE 0x4
138 #define INTENTRY_FLAGS_TRIGGER_LEVEL 0xc
140 /* Extended table entries */
142 typedef struct EXTENTRY {
145 } __packed *ext_entry_ptr;
147 #define MPCT_EXTENTRY_SAS 0x80
148 #define MPCT_EXTENTRY_BHD 0x81
149 #define MPCT_EXTENTRY_CBASM 0x82
151 typedef struct SASENTRY {
155 uint8_t address_type;
156 uint64_t address_base;
157 uint64_t address_length;
158 } __packed *sas_entry_ptr;
160 #define SASENTRY_TYPE_IO 0
161 #define SASENTRY_TYPE_MEMORY 1
162 #define SASENTRY_TYPE_PREFETCH 2
164 typedef struct BHDENTRY {
171 } __packed *bhd_entry_ptr;
173 #define BHDENTRY_INFO_SUBTRACTIVE_DECODE 0x1
175 typedef struct CBASMENTRY {
180 uint32_t predefined_range;
181 } __packed *cbasm_entry_ptr;
183 #define CBASMENTRY_ADDRESS_MOD_ADD 0x0
184 #define CBASMENTRY_ADDRESS_MOD_SUBTRACT 0x1
186 #define CBASMENTRY_RANGE_ISA_IO 0
187 #define CBASMENTRY_RANGE_VGA_IO 1
190 struct mptable_hostb_softc {
192 struct pcib_host_resources sc_host_res;
193 int sc_decodes_vga_io;
194 int sc_decodes_isa_io;
199 void mptable_pci_host_res_init(device_t pcib);
201 int mptable_pci_probe_table(int bus);
202 int mptable_pci_route_interrupt(device_t pcib, device_t dev, int pin);
204 #endif /* !__MACHINE_MPTABLE_H__ */