Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1659239ybb; Thu, 2 Apr 2020 05:13:01 -0700 (PDT) X-Google-Smtp-Source: APiQypJrMC9xpTHmm/27L7tijI6P7yHEuLUPQyWYwq0gfRcAxiNjcbdvwmB8GbHZP9LTL2fXszcd X-Received: by 2002:a9d:630f:: with SMTP id q15mr1941928otk.146.1585829581689; Thu, 02 Apr 2020 05:13:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585829581; cv=none; d=google.com; s=arc-20160816; b=pGRSJ2jv9+gT6i+QD3V/jPovBpdfAx+vmwWezkTGEhyY7W3jPt+27AKg5mRZ1w2ADH cNcQPTz1nBqmc01hn9w8+Lej83zmbzA4q6QcGA/5jdITZ2RYo2O/YH3TYg2nq55/p6VO D6pTTFYsIvp+C+8AsFW/6diEWf8EpGwbNG/ngtpQSTw8ufTFhsv3FOSDPf0nPM59Ma7/ eQpNYbEsAAShicjwfBLUISYM6iRulCAV7qjCtx4+NDHj25B2lKC/XB7w3iEqA9gt9K9Q cn+4glsv5ZhEMwbYmakn2v5hCjwQQknwjZbGd23phCpX8ZMP0puGIvyVnQbEFAvsIG4A TIQA== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LRlrYBCdZcwWb03ZprO8ychzrcB476+VJ1UlnxZ2m10=; b=pM9KA074iKQvOQzQFbd68/UQ7HFeUMGTmhYWBY28JPGdl3516JkhLcP+ZACT56Q7rN qgGsE3oHZREbQXh/Ax0iicrfX0PUJ780M/O+OBaSP5NuBrz1H6PfR+5vQunztBOrQzu7 u+JYTjjgpSvY2FnJj9JqRDXvKM5kgnJMXZJw/0/OsOkEMq1yZg5QoSnXjixdnsILVM6R dlOgXQI3k5dazLYdyLUmEt2JbwkvP1Eu16kriG587S0o8NG00j++QfBAJElfUtjNs3al Mq3i/gSHn8jZnbhooW4JNVr0ROd69AhIFaqcZ+SXCYsQH8XdjDtp1a88mC/JIRwFYubu oUjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TQxW9jZa; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j15si2350248oos.59.2020.04.02.05.12.41; Thu, 02 Apr 2020 05:13:01 -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=@gmail.com header.s=20161025 header.b=TQxW9jZa; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388245AbgDBMMB (ORCPT + 99 others); Thu, 2 Apr 2020 08:12:01 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:43767 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387937AbgDBMMA (ORCPT ); Thu, 2 Apr 2020 08:12:00 -0400 Received: by mail-ed1-f66.google.com with SMTP id bd14so3768705edb.10; Thu, 02 Apr 2020 05:11:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LRlrYBCdZcwWb03ZprO8ychzrcB476+VJ1UlnxZ2m10=; b=TQxW9jZaa+wrh9KjiHx179fg9oGdn4GxO+8hkR7A5O77/1lguXBzDIGKMy2QtZFkr7 oPsNGTDlqbNES1TGkDjhOVgRXTxopGu9LKpnf+3RnC3rrwOlb6ChrPWTNp6cDki1FeiY LYXx/FZVbN9HsGCHnnPpDIMhFKOoj5qzOacyz6F49Dv5CJRFouSScdHY0zNRWCOfYIFu xh4ipTGayZpAlquTuTUEZymfHHrP6twIFegpkwQgv9OcUgJ5stH1/ofDicEy5Kvjm/Sg VSQIt9Zonjv05IcBKJbEakrXUolg7LkXdCBa07ACnKczupACaKTJ9lriXeUtnf8nk1kY itQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LRlrYBCdZcwWb03ZprO8ychzrcB476+VJ1UlnxZ2m10=; b=r6QmcMUFEPaNtZovlDf3YGfR5t9S1VwJmSFcQXTDuSTec0H3Hd37HnnalHw/pXcFXd ryuPtpG9KUSLBLE8yiNrjPqXt0K0A2vrQ8IMFXTWRedK3CO0uj8ls7hiR+RLg/qeAAMR pQm2OeMBxIv1h7+J0PMlk8Bvc35+szeRyTPOmHztW/cDgmN4X1f33+QST+pna7gaZdZ1 VBkopgJygZnLBMoOSkrbaAgIrfMA8JTfAYg6C3UiUd2dfqO8IisqWbEau5MGKOvS9yEj KsMPaAEwT/jjWORESYPYNdXfLch36CnAxyhWIBK5IuNmBkH594E0HPkNgAsX3p4nmsxN uDqQ== X-Gm-Message-State: AGi0PuYAEGDUCla0JOmRgQqTcBAtNbObOr0rr9Vizdrd5B+w/WYucY5h tJVqmra4gdq9fsB7eDno2CE= X-Received: by 2002:a50:e007:: with SMTP id e7mr2532354edl.361.1585829518018; Thu, 02 Apr 2020 05:11:58 -0700 (PDT) Received: from Ansuel-XPS.localdomain (host250-251-dynamic.250-95-r.retail.telecomitalia.it. [95.250.251.250]) by smtp.googlemail.com with ESMTPSA id w20sm1083611ejv.40.2020.04.02.05.11.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 05:11:57 -0700 (PDT) From: Ansuel Smith To: Andy Gross Cc: Ansuel Smith , Sham Muthayyan , Bjorn Andersson , Bjorn Helgaas , Rob Herring , Mark Rutland , Stanimir Varbanov , Lorenzo Pieralisi , Andrew Murray , Philipp Zabel , linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 01/10] PCIe: qcom: add missing ipq806x clocks in PCIe driver Date: Thu, 2 Apr 2020 14:11:38 +0200 Message-Id: <20200402121148.1767-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200402121148.1767-1-ansuelsmth@gmail.com> References: <20200402121148.1767-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Aux and Ref clk are missing in pcie qcom driver. Add support in the driver to fix pcie inizialization in ipq806x. Fixes: 82a82383 PCI: qcom: Add Qualcomm PCIe controller driver Signed-off-by: Sham Muthayyan Signed-off-by: Ansuel Smith --- drivers/pci/controller/dwc/pcie-qcom.c | 38 ++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c index 5ea527a6bd9f..f958c535de6e 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -88,6 +88,8 @@ struct qcom_pcie_resources_2_1_0 { struct clk *iface_clk; struct clk *core_clk; struct clk *phy_clk; + struct clk *aux_clk; + struct clk *ref_clk; struct reset_control *pci_reset; struct reset_control *axi_reset; struct reset_control *ahb_reset; @@ -246,6 +248,14 @@ static int qcom_pcie_get_resources_2_1_0(struct qcom_pcie *pcie) if (IS_ERR(res->phy_clk)) return PTR_ERR(res->phy_clk); + res->aux_clk = devm_clk_get(dev, "aux"); + if (IS_ERR(res->aux_clk)) + return PTR_ERR(res->aux_clk); + + res->ref_clk = devm_clk_get(dev, "ref"); + if (IS_ERR(res->ref_clk)) + return PTR_ERR(res->ref_clk); + res->pci_reset = devm_reset_control_get_exclusive(dev, "pci"); if (IS_ERR(res->pci_reset)) return PTR_ERR(res->pci_reset); @@ -278,6 +288,8 @@ static void qcom_pcie_deinit_2_1_0(struct qcom_pcie *pcie) clk_disable_unprepare(res->iface_clk); clk_disable_unprepare(res->core_clk); clk_disable_unprepare(res->phy_clk); + clk_disable_unprepare(res->aux_clk); + clk_disable_unprepare(res->ref_clk); regulator_bulk_disable(ARRAY_SIZE(res->supplies), res->supplies); } @@ -307,16 +319,28 @@ static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie) goto err_assert_ahb; } + ret = clk_prepare_enable(res->core_clk); + if (ret) { + dev_err(dev, "cannot prepare/enable core clock\n"); + goto err_clk_core; + } + ret = clk_prepare_enable(res->phy_clk); if (ret) { dev_err(dev, "cannot prepare/enable phy clock\n"); goto err_clk_phy; } - ret = clk_prepare_enable(res->core_clk); + ret = clk_prepare_enable(res->aux_clk); if (ret) { - dev_err(dev, "cannot prepare/enable core clock\n"); - goto err_clk_core; + dev_err(dev, "cannot prepare/enable aux clock\n"); + goto err_clk_aux; + } + + ret = clk_prepare_enable(res->ref_clk); + if (ret) { + dev_err(dev, "cannot prepare/enable ref clock\n"); + goto err_clk_ref; } ret = reset_control_deassert(res->ahb_reset); @@ -372,10 +396,14 @@ static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie) return 0; err_deassert_ahb: - clk_disable_unprepare(res->core_clk); -err_clk_core: + clk_disable_unprepare(res->ref_clk); +err_clk_ref: + clk_disable_unprepare(res->aux_clk); +err_clk_aux: clk_disable_unprepare(res->phy_clk); err_clk_phy: + clk_disable_unprepare(res->core_clk); +err_clk_core: clk_disable_unprepare(res->iface_clk); err_assert_ahb: regulator_bulk_disable(ARRAY_SIZE(res->supplies), res->supplies); -- 2.25.1