From patchwork Fri Jul 11 20:36:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 33513 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6944720672 for ; Fri, 11 Jul 2014 20:38:23 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id fp1sf9461774pdb.4 for ; Fri, 11 Jul 2014 13:38:22 -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=yfZTITCGqHI8pGTOjKdwNcmiOcnLpZj53wDPwxd/L7Y=; b=mJtdVRoHtYHLUGMrH6RVFGug/IcXEtkzv5DEx9WlFfMiTt/XaAwTlO0pfCl7L2yY4R YjvXRRuBGTzz1ksci7+EDJDF2ig5/Y8+I0frBon3TbzHUSHpIutNE58IRJlc3BN+HEqU qvcuEC/G40CK5D66b6LvuEgUipVicE4BXqmyJc2Oa4YzuK4YhA5lYhh+7yF4pC4pqzzy RhV/UzZ2wTYiJ/ZirVpC1B4hrWuUruGkeuP5wG+Cejq+RGQdOMj5/lbqtmHb27p3VduT WHQJ9F6l3R76Pr0D52+1nlyowuT9wuz6sGtRNA4Kn3VcsPMOPeLZBpHBNxTil9fFn0WN QODA== X-Gm-Message-State: ALoCoQmwd6TMqSHSNJjFqqWqgDvWDI4+2kag2C/8cEG+DyFMVr134XiWiBC34A27d/XAuuOdSdB/ X-Received: by 10.66.220.129 with SMTP id pw1mr652716pac.10.1405111102714; Fri, 11 Jul 2014 13:38:22 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.84.72 with SMTP id k66ls496033qgd.96.gmail; Fri, 11 Jul 2014 13:38:22 -0700 (PDT) X-Received: by 10.220.245.3 with SMTP id ls3mr1423293vcb.54.1405111102547; Fri, 11 Jul 2014 13:38:22 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id xq1si2536326vec.20.2014.07.11.13.38.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Jul 2014 13:38:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id ij19so3073490vcb.8 for ; Fri, 11 Jul 2014 13:38:22 -0700 (PDT) X-Received: by 10.53.5.230 with SMTP id cp6mr80512vdd.25.1405111102455; Fri, 11 Jul 2014 13:38:22 -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 tc5csp64793vcb; Fri, 11 Jul 2014 13:38:22 -0700 (PDT) X-Received: by 10.68.219.162 with SMTP id pp2mr1091398pbc.47.1405111101006; Fri, 11 Jul 2014 13:38:21 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bd15si1791237pdb.94.2014.07.11.13.38.20; Fri, 11 Jul 2014 13:38:20 -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 S1754804AbaGKUiH (ORCPT + 28 others); Fri, 11 Jul 2014 16:38:07 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:48088 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752930AbaGKUiF (ORCPT ); Fri, 11 Jul 2014 16:38:05 -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 s6BKaZgR020110; Fri, 11 Jul 2014 15:36:35 -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 s6BKaZWL017574; Fri, 11 Jul 2014 15:36:35 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Fri, 11 Jul 2014 15:36:34 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s6BKaWuc016223; Fri, 11 Jul 2014 15:36:34 -0500 From: Murali Karicheri To: , , CC: Murali Karicheri , Russell King , Grant Likely , Rob Herring , 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 v4 1/6] PCI: designware: add rd[wr]_other_conf API Date: Fri, 11 Jul 2014 16:36:30 -0400 Message-ID: <1405110995-24676-2-git-send-email-m-karicheri2@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1405110995-24676-1-git-send-email-m-karicheri2@ti.com> References: <1405110995-24676-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.177 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 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: 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 --- 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); };