From patchwork Mon Oct 24 22:17:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ray Jui X-Patchwork-Id: 9393399 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 28186607F0 for ; Mon, 24 Oct 2016 22:21:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18527290B9 for ; Mon, 24 Oct 2016 22:21:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0CC6629160; Mon, 24 Oct 2016 22:21:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BB82290B9 for ; Mon, 24 Oct 2016 22:21:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965400AbcJXWRs (ORCPT ); Mon, 24 Oct 2016 18:17:48 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:36147 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965378AbcJXWRp (ORCPT ); Mon, 24 Oct 2016 18:17:45 -0400 Received: by mail-pf0-f170.google.com with SMTP id e6so105847908pfk.3 for ; Mon, 24 Oct 2016 15:17:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8d7Dj4Ho5kV5NEdQuPCcwJwRGrgfRyq+k17hiUxnlOU=; b=UaJ2vhK63/ki/Cr4E9l5TN2e+MNrQCOAjbCMAlVTHCWKE6ZZeJoDT8zjgxl9DPeSRq SjY65o9wPUhDcQ6xxFNaOjRX4ltGYqIX2oQYkxKu8z1mW++q4QEJNDBtBy6/kWL7bpXU UhFNMOlaTdzcNAZifbjJ7WqzPdBmUXunRwfJ0= 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=8d7Dj4Ho5kV5NEdQuPCcwJwRGrgfRyq+k17hiUxnlOU=; b=PFyn7OkzbXpIQmIePxx5uvGcSLnsz+D11dBZJAcXIaJQCHUCmVnwVfXIeyOJsh8T6W VB4A8Lc6lEjIvHIP1YonQ4rwQ8rleYNJ7K8ke5rzlr3fYwML5tylgaht1ohIHW16a+vq meNCchYHweXGR9R46ytlw6SS39lfc7Yl3X6PTFLXYsOmfjXUOsBpG56ne8626AfYXfvN bWEEBrESRRT6aFA7OjbcwZC7zSYy6EfzkVN55DoFRqwomdHQCE0uQUPwdsdgz5ItzOP7 9ASjU9/U81injXh+uRjIk+5FkEbF5Bn9yHe5KQbzD/RmQs5Musm5TPJ9rrWof+zg4Pex fIRQ== X-Gm-Message-State: ABUngve6SodUcLlspcHN706A7MiSIPzuPIpacNzoUqZkhCUbRGpPvuImJpxtwG+5LV4mkDPk X-Received: by 10.98.57.140 with SMTP id u12mr33619602pfj.127.1477347464811; Mon, 24 Oct 2016 15:17:44 -0700 (PDT) Received: from lbrmn-lnxub44-1.ric.broadcom.com ([216.31.219.19]) by smtp.gmail.com with ESMTPSA id x1sm27745131pax.7.2016.10.24.15.17.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Oct 2016 15:17:44 -0700 (PDT) From: Ray Jui To: Bjorn Helgaas , Bjorn Helgaas Cc: linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-pci@vger.kernel.org, Alex Barba , Oza Oza , Ray Jui , Ray Jui Subject: [PATCH 03/12] PCI: iproc: Add BCMA type Date: Mon, 24 Oct 2016 15:17:03 -0700 Message-Id: <1477347432-17656-4-git-send-email-ray.jui@broadcom.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1477347432-17656-1-git-send-email-ray.jui@broadcom.com> References: <1477347432-17656-1-git-send-email-ray.jui@broadcom.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The iProc PCIe driver is currently using type IPROC_PCIE_PAXB for the following SoCs: NS, NSP, Cygnus, NS2, and Pegasus. In fact, the BCMA based NS uses a legacy PAXB controller that is slightly different from the PAXB controller used in the rest of SoCs, e.g., some registers are missing and it does not require software configuration of outbound/inbound address mapping A new type IPROC_PCIE_PAXB_BCMA is added in this patch to allow us to properly support the BCMA based NS along with other iProc based SoCs going forward Signed-off-by: Ray Jui Reviewed-by: Scott Branden --- drivers/pci/host/pcie-iproc-bcma.c | 1 + drivers/pci/host/pcie-iproc-msi.c | 1 + drivers/pci/host/pcie-iproc.c | 14 ++++++++++++++ drivers/pci/host/pcie-iproc.h | 3 ++- 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/pci/host/pcie-iproc-bcma.c b/drivers/pci/host/pcie-iproc-bcma.c index 8ce0890..bd4c9ec 100644 --- a/drivers/pci/host/pcie-iproc-bcma.c +++ b/drivers/pci/host/pcie-iproc-bcma.c @@ -54,6 +54,7 @@ static int iproc_pcie_bcma_probe(struct bcma_device *bdev) pcie->dev = dev; + pcie->type = IPROC_PCIE_PAXB_BCMA; pcie->base = bdev->io_addr; if (!pcie->base) { dev_err(dev, "no controller registers\n"); diff --git a/drivers/pci/host/pcie-iproc-msi.c b/drivers/pci/host/pcie-iproc-msi.c index 9a2973b..9fad791 100644 --- a/drivers/pci/host/pcie-iproc-msi.c +++ b/drivers/pci/host/pcie-iproc-msi.c @@ -563,6 +563,7 @@ int iproc_msi_init(struct iproc_pcie *pcie, struct device_node *node) } switch (pcie->type) { + case IPROC_PCIE_PAXB_BCMA: case IPROC_PCIE_PAXB: msi->reg_offsets = iproc_msi_reg_paxb; msi->nr_eq_region = 1; diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c index 3f4884a..f3b3340 100644 --- a/drivers/pci/host/pcie-iproc.c +++ b/drivers/pci/host/pcie-iproc.c @@ -100,6 +100,17 @@ enum iproc_pcie_reg { IPROC_PCIE_MAX_NUM_REG, }; +/* iProc PCIe PAXB BCMA registers */ +static const u16 iproc_pcie_reg_paxb_bcma[] = { + [IPROC_PCIE_CLK_CTRL] = 0x000, + [IPROC_PCIE_CFG_IND_ADDR] = 0x120, + [IPROC_PCIE_CFG_IND_DATA] = 0x124, + [IPROC_PCIE_CFG_ADDR] = 0x1f8, + [IPROC_PCIE_CFG_DATA] = 0x1fc, + [IPROC_PCIE_INTX_EN] = 0x330, + [IPROC_PCIE_LINK_STATUS] = 0xf0c, +}; + /* iProc PCIe PAXB registers */ static const u16 iproc_pcie_reg_paxb[] = { [IPROC_PCIE_CLK_CTRL] = 0x000, @@ -469,6 +480,9 @@ static int iproc_pcie_rev_init(struct iproc_pcie *pcie) const u16 *regs; switch (pcie->type) { + case IPROC_PCIE_PAXB_BCMA: + regs = iproc_pcie_reg_paxb_bcma; + break; case IPROC_PCIE_PAXB: regs = iproc_pcie_reg_paxb; break; diff --git a/drivers/pci/host/pcie-iproc.h b/drivers/pci/host/pcie-iproc.h index 83643d5..768be05 100644 --- a/drivers/pci/host/pcie-iproc.h +++ b/drivers/pci/host/pcie-iproc.h @@ -24,7 +24,8 @@ * endpoint devices. */ enum iproc_pcie_type { - IPROC_PCIE_PAXB = 0, + IPROC_PCIE_PAXB_BCMA = 0, + IPROC_PCIE_PAXB, IPROC_PCIE_PAXC, };