Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp977147ybt; Wed, 17 Jun 2020 19:42:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLuihf4eM2yiOsb1p8k5bWMlVWFkc7A5J059N5Uliu2g178NXcLrP35z9lt7Zvx+pqCcBz X-Received: by 2002:a05:6402:b31:: with SMTP id bo17mr2098766edb.152.1592448134508; Wed, 17 Jun 2020 19:42:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592448134; cv=none; d=google.com; s=arc-20160816; b=j9lCJv1qiGdYDMC5OeeRg6sK5y9jO28CIVBRu5GNk4QXAPe1qkv19T74C7wbQrWh8I SfJAGUQX8Zxk45y9iDx1MOemZjvNaonSRI0Sx23L+8N5EBBO1NmrZkJcr8m7OtD8aQqN elpTfOG4ZiDDlNwmmdzVgSyiny5kZe9u9bLW6Io+PzpK77FoMY2NpuCc7QLKtU9y9NKJ B1iS6p2BvRx9rnq+PWy78B00bobNnzSuCHVeVfUDKmdU1F0xO3Bb733bXU1tqLbydxhF 3cbNvvvAfT59uX4BQedGm2rN3Thpygi7CDx/bUzOtNbOnq8qrr0DQTqlUbstCJCWqB6/ gogg== 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=Hm3GXnzQqDV1s6zHffadQuQ7fNtndXWR3j36MKN7dw8=; b=oJeqcRGytv3xPfAAbpkLZzKt0oF8ikk7Ats0rraK4Cdae5QK47g/UuZrBgRxkLaQGx sMgoiFClWwwLZV7HkNRKU+qjxfYy+ElonmftXQt3u7+UHP3uROy4nSJMPbZvhgx1ufyu iWy/6W7CsyXvBuqkkjC4h4LdqH72pWthnYrcTOHeenLZcvSoacCXKj9PRJyLbtEa0z9E czlhv1bPZlLotNgx36ws94kVGaTH5wcGwgqx1IZ6czR4AVKjSwRreZsH39upldbvJ+Nf pOBtYiKzQ26kNBV5ZC8alLajEGOGnaaKJzg+1JnIZvYqHXlczQWj9/YyM4FgIi6A/xRi Go9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Xy4urPlQ; 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 ds17si1322329ejc.619.2020.06.17.19.41.52; Wed, 17 Jun 2020 19:42:14 -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=Xy4urPlQ; 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 S2387825AbgFRCkO (ORCPT + 99 others); Wed, 17 Jun 2020 22:40:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:41540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728983AbgFRBMq (ORCPT ); Wed, 17 Jun 2020 21:12:46 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 271E920CC7; Thu, 18 Jun 2020 01:12:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592442765; bh=EErdMN8eKgwLm5pu88Mv/t1aZoo7WuwsMT7n55tqxVQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xy4urPlQc8UKHFK1qjMOG2lDva6peclOHmdk/WUmUthSemOV9NhIzUb3yaLLekvTP QbnBmmBRHvvVIWU+CAijPWFqdxio8JZcCCX4h+BUMg9NemYzeyNTzJdtFxNsDAio+y g8dYfGzXdywEI7kLhhhfWJzakeT+3rG5b8KSToBE= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?Marek=20Beh=C3=BAn?= , Remi Pommarel , Tomasz Maciej Nowak , Thomas Petazzoni , Gregory CLEMENT , Sasha Levin , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 214/388] arm64: dts: marvell: armada-37xx: Set pcie_reset_pin to gpio function Date: Wed, 17 Jun 2020 21:05:11 -0400 Message-Id: <20200618010805.600873-214-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200618010805.600873-1-sashal@kernel.org> References: <20200618010805.600873-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore 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 [ Upstream commit 715878016984b2617f6c1f177c50039e12e7bd5b ] 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 Tested-by: Tomasz Maciej Nowak Acked-by: Thomas Petazzoni Signed-off-by: Gregory CLEMENT Signed-off-by: Sasha Levin --- 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 @@ phy1: ethernet-phy@1 { /* 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 @@ &pcie0 { 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 0e0491ca2930..1452c821f8c0 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 @@ rtc@6f { }; }; -&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 @@ sdio_pins: sdio-pins { pcie_reset_pins: pcie-reset-pins { groups = "pcie1"; - function = "pcie"; + function = "gpio"; }; pcie_clkreq_pins: pcie-clkreq-pins { -- 2.25.1