diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-08-19 08:23:48 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-08-19 08:23:48 +0000 |
commit | 63e6caa26564e0dc0de5c358a1401413ea2b7e8c (patch) | |
tree | a405a2c32a4101e6ed60be302e4d8a4c085934fa /sys/arch/amd64 | |
parent | 189364187b38c0928ee75abd2ed96ab3637938f6 (diff) |
Add support for multiple PCI segments. Only really implemented for arm64
for now as amd64/i386 firmware still caters for legacy OSes that only
support a single PCI segment.
ok patrick@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/amd64/acpi_machdep.c | 3 | ||||
-rw-r--r-- | sys/arch/amd64/include/pci_machdep.h | 5 | ||||
-rw-r--r-- | sys/arch/amd64/pci/pci_machdep.c | 22 |
3 files changed, 19 insertions, 11 deletions
diff --git a/sys/arch/amd64/amd64/acpi_machdep.c b/sys/arch/amd64/amd64/acpi_machdep.c index 9c820b718df..f136f0743d4 100644 --- a/sys/arch/amd64/amd64/acpi_machdep.c +++ b/sys/arch/amd64/amd64/acpi_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi_machdep.c,v 1.84 2018/07/04 20:46:21 kettenis Exp $ */ +/* $OpenBSD: acpi_machdep.c,v 1.85 2018/08/19 08:23:47 kettenis Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * @@ -97,7 +97,6 @@ acpi_attach(struct device *parent, struct device *self, void *aux) sc->sc_iot = ba->ba_iot; sc->sc_memt = ba->ba_memt; sc->sc_dmat = &pci_bus_dma_tag; - sc->sc_pc = NULL; /* Legacy 0xcf8/0xcfc access mechanism */ acpi_attach_common(sc, ba->ba_acpipbase); } diff --git a/sys/arch/amd64/include/pci_machdep.h b/sys/arch/amd64/include/pci_machdep.h index a919dfd77e2..8a456f72b09 100644 --- a/sys/arch/amd64/include/pci_machdep.h +++ b/sys/arch/amd64/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.26 2018/07/04 20:46:22 kettenis Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.27 2018/08/19 08:23:47 kettenis Exp $ */ /* $NetBSD: pci_machdep.h,v 1.1 2003/02/26 21:26:11 fvdl Exp $ */ /* @@ -95,7 +95,8 @@ void pci_dev_postattach(struct device *, struct pci_attach_args *); pcireg_t pci_min_powerstate(pci_chipset_tag_t, pcitag_t); void pci_set_powerstate_md(pci_chipset_tag_t, pcitag_t, int, int); -pci_chipset_tag_t pci_mcfg_init(bus_space_tag_t, bus_addr_t, int, int); +void pci_mcfg_init(bus_space_tag_t, bus_addr_t, int, int, int); +pci_chipset_tag_t pci_lookup_segment(int); /* * ALL OF THE FOLLOWING ARE MACHINE-DEPENDENT, AND SHOULD NOT BE USED diff --git a/sys/arch/amd64/pci/pci_machdep.c b/sys/arch/amd64/pci/pci_machdep.c index 5e05c750a0c..4e58376aff5 100644 --- a/sys/arch/amd64/pci/pci_machdep.c +++ b/sys/arch/amd64/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.c,v 1.68 2018/07/04 20:46:22 kettenis Exp $ */ +/* $OpenBSD: pci_machdep.c,v 1.69 2018/08/19 08:23:47 kettenis Exp $ */ /* $NetBSD: pci_machdep.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */ /*- @@ -140,14 +140,22 @@ struct bus_dma_tag pci_bus_dma_tag = { _bus_dmamem_mmap, }; -pci_chipset_tag_t -pci_mcfg_init(bus_space_tag_t iot, bus_addr_t addr, int min_bus, int max_bus) +void +pci_mcfg_init(bus_space_tag_t iot, bus_addr_t addr, int segment, + int min_bus, int max_bus) { - pci_mcfgt = iot; - pci_mcfg_addr = addr; - pci_mcfg_min_bus = min_bus; - pci_mcfg_max_bus = max_bus; + if (segment == 0) { + pci_mcfgt = iot; + pci_mcfg_addr = addr; + pci_mcfg_min_bus = min_bus; + pci_mcfg_max_bus = max_bus; + } +} +pci_chipset_tag_t +pci_lookup_segment(int segment) +{ + KASSERT(segment == 0); return NULL; } |