From: "Arnd Bergmann" <arnd@arndb.de>
To: "Semih Baskan" <strst.gs@gmail.com>
Cc: "Bjorn Helgaas" <helgaas@kernel.org>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Rob Herring" <robh@kernel.org>,
bhelgaas@google.com, "Ray Jui" <rjui@broadcom.com>,
"Scott Branden" <sbranden@broadcom.com>,
bcm-kernel-feedback-list@broadcom.com,
"Rafał Miłecki" <rafal@milecki.pl>,
"Rafał Miłecki" <zajec5@gmail.com>,
"Florian Fainelli" <florian.fainelli@broadcom.com>,
linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, "Rosen Penev" <rosenp@gmail.com>,
rani.hod@gmail.com
Subject: Re: [PATCH] PCI: iproc: Use pci_alloc_host_bridge() on BCMA
Date: Fri, 18 Sep 2026 19:46:42 +0200 [thread overview]
Message-ID: <95e4b5ed-2f72-4bfe-85d8-9cd7b45a5fa7@app.fastmail.com> (raw)
In-Reply-To: <CAAsRjR=sHgZMgXuTid+D7Vst=N_GBUZUrduZ4YZax5rbotHNMg@mail.gmail.com>
On Fri, Sep 18, 2026, at 18:25, Semih Baskan wrote:
> On Fri, Sep 18, 2026 at 12:32:12PM +0200, Arnd Bergmann wrote:
>> If the DT window doesn't match, how does the bcma driver find
>> the device node that corresponds to the EROM entry to populate
>> the child nodes?
>
> By reg. bcma_of_find_child_device() in drivers/bcma/main.c compares the
> first reg address of each child of the axi node with the core's register
> base from the EROM. That base is 0x18012000, 0x18013000 and 0x18014000
> on both revisions; only the outbound window differs. The pcie node's
> ranges is not looked at. The reg is translated through the axi node's
> first ranges entry. The PCI core then matches the wifi nodes below that
> node by devfn.
Ok, makes sense.
>> The driver should probably check earlier if the device is
>> already bound to the bcma bus, rather than just trying to
>> request the bus windows. If anything, I would have expected
>> the conflict on the 18012000 address for the register
>> base.
>>
>> I see an ioremap() of bdev->addr in drivers/bcma/scan.c but
>> don't see a corresponding request_resource() for it, so maybe
>> an easy fix is to add this to the bcma bus scan and
>> make sure that always happens before the pci driver probe?
>
> In the tree as it is, neither side claims the register base. bcma
> only ioremaps it in scan.c, and pcie-iproc-platform maps its reg with
> devm_pci_remap_cfgspace(), which does not request the region either.
> That is why the window is the first thing the two collide on. On the
> ordering, bcma_bus_register() calls bcma_bus_scan(), then
> of_platform_default_populate(), then bcma_register_devices(), so the
> scan is done before the pcie platform devices are created and the
> bcma core devices are registered after that.
Ok, so adding the regular resource management to both sides here is
probably a good idea anyway, though it is not sufficient as long the
platform driver gets probed first.
>> If a board has nothing connected to one of the host bridges,
>> why is the pcie host bridge still marked as status="ok"?
>> Do you need a driver to put it into low-power mode, or
>> should this just be marked as disabled?
>
> The three nodes are in bcm-ns.dtsi without a status property, and no
> Northstar board file disables one. Which controllers carry a device
> differs per board: the RT-N18U has one on the first, the R8000 on the
> first, and on the second through a switch with two radios behind it.
> bcma takes the cores from the EROM, and bcma_register_devices() skips a
> core whose node is not available, so a node marked status = "disabled"
> is skipped there too, and neither driver would take that core. I do not
> know whether an unused core needs a driver for power.
Ok
>> Does the platform driver reprogram the windows to match the DT
>> description, or does it rely on the boot loader to ensure they
>> ranges/dma-ranges properties match the register contents?
>
> It programs OARR/OMAP from ranges only when the node has
> "brcm,pcie-ob", and the inbound side only when it has dma-ranges.
> The bcm-ns.dtsi nodes have neither, so it programs nothing and runs
> with what is in the registers at boot. The PAXB_BCMA register table
> has no OARR/OMAP at all, and the bcma driver never asks for an
> outbound mapping, so it does not program them either. OARR0/OMAP0
> are in the PAXB table the platform driver uses, at 0xd20 and 0xd40;
> I have not written them on revision 0x01. Broadcom's 2.6.36 driver
> writes OMAP/OARR 1:1 from its own table: 0x08000000, 0x40000000 and
> 0x48000000, with the last two replaced by 0x20000000 and 0x28000000
> when the core revision reads 0x07.
Ah, interesting. So if the problem with the platform driver
is that the outbound windows are mismatched between the register
settings and the ranges property, wouldn't it make sense to always
set "brcm,pcie-ob" for boards that are known to have more than
one possible setting in their firmware?
That way I would hope the platform driver can just work in the cases
that currently fail.
>> When using the bcma driver, does that update the ranges properties
>> in memory to match the EROM contents?
>
> No. 552aa843e4c5 drops the windows parsed from ranges out of the
> bridge's resource list and adds the EROM one; the patch in this
> thread reads ranges only to compare them with the EROM window. The
> property in the live tree is not touched, so /proc/device-tree keeps
> the dtsi values and the mismatch shows up only as the warning.
Ok. I suspect this may cause problems when someone uses an MFD
device that needs to translate internal registers of child device
through the ranges. It's probably not a big deal since those devices
are rare, just something to keep in mind.
Arnd
prev parent reply other threads:[~2026-09-18 17:50 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-07 16:05 [PATCH v3] PCI: iproc: Use the EROM outbound window " Semih Baskan
2026-09-10 11:14 ` Manivannan Sadhasivam
2026-09-11 19:14 ` Bjorn Helgaas
2026-09-12 4:32 ` Semih Baskan
2026-09-12 4:36 ` [PATCH] PCI: iproc: Use pci_alloc_host_bridge() " Semih Baskan
2026-09-14 17:46 ` Bjorn Helgaas
2026-09-16 8:12 ` Semih Baskan
2026-09-16 20:01 ` Bjorn Helgaas
2026-09-17 5:40 ` Semih Baskan
2026-09-17 15:59 ` Bjorn Helgaas
2026-09-17 18:02 ` Semih Baskan
2026-09-17 18:36 ` Bjorn Helgaas
2026-09-17 20:27 ` Arnd Bergmann
2026-09-17 21:48 ` Bjorn Helgaas
2026-09-18 5:46 ` Arnd Bergmann
2026-09-18 8:29 ` Semih Baskan
2026-09-18 10:32 ` Arnd Bergmann
2026-09-18 16:25 ` Semih Baskan
2026-09-18 17:46 ` Arnd Bergmann [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=95e4b5ed-2f72-4bfe-85d8-9cd7b45a5fa7@app.fastmail.com \
--to=arnd@arndb.de \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bhelgaas@google.com \
--cc=florian.fainelli@broadcom.com \
--cc=helgaas@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=rafal@milecki.pl \
--cc=rani.hod@gmail.com \
--cc=rjui@broadcom.com \
--cc=robh@kernel.org \
--cc=rosenp@gmail.com \
--cc=sbranden@broadcom.com \
--cc=strst.gs@gmail.com \
--cc=zajec5@gmail.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
all inboxes | Powered by JetHome®