Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp468802ybx; Wed, 6 Nov 2019 21:00:49 -0800 (PST) X-Google-Smtp-Source: APXvYqx8bB69Clim0mPtMLPSEb0hemDxO0x61O1nhI163yCAQ2+Me+PuCTy/zHfiEwUqGN4P4a7X X-Received: by 2002:a05:6402:706:: with SMTP id w6mr1589318edx.38.1573102849805; Wed, 06 Nov 2019 21:00:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573102849; cv=none; d=google.com; s=arc-20160816; b=ZVssEWjZZFUBSpJKLeRq8GzSxMG4voIuCVhlpNlNNEuwuJtTkxLkdXPSJEEkqOmWFd t39h/34fNhVOLmeKv40F08WUoMYa3zc0sHsweQu7vn+lMZ9tDrgtaN66fpJmndhsK5YZ WOYwQWHEZ5EnW8qgwhapXCAMAhdqqa6avej+LKkEnkQH6I+HTv9dHm+2VBz6b3j/EJhy XMznM3P4FxVnBAaLopM2HKTAcTTRYrVNjXfkRtv2QHi213hQHnrJ3V3H0cKTELWY4aQo KScOywiWUnXypP3r4lruikKBmA50KTsr2jLOpf6Z0NuKA4I1kI1KyK74hkHZboKlFoW8 hdUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=+WvTDd7bU1Qbgbyqy1GUEZEaZxHZ7Lm8TAnnmQtQthQ=; b=B52Ndgn4do8ZtFkwdm6oONqkF5VUg7b/I/lpQy7mOzVIAaPfbz/k2z9ZI6WW4p7ahg c1BdYezLqvd7wjTUZL4cGkkhN7e0L/y2jg1RBijO9tBnZFb6sUVvhs8kzP9Urzef4nP9 VWVpZbO0B00/dk34ceGtmQ1RnRgkBwlQ8HsfklXuz3jGPHYZWYdsE3MM9sw8Zi4fDXBs jlgLp4k4zndtQIakvt1Zh4Y/5fsblSOiVqfH8kt8i5Y40nDLwjWy6pTHF8IpXwOx4IcU 5DnPKfOk0iYffboYTRdEG4xG5Ae9OvVPMzZUQ1Lpcsh2o9x0thmhueGm61c49wQ5SMca FSMQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n8si666808eja.438.2019.11.06.21.00.26; Wed, 06 Nov 2019 21:00:49 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733206AbfKGE7I (ORCPT + 99 others); Wed, 6 Nov 2019 23:59:08 -0500 Received: from mx.socionext.com ([202.248.49.38]:53331 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726582AbfKGE7I (ORCPT ); Wed, 6 Nov 2019 23:59:08 -0500 Received: from unknown (HELO iyokan-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 07 Nov 2019 13:59:06 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by iyokan-ex.css.socionext.com (Postfix) with ESMTP id B9291605F8; Thu, 7 Nov 2019 13:59:06 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Thu, 7 Nov 2019 13:59:16 +0900 Received: from plum.e01.socionext.com (unknown [10.213.132.32]) by kinkan.css.socionext.com (Postfix) with ESMTP id 7DCE31A0E9F; Thu, 7 Nov 2019 13:59:06 +0900 (JST) From: Kunihiko Hayashi To: Lorenzo Pieralisi , Andrew Murray , Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Masami Hiramatsu , Jassi Brar , Kunihiko Hayashi Subject: [PATCH 2/2] PCI: uniphier: Add checking whether PERST# is deasserted Date: Thu, 7 Nov 2019 13:58:15 +0900 Message-Id: <1573102695-7018-2-git-send-email-hayashi.kunihiko@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573102695-7018-1-git-send-email-hayashi.kunihiko@socionext.com> References: <1573102695-7018-1-git-send-email-hayashi.kunihiko@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When PERST# is asserted once, EP configuration will be initialized. If PERST# has been already deasserted, it isn't necessary to assert here. This checks whether PERST# is deasserted using PCL_PINMON register, and adds omit controlling PERST#. Signed-off-by: Kunihiko Hayashi --- drivers/pci/controller/dwc/pcie-uniphier.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-uniphier.c b/drivers/pci/controller/dwc/pcie-uniphier.c index 8fd7bad..1ea4220 100644 --- a/drivers/pci/controller/dwc/pcie-uniphier.c +++ b/drivers/pci/controller/dwc/pcie-uniphier.c @@ -22,6 +22,9 @@ #include "pcie-designware.h" +#define PCL_PINMON 0x0028 +#define PCL_PINMON_PERST_OUT BIT(16) + #define PCL_PINCTRL0 0x002c #define PCL_PERST_PLDN_REGEN BIT(12) #define PCL_PERST_NOE_REGEN BIT(11) @@ -100,6 +103,11 @@ static void uniphier_pcie_init_rc(struct uniphier_pcie_priv *priv) val |= PCL_SYS_AUX_PWR_DET; writel(val, priv->base + PCL_APP_PM0); + /* return if PERST# is already deasserted */ + val = readl(priv->base + PCL_PINMON); + if (val & PCL_PINMON_PERST_OUT) + return; + /* assert PERST# */ val = readl(priv->base + PCL_PINCTRL0); val &= ~(PCL_PERST_NOE_REGVAL | PCL_PERST_OUT_REGVAL -- 2.7.4