Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Frank Li <Frank.li@nxp.com>
Cc: "Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Jon Mason" <jdmason@kudzu.us>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Kishon Vijay Abraham I" <kishon@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Damien Le Moal" <dlemoal@kernel.org>,
	"Jesper Nilsson" <jesper.nilsson@axis.com>,
	linux-pci@vger.kernel.org
Subject: Re: DWC PCIe endpoint iATU vs BAR MASK ordering
Date: Fri, 22 Nov 2024 14:00:21 +0100	[thread overview]
Message-ID: <Z0CAZZy8U5fMmOYs@ryzen> (raw)
In-Reply-To: <Zz4eTVyh73SQo60q@lizhi-Precision-Tower-5810>

On Wed, Nov 20, 2024 at 12:37:17PM -0500, Frank Li wrote:
> Maybe off topic, I think if support combine some segmement address to
> one bar should be wonderful, such as combine MSI ITS address and other
> register to BAR0. It is not worth to waste one bar, which just for
> doorbell.

I was thinking about this as well.

If we want a single BAR to redirect to two different physical memory areas,
then we can no longer use BAR Match Mode.

Sure, we could use two different iATUs and use Address Match Mode.
However, the problem is that the minimum size of an Address Translation
Region (CX_ATU_MIN_REGION_SIZE). E.g. on rk3588 CX_ATU_MIN_REGION_SIZE
is 64k...

So we would need to split the BAR in chunks of CX_ATU_MIN_REGION_SIZE.

If we look at e.g. the NVMe doorbells in BAR0, they are defined to
start at offset 0x1000 (4k).
See "Figure 4: PCI Express Specific Controller Property Definitions" in:
https://nvmexpress.org/wp-content/uploads/NVM-Express-PCI-Express-Transport-Specification-Revision-1.1-2024.08.05-Ratified.pdf

So, since that fixed offset is smaller than CX_ATU_MIN_REGION_SIZE,
we are out of luck... (at least for rk3588).

But.. perhaps the idea is still worth it?
For controllers that have CX_ATU_MIN_REGION_SIZE == 4k,
they could use one iATU for offset 0x-0xfff, and
another iATU for 0x1000-0x1fff.

(And of course, NVMe is just one specification out of many...)

I have no idea how CX_ATU_MIN_REGION_SIZE is set on NXP DWC PCIe
controllers.


Kind regards,
Niklas

  parent reply	other threads:[~2024-11-22 13:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-19  9:44 DWC PCIe endpoint iATU vs BAR MASK ordering Niklas Cassel
2024-11-20 17:37 ` Frank Li
2024-11-22 12:12   ` Niklas Cassel
2024-11-22 13:00   ` Niklas Cassel [this message]
2024-12-02 14:59 ` Manivannan Sadhasivam

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=Z0CAZZy8U5fMmOYs@ryzen \
    --to=cassel@kernel.org \
    --cc=Frank.li@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=dlemoal@kernel.org \
    --cc=jdmason@kudzu.us \
    --cc=jesper.nilsson@axis.com \
    --cc=jingoohan1@gmail.com \
    --cc=kishon@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    /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