summaryrefslogtreecommitdiffstats
path: root/sys/pci/intpm.c
Commit message (Collapse)AuthorAgeFilesLines
* intpm: add ATI IXP400 pci idavg2012-04-161-0/+3
| | | | | | | PR: kern/136762 Submitted by: Aurelien Mere <freebsd@amc-os.com> Tested by: Jens Link <jens.link@gmx.de> MFC after: 5 days
* intpm: return only SMB bus error codes from SMB methodsavg2012-04-081-3/+3
| | | | | PR: kern/25733 MFC after: 5 days
* intpm: reflect the fact that SB800 and later AMD chipsets are not supportedavg2012-04-081-0/+3
| | | | | | | | They do not have compatible configuration registers in PCI configuration space. Instead their configuration resides in AMD "PM I/O" space (accessed via a pair of I/O space registers). MFC after: 5 days
* - There's no need to overwrite the default device method with the defaultmarius2011-11-221-4/+1
| | | | | | | | | | one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9) since r52045) but even recently added device drivers do this unnecessarily. Discussed with: jhb, marcel - While at it, use DEVMETHOD_END. Discussed with: jhb - Also while at it, use __FBSDID.
* intpm/sb700: force polling mode if configured interrupt is SMIavg2009-09-191-0/+6
| | | | instead of failing to attach
* intpm: add support for smbus controller found in AMD SB700avg2009-09-121-13/+41
| | | | | | | | | | | | | | | | According to the specifications AMD/ATI SMBus controller is very similar to SMBus controller found in PIIX4. Some notable differences: o different bit for enabling/signalling regular interrupt mode o in practice seems to support only polling mode Thus, intpm driver is modified to support polling-only mode and to recognize SB700 PCI ID and differences. Tested on: SB700 and PIIX4E platforms Reviewed by: jhb MFC after: 2 weeks X-Perhaps-ToDo: rename the driver to reflect its function and supported hardware
* intpm: minor enhancementsavg2009-03-161-8/+8
| | | | | | | | | | | 1. fix nointr check in intsmb_start, matters only if ENABLE_ALART is defined (by default, it is not); 2. drop unnecessary inspection/reporting of power-management io registers base address; 3. in verbose mode report errors from SMBus host controller and their mapping to smbus(4) errors; Approved by: jhb (mentor)
* - Use bus_foo() rather than bus_space_foo() and remove bus space tag/handlejhb2008-06-061-2/+2
| | | | | | from softc. - Mark interrupt handlers MPSAFE as these drivers have been locked for a while.
* - Set sc->dev to the new-bus device_t so all the device_printf()s work.jhb2008-05-121-1/+3
| | | | | | | - Add a missing newline to a printf. MFC after: 1 week Submitted by: Andriy Gapon avg <> icyb.net.ua
* Oops, convert a tsleep() to a msleep() that was missed when adding lockingjhb2007-10-151-1/+1
| | | | | | to this driver. Reported by: Michael Butler : imb of protected-networks net
* Oops, fix intsmb(4) attach. Don't overwrite the 'value' holding thejhb2007-04-191-2/+1
| | | | | | | interrupt mode with the SMB revision before checking 'value' for a valid interrupt mode. Reported by: Ulrich Spoerlein <uspoerlein of gmail fame>
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-231-2/+2
| | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@
* Remove duplicate variable initialization.jhb2007-01-161-1/+0
| | | | | CID: 1706 Found by: Coverity Prevent (tm)
* Various updates to most of the smbus(4) drivers:jhb2007-01-111-430/+418
| | | | | | | | | | | | | | | | | | - Use printf() and device_printf() instead of log() in ichsmb(4). - Create the mutex sooner during ichsmb(4) attach. - Attach the interrupt handler later during ichsmb(4) attach to avoid races. - Don't try to set PCIM_CMD_PORTEN in ichsmb(4) attach as the PCI bus driver does this already. - Add locking to alpm(4), amdpm(4), amdsmb(4), intsmb(4), nfsmb(4), and viapm(4). - Axe ALPM_SMBIO_BASE_ADDR, it's not really safe to write arbitrary values into BARs, and the PCI bus layer will allocate resources now if needed. - Merge intpm(4) and intsmb(4) into just intsmb(4). Previously, intpm(4) attached to the PCI device and created an intsmb(4) child. Now, intsmb(4) just attaches to PCI directly. - Change several intsmb functions to take a softc instead of a device_t to make things simpler.
* intpm(4) meet style(9). style(9) meet intpm(4).jhb2006-09-131-484/+522
|
* Minor overhaul of SMBus support:jhb2006-09-111-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Change smbus_callback() to pass a void * rather than caddr_t. - Change smbus_bread() to pass a pointer to the count and have it be an in/out parameter. The input is the size of the buffer (same as before), but on return it will contain the actual amount of data read back from the bus. Note that this value may be larger than the input value. It is up to the caller to treat this as an error if desired. - Change the SMB_BREAD ioctl to write out the updated struct smbcmd which will contain the actual number of bytes read in the 'count' field. To preserve the previous ABI, the old ioctl value is mapped to SMB_OLD_BREAD which doesn't copy the updated smbcmd back out to userland. I doubt anyone actually used the old BREAD anyway as it was rediculous to do a bulk-read but not tell the using program how much data was actually read. - Make the smbus driver and devclass public in the smbus module and push all the DRIVER_MODULE()'s for attaching the smbus driver to various foosmb drivers out into the foosmb modules. This makes all the foosmb logic centralized and allows new foosmb modules to be self-contained w/o having to hack smbus.c everytime a new smbus driver is added. - Add a new SMB_EINVAL error bit and use it in place of EINVAL to return an error for bad arguments (such as invalid counts for bread and bwrite). - Map SMB bus error bits to EIO in smbus_error(). - Make the smbus driver call bus_generic_probe() and require child drivers such as smb(4) to create device_t's via identify routines. Previously, smbus just created one anonymous device during attach, and if you had multiple drivers that could attach it was just random chance as to which driver got to probe for the sole device_t first. - Add a mutex to the smbus(4) softc and use it in place of dummy splhigh() to protect the 'owner' field and perform necessary synchronization for smbus_request_bus() and smbus_release_bus(). - Change the bread() and bwrite() methods of alpm(4), amdpm(4), and viapm(4) to only perform a single transaction and not try to use a loop of multiple transactions for a large request. The framing and commands to use for a large transaction depend on the upper-layer protocol (such as SSIF for IPMI over SMBus) from what I can tell, and the smb(4) driver never allowed bulk read/writes of more than 32-bytes anyway. The other smb drivers only performed single transactions. - Fix buffer overflows in the bread() methods of ichsmb(4), alpm(4), amdpm(4), amdsmb(4), intpm(4), and nfsmb(4). - Use SMB_xxx errors in viapm(4). - Destroy ichsmb(4)'s mutex after bus_generic_detach() to avoid problems from child devices making smb upcalls that would use the mutex during their detach methods. MFC after: 1 week Reviewed by: jmg (mostly)
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386nyan2005-05-291-2/+0
| | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr)
* Return BUS_PROBE_DEFAULT instead of 0.imp2005-02-241-2/+2
|
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-171-2/+1
| | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
* Prefer new location of pci include files (which have only been in theimp2003-08-221-2/+2
| | | | | tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD.
* Use __FBSDID().obrien2003-06-111-2/+3
|
* Use rman_get_start() to get start address of the resource.nyan2003-02-261-2/+2
|
* Wrap a device_printf() that violates bus space abstractions to figure outjhb2002-11-081-0/+2
| | | | | if it's IO port resource is IO or memory mapped for the sake of a printf using i386-specific values in #ifdef __i386__.
* Major rework of the iicbus/smbus framework:nsouch2002-03-231-1/+3
| | | | | | | | - VIA chipset SMBus controllers added - alpm driver updated - Support for dynamic modules added - bktr FreeBSD smbus updated but not tested - cleanup
* Remove __P.alfred2002-03-201-1/+1
|
* Add support for the Intel 82443MX chipsetpirzyk2001-12-211-0/+1
| | | | | PR: kern/33032 MFC after: 1 month
* Fix warning:peter2001-06-151-2/+2
| | | | 298: warning: assignment makes pointer from integer without a cast
* Add a placeholder for the ServerWorks OSB4 device id. The SMBuspeter2001-03-151-0/+4
| | | | | | interface on this chip is compatable with the PIIX4. The catch is that this interferes with isab0 which wants to attach to the same PCI node. It seems to work, but we only tested it on systems with no ISA cards.
* Remove unneeded #include <machine/clock.h>phk2000-10-151-1/+0
|
* Fix some leakage from inside #ifdef PCI_COMPAT (the FreeBSD 2.2 compatpeter2000-05-281-2/+1
| | | | stuff).
* Remove ~25 unneeded #include <sys/conf.h>phk2000-04-191-2/+0
| | | | Remove ~60 unneeded #include <sys/malloc.h>
* Remove unneeded <sys/buf.h> includes.phk2000-04-181-1/+0
| | | | | Due to some interesting cpp tricks in lockmgr, the LINT kernel shrinks by 924 bytes.
* Remove the 'ivars' arguement to device_add_child() andmdodd1999-12-031-1/+1
| | | | | | | | | | | | | | | | device_add_child_ordered(). 'ivars' may now be set using the device_set_ivars() function. This makes it easier for us to change how arbitrary data structures are associated with a device_t. Eventually we won't be modifying device_t to add additional pointers for ivars, softc data etc. Despite my best efforts I've probably forgotten something so let me know if this breaks anything. I've been running with this change for months and its been quite involved actually isolating all the changes from the rest of the local changes in my tree. Reviewed by: peter, dfr
* Fix some resource allocation peculiarities of the intpm device.dfr1999-10-281-12/+1
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Alter the behavior of sys/kern/subr_bus.c:device_print_child()mdodd1999-07-291-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - device_print_child() either lets the BUS_PRINT_CHILD method produce the entire device announcement message or it prints "foo0: not found\n" Alter sys/kern/subr_bus.c:bus_generic_print_child() to take on the previous behavior of device_print_child() (printing the "foo0: <FooDevice 1.1>" bit of the announce message.) Provide bus_print_child_header() and bus_print_child_footer() to actually print the output for bus_generic_print_child(). These functions should be used whenever possible (unless you can just use bus_generic_print_child()) The BUS_PRINT_CHILD method now returns int instead of void. Modify everything else that defines or uses a BUS_PRINT_CHILD method to comply with the above changes. - Devices are 'on' a bus, not 'at' it. - If a custom BUS_PRINT_CHILD method does the same thing as bus_generic_print_child(), use bus_generic_print_child() - Use device_get_nameunit() instead of both device_get_name() and device_get_unit() - All BUS_PRINT_CHILD methods return the number of characters output. Reviewed by: dfr, peter
* Update intpm driver.nsouch1999-07-241-6/+17
| | | | | PR: kern/12631 Submitted by: Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp>
* Eliminate a bunch of #include "pci.h" and #if NPCI > 0 around entirepeter1999-07-031-8/+1
| | | | files. config will leave the whole file out if configured to do so.
* fix some DRIVER_TYPE / INTR_TYPE confusions.phk1999-05-091-3/+2
|
* Move the declaration of the interrupt type from the driver structuredfr1999-05-081-2/+1
| | | | to the BUS_SETUP_INTR call.
* Update intpm driver.peter1999-05-071-131/+104
| | | | | PR: 11531 Submitted by: Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp>
* Fix some variable naming confusionpeter1999-05-061-3/+2
|
* Use COMPAT_PCI_DRIVER() for registration if it exists. This shouldn'tpeter1999-04-241-1/+5
| | | | hurt the driver portability to 3.x too much for where drivers are shared.
* Stage 1 of a cleanup of the i386 interrupt registration mechanism.peter1999-04-211-8/+4
| | | | | | | Interrupts under the new scheme are managed by the i386 nexus with the awareness of the resource manager. There is further room for optimizing the interfaces still. All the users of register_intr()/intr_create() should be gone, with the exception of pcic and i386/isa/clock.c.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-281-2/+2
| | | | kernel compile
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-271-2/+2
| | | | | | | kernel compile. This commit includes significant work to proper handle const arguments for the DDB symbol routines.
* Add missing declarations to fix error with LINT compiledillon1999-01-271-1/+6
|
* SMBus support for the Intel PIIX4 power management unit. See smbus(4),nsouch1999-01-241-0/+789
iicbus(4) and smb(4). User programs are available to retrieve SDRAM and sensor info, contact the author. Submitted by: Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp> Reviewed by: Mike Smith <msmith@freebsd.org>
OpenPOWER on IntegriCloud