* [PATCH v3 1/4] hw/arm/sbsa-ref: add GIC node into DT
2023-05-24 11:33 [PATCH v3 0/4] hw/arm/sbsa-ref: platform version 0.1 Marcin Juszkiewicz
@ 2023-05-24 11:33 ` Marcin Juszkiewicz
2023-05-24 11:33 ` [PATCH v3 2/4] docs: sbsa: correct graphics card name Marcin Juszkiewicz
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Marcin Juszkiewicz @ 2023-05-24 11:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-arm, Leif Lindholm, Peter Maydell, Marcin Juszkiewicz
Let add GIC information into DeviceTree as part of SBSA-REF versioning.
Trusted Firmware will read it and provide to next firmware level.
Bumps platform version to 0.1 one so we can check is node is present.
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
hw/arm/sbsa-ref.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
index 792371fdce..9204e8605f 100644
--- a/hw/arm/sbsa-ref.c
+++ b/hw/arm/sbsa-ref.c
@@ -29,6 +29,7 @@
#include "exec/hwaddr.h"
#include "kvm_arm.h"
#include "hw/arm/boot.h"
+#include "hw/arm/fdt.h"
#include "hw/arm/smmuv3.h"
#include "hw/block/flash.h"
#include "hw/boards.h"
@@ -168,6 +169,20 @@ static uint64_t sbsa_ref_cpu_mp_affinity(SBSAMachineState *sms, int idx)
return arm_cpu_mp_affinity(idx, clustersz);
}
+static void sbsa_fdt_add_gic_node(SBSAMachineState *sms)
+{
+ char *nodename;
+
+ nodename = g_strdup_printf("/intc");
+ qemu_fdt_add_subnode(sms->fdt, nodename);
+ qemu_fdt_setprop_sized_cells(sms->fdt, nodename, "reg",
+ 2, sbsa_ref_memmap[SBSA_GIC_DIST].base,
+ 2, sbsa_ref_memmap[SBSA_GIC_DIST].size,
+ 2, sbsa_ref_memmap[SBSA_GIC_REDIST].base,
+ 2, sbsa_ref_memmap[SBSA_GIC_REDIST].size);
+
+ g_free(nodename);
+}
/*
* Firmware on this machine only uses ACPI table to load OS, these limited
* device tree nodes are just to let firmware know the info which varies from
@@ -204,7 +219,7 @@ static void create_fdt(SBSAMachineState *sms)
* fw compatibility.
*/
qemu_fdt_setprop_cell(fdt, "/", "machine-version-major", 0);
- qemu_fdt_setprop_cell(fdt, "/", "machine-version-minor", 0);
+ qemu_fdt_setprop_cell(fdt, "/", "machine-version-minor", 1);
if (ms->numa_state->have_numa_distance) {
int size = nb_numa_nodes * nb_numa_nodes * 3 * sizeof(uint32_t);
@@ -260,6 +275,8 @@ static void create_fdt(SBSAMachineState *sms)
g_free(nodename);
}
+
+ sbsa_fdt_add_gic_node(sms);
}
#define SBSA_FLASH_SECTOR_SIZE (256 * KiB)
--
2.40.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v3 2/4] docs: sbsa: correct graphics card name
2023-05-24 11:33 [PATCH v3 0/4] hw/arm/sbsa-ref: platform version 0.1 Marcin Juszkiewicz
2023-05-24 11:33 ` [PATCH v3 1/4] hw/arm/sbsa-ref: add GIC node into DT Marcin Juszkiewicz
@ 2023-05-24 11:33 ` Marcin Juszkiewicz
2023-05-24 11:33 ` [PATCH v3 3/4] docs: sbsa: document platform version changes Marcin Juszkiewicz
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Marcin Juszkiewicz @ 2023-05-24 11:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-arm, Leif Lindholm, Peter Maydell, Marcin Juszkiewicz
We moved from VGA to Bochs to have PCIe card.
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
docs/system/arm/sbsa.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/system/arm/sbsa.rst b/docs/system/arm/sbsa.rst
index b499d7e927..016776aed8 100644
--- a/docs/system/arm/sbsa.rst
+++ b/docs/system/arm/sbsa.rst
@@ -27,6 +27,6 @@ The sbsa-ref board supports:
- System bus EHCI controller
- CDROM and hard disc on AHCI bus
- E1000E ethernet card on PCIe bus
- - VGA display adaptor on PCIe bus
+ - Bochs display adapter on PCIe bus
- A generic SBSA watchdog device
--
2.40.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v3 3/4] docs: sbsa: document platform version changes
2023-05-24 11:33 [PATCH v3 0/4] hw/arm/sbsa-ref: platform version 0.1 Marcin Juszkiewicz
2023-05-24 11:33 ` [PATCH v3 1/4] hw/arm/sbsa-ref: add GIC node into DT Marcin Juszkiewicz
2023-05-24 11:33 ` [PATCH v3 2/4] docs: sbsa: correct graphics card name Marcin Juszkiewicz
@ 2023-05-24 11:33 ` Marcin Juszkiewicz
2023-05-30 12:36 ` Peter Maydell
2023-05-25 10:08 ` [PATCH v3 0/4] hw/arm/sbsa-ref: platform version 0.1 Peter Maydell
2023-05-30 12:37 ` Peter Maydell
4 siblings, 1 reply; 8+ messages in thread
From: Marcin Juszkiewicz @ 2023-05-24 11:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-arm, Leif Lindholm, Peter Maydell, Marcin Juszkiewicz
We plan to start adding more system information in DT so firmware does
not have to use hardcoded values.
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
docs/system/arm/sbsa.rst | 31 +++++++++++++++++++++++++------
1 file changed, 25 insertions(+), 6 deletions(-)
diff --git a/docs/system/arm/sbsa.rst b/docs/system/arm/sbsa.rst
index 016776aed8..922a29700d 100644
--- a/docs/system/arm/sbsa.rst
+++ b/docs/system/arm/sbsa.rst
@@ -6,16 +6,35 @@ any real hardware the ``sbsa-ref`` board intends to look like real
hardware. The `Server Base System Architecture
<https://developer.arm.com/documentation/den0029/latest>`_ defines a
minimum base line of hardware support and importantly how the firmware
-reports that to any operating system. It is a static system that
-reports a very minimal DT to the firmware for non-discoverable
-information about components affected by the qemu command line (i.e.
-cpus and memory). As a result it must have a firmware specifically
-built to expect a certain hardware layout (as you would in a real
-machine).
+reports that to any operating system.
It is intended to be a machine for developing firmware and testing
standards compliance with operating systems.
+Platform versions
+"""""""""""""""""
+
+QEMU 7.1 brought support for "platform version major/minor" fields in
+DeviceTree.
+
+Version 0.0
+'''''''''''
+
+It is a static system that reports a very minimal DT to the firmware for
+non-discoverable information about components affected by the qemu
+command line (i.e. cpus and memory). As a result it must have a firmware
+specifically built to expect a certain hardware layout (as you would in
+a real machine).
+
+Version 0.1
+'''''''''''
+
+Additional data are provided in DT to the firmware:
+ - address and size of GIC Distributor
+ - address and size of GIC Redistributor
+
+Simple "/intc/reg" field is used.
+
Supported devices
"""""""""""""""""
--
2.40.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v3 3/4] docs: sbsa: document platform version changes
2023-05-24 11:33 ` [PATCH v3 3/4] docs: sbsa: document platform version changes Marcin Juszkiewicz
@ 2023-05-30 12:36 ` Peter Maydell
0 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2023-05-30 12:36 UTC (permalink / raw)
To: marcin.juszkiewicz; +Cc: qemu-devel, qemu-arm, Leif Lindholm
On Wed, 24 May 2023 at 12:33, Marcin Juszkiewicz
<marcin.juszkiewicz@linaro.org> wrote:
>
> We plan to start adding more system information in DT so firmware does
> not have to use hardcoded values.
>
> Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
> ---
> docs/system/arm/sbsa.rst | 31 +++++++++++++++++++++++++------
> 1 file changed, 25 insertions(+), 6 deletions(-)
>
> diff --git a/docs/system/arm/sbsa.rst b/docs/system/arm/sbsa.rst
> index 016776aed8..922a29700d 100644
> --- a/docs/system/arm/sbsa.rst
> +++ b/docs/system/arm/sbsa.rst
> @@ -6,16 +6,35 @@ any real hardware the ``sbsa-ref`` board intends to look like real
> hardware. The `Server Base System Architecture
> <https://developer.arm.com/documentation/den0029/latest>`_ defines a
> minimum base line of hardware support and importantly how the firmware
> -reports that to any operating system. It is a static system that
> -reports a very minimal DT to the firmware for non-discoverable
> -information about components affected by the qemu command line (i.e.
> -cpus and memory). As a result it must have a firmware specifically
> -built to expect a certain hardware layout (as you would in a real
> -machine).
> +reports that to any operating system.
>
> It is intended to be a machine for developing firmware and testing
> standards compliance with operating systems.
> +Platform versions
> +"""""""""""""""""
All this stuff about the DTB format isn't interesting to most
users, so we should put it at the bottom of the doc, below
the 'supported devices' part. Also, the subsection title should
be something like "Board-to-firmware interface", and it should
lead off with the text that clarifies that although the data
blob provided by the board is in DT format it is not intended
to be a complete compliant DT but is just a mechanism for
providing the firmware with specific information about the
non-discoverable components in the system.
> +
> +QEMU 7.1 brought support for "platform version major/minor" fields in
> +DeviceTree.
We don't generally document things in terms of which QEMU versions
they appeared in. The docs just say what the current status is.
> +
> +Version 0.0
> +'''''''''''
> +
> +It is a static system that reports a very minimal DT to the firmware for
> +non-discoverable information about components affected by the qemu
> +command line (i.e. cpus and memory). As a result it must have a firmware
> +specifically built to expect a certain hardware layout (as you would in
> +a real machine).
> +
> +Version 0.1
> +'''''''''''
> +
> +Additional data are provided in DT to the firmware:
> + - address and size of GIC Distributor
> + - address and size of GIC Redistributor
> +
> +Simple "/intc/reg" field is used.
> +
> Supported devices
> """""""""""""""""
thanks
-- PMM
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 0/4] hw/arm/sbsa-ref: platform version 0.1
2023-05-24 11:33 [PATCH v3 0/4] hw/arm/sbsa-ref: platform version 0.1 Marcin Juszkiewicz
` (2 preceding siblings ...)
2023-05-24 11:33 ` [PATCH v3 3/4] docs: sbsa: document platform version changes Marcin Juszkiewicz
@ 2023-05-25 10:08 ` Peter Maydell
2023-05-26 8:06 ` Marcin Juszkiewicz
2023-05-30 12:37 ` Peter Maydell
4 siblings, 1 reply; 8+ messages in thread
From: Peter Maydell @ 2023-05-25 10:08 UTC (permalink / raw)
To: marcin.juszkiewicz; +Cc: qemu-devel, qemu-arm, Leif Lindholm
On Wed, 24 May 2023 at 12:33, Marcin Juszkiewicz
<marcin.juszkiewicz@linaro.org> wrote:
>
> About year ago support for setting platform version for sbsa-ref was
> added with "0.0" value.
>
> This patchset bumps it to "0.1" as we export basic GIC information via
> DeviceTree to the firmware. TF-A will then take it and provide to EDK2
> via Secure Monitor Call (instead of using hardcoded values).
>
> Basic documentation about platform changes added.
>
> Marcin Juszkiewicz (3):
> hw/arm/sbsa-ref: add GIC node into DT
> docs: sbsa: correct graphics card name
> docs: sbsa: document platform version changes
The cover message subject says there should be 4 patches
in this series, but there are only 3 listed here and
only 3 emails arrived on list. Is there a missing patch?
thanks
-- PMM
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 0/4] hw/arm/sbsa-ref: platform version 0.1
2023-05-24 11:33 [PATCH v3 0/4] hw/arm/sbsa-ref: platform version 0.1 Marcin Juszkiewicz
` (3 preceding siblings ...)
2023-05-25 10:08 ` [PATCH v3 0/4] hw/arm/sbsa-ref: platform version 0.1 Peter Maydell
@ 2023-05-30 12:37 ` Peter Maydell
4 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2023-05-30 12:37 UTC (permalink / raw)
To: marcin.juszkiewicz; +Cc: qemu-devel, qemu-arm, Leif Lindholm
On Wed, 24 May 2023 at 12:33, Marcin Juszkiewicz
<marcin.juszkiewicz@linaro.org> wrote:
>
> About year ago support for setting platform version for sbsa-ref was
> added with "0.0" value.
>
> This patchset bumps it to "0.1" as we export basic GIC information via
> DeviceTree to the firmware. TF-A will then take it and provide to EDK2
> via Secure Monitor Call (instead of using hardcoded values).
>
> Basic documentation about platform changes added.
>
> Marcin Juszkiewicz (3):
> hw/arm/sbsa-ref: add GIC node into DT
> docs: sbsa: correct graphics card name
> docs: sbsa: document platform version changes
>
I've applied the first two patches to target-arm.next;
I had some comments on the third.
thanks
-- PMM
^ permalink raw reply [flat|nested] 8+ messages in thread