summaryrefslogtreecommitdiffstats
path: root/sys/i386/acpica/madt.c
Commit message (Collapse)AuthorAgeFilesLines
* In keeping with style(9)'s recommendations on macros, use a ';'rwatson2008-03-161-2/+2
| | | | | | | | | after each SYSINIT() macro invocation. This makes a number of lightweight C parsers much happier with the FreeBSD kernel source, including cflow's prcc and lxr. MFC after: 1 month Discussed with: imp, rink
* For no good reason I had assumed that ACPI table headers would be pagejhb2008-01-311-5/+7
| | | | | | | | | | | | | | | | | | | | aligned (or at least not cross a page boundary). However, it turns out that on at least one machine one table header does cross a page boundary. This caused problems with the MADT early probe as it uses the crash dump map to load ACPI tables by loading the RSDT/XSDT into pages 1 ... N and loading the header of each ACPI table header into page 0 looking for the MADT. However, if a table header crossed a page boundary, then page 1 would get trashed resulting in a panic. Fix this by reserving the first 2 pages for ACPI table headers (headers are less than a page in size, so 2 pages will be sufficient) and use pages 2 .. N for the RSDT and XSDT. Note: amd64 should probably be simplified to just use pmap_mapbios() for all these tables which will use the direct map and not need the crash dump hack. MFC after: 5 days Tested on: i386 Reported by: Pete French petefrench of ticketswitch.com
* This is a follow-up, cleaning-up commit about recent changes involvingattilio2007-09-111-1/+1
| | | | | | | | | | | | | | | | topology foo functions. Working at the patch for topology problems in ia32/amd64 evicted some problems regarding functions ordering in the SI_SUB_CPU family of SYSINIT'ed subsystems. In order to avoid problems with new modified to involved functions, a correct ordering is not semantically specified for SI_SUB_CPU functions (for a larger view of the issue please visit: http://lists.freebsd.org/pipermail/freebsd-current/2007-July/075409.html ) Discussed with: peter Tested by: kris, Rui Paulo <rpaulo@FreeBSD.org> Approved by: jeff Approved by: re
* Handle CPUs with APIC IDs higher than 32 (at least one IBM server usesjhb2007-05-081-10/+7
| | | | | | | | | | | | | an APIC ID of 38 for its second CPU): - Add a new MAX_APIC_ID constant for the highest valid APIC ID for modern systems. - Size the various arrays in the MADT, MP Table, and SMP code that are indexed by APIC IDs to allow for up to MAX_APIC_ID. - Explicitly go through and assign logical cpu ids to local APICs before starting any of the APs up rather than doing it while starting up the APs. This step is now where we honor MAXCPU. MFC after: 1 week
* Catch up with ACPI-CA 20070320 import.jkim2007-03-221-124/+126
|
* Use vm_paddr_t rather than uintptr_t when passing the physical address ofjhb2007-03-051-4/+3
| | | | APICs to lapic_init() and ioapic_create().
* First pass at allowing memory to be mapped using cache modes other thanjhb2006-08-111-5/+5
| | | | | | | | | | | | | | | | | | | | WB (write-back) on x86 via control bits in PTEs and PDEs (including making use of the PAT MSR). Changes include: - A new pmap_mapdev_attr() function for amd64 and i386 which takes an additional parameter (relative to pmap_mapdev()) specifying the cache mode for this mapping. Note that on amd64 only WB mappings are done with the direct map, all other modes result in a private mapping. - pmap_mapdev() on i386 and amd64 now defaults to using UC (uncached) mappings rather than WB. Previously we relied on the BIOS setting up MTRR's to enforce memio regions being treated as UC. This might make hw.cbb_start_memory unnecessary in some cases now for example. - A new pmap_mapbios()/pmap_unmapbios() API has been added to allow places that used pmap_mapdev() to map non-device memory (such as ACPI tables) to do so using WB as before. - A new pmap_change_attr() function for amd64 and i386 that changes the caching mode for a range of KVA. Reviewed by: alc
* If the XSDT address in the RSDP for an ACPI 2.0 machine is NULL, then falljhb2006-03-271-4/+5
| | | | | | | | back to using the RSDT instead. ACPI-CA already follows this same strategy as a workaround for yet another instance of brain-damaged BIOS writers. PR: i386/93963 Submitted by: Masayuki FUKUI <fukui.FreeBSD@fanet.net>
* Catch up with ACPI-CA 20051021 importjkim2005-11-011-1/+1
|
* Normalize a significant number of kernel malloc type names:rwatson2005-10-311-1/+1
| | | | | | | | | | | | | | | | | | | - Prefer '_' to ' ', as it results in more easily parsed results in memory monitoring tools such as vmstat. - Remove punctuation that is incompatible with using memory type names as file names, such as '/' characters. - Disambiguate some collisions by adding subsystem prefixes to some memory types. - Generally prefer lower case to upper case. - If the same type is defined in multiple architecture directories, attempt to use the same name in additional cases. Not all instances were caught in this change, so more work is required to finish this conversion. Similar changes are required for UMA zone names.
* Canonize the include of acpi.h.obrien2005-09-111-1/+1
|
* Remove support for mixed mode altogether now that we no longer use IRQ 0jhb2005-04-141-2/+0
| | | | | | when using an APIC. This simplifies the APIC code somewhat and also allows us to be pedantically more compliant with ACPI which mandates no use of mixed mode.
* - Add a new quirk to indicate that pin 0 of the first I/O APIC is reallyjhb2005-02-221-2/+8
| | | | | | | | | IRQ 0 and not an ExtINT pin. The MADT enumerators ignore the PC-AT flag and ignore overrides that map IRQ 0 to pin 2 when this quirk is present. - Add a block comment above the quirks to document each quirk so that we can use more verbose descriptions quirks. MFC after: 2 weeks
* Completely ignore disabled CPU entries as their APIC IDs tend to bejhb2004-06-101-13/+8
| | | | invalid.
* Use the local APIC ID rather than the ACPI Processor ID to index the arrayjhb2004-06-011-28/+30
| | | | of CPUs since local APIC IDs are bounded but ACPI IDs are not bounded.
* Fixup a few bogons in a comment.jhb2004-05-111-3/+3
|
* Rework the APIC mixed mode support a bit:jhb2004-05-101-0/+2
| | | | | | | | | | | | | | | | | - Require the APIC enumerators to explicitly enable mixed mode by calling ioapic_enable_mixed_mode(). Calling this function tells the apic driver that the PC-AT 8259A PICs are present and routable through the first I/O APIC via an ExtINT pin. The mptable enumerator always calls this function for now. The MADT enumerator only enables mixed mode if the PC-AT compatability flag is set in the MADT header. - Allow mixed mode to be enabled or disabled via a 'hw.apic.mixed_mode' tunable. By default this tunable is set to 1 (true). The kernel option NO_MIXED_MODE changes the default to 0 to preserve existing behavior, but adding 'hw.apic.mixed_mode=0' to loader.conf achieves the same effect. - Only use mixed mode to route IRQ 0 if it is both enabled by the APIC enumerator and activated by the loader tunable. Note that both conditions must be true, so if the APIC enumerator does not enable mixed mode, then you can't set the tunable to try to override the enumerator.
* - Change madt_map_table() to verify the checksum of any table it is askedjhb2004-05-101-2/+30
| | | | | | | | | | | to map. If the checksum fails, the table is unmapped and a NULL pointer returned. - For ACPI version >= 2.0, check the extended checksum of the RSDP. AcpiOsGetRootPointer() already checks the version 1.0 checksum. - Remap the full MADT table at the end of madt_probe() so that we verify its checksum before saying it is really there. Requested by: njl
* - Change the APIC code to mostly use the recently added intr_triggerjhb2004-05-041-36/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | and intr_polarity enums for passing around interrupt trigger modes and polarity rather than using the magic numbers 0 for level/low and 1 for edge/high. - Convert the mptable parsing code to use the new ELCR wrapper code rather than reading the ELCR directly. Also, use the ELCR settings to control both the trigger and polarity of EISA IRQs instead of just the trigger mode. - Rework the MADT's handling of the ACPI SCI again: - If no override entry for the SCI exists at all, use level/low trigger instead of the default edge/high used for ISA IRQs. - For the ACPI SCI, use level/low values for conforming trigger and polarity rather than the edge/high values we use for all other ISA IRQs. - Rework the tunables available to override the MADT. The hw.acpi.force_sci_lo tunable is no longer supported. Instead, there are now two tunables that can independently override the trigger mode and/or polarity of the SCI. The hw.acpi.sci.trigger tunable can be set to either "edge" or "level", and the hw.acpi.sci.polarity tunable can be set to either "high" or "low". To simulate hw.acpi.force_sci_lo, set hw.acpi.sci.trigger to "level" and hw.acpi.sci.polarity to "low". If you are having problems with ACPI either causing an interrupt storm or not working at all (e.g., the power button doesn't turn invoke a shutdown -p now), you can try tweaking these two tunables to find the combination that works.
* Revert part of the "BIOS brain damage" from rev 1.10. It seems thatjhb2004-04-161-4/+5
| | | | | | | | | | | | | | | | | | | | | different BIOSs use the same exact settings to mean two very different and incompatible things for the SCI. Thus, if the SCI is remapped to a PCI interrupt, we now trust the trigger/polarity that the MADT provides by default. However, the SCI can be forced to level/lo as 1.10 did by setting the tunable "hw.acpi.force_sci_lo" to a non-zero value from the loader. Thus, if rev 1.10 caused an interrupt storm, it should nwo fix your machine. If rev 1.10 fixed an interrupt storm on your machine, you probably need to set the aforementioned tunable in /boot/loader.conf to prevent the interrupt storm. The more general problem of getting the SCI's trigger/polarity programmed "correctly" (for some value of correctly meaning several workarounds for broken BIOSs and inconsistent "implementations" of the ACPI standard) is going to require more work, but this band-aid should improve the current situation somewhat. Requested by: njl
* - Call acpi_Startup() before parsing interrupt-related APIC resources so wejhb2004-01-261-7/+43
| | | | | | | | | | | | | | | | | can look at the ACPI tables. If the startup fails, we panic and tell the user to try rebooting with ACPI disabled. Previously in this case we would try to use $PIR interrupt routing which only works for the atpic while using the apic to handle interrupts which would result in misrouted interrupts and a hang at boot time with no error message. - Read the SCI out of the FADT instead of hardcoding 9 when checking to see if an interrupt override entry is for the SCI. - Try to work around some BIOS brain damage for the SCI's programming by forcing the SCI to be level triggered and active low if it is routed to a non-ISA interrupt (greater than 15) or if it is identity mapped with edge trigger and active high polarity. This should fix some of the hangs with device apic and ACPI that some people see. Reviewed by: njl
* Use the ACPI-CA definitions for the various APIC tables instead of ournjl2003-12-091-59/+55
| | | | own.
* - Reorder the APIC enumerator SYSINIT's to register enumeators atjhb2003-12-031-3/+2
| | | | | | | | | | | | | | SI_SUB_CPU - 1 and probe enumerators, probe CPUs, and setup the local APIC programming all at SI_SUB_CPU / SI_ORDER_FIRST. This is needed to help get the ACPI module working again as it moves the APIC enumeration code after SI_SUB_KLD. - In the MADT parser, use mp_maxid rather than MAXCPU to terminate a loop when assigning per-cpu ACPI IDs to avoid a dependency on 'options SMP'. - Allow the apic device to be disabled via 'hint.apic.0.disabled' from the loader. Note that since this is done in the local APIC code, it works for both the ACPI and non-ACPI cases. Approved by: re (scott / blanket)
* Minor source sync with amd64. For %.*s printf formats, pass in anpeter2003-11-141-3/+5
| | | | | int rather than a size_t. cast the ioapicaddress variable via uintptr_t before going to void *.
* Some motherboards like to remap the SCI (normally IRQ 9) up to a PCIjhb2003-11-111-1/+6
| | | | | | | | | | | | | | | | | interrupt such as IRQ 22 or 19. However, the ACPI BIOS still routes interrupts from some PCI devices to the same intpin calling the pin IRQ 22. Thus, ACPI expects to address a single interrupt source via two different names. To work around this, if the SCI is remapped to a non-ISA interrupt (i.e., greater than 15), then we use acpi_OverrideInterruptLevel() function to tell ACPI to use IRQ 22 or 19 rather than IRQ 9 for the SCI. Previously we would change IRQ 22 or 19's name to IRQ 9 when we encountered such an Interrupt Source Override entry in the MADT which routed the SCI properly but left PCI devices mapped to IRQ 22 or 19 w/o a routable interrupt. Tested by: sos
* Bump APIC ID limits up to 32 since a machine with 16 CPUs will have APICjhb2003-11-101-2/+2
| | | | | | IDs for the I/O APICs that are greater than 16. Reported by: John Cagle <john.cagle@hp.com>
* Only disable the old pin when doing a remap if it's current vector is stilljhb2003-11-061-1/+2
| | | | | | the old vector. Reported by: sam
* When remapping an ISA interrupt from one intpin to another, disable thejhb2003-11-051-8/+16
| | | | | | | | | pin that is used by the default identity mapping if it still maps to the old vector. The ACPI case might need some tweaking for the SCI interrupt case since ACPI likes to address the intpin using both the IRQ remapped to it as well as the previous existing PCI IRQ mapped to it. Reported by: kan
* Make this compile with PAE.peter2003-11-041-5/+6
|
* Add the ACPI MADT table APIC enumerator. This code uses the ACPI Multiplejhb2003-11-031-0/+650
APIC Descriptor Table to enumerate both I/O APICs and local APICs. ACPI does not embed PCI interrupt routing information in the MADT like the MP Table does. Instead, ACPI stores the PCI interrupt routing information in the _PRT object under each PCI bus device. The MADT table simply provides hints about which interrupt vectors map to which I/O APICs. Thus when using ACPI, the existing ACPI PCI bridge drivers are sufficient to route PCI interrupts.
OpenPOWER on IntegriCloud