From patchwork Tue Aug 5 16:11:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Minter X-Patchwork-Id: 4680361 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7F62FC0338 for ; Tue, 5 Aug 2014 16:12:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9B1FF201CE for ; Tue, 5 Aug 2014 16:12:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6924B201BA for ; Tue, 5 Aug 2014 16:12:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755142AbaHEQMM (ORCPT ); Tue, 5 Aug 2014 12:12:12 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:62923 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755003AbaHEQMH (ORCPT ); Tue, 5 Aug 2014 12:12:07 -0400 Received: by mail-wi0-f177.google.com with SMTP id ho1so1645421wib.16 for ; Tue, 05 Aug 2014 09:12:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=myport.ac.uk; s=google-20130730; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=HPhDeGci/AzO6zOhVzAo4IDgAXtHxdnfyH+uxwBKpmA=; b=ccRSnWaeJSBXoPI1iem+oE7GW2oqrNh3RDw5clUk/PvtNO7I7PesMv//7Azl1ZE1je e+K4EaNhwWZiiRXpGG6Md9eBrYV6Jdn5FWo26EgC2MMhte2JMB7eADE5ALLoNiITzNVU 2OEhle54kFtGs/Y8jdlrde5uGCp+azDNHGTdM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=HPhDeGci/AzO6zOhVzAo4IDgAXtHxdnfyH+uxwBKpmA=; b=mJR24dtZ08ckYdPsQijHsk2q85ebhU4U6wYROC4nL9wOFtBB1r9x9d2P09EICKo0zJ WFgjKL5kh69cyvp1CsVax+as1mIT4JUSP+18q9FotJ2Zbwohv0U2EajTNXot38mtYU5m cOCM5K9E5Ddollib98VlRn7vhTIkF9Vq+TB7nKvY3mBeeYO0TOHoi+0/hCkQcf/u//IK vVZVRZ7mrk+Rx0RkcleGrHI9y4WCNRi3nNGYcRS8dIIWqIHQg8jMV80YCAFHM1+sMInd BMD6CF+OUkUCVmf506wyfx563XJYUgOdCmSPB7KqH4W9rdswRMgTVp7mRcQ1IU+3DVfj QR1A== X-Gm-Message-State: ALoCoQkyi7R+BWjnmLeh90ua9hDdt3LlCLONk3rg8sAF/Qq/jPwreLMFpDHsNmko6nNSGniJRr+Z X-Received: by 10.180.221.133 with SMTP id qe5mr1132624wic.17.1407255125457; Tue, 05 Aug 2014 09:12:05 -0700 (PDT) Received: from localhost.xy01.xyratex.com (xyratex195.xyratex.com. [194.131.166.195]) by mx.google.com with ESMTPSA id e3sm5169369wjp.4.2014.08.05.09.12.04 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 05 Aug 2014 09:12:04 -0700 (PDT) From: matthew_minter@xyratex.com To: bhelgaas@google.com, linux-pci@vger.kernel.org Cc: matthew_minter Subject: [PATCH 11/22] Added (untested) support to mn10300 architecture to accomodate new irq init code Date: Tue, 5 Aug 2014 17:11:12 +0100 Message-Id: <1407255083-9356-12-git-send-email-matthew_minter@xyratex.com> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1407255083-9356-1-git-send-email-matthew_minter@xyratex.com> References: <1407255083-9356-1-git-send-email-matthew_minter@xyratex.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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: matthew_minter --- arch/mn10300/unit-asb2305/pci-asb2305.h | 5 +---- arch/mn10300/unit-asb2305/pci-irq.c | 25 +++++-------------------- arch/mn10300/unit-asb2305/pci.c | 21 ++++++++------------- 3 files changed, 14 insertions(+), 37 deletions(-) diff --git a/arch/mn10300/unit-asb2305/pci-asb2305.h b/arch/mn10300/unit-asb2305/pci-asb2305.h index 9e17aca..fb520cf 100644 --- a/arch/mn10300/unit-asb2305/pci-asb2305.h +++ b/arch/mn10300/unit-asb2305/pci-asb2305.h @@ -67,9 +67,6 @@ struct irq_routing_table { } __attribute__((packed)); extern unsigned int pcibios_irq_mask; - -extern void pcibios_irq_init(void); -extern void pcibios_fixup_irqs(void); -extern void pcibios_enable_irq(struct pci_dev *dev); +extern int pci_map_irq(struct pci_dev *, u8 slot, u8 pin); #endif /* PCI_ASB2305_H */ diff --git a/arch/mn10300/unit-asb2305/pci-irq.c b/arch/mn10300/unit-asb2305/pci-irq.c index fcb28ce..5be6fea 100644 --- a/arch/mn10300/unit-asb2305/pci-irq.c +++ b/arch/mn10300/unit-asb2305/pci-irq.c @@ -20,27 +20,12 @@ #include #include "pci-asb2305.h" -void __init pcibios_irq_init(void) +int pci_map_irq(struct pci_dev *, u8 slot, u8 pin) { -} - -void __init pcibios_fixup_irqs(void) -{ - struct pci_dev *dev = NULL; - u8 line, pin; + u8 line; - for_each_pci_dev(dev) { - pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); - if (pin) { - dev->irq = XIRQ1; - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, - dev->irq); - } - pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &line); - } -} - -void pcibios_enable_irq(struct pci_dev *dev) -{ + pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); + dev->irq = XIRQ1; pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq); + pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &line); } diff --git a/arch/mn10300/unit-asb2305/pci.c b/arch/mn10300/unit-asb2305/pci.c index 6b4339f..22f8786 100644 --- a/arch/mn10300/unit-asb2305/pci.c +++ b/arch/mn10300/unit-asb2305/pci.c @@ -377,13 +377,18 @@ static int __init pcibios_init(void) pci_add_resource_offset(&resources, &pci_ioport_resource, io_offset); pci_add_resource_offset(&resources, &pci_iomem_resource, mem_offset); pci_scan_root_bus(NULL, 0, &pci_direct_ampci, NULL, &resources); - - pcibios_irq_init(); - pcibios_fixup_irqs(); pcibios_resource_survey(); return 0; } +int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge) +{ + bridge->swizzle_irq = NULL; + bridge->map_irq = pci_map_irq; + return 0; +} + + arch_initcall(pcibios_init); char *__init pcibios_setup(char *str) @@ -396,16 +401,6 @@ char *__init pcibios_setup(char *str) return str; } -int pcibios_enable_device(struct pci_dev *dev, int mask) -{ - int err; - - err = pci_enable_resources(dev, mask); - if (err == 0) - pcibios_enable_irq(dev); - return err; -} - /* * disable the ethernet chipset */