]> xenbits.xensource.com Git - people/julieng/linux-arm.git/commitdiff
Skeleton for registering hostbridge
authorJulien Grall <julien.grall@arm.com>
Wed, 7 Jun 2017 11:47:54 +0000 (12:47 +0100)
committerJulien Grall <julien.grall@linaro.org>
Tue, 14 Nov 2017 17:35:02 +0000 (17:35 +0000)
arch/arm/xen/Makefile
arch/arm/xen/pci.c [new file with mode: 0644]
arch/arm64/include/asm/xen/xen-ops.h
arch/arm64/kernel/pci.c
arch/arm64/xen/Makefile

index 227952103b0bbff28a21d74ce6b10b975233e6c1..7ff125e0101293762c54396b01d413e96e3ace3b 100644 (file)
@@ -1,2 +1,3 @@
 obj-y          := enlighten.o hypercall.o grant-table.o p2m.o mm.o
 obj-$(CONFIG_XEN_EFI) += efi.o
+obj-$(CONFIG_PCI)     += pci.o
diff --git a/arch/arm/xen/pci.c b/arch/arm/xen/pci.c
new file mode 100644 (file)
index 0000000..933b6b3
--- /dev/null
@@ -0,0 +1,14 @@
+#include <asm/xen/xen-ops.h>
+#include <linux/printk.h>
+
+void xen_pci_register_host_bridge(struct pci_host_bridge *bridge)
+{
+//     struct physdev_pci_mmcfg_reserved r;
+       struct pci_bus *bus = bridge->bus;
+
+       printk("============== Register Hostbridge ================\n");
+
+       printk("seg %u\n", pci_domain_nr(bus));
+
+       while (1);
+}
index e6e784051932b9f1a5e3dc3125876fe9d972d4a1..0a601bd7f740cad147db6d2ff53ef09d40c8a954 100644 (file)
@@ -2,6 +2,12 @@
 #ifndef _ASM_XEN_OPS_H
 #define _ASM_XEN_OPS_H
 
+#include <linux/pci.h>
+#include <xen/xen-ops.h>
+#include <asm/xen/xen-ops.h>
+
 void xen_efi_runtime_setup(void);
 
+void xen_pci_register_host_bridge(struct pci_host_bridge *bridge);
+
 #endif /* _ASM_XEN_OPS_H */
index 0e2ea1c785427849b68435eb1c188e8b7d65eb64..179494dc4ce8d1709a1d7f948eb2f4c0eb10c786 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/pci-acpi.h>
 #include <linux/pci-ecam.h>
 #include <linux/slab.h>
+#include <asm/xen/xen-ops.h>
 
 #ifdef CONFIG_ACPI
 /*
@@ -206,11 +207,20 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
 void pcibios_add_bus(struct pci_bus *bus)
 {
        acpi_pci_add_bus(bus);
+
+       /*
+        * XXX This function is also called for child bus. Maybe we should
+        * hooked up in another function or check if we are registering
+        * the root parent
+        */
+       if (xen_initial_domain() && !pci_is_root_bus(bus))
+               xen_pci_register_host_bridge(pci_find_host_bridge(bus));
 }
 
 void pcibios_remove_bus(struct pci_bus *bus)
 {
        acpi_pci_remove_bus(bus);
+       /* XXX Implement remove bus */
 }
 
 #endif
index 8ff8aa9c62285c130af721aeb4299709ef1a33bb..c93c5f8e61b7e9f04fc478aac6d8d82eeb578a74 100644 (file)
@@ -1,3 +1,4 @@
 xen-arm-y      += $(addprefix ../../arm/xen/, enlighten.o grant-table.o p2m.o mm.o)
 obj-y          := xen-arm.o hypercall.o
 obj-$(CONFIG_XEN_EFI) += $(addprefix ../../arm/xen/, efi.o)
+obj-$(CONFIG_PCI)     += $(addprefix ../../arm/xen/, pci.o)