Commit Graph

27 Commits

Author SHA1 Message Date
jmcneill 6f25f8641b Add support for Arm N1 SDP PCIe host controller.
The N1 SDP has a few bugs that we need to work around:
 - PCIe root port config space lives in a non-standard location.
 - Access to PCIe config space of devices that do not exist results in
   an sync SError. Firmware creates a "known devices" table at a fixed
   physical address that we use to filter PCI conf access to only known
   devices.

This change splits the Arm ACPI PCI quirks into separate files for each
host controller, and allows per-segment quirks to be applied.

These changes exposed some bugs in the MI ACPI layer related to
multi-segment support. The MI ACPI PCI code was using a shared PCI
chipset tag to access devices, and these accesses can happen before our
PCI host bridge drivers are attached! The global chipset tag is now gone,
and an MD callback can provide a custom tag on a per-segment basis.
2020-01-17 17:06:32 +00:00
msaitoh 7977047465 - Almost all ppbreg.h's definitions are also in pcireg.h. Remove duplicated
definitions from ppbreg.h and move some definitions from ppbreg.h to
  pcireg.h.
- Change fast back-to-back "capable" to "enable" in pci_subr.c.
- Print Primary Discard Timer, Secondary Discard Timer, Discard Timer Status
  and Discard Timer SERR# Enable bit in pci_subr.c.
- PCI_BRIDGE_PREFETCHBASE32_REG and PCI_BRIDGE_PREFETCHLIMIT32_REG are
  "upper" 32bit registers, rename to *UP32_REG to avoid confusion.
- Use macro.
2019-03-01 09:25:59 +00:00
pgoyette d91f98a871 Merge the [pgoyette-compat] branch 2019-01-27 02:08:33 +00:00
jmcneill 16d1d11300 Add a function to report whether the operating system may ignore the boot
configuration of PCI resources for a given bus.
2018-10-21 11:04:26 +00:00
jmcneill 7a0ad3635b Add a function to find a PCI root bridge by segment and bus number. 2018-10-15 10:00:30 +00:00
christos a2cf80f283 introduce acpi_device_present() to replace the previous _STA checks. 2018-05-05 17:16:23 +00:00
christos f45f09e842 Merge conflicts; STA methods and fields are not present anymore. 2018-04-07 15:49:50 +00:00
chs fd34ea77eb remove checks for failure after memory allocation calls that cannot fail:
kmem_alloc() with KM_SLEEP
  kmem_zalloc() with KM_SLEEP
  percpu_alloc()
  pserialize_create()
  psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
2017-06-01 02:45:05 +00:00
christos 6252065cbb sync with new acpica struct shuffling. 2015-04-13 18:32:50 +00:00
jruoho 396210649d acpi_pcidev_find_dev(): take struct acpi_devnode as a parameter. 2010-12-31 10:56:39 +00:00
jruoho aa705fc95d Move the function that finds a device_t for the corresponding ACPI device
node from ACPIVERBOSE to the ACPI PCI code.
2010-12-31 10:23:44 +00:00
gsutre af565a28d4 An _ADR object is not required for PCI root bridges. To solve
this, the structure acpi_pciinfo now tells whether the ACPI
device node is a PCI bridge, a regular PCI device, or both.

Problem reported by jmcneill@, who also suggested the solution.

ok jmcneill@, jruoho@
2010-10-26 22:27:44 +00:00
gsutre a9c0568376 Do not discard ACPI PCI addresses with function number 0xFFFF: the
ACPI specification allows them (ACPI 4.0a, p. 200).

ok jruoho@
2010-09-24 07:48:59 +00:00
gsutre 474664a934 acpi_pcidev_scan: attach PCI information only to working devices.
ok jruoho@
2010-08-09 09:36:42 +00:00
gsutre 110cd99be7 acpi_pcidev_scan: discard invalid PCI addresses. 2010-08-08 16:26:47 +00:00
mrg 0196355634 pci_chipset_tag_t is opaque - don't compare it to NULL, just use it.
shouldn't be a problem because "acpi_softc" variable isn't setup until
the "sc_pc" member is set.

fixes ia64 build.  tested on amd64.  ok jruoho.
2010-06-09 04:20:10 +00:00
jruoho 727f1f57e9 Improve and rearrange comments. 2010-04-26 13:30:31 +00:00
jruoho 84377acda5 Simplify acpi_pcidev_find(): directly return a pointer to the device node. 2010-04-23 15:46:59 +00:00
jruoho bdb6986f24 Some pretty printing for ACPIVERBOSE. 2010-04-22 21:58:08 +00:00
jruoho e0aec4e102 Wrap long lines, add some white space for readability, remove unnecessary
variable assignments, misc KNF. No functional change.
2010-04-22 15:25:46 +00:00
jruoho 1af445da2a Shorten the long lines with two custom macros. 2010-04-22 15:14:24 +00:00
jruoho b3ff23fb49 From Gregoire Sutre: rework the ACPI PCI support. This makes ACPI to
correctly pick PCI segment groups, PCI bus numbers, PCI root bridges,
PCI-to-PCI bridges, and PCI devices, among other things. In short: it is
more robust than the old code or anything in sys/arch/x86/x86/mpacpi.c.

ok cegger@, jmcneill@
2010-04-22 14:50:30 +00:00
jruoho 0c6bf9beea From Gregoire Sutre:
Modify the main ACPI namespace scan by including a parent-child
  relationship for each node. The result is a bi-directional tree.

ok jmcneill@
2010-04-18 14:05:26 +00:00
jruoho 320e1e3fb8 Remove the namespace scopes.
These are neither used nor useful beyond the parser and interpreter.

ok jmcneill@, joerg@
2010-03-09 18:15:21 +00:00
jruoho 5a425210a3 Remove <dev/acpi/acpica.h> from all files. It is included from
<dev/acpi/acpivar.h>. Ditto for <dev/sysmon/sysmonvar.h>, <sys/bus.h>,
<dev/pci/pcivar.h>, and <dev/isa/isavar.h>.

Also nuke a lot of unused and invalid headers. Some of these are audibly
provided by standard headers (namely <sys/param.h> and <sys/device.h>), some
have nothing to do with ACPI devices (e.g. <sys/syslog.h>), and some are
nonexistent local includes (e.g. "mpu_ym.h"). Moreoever, try to group the
includes into their respective blocks.

Tested with GENERIC and ALL (i386). No functional change.
2010-03-05 14:00:16 +00:00
njoly 5d456b9df1 Fix NetBSD keyword expansion. 2009-12-04 10:42:39 +00:00
cegger 82b81a0cd1 Enumerate ACPI PCI devices. Allows to link PCI with ACPI devices.
Patch presented on tech-kern@
http://mail-index.netbsd.org/tech-kern/2009/11/28/msg006552.html

'nice work' Jukka Ruohonen
2009-12-03 21:04:29 +00:00