From patchwork Fri Jul 18 15:14:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 33875 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f198.google.com (mail-ig0-f198.google.com [209.85.213.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 99A6A208CF for ; Fri, 18 Jul 2014 15:17:51 +0000 (UTC) Received: by mail-ig0-f198.google.com with SMTP id h18sf3058628igc.5 for ; Fri, 18 Jul 2014 08:17:50 -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=Cj3js0m9GR8gLE2iXmjKrri/pvya+38shMRqcw6vP7M=; b=OMY48y8iJVt65rwtMqrAT4C+dpjnH7ZvjK5x2LUdqnWS0HYcMpscLffz5USZKODmHT 8VGI/HIZQHgSCIqSmKEoPI+2g7xyt0PHuuwuwUxrufne/7Y1ObqDpw4Cx8/PGI/4vLgW LNAvibFEHagbj8RgqHecvqJnzSN+D/mynmJGpOp6noHVuqXxOVi97XbJrzdceapmQsBG Idc4I+vyMxCmFeYooT+1K3qEEMA9OTfqctU83B3WJyZni1qxiSXSKfqBMjnfH4giJfCS S0Hhl4fcqUySrMVD2fAD2UMzrqV4PYlO42yba78O8WZ2PtrilCZlpNAKUTq/p9rAFEGR fgcw== X-Gm-Message-State: ALoCoQkR24PmKkuU9E2LLAkD1v1+AZ+VDoRWE1TRecRa3SzZopmkVVI8R0o3CuBGiOoMhL+SQ3Xu X-Received: by 10.182.55.104 with SMTP id r8mr2732383obp.11.1405696670926; Fri, 18 Jul 2014 08:17:50 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.29.55 with SMTP id a52ls988266qga.14.gmail; Fri, 18 Jul 2014 08:17:50 -0700 (PDT) X-Received: by 10.52.138.209 with SMTP id qs17mr5737791vdb.80.1405696670822; Fri, 18 Jul 2014 08:17:50 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id yr5si6041569vdb.14.2014.07.18.08.17.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Jul 2014 08:17:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hq11so6160757vcb.10 for ; Fri, 18 Jul 2014 08:17:50 -0700 (PDT) X-Received: by 10.52.120.38 with SMTP id kz6mr5672404vdb.86.1405696670459; Fri, 18 Jul 2014 08:17:50 -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.37.5 with SMTP id tc5csp19660vcb; Fri, 18 Jul 2014 08:17:49 -0700 (PDT) X-Received: by 10.69.18.97 with SMTP id gl1mr6109342pbd.78.1405696653441; Fri, 18 Jul 2014 08:17:33 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10si6314321pas.51.2014.07.18.08.17.28; Fri, 18 Jul 2014 08:17:28 -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 S965808AbaGRPR0 (ORCPT + 24 others); Fri, 18 Jul 2014 11:17:26 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:35825 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965465AbaGRPP4 (ORCPT ); Fri, 18 Jul 2014 11:15:56 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s6IFEVCr016912; Fri, 18 Jul 2014 10:14:31 -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 s6IFEV2u023773; Fri, 18 Jul 2014 10:14:31 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Fri, 18 Jul 2014 10:14:30 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s6IFESYl025193; Fri, 18 Jul 2014 10:14:30 -0500 From: Murali Karicheri To: , , CC: Murali Karicheri , Russell King , Grant Likely , Rob Herring , Bjorn Helgaas , Richard Zhu , Kishon Vijay Abraham I , Marek Vasut , Arnd Bergmann , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Randy Dunlap Subject: [PATCH v6 1/5] PCI: designware: add rd[wr]_other_conf API Date: Fri, 18 Jul 2014 11:14:25 -0400 Message-ID: <1405696469-7172-2-git-send-email-m-karicheri2@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1405696469-7172-1-git-send-email-m-karicheri2@ti.com> References: <1405696469-7172-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.220.179 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 Reviewed-by: Pratyush Anand Acked-by: Mohit Kumar Acked-by: Jingoo Han Acked-by: Santosh Shilimkar CC: Russell King CC: Grant Likely CC: Rob Herring CC: Bjorn Helgaas 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 --- 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 1eaf4df..d8f3af7 100644 --- a/drivers/pci/host/pcie-designware.c +++ b/drivers/pci/host/pcie-designware.c @@ -656,7 +656,11 @@ static int dw_pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where, } 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); @@ -679,7 +683,11 @@ static int dw_pcie_wr_conf(struct pci_bus *bus, u32 devfn, return PCIBIOS_DEVICE_NOT_FOUND; 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 77f592f..8121901 100644 --- a/drivers/pci/host/pcie-designware.h +++ b/drivers/pci/host/pcie-designware.h @@ -61,6 +61,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); };