Cc: Thomas Huth <thuth@xxxxxxxxxx> Cc: Andrew Jones <drjones@xxxxxxxxxx> Signed-off-by: Alexander Gordeev <agordeev@xxxxxxxxxx> --- arm/Makefile.common | 5 ++++- arm/pci-test.c | 21 +++++++++++++++++++++ lib/arm/asm/pci.h | 4 ++++ lib/arm64/asm/pci.h | 1 + 4 files changed, 30 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..315a4e5e986c --- /dev/null +++ b/arm/pci-test.c @@ -0,0 +1,21 @@ +/* + * 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()) { + printf("PCI bus probing failed\n"); + abort(); + } + + 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..c6467496614b --- /dev/null +++ b/lib/arm/asm/pci.h @@ -0,0 +1,4 @@ +#ifndef _ASMARM_PCI_H_ +#define _ASMARM_PCI_H_ +#include "asm-generic/pci-host-bridge.h" +#endif 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