Cc: Thomas Huth <thuth@xxxxxxxxxx> Cc: Andrew Jones <drjones@xxxxxxxxxx> Reviewed-by: Andrew Jones <drjones@xxxxxxxxxx> Signed-off-by: Alexander Gordeev <agordeev@xxxxxxxxxx> --- arm/Makefile.common | 5 ++++- arm/pci-test.c | 19 +++++++++++++++++++ lib/arm/asm/pci.h | 1 + lib/arm64/asm/pci.h | 1 + 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 arm/pci-test.c create mode 100644 lib/arm/asm/pci.h create mode 100644 lib/arm64/asm/pci.h diff --git a/arm/Makefile.common b/arm/Makefile.common index ccb554d9251a..97179bbea4e7 100644 --- a/arm/Makefile.common +++ b/arm/Makefile.common @@ -11,7 +11,8 @@ endif tests-common = \ $(TEST_DIR)/selftest.flat \ - $(TEST_DIR)/spinlock-test.flat + $(TEST_DIR)/spinlock-test.flat \ + $(TEST_DIR)/pci-test.flat all: test_cases @@ -33,6 +34,8 @@ include scripts/asm-offsets.mak cflatobjs += lib/util.o cflatobjs += lib/alloc.o cflatobjs += lib/devicetree.o +cflatobjs += lib/pci.o +cflatobjs += lib/pci-host-generic.o cflatobjs += lib/virtio.o cflatobjs += lib/virtio-mmio.o cflatobjs += lib/chr-testdev.o diff --git a/arm/pci-test.c b/arm/pci-test.c new file mode 100644 index 000000000000..daebdafceb60 --- /dev/null +++ b/arm/pci-test.c @@ -0,0 +1,19 @@ +/* + * PCI bus operation test + * + * Copyright (C) 2016, Red Hat Inc, Alexander Gordeev <agordeev@xxxxxxxxxx> + * + * This work is licensed under the terms of the GNU LGPL, version 2. + */ +#include <libcflat.h> +#include <pci.h> + +int main(void) +{ + if (!pci_probe()) + report_abort("PCI bus probing failed\n"); + + pci_print(); + + return report_summary(); +} diff --git a/lib/arm/asm/pci.h b/lib/arm/asm/pci.h new file mode 100644 index 000000000000..01ecafe2b6d8 --- /dev/null +++ b/lib/arm/asm/pci.h @@ -0,0 +1 @@ +#include "asm-generic/pci-host-bridge.h" diff --git a/lib/arm64/asm/pci.h b/lib/arm64/asm/pci.h new file mode 100644 index 000000000000..f70ef560e2ab --- /dev/null +++ b/lib/arm64/asm/pci.h @@ -0,0 +1 @@ +#include "../../arm/asm/pci.h" -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html