aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/x86/pci/early.c
diff options
context:
space:
mode:
authorSinan Kaya <okaya@codeaurora.org>2018-06-04 22:16:09 -0400
committerBjorn Helgaas <helgaas@kernel.org>2018-06-29 20:06:07 -0500
commit11eb0e0e8dea8b97cff972b09cf6fb033b729dff (patch)
tree84ca9d5c2ae77c4bb21984c68469b75c37eb80ad /arch/x86/pci/early.c
parentPCI: Cleanup PCI_REBAR_CTRL_BAR_SHIFT handling (diff)
downloadwireguard-linux-11eb0e0e8dea8b97cff972b09cf6fb033b729dff.tar.xz
wireguard-linux-11eb0e0e8dea8b97cff972b09cf6fb033b729dff.zip
PCI: Make early dump functionality generic
Move early dump functionality into common code so that it is available for all architectures. No need to carry arch-specific reads around as the read hooks are already initialized by the time pci_setup_device() is getting called during scan. Tested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Diffstat (limited to 'arch/x86/pci/early.c')
-rw-r--r--arch/x86/pci/early.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/arch/x86/pci/early.c b/arch/x86/pci/early.c
index e5f753cbb1c3..f5fc953e5848 100644
--- a/arch/x86/pci/early.c
+++ b/arch/x86/pci/early.c
@@ -57,47 +57,3 @@ int early_pci_allowed(void)
PCI_PROBE_CONF1;
}
-void early_dump_pci_device(u8 bus, u8 slot, u8 func)
-{
- u32 value[256 / 4];
- int i;
-
- pr_info("pci 0000:%02x:%02x.%d config space:\n", bus, slot, func);
-
- for (i = 0; i < 256; i += 4)
- value[i / 4] = read_pci_config(bus, slot, func, i);
-
- print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 1, value, 256, false);
-}
-
-void early_dump_pci_devices(void)
-{
- unsigned bus, slot, func;
-
- if (!early_pci_allowed())
- return;
-
- for (bus = 0; bus < 256; bus++) {
- for (slot = 0; slot < 32; slot++) {
- for (func = 0; func < 8; func++) {
- u32 class;
- u8 type;
-
- class = read_pci_config(bus, slot, func,
- PCI_CLASS_REVISION);
- if (class == 0xffffffff)
- continue;
-
- early_dump_pci_device(bus, slot, func);
-
- if (func == 0) {
- type = read_pci_config_byte(bus, slot,
- func,
- PCI_HEADER_TYPE);
- if (!(type & 0x80))
- break;
- }
- }
- }
- }
-}