From: Daniel Henrique Barboza <danielhb413@gmail.com>
To: qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, clg@kaod.org,
Daniel Henrique Barboza <danielhb413@gmail.com>
Subject: [PATCH v6 05/14] hw/ppc: set machine->fdt in bamboo_load_device_tree()
Date: Sun, 4 Sep 2022 20:34:47 -0300 [thread overview]
Message-ID: <20220904233456.209027-6-danielhb413@gmail.com> (raw)
In-Reply-To: <20220904233456.209027-1-danielhb413@gmail.com>
This will enable support for 'dumpdtb' QMP/HMP command for the bamboo
machine.
Cc: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
hw/ppc/ppc440_bamboo.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c
index ea945a1c99..aa5c901b09 100644
--- a/hw/ppc/ppc440_bamboo.c
+++ b/hw/ppc/ppc440_bamboo.c
@@ -34,6 +34,8 @@
#include "hw/qdev-properties.h"
#include "qapi/error.h"
+#include <libfdt.h>
+
#define BINARY_DEVICE_TREE_FILE "bamboo.dtb"
/* from u-boot */
@@ -62,6 +64,7 @@ static int bamboo_load_device_tree(hwaddr addr,
hwaddr initrd_size,
const char *kernel_cmdline)
{
+ MachineState *machine = MACHINE(qdev_get_machine());
int ret = -1;
uint32_t mem_reg_property[] = { 0, 0, cpu_to_be32(ramsize) };
char *filename;
@@ -119,7 +122,13 @@ static int bamboo_load_device_tree(hwaddr addr,
tb_freq);
rom_add_blob_fixed(BINARY_DEVICE_TREE_FILE, fdt, fdt_size, addr);
- g_free(fdt);
+
+ /*
+ * Update the machine->fdt pointer to enable support for
+ * 'dumpdtb' QMP/HMP command.
+ */
+ machine->fdt = fdt;
+
return 0;
}
--
2.37.2
next prev parent reply other threads:[~2022-09-04 23:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-04 23:34 [PATCH v6 00/14] QMP/HMP: introduce 'dumpdtb' Daniel Henrique Barboza
2022-09-04 23:34 ` [PATCH v6 01/14] hw/arm: do not free machine->fdt in arm_load_dtb() Daniel Henrique Barboza
2022-09-04 23:34 ` [PATCH v6 02/14] hw/microblaze: set machine->fdt in microblaze_load_dtb() Daniel Henrique Barboza
2022-09-04 23:34 ` [PATCH v6 03/14] hw/nios2: set machine->fdt in nios2_load_dtb() Daniel Henrique Barboza
2022-09-04 23:34 ` [PATCH v6 04/14] hw/ppc: set machine->fdt in ppce500_load_device_tree() Daniel Henrique Barboza
2022-09-04 23:34 ` Daniel Henrique Barboza [this message]
2022-09-04 23:34 ` [PATCH v6 06/14] hw/ppc: set machine->fdt in sam460ex_load_device_tree() Daniel Henrique Barboza
2022-09-05 7:15 ` BALATON Zoltan
2022-09-05 12:39 ` Daniel Henrique Barboza
2022-09-04 23:34 ` [PATCH v6 07/14] hw/ppc: set machine->fdt in xilinx_load_device_tree() Daniel Henrique Barboza
2022-09-04 23:34 ` [PATCH v6 08/14] hw/ppc: set machine->fdt in pegasos2_machine_reset() Daniel Henrique Barboza
2022-09-04 23:34 ` [PATCH v6 09/14] hw/ppc: set machine->fdt in pnv_reset() Daniel Henrique Barboza
2022-09-07 7:19 ` Cédric Le Goater
2022-09-07 9:00 ` Frederic Barrat
2022-09-04 23:34 ` [PATCH v6 10/14] hw/ppc: set machine->fdt in spapr machine Daniel Henrique Barboza
2022-09-04 23:34 ` [PATCH v6 11/14] hw/riscv: set machine->fdt in sifive_u_machine_init() Daniel Henrique Barboza
2022-09-04 23:34 ` [PATCH v6 12/14] hw/riscv: set machine->fdt in spike_board_init() Daniel Henrique Barboza
2022-09-04 23:34 ` [PATCH v6 13/14] hw/xtensa: set machine->fdt in xtfpga_init() Daniel Henrique Barboza
2022-09-04 23:34 ` [PATCH v6 14/14] qmp/hmp, device_tree.c: introduce dumpdtb Daniel Henrique Barboza
2022-09-05 13:41 ` Markus Armbruster
2022-09-05 17:51 ` Daniel Henrique Barboza
2022-09-08 10:32 ` Dr. David Alan Gilbert
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=20220904233456.209027-6-danielhb413@gmail.com \
--to=danielhb413@gmail.com \
--cc=clg@kaod.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/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).