linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: "Hui Ma (马慧)" <Hui.Ma@airoha.com>,
	"Ryder Lee" <Ryder.Lee@mediatek.com>,
	"Jianjun Wang (王建军)" <Jianjun.Wang@mediatek.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Rob Herring" <robh@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"Frank Li" <Frank.li@nxp.com>, upstream <upstream@airoha.com>
Subject: Re: 回复: [PATCH v2 2/2] PCI: mediatek-gen3: Configure PBUS_CSR registers for EN7581 SoC
Date: Sat, 22 Feb 2025 00:18:52 +0100	[thread overview]
Message-ID: <Z7kJ3Ejd4Mi_Lj0b@lore-desk> (raw)
In-Reply-To: <20250221183131.GA353053@bhelgaas>

[-- Attachment #1: Type: text/plain, Size: 2459 bytes --]

[...]

> >
> > 	Pbus-csr (base and mask) is used to determine the address
> > 	range can be access by PCIe bus.
> > 
> > 1FBE3400 PCIE0_MEM_BASE 32 PCIE0 base address
> > 1FBE3404 PCIE0_MEM_MASK 32 PCIE0 base address mask
> > 1FBE3408 PCIE1_MEM_BASE 32 PCIE1 base address
> > 1FBE340C PCIE1_MEM_MASK 32 PCIE1 base address mask
> > 1FBE3410 PCIE2_MEM_BASE 32 PCIE2 base address
> > 1FBE3414 PCIE2_MEM_MASK 32 PCIE2 base address mask
> 
> "Can be accessed by PCIe bus" sounds like DMA.  Is that what you mean?
> 
> I doubt it, because if you have multiple host bridges, I assume they
> would all be able to handle DMA to all of system memory.
> 
> It would make more sense if this is some sort of description of host
> bridge apertures, e.g., something like this to allow CPU MMIO accesses
> to reach the first 2GB of PCI memory space below any of the pcie0,
> pcie1, pcie2 host bridges:
> 
>   pcie0 0000:00: root bus resource [mem 0x84000000000-0x8407fffffff] (bus address [0x00000000-0x7fffffff])
>   pcie1 0001:00: root bus resource [mem 0x84100000000-0x8417fffffff] (bus address [0x00000000-0x7fffffff])
>   pcie2 0002:00: root bus resource [mem 0x84200000000-0x8427fffffff] (bus address [0x00000000-0x7fffffff])
> 
> But I think this would be described via 'ranges' properties.  And I
> think it would make sense if the driver had to learn this address map
> from devicetree and program it into the hardware, so maybe that's
> what Pbus-csr is for?  Total speculation on my part.

I agree we should provide these info to the driver via the dts.

Do you agree to pass the register offsets, base address and base mask values
in the 'mediatek,pbus-csr' phandle array? Something like:

pcie0: pcie@1fc00000 {
	...
	mediatek,pbus-csr = <&pbus_csr 0x0 0x20000000 0x4 0xfc000000>;
	...
}

where:
- reg offset for base address:	0x0
- base address value:		0x20000000
- reg offset for base mask:	0x4
- base mask value:		0xfc000000

Or do you prefer to just pass register offsets in mediatek,pbus-csr phandle
array and get base address values reading ranges property? Something like:

pcie0: pcie@1fc00000 {
	...
	ranges = <0x02000000 0 0x20000000 0x0 0x20000000 0 0x4000000>;
	...
	mediatek,pbus-csr = <&pbus_csr 0x0 0x4>;
	...
}

Considering the latter, even if it is not a real problem for EN7581 since we
have just a single range, what if we have multiple ranges?

Regards,
Lorenzo

> 
> Bjorn

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2025-02-21 23:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-02 19:34 [PATCH v2 0/2] PCI: mediatek-gen3: Set PBUS_CSR regs for Airoha EN7581 SoC Lorenzo Bianconi
2025-02-02 19:34 ` [PATCH v2 1/2] dt-bindings: PCI: mediatek-gen3: Add mediatek,pbus-csr phandle property Lorenzo Bianconi
2025-02-04  8:14   ` Krzysztof Kozlowski
2025-02-02 19:34 ` [PATCH v2 2/2] PCI: mediatek-gen3: Configure PBUS_CSR registers for EN7581 SoC Lorenzo Bianconi
2025-02-14 17:11   ` Manivannan Sadhasivam
2025-02-17 12:19     ` Lorenzo Bianconi
2025-02-19 18:26   ` Manivannan Sadhasivam
2025-02-20 20:23     ` Frank Li
2025-02-20 22:39       ` Lorenzo Bianconi
2025-02-20 18:20   ` Bjorn Helgaas
2025-02-20 19:54     ` Lorenzo Bianconi
2025-02-20 23:56       ` Bjorn Helgaas
2025-02-21  9:20         ` Lorenzo Bianconi
2025-02-21  9:30           ` 回复: " Hui Ma (马慧)
2025-02-21 18:31             ` Bjorn Helgaas
2025-02-21 23:18               ` Lorenzo Bianconi [this message]
2025-02-22  0:07                 ` Bjorn Helgaas

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=Z7kJ3Ejd4Mi_Lj0b@lore-desk \
    --to=lorenzo@kernel.org \
    --cc=Frank.li@nxp.com \
    --cc=Hui.Ma@airoha.com \
    --cc=Jianjun.Wang@mediatek.com \
    --cc=Ryder.Lee@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=bhelgaas@google.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=helgaas@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=matthias.bgg@gmail.com \
    --cc=robh@kernel.org \
    --cc=upstream@airoha.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;
as well as URLs for NNTP newsgroup(s).