Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1148714lqb; Thu, 18 Apr 2024 01:13:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXnUKMTND/dHQHEbsL+zm0e6nsPb7fBX9tqo/Sr0xHKINVFHuSsHEyqA8snsG7kEHeebzVvtU3lQ1kBOxxP4vEENWvb9n1suYBBe9b/1A== X-Google-Smtp-Source: AGHT+IEH5ghDDABnRhmDZrQo3DzhbGPSOJrSMt1haa5lkYdQmW4wajyU+EFV1SiH7k39lj5pmK/A X-Received: by 2002:a50:cd0a:0:b0:56e:3571:189c with SMTP id z10-20020a50cd0a000000b0056e3571189cmr1510746edi.18.1713427988401; Thu, 18 Apr 2024 01:13:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713427988; cv=pass; d=google.com; s=arc-20160816; b=dB1W9CCt5sQ1TlBuggp7ZCphUhgWDOmvvpLSVVLAdnvrksYbTRpRTPFPy5iIBvPuNg /dt7s3Q329o2DRojCGcq+BBcxk3EEojHzr87iNBHWwF5p+eKpvrBhDVcCNvwfHazpMjB C+RQaGLDCxGVw2xstSg3a3DraFTqixtMoD6hTGa2CvSiE6eX6xYZTzNd1s0wh/0yleZp leZ4WCEAY/X7WZx+id/nagZ6C8EvYXdM+YhZL8usTpwKuH7P9wzqE6FzTQDQDysbtt9O Gozy+G9X/xdnAJgP0jLiwiWybb6XV13UBgK6u3Fb2KCkPe/siG90j57swME4LdK9PNPO E09w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=oSocKNmm0jNMLUEulHPej/B22GIXSXBudvO4Ao+R0rE=; fh=AT1mpWfEXiY0KDBktqdD3jyQFUTOJgjj22uP6N2Oip4=; b=kyJ6cCSCzt2cp97w5ecUhb0VlRaiNYAil9pb03ljelfvo3lTt8xDF4ocmcNPffqyKq 02jztlaz5W/UhXgQ3x1KGmzo6WsYhSlQxBu4/S/5Hp2GNu78gjvKZ2LSZzg7OwMKlo8O JMfZ18d9DulG+QfwPBIWoITrcBUh1OcI3fHoDe1A10Y4ZLor7Z6qE9T79jprfhcr9IGe e4Vw0lUdHl8VP0lTwERF3cZC6ctYrAEV9hEkHJ418aDVcLUmsNY31XCQ1Kdwqy6UtIzZ 7ShhDAF0+AkXQGQlz/8QGyfLenkl6Qc6Jcb7Yke3jVFAbv8shZTMCs9PLYekLgOzQG4y pD7g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sntech.de dmarc=pass fromdomain=sntech.de); spf=pass (google.com: domain of linux-kernel+bounces-149696-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149696-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id z5-20020aa7d405000000b0056e2c60123esi555285edq.26.2024.04.18.01.13.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 01:13:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149696-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sntech.de dmarc=pass fromdomain=sntech.de); spf=pass (google.com: domain of linux-kernel+bounces-149696-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149696-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 236951F219D1 for ; Thu, 18 Apr 2024 08:13:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 578047D3EC; Thu, 18 Apr 2024 08:13:02 +0000 (UTC) Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3D607D09A for ; Thu, 18 Apr 2024 08:12:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.11.138.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713427981; cv=none; b=sYQPd1O0OjFSnHElLvqgIfOo5TUrQqSiygoaqBh0h8lkMDX3qyEvduirm7ZFLoyoWXEi5UyY1LevPQvTLsB/mDpcE4b1VxnsrgUr7RohHDjKSoFCqpu047C+9qvQMA+a/3Zh9Uj98NpcPi7tQIyBuS3WTokH4al8jopsRyFaf14= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713427981; c=relaxed/simple; bh=a1lDZyQcKMG8tu88vZXH92dfxB+K0HC43vvv9bgkkGI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PHz+7njcAMJ00WrfgqLxFxR58QI12U1XOf7z9266phq1LfFyQ0/lro9Tn89AaKUkDKuIL/gyjCVWz+ac0pwdpUoMWDVl/s+i6JeOatejeac6HJWn5Uas7M0fgh/mwnXByFRDFhTMr+Lgu8G+G/R6kB3Q85kDzJOjxKoxtXgX3+g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de; spf=pass smtp.mailfrom=sntech.de; arc=none smtp.client-ip=185.11.138.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sntech.de Received: from i5e861917.versanet.de ([94.134.25.23] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rxMt5-0004Xm-Bg; Thu, 18 Apr 2024 10:12:55 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Quentin Schulz Cc: linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Heiko Stuebner Subject: Re: [PATCH] arm64: dts: rockchip: add PCIe3 support on rk3588-jaguar Date: Thu, 18 Apr 2024 10:12:54 +0200 Message-ID: <5932394.MhkbZ0Pkbq@diego> In-Reply-To: References: <20240417141642.2243193-1-heiko@sntech.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Am Donnerstag, 18. April 2024, 10:07:37 CEST schrieb Quentin Schulz: > On 4/17/24 16:16, Heiko Stuebner wrote: > > From: Heiko Stuebner > > > > The Jaguar SBC provides a M.2 slot connected to the pcie3 controller. > > In contrast to a number of other boards the pcie-refclk is gpio-controlled, > > so the necessary clock is added to the list of pcie3 clocks. > > > > Signed-off-by: Heiko Stuebner > > --- > > .../arm64/boot/dts/rockchip/rk3588-jaguar.dts | 53 +++++++++++++++++++ > > 1 file changed, 53 insertions(+) > > > > diff --git a/arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts b/arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts > > index 5002105dc78e..908fbabd8b00 100644 > > --- a/arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts > > +++ b/arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts > > @@ -72,6 +72,25 @@ led-1 { > > }; > > }; > > > > + /* > > + * 100MHz reference clock for PCIe peripherals from PI6C557-05BLE > > + * clock generator. > > + * The clock output is gated via the OE pin on the clock generator. > > + * This is modeled as a fixed-clock plus a gpio-gate-clock. > > + */ > > + pcie_refclk_gen: pcie-refclk-gen-clock { > > + compatible = "fixed-clock"; > > + #clock-cells = <0>; > > + clock-frequency = <1000000000>; > > + }; > > + > > + pcie_refclk: pcie-refclk-clock { > > + compatible = "gpio-gate-clock"; > > + clocks = <&pcie_refclk_gen>; > > + #clock-cells = <0>; > > + enable-gpios = <&gpio0 RK_PC6 GPIO_ACTIVE_LOW>; /* PCIE30X4_CLKREQN_M0 */ > > I think we usually want to have the pinctrl for GPIOs as well to not > assume the pins are muxed in that function by default or by the bootloader? > > > + }; > > + > > pps { > > compatible = "pps-gpio"; > > gpios = <&gpio0 RK_PD5 GPIO_ACTIVE_HIGH>; > > @@ -466,6 +485,40 @@ &pcie2x1l0 { > > status = "okay"; > > }; > > > > +&pcie30phy { > > + status = "okay"; > > +}; > > + > > +&pcie30x4m0_pins { > > I'm wondering if it really makes sense to reuse this node if we're > planning to change the only property it has to mean something different? ok, will create a specific node for the new pinctrl As an added pro, this also moves it to the pinctrl area in the dts > > + /* > > + * pcie30x4_clkreqn_m0 is used by the refclk generator > > + * pcie30x4_perstn_m0 is used as via the reset-gpio > > + */ > > + rockchip,pins = > > + /* pcie30x4_waken_m0 */ > > + <0 RK_PC7 12 &pcfg_pull_none>; > > +}; > > + > > +&pcie3x4 { > > + /* > > + * The board has a gpio-controlled "pcie_refclk" generator, > > + * so add it to the list of clocks. > > + */ > > + clocks = <&cru ACLK_PCIE_4L_MSTR>, <&cru ACLK_PCIE_4L_SLV>, > > + <&cru ACLK_PCIE_4L_DBI>, <&cru PCLK_PCIE_4L>, > > + <&cru CLK_PCIE_AUX0>, <&cru CLK_PCIE4L_PIPE>, > > + <&pcie_refclk>; > > + clock-names = "aclk_mst", "aclk_slv", > > + "aclk_dbi", "pclk", > > + "aux", "pipe", > > + "ref"; > > + pinctrl-names = "default"; > > + pinctrl-0 = <&pcie30x4m0_pins>; > > + reset-gpios = <&gpio0 RK_PD0 GPIO_ACTIVE_HIGH>; /* PCIE30X4_PERSTN_M0 */ > > Ditto, I assume we want to have a pinmux for that GPIO as well? Correct. While the Rockchip pinctrl driver _does_ the muxing when a gpio is requested, it wouldn't touch pinconf settings u-boot or whoever might have set differently before. Heiko