public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@chromium.org>
Cc: Patrick Rudolph <patrick.rudolph@9elements.com>,
	u-boot@lists.denx.de,
	Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>,
	Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>,
	Bin Meng <bmeng.cn@gmail.com>,
	Peter Robinson <pbrobinson@gmail.com>
Subject: Re: [PATCH v6 25/37] board: emulation: Add QEMU sbsa support
Date: Thu, 3 Oct 2024 16:25:16 -0600	[thread overview]
Message-ID: <20241003222516.GW4737@bill-the-cat> (raw)
In-Reply-To: <CAFLszTi5nj-tXuO+UGJSPbJxqFtwQXkN8UsjT2hi1LF6zGLFHg@mail.gmail.com>

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

On Thu, Oct 03, 2024 at 02:46:03PM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On Thu, 3 Oct 2024 at 13:17, Tom Rini <trini@konsulko.com> wrote:
[snip]
> > We don't, but this isn't quite a normal board?
> 
> Don't be surprised if this becomes more common. For better or worse,
> ARM has decided on ACPI for its servers and RISC-V is following. We
> also have the EFI app, which has a devicetree, although of course no
> actual addresses.

True. And U-Boot being able to take and reasonably as far as the OS is
concerned be the UEFI implementation in UEFI+ACPI boot opens us up to
being able to be part of the software stack that's certified for
SystemReady ES and SR. On that real hardware we can certainly expect to
mandate that the previous part of the firmware stack gives us a device
tree. It will be TF-A and so the "pass over a device tree" part
shouldn't be an issue. And since yes, really (and for the future
record), real hardware isn't allowed to fake this out like we're
allowing here, today.

Heck, it's possible that down the line and it's important to a lot more
people, we can get the TF-A build for QEMU SBSA to have an option to
include a device tree for U-Boot, because it's an important part of the
stack for that project to be able to validate too.

> > > Breaking down the SBSA_UART_BASE_ADDR:
> > >
> > > - this is in the uart0 node so obviously relates to the UART
> > > - it is a reg property, so BASE_ADDR is obvious
> > > - SBSA is the board name, which is in the filename, so don't really add anything
> > >
> > > Normally where the devicetree needs a value defined, we put it in the
> > > dt-bindings directory. But even then, we don't typically put addresses
> > > there. It is just for cases where we need the code and the devicetree
> > > to be in sync about a property value. With addresses, the code reads
> > > them from the devicetree, so doesn't need to have a #define to access
> > > them...in fact that would defeat the purpose.
> > >
> > > If we did this sort of thing with other boards, we would have a heap
> > > of binding files containing addresses that are only used in one place.
> > > I just don't see the point.
> > >
> > > However for SBSA_PCIE_MMIO_BASE_ADDR I see that it is used in the .asl
> > > and the memory map, so it seems fair enough to define that, at least
> > > unless/until we can refer to devicetree addresses in the .asl file.
> > > Even with this one though, I would expect something like:
> > >
> > > ranges = <0x02000000>, /bits/ 64 <SBSA_PCIE_MMIO_BASE_ADDR
> > >
> > > SBSA_PCIE_MMIO_BASE_ADDR>;
> > >
> > > But in this case I can see how a macro might be more convenient and
> > > I'm not sure I have a strong opinion here.
> >
> > If you're strongly against using the macros here, OK, fine. But since
> > this tree is only going to be read by humans in U-Boot, and consumed by
> > U-Boot, I think it makes sense to deviate from the norms a little, in
> > favour of human readability.
> 
> How about only using them when there is code that need the same address?
> 
> There are two lots of macros so just to check we are talking about the
> same thing:
> 
> - xxx_BASE_ADDR - IMO they should be open-coded into the devicetree if
> it is the only user
> - MAKE_PROP - IMO we should use /bit/ 64 instead

OK.

> > > > > But I very much doubt upstream would accept it with a macro. Other
> > > > > 64-bit boards seem to use '/bits/ 64'.
> > > >
> > > > What upstream are you referring to here? I'm not sure what other project
> > > > will want a device tree for the "no device tree only acpi" virtual
> > > > reference platform.
> > >
> > > It depends if they want to run U-Boot or not. U-Boot always needs a
> > > devicetree, as you know. It cannot use ACPI tables to configure itself
> > > and I would rather it doesn't start.
> > >
> > > I don't actually see any reason why this devicetree could not be
> > > upstreamed, except that QEMU actually creates a Linux devicetree right
> > > now (on the ARM side) and takes no notice of what U-Boot needs... I
> > > don't see any U-Boot patches from the maintainers, for example,
> > > although I may have missed some. It seems very focussed on UEFI. I
> > > would love that to change, as QEMU is widely used in U-Boot on ARM...
> >
> > I feel like we're lost the point here. This platform in question is the
> > "never use device tree, only use ACPI" reference platform.
> 
> never use device tree for Linux
> 
> (U-Boot always uses it)

True.

> > This is not
> > the regular "virt" platform, even. U-Boot needs a device tree because
> > internally we use it for configuration. I do not see the QEMU project
> > agreeing to have this platform generate a device tree for us to consume
> > in this case, declaring instead that it's a U-Boot internal need and
> > that no, it's fine if U-Boot can't use it. _We_ want it because it makes
> > testing of the aarch64 + ACPI use case easy because it provides us with
> > the ability to use the reference platform too and make sure that we
> > aren't breaking the OS in unexpected ways.
> 
> OK, well as you say this is not really the main issue, so that's fine.
> I agree (and was lamenting) that QEMU seems unwilling at present to do
> anything to assist U-Boot.

At least today, I don't think this is even a QEMU issue, honestly. A
point could be made in the future that EDKII will ignore TF-A passing a
device tree, and that also needs to be confirmed / validated because
<physical hardware platform> supports EDKII or U-Boot for ES/SR
certification. That's a much stronger I think position to start from in
asking QEMU to pass along the device tree that it could make.

-- 
Tom

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

  reply	other threads:[~2024-10-03 22:25 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-02  9:46 [PATCH v6 00/37] Implement ACPI on aarch64 Patrick Rudolph
2024-10-02  9:46 ` [PATCH v6 01/37] acpi: x86: Move SPCR and DBG2 into common code Patrick Rudolph
2024-10-02  9:46 ` [PATCH v6 02/37] acpi: x86: Write FADT in " Patrick Rudolph
2024-10-02  9:46 ` [PATCH v6 03/37] acpi: x86: Move MADT to " Patrick Rudolph
2024-10-02  9:46 ` [PATCH v6 04/37] acpi: Fix typo Patrick Rudolph
2024-10-02  9:46 ` [PATCH v6 05/37] serial: serial_pl01x: Implement .getinfo() for PL01 Patrick Rudolph
2024-10-02  9:46 ` [PATCH v6 06/37] acpi: Add define for GTDT Patrick Rudolph
2024-10-02  9:46 ` [PATCH v6 07/37] arm: acpi: Add generic ACPI methods Patrick Rudolph
2024-10-02  9:46 ` [PATCH v6 08/37] acpi: Add fill_madt to acpi_ops Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 09/37] acpi: acpi_table: Bump revisions Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 10/37] acpi: Add ACPITAB for PPTT and GTDT Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 11/37] acpi: acpi_table: Add IORT support Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 12/37] acpi: Move function prototype Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 13/37] acpi_table: Support platforms with unusable RSDT Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 14/37] efi_loader: Allocate and write ACPI tables Patrick Rudolph
2024-10-02 22:55   ` Simon Glass
2024-10-03  5:45   ` Ilias Apalodimas
2024-10-03 13:49     ` Simon Glass
2024-10-03 15:58       ` Ilias Apalodimas
2024-10-03 20:46         ` Simon Glass
2024-10-02  9:47 ` [PATCH v6 15/37] acpi: Add processor device Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 16/37] drivers: usb: Add generic XHCI Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 17/37] drivers: ata: Rename ahci_mvebu Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 18/37] drivers/cpu: Add generic armv8 cpu driver Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 19/37] arm: gic-v3-its: Rename objects Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 20/37] arm: gic-v3-its: Implement of_xlate Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 21/37] arm: lib: Add GICV2 driver Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 22/37] drivers: misc: irq-uclass: Update irq_get_by_index Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 23/37] drivers/arm: Implement acpi_fill_madt Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 24/37] common: Enable BLOBLIST_TABLES on arm Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 25/37] board: emulation: Add QEMU sbsa support Patrick Rudolph
2024-10-02 22:55   ` Simon Glass
2024-10-03  1:35     ` Tom Rini
2024-10-03 13:50       ` Simon Glass
2024-10-03 14:43         ` Tom Rini
2024-10-03 16:59           ` Simon Glass
2024-10-03 19:17             ` Tom Rini
2024-10-03 20:46               ` Simon Glass
2024-10-03 22:25                 ` Tom Rini [this message]
2024-10-04  1:28                   ` Simon Glass
2024-10-04  7:19         ` Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 26/37] arm: mach-bcm283x: Map the ARM local MMIO as well Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 27/37] arm: mach-bcm283x: Bring in some header files from tianocore Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 28/37] arm: bcm283x: Generate ACPI tables Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 29/37] board: raspberrypi: Add ASL files from tianocore Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 30/37] arm: cpu: Add ACPI parking protocol support Patrick Rudolph
2024-10-02 22:55   ` Simon Glass
2024-10-02  9:47 ` [PATCH v6 31/37] armv8: cpu: Enable ACPI parking protocol Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 32/37] arm: Implement read_mpidr on armv7 Patrick Rudolph
2024-10-02 22:55   ` Simon Glass
2024-10-02  9:47 ` [PATCH v6 33/37] arm: mach-bcm283x: Add ARMV8_MULTIENTRY support Patrick Rudolph
2024-10-02 22:55   ` Simon Glass
2024-10-02  9:47 ` [PATCH v6 34/37] arm: mach-bcm283x: Enable ARMV8_MULTIENTRY Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 35/37] bloblist: Fix use of uninitialized variable Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 36/37] configs: Add RPI4 ACPI defconfig Patrick Rudolph
2024-10-02  9:47 ` [PATCH v6 37/37] CI: Enable qemu_sbsa Patrick Rudolph
2024-10-02 22:55   ` Simon Glass
2024-10-03 22:25   ` Tom Rini

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=20241003222516.GW4737@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=bmeng.cn@gmail.com \
    --cc=patrick.rudolph@9elements.com \
    --cc=pbrobinson@gmail.com \
    --cc=rayagonda.kokatanur@broadcom.com \
    --cc=sjg@chromium.org \
    --cc=tuomas.tynkkynen@iki.fi \
    --cc=u-boot@lists.denx.de \
    /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