summaryrefslogtreecommitdiffstats
path: root/sys/i386/acpica
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Make unnecessary globals static and remove unused includes.njl2004-05-062-6/+1
| | | | Pointed out by: cscout
* Style cleanups, u_intXX -> uintXX.njl2004-05-052-45/+28
|
* Have ACPI use BUS_CONFIG_INTR() to force the SCI to level trigger andjhb2004-05-041-1/+4
| | | | | | | | active low polarity when using the PIC interrupt model. This should fix broken SCI interrupts on machines when not using the APIC where the BIOS doesn't program the ELCR to level trigger for the ACPI SCI. 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.
* Enable the led-toggling magic. Compiling files which are in the kernel intophilip2004-04-231-12/+0
| | | | | | | | | modules is a very nice way to produce hard-to-find panics. Who would look for a bug in a Makefile anyway? Has anyone seen the pointy hat? :-o Approved by: njl (mentor)
* Add the ACPI Asus extras driver. Provides support for cool ACPI-controledphilip2004-04-221-0/+629
| | | | | | | | | gadgets (hotkeys, lcd, ...) on Asus laptops. I aim to closely track the acpi4asus project which implements these features in the Linux kernel. If this breaks your laptop, please let me know how it does it :-) Approved by: njl (mentor)
* Don't check for NULL, device_get_softc() always succeeds.njl2004-04-211-4/+2
|
* 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
* Use METHOD_VIDEO instead of the method string itself.njl2004-04-141-1/+1
| | | | Pointed out by: Andrew Thompson
* Add support for video output switching. It appears no systems use HCI tonjl2004-04-141-10/+78
| | | | | | | | change the video output but use a separate device with a DSSX method and a HID of "TOS6201" instead. We use a pseudo-driver to get the handle for this object and pass it to the acpi_toshiba driver. This is untested but seems to match the Linux Toshiba driver.
* Use headers from the kernel source tree rather than installed headers.des2004-04-131-1/+1
| | | | Submitted by: ru
* Unify on version 1 to be similar to the rest of the tree. After 5-stablenjl2004-04-081-1/+1
| | | | branches, increment version on any API change visible to other modules.
* These are changes to allow to use the Intel C/C++ compiler (lang/icc)trhodes2004-03-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to build the kernel. It doesn't affect the operation if gcc. Most of the changes are just adding __INTEL_COMPILER to #ifdef's, as icc v8 may define __GNUC__ some parts may look strange but are necessary. Additional changes: - in_cksum.[ch]: * use a generic C version instead of the assembly version in the !gcc case (ASM code breaks with the optimizations icc does) -> no bad checksums with an icc compiled kernel Help from: andre, grehan, das Stolen from: alpha version via ppc version The entire checksum code should IMHO be replaced with the DragonFly version (because it isn't guaranteed future revisions of gcc will include similar optimizations) as in: ---snip--- Revision Changes Path 1.12 +1 -0 src/sys/conf/files.i386 1.4 +142 -558 src/sys/i386/i386/in_cksum.c 1.5 +33 -69 src/sys/i386/include/in_cksum.h 1.5 +2 -0 src/sys/netinet/igmp.c 1.6 +0 -1 src/sys/netinet/in.h 1.6 +2 -0 src/sys/netinet/ip_icmp.c 1.4 +3 -4 src/contrib/ipfilter/ip_compat.h 1.3 +1 -2 src/sbin/natd/icmp.c 1.4 +0 -1 src/sbin/natd/natd.c 1.48 +1 -0 src/sys/conf/files 1.2 +0 -1 src/sys/conf/files.amd64 1.13 +0 -1 src/sys/conf/files.i386 1.5 +0 -1 src/sys/conf/files.pc98 1.7 +1 -1 src/sys/contrib/ipfilter/netinet/fil.c 1.10 +2 -3 src/sys/contrib/ipfilter/netinet/ip_compat.h 1.10 +1 -1 src/sys/contrib/ipfilter/netinet/ip_fil.c 1.7 +1 -1 src/sys/dev/netif/txp/if_txp.c 1.7 +1 -1 src/sys/net/ip_mroute/ip_mroute.c 1.7 +1 -2 src/sys/net/ipfw/ip_fw2.c 1.6 +1 -2 src/sys/netinet/igmp.c 1.4 +158 -116 src/sys/netinet/in_cksum.c 1.6 +1 -1 src/sys/netinet/ip_gre.c 1.7 +1 -2 src/sys/netinet/ip_icmp.c 1.10 +1 -1 src/sys/netinet/ip_input.c 1.10 +1 -2 src/sys/netinet/ip_output.c 1.13 +1 -2 src/sys/netinet/tcp_input.c 1.9 +1 -2 src/sys/netinet/tcp_output.c 1.10 +1 -1 src/sys/netinet/tcp_subr.c 1.10 +1 -1 src/sys/netinet/tcp_syncache.c 1.9 +1 -2 src/sys/netinet/udp_usrreq.c 1.5 +1 -2 src/sys/netinet6/ipsec.c 1.5 +1 -2 src/sys/netproto/ipsec/ipsec.c 1.5 +1 -1 src/sys/netproto/ipsec/ipsec_input.c 1.4 +1 -2 src/sys/netproto/ipsec/ipsec_output.c and finally remove sys/i386/i386 in_cksum.c sys/i386/include in_cksum.h ---snip--- - endian.h: * DTRT in C++ mode - quad.h: * we don't use gcc v1 anymore, remove support for it Suggested by: bde (long ago) - assym.h: * avoid zero-length arrays (remove dependency on a gcc specific feature) This change changes the contents of the object file, but as it's only used to generate some values for a header, and the generator knows how to handle this, there's no impact in the gcc case. Explained by: bde Submitted by: Marius Strobl <marius@alchemy.franken.de> - aicasm.c: * minor change to teach it about the way icc spells "-nostdinc" Not approved by: gibbs (no reply to my mail) - bump __FreeBSD_version (lang/icc needs to know about the changes) Incarnations of this patch survive gcc compiles since a loooong time, I use it on my desktop. An icc compiled kernel works since Nov. 2003 (exceptions: snd_* if used as modules), it survives a build of the entire ports collection with icc. Parts of this commit contains suggestions or submissions from Marius Strobl <marius@alchemy.franken.de>. Reviewed by: -arch Submitted by: netchild
* Add support for quirks for acpi tables. Key off OEM vendor and revision.njl2004-03-031-7/+0
| | | | | | Sort acpi debug values. Change "disable" to "disabled" to match rest of the kernel. Remove debugging from acpi_toshiba since it was only used for probe/attach.
* Device megapatch 4/6:phk2004-02-211-0/+2
| | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
* Device megapatch 1/6:phk2004-02-211-2/+0
| | | | | | | Free approx 86 major numbers with a mostly automatically generated patch. A number of strategic drivers have been left behind by caution, and a few because they still (ab)use their major number.
* - 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
* Only remove the handler if we installed it.njl2004-01-121-2/+4
|
* Clean up the probe message and sort the function table according tonjl2004-01-121-3/+3
| | | | the function order in the file.
* Add the ACPI Toshiba extras driver (hotkeys, LCD backlight, video output,njl2004-01-111-0/+485
| | | | | | | | | | | forced fan control, and CPU throttling). PR: Submitted by: Hiroyuki Aizu <aizu@navi.org> Reviewed by: Approved by: Obtained from: MFC after:
* Use <machine/asmacros.h> since <machine/asm.h> is a userland-only headernjl2004-01-011-3/+3
| | | | | | | | | | | and gives very wrong macros for ENTRY(), etc. for kernel programs. PR: Suggested by: bde Reviewed by: Approved by: Obtained from: MFC after:
* 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
|
* - Update includes.jhb2003-11-031-3/+4
| | | | | | - Use intr_suspend/resume() callouts to the interrupt code layer which suspends and resumes all the known interrupt sources instead of calling icu_reinit() directly.
* 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.
* Fix the logic to match the new name of the tunable.njl2003-11-011-1/+1
| | | | Pointed out by: iwasaki
* Change the reset video option to be positive (hw.acpi.reset_video).njl2003-11-014-26/+27
| | | | | | | | | | | | | Requested by: jhb Initialize the real mode stack. This is needed at least for the return address from the lcall. Requested by: takawata Fix style bugs in acpi_wakecode.S Requested by: bde Remove the kernel option now that we have the tunable.
* Add sysctl MIB and loader tunable `hw.acpi.no_reset_video' asiwasaki2003-10-303-0/+17
| | | | the same effect as ACPI_NO_RESET_VIDEO kernel option.
* Add kernel option ACPI_NO_RESET_VIDEO as workaround for problemsiwasaki2003-10-292-0/+6
| | | | | (e.g. LCD white-out after resume) on some machine cased by re-initialize video BIOS code in acpi_wakecode.
* Call the VESA reset BIOS vector on the resume path. This may help displaysnjl2003-10-271-0/+9
| | | | after resume. I have not found it to break anything.
* - Eliminate the pte object.alc2003-09-251-9/+0
| | | | | - Use kmem_alloc_nofault() rather than kmem_alloc_pageable() to allocate KVA space for the page directory page(s). Submitted by: tegge
* Add final adjustment code of battery status based on the battery capacityiwasaki2003-09-171-0/+9
| | | | rather than returning unknown status.
* Finish an earlier commit:jhb2003-09-101-3/+11
| | | | | Add a acpi_SetDefaultIntrModel() method to allow drivers to set the interrupt model prior to the acpi0 device being probed and attached.
* Don't disable interrupts a second time. Remove an extraneous interruptnjl2003-09-081-4/+1
| | | | | | | enable (that happens elsewhere). Clarify the interrupt disabling point by using ACPI_DISABLE_IRQS(). Tested by: Kevin Oberman
* Use the ACPICA AcpiEnterSleepStateS4bios instead of rolling our own. Thisnjl2003-08-291-3/+4
| | | | | | change also disables interrupts around non-S4 suspends whereas before we did not do this. Our version of AcpiEnterSleepStateS4bios was almost identical to the ACPICA version.
* Style cleanups.njl2003-08-284-72/+35
|
* Use ACPI_FLUSH_CPU_CACHE() instead of wbinvd(). Verified .o with md5.njl2003-07-301-1/+1
| | | | Pointed out by: Mark Santcroos <marks@ripe.net>
* Commit Ian Dowse's workaround for acpi resume resetting after thepeter2003-07-211-0/+8
| | | | | | | | | | LAZY_SWITCH changes. He pointed out the acpi code sets up an identity mapping in the current vmspace and that got messed up by the %cr3 being out of sync with the current page directory. As a workaround, restore %cr3 across the sleep/resume. A more complete fix would be to undo the lazy state and clear the pm_active bit from the borrowed pmap, but this works and people are currently hurting. I'll clean this up. This is mostly Ian's patch, plus a PAE tweak from me.
* Mega busdma API commit.scottl2003-07-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg. Lockfunc allows a driver to provide a function for managing its locking semantics while using busdma. At the moment, this is used for the asynchronous busdma_swi and callback mechanism. Two lockfunc implementations are provided: busdma_lock_mutex() performs standard mutex operations on the mutex that is specified from lockfuncarg. dftl_lock() is a panic implementation and is defaulted to when NULL, NULL are passed to bus_dma_tag_create(). The only time that NULL, NULL should ever be used is when the driver ensures that bus_dmamap_load() will not be deferred. Drivers that do not provide their own locking can pass busdma_lock_mutex,&Giant args in order to preserve the former behaviour. sparc64 and powerpc do not provide real busdma_swi functions, so this is largely a noop on those platforms. The busdma_swi on is64 is not properly locked yet, so warnings will be emitted on this platform when busdma callback deferrals happen. If anyone gets panics or warnings from dflt_lock() being called, please let me know right away. Reviewed by: tmm, gibbs
* Use __FBSDID().obrien2003-06-024-8/+12
|
* Add some extra #ifdef stubs so that this compiles on 4.8.jhb2003-05-132-0/+9
| | | | Approved by: re (rwatson/bmah)
OpenPOWER on IntegriCloud