From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b6-smtp.messagingengine.com (fhigh-b6-smtp.messagingengine.com [202.12.124.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 225AB560AA8; Wed, 9 Sep 2026 12:42:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788957770; cv=none; b=El5BHwY77cATuBbNopRzyVyTHEgZNwRcvRXVIe18l1gJzI8MezbHb98Q1zNlZLc3Tg04yNXdTbOivd7c4rbKGHTaZz21Jhq9tbnDWFQbHG7z6y/zYZqo1UXaWZMib+ZmHFu6sjxXRbDHDeh4EBObm5kPLM7OhEpB8N5fpN9ynD4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788957770; c=relaxed/simple; bh=Hy93wUEU3aP177anqQrBTbLKnzHz3VWyW8/0RPFKYjE=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=DZWhQVgX/F9gpVxoih9Coj0eiQ2tbLP/xPZ5tgudln/cBBDAqYEe6w9Cvqs7XIN/WIWgKYGvw0QYw2muEuQDIfrR5gcIc7HuVYUyOkDlK4HS/FoYqAQLKZRjPULCA16GsYYIi9mFYQtyC0HH7ij0NsB6M5v7uRyWPcZiUf1KWe0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=VQzWB6ZL; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=GTcZpPue; arc=none smtp.client-ip=202.12.124.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="VQzWB6ZL"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="GTcZpPue" Received: from ams-compute-02.internal (ams-compute-02.internal [10.64.2.62]) by mailfhigh.stl.internal (Postfix) with ESMTP id 2485E7A00C3; Wed, 9 Sep 2026 08:42:41 -0400 (EDT) Received: from ams-imap-03 ([10.64.2.23]) by ams-compute-02.internal (MEProxy); Wed, 09 Sep 2026 08:42:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1788957760; x=1789044160; bh=uJyh/ViHzUPAK9T00aADTIqyIetgXDLGWC2z8GN+6xA=; b= VQzWB6ZLpky/QfkKyAJMc5eI+YTse05ypT1OeUbxW1WDt71uVkvsByBh20nMp43e LPfvN/es7kb+GhuX75I1d9ICQbCTydKf9tN5ZYIZIyoWC47ekLsJq+QVNSy7Q4W5 Ppkd1TaGnsgswxK5YRctlcIaKsS/NGYtZ4nhZtppgyLGV0Uy6ajzTL/EZjORzF+j d7mSh+5bOmvf5I1B/E9CxhiyeV8XtXPqgTDHZAWkdiERbo/mPfbwaIckj0jLk+Qg +HUrY03CrHBMOItPdO8JpPJpUzzkx/8k/SGbnp4c+8La/uDggTqcdAruLhkhXLrH Yjh4mKbrW2fn5Y8xNTjrXQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1788957760; x= 1789044160; bh=uJyh/ViHzUPAK9T00aADTIqyIetgXDLGWC2z8GN+6xA=; b=G TcZpPueYMIKWtRBfMusIATG89Y+TDQh1SBLr1NIDou2lbM3WHzCJCfYLNuP8BrVJ IU08S79I1ehJayj+aPH3FPsLhvc567guZNKAhLnXF2UUTkXGeqoHaYn/SZpjI+0L qP5tRTJ3Nu/w5k1LaLSm31Tl6yillgbZ6NpaUCNJiVIZQEzOA6GC6gxdxi3BMYer CiVaKQtEnY4o868XI4q64faWUqUmVh/Iz9vfi8hLyJ2uQmJnyoLiGjTrE63Fdmhh S+GtfUS35CzpLQPC9aroGj2P7CAFIGVOglbTqx1E+SBD6b08XhheoWAaTJ2ThO4Y 0D4RULrKUGVQb9yDD755Q== X-ME-Sender: X-ME-Proxy-Cause: dmFkZTFPd8V8B4P+DsqDyRah16w1bAIOCumRPLl+mFEFGvBgBFqsOeDNrhmNC28xIXSsqD 0cJ0INSSFjL7rfIF6ndLm42K6CSQCuO75voP9ACWoKzdnt+qeTIEF26UEDkAIBYdQ1o6Ji A4mkwM3er6z9nKXbdnq1orVJXtpSz3T8IN119ZGT7x5rTmxUsICxkTcB/e7G+k7akWqi+g 6DuczB9f4/rsGkN1xUUbBxb/fJP/qEeMiWxPQznCAQgN99F83VmIseswEc1mfLLpvyhXYn a48gXfVQVnDAogM//EYuyJVzBFbi+7+W5ptDQjq9AHNfADXg7Q9H1Wl39tPqOHoA2yGqpm bDESP84LF/45yy5hsBEUoXmG3UQ4RDnqtA3PqbhuKhOcljBURBLT2pl5C81goIXKXgNsQP 7R5CXoUUxnFb/nQzwDSLzTzJVOSFkif/GOgRvTbpErKNBi9b1fLgIXT48+S3OTssdn+MS5 DH6yy/1zAZC6LToSLAkAndYcAX/nfP0JnJCrkIVag5umNVuGpDcTcrD/48V/dD+pq3tvJW GBhXowS4/HEdAhkN76MaKdBcNPBADRq3KA4i3UM77W9/oTIuVZQv/g3A1RLppNe37We33d iewnoGZEiSHs4SvLeBbyTsD6J42t8BQTNG1icOfZglbTyod1Tjk70dNyyzSQ X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.ams.internal (Postfix, from userid 501) id 8374332A007B; Wed, 9 Sep 2026 08:42:35 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Wed, 09 Sep 2026 14:42:15 +0200 From: "Arnd Bergmann" To: "Arnd Bergmann" , sashiko-reviews@lists.linux.dev Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, "Damien Le Moal" , linux-rtc@vger.kernel.org, "Neil Armstrong" , "Vinod Koul" , "Alexandre Belloni" , "Vladimir Oltean" , "Frank Li" , linux-pci@vger.kernel.org, "Rob Herring" , "Conor Dooley" , imx@lists.linux.dev, "Niklas Cassel" , linux-ide@vger.kernel.org, linux-watchdog@vger.kernel.org Message-Id: <8ead0091-3b0e-487a-b0c3-16e7ba624710@app.fastmail.com> In-Reply-To: <71266564-7be5-4621-ab03-29cf9ec49287@app.fastmail.com> References: <20260908152808.3928630-1-arnd@kernel.org> <20260908152808.3928630-6-arnd@kernel.org> <20260908161125.E4A331F00A3A@smtp.kernel.org> <71266564-7be5-4621-ab03-29cf9ec49287@app.fastmail.com> Subject: [PATCH 05.2/13] ARM: orion5x: fold plat-orion/pcie.c and hw_pci into pci.c Content-Type: text/plain Content-Transfer-Encoding: 7bit orion5x is the only user of arch/arm/plat-orion/pcie.c and of asm/mach/pci.h. Fold it all into the one file referencing it, removing both the infrastructure to deal with arch/arm/plat-* directories and pci_sys_data from everywhere else. Aside from making all the newly local functions 'static', this leaves the code unchanged. Obviously a number of additional cleanups are possible as follow-ups, which would allow turning it into two regular pci_host_bridge drivers. I stopped here in order to reduce the risk for regressions, while still cleaning up the common code as much as possible. Signed-off-by: Arnd Bergmann --- Based on the earlier suggestions I have now added this patch to the cleanup series. Documentation/arch/arm/marvell.rst | 2 - MAINTAINERS | 1 - arch/arm/Kconfig | 4 +- arch/arm/Makefile | 2 - arch/arm/include/asm/mach/pci.h | 72 ---------- arch/arm/include/asm/pci.h | 1 - arch/arm/kernel/bios32.c | 197 -------------------------- arch/arm/mach-mvebu/Makefile | 2 - arch/arm/mach-orion5x/Makefile | 2 - arch/arm/mach-orion5x/board-d2net.c | 1 - arch/arm/mach-orion5x/board-mss2.c | 1 - arch/arm/mach-orion5x/board-rd88f5182.c | 1 - arch/arm/mach-orion5x/common.h | 19 +++ arch/arm/mach-orion5x/pci.c | 428 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- arch/arm/mm/ioremap.c | 1 - arch/arm/mm/mmu.c | 1 - arch/arm/plat-orion/Makefile | 7 - arch/arm/plat-orion/include/plat/pcie.h | 34 ----- arch/arm/plat-orion/pcie.c | 287 ------------------------------------- drivers/pci/controller/pci-mvebu.c | 5 - 20 files changed, 446 insertions(+), 622 deletions(-) diff --git a/Documentation/arch/arm/marvell.rst b/Documentation/arch/arm/marvell.rst index eb450095161e..28f212848668 100644 --- a/Documentation/arch/arm/marvell.rst +++ b/Documentation/arch/arm/marvell.rst @@ -32,8 +32,6 @@ Orion family Feroceon 88fr331 (88f51xx) or 88fr531-vd (88f52xx) ARMv5 compatible Linux kernel mach directory: arch/arm/mach-orion5x - Linux kernel plat directory: - arch/arm/plat-orion Kirkwood family --------------- diff --git a/MAINTAINERS b/MAINTAINERS index 5dde144e37c8..1ed42d8f6d56 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3081,7 +3081,6 @@ F: Documentation/devicetree/bindings/soc/dove/ F: arch/arm/boot/dts/marvell/dove* F: arch/arm/boot/dts/marvell/orion5x* F: arch/arm/mach-orion5x/ -F: arch/arm/plat-orion/ F: drivers/bus/mvebu-mbus.c F: drivers/soc/dove/ diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index da29afce309f..f551f51b1ad1 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -339,9 +339,7 @@ config ARCH_MULTIPLATFORM source "arch/arm/Kconfig.platforms" # -# This is sorted alphabetically by mach-* pathname. However, plat-* -# Kconfigs may be included either alphabetically (according to the -# plat- suffix) or along side the corresponding mach-* source. +# This is sorted alphabetically by mach-* pathname. # source "arch/arm/mach-actions/Kconfig" diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 1b990994f46d..c1437c16b115 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -229,8 +229,6 @@ core-y += $(patsubst %,arch/arm/mach-%/,$(machine-y)) # For cleaning core- += $(patsubst %,arch/arm/mach-%/,$(machine-)) -core-$(CONFIG_PLAT_ORION) += arch/arm/plat-orion/ - libs-y := arch/arm/lib/ $(libs-y) # Default target when executing plain make diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h deleted file mode 100644 index 78f2318ed000..000000000000 --- a/arch/arm/include/asm/mach/pci.h +++ /dev/null @@ -1,72 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * arch/arm/include/asm/mach/pci.h - * - * Copyright (C) 2000 Russell King - */ - -#ifndef __ASM_MACH_PCI_H -#define __ASM_MACH_PCI_H - -#include - -struct pci_sys_data; -struct pci_ops; -struct pci_bus; -struct pci_host_bridge; -struct device; - -struct hw_pci { - struct pci_ops *ops; - int nr_controllers; - void **private_data; - int (*setup)(int nr, struct pci_sys_data *); - int (*scan)(int nr, struct pci_host_bridge *); - void (*preinit)(void); - void (*postinit)(void); - u8 (*swizzle)(struct pci_dev *dev, u8 *pin); - int (*map_irq)(const struct pci_dev *dev, u8 slot, u8 pin); -}; - -/* - * Per-controller structure - */ -struct pci_sys_data { - struct list_head node; - int busnr; /* primary bus number */ - u64 mem_offset; /* bus->cpu memory mapping offset */ - unsigned long io_offset; /* bus->cpu IO mapping offset */ - struct pci_bus *bus; /* PCI bus */ - struct list_head resources; /* root bus resources (apertures) */ - struct resource io_res; - char io_res_name[12]; - /* Bridge swizzling */ - u8 (*swizzle)(struct pci_dev *, u8 *); - /* IRQ mapping */ - int (*map_irq)(const struct pci_dev *, u8, u8); - void *private_data; /* platform controller private data */ -}; - -/* - * Call this with your hw_pci struct to initialise the PCI system. - */ -void pci_common_init_dev(struct device *, struct hw_pci *); - -/* - * Compatibility wrapper for older platforms that do not care about - * passing the parent device. - */ -static inline void pci_common_init(struct hw_pci *hw) -{ - pci_common_init_dev(NULL, hw); -} - -/* - * PCI controllers - */ -extern struct pci_ops iop3xx_ops; -extern int iop3xx_pci_setup(int nr, struct pci_sys_data *); -extern void iop3xx_pci_preinit(void); -extern void iop3xx_pci_preinit_cond(void); - -#endif /* __ASM_MACH_PCI_H */ diff --git a/arch/arm/include/asm/pci.h b/arch/arm/include/asm/pci.h index 50ddc7ce1db8..650becf39e58 100644 --- a/arch/arm/include/asm/pci.h +++ b/arch/arm/include/asm/pci.h @@ -3,7 +3,6 @@ #define ASMARM_PCI_H #ifdef __KERNEL__ -#include /* for pci_sys_data */ extern unsigned long pcibios_min_io; #define PCIBIOS_MIN_IO pcibios_min_io diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index 3367ef0f6a37..a6c7f271e31a 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c @@ -16,9 +16,6 @@ #include #include -#include - -static int debug_pci; /* * We don't use this to fix the device, but initialisation of it. @@ -298,191 +295,6 @@ void pcibios_fixup_bus(struct pci_bus *bus) } EXPORT_SYMBOL(pcibios_fixup_bus); -/* - * Swizzle the device pin each time we cross a bridge. If a platform does - * not provide a swizzle function, we perform the standard PCI swizzling. - * - * The default swizzling walks up the bus tree one level at a time, applying - * the standard swizzle function at each step, stopping when it finds the PCI - * root bus. This will return the slot number of the bridge device on the - * root bus and the interrupt pin on that device which should correspond - * with the downstream device interrupt. - * - * Platforms may override this, in which case the slot and pin returned - * depend entirely on the platform code. However, please note that the - * PCI standard swizzle is implemented on plug-in cards and Cardbus based - * PCI extenders, so it can not be ignored. - */ -static u8 pcibios_swizzle(struct pci_dev *dev, u8 *pin) -{ - struct pci_sys_data *sys = dev->sysdata; - int slot, oldpin = *pin; - - if (sys->swizzle) - slot = sys->swizzle(dev, pin); - else - slot = pci_common_swizzle(dev, pin); - - if (debug_pci) - printk("PCI: %s swizzling pin %d => pin %d slot %d\n", - pci_name(dev), oldpin, *pin, slot); - - return slot; -} - -/* - * Map a slot/pin to an IRQ. - */ -static int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) -{ - struct pci_sys_data *sys = dev->sysdata; - int irq = -1; - - if (sys->map_irq) - irq = sys->map_irq(dev, slot, pin); - - if (debug_pci) - printk("PCI: %s mapping slot %d pin %d => irq %d\n", - pci_name(dev), slot, pin, irq); - - return irq; -} - -static int pcibios_init_resource(int busnr, struct pci_sys_data *sys) -{ - int ret; - struct resource_entry *window; - - if (list_empty(&sys->resources)) { - pci_add_resource_offset(&sys->resources, - &iomem_resource, sys->mem_offset); - } - - resource_list_for_each_entry(window, &sys->resources) - if (resource_type(window->res) == IORESOURCE_IO) - return 0; - - sys->io_res.start = (busnr * SZ_64K) ? : pcibios_min_io; - sys->io_res.end = (busnr + 1) * SZ_64K - 1; - sys->io_res.flags = IORESOURCE_IO; - sys->io_res.name = sys->io_res_name; - sprintf(sys->io_res_name, "PCI%d I/O", busnr); - - ret = request_resource(&ioport_resource, &sys->io_res); - if (ret) { - pr_err("PCI: unable to allocate I/O port region (%d)\n", ret); - return ret; - } - pci_add_resource_offset(&sys->resources, &sys->io_res, - sys->io_offset); - - return 0; -} - -static void pcibios_init_hw(struct device *parent, struct hw_pci *hw, - struct list_head *head) -{ - struct pci_sys_data *sys = NULL; - int ret; - int nr, busnr; - - for (nr = busnr = 0; nr < hw->nr_controllers; nr++) { - struct pci_host_bridge *bridge; - - bridge = pci_alloc_host_bridge(sizeof(struct pci_sys_data)); - if (WARN(!bridge, "PCI: unable to allocate bridge!")) - break; - - sys = pci_host_bridge_priv(bridge); - - sys->busnr = busnr; - sys->swizzle = hw->swizzle; - sys->map_irq = hw->map_irq; - INIT_LIST_HEAD(&sys->resources); - - if (hw->private_data) - sys->private_data = hw->private_data[nr]; - - ret = hw->setup(nr, sys); - - if (ret > 0) { - - ret = pcibios_init_resource(nr, sys); - if (ret) { - pci_free_host_bridge(bridge); - break; - } - - bridge->map_irq = pcibios_map_irq; - bridge->swizzle_irq = pcibios_swizzle; - - if (hw->scan) - ret = hw->scan(nr, bridge); - else { - list_splice_init(&sys->resources, - &bridge->windows); - bridge->dev.parent = parent; - bridge->sysdata = sys; - bridge->busnr = sys->busnr; - bridge->ops = hw->ops; - - ret = pci_scan_root_bus_bridge(bridge); - } - - if (WARN(ret < 0, "PCI: unable to scan bus!")) { - pci_free_host_bridge(bridge); - break; - } - - sys->bus = bridge->bus; - - busnr = sys->bus->busn_res.end + 1; - - list_add(&sys->node, head); - } else { - pci_free_host_bridge(bridge); - if (ret < 0) - break; - } - } -} - -void pci_common_init_dev(struct device *parent, struct hw_pci *hw) -{ - struct pci_sys_data *sys; - LIST_HEAD(head); - - pci_add_flags(PCI_REASSIGN_ALL_BUS); - if (hw->preinit) - hw->preinit(); - pcibios_init_hw(parent, hw, &head); - if (hw->postinit) - hw->postinit(); - - list_for_each_entry(sys, &head, node) { - struct pci_bus *bus = sys->bus; - - /* - * We insert PCI resources into the iomem_resource and - * ioport_resource trees in either pci_bus_claim_resources() - * or pci_bus_assign_resources(). - */ - if (pci_has_flag(PCI_PROBE_ONLY)) { - pci_bus_claim_resources(bus); - } else { - struct pci_bus *child; - - pci_bus_size_bridges(bus); - pci_bus_assign_resources(bus); - - list_for_each_entry(child, &bus->children, node) - pcie_bus_configure_settings(child); - } - - pci_bus_add_devices(bus); - } -} - #ifndef CONFIG_PCI_HOST_ITE8152 void pcibios_set_master(struct pci_dev *dev) { @@ -490,15 +302,6 @@ void pcibios_set_master(struct pci_dev *dev) } #endif -char * __init pcibios_setup(char *str) -{ - if (!strcmp(str, "debug")) { - debug_pci = 1; - return NULL; - } - return str; -} - /* * From arch/i386/kernel/pci-i386.c: * diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile index 569768a69ffc..7db707fdf8ef 100644 --- a/arch/arm/mach-mvebu/Makefile +++ b/arch/arm/mach-mvebu/Makefile @@ -1,6 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 -ccflags-y := -I$(srctree)/arch/arm/plat-orion/include - obj-$(CONFIG_MACH_MVEBU_ANY) += system-controller.o mvebu-soc-id.o ifeq ($(CONFIG_MACH_MVEBU_V7),y) diff --git a/arch/arm/mach-orion5x/Makefile b/arch/arm/mach-orion5x/Makefile index a80932210031..d13048c99d18 100644 --- a/arch/arm/mach-orion5x/Makefile +++ b/arch/arm/mach-orion5x/Makefile @@ -1,6 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 -ccflags-y := -I$(srctree)/arch/arm/plat-orion/include - obj-y += common.o pci.o obj-$(CONFIG_ARCH_ORION5X_DT) += board-dt.o diff --git a/arch/arm/mach-orion5x/board-d2net.c b/arch/arm/mach-orion5x/board-d2net.c index 0fe6fd1fd0d9..94f6d802f1f8 100644 --- a/arch/arm/mach-orion5x/board-d2net.c +++ b/arch/arm/mach-orion5x/board-d2net.c @@ -17,7 +17,6 @@ #include #include #include -#include #include "common.h" #include "orion5x.h" diff --git a/arch/arm/mach-orion5x/board-mss2.c b/arch/arm/mach-orion5x/board-mss2.c index 322ae29d05aa..06189aaf886d 100644 --- a/arch/arm/mach-orion5x/board-mss2.c +++ b/arch/arm/mach-orion5x/board-mss2.c @@ -12,7 +12,6 @@ #include #include #include -#include #include "orion5x.h" #include "bridge-regs.h" #include "common.h" diff --git a/arch/arm/mach-orion5x/board-rd88f5182.c b/arch/arm/mach-orion5x/board-rd88f5182.c index 9e2fe74ec68a..f403a994e27e 100644 --- a/arch/arm/mach-orion5x/board-rd88f5182.c +++ b/arch/arm/mach-orion5x/board-rd88f5182.c @@ -15,7 +15,6 @@ #include #include #include -#include #include "common.h" #include "orion5x.h" diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h index 4dc6c59bde99..9e6edac784b2 100644 --- a/arch/arm/mach-orion5x/common.h +++ b/arch/arm/mach-orion5x/common.h @@ -41,6 +41,25 @@ struct pci_bus; struct pci_host_bridge; struct pci_sys_data; struct pci_dev; +struct pci_ops; +struct device; + +struct hw_pci { + struct pci_ops *ops; + int nr_controllers; + void **private_data; + int (*setup)(int nr, struct pci_sys_data *); + int (*scan)(int nr, struct pci_host_bridge *); + void (*preinit)(void); + void (*postinit)(void); + u8 (*swizzle)(struct pci_dev *dev, u8 *pin); + int (*map_irq)(const struct pci_dev *dev, u8 slot, u8 pin); +}; + +/* + * Call this with your hw_pci struct to initialise the PCI system. + */ +void pci_common_init(struct hw_pci *); void orion5x_pcie_id(u32 *dev, u32 *rev); void orion5x_pci_disable(void); diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c index 3d1e6ad0e14b..2da278b94661 100644 --- a/arch/arm/mach-orion5x/pci.c +++ b/arch/arm/mach-orion5x/pci.c @@ -13,11 +13,28 @@ #include #include