From: Peter Maydell <peter.maydell@linaro.org>
To: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>,
qemu-devel@nongnu.org, Radoslaw Biernacki <rad@semihalf.com>,
qemu-arm@nongnu.org
Subject: Re: [PATCH 1/1] hw/arm/sbsa-ref: add PCIe node into DT
Date: Tue, 4 Jul 2023 14:21:54 +0100 [thread overview]
Message-ID: <CAFEAcA8mk0upQUqXsdm3YXvRjAJc+6npkXAWWLtHS+3A8bMJKA@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA_rg4CbE1Y9mTQmPs_KBqb-S=3Z5Hh78gbVUD6R7DR0hg@mail.gmail.com>
On Tue, 27 Jun 2023 at 14:27, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Tue, 27 Jun 2023 at 13:52, Leif Lindholm <quic_llindhol@quicinc.com> wrote:
> >
> > On 2023-06-27 13:12, Peter Maydell wrote:
> > > On Mon, 26 Jun 2023 at 08:52, Marcin Juszkiewicz
> > > <marcin.juszkiewicz@linaro.org> wrote:
> > >>
> > >> Add PCI Express information into DeviceTree as part of SBSA-REF
> > >> versioning.
> > >>
> > >> Trusted Firmware will read it and provide to next firmware level.
> > >>
> > >> Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
> > >> ---
> > >> hw/arm/sbsa-ref.c | 20 ++++++++++++++++++++
> > >> 1 file changed, 20 insertions(+)
> > >>
> > >> diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
> > >> index 0639f97dd5..b87d2ee3b2 100644
> > >> --- a/hw/arm/sbsa-ref.c
> > >> +++ b/hw/arm/sbsa-ref.c
> > >> @@ -171,6 +171,25 @@ static uint64_t sbsa_ref_cpu_mp_affinity(SBSAMachineState *sms, int idx)
> > >> return arm_cpu_mp_affinity(idx, clustersz);
> > >> }
> > >>
> > >> +static void sbsa_fdt_add_pcie_node(SBSAMachineState *sms)
> > >> +{
> > >> + char *nodename;
> > >> +
> > >> + nodename = g_strdup_printf("/pcie");
> > >> + qemu_fdt_add_subnode(sms->fdt, nodename);
> > >> + qemu_fdt_setprop_sized_cells(sms->fdt, nodename, "reg",
> > >> + 2, sbsa_ref_memmap[SBSA_PCIE_ECAM].base,
> > >> + 2, sbsa_ref_memmap[SBSA_PCIE_ECAM].size,
> > >> + 2, sbsa_ref_memmap[SBSA_PCIE_PIO].base,
> > >> + 2, sbsa_ref_memmap[SBSA_PCIE_PIO].size,
> > >> + 2, sbsa_ref_memmap[SBSA_PCIE_MMIO].base,
> > >> + 2, sbsa_ref_memmap[SBSA_PCIE_MMIO].size,
> > >> + 2, sbsa_ref_memmap[SBSA_PCIE_MMIO_HIGH].base,
> > >> + 2, sbsa_ref_memmap[SBSA_PCIE_MMIO_HIGH].size);
> > >> +
> > >> + g_free(nodename);
> > >
> > >
> > > Why do we need to do this? The firmware should just
> > > know exactly where the PCIE windows are, the same way
> > > it knows where the flash, the UART, the RTC etc etc
> > > all are in the memory map.
> >
> > That is not automatically true (it was not for at least one SoC I have
> > worked on). In a real system which had these dynamically decided, some
> > coprocessor would program the CMN to route these address ranges to
> > certain offsets within certain components, and that same coprocessor
> > could then provide a mechanism for how TF-A could discover these and
> > provide it to later-stage firmware via SiP SMC calls.
> >
> > Sticking the information in the DT lets us emulate this without actually
> > emulating the CMN and the coprocessor, and prototype (and verify) the
> > same firmware interfaces for developing i.e. edk2 support.
>
> OK. This is the kind of rationale that needs to be described
> in the commit message and comments, though, so it's clear
> why the PCI controller is special in this way.
Just to be clear about the status of this patch, I don't
have a problem with the code changes, but it does definitely
need a much clearer commit message to explain why we're changing
the way we handle the PCI controller. So I'm dropping this from
my to-review list on the assumption there will be a v2.
We could also do with expanding the commentary in the source
file to clarify the design approach we're using w.r.t. what
we do and don't want to put into the "dt" blob, but that would
probably be best in a different patch.
thanks
-- PMM
next prev parent reply other threads:[~2023-07-04 13:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-26 7:51 [PATCH 1/1] hw/arm/sbsa-ref: add PCIe node into DT Marcin Juszkiewicz
2023-06-27 12:12 ` Peter Maydell
2023-06-27 12:52 ` Leif Lindholm
2023-06-27 13:27 ` Peter Maydell
2023-06-27 14:09 ` Leif Lindholm
2023-06-27 14:27 ` Peter Maydell
2023-06-27 15:38 ` Leif Lindholm
2023-07-04 13:21 ` Peter Maydell [this message]
2023-07-04 13:38 ` Marcin Juszkiewicz
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=CAFEAcA8mk0upQUqXsdm3YXvRjAJc+6npkXAWWLtHS+3A8bMJKA@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=marcin.juszkiewicz@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=quic_llindhol@quicinc.com \
--cc=rad@semihalf.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).