From: Frank Li <Frank.li@nxp.com>
To: nobuhiro1.iwamatsu@toshiba.co.jp
Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
lpieralisi@kernel.org, kwilczynski@kernel.org, mani@kernel.org,
bhelgaas@google.com, linux-arm-kernel@lists.infradead.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org
Subject: Re: [PATCH RFT 1/2] arm64: dts: toshiba: Update SoC and PCIe ranges to reflect hardware behavior
Date: Mon, 28 Jul 2025 10:26:01 -0400 [thread overview]
Message-ID: <aIeIeQsDLz53aAHR@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <TY7PR01MB1481875AD0293961D0DB8738E925AA@TY7PR01MB14818.jpnprd01.prod.outlook.com>
On Mon, Jul 28, 2025 at 05:38:25AM +0000, nobuhiro1.iwamatsu@toshiba.co.jp wrote:
> Hi Frank,
>
> Thanks for your patch, and sorry reply was too late.
>
> > -----Original Message-----
> > From: Frank Li <Frank.Li@nxp.com>
> > Sent: Saturday, June 14, 2025 6:33 AM
> > To: iwamatsu nobuhiro(岩松 信洋 □DITC○CPT)
> > <nobuhiro1.iwamatsu@toshiba.co.jp>; Rob Herring <robh@kernel.org>;
> > Krzysztof Kozlowski <krzk+dt@kernel.org>; Conor Dooley
> > <conor+dt@kernel.org>; Lorenzo Pieralisi <lpieralisi@kernel.org>; Krzysztof
> > Wilczyński <kwilczynski@kernel.org>; Manivannan Sadhasivam
> > <mani@kernel.org>; Bjorn Helgaas <bhelgaas@google.com>
> > Cc: linux-arm-kernel@lists.infradead.org; devicetree@vger.kernel.org;
> > linux-kernel@vger.kernel.org; linux-pci@vger.kernel.org; Frank Li
> > <Frank.Li@nxp.com>
> > Subject: [PATCH RFT 1/2] arm64: dts: toshiba: Update SoC and PCIe ranges to
> > reflect hardware behavior
> >
> > tmpv7708 trim address bit[31:30] in tmpv7708 before passing to the PCIe
> > controller. So add a 'ranges' entry under the parent bus 'soc' to map address 0x0
> > to 0x40000000.
> >
> > Update the PCIe node's 'config' and 'ranges' properties to use the real upstream
> > bus address.
> >
> > Ensure there is no functional impact on the final address translation result.
> >
> > Prepare for the removal of the driver’s cpu_addr_fixup().
> >
> > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > ---
> > arch/arm64/boot/dts/toshiba/tmpv7708.dtsi | 16 ++++++++++++----
> > 1 file changed, 12 insertions(+), 4 deletions(-)
> >
> > diff --git a/arch/arm64/boot/dts/toshiba/tmpv7708.dtsi
> > b/arch/arm64/boot/dts/toshiba/tmpv7708.dtsi
> > index 39806f0ae5133..2a18aa93d4723 100644
> > --- a/arch/arm64/boot/dts/toshiba/tmpv7708.dtsi
> > +++ b/arch/arm64/boot/dts/toshiba/tmpv7708.dtsi
> > @@ -147,7 +147,15 @@ soc {
> > #size-cells = <2>;
> > compatible = "simple-bus";
> > interrupt-parent = <&gic>;
> > - ranges;
> > + ranges = /* register 1:1 map */
> > + <0x0 0x24000000 0x0 0x24000000 0x0 0x10000000>,
> > + /*
> > + * bus fabric mask address bit 30 and 31 to 0
> > + * before send to PCIe controller.
> > + *
> > + * PCIe map address 0 to cpu's 0x40000000
> > + */
> > + <0x0 0x00000000 0x0 0x40000000 0x0 0x40000000>;
> >
> > gic: interrupt-controller@24001000 {
> > compatible = "arm,gic-400";
> > @@ -481,7 +489,7 @@ pwm: pwm@241c0000 {
> > pcie: pcie@28400000 {
> > compatible = "toshiba,visconti-pcie";
> > reg = <0x0 0x28400000 0x0 0x00400000>,
> > - <0x0 0x70000000 0x0 0x10000000>,
> > + <0x0 0x30000000 0x0 0x10000000>,
>
> If my understanding is correct, this setting conflicts with the address space this patch changed
> ranges above. Therefore, it does not work.
>
> 0x24000000 + 0x10000000 > 0x30000000
You are right. Address map should only happen at pci fabic.
So we should not touch soc's ranges.
soc {
...
pci-bus {
ranges = /* register 1:1 map */
<0x0 0x24000000 0x0 0x24000000 0x0 0x10000000>,
/*
* bus fabric mask address bit 30 and 31 to 0
* before send to PCIe controller.
*
* PCIe map address 0 to cpu's 0x40000000
*/
<0x0 0x00000000 0x0 0x40000000 0x0 0x40000000>;
pci@0x24000000 {
...
}
}
}
Do you need me send v2 for your test?
Frank
>
> By reducing 0x10000000 to 0xc000000, it will fit within the 0x30000000 range.
> And by adding the following to the driver:
> ```
> pci->use_parent_dt_ranges = true;
> ```
>
> the PCIe will work, but this setting prevents access to devices located after 0x30000000.
> Is there any other DT method to avoid this?
>
> Best regards,
> Nobuhiro
next prev parent reply other threads:[~2025-07-28 14:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-13 21:33 [PATCH RFT 0/2] pci: clean up cpu_addr_fixup() for visconti Frank Li
2025-06-13 21:33 ` [PATCH RFT 1/2] arm64: dts: toshiba: Update SoC and PCIe ranges to reflect hardware behavior Frank Li
2025-07-28 5:38 ` nobuhiro1.iwamatsu
2025-07-28 14:26 ` Frank Li [this message]
2025-07-30 0:13 ` nobuhiro1.iwamatsu
2025-06-13 21:33 ` [PATCH RFT 2/2] PCI: dwc: visconti: Remove cpu_addr_fix() after DTS fix ranges Frank Li
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=aIeIeQsDLz53aAHR@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=bhelgaas@google.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=nobuhiro1.iwamatsu@toshiba.co.jp \
--cc=robh@kernel.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