qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
To: qemu-devel@nongnu.org
Cc: Leif Lindholm <quic_llindhol@quicinc.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Radoslaw Biernacki <rad@semihalf.com>,
	qemu-arm@nongnu.org,
	Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Subject: [PATCH 1/1] hw/arm/sbsa-ref: add PCIe node into DT
Date: Mon, 26 Jun 2023 09:51:56 +0200	[thread overview]
Message-ID: <20230626075207.623535-1-marcin.juszkiewicz@linaro.org> (raw)

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);
+}
+
 static void sbsa_fdt_add_gic_node(SBSAMachineState *sms)
 {
     char *nodename;
@@ -286,6 +305,7 @@ static void create_fdt(SBSAMachineState *sms)
     }
 
     sbsa_fdt_add_gic_node(sms);
+    sbsa_fdt_add_pcie_node(sms);
 }
 
 #define SBSA_FLASH_SECTOR_SIZE (256 * KiB)
-- 
2.41.0



             reply	other threads:[~2023-06-26  7:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26  7:51 Marcin Juszkiewicz [this message]
2023-06-27 12:12 ` [PATCH 1/1] hw/arm/sbsa-ref: add PCIe node into DT 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
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=20230626075207.623535-1-marcin.juszkiewicz@linaro.org \
    --to=marcin.juszkiewicz@linaro.org \
    --cc=peter.maydell@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).