From patchwork Thu Nov 7 04:58:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kunihiko Hayashi X-Patchwork-Id: 178783 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp495521ilf; Wed, 6 Nov 2019 20:59:10 -0800 (PST) X-Google-Smtp-Source: APXvYqxm5VUhD0cbFueggSEcMJnOpt7LwuC5A8wdpyGwu5fO+R5v4IW3xE6VuKgayNKbydyEiukU X-Received: by 2002:a50:e68c:: with SMTP id z12mr1549095edm.53.1573102750329; Wed, 06 Nov 2019 20:59:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573102750; cv=none; d=google.com; s=arc-20160816; b=FMBn8YLx1KT1UfhIrHKW6n8Qo4x979iWAbxOn0An/e9cv7rfIs5G56tbd88zWwp/jO +ZNdT+gA7KsSeNTgcWuo1VvkGd1K3JeJ3S9FVjTQCVYx5OH5603RdiZFyCHVmQFULUE0 yvHDAJj4+LyAYTCTD/9b3vU6q6KpDPeIQYfYrO1d1QoJ65Kkpvf1a+H/tZDHMUlVC0rK IY+EFBPPG6fprWNMVZdmmREZkslfBD5z0VeBmW0GCsKnKpVwiugz//Ib6WEMMoyrR3vf hoNdiBgbnTJHgv2oIlkJPkLZ8Fe5X9CL+lhPhkjZ5TOs2qR55EjHFDdlFNuU0jDurLVe mLmQ== 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 s15si690095eds.217.2019.11.06.20.59.10; Wed, 06 Nov 2019 20:59:10 -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 S1733214AbfKGE7I (ORCPT + 26 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(+) -- 2.7.4 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