All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] aspeed: Add support for the g220a-bmc board
@ 2020-09-28  6:12 John Wang
  2020-09-28  7:55 ` Cédric Le Goater
  0 siblings, 1 reply; 5+ messages in thread
From: John Wang @ 2020-09-28  6:12 UTC (permalink / raw)
  To: yulei.sh, xuxiaohan
  Cc: Peter Maydell, Andrew Jeffery, open list:All patches CC here,
	open list:ASPEED BMCs, Cédric Le Goater, Joel Stanley

G220A is a 2 socket x86 motherboard supported by OpenBMC.
Strapping configuration was obtained from hardware.

Signed-off-by: John Wang <wangzhiqiang.bj@bytedance.com>
---
 hw/arm/aspeed.c | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index bdb981d2f8..1de61f7d4f 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -120,6 +120,20 @@ struct AspeedMachineState {
         SCU_AST2500_HW_STRAP_ACPI_ENABLE |                              \
         SCU_HW_STRAP_SPI_MODE(SCU_HW_STRAP_SPI_MASTER))
 
+#define G220A_BMC_HW_STRAP1 (                                      \
+        SCU_AST2500_HW_STRAP_SPI_AUTOFETCH_ENABLE |                     \
+        SCU_AST2500_HW_STRAP_GPIO_STRAP_ENABLE |                        \
+        SCU_AST2500_HW_STRAP_UART_DEBUG |                               \
+        SCU_AST2500_HW_STRAP_RESERVED28 |                               \
+        SCU_AST2500_HW_STRAP_DDR4_ENABLE |                              \
+        SCU_HW_STRAP_2ND_BOOT_WDT |                                     \
+        SCU_HW_STRAP_VGA_CLASS_CODE |                                   \
+        SCU_HW_STRAP_LPC_RESET_PIN |                                    \
+        SCU_HW_STRAP_SPI_MODE(SCU_HW_STRAP_SPI_MASTER) |                \
+        SCU_AST2500_HW_STRAP_SET_AXI_AHB_RATIO(AXI_AHB_RATIO_2_1) |     \
+        SCU_HW_STRAP_VGA_SIZE_SET(VGA_64M_DRAM) |                       \
+        SCU_AST2500_HW_STRAP_RESERVED1)
+
 /* Witherspoon hardware value: 0xF10AD216 (but use romulus definition) */
 #define WITHERSPOON_BMC_HW_STRAP1 ROMULUS_BMC_HW_STRAP1
 
@@ -798,6 +812,23 @@ static void aspeed_machine_tacoma_class_init(ObjectClass *oc, void *data)
         aspeed_soc_num_cpus(amc->soc_name);
 };
 
+static void aspeed_machine_g220a_class_init(ObjectClass *oc, void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+    AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc);
+
+    mc->desc       = "Bytedance G220A BMC (ARM1176)";
+    amc->soc_name  = "ast2500-a1";
+    amc->hw_strap1 = G220A_BMC_HW_STRAP1;
+    amc->fmc_model = "n25q512a";
+    amc->spi_model = "mx25l25635e";
+    amc->num_cs    = 2;
+    amc->i2c_init  = NULL;
+    mc->default_ram_size = 1024 * MiB;
+    mc->default_cpus = mc->min_cpus = mc->max_cpus =
+        aspeed_soc_num_cpus(amc->soc_name);
+};
+
 static const TypeInfo aspeed_machine_types[] = {
     {
         .name          = MACHINE_TYPE_NAME("palmetto-bmc"),
@@ -835,6 +866,10 @@ static const TypeInfo aspeed_machine_types[] = {
         .name          = MACHINE_TYPE_NAME("tacoma-bmc"),
         .parent        = TYPE_ASPEED_MACHINE,
         .class_init    = aspeed_machine_tacoma_class_init,
+    }, {
+        .name          = MACHINE_TYPE_NAME("g220a-bmc"),
+        .parent        = TYPE_ASPEED_MACHINE,
+        .class_init    = aspeed_machine_g220a_class_init,
     }, {
         .name          = TYPE_ASPEED_MACHINE,
         .parent        = TYPE_MACHINE,
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] aspeed: Add support for the g220a-bmc board
  2020-09-28  6:12 [PATCH] aspeed: Add support for the g220a-bmc board John Wang
@ 2020-09-28  7:55 ` Cédric Le Goater
  2020-09-28  9:18   ` [External] " 王志强
  0 siblings, 1 reply; 5+ messages in thread
From: Cédric Le Goater @ 2020-09-28  7:55 UTC (permalink / raw)
  To: John Wang, yulei.sh, xuxiaohan
  Cc: Andrew Jeffery, Peter Maydell, open list:ASPEED BMCs,
	Joel Stanley, open list:All patches CC here

On 9/28/20 8:12 AM, John Wang wrote:
> G220A is a 2 socket x86 motherboard supported by OpenBMC.
> Strapping configuration was obtained from hardware.
> 
> Signed-off-by: John Wang <wangzhiqiang.bj@bytedance.com>> ---
>  hw/arm/aspeed.c | 35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
> 
> diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
> index bdb981d2f8..1de61f7d4f 100644
> --- a/hw/arm/aspeed.c
> +++ b/hw/arm/aspeed.c
> @@ -120,6 +120,20 @@ struct AspeedMachineState {
>          SCU_AST2500_HW_STRAP_ACPI_ENABLE |                              \
>          SCU_HW_STRAP_SPI_MODE(SCU_HW_STRAP_SPI_MASTER))
>  
> +#define G220A_BMC_HW_STRAP1 (                                      \
> +        SCU_AST2500_HW_STRAP_SPI_AUTOFETCH_ENABLE |                     \
> +        SCU_AST2500_HW_STRAP_GPIO_STRAP_ENABLE |                        \
> +        SCU_AST2500_HW_STRAP_UART_DEBUG |                               \
> +        SCU_AST2500_HW_STRAP_RESERVED28 |                               \
> +        SCU_AST2500_HW_STRAP_DDR4_ENABLE |                              \
> +        SCU_HW_STRAP_2ND_BOOT_WDT |                                     \
> +        SCU_HW_STRAP_VGA_CLASS_CODE |                                   \
> +        SCU_HW_STRAP_LPC_RESET_PIN |                                    \
> +        SCU_HW_STRAP_SPI_MODE(SCU_HW_STRAP_SPI_MASTER) |                \
> +        SCU_AST2500_HW_STRAP_SET_AXI_AHB_RATIO(AXI_AHB_RATIO_2_1) |     \
> +        SCU_HW_STRAP_VGA_SIZE_SET(VGA_64M_DRAM) |                       \
> +        SCU_AST2500_HW_STRAP_RESERVED1)
> +
>  /* Witherspoon hardware value: 0xF10AD216 (but use romulus definition) */
>  #define WITHERSPOON_BMC_HW_STRAP1 ROMULUS_BMC_HW_STRAP1
>  
> @@ -798,6 +812,23 @@ static void aspeed_machine_tacoma_class_init(ObjectClass *oc, void *data)
>          aspeed_soc_num_cpus(amc->soc_name);
>  };
>  
> +static void aspeed_machine_g220a_class_init(ObjectClass *oc, void *data)
> +{
> +    MachineClass *mc = MACHINE_CLASS(oc);
> +    AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc);
> +
> +    mc->desc       = "Bytedance G220A BMC (ARM1176)";
> +    amc->soc_name  = "ast2500-a1";
> +    amc->hw_strap1 = G220A_BMC_HW_STRAP1;
> +    amc->fmc_model = "n25q512a";
> +    amc->spi_model = "mx25l25635e";
> +    amc->num_cs    = 2;

'macs_mask' is missing. You won't get network.

> +    amc->i2c_init  = NULL;

Isn't it possible to add some default I2C devices ? temperature sensors ?

Thanks,

C. 

> +    mc->default_ram_size = 1024 * MiB;
> +    mc->default_cpus = mc->min_cpus = mc->max_cpus =
> +        aspeed_soc_num_cpus(amc->soc_name);
> +};
> +
>  static const TypeInfo aspeed_machine_types[] = {
>      {
>          .name          = MACHINE_TYPE_NAME("palmetto-bmc"),
> @@ -835,6 +866,10 @@ static const TypeInfo aspeed_machine_types[] = {
>          .name          = MACHINE_TYPE_NAME("tacoma-bmc"),
>          .parent        = TYPE_ASPEED_MACHINE,
>          .class_init    = aspeed_machine_tacoma_class_init,
> +    }, {
> +        .name          = MACHINE_TYPE_NAME("g220a-bmc"),
> +        .parent        = TYPE_ASPEED_MACHINE,
> +        .class_init    = aspeed_machine_g220a_class_init,
>      }, {
>          .name          = TYPE_ASPEED_MACHINE,
>          .parent        = TYPE_MACHINE,
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [External] Re: [PATCH] aspeed: Add support for the g220a-bmc board
  2020-09-28  7:55 ` Cédric Le Goater
@ 2020-09-28  9:18   ` 王志强
  2020-09-28 10:11     ` Cédric Le Goater
  0 siblings, 1 reply; 5+ messages in thread
From: 王志强 @ 2020-09-28  9:18 UTC (permalink / raw)
  To: Cédric Le Goater
  Cc: Peter Maydell, Andrew Jeffery, yulei.sh,
	open list:All patches CC here, open list:ASPEED BMCs,
	Joel Stanley, xuxiaohan

Cédric Le Goater,

Sorry, I did not reply to all, this email is the same as the previous one.


On Mon, Sep 28, 2020 at 3:55 PM Cédric Le Goater <clg@kaod.org> wrote:
>
> On 9/28/20 8:12 AM, John Wang wrote:
> > G220A is a 2 socket x86 motherboard supported by OpenBMC.
> > Strapping configuration was obtained from hardware.
> >
> > Signed-off-by: John Wang <wangzhiqiang.bj@bytedance.com>> ---
> >  hw/arm/aspeed.c | 35 +++++++++++++++++++++++++++++++++++
> >  1 file changed, 35 insertions(+)
> >
> > diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
> > index bdb981d2f8..1de61f7d4f 100644
> > --- a/hw/arm/aspeed.c
> > +++ b/hw/arm/aspeed.c
> > @@ -120,6 +120,20 @@ struct AspeedMachineState {
> >          SCU_AST2500_HW_STRAP_ACPI_ENABLE |                              \
> >          SCU_HW_STRAP_SPI_MODE(SCU_HW_STRAP_SPI_MASTER))
> >
> > +#define G220A_BMC_HW_STRAP1 (                                      \
> > +        SCU_AST2500_HW_STRAP_SPI_AUTOFETCH_ENABLE |                     \
> > +        SCU_AST2500_HW_STRAP_GPIO_STRAP_ENABLE |                        \
> > +        SCU_AST2500_HW_STRAP_UART_DEBUG |                               \
> > +        SCU_AST2500_HW_STRAP_RESERVED28 |                               \
> > +        SCU_AST2500_HW_STRAP_DDR4_ENABLE |                              \
> > +        SCU_HW_STRAP_2ND_BOOT_WDT |                                     \
> > +        SCU_HW_STRAP_VGA_CLASS_CODE |                                   \
> > +        SCU_HW_STRAP_LPC_RESET_PIN |                                    \
> > +        SCU_HW_STRAP_SPI_MODE(SCU_HW_STRAP_SPI_MASTER) |                \
> > +        SCU_AST2500_HW_STRAP_SET_AXI_AHB_RATIO(AXI_AHB_RATIO_2_1) |     \
> > +        SCU_HW_STRAP_VGA_SIZE_SET(VGA_64M_DRAM) |                       \
> > +        SCU_AST2500_HW_STRAP_RESERVED1)
> > +
> >  /* Witherspoon hardware value: 0xF10AD216 (but use romulus definition) */
> >  #define WITHERSPOON_BMC_HW_STRAP1 ROMULUS_BMC_HW_STRAP1
> >
> > @@ -798,6 +812,23 @@ static void aspeed_machine_tacoma_class_init(ObjectClass *oc, void *data)
> >          aspeed_soc_num_cpus(amc->soc_name);
> >  };
> >
> > +static void aspeed_machine_g220a_class_init(ObjectClass *oc, void *data)
> > +{
> > +    MachineClass *mc = MACHINE_CLASS(oc);
> > +    AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc);
> > +
> > +    mc->desc       = "Bytedance G220A BMC (ARM1176)";
> > +    amc->soc_name  = "ast2500-a1";
> > +    amc->hw_strap1 = G220A_BMC_HW_STRAP1;
> > +    amc->fmc_model = "n25q512a";
> > +    amc->spi_model = "mx25l25635e";
> > +    amc->num_cs    = 2;
>
> 'macs_mask' is missing. You won't get network.

Will Fix


>
> > +    amc->i2c_init  = NULL;
>
> Isn't it possible to add some default I2C devices ? temperature sensors ?

hmm, G220A BMC uses emc1413 as the temperature sensor. I can not find
it in qemu.
I can't find an i2c chip that qemu has and that the g220a uses. :(

>
> Thanks,
>
> C.
>
> > +    mc->default_ram_size = 1024 * MiB;
> > +    mc->default_cpus = mc->min_cpus = mc->max_cpus =
> > +        aspeed_soc_num_cpus(amc->soc_name);
> > +};
> > +
> >  static const TypeInfo aspeed_machine_types[] = {
> >      {
> >          .name          = MACHINE_TYPE_NAME("palmetto-bmc"),
> > @@ -835,6 +866,10 @@ static const TypeInfo aspeed_machine_types[] = {
> >          .name          = MACHINE_TYPE_NAME("tacoma-bmc"),
> >          .parent        = TYPE_ASPEED_MACHINE,
> >          .class_init    = aspeed_machine_tacoma_class_init,
> > +    }, {
> > +        .name          = MACHINE_TYPE_NAME("g220a-bmc"),
> > +        .parent        = TYPE_ASPEED_MACHINE,
> > +        .class_init    = aspeed_machine_g220a_class_init,
> >      }, {
> >          .name          = TYPE_ASPEED_MACHINE,
> >          .parent        = TYPE_MACHINE,
> >
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [External] Re: [PATCH] aspeed: Add support for the g220a-bmc board
  2020-09-28  9:18   ` [External] " 王志强
@ 2020-09-28 10:11     ` Cédric Le Goater
  2020-09-29  5:50       ` John Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Cédric Le Goater @ 2020-09-28 10:11 UTC (permalink / raw)
  To: 王志强
  Cc: Peter Maydell, Andrew Jeffery, yulei.sh,
	open list:All patches CC here, open list:ASPEED BMCs,
	Joel Stanley, xuxiaohan

>> Isn't it possible to add some default I2C devices ? temperature sensors ?
> 
> hmm, G220A BMC uses emc1413 as the temperature sensor. I can not find
> it in qemu.

Could it be compatible with the tm105 or TM421 ? 

> I can't find an i2c chip that qemu has and that the g220a uses. :(

Try to model them ! :)

Thanks,

C. 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [External] Re: [PATCH] aspeed: Add support for the g220a-bmc board
  2020-09-28 10:11     ` Cédric Le Goater
@ 2020-09-29  5:50       ` John Wang
  0 siblings, 0 replies; 5+ messages in thread
From: John Wang @ 2020-09-29  5:50 UTC (permalink / raw)
  To: Cédric Le Goater
  Cc: Peter Maydell, Andrew Jeffery, 郁雷,
	open list:All patches CC here, open list:ASPEED BMCs,
	Joel Stanley, Lotus Xu

On Mon, Sep 28, 2020 at 6:11 PM Cédric Le Goater <clg@kaod.org> wrote:
>
> >> Isn't it possible to add some default I2C devices ? temperature sensors ?
> >
> > hmm, G220A BMC uses emc1413 as the temperature sensor. I can not find
> > it in qemu.
>
> Could it be compatible with the tm105 or TM421 ?

It isn't, I think. but I try to model an emc1413, so I will send a patchset :)

>
> > I can't find an i2c chip that qemu has and that the g220a uses. :(
>
> Try to model them ! :)

Yes!

>
> Thanks,
>
> C.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-29  5:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-28  6:12 [PATCH] aspeed: Add support for the g220a-bmc board John Wang
2020-09-28  7:55 ` Cédric Le Goater
2020-09-28  9:18   ` [External] " 王志强
2020-09-28 10:11     ` Cédric Le Goater
2020-09-29  5:50       ` John Wang

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.