Skip to contentSkip to conversation

Adding new machine Yosemitev2 in QEMU

PATCH In review Karthikeyan Pasupathi 2 participants 4 messages Feb 10, 2023 – Feb 15, 2023 1 message not in the archive Arm/Aspeed machine support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Adding new machine Yosemitev2 in QEMU

This patch support Yosemitev2 in QEMU environment.

---
 hw/arm/aspeed.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
hw/arm/aspeed.c +30 -0
index 27dda58338..74dc07190d 100644
@@ -536,6 +536,14 @@ static void create_pca9552(AspeedSoCState *soc, int bus_id, int addr)
                             TYPE_PCA9552, addr);
 }
 
+static void fb_bmc_i2c_init(AspeedMachineState *bmc)
+{
+    AspeedSoCState *soc = &bmc->soc;
+
+    /* The FB board AST2500 compatible with ds1338 */
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
+}
+
 static void sonorapass_bmc_i2c_init(AspeedMachineState *bmc)
 {
     AspeedSoCState *soc = &bmc->soc;
@@ -1191,6 +1199,24 @@ static void aspeed_machine_romulus_class_init(ObjectClass *oc, void *data)
         aspeed_soc_num_cpus(amc->soc_name);
 };
 
+static void aspeed_machine_fbyv2_class_init(ObjectClass *oc, void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+    AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc);
+
+    mc->desc       = "Facebook YosemiteV2 BMC (ARM1176)";
+    amc->soc_name  = "ast2500-a1";
+    amc->hw_strap1 = AST2500_EVB_HW_STRAP1;
+    amc->hw_strap2 = 0;
+    amc->fmc_model = "n25q256a";
+    amc->spi_model = "mx25l25635e";
+    amc->num_cs    = 2;
+    amc->i2c_init  = fb_bmc_i2c_init;
+    mc->default_ram_size       = 512 * MiB;
+    mc->default_cpus = mc->min_cpus = mc->max_cpus =
+        aspeed_soc_num_cpus(amc->soc_name);
+};
+
 static void aspeed_machine_sonorapass_class_init(ObjectClass *oc, void *data)
 {
     MachineClass *mc = MACHINE_CLASS(oc);
@@ -1554,6 +1580,10 @@ static const TypeInfo aspeed_machine_types[] = {
         .name          = MACHINE_TYPE_NAME("sonorapass-bmc"),
         .parent        = TYPE_ASPEED_MACHINE,
         .class_init    = aspeed_machine_sonorapass_class_init,
+    }, {
+        .name          = MACHINE_TYPE_NAME("fbyv2-bmc"),
+        .parent        = TYPE_ASPEED_MACHINE,
+        .class_init    = aspeed_machine_fbyv2_class_init,
     }, {
         .name          = MACHINE_TYPE_NAME("witherspoon-bmc"),
         .parent        = TYPE_ASPEED_MACHINE,
Signature · 1 line
2.25.1
#1 lore raw

Hello,

Quoted 1 line · Karthikeyan Pasupathi

This patch support Yosemitev2 in QEMU environment.

It looks OK apart from the naming. Could we call it "yosemite2-bmc" instead ?

Thanks,

C.

Quoted 10 lines
---
  hw/arm/aspeed.c | 30 ++++++++++++++++++++++++++++++
  1 file changed, 30 insertions(+)
hw/arm/aspeed.c +0 -0
index 27dda58338..74dc07190d 100644

hw/arm/aspeed.c static void create_pca9552(AspeedSoCState *soc, int bus_id, int addr) · line 539

Quoted 4 lines
hw/arm/aspeed.c +1 -0
@@ -536,6 +536,14 @@ static void create_pca9552(AspeedSoCState *soc, int bus_id, int addr)
                              TYPE_PCA9552, addr);
  }
 
+static void fb_bmc_i2c_init(AspeedMachineState *bmc)

The same routine name is proposed in the tiogapass patch :

https://lore.kernel.org/qemu-devel/[email protected]/

Do you have plans to populate the I2C buses differently ?

Quoted 15 lines
hw/arm/aspeed.c +8 -0
+{
+    AspeedSoCState *soc = &bmc->soc;
+
+    /* The FB board AST2500 compatible with ds1338 */
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
+}
+
  static void sonorapass_bmc_i2c_init(AspeedMachineState *bmc)
  {
      AspeedSoCState *soc = &bmc->soc;
@@ -1191,6 +1199,24 @@ static void aspeed_machine_romulus_class_init(ObjectClass *oc, void *data)
          aspeed_soc_num_cpus(amc->soc_name);
  };
 
+static void aspeed_machine_fbyv2_class_init(ObjectClass *oc, void *data)

hw/arm/aspeed.c static void aspeed_machine_romulus_class_init(ObjectClass *oc, void *data) · line 1212

Quoted 10 lines
hw/arm/aspeed.c +10 -0
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+    AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc);
+
+    mc->desc       = "Facebook YosemiteV2 BMC (ARM1176)";
+    amc->soc_name  = "ast2500-a1";
+    amc->hw_strap1 = AST2500_EVB_HW_STRAP1;
+    amc->hw_strap2 = 0;
+    amc->fmc_model = "n25q256a";
+    amc->spi_model = "mx25l25635e";

same as tiogapass ?

hw/arm/aspeed.c static void aspeed_machine_romulus_class_init(ObjectClass *oc, void *data) · line 1215

Quoted 3 lines
hw/arm/aspeed.c +3 -0
+    amc->num_cs    = 2;
+    amc->i2c_init  = fb_bmc_i2c_init;
+    mc->default_ram_size       = 512 * MiB;

The RAM size is the only difference with the tiogapass and one could use the -m machine option instead.

Thanks,

C.

Quoted 18 lines
hw/arm/aspeed.c +8 -0
+    mc->default_cpus = mc->min_cpus = mc->max_cpus =
+        aspeed_soc_num_cpus(amc->soc_name);
+};
+
  static void aspeed_machine_sonorapass_class_init(ObjectClass *oc, void *data)
  {
      MachineClass *mc = MACHINE_CLASS(oc);
@@ -1554,6 +1580,10 @@ static const TypeInfo aspeed_machine_types[] = {
          .name          = MACHINE_TYPE_NAME("sonorapass-bmc"),
          .parent        = TYPE_ASPEED_MACHINE,
          .class_init    = aspeed_machine_sonorapass_class_init,
+    }, {
+        .name          = MACHINE_TYPE_NAME("fbyv2-bmc"),
+        .parent        = TYPE_ASPEED_MACHINE,
+        .class_init    = aspeed_machine_fbyv2_class_init,
      }, {
          .name          = MACHINE_TYPE_NAME("witherspoon-bmc"),
          .parent        = TYPE_ASPEED_MACHINE,

A message that is not in the archive (sent off-list or not yet received): CA+ezb7ifqiE-WJnBfDpn6-F17ukkarqnXTmMsSTNRGAHEnp0mA@mail.gmail.com

#3 lore raw

Hello,

[ adding the lists ]

Quoted 10 lines

> +static void fb_bmc_i2c_init(AspeedMachineState *bmc)

The same routine name is proposed in the tiogapass patch :

https://lore.kernel.org/qemu-devel/[email protected]/ <https://lore.kernel.org/qemu-devel/[email protected]/>

Do you have plans to populate the I2C buses differently ?

This is an initial patch we have been working on adding more specific configurations in the future.

OK. Then please rename the routine with a "yosemite" like prefix.

Thanks,

C.

#4 lore raw

Ok, will do that.

Quoted 28 lines · Cédric Le Goater

Hello,

[ adding the lists ]

Quoted 5 lines

> +static void fb_bmc_i2c_init(AspeedMachineState *bmc)

The same routine name is proposed in the tiogapass patch :

https://lore.kernel.org/qemu-devel/[email protected]/
<
https://lore.kernel.org/qemu-devel/[email protected]/

Quoted 6 lines

Do you have plans to populate the I2C buses differently ?

This is an initial patch we have been working on adding more specific

configurations in the future.

OK. Then please rename the routine with a "yosemite" like prefix.

Thanks,

C.