xref: /minix3/sys/arch/x86/include/mpbiosreg.h (revision 1cd76c751364e6270e8d5a0daebc6d3d169baf4d)
1*1cd76c75SBen Gras /* 	$NetBSD: mpbiosreg.h,v 1.6 2010/04/18 23:47:51 jym Exp $ */
2*1cd76c75SBen Gras 
3*1cd76c75SBen Gras /*-
4*1cd76c75SBen Gras  * Copyright (c) 2000 The NetBSD Foundation, Inc.
5*1cd76c75SBen Gras  * All rights reserved.
6*1cd76c75SBen Gras  *
7*1cd76c75SBen Gras  * This code is derived from software contributed to The NetBSD Foundation
8*1cd76c75SBen Gras  * by RedBack Networks Inc.
9*1cd76c75SBen Gras  *
10*1cd76c75SBen Gras  * Author: Bill Sommerfeld
11*1cd76c75SBen Gras  *
12*1cd76c75SBen Gras  * Redistribution and use in source and binary forms, with or without
13*1cd76c75SBen Gras  * modification, are permitted provided that the following conditions
14*1cd76c75SBen Gras  * are met:
15*1cd76c75SBen Gras  * 1. Redistributions of source code must retain the above copyright
16*1cd76c75SBen Gras  *    notice, this list of conditions and the following disclaimer.
17*1cd76c75SBen Gras  * 2. Redistributions in binary form must reproduce the above copyright
18*1cd76c75SBen Gras  *    notice, this list of conditions and the following disclaimer in the
19*1cd76c75SBen Gras  *    documentation and/or other materials provided with the distribution.
20*1cd76c75SBen Gras  *
21*1cd76c75SBen Gras  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
22*1cd76c75SBen Gras  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23*1cd76c75SBen Gras  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24*1cd76c75SBen Gras  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
25*1cd76c75SBen Gras  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26*1cd76c75SBen Gras  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27*1cd76c75SBen Gras  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28*1cd76c75SBen Gras  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29*1cd76c75SBen Gras  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30*1cd76c75SBen Gras  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31*1cd76c75SBen Gras  * POSSIBILITY OF SUCH DAMAGE.
32*1cd76c75SBen Gras  */
33*1cd76c75SBen Gras 
34*1cd76c75SBen Gras #ifndef _X86_MPBIOSREG_H_
35*1cd76c75SBen Gras #define _X86_MPBIOSREG_H_
36*1cd76c75SBen Gras 
37*1cd76c75SBen Gras #define BIOS_BASE		(0xf0000)
38*1cd76c75SBen Gras #define BIOS_SIZE		(0x10000)
39*1cd76c75SBen Gras #define BIOS_COUNT		(BIOS_SIZE)
40*1cd76c75SBen Gras 
41*1cd76c75SBen Gras /*
42*1cd76c75SBen Gras  * Multiprocessor config table entry types.
43*1cd76c75SBen Gras  */
44*1cd76c75SBen Gras 
45*1cd76c75SBen Gras #define MPS_MCT_CPU	0
46*1cd76c75SBen Gras #define MPS_MCT_BUS	1
47*1cd76c75SBen Gras #define MPS_MCT_IOAPIC	2
48*1cd76c75SBen Gras #define MPS_MCT_IOINT	3
49*1cd76c75SBen Gras #define MPS_MCT_LINT	4
50*1cd76c75SBen Gras 
51*1cd76c75SBen Gras #define MPS_MCT_NTYPES	5
52*1cd76c75SBen Gras 
53*1cd76c75SBen Gras /* MP Floating Pointer Structure */
54*1cd76c75SBen Gras struct mpbios_fps {
55*1cd76c75SBen Gras 	uint32_t	signature;
56*1cd76c75SBen Gras /* string defined by the Intel MP Spec as identifying the MP table */
57*1cd76c75SBen Gras #define MP_FP_SIG		0x5f504d5f	/* _MP_ */
58*1cd76c75SBen Gras 
59*1cd76c75SBen Gras 	uint32_t 	pap;
60*1cd76c75SBen Gras 	uint8_t  	length;
61*1cd76c75SBen Gras 	uint8_t  	spec_rev;
62*1cd76c75SBen Gras 	uint8_t  	checksum;
63*1cd76c75SBen Gras 	uint8_t  	mpfb1;	/* system configuration */
64*1cd76c75SBen Gras 	uint8_t  	mpfb2;	/* flags */
65*1cd76c75SBen Gras #define MPFPS_FLAG_IMCR		0x80	/* IMCR present */
66*1cd76c75SBen Gras 	uint8_t  	mpfb3;	/* unused */
67*1cd76c75SBen Gras 	uint8_t  	mpfb4;	/* unused */
68*1cd76c75SBen Gras 	uint8_t  	mpfb5;	/* unused */
69*1cd76c75SBen Gras };
70*1cd76c75SBen Gras 
71*1cd76c75SBen Gras /* MP Configuration Table Header */
72*1cd76c75SBen Gras struct mpbios_cth {
73*1cd76c75SBen Gras 	uint32_t	signature;
74*1cd76c75SBen Gras #define MP_CT_SIG		0x504d4350 	/* PCMP */
75*1cd76c75SBen Gras 
76*1cd76c75SBen Gras 	uint16_t 	base_len;
77*1cd76c75SBen Gras 	uint8_t  	spec_rev;
78*1cd76c75SBen Gras 	uint8_t  	checksum;
79*1cd76c75SBen Gras 	uint8_t  	oem_id[8];
80*1cd76c75SBen Gras 	uint8_t  	product_id[12];
81*1cd76c75SBen Gras 	uint32_t	oem_table_pointer;
82*1cd76c75SBen Gras 	uint16_t 	oem_table_size;
83*1cd76c75SBen Gras 	uint16_t 	entry_count;
84*1cd76c75SBen Gras 	uint32_t	apic_address;
85*1cd76c75SBen Gras 	uint16_t	ext_len;
86*1cd76c75SBen Gras 	uint8_t  	ext_cksum;
87*1cd76c75SBen Gras 	uint8_t  	reserved;
88*1cd76c75SBen Gras };
89*1cd76c75SBen Gras 
90*1cd76c75SBen Gras struct mpbios_proc {
91*1cd76c75SBen Gras 	uint8_t  type;
92*1cd76c75SBen Gras 	uint8_t  apic_id;
93*1cd76c75SBen Gras 	uint8_t  apic_version;
94*1cd76c75SBen Gras 	uint8_t  cpu_flags;
95*1cd76c75SBen Gras #define PROCENTRY_FLAG_EN	0x01
96*1cd76c75SBen Gras #define PROCENTRY_FLAG_BP	0x02
97*1cd76c75SBen Gras 	uint32_t  reserved1;
98*1cd76c75SBen Gras 	uint32_t  reserved2;
99*1cd76c75SBen Gras };
100*1cd76c75SBen Gras 
101*1cd76c75SBen Gras struct mpbios_bus {
102*1cd76c75SBen Gras 	uint8_t  type;
103*1cd76c75SBen Gras 	uint8_t  bus_id;
104*1cd76c75SBen Gras 	char    bus_type[6];
105*1cd76c75SBen Gras };
106*1cd76c75SBen Gras 
107*1cd76c75SBen Gras struct mpbios_ioapic {
108*1cd76c75SBen Gras 	uint8_t  type;
109*1cd76c75SBen Gras 	uint8_t  apic_id;
110*1cd76c75SBen Gras 	uint8_t  apic_version;
111*1cd76c75SBen Gras 	uint8_t  apic_flags;
112*1cd76c75SBen Gras #define IOAPICENTRY_FLAG_EN	0x01
113*1cd76c75SBen Gras 	uint32_t   apic_address;
114*1cd76c75SBen Gras };
115*1cd76c75SBen Gras 
116*1cd76c75SBen Gras struct mpbios_int {
117*1cd76c75SBen Gras 	uint8_t  type;
118*1cd76c75SBen Gras 	uint8_t  int_type;
119*1cd76c75SBen Gras 	uint16_t int_flags;
120*1cd76c75SBen Gras 	uint8_t  src_bus_id;
121*1cd76c75SBen Gras 	uint8_t  src_bus_irq;
122*1cd76c75SBen Gras 	uint8_t  dst_apic_id;
123*1cd76c75SBen Gras #define MPS_ALL_APICS	0xff
124*1cd76c75SBen Gras 	uint8_t  dst_apic_int;
125*1cd76c75SBen Gras };
126*1cd76c75SBen Gras 
127*1cd76c75SBen Gras 
128*1cd76c75SBen Gras #endif /* !_X86_MPBIOSREG_H_ */
129