From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3D5DACD98DC for ; Thu, 13 Nov 2025 21:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CvtAxB0gMO+lKEQ8/XoUYvO3UK6Xe2PuN8Brww3O5oA=; b=MwoSWTVH71Jq8+ lmUpMKyYVCqmZbb0wY/F6oMSuxq0vHubaQVu38IfzxiD6LPJhLg30r41oTys6iHsDJPEzA9kVCU64 YGiZ5955On0xYx2q2acIYEDhfJHga0REms39/AWLlM7FKO62+xo5y4Z3zXepq2DBELiQesBGGglvp tAIbgWvJBCRWoBT97XcRyzQ2SO1Al4GBfzq254elN7+52JUmgkqDF7olsNqm3xkm9EalDM0XurvpG mKkmThgU3gX1pmIPtnlG04Id4D4OE3GCOsR4l/uo03y1CUVvHLC28P6mlMw8lh5nyy3CX8KEH/Ox8 88KKew2e88+yU5SvALxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vJf8j-0000000B9Li-2ERx; Thu, 13 Nov 2025 21:46:01 +0000 Received: from mail-io1-xd29.google.com ([2607:f8b0:4864:20::d29]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vJf8g-0000000B9IA-3xce for linux-riscv@lists.infradead.org; Thu, 13 Nov 2025 21:46:00 +0000 Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-9487e2b95f1so57564939f.2 for ; Thu, 13 Nov 2025 13:45:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20230601.gappssmtp.com; s=20230601; t=1763070358; x=1763675158; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=deRuCrhbg73yoYSTX7ZbEzVdWXcb3YNjOYMcREzS1gQ=; b=N5Qv4lxob/68/QS3Bx4x521MY955u6UKclz8JmOoXlBgUjbECFwiD/JzK+bTpYEdVF EFj9XuGqDJSPd7e3JaxJnYdB+1UES/QUGPOKafPCUek54Cj63qxllUlhoV51o+iMsFfm 8wqvJLIyC+J7cVLnv8eG0PKpC1mNzNO7ldmhaVgviblzvQi7moISXuH0ss9XiusqOfVK 2Nal2L+cVFD40So+hpCuK5zdeYz6cYxHJYv/316aiOra2UtdfuPTLsgle8W9ziWmHQIm HWY20QpYZIU4fRRzEEGJmHcR+YjAJCPg/Yiv33HRzRKE8f6L3P4LQb8Mdec2uu/DdEu9 /cYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763070358; x=1763675158; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=deRuCrhbg73yoYSTX7ZbEzVdWXcb3YNjOYMcREzS1gQ=; b=Wb+cQlwoDyE7oQteGcj7P0H0Jc4PvRkiM9m0RoIlLY3T3eIlTktJ0637sC3vVEX1YF ocRfqZAzcWKn23GsjD2sRiFjtr8rXqe2sSEZ+M7ZX4J8RyXhqQTzWy5UN2UiXb54AGxF K5HzPGFL2BWXAxd+aJ0IJVZBzCICoHQKGQ9OC6kXpJaCo1185SmRtJODLqOTNGnNX1CS ms4ZLHh16RqQXE72aw6Ck8WTde05D7QkfC1aGnUP7krP7Vzko7TaQpKgZ6ihcrmsvkeq moMt0rmMSuKBUZNmODZq9QPpOOmrKzXZDh+XI9UiFvXfafFwHAfuaZiXw6FH+/VfVXgE T99w== X-Forwarded-Encrypted: i=1; AJvYcCUMnWF6rGPcfqo70pK3BuWTbZRu6kok9fWxIuHCUWE0qjKS8oPCX3Nz6jkiMDa2K5iNymuLPxRGXR8A8Q==@lists.infradead.org X-Gm-Message-State: AOJu0Yw3c4h4dFS0LQNjiXc1q8S6YIpDm/OQKR9/tmA6RL2G14b16rnm DvFOiWhkRQdZJaqIXKC+Tmtkef1EniHrZIe56iZMAXw9xOeRiJtfOD9l+7tXJE90XlA= X-Gm-Gg: ASbGncsvDy5oyju35cqamnmw3MMgWxwYjkAJ+9H6fy+DiQjHIn1kYgDRGL6xe/wvq8j 6rFOcUn2gYhJuHoc41i2zBLlRXyFInLGsA5HyVtSIFkk7wTqS4imG+S8juBp2u4PtwL1Og9bCJq wkDe0ekf0uZSFoQbEqAJR8NnYyPLej8QshV/UQyBVgELlmo1u1Oe/nxyjPFRSz1bqQvnV5aUGKb fXOP46khnd/etypPH+pB63Hr1g5Wlq6dGCt5bY9XaStOXHyajbndrms1qB17rSHmyWSVB7IP7bY oVZjZZYCkXs73dKiB4CpnevB8SaDPTdSbjzVXSAB+ft83yc9+/8Bkj0cMZE56jUOhAXhSzE7dqO DANmfN8FHfMpkAjskl4u8QkpElPQFbcmkOtQmdjQvXlOydqo5bEv2yrgX2vJ68WzP/adMzD7f86 j32qsOe8Mwo0HLanKfDyEFbO6df6gA9UrSyQvrAEnkyYOH1zMXxl/tzbPo0iEhqPEk X-Google-Smtp-Source: AGHT+IEvguf6tBlTrnNH3WYTCFykO/NToGvTaWWLy0FsWmSPv03pSe9jJlt9kRkNhm10ZfiEVXgJMw== X-Received: by 2002:a92:cda5:0:b0:434:767d:8a3f with SMTP id e9e14a558f8ab-4348c942b89mr16005835ab.21.1763070357875; Thu, 13 Nov 2025 13:45:57 -0800 (PST) Received: from zippy.localdomain (c-75-72-117-212.hsd1.mn.comcast.net. [75.72.117.212]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-434839a4ac7sm10877115ab.25.2025.11.13.13.45.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Nov 2025 13:45:57 -0800 (PST) From: Alex Elder To: dlan@gentoo.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, guodong@riscstar.com, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v6 7/7] riscv: dts: spacemit: PCIe and PHY-related updates Date: Thu, 13 Nov 2025 15:45:39 -0600 Message-ID: <20251113214540.2623070-8-elder@riscstar.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20251113214540.2623070-1-elder@riscstar.com> References: <20251113214540.2623070-1-elder@riscstar.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251113_134559_001155_B4B5DF25 X-CRM114-Status: GOOD ( 11.82 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Define PCIe and PHY-related Device Tree nodes for the SpacemiT K1 SoC. Enable the combo PHY and the two PCIe-only PHYs on the Banana Pi BPI-F3 board. The combo PHY is used for USB on this board, and that will be enabled when USB 3 support is accepted. The combo PHY must perform a calibration step to determine configuration values used by the PCIe-only PHYs. As a result, it must be enabled if either of the other two PHYs is enabled. Signed-off-by: Alex Elder --- .../boot/dts/spacemit/k1-bananapi-f3.dts | 36 ++++ arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 33 ++++ arch/riscv/boot/dts/spacemit/k1.dtsi | 176 ++++++++++++++++++ 3 files changed, 245 insertions(+) diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts index 71f48454ba47c..3f10efd925dc8 100644 --- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts +++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts @@ -61,6 +61,12 @@ reg_vcc_4v: vcc-4v { }; }; +&combo_phy { + pinctrl-names = "default"; + pinctrl-0 = <&pcie0_3_cfg>; + status = "okay"; +}; + &emmc { bus-width = <8>; mmc-hs400-1_8v; @@ -272,6 +278,36 @@ dldo7 { }; }; +&pcie1_phy { + pinctrl-names = "default"; + pinctrl-0 = <&pcie1_3_cfg>; + status = "okay"; +}; + +&pcie1_port { + phys = <&pcie1_phy>; +}; + +&pcie1 { + vpcie3v3-supply = <&pcie_vcc_3v3>; + status = "okay"; +}; + +&pcie2_phy { + pinctrl-names = "default"; + pinctrl-0 = <&pcie2_4_cfg>; + status = "okay"; +}; + +&pcie2_port { + phys = <&pcie2_phy>; +}; + +&pcie2 { + vpcie3v3-supply = <&pcie_vcc_3v3>; + status = "okay"; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_2_cfg>; diff --git a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi index e922e05ff856d..b13dcb10f4d66 100644 --- a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi +++ b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi @@ -530,6 +530,39 @@ uart9-2-pins { }; }; + pcie0_3_cfg: pcie0-3-cfg { + pcie0-3-pins { + pinmux = , /* PERST# */ + , /* WAKE# */ + ; /* CLKREQ# */ + + bias-pull-up = <0>; + drive-strength = <21>; + }; + }; + + pcie1_3_cfg: pcie1-3-cfg { + pcie1-3-pins { + pinmux = , /* PERST# */ + , /* WAKE# */ + ; /* CLKREQ# */ + + bias-pull-up = <0>; + drive-strength = <21>; + }; + }; + + pcie2_4_cfg: pcie2-4-cfg { + pcie2-4-pins { + pinmux = , /* PERST# */ + , /* WAKE# */ + ; /* CLKREQ# */ + + bias-pull-up = <0>; + drive-strength = <21>; + }; + }; + pwm14_1_cfg: pwm14-1-cfg { pwm14-1-pins { pinmux = ; diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spacemit/k1.dtsi index 7818ca4979b6a..86d1db14e2ee4 100644 --- a/arch/riscv/boot/dts/spacemit/k1.dtsi +++ b/arch/riscv/boot/dts/spacemit/k1.dtsi @@ -4,6 +4,7 @@ */ #include +#include /dts-v1/; / { @@ -423,6 +424,52 @@ i2c5: i2c@d4013800 { status = "disabled"; }; + combo_phy: phy@c0b10000 { + compatible = "spacemit,k1-combo-phy"; + reg = <0x0 0xc0b10000 0x0 0x1000>; + clocks = <&vctcxo_24m>, + <&syscon_apmu CLK_PCIE0_DBI>, + <&syscon_apmu CLK_PCIE0_MASTER>, + <&syscon_apmu CLK_PCIE0_SLAVE>; + clock-names = "refclk", + "dbi", + "mstr", + "slv"; + resets = <&syscon_apmu RESET_PCIE0_GLOBAL>, + <&syscon_apmu RESET_PCIE0_DBI>, + <&syscon_apmu RESET_PCIE0_MASTER>, + <&syscon_apmu RESET_PCIE0_SLAVE>; + reset-names = "phy", + "dbi", + "mstr", + "slv"; + #phy-cells = <1>; + spacemit,apmu = <&syscon_apmu>; + status = "disabled"; + }; + + pcie1_phy: phy@c0c10000 { + compatible = "spacemit,k1-pcie-phy"; + reg = <0x0 0xc0c10000 0x0 0x1000>; + clocks = <&vctcxo_24m>; + clock-names = "refclk"; + resets = <&syscon_apmu RESET_PCIE1_GLOBAL>; + reset-names = "phy"; + #phy-cells = <0>; + status = "disabled"; + }; + + pcie2_phy: phy@c0d10000 { + compatible = "spacemit,k1-pcie-phy"; + reg = <0x0 0xc0d10000 0x0 0x1000>; + clocks = <&vctcxo_24m>; + clock-names = "refclk"; + resets = <&syscon_apmu RESET_PCIE2_GLOBAL>; + reset-names = "phy"; + #phy-cells = <0>; + status = "disabled"; + }; + syscon_apbc: system-controller@d4015000 { compatible = "spacemit,k1-syscon-apbc"; reg = <0x0 0xd4015000 0x0 0x1000>; @@ -969,6 +1016,135 @@ pcie-bus { #size-cells = <2>; dma-ranges = <0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>, <0x0 0xb8000000 0x1 0x38000000 0x3 0x48000000>; + pcie0: pcie@ca000000 { + device_type = "pci"; + compatible = "spacemit,k1-pcie"; + reg = <0x0 0xca000000 0x0 0x00001000>, + <0x0 0xca300000 0x0 0x0001ff24>, + <0x0 0x8f000000 0x0 0x00002000>, + <0x0 0xc0b20000 0x0 0x00001000>; + reg-names = "dbi", + "atu", + "config", + "link"; + #address-cells = <3>; + #size-cells = <2>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x8f002000 0x0 0x00100000>, + <0x02000000 0x0 0x80000000 0x0 0x80000000 0x0 0x0f000000>; + interrupts = <141>; + interrupt-names = "msi"; + clocks = <&syscon_apmu CLK_PCIE0_DBI>, + <&syscon_apmu CLK_PCIE0_MASTER>, + <&syscon_apmu CLK_PCIE0_SLAVE>; + clock-names = "dbi", + "mstr", + "slv"; + resets = <&syscon_apmu RESET_PCIE0_DBI>, + <&syscon_apmu RESET_PCIE0_MASTER>, + <&syscon_apmu RESET_PCIE0_SLAVE>; + reset-names = "dbi", + "mstr", + "slv"; + spacemit,apmu = <&syscon_apmu 0x03cc>; + status = "disabled"; + + pcie0_port: pcie@0 { + device_type = "pci"; + compatible = "pciclass,0604"; + reg = <0x0 0x0 0x0 0x0 0x0>; + bus-range = <0x01 0xff>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + }; + }; + + pcie1: pcie@ca400000 { + device_type = "pci"; + compatible = "spacemit,k1-pcie"; + reg = <0x0 0xca400000 0x0 0x00001000>, + <0x0 0xca700000 0x0 0x0001ff24>, + <0x0 0x9f000000 0x0 0x00002000>, + <0x0 0xc0c20000 0x0 0x00001000>; + reg-names = "dbi", + "atu", + "config", + "link"; + #address-cells = <3>; + #size-cells = <2>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x9f002000 0x0 0x00100000>, + <0x02000000 0x0 0x90000000 0x0 0x90000000 0x0 0x0f000000>; + interrupts = <142>; + interrupt-names = "msi"; + clocks = <&syscon_apmu CLK_PCIE1_DBI>, + <&syscon_apmu CLK_PCIE1_MASTER>, + <&syscon_apmu CLK_PCIE1_SLAVE>; + clock-names = "dbi", + "mstr", + "slv"; + resets = <&syscon_apmu RESET_PCIE1_DBI>, + <&syscon_apmu RESET_PCIE1_MASTER>, + <&syscon_apmu RESET_PCIE1_SLAVE>; + reset-names = "dbi", + "mstr", + "slv"; + spacemit,apmu = <&syscon_apmu 0x3d4>; + status = "disabled"; + + pcie1_port: pcie@0 { + device_type = "pci"; + compatible = "pciclass,0604"; + reg = <0x0 0x0 0x0 0x0 0x0>; + bus-range = <0x01 0xff>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + }; + }; + + pcie2: pcie@ca800000 { + device_type = "pci"; + compatible = "spacemit,k1-pcie"; + reg = <0x0 0xca800000 0x0 0x00001000>, + <0x0 0xcab00000 0x0 0x0001ff24>, + <0x0 0xb7000000 0x0 0x00002000>, + <0x0 0xc0d20000 0x0 0x00001000>; + reg-names = "dbi", + "atu", + "config", + "link"; + #address-cells = <3>; + #size-cells = <2>; + ranges = <0x01000000 0x0 0x00000000 0x0 0xb7002000 0x0 0x00100000>, + <0x42000000 0x0 0xa0000000 0x0 0xa0000000 0x0 0x10000000>, + <0x02000000 0x0 0xb0000000 0x0 0xb0000000 0x0 0x07000000>; + interrupts = <143>; + interrupt-names = "msi"; + clocks = <&syscon_apmu CLK_PCIE2_DBI>, + <&syscon_apmu CLK_PCIE2_MASTER>, + <&syscon_apmu CLK_PCIE2_SLAVE>; + clock-names = "dbi", + "mstr", + "slv"; + resets = <&syscon_apmu RESET_PCIE2_DBI>, + <&syscon_apmu RESET_PCIE2_MASTER>, + <&syscon_apmu RESET_PCIE2_SLAVE>; + reset-names = "dbi", + "mstr", + "slv"; + spacemit,apmu = <&syscon_apmu 0x3dc>; + status = "disabled"; + + pcie2_port: pcie@0 { + device_type = "pci"; + compatible = "pciclass,0604"; + reg = <0x0 0x0 0x0 0x0 0x0>; + bus-range = <0x01 0xff>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + }; + }; }; storage-bus { -- 2.48.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv