From patchwork Fri Feb 28 01:19:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Harvey X-Patchwork-Id: 3737051 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7F47EBF13A for ; Fri, 28 Feb 2014 01:22:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 96EA32025A for ; Fri, 28 Feb 2014 01:22:17 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EE3CE20254 for ; Fri, 28 Feb 2014 01:22:14 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WJC8b-0006qH-EG; Fri, 28 Feb 2014 01:21:17 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WJC8L-0002Ca-6Y; Fri, 28 Feb 2014 01:21:01 +0000 Received: from mail-pa0-f42.google.com ([209.85.220.42]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WJC7r-0002A5-Lm for linux-arm-kernel@lists.infradead.org; Fri, 28 Feb 2014 01:20:32 +0000 Received: by mail-pa0-f42.google.com with SMTP id kl14so43420pab.15 for ; Thu, 27 Feb 2014 17:20:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WVrn+lHlfZhu0AZv6sRClI19NAZY7aFcWh1ZWeeoyk4=; b=JucYx70yYi/0GZ2wedwNML4OcvjCiuTfR/fdCYANEm6LeQQsh/fChNbeUZjlIiYe3W wDZB1WHig1S2S4mV5OoKoRitXJ3+NhpTrrfTkB0kPvxTqPxdqgAKfWpzyto68dtJSr6h WiN1kZgcHvyebXy+El7D2PNE2ZzTu0LyqGwsPNcV24JsXkv/VBSnisQDmHtxxo9aCFhY 8XPKS2phmEuuo/AYxsmT4dDJCNK58lnAVKpz12oGLUGjOXy9BURUSYPPzgeA3wAdER2+ MUq/Q380ERlePE5hOTUd1jQU37sNEDb1DyiInjhqWlDUO+XFzgN+0logQygFKC7SHS1m VtSQ== X-Gm-Message-State: ALoCoQlzPGqPhhtpXNY9MKMKz1C9RIRPwWBjft5OdWlPVsVOCzkJQcx6MQ1xtgkzMEd/sNVbqOBO X-Received: by 10.68.166.196 with SMTP id zi4mr161282pbb.90.1393550405795; Thu, 27 Feb 2014 17:20:05 -0800 (PST) Received: from localhost.localdomain (68-189-91-139.static.snlo.ca.charter.com. [68.189.91.139]) by mx.google.com with ESMTPSA id y9sm608473pas.10.2014.02.27.17.20.04 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Feb 2014 17:20:04 -0800 (PST) From: Tim Harvey To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/3] PCI: designware: add ability for custom swizzle Date: Thu, 27 Feb 2014 17:19:53 -0800 Message-Id: <1393550394-11071-3-git-send-email-tharvey@gateworks.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1393550394-11071-1-git-send-email-tharvey@gateworks.com> References: <1393550394-11071-1-git-send-email-tharvey@gateworks.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140227_202031_782110_2E61FBEC X-CRM114-Status: GOOD ( 10.88 ) X-Spam-Score: -2.6 (--) Cc: Richard Zhu , Jingoo Han , Bjorn Helgaas , Sean Cross , Shawn Guo , Lucas Stach X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 Add the ability for a platform driver to provide a host-specific swizzle function. Signed-off-by: Tim Harvey Cc: Bjorn Helgaas Cc: Richard Zhu Cc: Shawn Guo Cc: Lucas Stach Cc: Sean Cross Cc: Jingoo Han --- drivers/pci/host/pcie-designware.c | 3 +++ drivers/pci/host/pcie-designware.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c index 5808177..a143f2a 100644 --- a/drivers/pci/host/pcie-designware.c +++ b/drivers/pci/host/pcie-designware.c @@ -480,6 +480,9 @@ int __init dw_pcie_host_init(struct pcie_port *pp) if (pp->ops->host_init) pp->ops->host_init(pp); + if (pp->swizzle) + dw_pci.swizzle = pp->swizzle; + dw_pcie_wr_own_conf(pp, PCI_BASE_ADDRESS_0, 4, 0); /* program correct class for RC */ diff --git a/drivers/pci/host/pcie-designware.h b/drivers/pci/host/pcie-designware.h index 5c596c0..8631d56 100644 --- a/drivers/pci/host/pcie-designware.h +++ b/drivers/pci/host/pcie-designware.h @@ -53,6 +53,7 @@ struct pcie_port { struct irq_domain *irq_domain; unsigned long msi_data; DECLARE_BITMAP(msi_irq_in_use, MAX_MSI_IRQS); + u8 (*swizzle)(struct pci_dev *, u8 *); }; struct pcie_host_ops {