1*bc042041Sjym /* $NetBSD: mpbiosreg.h,v 1.6 2010/04/18 23:47:51 jym Exp $ */ 28375b2d9Sfvdl 38375b2d9Sfvdl /*- 48375b2d9Sfvdl * Copyright (c) 2000 The NetBSD Foundation, Inc. 58375b2d9Sfvdl * All rights reserved. 68375b2d9Sfvdl * 78375b2d9Sfvdl * This code is derived from software contributed to The NetBSD Foundation 88375b2d9Sfvdl * by RedBack Networks Inc. 98375b2d9Sfvdl * 108375b2d9Sfvdl * Author: Bill Sommerfeld 118375b2d9Sfvdl * 128375b2d9Sfvdl * Redistribution and use in source and binary forms, with or without 138375b2d9Sfvdl * modification, are permitted provided that the following conditions 148375b2d9Sfvdl * are met: 158375b2d9Sfvdl * 1. Redistributions of source code must retain the above copyright 168375b2d9Sfvdl * notice, this list of conditions and the following disclaimer. 178375b2d9Sfvdl * 2. Redistributions in binary form must reproduce the above copyright 188375b2d9Sfvdl * notice, this list of conditions and the following disclaimer in the 198375b2d9Sfvdl * documentation and/or other materials provided with the distribution. 208375b2d9Sfvdl * 218375b2d9Sfvdl * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 228375b2d9Sfvdl * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 238375b2d9Sfvdl * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 248375b2d9Sfvdl * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 258375b2d9Sfvdl * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 268375b2d9Sfvdl * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 278375b2d9Sfvdl * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 288375b2d9Sfvdl * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 298375b2d9Sfvdl * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 308375b2d9Sfvdl * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 318375b2d9Sfvdl * POSSIBILITY OF SUCH DAMAGE. 328375b2d9Sfvdl */ 338375b2d9Sfvdl 348375b2d9Sfvdl #ifndef _X86_MPBIOSREG_H_ 358375b2d9Sfvdl #define _X86_MPBIOSREG_H_ 368375b2d9Sfvdl 378375b2d9Sfvdl #define BIOS_BASE (0xf0000) 388375b2d9Sfvdl #define BIOS_SIZE (0x10000) 398375b2d9Sfvdl #define BIOS_COUNT (BIOS_SIZE) 408375b2d9Sfvdl 418375b2d9Sfvdl /* 428375b2d9Sfvdl * Multiprocessor config table entry types. 438375b2d9Sfvdl */ 448375b2d9Sfvdl 458375b2d9Sfvdl #define MPS_MCT_CPU 0 468375b2d9Sfvdl #define MPS_MCT_BUS 1 478375b2d9Sfvdl #define MPS_MCT_IOAPIC 2 488375b2d9Sfvdl #define MPS_MCT_IOINT 3 498375b2d9Sfvdl #define MPS_MCT_LINT 4 508375b2d9Sfvdl 518375b2d9Sfvdl #define MPS_MCT_NTYPES 5 528375b2d9Sfvdl 538375b2d9Sfvdl /* MP Floating Pointer Structure */ 548375b2d9Sfvdl struct mpbios_fps { 555c97fc53Scegger uint32_t signature; 568375b2d9Sfvdl /* string defined by the Intel MP Spec as identifying the MP table */ 578375b2d9Sfvdl #define MP_FP_SIG 0x5f504d5f /* _MP_ */ 588375b2d9Sfvdl 595c97fc53Scegger uint32_t pap; 605c97fc53Scegger uint8_t length; 615c97fc53Scegger uint8_t spec_rev; 625c97fc53Scegger uint8_t checksum; 635c97fc53Scegger uint8_t mpfb1; /* system configuration */ 645c97fc53Scegger uint8_t mpfb2; /* flags */ 658375b2d9Sfvdl #define MPFPS_FLAG_IMCR 0x80 /* IMCR present */ 665c97fc53Scegger uint8_t mpfb3; /* unused */ 675c97fc53Scegger uint8_t mpfb4; /* unused */ 685c97fc53Scegger uint8_t mpfb5; /* unused */ 698375b2d9Sfvdl }; 708375b2d9Sfvdl 718375b2d9Sfvdl /* MP Configuration Table Header */ 728375b2d9Sfvdl struct mpbios_cth { 735c97fc53Scegger uint32_t signature; 748375b2d9Sfvdl #define MP_CT_SIG 0x504d4350 /* PCMP */ 758375b2d9Sfvdl 765c97fc53Scegger uint16_t base_len; 775c97fc53Scegger uint8_t spec_rev; 785c97fc53Scegger uint8_t checksum; 795c97fc53Scegger uint8_t oem_id[8]; 805c97fc53Scegger uint8_t product_id[12]; 815c97fc53Scegger uint32_t oem_table_pointer; 825c97fc53Scegger uint16_t oem_table_size; 835c97fc53Scegger uint16_t entry_count; 845c97fc53Scegger uint32_t apic_address; 855c97fc53Scegger uint16_t ext_len; 865c97fc53Scegger uint8_t ext_cksum; 875c97fc53Scegger uint8_t reserved; 888375b2d9Sfvdl }; 898375b2d9Sfvdl 908375b2d9Sfvdl struct mpbios_proc { 915c97fc53Scegger uint8_t type; 925c97fc53Scegger uint8_t apic_id; 935c97fc53Scegger uint8_t apic_version; 945c97fc53Scegger uint8_t cpu_flags; 958375b2d9Sfvdl #define PROCENTRY_FLAG_EN 0x01 968375b2d9Sfvdl #define PROCENTRY_FLAG_BP 0x02 975c97fc53Scegger uint32_t reserved1; 985c97fc53Scegger uint32_t reserved2; 998375b2d9Sfvdl }; 1008375b2d9Sfvdl 1018375b2d9Sfvdl struct mpbios_bus { 1025c97fc53Scegger uint8_t type; 1035c97fc53Scegger uint8_t bus_id; 1048375b2d9Sfvdl char bus_type[6]; 1058375b2d9Sfvdl }; 1068375b2d9Sfvdl 1078375b2d9Sfvdl struct mpbios_ioapic { 1085c97fc53Scegger uint8_t type; 1095c97fc53Scegger uint8_t apic_id; 1105c97fc53Scegger uint8_t apic_version; 1115c97fc53Scegger uint8_t apic_flags; 1128375b2d9Sfvdl #define IOAPICENTRY_FLAG_EN 0x01 1135c97fc53Scegger uint32_t apic_address; 1148375b2d9Sfvdl }; 1158375b2d9Sfvdl 1168375b2d9Sfvdl struct mpbios_int { 1175c97fc53Scegger uint8_t type; 1185c97fc53Scegger uint8_t int_type; 1195c97fc53Scegger uint16_t int_flags; 1205c97fc53Scegger uint8_t src_bus_id; 1215c97fc53Scegger uint8_t src_bus_irq; 1225c97fc53Scegger uint8_t dst_apic_id; 1238375b2d9Sfvdl #define MPS_ALL_APICS 0xff 1245c97fc53Scegger uint8_t dst_apic_int; 1258375b2d9Sfvdl }; 1268375b2d9Sfvdl 1278375b2d9Sfvdl 1288375b2d9Sfvdl #endif /* !_X86_MPBIOSREG_H_ */ 129