Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp653354lqb; Wed, 17 Apr 2024 07:16:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXhVt2VPeU1ZS9Vzv8BY1Xv3coGedGuX/tnEZiszh+4jYzpKVrJx1NFplKqDkzJKkHdGwlXLaFODvJOBw9JaRJOdo0GtOl27YsyO/keAA== X-Google-Smtp-Source: AGHT+IE/Os+iENmePRUXE2dLOIae6fZh8jyQfKwGCTSdLNoEI74qTxe4/kKP1s/lrfTWCFDfjw9P X-Received: by 2002:a17:90a:1190:b0:2a2:d48:9d50 with SMTP id e16-20020a17090a119000b002a20d489d50mr15080484pja.44.1713363416744; Wed, 17 Apr 2024 07:16:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713363416; cv=pass; d=google.com; s=arc-20160816; b=qXrPreHwB4KYpXkuy0DVM5J33QCZZ3pgkMGr6Ib3QX51qoJQV+RJPWcWLlRMsI090Q kEjnAFQBn2r32A5ODbDW8qlVhyGh3l42gkigNEJEwb67yCRFGuVu0HkoNadkflNZ62yr FQTlo6B+Rll4jdjuAP/a7v6tR48flI7/AAA8Hy/94TNPvbjea9YIopffmMIDrEzfg11B WiDk8EQ6OZsfZX192SWKqCEycjUe51J3Y3XodE8UdTM1F1oPG44MoeFUGbN2Ppofbr4u JTa1CNumvowbpuZ4WBnRqT3O+yBqvhWQbNY1OMqRkk/2d4Xz0M5y+bX5RJoLTBlC/jPI yCRQ== 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:message-id:date:subject:cc:to :from; bh=djiXwVSjQTJJ9uwcHBDm8kN8CDKOaaZAt0HWBhJWhCw=; fh=5sGA35n7zigtFlmq1mADrfJQ3jGu/uSz/HAiY46yR+s=; b=i0+W79/K4JRbDaXL2iqjBJMVlJTF6xyM6YQYhkow+wAtWG0YJgNNAN2XGHh7yhJR7A 31tHU4P2UKe4dewBWqjUkvapxRcP2Zza5jHorpEtr7xek0tDhKanAYaDwbB+lBznfymY /b0dJDh+k0F1c7Sg/XMuZfCKjMlmROCILvqD2d5CWqbPKawrqwA8r1Op1n3OtQc7oNrp RjY4eYQpqpQyooRY7Kmg6O80SRlQIhqlkZlvfQ+IfMhmaihoxCO4hXMrlA4LbWzNniM+ WTS5i4TCA7cnvNyZoyzlfDNWy+Zre8zV4SIZcjXCBwNar0+a0LGjBYR0gf0l5PR4Ph7K YMEQ==; 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-148664-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148664-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id b24-20020a17090acc1800b002a9f7b48feasi1313819pju.151.2024.04.17.07.16.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 07:16:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148664-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-148664-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148664-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6ECB6282EA0 for ; Wed, 17 Apr 2024 14:16:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26D0B1411E7; Wed, 17 Apr 2024 14:16:52 +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 973D1140397 for ; Wed, 17 Apr 2024 14:16:48 +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=1713363411; cv=none; b=WWA/X8M6wV2V+j7XccPLR7VGi92zDi0WpJPul+i+YeUxOA2Lg/acqxrxr4FPvB/wTUn7r7mAP7OJVKD8joNnKdt8EB9OK6WUdF328ghv9Naq6axh1JkMOVW8WlD0iaz0Cq4m/f1XTuUKQyPiiY3lO32EYQlnRCFmsVTy9knvvRg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713363411; c=relaxed/simple; bh=osq/0yl1rbJ03d+zBaWyiwuurKQIcrxcS59wyj56nQI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=sL/kWrTSN7SPJJ8lUiQ9dW2TVSwTJzVKwBR+QYgrRIUIR9YdXtmTNtkLX9iV+TLW3B49Tsda+8x1yOCGPspaRtcYC8wK3DmmXtf/Tf+qBsn+7iL8eTt+eZlmRV75eybRmE+EMCDvg3cI8meEy+sQfO1LTxYB/9xsVzqP0qLE5ro= 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 i5e8616c3.versanet.de ([94.134.22.195] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rx65c-0003sM-KV; Wed, 17 Apr 2024 16:16:44 +0200 From: Heiko Stuebner To: heiko@sntech.de Cc: quentin.schulz@theobroma-systems.com, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Heiko Stuebner Subject: [PATCH] arm64: dts: rockchip: add PCIe3 support on rk3588-jaguar Date: Wed, 17 Apr 2024 16:16:42 +0200 Message-Id: <20240417141642.2243193-1-heiko@sntech.de> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 */ + }; + pps { compatible = "pps-gpio"; gpios = <&gpio0 RK_PD5 GPIO_ACTIVE_HIGH>; @@ -466,6 +485,40 @@ &pcie2x1l0 { status = "okay"; }; +&pcie30phy { + status = "okay"; +}; + +&pcie30x4m0_pins { + /* + * 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 */ + vpcie3v3-supply = <&vcc3v3_mdot2>; + status = "okay"; +}; + &pinctrl { emmc { emmc_reset: emmc-reset { -- 2.39.2