From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (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 CF4243750AD for ; Tue, 9 Jun 2026 16:11:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781021485; cv=none; b=nJPoK2CVmg0Sm8vRxAHdN+X8brynNZaw9WJiW+l1hVGGQrgDfS97QSWc4DD80tQoV8rdOnfxyNJGodmaRG7PPi0apdY89sdhcP0BwhegGNw/UP3Zdo6IreXDQWOkNlr8xpcNiqeeSgpyx60t4CwUtUWqKVx8/b+jGuBbTQy6NOg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781021485; c=relaxed/simple; bh=zBz50Ykka4AVz+QNBsQ5oDdeIq0rYJLLgX1yaLOkoHo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=GP0V2n6pDnWGyeWHh83gYylwASk7G9tBzx1O0flZrVVpE+K6hg9PhVT/74Y9Z0Abfh6cTZc/kiLu9u1YYLZrElZiOELLkm8V5+o28xtMd/FyYfW0W2W1qZhR3T2CQlJPIUHaN4uCg2gFQ43vHnU9aWvKmmWOsKTr+ynGVcDWciw= 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.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b=vsuP/VF4; arc=none smtp.client-ip=209.85.167.175 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b="vsuP/VF4" Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-485ecc0f2dfso4435825b6e.3 for ; Tue, 09 Jun 2026 09:11:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20251104.gappssmtp.com; s=20251104; t=1781021483; x=1781626283; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=H1jWZCzmLm9wzBxE++FfHpmTEYKEQ9CFhlrClkcQyz0=; b=vsuP/VF4KzKdR8HJ1nlimUaiGn3q7lA60Hf8ReoUxb8yCuzM2dkTZFBIaw09azfB8o rJpPUenr5fusZ2F7BQJVeDYQiw8ZUnZNTFm7lcSHiKROfoiiLHXQc+Dcosgk/W1BE6/8 8kIHYYmHHkiz5aUJzacUI7tfKS7TEpDUPxDk4Th92YUIlBKo+He/dVGJ/1eGxd60w7An yf8i+wd6FJnHZBvDceOzNIyisJxp6KoXLTIuxtYyEKNlyeXARga70S8NABeeMwZmCKnZ Lo3QkP4DbKrpVCokblhdBMNEGXwmw7+ffTvQ6I0wrh4b073Uk5yj8fqbhuu/iXs0Brbz TejQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781021483; x=1781626283; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=H1jWZCzmLm9wzBxE++FfHpmTEYKEQ9CFhlrClkcQyz0=; b=gkMwFwNraBApJK863ZFHLKgBDc14FZfrvphF8alP+5LpnijQ4zT1fRs/ihaEGdNbeX Yfu8DzWyGv0KG2V7LTY/lpucwO4JLWVZGMf2PjBFEPqamM3qLcMmZi40pKAbn2jQt2qZ AOHakGk2dv/jjQfn7EUmVigCVxsDApDZ4VEsgWWPG908xSw3uQU6FeB7zDsB4DuHnFT9 zyFzbDWHU2GuJyD1meLSZSETy1dBtlRWQCTFrBPAtsmU2Kf/99P617GY1nwyfeiJRT97 lOcjJgFscO+zz/MjuLdDzyZjfXYjj9XpTyovxu1fX1oZYxy9as3mE6Si01Ah9tyHImX1 jmZA== X-Forwarded-Encrypted: i=1; AFNElJ92f8A6CbvyZG04X1i7m9kFHsEJ90T4Z2qPR+PXtb63nz0NIoAHpYe3gGohhJUTJjTFMUGVldKLNDqq5QM=@vger.kernel.org X-Gm-Message-State: AOJu0Yxf4KLKJiBOmDJes2oIVhjoUxQ4wdjpOxFNGWU3aMmRLyHFQuAs yYBYs55UDjhn4xD9BuPvAmy4bB07ofPdw8pwVXd9ouFOGOOs4aF/fKAtwiLFkcUQs/A= X-Gm-Gg: Acq92OGMPCgfkOU79hU3IGKSiYKhR28F3dTllcgPh2c7TetOB0YU0hpQOZHs8MYF8Sb 7d+eVUvW6U5lSLbM6M6Oc1MVPKMK/81QZm/EeWUxBwTKXc5RMeXnYiGUGTOHvfOm7mkt6fRtm1O /cKPqnwuoznt8fMcSWddGaYfRPOClN3duDnky2wrLPhEdAO+T76RD6fxa7x2gvlrwhOT1tzWa+p fSI8mbMrHA76ZM9yL1YSChIZtehbxZj6D00/PQwqeWiqREsefbF2xSyH7t0hmPZPVPtriB80HOK RK5DtbS2RWPErrXKK4XcmLYtbwLWrCEnC5z5u4HK20hiNJ+bt0nlJdIhwAwa41wE5gQ+EuxQvoD ZnEt9EWbmIUjEEIFawmR5JEFamLgu59MUHCEG/RKy3tfkGK/T2y0rPlo3waJlNlLScA6LsdGw7J 1x2BzxiMdbyvgyGngrm9J/XP8osDKOs43mcw== X-Received: by 2002:a05:6808:251a:b0:464:3d5d:d9d4 with SMTP id 5614622812f47-4868df031d7mr13579710b6e.39.1781021482752; Tue, 09 Jun 2026 09:11:22 -0700 (PDT) Received: from [172.22.22.28] ([73.62.185.64]) by smtp.gmail.com with ESMTPSA id 5614622812f47-4865b91f944sm16430240b6e.9.2026.06.09.09.11.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Jun 2026 09:11:22 -0700 (PDT) Message-ID: <8010bb91-77e1-42b4-9f19-d9e70e385d00@riscstar.com> Date: Tue, 9 Jun 2026 11:11:20 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 4/5] dt-bindings: PCI: spacemit: Introduce Spacemit K3 PCIe host controller To: Manivannan Sadhasivam , Inochi Amaoto Cc: Jingoo Han , Bjorn Helgaas , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Yixun Lan , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Christian Bruel , Vincent Guittot , Senchuan Zhang , Nam Cao , Siddharth Vadapalli , Randolph Lin , Andy Shevchenko , Vidya Sagar , Neil Armstrong , Gustavo Pimentel , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, Yixun Lan , Longbin Li References: <20260517014841.254085-1-inochiama@gmail.com> <20260517014841.254085-5-inochiama@gmail.com> Content-Language: en-US From: Alex Elder In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/9/26 9:03 AM, Manivannan Sadhasivam wrote: > On Sun, May 17, 2026 at 09:48:39AM +0800, Inochi Amaoto wrote: >> Add binding support for the PCIe controller on the SpacemiT K3 SoC. >> This controller is almost a standard Synopsys DesignWare PCIe IP, >> with some extra link and reset state control. >> >> Signed-off-by: Inochi Amaoto > > Why can't you reuse the existing spacemit,k1-pcie-host.yaml binding? I see very > few differences which could be added using conditionals. Also, this binding > defines the PHY property in the controller node, which is a way backwards as we > now prefer to define these in Root Port node as spacemit,k1-pcie-host.yaml does. I agree. I have another couple of comments below, including several things that just point out what's the same and what's different. -Alex > > - Mani > >> --- >> .../bindings/pci/spacemit,k3-pcie-host.yaml | 135 ++++++++++++++++++ >> 1 file changed, 135 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/pci/spacemit,k3-pcie-host.yaml >> >> diff --git a/Documentation/devicetree/bindings/pci/spacemit,k3-pcie-host.yaml b/Documentation/devicetree/bindings/pci/spacemit,k3-pcie-host.yaml >> new file mode 100644 >> index 000000000000..46147a37a9ce >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/pci/spacemit,k3-pcie-host.yaml >> @@ -0,0 +1,135 @@ >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/pci/spacemit,k3-pcie-host.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: SpacemiT K3 PCI Express Host Controller >> + >> +maintainers: >> + - Inochi Amaoto If you would like to maintain the (common) SpacemiT K1 host controller binding I'd be OK with that. >> + >> +description: >> + The SpacemiT K3 SoC PCIe host controller is based on the Synopsys >> + DesignWare PCIe IP. The controller uses the external MSI interrupt >> + controller. >> + >> +allOf: >> + - $ref: /schemas/pci/pci-host-bridge.yaml# >> + - $ref: /schemas/pci/snps,dw-pcie.yaml# >> + >> +properties: >> + compatible: >> + const: spacemit,k3-pcie >> + >> + reg: >> + items: >> + - description: DesignWare PCIe registers >> + - description: Data Bus Interface (DBI) shadow registers The above is new (different from K1), as is "dbi2" as its name. >> + - description: ATU address space >> + - description: PCIe configuration space >> + - description: Link control registers >> + >> + reg-names: >> + items: >> + - const: dbi >> + - const: dbi2 >> + - const: atu >> + - const: config >> + - const: link >> + >> + clocks: Clocks and resets are the same as K1. >> + 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 >> + >> + msi-parent: true msi-parent and phys are not present in the K1 binding. >> + >> + phys: >> + description: >> + PHY phandle from the Combo PHY, the lane number does not depends >> + on this, since the number of lanes provided by Combo PHY can be >> + 1 or 2. >> + minItems: 1 >> + maxItems: 6 >> + >> + phy-names: >> + minItems: 1 >> + maxItems: 6 >> + The following property is the same as K1. >> + 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 >> + >> +required: >> + - clocks >> + - clock-names >> + - resets >> + - reset-names >> + - msi-parent >> + - spacemit,apmu >> + >> +unevaluatedProperties: false >> + >> +examples: >> + - | >> + #include >> + >> + soc { >> + #address-cells = <2>; >> + #size-cells = <2>; >> + >> + pcie@80000000 { >> + compatible = "spacemit,k3-pcie"; >> + reg = <0x0 0x80000000 0x0 0x00001000>, >> + <0x0 0x80100000 0x0 0x00001000>, >> + <0x0 0x80300000 0x0 0x00003f20>, >> + <0x11 0x00000000 0x0 0x00010000>, >> + <0x0 0x82900000 0x0 0x00001000>; >> + reg-names = "dbi", "dbi2", "atu", "config", "link"; >> + device_type = "pci"; >> + #address-cells = <3>; >> + #size-cells = <2>; >> + clocks = <&syscon_apmu 89>, >> + <&syscon_apmu 56>, >> + <&syscon_apmu 57>; >> + clock-names = "dbi", "mstr", "slv"; >> + msi-parent = <&simsic>; >> + ranges = <0x01000000 0x00 0x00010000 0x11 0x00010000 0x0 0x00100000>, >> + <0x02000000 0x0 0x00110000 0x11 0x00110000 0x0 0x7fef0000>, >> + <0x43000000 0x18 0x00000000 0x18 0x00000000 0x1 0x00000000>; >> + resets = <&syscon_apmu 76>, >> + <&syscon_apmu 78>, >> + <&syscon_apmu 77>; >> + reset-names = "dbi", "mstr", "slv"; >> + linux,pci-domain = <0>; >> + spacemit,apmu = <&syscon_apmu 0x1f0>; >> + }; >> + }; >> + >> -- >> 2.54.0 >> >