Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1282585lqb; Thu, 18 Apr 2024 05:48:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVACVMR6dLgJrP3U6iMWeKb9FczMpUM3TnWpDQd4b33nKHaigsPl3jSEJTTLwoUeOyTnckJjtbowifnVQKHjlOJqohw1h3+CX0DV4Gkbw== X-Google-Smtp-Source: AGHT+IE+pEB2vN82N7PW+PWBOZ1N6eR6uJ3sYmYDoQRd3FZbEmUrFO2etBK9q0LOGac1//k6RdRd X-Received: by 2002:a05:690c:6691:b0:61a:ef8f:a9fd with SMTP id hz17-20020a05690c669100b0061aef8fa9fdmr2984797ywb.15.1713444538054; Thu, 18 Apr 2024 05:48:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713444538; cv=pass; d=google.com; s=arc-20160816; b=gsZAmyEzH6Oxolh6IHdKO7nnaKmnUAYjk9675XzwK7o6024OXc7eOBw/AP2AWpWUAn 8S85MfyAlSp0lYuEhZBvbrd/+V9nZ0uaT0FIRt1ArrWxDoGsu5PY4e2HgQsPshXfiyoy aHEXlbZFWizjpE4CinBYAexbDPnuk7RnVpVUqKRcKI1zdSHrwPaNUjWIzzffuBVb/xCm RZKSKNVXfKlD++Xtug1zmSi+nN/0hBXntQPPTr33V9JcjMUEoKL1GgDUF0W4UVjwfmiI kMPPWRRPaA3mDDEKqELVHc93IoToV92pmdGSmWil7VqCAvBO2iK6FVeRIBrvLe2l+eKj Hv0Q== 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=ccz4qrdjSz+6z+1lEnS/0pR1RoHUe7vZJyDEhF/dQDI=; fh=UBNqWECPOYNaP+fszrw/wHUf/YuCCtg9290tK6WeF5I=; b=ErMKXVh+vO4rU4G1uXcESEbYAFL2XreXGQZm81eeJ1/0Rr1ZHRAYBXMA+RcgbI/HUd H/5CzcV3l/zy1yVxSY3MlthDOwVo54aiGFVLenTyOjEgwWcDHhgQx8AwjjA7/fxWu5Nx jH2iS+1by3PwlasVPtPyoiEMpRxMrImetVVZvdWYooaKiyXTwDbHP8uC+QZ4rKkXy6UD SvTYR/5OpDZ/uriRw4MgMaWXQezoep4mA+c/jXsTVUYLAtugS6uzCRLdXWAwTyB32618 EZsuBy6ZRYD2/c8jP9PHHKAHoEhBrWHOK5zdAsMM3zN3xI4NyAPXrKGtu43VgJy8U9jy UBdQ==; 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-150093-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150093-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id w19-20020a05622a135300b0043785904306si1385404qtk.142.2024.04.18.05.48.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 05:48:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150093-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; 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-150093-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150093-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B4B7B1C21B2E for ; Thu, 18 Apr 2024 12:48:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6517115FA88; Thu, 18 Apr 2024 12:45:07 +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 B0A7C12FF75 for ; Thu, 18 Apr 2024 12:45:02 +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=1713444306; cv=none; b=L/vMv7GvS/z5MJrK66bkP0RWw9KJX4rl3lnIQGfWPht9mpjhAkpEBagf0i3589FEE4+HxC00i2zEyqf8/a50AiaVXfzadNge0YV8IURo6Zk0NFax/aexw96UGMkN1QcsiIak+En5rPv5zgmz1wJiWtkPilaXom5i4i6eLD4k0bs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713444306; c=relaxed/simple; bh=BX//LDamhCsN5RO0/Ar3nYwJvwCqv29g1oqAqiuZ1x4=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=naOgrWkQQ1OWIyGoYlKS2OfAn1evPI5DmlD5IvlWK82h63C0GOJeIzSzS/1nurCh54528RL6pnskeaJW62yunLZp+fojzAQW3Jze62pWDZ2joc38/i/ZGWREA/9fqLqKHqEMAN+YGGiMPg3ENSg9dxdOwSuNVD9ePawTwyKiPcg= 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=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 1rxR8H-0006mk-Bn; Thu, 18 Apr 2024 14:44:53 +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, dsimic@manjaro.org, Heiko Stuebner Subject: [PATCH v2] arm64: dts: rockchip: add PCIe3 support on rk3588-jaguar Date: Thu, 18 Apr 2024 14:44:45 +0200 Message-Id: <20240418124445.2360491-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 an 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 and is added to the list of pcie3 clocks. Signed-off-by: Heiko Stuebner --- changes in v2: - "an" M.2 slot (Dragan) - pinctrl for refclk-en and reset pin (Quentin) - don't repurpose the pcie30x4_pins pinctrl entry for only wake (Quentin) .../arm64/boot/dts/rockchip/rk3588-jaguar.dts | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts b/arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts index 4076c92668ba..3407e777e97b 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts @@ -72,6 +72,27 @@ 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 */ + pinctrl-names = "default"; + pinctrl-0 = <&pcie30x4_clkreqn_m0>; + }; + pps { compatible = "pps-gpio"; gpios = <&gpio0 RK_PD5 GPIO_ACTIVE_HIGH>; @@ -358,6 +379,30 @@ &pcie2x1l0 { status = "okay"; }; +&pcie30phy { + status = "okay"; +}; + +&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 = <&pcie30x4_waken_m0 &pcie30x4_perstn_m0>; + reset-gpios = <&gpio0 RK_PD0 GPIO_ACTIVE_HIGH>; /* PCIE30X4_PERSTN_M0 */ + vpcie3v3-supply = <&vcc3v3_mdot2>; + status = "okay"; +}; + &pinctrl { emmc { emmc_reset: emmc-reset { @@ -376,6 +421,25 @@ led1_pin: led1-pin { rockchip,pins = <1 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>; }; }; + + pcie30x4 { + pcie30x4_clkreqn_m0: pcie30x4-clkreqn-m0 { + rockchip,pins = <0 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + pcie30x4_perstn_m0: pcie30x4-perstn-m0 { + rockchip,pins = <0 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + pcie30x4_waken_m0: pcie30x4-waken-m0 { + /* + * pcie30x4_clkreqn_m0 is used by the refclk generator + * pcie30x4_perstn_m0 is used as via the reset-gpio + * So only pcie30x4_waken_m0 is used. + */ + rockchip,pins = <0 RK_PC7 12 &pcfg_pull_none>; + }; + }; }; &saradc { -- 2.39.2