Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp397909yba; Thu, 16 May 2019 02:42:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwB/MCAk9mqtDYV9BqIoKvcziPrsC9lXNPzV1E0lkuI3J9zoa2aPk/azg8QfDsiERmIxxNc X-Received: by 2002:a63:495e:: with SMTP id y30mr6870825pgk.185.1557999729048; Thu, 16 May 2019 02:42:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557999729; cv=none; d=google.com; s=arc-20160816; b=zcwQd9wg2jf5ZwgXw/1Wu2ERgnwLIHoVzyT2G9i7H7gKsrInDpgh4I8kjIYHMHvgKe Nc+X380+rEjL9ulw/9Dw7+SqnDd2aqwAbGdQffozNBX92D/uFBD/LG/w2MPcVGH3QZ0a iOjsdjfxfssM4sE3qIdkPp8nCx8YXpJ00+su069+peBxwlYK7uhfniOIvFg6m4Mtiqe8 S1Cw/Xcvq1G2r8snn+QiDYwDTI3utxtlZYQtHHSmW6aSnc4ooitfh5MPWH/ypwrFemLi HeAlMYrb0jNWumQsF4R1o5zcgUWiT8Soeb3euDuxoWFz10bQM7lgGnbdH3jL+Z87QE4Z g4qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=gO9AzrbYzIatf8Cx7zr1tfYbPUIpVMGqibhEQhGT9Sw=; b=syAt7DXIJ8RnA+mP4IEX/g2pGPYjgp24TQlXfz3W5gdMgTpyVHXy2ISIxGXfXemSIb oLWLytGeeoxnPiRUfVNhq/KMoORuS861ntR8aUNoCPJIj+sD06cxwQFtBrTPZ25EhUfJ qK1HeTnZQdoLem5lWCMqPS1D2nmjNCHGhX8giO1f7nMrUMpqlWA66ySJPaVjr6ni1vAq FldVS5AKVhu4ooXy7mOzLO4eYIdft2R4vZQKp3JecjbC6Ag/ahoVQV3p7z6gkWFmjSzk 7b7gQ5g0jA8TqdfvfSVkbKO9dHHIrqxaUzWlL/zKKj+lAJE4vWvLB+Y3xC+9LesaDsqB TtHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mm-sol.com header.s=201706 header.b="nK/xIje4"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=mm-sol.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t10si4261042plr.177.2019.05.16.02.41.54; Thu, 16 May 2019 02:42:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@mm-sol.com header.s=201706 header.b="nK/xIje4"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=mm-sol.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727142AbfEPJjv (ORCPT + 99 others); Thu, 16 May 2019 05:39:51 -0400 Received: from ns.mm-sol.com ([37.157.136.199]:48688 "EHLO extserv.mm-sol.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726374AbfEPJjv (ORCPT ); Thu, 16 May 2019 05:39:51 -0400 Received: from [192.168.27.209] (unknown [37.157.136.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by extserv.mm-sol.com (Postfix) with ESMTPSA id C8124CE6F; Thu, 16 May 2019 12:39:47 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mm-sol.com; s=201706; t=1557999587; bh=gtvWMbdQdnb7LYo5ABxwlV32TZDaPlVrBBH+/CofRko=; h=Subject:To:Cc:From:Date:From; b=nK/xIje4UFqTVVEISNtWB6QEO5a8wygY1e2E8Z4m7AUNg13m0ReU4WT9GSKz4Hytj zmXkUJqsSxM4oCkQYsAD00OVwDTXFWH1h3g7n2pC1OgEKo8v6jPdb/sSIYAQ5omiQD DrBhURBmTklidAqq1Mhdq+KizFSJAxNxMfL8f22EizKJVZkFrCBosYnwSoqei7y672 k4awo6qwCX7nelgUnfWv4ofToldsoX3K5gay5ZTE/WYH7/axgbMew41U52ZEDur+XH dY1BpCOTsNrkFEASqqp+k1nR0cOtnJhaQEY0WISnPCerI2SnrUET/KOTbkVpvh8DRV vwMfCR2A24YQw== Subject: Re: [PATCH v3 3/3] PCI: qcom: Add QCS404 PCIe controller support To: Bjorn Andersson , Bjorn Helgaas , Lorenzo Pieralisi Cc: Rob Herring , Mark Rutland , linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190502001955.10575-1-bjorn.andersson@linaro.org> <20190502001955.10575-4-bjorn.andersson@linaro.org> From: Stanimir Varbanov Message-ID: Date: Thu, 16 May 2019 12:39:45 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190502001955.10575-4-bjorn.andersson@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bjorn, On 5/2/19 3:19 AM, Bjorn Andersson wrote: > The QCS404 platform contains a PCIe controller of version 2.4.0 and a > Qualcomm PCIe2 PHY. The driver already supports version 2.4.0, for the > IPQ4019, but this support touches clocks and resets related to the PHY > as well, and there's no upstream driver for the PHY. > > On QCS404 we must initialize the PHY, so a separate PHY driver is > implemented to take care of this and the controller driver is updated to > not require the PHY related resources. This is done by relying on the > fact that operations in both the clock and reset framework are nops when > passed NULL, so we can isolate this change to only the get_resource > function. > > For QCS404 we also need to enable the AHB (iface) clock, in order to > access the register space of the controller, but as this is not part of > the IPQ4019 DT binding this is only added for new users of the 2.4.0 > controller. > > Reviewed-by: Niklas Cassel > Signed-off-by: Bjorn Andersson > --- > > Changes since v2: > - None > > drivers/pci/controller/dwc/pcie-qcom.c | 64 +++++++++++++++----------- > 1 file changed, 38 insertions(+), 26 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c > index d740cbe0e56d..d101bc5c0def 100644 > --- a/drivers/pci/controller/dwc/pcie-qcom.c > +++ b/drivers/pci/controller/dwc/pcie-qcom.c > @@ -112,7 +112,7 @@ struct qcom_pcie_resources_2_3_2 { > struct regulator_bulk_data supplies[QCOM_PCIE_2_3_2_MAX_SUPPLY]; > }; > > -#define QCOM_PCIE_2_4_0_MAX_CLOCKS 3 > +#define QCOM_PCIE_2_4_0_MAX_CLOCKS 4 > struct qcom_pcie_resources_2_4_0 { > struct clk_bulk_data clks[QCOM_PCIE_2_4_0_MAX_CLOCKS]; > int num_clks; > @@ -638,13 +638,16 @@ static int qcom_pcie_get_resources_2_4_0(struct qcom_pcie *pcie) > struct qcom_pcie_resources_2_4_0 *res = &pcie->res.v2_4_0; > struct dw_pcie *pci = pcie->pci; > struct device *dev = pci->dev; > + bool is_ipq = of_device_is_compatible(dev->of_node, "qcom,pcie-ipq4019"); > int ret; > > res->clks[0].id = "aux"; > res->clks[1].id = "master_bus"; > res->clks[2].id = "slave_bus"; > + res->clks[3].id = "iface"; > > - res->num_clks = 3; > + /* qcom,pcie-ipq4019 is defined without "iface" */ > + res->num_clks = is_ipq ? 3 : 4; This is ugly but I don't have better idea except having static const resource structures where we can describe num_clks and select the right resource from compatible string, but lets leave that for the future. Otherwise: Acked-by: Stanimir Varbanov -- regards, Stan