From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (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 2A992369207 for ; Sun, 12 Jul 2026 05:44:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783835059; cv=none; b=B1tHa0fM4AMuFlfqXcDrxNy4dL8jOJwOiqAUMD8iQfX4LsL+T2H48K2dS4o5WQHwX77adUtg5BFRTcinTUOBWCZAeMzIeYf1pPzDnjLGvvtgQ/1d7OGFt1KGqgTbvA577fpoRawUQejDRGi/aG49fQ/sM7P2CVdWdtj4zQ6Rstk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783835059; c=relaxed/simple; bh=IaU5AQLMyj4VZ3NhJA/7Pd/ODMHBYTuf7q8H473n99g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ExgSWScWFGScUxh0td6kuytf+MZYGx/yAYy2udhyfEfCNnnYcirbtO0vWekQyKsZvy0QXyScOAcdwta8Jxw+YPzrO+Z9hMqzXVLphzpjPiHqZOmh1pPAHEZK8HwKyqaKK5xNRaEVoJI6rPK6y/nLH1h++CKNB6e4EQsJuIi2WkU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=soBcSKEf; arc=none smtp.client-ip=209.85.216.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="soBcSKEf" Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-38101f85591so2340072a91.1 for ; Sat, 11 Jul 2026 22:44:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783835057; x=1784439857; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=tHBOsAK2LL1+dFyhqlDju8abtbkr9TbGvS+9b0ZjGQ4=; b=soBcSKEfjBw2guFkEI7x++GK35nEB/Zdh1vDjdljFLB8KBxFpknyrHL+7Rgt1Dy9gk EOH0BjR6MdxG7Z3bL3f6Vjd7s9EZZJyrnhCXDLIHTZPym1zJQGFxceeoaACf5/UyBhQy Gsr+f/EV9/ZVZGtDVGYz7xoTDYiyGUWMZ+LKX7zsOjCJc7gjoIIczRfSLR+FcaHY47mP Rdbb1UQIirwrIqVdgJ10l1/57vpNdau11fD6VEAmQmvya0nWISLmVtIqhy/UOZv5qnpU Td9kN75ZEtFdWm41Hm3gPAI0bwIYVUU6pwY5+o+Q55y9prnlAJopOZ2qMQFjkSyyhw0s 7uZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783835057; x=1784439857; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=tHBOsAK2LL1+dFyhqlDju8abtbkr9TbGvS+9b0ZjGQ4=; b=TjG8xKPQwawgbxzTkKfNlfyOk/giT8c6zruAQJQkxSM8KTlWYYDQ3vtji9mHMv2UMi LlUnFMfs5vflTbAPZTXI/NSnGPfTg0/P/h8cHym+jRG7Vrksr+oqrZo7Tkqhcyb/gNrC lrYmyyc5QMM04PGkl6oHB3717k21DEngV7rtv6N0D2Xo2DL6yY/dzoIi+/zUuZVi7SCu IL5djgF0grpjdJobwF3o73obQtkECl1AI1TBpgK6XlkIZu6+NICAx9zlQUT3twC7+nFY dTJuntC4B7Y2PXf10LHRfntFxFggJTkanJGYuXfNmQOCwykfcia+6jGonZWrG+wcfY4Q GXCA== X-Forwarded-Encrypted: i=1; AHgh+Rptl3MN6f2lCtSj9q3Uyz3i7nV+vVa+UEaSQc2UlRPE7N5q1zOKqFe5ZUfyhoBTJpm6q1VbYr6y3e9bXSY=@vger.kernel.org X-Gm-Message-State: AOJu0YxEdnQ5CBkVCteOdktPlT7zqLe0jr1RuQMow395BDZMHy7x/d8p vjLbZYUy61J4iG3Qs/YSfKSQY/gLekXpFwlc9c0NWTH7SvbRgqr1RTlT X-Gm-Gg: AfdE7cmIpgCDGnwhEye267QR9etJ6ELxRKYDVLN0hELjilZaHRrphtmsJ6Me0oJYBsL q3XDhP8koDXVOXBYDCWCqYOtghO5aCKWKDGmuQFMBG30TiZ6RRxeaAAExg29eM8H8lY5ORvKPQy Bl1njgq5W3EFnwGm8Lc1wf3ZPYQsprR1DKRcnKZEqEACciwe3jezE8u3NAvigNOHCEOzrD/NZlD gwyYOoBL+/Ikn63gGcfDH3lQ1zn59Y3Xjje4ECXOEW+CIfPYb++JglVg9i+brRySkCsQ61Wcx5t NE66K3LsSuzKY/AQwHqqNi1Lsr8b0vePgsjnpVEswIcT2lggtSWqYz4DNSX1JSv4MF85htMp4l+ nuICWqlijtyLXq664tQTnQ8ItqAjreaaxpHwz/gteiyOQaPds4iL8ROWBzf+YBSwL X-Received: by 2002:a17:90b:5903:b0:37f:9e21:91d8 with SMTP id 98e67ed59e1d1-38dc834de8fmr3876818a91.15.1783835057412; Sat, 11 Jul 2026 22:44:17 -0700 (PDT) Received: from localhost ([2001:da8:7001:11::cb]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38d11280409sm1900696a91.0.2026.07.11.22.44.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jul 2026 22:44:17 -0700 (PDT) Date: Sun, 12 Jul 2026 13:43:33 +0800 From: Inochi Amaoto To: Alex Elder , Inochi Amaoto , Jingoo Han , Manivannan Sadhasivam , Bjorn Helgaas , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Yixun Lan , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Christian Bruel , Frank Li , Nam Cao , Qiang Yu , Krishna Chaitanya Chundru , Xincheng Zhang , Siddharth Vadapalli , Andy Shevchenko , Vidya Sagar , Neil Armstrong , Gustavo Pimentel Cc: 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 Subject: Re: [PATCH v4 5/6] dt-bindings: PCI: spacemit: Introduce Spacemit K3 PCIe host controller Message-ID: References: <20260709040027.958400-1-inochiama@gmail.com> <20260709040027.958400-6-inochiama@gmail.com> <58948c74-0990-449e-8eee-88cbb38db7e7@riscstar.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <58948c74-0990-449e-8eee-88cbb38db7e7@riscstar.com> On Fri, Jul 10, 2026 at 11:01:38AM -0500, Alex Elder wrote: > On 7/8/26 11:00 PM, 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 > > This looks OK to me. What I see is that K3 does not require > the interrupts and interrupt-names properties, allows up to > six PHYs (not just one), and adds a dbi2 register that is not > used by K1. > > I might have missed it, but I don't see where the dbi2 register > is used by the K3 code you have added. In pcie-designware.c, > I see that if no "dbi2" resource is found, memory at offset > 4096 from the "dbi" base is used. Does that apply for K3? > If so, maybe there's no need to define dbi2. > > -Alex > Weird, I have found the following logic in dw_pcie_get_resources() of pcie-designware.c ``` /* DBI2 is mainly useful for the endpoint controller */ if (!pci->dbi_base2) { res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dbi2"); if (res) { pci->dbi_base2 = devm_pci_remap_cfg_resource(pci->dev, res); if (IS_ERR(pci->dbi_base2)) return PTR_ERR(pci->dbi_base2); } else { pci->dbi_base2 = pci->dbi_base + SZ_4K; } } ``` Regards, Inochi > > --- > > .../bindings/pci/spacemit,k1-pcie-host.yaml | 50 ++++++++++++++++--- > > 1 file changed, 43 insertions(+), 7 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/pci/spacemit,k1-pcie-host.yaml b/Documentation/devicetree/bindings/pci/spacemit,k1-pcie-host.yaml > > index c4c00b5fcdc0..54817d6fd9af 100644 > > --- a/Documentation/devicetree/bindings/pci/spacemit,k1-pcie-host.yaml > > +++ b/Documentation/devicetree/bindings/pci/spacemit,k1-pcie-host.yaml > > @@ -14,26 +14,29 @@ description: > > > 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 > > + enum: > > + - spacemit,k1-pcie > > + - spacemit,k3-pcie > > reg: > > + minItems: 4 > > items: > > - description: DesignWare PCIe registers > > - description: ATU address space > > - description: PCIe configuration space > > - description: Link control registers > > + - description: Data Bus Interface (DBI) shadow registers. > > reg-names: > > + minItems: 4 > > items: > > - const: dbi > > - const: atu > > - const: config > > - const: link > > + - const: dbi2 > > clocks: > > items: > > @@ -66,6 +69,8 @@ properties: > > interrupt-names: > > const: msi > > + msi-parent: true > > + > > spacemit,apmu: > > $ref: /schemas/types.yaml#/definitions/phandle-array > > description: > > @@ -84,7 +89,8 @@ patternProperties: > > properties: > > phys: > > - maxItems: 1 > > + minItems: 1 > > + maxItems: 6 > > vpcie3v3-supply: > > description: > > @@ -96,13 +102,43 @@ patternProperties: > > unevaluatedProperties: false > > +allOf: > > + - $ref: /schemas/pci/snps,dw-pcie.yaml# > > + - if: > > + properties: > > + compatible: > > + contains: > > + const: spacemit,k1-pcie > > + then: > > + properties: > > + reg: > > + maxItems: 4 > > + > > + reg-names: > > + maxItems: 4 > > + > > + patternProperties: > > + '^pcie@': > > + properties: > > + phys: > > + maxItems: 1 > > + > > + required: > > + - interrupts > > + - interrupt-names > > + else: > > + properties: > > + reg: > > + minItems: 5 > > + > > + reg-names: > > + minItems: 5 > > + > > required: > > - clocks > > - clock-names > > - resets > > - reset-names > > - - interrupts > > - - interrupt-names > > - spacemit,apmu > > unevaluatedProperties: false > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv