summaryrefslogtreecommitdiffstats
path: root/sys/pci/viapm.c
Commit message (Collapse)AuthorAgeFilesLines
* Various updates to most of the smbus(4) drivers:jhb2007-01-111-28/+83
| | | | | | | | | | | | | | | | | | - 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.
* Trim some unneeded includes.jhb2006-09-121-2/+0
|
* Minor overhaul of SMBus support:jhb2006-09-111-54/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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)
* Since DELAY() was moved, most <machine/clock.h> #includes have beenphk2006-05-161-1/+0
| | | | unnecessary.
* Fix -Wundef from compiling the amd64 LINT.ru2005-12-041-4/+4
|
* Add the device ID for the VIA VT8235 south bridge.jhb2005-10-311-0/+7
| | | | | | | PR: kern/62438 Submitted by: FUJIMOTO Kou fujimoto at j dot dendai dot ac dot jp Tested by: Oliver Fromme olli at secnetix dot de MFC after: 1 week
* Some of the VIA pm and propm devices are actually the same device as thejhb2005-10-311-1/+38
| | | | | | | | | | | | | | | | | PCI-ISA bridge. Thus, when viapm0 or viapropm0 attaches, isab0 dosen't attach so there is no isa0 bus hung off of that bridge. In the non-ACPI case, legacy0 will add an isa0 anyway as a fail-safe, but ACPI assumes that any ISA bus will be enumerated via a bridge. To fix this, call isab_attach() to attach an isa0 ISA child bus device if the pm or propm device we are probing is a PCI-ISA bridge. Both drivers now have to implement the bus_if interface via the generic methods for resource allocation, etc. to work. Also, we now add 2 new ISA bus drivers that attach to viapm and viapropm devices. PR: kern/87363 Reported by: Oliver Fromme olli at secnetix dot de Tested by: glebius MFC after: 1 week
* 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
|
* Prefer C99's __func__ over GCC's __FUNCTION__.stefanf2004-09-221-2/+1
|
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-171-4/+4
| | | | | 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.
* Add ID for VT8233A.mdodd2003-06-221-0/+2
| | | | | PR: i386/38299 Submitted by: Rob Schulhof <rrs@there.net>
* Use __FBSDID().obrien2003-06-111-3/+4
|
* - Express hard dependencies on bus (pci, isa, pccard) andmdodd2003-04-151-0/+2
| | | | | | | | network layer (ether). - Don't abuse module names to facilitate ifconfig module loading; such abuse isn't really needed. (And if we do need type information associated with a module then we should make it explicit and not use hacks.)
* Fix an unparenthasized macro argument. md5s differ but this is likelyalfred2002-11-091-1/+1
| | | | to order of operations that are actually fixed by the proper parenthasizing.
* Major rework of the iicbus/smbus framework:nsouch2002-03-231-0/+924
- VIA chipset SMBus controllers added - alpm driver updated - Support for dynamic modules added - bktr FreeBSD smbus updated but not tested - cleanup
OpenPOWER on IntegriCloud