From patchwork Wed Jul 15 16:54:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 6799751 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C7757C05AC for ; Wed, 15 Jul 2015 16:57:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EAF1120663 for ; Wed, 15 Jul 2015 16:57:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2AF1620661 for ; Wed, 15 Jul 2015 16:57:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZFPy2-0001o9-6C; Wed, 15 Jul 2015 16:55:34 +0000 Received: from mail-ig0-x232.google.com ([2607:f8b0:4001:c05::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZFPxm-0000OK-8r for linux-arm-kernel@lists.infradead.org; Wed, 15 Jul 2015 16:55:19 +0000 Received: by iggp10 with SMTP id p10so125842447igg.0 for ; Wed, 15 Jul 2015 09:54:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TnRWhmyhGx47vZiyq4k6vNogMmk1dV4pWLcFHfGcNto=; b=ehsL9uTiMmIfF48Trmho3GN3lhmmc+M3NyYRcIDG3A16R/j4aq+kt1e47Q3UD4axna l5anT886TPsoln0lT51EsA9xl2i+RrVaxltv1XJ2wHRGHQEQNqbSc9Mgf7BE8QSsRMDP qZQ478MFHzkeiU6WjXBczAHWV0LSq6zLG59oE3Y4Itlqk9E/AXiK+jnwojuHmFoUg4jT VkXOTX/ekY+gQo9ZErFakj2umSsVNFOGlv4oWw7agWzh5uBSsphCqpjdaVCGNNDFchek f4+f1BGfPde2M8nmR2Ro5nkz+iSvxnJ8qFg4CkGIBvOkGf/l6QWD0oI9qpsAUS1qwRUF xaZw== X-Received: by 10.50.49.46 with SMTP id r14mr27910020ign.45.1436979297569; Wed, 15 Jul 2015 09:54:57 -0700 (PDT) Received: from dl.caveonetworks.com (64.2.3.194.ptr.us.xo.net. [64.2.3.194]) by smtp.gmail.com with ESMTPSA id c12sm3120863ioj.39.2015.07.15.09.54.55 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 15 Jul 2015 09:54:56 -0700 (PDT) Received: from dl.caveonetworks.com (localhost.localdomain [127.0.0.1]) by dl.caveonetworks.com (8.14.5/8.14.5) with ESMTP id t6FGsssX008227; Wed, 15 Jul 2015 09:54:54 -0700 Received: (from ddaney@localhost) by dl.caveonetworks.com (8.14.5/8.14.5/Submit) id t6FGssZ8008226; Wed, 15 Jul 2015 09:54:54 -0700 From: David Daney To: linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Bjorn Helgaas , linux-pci@vger.kernel.org, Thomas Gleixner , Jason Cooper Subject: [PATCH 3/5] arm64, pci: Allow RC drivers to supply pcibios_add_device() implementation. Date: Wed, 15 Jul 2015 09:54:43 -0700 Message-Id: <1436979285-8177-4-git-send-email-ddaney.cavm@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1436979285-8177-1-git-send-email-ddaney.cavm@gmail.com> References: <1436979285-8177-1-git-send-email-ddaney.cavm@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150715_095518_371552_8D08050F X-CRM114-Status: GOOD ( 13.23 ) X-Spam-Score: -2.0 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Robert Richter , linux-kernel@vger.kernel.org, David Daney MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: David Daney The default is to continue doing the what we have done before, but add a hook so that this can be overridden. Signed-off-by: David Daney --- arch/arm64/include/asm/pci.h | 3 +++ arch/arm64/kernel/pci.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/arch/arm64/include/asm/pci.h b/arch/arm64/include/asm/pci.h index b008a72..ad3fb18 100644 --- a/arch/arm64/include/asm/pci.h +++ b/arch/arm64/include/asm/pci.h @@ -37,6 +37,9 @@ static inline int pci_proc_domain(struct pci_bus *bus) { return 1; } + +void set_pcibios_add_device(int (*arg)(struct pci_dev *)); + #endif /* CONFIG_PCI */ #endif /* __KERNEL__ */ diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index 4095379..3356023 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -38,11 +38,21 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res, return res->start; } +static int (*pcibios_add_device_impl)(struct pci_dev *); + +void set_pcibios_add_device(int (*arg)(struct pci_dev *)) +{ + pcibios_add_device_impl = arg; +} + /* * Try to assign the IRQ number from DT when adding a new device */ int pcibios_add_device(struct pci_dev *dev) { + if (pcibios_add_device_impl) + return pcibios_add_device_impl(dev); + dev->irq = of_irq_parse_and_map_pci(dev, 0, 0); return 0;