From patchwork Fri Oct 17 08:07:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2152268 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=XaqC+Gct; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45e3:2400::1; helo=sv.mirrors.kernel.org; envelope-from=devicetree+bounces-228298-incoming-dt=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [IPv6:2604:1380:45e3:2400::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4cpDrK02q8z1yHW for ; Sat, 18 Oct 2025 06:08:48 +1100 (AEDT) Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CD0C7421431 for ; Fri, 17 Oct 2025 19:08:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 728B12C3271; Fri, 17 Oct 2025 19:07:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b="XaqC+Gct" X-Original-To: devicetree@vger.kernel.org Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 28BE333F8C1 for ; Fri, 17 Oct 2025 19:07:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760728069; cv=none; b=oZG3dCDDPRwR1HVZlAfDuYhLWm2+a/iKVgZgIqWyLc19XN6WlS71ForBGMfjqNrxcLdS4nXXOvfrnnje3t3421CEGDo8KOOfHIjhVfPhfHEqx196MBIhQ+nHcnJBwxpo7jjes0kBkMR3NRFAGAn6k4I82MGz3RqUNEW2mLCdjc8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760728069; c=relaxed/simple; bh=7WrOPVM0gt+b/Q/c9vY/ADstDCH0ZLchyGhM1A9P4gQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YRaNm5Wjtw5WhukcIzDAWG8n97bCap7QJ+DcrpjPOMmApTaRJlFFtmfbVD6hZpQuQjXwjWbAQgFH4/3MvlSUxjSfqpf70P8Ktkg217KbbN+ZB/TrmMS4GB6w49UK3uSmnyKBBY2/0nRWU8ZIbjFt9tWvonDxXbMtorQloVd17GA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b=XaqC+Gct; arc=none smtp.client-ip=209.85.166.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Received: by mail-io1-f65.google.com with SMTP id ca18e2360f4ac-912d4135379so92562939f.1 for ; Fri, 17 Oct 2025 12:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20230601.gappssmtp.com; s=20230601; t=1760728066; x=1761332866; darn=vger.kernel.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=nnj3ndeUMae3NyNArAGupVHJsLP7DcySgmrwpRjKSkM=; b=XaqC+GctWKHYCQ69QE3CSwqNingyyvxRnRKsuBSNjpwZ1/hXMUEQI391D3b+ozZc3R KjHkZXReEq5hdqHSGNAezlzaJkPe21TozjrjMNZuEsOfl2AXs3my4MgBCnuSbXqb6P+S V+/66dYUCXBoWX2ZHxaTl1RNGmPmg3ooFuzo6Hjyl801XK4u5ZWZv0WzLvRSWY38IxB/ +Lz9OTTrqDBX8e5e1sd2oeVg718Sho7fjMLps3odM3U1GoeGP62BcHevRbU6aTEv6xMu AkcpsKYciYb1MaM1xCNXodd9U095CSzgyO6JSmSYGJgjVz7iI2c25ks8NxJ89m39ezgl mpAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760728066; x=1761332866; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nnj3ndeUMae3NyNArAGupVHJsLP7DcySgmrwpRjKSkM=; b=rlYaprIRB/97IfT6Z+juFcfQEdRoA8kp0Fi0UyKR+XStc0VZzCts3BIjlDEOX1Un4A Y7bECXQO24vrtQKR6v9KiGchTJDYUXnWzu0XPaJZuUVOe8N/sUGGQOJHeWlq6f48w/5n NY6Acnph8iuIFDYNEi8moUfwB1kK4EVIo1e6ct86XwQM4ObdLUxNos/R1WHncB9QsjGS 9EuKcoIhDEYe46qRBPyw4KqJ1k+35BC4SQaxXlres6Jrd9t15UEoMtINFk5z8UKgOQUD JGBUlAQD2LecY4Oj6X3I3qrHcdqzqMCDLzN5RGJatAUMSurEOTR7558BC5PnDwmSnc7E qtrg== X-Forwarded-Encrypted: i=1; AJvYcCVurSxWBKfjuyo5eXRKqJXUMEEGWm1c0qKPgwdWvW6zg1nqjDxoim7n8ChDLcXfDq1e0sl8n82lmTAp@vger.kernel.org X-Gm-Message-State: AOJu0YwqQatvJts9DA4zK+lats30PeCKplRJRrO1jV9d/KUlE1RgvXKb MfNs6WEJLUv74t0DY+nFIPvIgZxHOI8SHAUkbigc9PA7Ey4cLKNWGHBJex04xmbVlSA= X-Gm-Gg: ASbGncsom2agtk2EgDYBnvo+JEGmQnEr1IrIpt9O7Q2mZ7kZXsnGGUyL61Wl5yg2ZBf fZxw5rcI/hhfnBxdoyOFPCvDYfKU+NB1R3KwukORKP0xsyz8l05bdeTCStFrzEwCDGhObFwLlH+ LuR54Y5kxvQPC+C7rVC/D/hQFEcVpThGvxCiJ/NupIdeMFqzr3KhqzuF741HgZSTGXyrSQc2EV8 MHbqPNVTXHXmAJc3bCFHp0IBe677H2d2eQe9REPo1L60cYkGOYqMyn/lhjAjSALvFZf0UBd7PGN GgLVZmIPJwgxKZ7kNykBQhma/tTRPgZ7MJngJMFxguL9DoAEZjM9lnXOnpZ2KztkqGdIFUAdd+O IAKpAPp5Q1UvH7wPQKxB9KELt5Agtu9B/iAK3QFRkseG+AUwuR3Y8SKqPE/6t+DLxf/hQBVhImq pYAlbhnk8OdHp1Lu7metoWLG6F8veXBUEkgj3BgbeupuYbbQTwCV0fOg== X-Google-Smtp-Source: AGHT+IHytZYPq3sSfMjOZfFYHMcFE2wOrzrpGR8N8DWI8WbrnQAptaEbQ6cEghvzh0pSWjDXYscmQg== X-Received: by 2002:a92:ca4d:0:b0:430:b05a:ecc3 with SMTP id e9e14a558f8ab-430c525f528mr67642975ab.9.1760728065914; Fri, 17 Oct 2025 12:07:45 -0700 (PDT) Received: from zippy.localdomain (c-75-72-117-212.hsd1.mn.comcast.net. [75.72.117.212]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-5a8a9768b98sm153462173.46.2025.10.17.12.07.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Oct 2025 12:07:45 -0700 (PDT) From: Alex Elder To: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, vkoul@kernel.org, kishon@kernel.org Cc: dlan@gentoo.org, guodong@riscstar.com, devicetree@vger.kernel.org, linux-phy@lists.infradead.org, spacemit@lists.linux.dev, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/7] dt-bindings: phy: spacemit: add SpacemiT PCIe/combo PHY Date: Fri, 17 Oct 2025 14:07:33 -0500 Message-ID: <20251017190740.306780-2-elder@riscstar.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20251017190740.306780-1-elder@riscstar.com> References: <20251017190740.306780-1-elder@riscstar.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add the Device Tree binding for the PCIe/USB 3.0 combo PHY found in the SpacemiT K1 SoC. This is one of three PCIe PHYs, and is unusual in that only the combo PHY can perform a calibration step needed to determine settings used by the other two PCIe PHYs. Calibration must be done with the combo PHY in PCIe mode, and to allow this to occur independent of the eventual use for the PHY (PCIe or USB) some PCIe-related properties must be supplied: clocks; resets; and a syscon phandle. Reviewed-by: Rob Herring (Arm) Signed-off-by: Alex Elder --- v3: - Added Reviewed-by from Rob Herring - The "phy" reset is listed first .../bindings/phy/spacemit,k1-combo-phy.yaml | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/spacemit,k1-combo-phy.yaml diff --git a/Documentation/devicetree/bindings/phy/spacemit,k1-combo-phy.yaml b/Documentation/devicetree/bindings/phy/spacemit,k1-combo-phy.yaml new file mode 100644 index 0000000000000..b59476cd78b57 --- /dev/null +++ b/Documentation/devicetree/bindings/phy/spacemit,k1-combo-phy.yaml @@ -0,0 +1,114 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/spacemit,k1-combo-phy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SpacemiT K1 PCIe/USB3 Combo PHY + +maintainers: + - Alex Elder + +description: > + Of the three PHYs on the SpacemiT K1 SoC capable of being used for + PCIe, one is a combo PHY that can also be configured for use by a + USB 3 controller. Using PCIe or USB 3 is a board design decision. + + The combo PHY is also the only PCIe PHY that is able to determine + PCIe calibration values to use, and this must be determined before + the other two PCIe PHYs can be used. This calibration must be + performed with the combo PHY in PCIe mode, and is this is done + when the combo PHY is probed. + + The combo PHY uses an external oscillator as a reference clock. + During normal operation, the PCIe or USB port driver is responsible + for ensuring all other clocks needed by a PHY are enabled, and all + resets affecting the PHY are deasserted. However, for the combo + PHY to perform calibration independent of whether it's later used + for PCIe or USB, all PCIe mode clocks and resets must be defined. + +properties: + compatible: + const: spacemit,k1-combo-phy + + reg: + items: + - description: PHY control registers + + clocks: + items: + - description: External oscillator used by the PHY PLL + - description: DWC PCIe Data Bus Interface (DBI) clock + - description: DWC PCIe application AXI-bus Master interface clock + - description: DWC PCIe application AXI-bus slave interface clock + + clock-names: + items: + - const: refclk + - const: dbi + - const: mstr + - const: slv + + resets: + items: + - description: PHY reset; remains deasserted after initialization + - description: DWC PCIe Data Bus Interface (DBI) reset + - description: DWC PCIe application AXI-bus Master interface reset + - description: DWC PCIe application AXI-bus slave interface reset + + reset-names: + items: + - const: phy + - const: dbi + - const: mstr + - const: slv + + spacemit,apmu: + description: + A phandle that refers to the APMU system controller, whose + regmap is used in setting the mode + $ref: /schemas/types.yaml#/definitions/phandle + + "#phy-cells": + const: 1 + description: + The argument value (PHY_TYPE_PCIE or PHY_TYPE_USB3) determines + whether the PHY operates in PCIe or USB3 mode. + +required: + - compatible + - reg + - clocks + - clock-names + - resets + - reset-names + - spacemit,apmu + - "#phy-cells" + +additionalProperties: false + +examples: + - | + #include + phy@c0b10000 { + compatible = "spacemit,k1-combo-phy"; + reg = <0xc0b10000 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"; + spacemit,apmu = <&syscon_apmu>; + #phy-cells = <1>; + }; From patchwork Fri Oct 17 08:07:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2152267 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=Je1RL/Fd; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.80.249; helo=am.mirrors.kernel.org; envelope-from=devicetree+bounces-228300-incoming-dt=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4cpDrF3wjTz1yHW for ; Sat, 18 Oct 2025 06:08:45 +1100 (AEDT) Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D4F371AE43AD for ; Fri, 17 Oct 2025 19:09:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7F45331BCAB; Fri, 17 Oct 2025 19:07:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b="Je1RL/Fd" X-Original-To: devicetree@vger.kernel.org Received: from mail-il1-f194.google.com (mail-il1-f194.google.com [209.85.166.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CE1733F8A8 for ; Fri, 17 Oct 2025 19:07:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760728070; cv=none; b=X8AUPetEteRXFXEF5x6M8Bf+na1KByNXvLUOHJ7iZaUiRWFA5pccUB9L1aJbC2yYCeE5bxaRVh07BG+hoZ/gc6lYDyJ6uKfzrjDj437h/fOJkQG3BooHKBPRVmDg+ZnQRaXtEALNwRORuGJCdMHQsArayvPz4OK85PJBqhK3+Mo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760728070; c=relaxed/simple; bh=LLI/HQYDWhCmej4ouNtvXFhwrmFwQGLMws3w9xIK1/c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XrrepiN41xe/VVs4DYyp0FVfBpZmAJGLVO2caGFbSo/WOfRQqkjhadvaRsejTXv6e6A98oI+mihyAhws+/h3kbML9ReJZQHh1pp71kM9Ra5UQwHLkTNX4pBhNx6Zs+dLqcc9md8eaWUCgR+urifG3+jkc82stlZO9UiUSYp4soc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b=Je1RL/Fd; arc=none smtp.client-ip=209.85.166.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Received: by mail-il1-f194.google.com with SMTP id e9e14a558f8ab-430bf3b7608so16591985ab.3 for ; Fri, 17 Oct 2025 12:07:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20230601.gappssmtp.com; s=20230601; t=1760728067; x=1761332867; darn=vger.kernel.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=H/3BQdd3vn0d3oIHDdjobMfykMV90YiIp5S1jVARxr8=; b=Je1RL/FdYh7jK6gjcwQZz0xPkIuPjcqjDnpaYtZ0xInXRmsJ1tYpCreoL1rBcV0qm2 qsFj1zwFPkikT+yVGgtbyNUqV/MOcb1u4X5A+a9SZjej5vTpixKciukwLcDiWLW4YVR/ wTS5hyppbtYDvOYKkN34Yolrm56L9CovtkHJ51FrcA7F/Vysromg9DQBdzba9GyHT17f EJq6WM3FTXfk+Y+63ty5ESD1O3TFgDnJzJ6jeRe4Cf0V+SAnXsv3mbjNGmrkAYndr59V DK279aAeAaaxP9XYaHttx26K6TmCVqzXgZJcmIplk/+CUhq4sQt+17qG+tpieZePJ8KA ECDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760728067; x=1761332867; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H/3BQdd3vn0d3oIHDdjobMfykMV90YiIp5S1jVARxr8=; b=jGYDJVbKO9pUhmICKml65P/p5CqkF+F3yjpfCpuVyT/cn77vK/WuKTY3Z9nWw4J0ND 5KDz2NyvDxTBam7dcBFABjf2xiaX8tzQ9fK3lWnF4r1WkjlMPsO6TMOvT/OM8dSm38Mc 4yqQRGFpdOxUAkO0t4G2RxI6dj3Hy+PJFnMsGlac5yG72knUdCLJ2CALoqaQS2t2IUwk hoEmGSXzNY5p1e2wfD2sB2MnGuspYfDvVieDNokfMBYGPfKtgjYOTF0eoML1S5o2gSPB N9xGUezFvDvkX3ir2lU8cF5Isg9NUKY5qS9bsUkMQd6fWaLe18QEpchqhwKhospSYLLt xkVg== X-Forwarded-Encrypted: i=1; AJvYcCXpOv2AIndzxbHryXEdOMn4jXCUFizLMgzFaHooAJqy8we6KPk2mtxAIoI4W+c28V5sFfe/gOc4Z+Xr@vger.kernel.org X-Gm-Message-State: AOJu0YznPUOlm1sF75/5c1LfsvhW8CUe+YS7X1rfzNDCDIwj8aHmJqVr tuzATqCdapXBeqEBXm7DJUwZZkUCwOrOtFf2FOC39z5tilRHLTJzL0FeUspfYM7ktohl8WM75Rx EJyOg/Y7VUQ== X-Gm-Gg: ASbGncvVB+HbpXykSF9Fuic3uESQvGEx4nrsU/IDjr9tUGxmXS8fWek7t/VykIx9/R4 XW4JP+eyY8QYnzbbm/8gdNqtgfYjaQE4ObxRVCJGgRd4Isn3R2/vZAMjcBcaqZnMgzovYeUHGE0 3sS876dYJywxRO2M0OdENJJ2q/vGBpwJC0X+jSrjXLeO6xWNFYum3d6ozVNX9u+VaqUmXaWZ9xx rXDsVOGWm6SpqVnmGwIQo7nBRV20wcMDH7R2MC1xGDUyLttH5bnrURQzprvdL3AtsQAjR7FowR0 vDzlusxGO2Rr31wDENmAb4nbqF9bZHrHcGpAOtoprL4E/baElN6EVqtUocvOZfq3GbThlwkymDF 2A5cpw8nzuvvUkC7QGAmQ3x1E3SnNjsMq55Zbh0mVhJsMpKC0u+PeeFVqIYo3zWv0y9LSFU8cHa H+I7uVvlqfTY0TomT0wlJJhiRnYF/FsofBLLZENbC7orW9EIVFIelq7g== X-Google-Smtp-Source: AGHT+IHRtsRSfhWCT9BQG3DcVkrpn6NA7ODycaChUBpFYwB1ZdnsTh8SKsqwMx76IAkXTipom5mlHA== X-Received: by 2002:a05:6e02:148d:b0:430:b167:3604 with SMTP id e9e14a558f8ab-430c5209bafmr76757915ab.4.1760728067217; Fri, 17 Oct 2025 12:07:47 -0700 (PDT) Received: from zippy.localdomain (c-75-72-117-212.hsd1.mn.comcast.net. [75.72.117.212]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-5a8a9768b98sm153462173.46.2025.10.17.12.07.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Oct 2025 12:07:46 -0700 (PDT) From: Alex Elder To: vkoul@kernel.org, kishon@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: ziyao@disroot.org, dlan@gentoo.org, guodong@riscstar.com, devicetree@vger.kernel.org, linux-phy@lists.infradead.org, spacemit@lists.linux.dev, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/7] dt-bindings: phy: spacemit: introduce PCIe PHY Date: Fri, 17 Oct 2025 14:07:34 -0500 Message-ID: <20251017190740.306780-3-elder@riscstar.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20251017190740.306780-1-elder@riscstar.com> References: <20251017190740.306780-1-elder@riscstar.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add the Device Tree binding for two PCIe PHYs present on the SpacemiT K1 SoC. These PHYs are dependent on a separate combo PHY, which determines at probe time the calibration values used by the PCIe-only PHYs. Reviewed-by: Rob Herring (Arm) Signed-off-by: Alex Elder --- v3: - Added Reviewed-by from Rob Herring - A "phy" reset is now required .../bindings/phy/spacemit,k1-pcie-phy.yaml | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/spacemit,k1-pcie-phy.yaml diff --git a/Documentation/devicetree/bindings/phy/spacemit,k1-pcie-phy.yaml b/Documentation/devicetree/bindings/phy/spacemit,k1-pcie-phy.yaml new file mode 100644 index 0000000000000..019b28349be75 --- /dev/null +++ b/Documentation/devicetree/bindings/phy/spacemit,k1-pcie-phy.yaml @@ -0,0 +1,71 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/spacemit,k1-pcie-phy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SpacemiT K1 PCIe PHY + +maintainers: + - Alex Elder + +description: > + Two PHYs on the SpacemiT K1 SoC used for only for PCIe. These + PHYs must be configured using calibration values that are + determined by a third "combo PHY". The combo PHY determines + these calibration values during probe so they can be used for + the two PCIe-only PHYs. + + The PHY uses an external oscillator as a reference clock. During + normal operation, the PCIe host driver is responsible for ensuring + all other clocks needed by a PHY are enabled, and all resets + affecting the PHY are deasserted. + +properties: + compatible: + const: spacemit,k1-pcie-phy + + reg: + items: + - description: PHY control registers + + clocks: + items: + - description: External oscillator used by the PHY PLL + + clock-names: + const: refclk + + resets: + items: + - description: PHY reset; remains deasserted after initialization + + reset-names: + const: phy + + "#phy-cells": + const: 0 + +required: + - compatible + - reg + - clocks + - clock-names + - resets + - reset-names + - "#phy-cells" + +additionalProperties: false + +examples: + - | + #include + phy@c0c10000 { + compatible = "spacemit,k1-pcie-phy"; + reg = <0xc0c10000 0x1000>; + clocks = <&vctcxo_24m>; + clock-names = "refclk"; + resets = <&syscon_apmu RESET_PCIE1_GLOBAL>; + reset-names = "phy"; + #phy-cells = <0>; + }; From patchwork Fri Oct 17 08:07:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2152269 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=B0Xs/t2B; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2a01:60a::1994:3:14; helo=ams.mirrors.kernel.org; envelope-from=devicetree+bounces-228301-incoming-dt=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from ams.mirrors.kernel.org (ams.mirrors.kernel.org [IPv6:2a01:60a::1994:3:14]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4cpDrX0jWkz1yHW for ; Sat, 18 Oct 2025 06:09:00 +1100 (AEDT) Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.mirrors.kernel.org (Postfix) with ESMTPS id B850C35DD0A for ; Fri, 17 Oct 2025 19:08:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C1A8332EA4; Fri, 17 Oct 2025 19:07:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b="B0Xs/t2B" X-Original-To: devicetree@vger.kernel.org Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B5FC2472A4 for ; Fri, 17 Oct 2025 19:07:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.68 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760728072; cv=none; b=l1YAEmodMvzkKT73vvULLaTNC5tcpLH+QfDgY/9gD+b9CnhgpfWeHSU/Qb7WjaUXwf7r35VWENpQy9/LYFI1BnxJPuPta73J43FzF11WTTCPNFHXkXZUc1W4wb5rct0glkCuRYTH/LGJi1jE4fn0y7PMS5quDc/ocaVLhT24FWc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760728072; c=relaxed/simple; bh=gSA8pzE96CptaNNhmH2TKS9Z/TX8WVfVdY5RfpgB+X0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=l6XGL994hEt+UNzDoGhCURpg5SA1BZZHvBWspVOepABYvL01BpeySqTEV6t7OY+yMXIInevoWcXwwJe8LlrJOIyEJdkzXZ1RzRYOn2gSSkaNs3PhTWaoAH5QsYiCGFgvvUytYtxJoRDJsxbY5AAc7AbME6NOqbxGMs/ihFWobIg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b=B0Xs/t2B; arc=none smtp.client-ip=209.85.166.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Received: by mail-io1-f68.google.com with SMTP id ca18e2360f4ac-93e2c9821fcso191309439f.3 for ; Fri, 17 Oct 2025 12:07:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20230601.gappssmtp.com; s=20230601; t=1760728068; x=1761332868; darn=vger.kernel.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=wipx6KUf5lXNnshQnWU8AGb6pBA1b4PqRzR3i29GydQ=; b=B0Xs/t2BZg2MRNTW0WNu8tW8U8O6d1wWBwsDDdRPVKO8t2h8ZkEopykzgoli3yGp6y oK/pSCuA8x55SGWwOu+btU3d0kWcJyMacvmb2SznYHuuXwS1DVSSzWAtzLj+2UUwTkRn 5Dc5p1Md/7n59TLQBm9pOEFwM0XlZJDaA0bhjgdmS9FsUWDYlZaDk1dAC88oPS04sk6Y jn0hugTebhOgvcOxKK2VFeBDzfNpcdFhAnx6NmxcNzUrI3dn2TUNwVYqCJbKIxyoXKSC SdL6Tn25xfyUZwYZY8dvPROUmpSfsSszXb9Z7E9v2T2l3kmMarUFgTumVAEegx2bOsMo ngJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760728068; x=1761332868; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wipx6KUf5lXNnshQnWU8AGb6pBA1b4PqRzR3i29GydQ=; b=Xo+m+XF7JqQK0TQvyBacySS7R6si+9JaEWHoxevQam+iK9o61Vxcf1miODsfTvXa0B Q6jYBS90ZVV2QEIp88dVyNaVMwdYfjYyjQ9e2fdhaaJtYQvjHe96yZcPmr3mLJ0rjUVT Q6wbxpzWEaZnOPs6TQzoGMdET4hjyA9znNM/xr/ZIANXipa12/rQSNpLtqxZ1APXh+s+ 8mhHRR7E+URO+kRB10smYLcB/lgm7k6ucZ/OedPTzfizRkroukqYGjKtCNSG8XNFfkRC 88UGSxAfpHX4WCflspAVrp4r2fsYHZf1yDDFRO9n3FmUb0+/CzmMwmT1L3bGeohROUm1 sBYQ== X-Forwarded-Encrypted: i=1; AJvYcCXe1APATRUuPvTqKRehLHe0GWuFDFX09bwvPgCwqT+sB4ISyRmnqySh4BeaaKX7vgs7gVp0zQSW+jEP@vger.kernel.org X-Gm-Message-State: AOJu0Yze8ffC7EcA8BGYx2NzOW3NWOUBChicPIqa90E3FhPQQRrW0VHX 5EbOhRwVpElqGfGqfxWpPPzaqoYfleHlpQZGW1gLwvC1PWrsnVhFzpb4Gcni62u1JE0= X-Gm-Gg: ASbGncvNXAxzF76yDC0JDKYQwQ+iaHNuxDqp1MXdjTJK9gsoOBn1hZ83A1USEi49+H2 kE0tDxfGJ1Gc7cg1A+f9WK7j5EbEZakrTpvCHPdo/9FHh/xkkYSn32gypDsu791h+GeO6Nwzzc5 VK6UoYyarFGVLdm00T9b8zFQvxa7KCIc7N1HoP+C3wzFnk4eQGOy4iZUi/pfk5rxR2V84q3ka3U U5KLWyZybyzMnkT23Yqkd6o1IW4N9/xUWYU5bvSfjNEZ5r4qEFTft8tSfjHTHncxncHaNjvQqhO Is4EzjR3764dcNDtphm4knABiJA+pORgfIQsRLLKijM58neqUBuNc98+bD9yY1XYFJhp4jPs40S MXzRWEABrChlAb9M2FNSJ7l9XPP+6SrWE/VQdfnKgY7CPwlEMiTCg8w2rXMx8F8B/QbeP0iUBgt /kGuV29dsLP0J8hyoBCwv60TJQrc4/ijqRfDyuRe+4a1s= X-Google-Smtp-Source: AGHT+IGlmzrh73wRb0y67T37imaj4fcl25NZgeEColbyy8xRcDJKg9j4yQIgu1HP8DHaZFDT+Smbzg== X-Received: by 2002:a05:6e02:188b:b0:430:b05a:ecb3 with SMTP id e9e14a558f8ab-430c52899ddmr71652585ab.9.1760728068556; Fri, 17 Oct 2025 12:07:48 -0700 (PDT) Received: from zippy.localdomain (c-75-72-117-212.hsd1.mn.comcast.net. [75.72.117.212]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-5a8a9768b98sm153462173.46.2025.10.17.12.07.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Oct 2025 12:07:48 -0700 (PDT) From: Alex Elder To: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, bhelgaas@google.com, lpieralisi@kernel.org, kwilczynski@kernel.org, mani@kernel.org Cc: dlan@gentoo.org, guodong@riscstar.com, devicetree@vger.kernel.org, linux-pci@vger.kernel.org, spacemit@lists.linux.dev, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/7] dt-bindings: pci: spacemit: introduce PCIe host controller Date: Fri, 17 Oct 2025 14:07:35 -0500 Message-ID: <20251017190740.306780-4-elder@riscstar.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20251017190740.306780-1-elder@riscstar.com> References: <20251017190740.306780-1-elder@riscstar.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add the Device Tree binding for the PCIe root complex found on the SpacemiT K1 SoC. This device is derived from the Synopsys Designware PCIe IP. It supports up to three PCIe ports operating at PCIe gen 2 link speeds (5 GT/sec). One of the ports uses a combo PHY, which is typically used to support a USB 3 port. Signed-off-by: Alex Elder Reviewed-by: Rob Herring (Arm) --- v3: - Remove the "num-viewport" property - A "phy" reset is no longer required .../bindings/pci/spacemit,k1-pcie-host.yaml | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 Documentation/devicetree/bindings/pci/spacemit,k1-pcie-host.yaml diff --git a/Documentation/devicetree/bindings/pci/spacemit,k1-pcie-host.yaml b/Documentation/devicetree/bindings/pci/spacemit,k1-pcie-host.yaml new file mode 100644 index 0000000000000..89f8b6b579c6e --- /dev/null +++ b/Documentation/devicetree/bindings/pci/spacemit,k1-pcie-host.yaml @@ -0,0 +1,147 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pci/spacemit,k1-pcie-host.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SpacemiT K1 PCI Express Host Controller + +maintainers: + - Alex Elder + +description: > + The SpacemiT K1 SoC PCIe host controller is based on the Synopsys + DesignWare PCIe IP. The controller uses the DesignWare built-in + MSI interrupt controller, and supports 256 MSIs. + +allOf: + - $ref: /schemas/pci/snps,dw-pcie.yaml# + +properties: + compatible: + const: spacemit,k1-pcie + + reg: + items: + - description: DesignWare PCIe registers + - description: ATU address space + - description: PCIe configuration space + - description: Link control registers + + reg-names: + items: + - const: dbi + - const: atu + - const: config + - const: link + + spacemit,apmu: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: + A phandle that refers to the APMU system controller, whose + regmap is used in managing resets and link state, along with + and offset of its reset control register. + items: + - items: + - description: phandle to APMU system controller + - description: register offset + + clocks: + items: + - description: DWC PCIe Data Bus Interface (DBI) clock + - description: DWC PCIe application AXI-bus master interface clock + - description: DWC PCIe application AXI-bus slave interface clock + + clock-names: + items: + - const: dbi + - const: mstr + - const: slv + + resets: + items: + - description: DWC PCIe Data Bus Interface (DBI) reset + - description: DWC PCIe application AXI-bus master interface reset + - description: DWC PCIe application AXI-bus slave interface reset + + reset-names: + items: + - const: dbi + - const: mstr + - const: slv + + interrupts: + items: + - description: Interrupt used for MSIs + + interrupt-names: + const: msi + + phys: + maxItems: 1 + + vpcie3v3-supply: + description: + A phandle for 3.3v regulator to use for PCIe + + device_type: + const: pci + +required: + - compatible + - reg + - reg-names + - spacemit,apmu + - "#address-cells" + - "#size-cells" + - ranges + - clocks + - clock-names + - resets + - reset-names + - interrupts + - interrupt-names + - phys + - vpcie3v3-supply + - device_type + +unevaluatedProperties: false + +examples: + - | + #include + pcie@ca400000 { + compatible = "spacemit,k1-pcie"; + reg = <0xca400000 0x00001000>, + <0xca700000 0x0001ff24>, + <0x9f000000 0x00002000>, + <0xc0c20000 0x00001000>; + reg-names = "dbi", + "atu", + "config", + "link"; + #address-cells = <3>; + #size-cells = <2>; + ranges = <0x01000000 0x0 0x00000000 0x9f002000 0x0 0x00100000>, + <0x02000000 0x0 0x90000000 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"; + phys = <&pcie1_phy>; + vpcie3v3-supply = <&pcie_vcc_3v3>; + device_type = "pci"; + pinctrl-names = "default"; + pinctrl-0 = <&pcie1_3_cfg>; + spacemit,apmu = <&syscon_apmu 0x3d4>; + };