summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/pci.c
Commit message (Collapse)AuthorAgeFilesLines
* Mask off the bar's value after the probe test write before testingimp2005-06-031-2/+2
| | | | | | | | | against 0 in pci_alloc_map, just like we do in pci_add_map. Also, make sure that we restore the value to the BAR that was there before if the bar is 0. Chances are that it was 0 before the write too and that the restoration is a nop, but better safe than sorry. Notice by: dwhite
* Typo.jhb2005-06-011-1/+1
| | | | Submitted by: njl
* Don't enable I/O or memory mode in a device's command register if the BARjhb2005-05-311-7/+7
| | | | | | | | | | | | | | | we are processing has a base address of zero. Note that this will only change behavior for devices where all the BARs of a given type have a base address of 0 since we will enable the appropriate access when we encounter the first BAR with a base that is not 0. Specifically, this allows certain Toshiba laptops to no longer require 'hw.pci.enable_io_modes=0' to avoid hangs during boot. PR: kern/20040 PR: i386/63776 (possibly) PR: i386/68900 (possibly) PR: i386/74532 (possibly) MFC after: 1 week
* Add a detach for pci bridge and pci bus drivers. This allows one toimp2005-04-291-0/+1
| | | | | | | | theoretically unload pci bridges or pci drivers. It will also allow detach to work if one needed to detach a subtree. This is inspired by looking at the p4 commits from bms to his 5.4 tree, but I didn't look at the final results.
* Call pci_print_verbose() before pci_add_resources() so that the order ofjhb2005-04-141-1/+1
| | | | | | printf's during a verbose boot is more intuitive (the BAR listings and interrupt routing info now comes after the config header dump rather than just before it).
* It isn't a whinable offence to want memory when the bar says ioport.imp2005-04-111-6/+8
| | | | | | | Put that behind bootverbose to make the ata driver less chatty on advanced hardware. Requested by: sos
* Go ahead and try to allocate PCI_BAR(5) for ata devices.imp2005-04-101-0/+1
|
* move the statement about switching power states to just before we do it, sojmg2005-04-011-5/+7
| | | | | we don't print a false statement if the destination powerstate is unsupported...
* add some additional pci classes and sub-classes..jmg2005-03-261-1/+25
| | | | Reviewed by: imp (almost 6 months ago)
* relocate the power state transition statements to thejmg2005-03-231-15/+5
| | | | | | | pci_set_powerstate_method function... Reviewed by: imp MFC after: 1 week
* Use STAILQ in preference to SLIST for the resources. Insert new resourcesimp2005-03-181-1/+1
| | | | | | | | | last in the list rather than first. This makes the resouces print in the 4.x order rather than the 5.x order (eg fdc0 at 0x3f0-0x3f5,0x3f7 is 4.x, but 0x3f7,0x3f0-0x3f5 is 5.x). This also means that the pci code will once again print the resources in BAR ascending order.
* If bus_generic_susped returns an error, devlist is not freed. Free it.imp2005-03-151-1/+3
| | | | Submitted by: Ted Unangst (using the Coverity Prevent analysis tool)
* Expose pci_cfg_safe/restore for subclasses of pci to use.imp2005-02-281-4/+2
|
* kill unused variablesam2005-02-251-2/+0
| | | | Noticed by: Coverity Prevent analysis tool
* Enable interrupt routing as first choice on alpha.ticso2005-02-071-1/+1
| | | | The alpha default handler knows how to trigger a fallback.
* Fix typo.njl2005-01-291-2/+1
|
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-061-1/+1
|
* Fix last second typos that crept in :-(.imp2004-12-311-2/+2
|
* Implement mimimum system software delays, per PCI PM 1.1 spec, asimp2004-12-311-38/+55
| | | | | | suggested by Peter Edwards. This seems to fix my fxp problems and likely will fix his as well. Use DELAY rather than *sleep because we can be called from any context.
* Fix comments to match last commit, and minor reformatting...imp2004-12-081-16/+16
|
* It turns out that a lot of newer systems have 'base peripherals' onimp2004-12-081-1/+2
| | | | | | | | | | the PCI bus. We presently have no drivers for these devices, so they are powered down. This is undesirable behavior since it breaks the system when the base peripherals go away suddenly in the middle of boot. # if we ever get generic drivers for memory and/or base peripherals, then # we can remove the tests here.
* ACPI is not on pc98 either.njl2004-12-031-1/+2
| | | | Informed by: nyan
* Non-x86 platforms cannot use the ACPI includes. This should be fixed butnjl2004-12-031-0/+4
| | | | | | for now, only include the headers for i386, amd64, or ia64. Pointed out by: grehan
* Turn ACPI and PCI devices off or to a lower power state in suspend andnjl2004-12-021-15/+54
| | | | | | | | | | | | | | | | back on again in resume. Override the default of D3 with the value the BIOS specifies in _SxD, if present. Skip serial devices (PNP05xx) since they seem to hang when set to D3 and may require special driver support. Also, skip non-type 0 PCI devices (i.e., bridges) since our we don't yet save/restore their config space and that seems to be necessary. If this gives you trouble with suspend/resume, you can disable the new ACPI and PCI power behavior separately with these tunables & sysctls: debug.acpi.do_powerstate hw.pci.do_powerstate Approved by: imp (pci) Tested by: acpi@ (numerous)
* Make pci_do_powerstate default to 1 now that we've done the release toimp2004-11-101-2/+2
| | | | get more testing. This should help things a little.
* - Change the ddb paging "support" to use a variable (db_lines_per_page) tojhb2004-11-011-1/+1
| | | | | | | | | | | | | | | | | control the number of lines per page rather than a constant. The variable can be examined and changed in ddb as '$lines'. Setting the variable to 0 will effectively turn off paging. - Change db_putchar() to force out pending whitespace before outputting newlines and carriage returns so that one can rub out content on the current line via '\r \r' type strings. - Change the simple pager to rub out the --More-- prompt explicitly when the routine exits. - Add some aliases to the simple pager to make it more compatible with more(1): 'e' and 'j' do a single line. 'd' does half a page, and 'f' does a full page. MFC after: 1 month Inspired by: kris
* Fix a spelling error in a panic string.green2004-10-141-1/+1
|
* Re-route interrupts on arm as well.cognet2004-09-231-1/+2
|
* Disable native ata support for now, too much breaksimp2004-07-021-1/+1
|
* Update the special handling code for ATA devices to allow usage ofsos2004-06-291-54/+42
| | | | | | PCI native addressing. That means that if the HW says that using "real" addresses instead of the hardwired legacy compat ones is allowed, we will use them.
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-1/+1
| | | | Bump __FreeBSD_version accordingly.
* Use PCI_BAR() in preference to PCI_MAPS + x * 4.imp2004-05-241-2/+2
| | | | Submitted by: jhb
* Do not write to those config registers that are unambiguously definedimp2004-05-241-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | in the various pci specifications as readonly. vendor, subvendor, device and subdevice are required to be loaded in hardware by some means that isn't the system BIOS or other system software (although some devices do have ways of accomplishing this). class and subclass are defined to be read-only in section 6.2.1 (v2.2). Apart from the status register, which we weren't touching, these are the only read-only registers I could find in the 2.2 spec. progif is also defined as being read-only in section 6.2.1. However, the PCI IDE programming document specifically states that some of the bits are read/write. Since we may have to restore registers before we have a driver attached, go ahead and restore this one byte when transitioning between D3 and D0. The PCI spec also says that writes to reserved and unimplemented registers must be completed normally. It makes no statements about writes to read-only registers, so be as conservative as possible, while covering the exception to the rule that is documented in a subpart of the standard. Requested by: socttl
* Fix cutNpasto in last commit.imp2004-05-211-1/+1
|
* ifdef writing to registers that the base pci standard says areimp2004-05-211-0/+13
| | | | | read-only on D3->D0 power state transition. Add a define to enable them, but include a comment to contact me if there's a problem.
* Compeletely rewrite the description of hw.pci.do_powerstate to soundimp2004-05-211-2/+2
| | | | better.
* Improve the English somewhat.imp2004-05-211-1/+1
| | | | Prodded by: ru@
* Ooops, forgot to commit the updated definition for hw.pci.do_powerstateimp2004-05-211-2/+1
| | | | when I committed code that changed its meaning.
* MFp4:imp2004-05-211-3/+7
| | | | | | | | | | Split the baby. For idepci devices, now both legacy mode bits need not be set. We can run an idepci in a split mode. However, it only works better than before, not works. It works better in that when one device is legacy and the other isn't and disabled, we now operate correctly. sos submitted a version of this patch.
* Move pci_do_powerstate up a level. Now it just means 'do not turn devicesimp2004-05-211-3/+6
| | | | | off into d3 state when there's no driver for the device'. This should help suspend/resume in the default case.
* MFp4: o save/restore subvendor, subdevice, vendor, device, baseclass,imp2004-05-211-0/+16
| | | | | | | subclass, progif and revid. While these are typically read only fields, they aren't always read-only. progif is writable for ata devices, for example. It does no harm when they are read only, and helps when they aren't.
* make the pci power state and resource code a lot less chatty. Theimp2004-05-211-17/+28
| | | | | | | | chattiness was left in for debugging, but now that nearly all of the problems relating to the changes have been fixed, it is only annoying. It is still available via bootverbose. Prodded by: jhb
* Remove the EBus stopgap of r1.248; a proper fix is in place now.tmm2004-04-281-8/+0
|
* Fix two typos from PR: 65694imp2004-04-261-1/+1
| | | | | | | | | | 1) In pci.c, we need to check the child device's state, not the parent device's state. 2) In acpi_pci.c, we have to run the power state change after the acpi method when the old_state is > new state, not the other way around. Submitted by: Dmitry Remesov PR: 65694
* Add a stopgap for the EBus breakage on sparc64 since the PCI code doesmarius2004-04-231-0/+8
| | | | | | | | | | | resource pre-allocation. The problem is that the BARs of the EBus bridges contain the ranges for the resources for the EBus devices beyond the bridge. So when the EBus code tries to allocate the resource for an EBus device it's already allocated by the PCI code. To be removed again as soon as we have a proper solution in the EBus Code. Reviewed by: tmm Approved by: marcel (mentor)
* ata devices in legacy are special, and we must treat them as such.imp2004-04-211-45/+99
| | | | | | | | | | | | | | While I would have prefered to have a solution that didn't move knowledge of this into the pci layer. However, this is literally the only exception that's listed in the PCI standard to the usual way of decoding BARs. atapci devices in legacy mode now ignore the first 4 bars and hard code the values to the legacy ide values (well, for each of the controllers that are in legacy mode). The 5th bar is handled normally. Remove the zero bar handling. zero bars should be ignored at all other times, and since we handle that specially, we don't need the older workaround.
* Do not pre-allocate resources for BAR's on ATA MASTERDEV's thats onsos2004-04-201-0/+9
| | | | | | | the standard ATA primary and secondary addresses. Reintroduce the size 1 ALTIO space so that we can have both ATA and floppies back working.
* ooops. I disabled pci_enable_io_modes not pci_do_powerstate in the lastimp2004-04-161-4/+4
| | | | | | commit. That was in error. Noticed by: sos
* make the bad bar warning less scary, and toss it behind a bootverbose.imp2004-04-161-2/+3
| | | | It is harmless, but freaking people out.
* Turn off the power stuff for a little while longer. There appears to beimp2004-04-161-2/+2
| | | | something subtle wrong with it.
OpenPOWER on IntegriCloud