All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Daniel P . Berrangé" <berrange@redhat.com>,
	"BALATON Zoltan" <balaton@eik.bme.hu>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Ovchinnikov Vitalii" <vitalii.ovchinnikov@auriga.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Jared Mauch" <jared+home@puck.nether.net>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	qemu-arm@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>,
	devel@lists.libvirt.org
Subject: [PATCH v2 04/12] hw/arm/raspi: Pass board_rev as argument to raspi_base_machine_init()
Date: Tue,  4 Feb 2025 01:22:32 +0100	[thread overview]
Message-ID: <20250204002240.97830-5-philmd@linaro.org> (raw)
In-Reply-To: <20250204002240.97830-1-philmd@linaro.org>

Since callers already have reference to the RaspiBaseMachineClass,
directly pass 'board_rev' as argument to raspi_base_machine_init().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/arm/raspi_platform.h | 2 +-
 hw/arm/raspi.c                  | 8 +++-----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/include/hw/arm/raspi_platform.h b/include/hw/arm/raspi_platform.h
index 7bc4807fa51..defb786153b 100644
--- a/include/hw/arm/raspi_platform.h
+++ b/include/hw/arm/raspi_platform.h
@@ -58,7 +58,7 @@ void raspi_machine_init(MachineState *machine);
 
 typedef struct BCM283XBaseState BCM283XBaseState;
 void raspi_base_machine_init(MachineState *machine,
-                             BCM283XBaseState *soc);
+                             BCM283XBaseState *soc, const uint32_t board_rev);
 
 void raspi_machine_class_common_init(MachineClass *mc,
                                      uint32_t board_rev);
diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c
index ef94d57dab5..571b50bef7e 100644
--- a/hw/arm/raspi.c
+++ b/hw/arm/raspi.c
@@ -254,10 +254,8 @@ static void setup_boot(MachineState *machine, ARMCPU *cpu,
 }
 
 void raspi_base_machine_init(MachineState *machine,
-                             BCM283XBaseState *soc)
+                             BCM283XBaseState *soc, const uint32_t board_rev)
 {
-    RaspiBaseMachineClass *mc = RASPI_BASE_MACHINE_GET_CLASS(machine);
-    uint32_t board_rev = mc->board_rev;
     uint64_t ram_size = board_ram_size(board_rev);
     uint32_t vcram_base, vcram_size;
     size_t boot_ram_size;
@@ -384,7 +382,7 @@ static void raspi4b_machine_init(MachineState *machine)
 
     object_initialize_child(OBJECT(machine), "soc", soc,
                             board_soc_type(mc->board_rev));
-    raspi_base_machine_init(machine, BCM283X_BASE(soc));
+    raspi_base_machine_init(machine, BCM283X_BASE(soc), mc->board_rev);
 }
 #endif /* TARGET_AARCH64 */
 
@@ -399,7 +397,7 @@ void raspi_machine_init(MachineState *machine)
 
     object_initialize_child(OBJECT(machine), "soc", soc,
                             board_soc_type(mc->board_rev));
-    raspi_base_machine_init(machine, BCM283X_BASE(soc));
+    raspi_base_machine_init(machine, BCM283X_BASE(soc), mc->board_rev);
 }
 
 void raspi_machine_class_common_init(MachineClass *mc,
-- 
2.47.1

  parent reply	other threads:[~2025-02-04  0:23 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-04  0:22 [PATCH v2 00/12] hw/arm/raspi: Allow creating any Raspberry Pi machine Philippe Mathieu-Daudé
2025-02-04  0:22 ` [PATCH v2 01/12] hw/arm/raspi: Access SoC parent object using BCM283X_BASE() macro Philippe Mathieu-Daudé
2025-02-04  0:22   ` Philippe Mathieu-Daudé
2025-02-04 15:01   ` Peter Maydell
2025-02-04  0:22 ` [PATCH v2 02/12] hw/arm/raspi: Merge model 4B with other models Philippe Mathieu-Daudé
2025-02-04 15:02   ` Peter Maydell
2025-02-04  0:22 ` [PATCH v2 03/12] hw/arm/raspi: Unify RASPI_MACHINE types Philippe Mathieu-Daudé
2025-02-04 15:06   ` Peter Maydell
2025-02-04  0:22 ` Philippe Mathieu-Daudé [this message]
2025-02-04  0:22 ` [PATCH v2 05/12] hw/arm/raspi: Consider processor id in types[] array Philippe Mathieu-Daudé
2025-02-04 15:08   ` Peter Maydell
2025-02-04  0:22 ` [PATCH v2 06/12] hw/arm/raspi: Consider network interface for B models Philippe Mathieu-Daudé
2025-02-04 15:09   ` Peter Maydell
2025-02-04  0:22 ` [PATCH v2 07/12] hw/arm/raspi: Check ramsize is within chipset aperture Philippe Mathieu-Daudé
2025-02-04 15:10   ` Peter Maydell
2025-02-04  0:22 ` [PATCH v2 08/12] hw/arm/raspi: Introduce generic Raspberry Pi machine Philippe Mathieu-Daudé
2025-02-04  0:22 ` [PATCH v2 09/12] hw/arm/raspi: Have the generic machine take a 'revision' property Philippe Mathieu-Daudé
2025-02-04  0:22 ` [PATCH v2 10/12] hw/arm/raspi: List models creatable by the generic 'raspi' machine Philippe Mathieu-Daudé
2025-02-04  0:22 ` [PATCH v2 11/12] hw/arm/raspi: Deprecate old raspiX machine names Philippe Mathieu-Daudé
2025-02-04  9:22   ` Peter Maydell
2025-02-04  9:51     ` Philippe Mathieu-Daudé
2025-02-04  9:57       ` Daniel P. Berrangé
2025-02-04 10:48         ` Philippe Mathieu-Daudé
2025-02-04 10:51           ` Daniel P. Berrangé
2025-02-04 11:13         ` Peter Maydell
2025-02-04 13:40           ` Philippe Mathieu-Daudé
2025-02-04 13:52             ` Peter Maydell
2025-02-04 14:59               ` Philippe Mathieu-Daudé
2025-02-04  9:58       ` BALATON Zoltan
2025-02-22 21:57         ` Jared Mauch
2025-02-04  0:22 ` [PATCH v2 12/12] hw/arm/raspi: Support more models Philippe Mathieu-Daudé

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=20250204002240.97830-5-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=balaton@eik.bme.hu \
    --cc=berrange@redhat.com \
    --cc=devel@lists.libvirt.org \
    --cc=farosas@suse.de \
    --cc=jared+home@puck.nether.net \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vitalii.ovchinnikov@auriga.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.