From patchwork Tue Jun 10 18:51:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 31699 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f71.google.com (mail-pb0-f71.google.com [209.85.160.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D367620675 for ; Tue, 10 Jun 2014 18:52:55 +0000 (UTC) Received: by mail-pb0-f71.google.com with SMTP id jt11sf15064055pbb.10 for ; Tue, 10 Jun 2014 11:52:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=ZSMbzdwZfB45FhTYqtr833D82oGUeeWey0ygsNbcBck=; b=fMybBCijGY/5el2xXC3dDflDJeYP1gqARmn4VekYDeSWZFZ99M5l6ogFdAxJOrb2g6 JeOyvIj4Khlo4BUbTAW8c9Hs0iAm00lWWUH5CE2vIAVk9CYROc0unwz4FbSahw/pSwaE tuFapEODweeSxgVPD4DIR0IVHMqGvXGPLaz1c30l8N6i38Mjj0yAbeT4XYhK+rBAI7Xn kNOxmc5OXFgHyyKWOvRU253XBT2L3EC0tteun+OE8R3zvrVwvykGsA1j/vsGgxVospMd 3FRDGOQjnURtaOIeHnDOblgGJDHdggrK3W2cc5cJjgL0ZvO9HK7GpScA4/gzzhl6eQPM 1UkA== X-Gm-Message-State: ALoCoQm//5L65x+s3dhMRMBmsTxUsCYmjtGzqfMFvSjCWX3qoRiimswbIs6ZA4sxLXMUg8ilN3AF X-Received: by 10.66.231.68 with SMTP id te4mr3182436pac.29.1402426375190; Tue, 10 Jun 2014 11:52:55 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.31.33 with SMTP id e30ls2436445qge.89.gmail; Tue, 10 Jun 2014 11:52:55 -0700 (PDT) X-Received: by 10.220.162.196 with SMTP id w4mr2727134vcx.58.1402426374990; Tue, 10 Jun 2014 11:52:54 -0700 (PDT) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id ce2si13361055vdc.67.2014.06.10.11.52.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Jun 2014 11:52:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.172 as permitted sender) client-ip=209.85.128.172; Received: by mail-ve0-f172.google.com with SMTP id jz11so4537006veb.31 for ; Tue, 10 Jun 2014 11:52:54 -0700 (PDT) X-Received: by 10.58.1.9 with SMTP id 9mr10425038vei.14.1402426374863; Tue, 10 Jun 2014 11:52:54 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp247455vcb; Tue, 10 Jun 2014 11:52:54 -0700 (PDT) X-Received: by 10.68.224.198 with SMTP id re6mr42670804pbc.8.1402426374087; Tue, 10 Jun 2014 11:52:54 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gu3si35211975pbb.232.2014.06.10.11.52.53; Tue, 10 Jun 2014 11:52:53 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752798AbaFJSwm (ORCPT + 27 others); Tue, 10 Jun 2014 14:52:42 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:56435 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752316AbaFJSwk (ORCPT ); Tue, 10 Jun 2014 14:52:40 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s5AIpJ9c011050; Tue, 10 Jun 2014 13:51:19 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5AIpJ9W029305; Tue, 10 Jun 2014 13:51:19 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Tue, 10 Jun 2014 13:51:19 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5AIpGKm012701; Tue, 10 Jun 2014 13:51:18 -0500 From: Murali Karicheri To: , , , , CC: Murali Karicheri , Santosh Shilimkar , Russell King , Grant Likely , Rob Herring , Mohit Kumar , Jingoo Han , Bjorn Helgaas , Pratyush Anand , Richard Zhu , Kishon Vijay Abraham I , Marek Vasut , Arnd Bergmann , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Randy Dunlap Subject: [PATCH v2 1/8] PCI: designware: add rd[wr]_other_conf API Date: Tue, 10 Jun 2014 14:51:20 -0400 Message-ID: <1402426287-31157-2-git-send-email-m-karicheri2@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1402426287-31157-1-git-send-email-m-karicheri2@ti.com> References: <1402426287-31157-1-git-send-email-m-karicheri2@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: m-karicheri2@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , v3.65 version of the designware h/w, requires application space registers to be configured to access the remote EP config space. To support this, add rd[wr]_other_conf API in the pcie_host_opts Signed-off-by: Murali Karicheri CC: Santosh Shilimkar CC: Russell King CC: Grant Likely CC: Rob Herring CC: Mohit Kumar CC: Jingoo Han CC: Bjorn Helgaas CC: Pratyush Anand CC: Richard Zhu CC: Kishon Vijay Abraham I CC: Marek Vasut CC: Arnd Bergmann CC: Pawel Moll CC: Mark Rutland CC: Ian Campbell CC: Kumar Gala CC: Randy Dunlap CC: Grant Likely Reviewed-by: Pratyush Anand --- drivers/pci/host/pcie-designware.c | 12 ++++++++++-- drivers/pci/host/pcie-designware.h | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c index c4e3732..e8f5d8d 100644 --- a/drivers/pci/host/pcie-designware.c +++ b/drivers/pci/host/pcie-designware.c @@ -654,7 +654,11 @@ static int dw_pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where, spin_lock_irqsave(&pp->conf_lock, flags); if (bus->number != pp->root_bus_nr) - ret = dw_pcie_rd_other_conf(pp, bus, devfn, + if (pp->ops->rd_other_conf) + ret = pp->ops->rd_other_conf(pp, bus, devfn, + where, size, val); + else + ret = dw_pcie_rd_other_conf(pp, bus, devfn, where, size, val); else ret = dw_pcie_rd_own_conf(pp, where, size, val); @@ -680,7 +684,11 @@ static int dw_pcie_wr_conf(struct pci_bus *bus, u32 devfn, spin_lock_irqsave(&pp->conf_lock, flags); if (bus->number != pp->root_bus_nr) - ret = dw_pcie_wr_other_conf(pp, bus, devfn, + if (pp->ops->wr_other_conf) + ret = pp->ops->wr_other_conf(pp, bus, devfn, + where, size, val); + else + ret = dw_pcie_wr_other_conf(pp, bus, devfn, where, size, val); else ret = dw_pcie_wr_own_conf(pp, where, size, val); diff --git a/drivers/pci/host/pcie-designware.h b/drivers/pci/host/pcie-designware.h index 3063b35..2d6dd66 100644 --- a/drivers/pci/host/pcie-designware.h +++ b/drivers/pci/host/pcie-designware.h @@ -62,6 +62,10 @@ struct pcie_host_ops { u32 val, void __iomem *dbi_base); int (*rd_own_conf)(struct pcie_port *pp, int where, int size, u32 *val); int (*wr_own_conf)(struct pcie_port *pp, int where, int size, u32 val); + int (*rd_other_conf)(struct pcie_port *pp, struct pci_bus *bus, + unsigned int devfn, int where, int size, u32 *val); + int (*wr_other_conf)(struct pcie_port *pp, struct pci_bus *bus, + unsigned int devfn, int where, int size, u32 val); int (*link_up)(struct pcie_port *pp); void (*host_init)(struct pcie_port *pp); };