]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xtensa: drop dead PCI support code
authorMax Filippov <jcmvbkbc@gmail.com>
Mon, 15 Oct 2018 19:33:51 +0000 (12:33 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Mon, 17 Jun 2019 06:31:28 +0000 (23:31 -0700)
xtensa-specific PCI initialization code has significantly bitrotted over
time because there's no platform that use it. Get rid of remaining
non-functioning initialization and remove platform_pcibios_* interface.
A new platform that would use PCI on xtensa will configure PCI
controller using device tree.

Drop variables pci_ctrl_head, pci_bus_count and functions pcibios_init,
pci_controller_apertures, platform_pcibios_init and
platform_pcibios_fixup.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/include/asm/platform.h
arch/xtensa/kernel/pci.c
arch/xtensa/kernel/platform.c
arch/xtensa/kernel/setup.c

index 560483356a06a2fcf9ad619bfd6c83602791dc72..913826dfa8383df6eb7bc34c73bcfc7080304c56 100644 (file)
@@ -54,16 +54,6 @@ extern void platform_idle (void);
  */
 extern void platform_heartbeat (void);
 
-/*
- * platform_pcibios_init is called to allow the platform to setup the pci bus.
- */
-extern void platform_pcibios_init (void);
-
-/*
- * platform_pcibios_fixup allows to modify the PCI configuration.
- */
-extern int platform_pcibios_fixup (void);
-
 /*
  * platform_calibrate_ccount calibrates cpu clock freq (CONFIG_XTENSA_CALIBRATE)
  */
index e0235e34e1babd41b632317294613be213c5ad1e..14effa40eb7d587561ab1951bebb43ca4b60e26b 100644 (file)
 #include <asm/pci-bridge.h>
 #include <asm/platform.h>
 
-/* PCI Controller */
-
-
-/*
- * pcibios_alloc_controller
- * pcibios_enable_device
- * pcibios_fixups
- * pcibios_align_resource
- * pcibios_fixup_bus
- * pci_bus_add_device
- */
-
-static struct pci_controller *pci_ctrl_head;
-
-static int pci_bus_count;
-
 /*
  * We need to avoid collisions with `mirrored' VGA ports
  * and other strange ISA hardware, so we always want the
@@ -74,81 +58,6 @@ pcibios_align_resource(void *data, const struct resource *res,
        return start;
 }
 
-static void __init pci_controller_apertures(struct pci_controller *pci_ctrl,
-                                           struct list_head *resources)
-{
-       struct resource *res;
-       unsigned long io_offset;
-       int i;
-
-       io_offset = (unsigned long)pci_ctrl->io_space.base;
-       res = &pci_ctrl->io_resource;
-       if (!res->flags) {
-               if (io_offset)
-                       pr_err("I/O resource not set for host bridge %d\n",
-                              pci_ctrl->index);
-               res->start = 0;
-               res->end = IO_SPACE_LIMIT;
-               res->flags = IORESOURCE_IO;
-       }
-       res->start += io_offset;
-       res->end += io_offset;
-       pci_add_resource_offset(resources, res, io_offset);
-
-       for (i = 0; i < 3; i++) {
-               res = &pci_ctrl->mem_resources[i];
-               if (!res->flags) {
-                       if (i > 0)
-                               continue;
-                       pr_err("Memory resource not set for host bridge %d\n",
-                              pci_ctrl->index);
-                       res->start = 0;
-                       res->end = ~0U;
-                       res->flags = IORESOURCE_MEM;
-               }
-               pci_add_resource(resources, res);
-       }
-}
-
-static int __init pcibios_init(void)
-{
-       struct pci_controller *pci_ctrl;
-       struct list_head resources;
-       struct pci_bus *bus;
-       int next_busno = 0, ret;
-
-       pr_info("PCI: Probing PCI hardware\n");
-
-       /* Scan all of the recorded PCI controllers.  */
-       for (pci_ctrl = pci_ctrl_head; pci_ctrl; pci_ctrl = pci_ctrl->next) {
-               pci_ctrl->last_busno = 0xff;
-               INIT_LIST_HEAD(&resources);
-               pci_controller_apertures(pci_ctrl, &resources);
-               bus = pci_scan_root_bus(NULL, pci_ctrl->first_busno,
-                                       pci_ctrl->ops, pci_ctrl, &resources);
-               if (!bus)
-                       continue;
-
-               pci_ctrl->bus = bus;
-               pci_ctrl->last_busno = bus->busn_res.end;
-               if (next_busno <= pci_ctrl->last_busno)
-                       next_busno = pci_ctrl->last_busno+1;
-       }
-       pci_bus_count = next_busno;
-       ret = platform_pcibios_fixup();
-       if (ret)
-               return ret;
-
-       for (pci_ctrl = pci_ctrl_head; pci_ctrl; pci_ctrl = pci_ctrl->next) {
-               if (pci_ctrl->bus)
-                       pci_bus_add_devices(pci_ctrl->bus);
-       }
-
-       return 0;
-}
-
-subsys_initcall(pcibios_init);
-
 void pcibios_fixup_bus(struct pci_bus *bus)
 {
        if (bus->parent) {
index 1cf008284dd2925599df108f776ccdfb2e10e222..a95ba05b0abe36724e1717432483c66e2f487966 100644 (file)
@@ -34,8 +34,6 @@ _F(void, halt, (void), { while(1); });
 _F(void, power_off, (void), { while(1); });
 _F(void, idle, (void), { __asm__ __volatile__ ("waiti 0" ::: "memory"); });
 _F(void, heartbeat, (void), { });
-_F(int,  pcibios_fixup, (void), { return 0; });
-_F(void, pcibios_init, (void), { });
 
 #ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
 _F(void, calibrate_ccount, (void),
index 176cb46bcf12cf25bb7ddf129cc99a79a587b221..5cb8a62e091c77619081973fe488b04a79437dd7 100644 (file)
@@ -405,10 +405,6 @@ void __init setup_arch(char **cmdline_p)
        conswitchp = &dummy_con;
 # endif
 #endif
-
-#ifdef CONFIG_PCI
-       platform_pcibios_init();
-#endif
 }
 
 static DEFINE_PER_CPU(struct cpu, cpu_data);