Devicetree
 help / color / mirror / Atom feed
From: Jia Wang <wangjia@ultrarisc.com>
To: Manivannan Sadhasivam <mani@kernel.org>
Cc: "Jia Wang" <wangjia@ultrarisc.com>,
	"Paul Walmsley" <pjw@kernel.org>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Alexandre Ghiti" <alex@ghiti.fr>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Xincheng Zhang" <zhangxincheng@ultrarisc.com>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v3 3/3] PCI: ultrarisc: Add UltraRISC DP1000 PCIe Root Complex driver
Date: Fri, 24 Apr 2026 16:08:06 +0800	[thread overview]
Message-ID: <177701808603.4074358.3746548668378362054.b4-reply@b4> (raw)
In-Reply-To: <yqxyjv2q4lp5ymb6mjzpldjp2folqsvu4qneaihapbchrcithl@tcj4gu3ez3wh>

On 2026-04-23 18:34 +0530, Manivannan Sadhasivam wrote:
> On Thu, Apr 23, 2026 at 06:14:48PM +0800, Jia Wang wrote:
> 
> [...]
> 
> > > > +	int ret;
> > > > +
> > > > +	pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);
> > > > +	if (!pcie)
> > > > +		return -ENOMEM;
> > > > +
> > > > +	pci = devm_kzalloc(dev, sizeof(*pci), GFP_KERNEL);
> > > > +	if (!pci)
> > > > +		return -ENOMEM;
> > > > +
> > > > +	pci->dev = dev;
> > > > +	pci->ops = &dw_pcie_ops;
> > > > +
> > > > +	/* Set a default value suitable for at most 16 in and 16 out windows */
> > > > +	pci->atu_size = SZ_8K;
> > > > +	pci->max_link_speed = 4;
> > > 
> > > Get this from DT please... This can change between SoC revisions.
> > >
> > 
> > During the v2 DT binding review, Krzysztof pointed out that since the
> > properties are fixed for this hardware, they are deducible from the
> > compatible string and should be dropped from the DT bindings.
> > 
> > The v2 discussion is here:
> > https://lore.kernel.org/all/c60a712e-ecf3-4926-9947-0e593cdb921d@kernel.org/
> > 
> > I then moved them into the driver for v3. If future SoC revisions introduce
> > variations, I'll update the driver to handle them accordingly.
> > 
> > Does this make sense?
> > 
> 
> There are two uses of this property:
> 
> 1. To provide default Max Link Speed of the Root Port(s) if the hardware default
> value is wrong.'
> 
> 2. To override the hardware default to workaround the hardware issues like
> broken PCB routing etc...
> 
> For the first usecase, you need to check if this value different from
> PCI_EXP_LNKCAP_SLS field of LNKCAP register? If not, you don't need to set it
> in soc.dtsi/dt-binding and the DWC core will extract this value from the DBI
> register.
> 
> For the second case, you don't need to define it in your controller dt-binding
> with a default value and also in your soc.dtsi. Since this property is defined
> in the dtschema [1], you can just include the property in board DTS file to
> workaround hardware issues (board specific) and dtbs_check will not complain.
> 
> NOTE: For both cases, you don't need driver changes, since DWC core will handle
> it.
> 
> - Mani
> 
> [1] https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/pci/pci-bus-common.yaml#L117
>

Thanks for the detailed explanation, Mani.

That makes perfect sense. I have confirmed that the hardware default value
for our SoC is correct and there is currently no need for board-level
overrides.

Following your suggestion, I will remove the hardcoded max-link-speed from
the driver in v4 and rely on the DWC core to handle it. If a board-level
workaround becomes necessary in the future, we can add the property in the
board DTS file without touching the driver.

> > > > +	pcie->pci = pci;
> > > > +
> > > > +	pp = &pci->pp;
> > > > +
> > > > +	platform_set_drvdata(pdev, pcie);
> > > > +
> > > > +	pp->irq = platform_get_irq(pdev, 1);
> > > > +	if (pp->irq < 0)
> > > > +		return pp->irq;
> > > 
> > > Who is requesting this IRQ?
> > > 
> > 
> > Not needed. Will remove it in v4.
> > 
> > > > +
> > > > +	pp->num_vectors = MAX_MSI_IRQS;
> > > 
> > > Are you sure your controller supports 256 MSIs with one SPI interrupt? It is
> > > possible, but want to make sure it is the case.
> > > 
> > 
> > Yes. The controller implements 8 MSI control blocks (i = 0..7), each
> > providing 32 vectors, so 256 MSIs are supported. This is documented in the
> > controller IP specification.
> >
> 
> Ok, thanks for confirming.
> 
> - Mani
> 
> -- 
> மணிவண்ணன் சதாசிவம்
> 

Best Regards,
Jia Wang



      reply	other threads:[~2026-04-24  8:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-15  7:21 [PATCH v3 0/3] riscv: Add PCIe support for UltraRISC DP1000 SoC Jia Wang
2026-04-15  7:21 ` [PATCH v3 1/3] riscv: add UltraRISC SoC family Kconfig support Jia Wang
2026-04-15 14:28   ` Conor Dooley
2026-04-15  7:21 ` [PATCH v3 2/3] dt-bindings: PCI: Add UltraRISC DP1000 PCIe controller Jia Wang
2026-04-16  8:45   ` Krzysztof Kozlowski
2026-04-15  7:21 ` [PATCH v3 3/3] PCI: ultrarisc: Add UltraRISC DP1000 PCIe Root Complex driver Jia Wang
2026-04-22 16:47   ` Manivannan Sadhasivam
2026-04-23 10:14     ` Jia Wang
2026-04-23 13:04       ` Manivannan Sadhasivam
2026-04-24  8:08         ` Jia Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=177701808603.4074358.3746548668378362054.b4-reply@b4 \
    --to=wangjia@ultrarisc.com \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=bhelgaas@google.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jingoohan1@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=kwilczynski@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=robh@kernel.org \
    --cc=zhangxincheng@ultrarisc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox