Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1551743ybz; Thu, 30 Apr 2020 01:09:01 -0700 (PDT) X-Google-Smtp-Source: APiQypJF1fCl9RB1hs5YXFT4YQQO0Zvym4rsdSOZ4QVtLZJTHSTlrUiXbA2Soq/kDWGlV72gkLq7 X-Received: by 2002:a50:a685:: with SMTP id e5mr1403385edc.243.1588234140889; Thu, 30 Apr 2020 01:09:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588234140; cv=none; d=google.com; s=arc-20160816; b=rKIxZ7WegBUvcbBESqqqLEHfWEuiVW/vibqottaJlleoZxfLtyYs9I/shaWIRc073N D7o4mv35YO+3GfovHGwk+VV7AWKPtWISVyv5oqGdrYzaLgCWOanulprl7CcuhG64kblb +zKGNBzXP8lRB2Hugn/LDU/jyvfxFlMOmrpdBFaG8Otwix6FVPbtTC7++e2qOXEhSdmf IQTlLvv/5RQ0+dKhpf80RFSVz8qMIuIs1KzhC6z8sm17v1LWK2Mht9B9wniJymlGEY4/ ahksA4huoenWPPof/iHRG9VilImVIWfarJzrtMCYOERxeFeiAwIk1LmgdWYWSiXGvvAf O3lQ== 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=xoUiKp513EScZ2QmRvwuMWnbBfzWFg8U8fE/flE7HDQ=; b=R7LS+7hLwrkmEwRhJEObYGmR9RXyZnOAnZe9kAS7oXYgx/IlZFil64dceMwstt1+vy G+08Uwyams5rpmvsVWNh0yM+SJoIUB5rlrJRjje6e6jDu3CudFV7vqJVbmWaYjQwoWtv IGRNc2570/DTFwdsjswe9YXunU+D3HAnTWs64j+OYF3xNc7qaWana8k3ecHcwWoIyGRy ZstlwXbh51OHONrBeAuxmu09jxo0TQ5FqHWyP7ODGjBJwp+R/vTyTfqxj4hd0r4RmKpO JrOvJbJ1NL+F2ddS3kH2G9askfldMljIfjQziGUpO3Vt/2YfgW9uUL4CurdP8Fb5HrB6 d/vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PTE8z5n3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y23si5037182edt.99.2020.04.30.01.08.37; Thu, 30 Apr 2020 01:09:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PTE8z5n3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727052AbgD3IGz (ORCPT + 99 others); Thu, 30 Apr 2020 04:06:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:51360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726974AbgD3IGx (ORCPT ); Thu, 30 Apr 2020 04:06:53 -0400 Received: from pali.im (pali.im [31.31.79.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CEF1E21D79; Thu, 30 Apr 2020 08:06:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588234012; bh=1PYNEt190Z62zeHSDG7STCys/SF2sPoEg3fmOsXgLm8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PTE8z5n3Iae5cHSULbAFG6ux2CbZZ37h0nZxZrPnVRSrK7XCnUWfBX8YZTvL9fVBn QSCRXrwBlsWjSkSr4QDy91i9S/UzVocr7MW1aSIa8BTP6/f21nqBrHIeIb3hdpylIU Oz1/lG3tD8G2fUQZlUemoR0Q9cLZABsdYa3+h4O0= Received: by pali.im (Postfix) id 0F486A19; Thu, 30 Apr 2020 10:06:50 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Jason Cooper , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Rob Herring , Thomas Petazzoni , Lorenzo Pieralisi , Andrew Murray , Bjorn Helgaas , Remi Pommarel , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Tomasz Maciej Nowak , Xogium Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v4 10/12] arm64: dts: marvell: armada-37xx: Set pcie_reset_pin to gpio function Date: Thu, 30 Apr 2020 10:06:23 +0200 Message-Id: <20200430080625.26070-11-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430080625.26070-1-pali@kernel.org> References: <20200430080625.26070-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek BehĂșn We found out that we are unable to control the PERST# signal via the default pin dedicated to be PERST# pin (GPIO2[3] pin) on A3700 SOC when this pin is in EP_PCIE1_Resetn mode. There is a register in the PCIe register space called PERSTN_GPIO_EN (D0088004[3]), but changing the value of this register does not change the pin output when measuring with voltmeter. We do not know if this is a bug in the SOC, or if it works only when PCIe controller is in a certain state. Commit f4c7d053d7f7 ("PCI: aardvark: Wait for endpoint to be ready before training link") says that when this pin changes pinctrl mode from EP_PCIE1_Resetn to GPIO, the PERST# signal is asserted for a brief moment. So currently the situation is that on A3700 boards the PERST# signal is asserted in U-Boot (because the code in U-Boot issues reset via this pin via GPIO mode), and then in Linux by the obscure and undocumented mechanism described by the above mentioned commit. We want to issue PERST# signal in a known way, therefore this patch changes the pcie_reset_pin function from "pcie" to "gpio" and adds the reset-gpios property to the PCIe node in device tree files of EspressoBin and Armada 3720 Dev Board (Turris Mox device tree already has this property and uDPU does not have a PCIe port). Signed-off-by: Marek BehĂșn Cc: Remi Pommarel --- arch/arm64/boot/dts/marvell/armada-3720-db.dts | 3 +++ arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi | 1 + arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts | 4 ---- arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm64/boot/dts/marvell/armada-3720-db.dts b/arch/arm64/boot/dts/marvell/armada-3720-db.dts index f2cc00594d64..3e5789f37206 100644 --- a/arch/arm64/boot/dts/marvell/armada-3720-db.dts +++ b/arch/arm64/boot/dts/marvell/armada-3720-db.dts @@ -128,6 +128,9 @@ /* CON15(V2.0)/CON17(V1.4) : PCIe / CON15(V2.0)/CON12(V1.4) :mini-PCIe */ &pcie0 { + pinctrl-names = "default"; + pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>; + reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>; status = "okay"; }; diff --git a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi index 42e992f9c8a5..c92ad664cb0e 100644 --- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi +++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi @@ -47,6 +47,7 @@ phys = <&comphy1 0>; pinctrl-names = "default"; pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>; + reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>; }; /* J6 */ diff --git a/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts b/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts index bb42d1e6a4e9..e496bd9d4737 100644 --- a/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts +++ b/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts @@ -128,10 +128,6 @@ }; }; -&pcie_reset_pins { - function = "gpio"; -}; - &pcie0 { pinctrl-names = "default"; pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>; diff --git a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi index 000c135e39b7..7909c146eabf 100644 --- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi +++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi @@ -317,7 +317,7 @@ pcie_reset_pins: pcie-reset-pins { groups = "pcie1"; - function = "pcie"; + function = "gpio"; }; pcie_clkreq_pins: pcie-clkreq-pins { -- 2.20.1