qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v6 01/41] Split out common part of BCM283X classes


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v6 01/41] Split out common part of BCM283X classes
Date: Tue, 27 Feb 2024 09:45:06 +0100
User-agent: Mozilla Thunderbird

On 26/2/24 01:02, Sergey Kambalin wrote:
Pre setup for BCM2838 introduction

Signed-off-by: Sergey Kambalin <sergey.kambalin@auriga.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
  hw/arm/bcm2836.c         | 103 ++++++++++++++++++++++-----------------
  hw/arm/raspi.c           |   2 +-
  include/hw/arm/bcm2836.h |  26 +++++++++-
  3 files changed, 84 insertions(+), 47 deletions(-)


diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h
index 6f90cabfa3..5a6717ca91 100644
--- a/include/hw/arm/bcm2836.h
+++ b/include/hw/arm/bcm2836.h
@@ -17,8 +17,10 @@
  #include "target/arm/cpu.h"
  #include "qom/object.h"
+#define TYPE_BCM283X_BASE "bcm283x-base"

Note for eventual future cleanup, we usually name this "common".

+OBJECT_DECLARE_TYPE(BCM283XBaseState, BCM283XBaseClass, BCM283X_BASE)
  #define TYPE_BCM283X "bcm283x"
-OBJECT_DECLARE_TYPE(BCM283XState, BCM283XClass, BCM283X)
+OBJECT_DECLARE_SIMPLE_TYPE(BCM283XState, BCM283X)
#define BCM283X_NCPUS 4 @@ -30,7 +32,7 @@ OBJECT_DECLARE_TYPE(BCM283XState, BCM283XClass, BCM283X)
  #define TYPE_BCM2836 "bcm2836"
  #define TYPE_BCM2837 "bcm2837"
-struct BCM283XState {
+struct BCM283XBaseState {
      /*< private >*/
      DeviceState parent_obj;
      /*< public >*/
@@ -41,7 +43,27 @@ struct BCM283XState {
          ARMCPU core;
      } cpu[BCM283X_NCPUS];
      BCM2836ControlState control;
+};
+
+struct BCM283XBaseClass {
+    /*< private >*/
+    DeviceClass parent_class;
+    /*< public >*/

Also we don't use these private/public comment anymore.

+    const char *name;
+    const char *cpu_type;
+    unsigned core_count;
+    hwaddr peri_base; /* Peripheral base address seen by the CPU */
+    hwaddr ctrl_base; /* Interrupt controller and mailboxes etc. */
+    int clusterid;
+};
+
+struct BCM283XState {
+    /*< private >*/
+    BCM283XBaseState parent_obj;
+    /*< public >*/

Ditto.

      BCM2835PeripheralState peripherals;
  };
+bool bcm283x_common_realize(DeviceState *dev, Error **errp);

Amusingly you name the realize handler 'common'.

  #endif /* BCM2836_H */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]