qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: John Wang <wangzhiqiang.bj@bytedance.com>, <clkg@kaod.org>,
	<yulei.sh@bytedance.com>, <xuxiaohan@bytedance.com>,
	<joel@jms.id.au>
Cc: Andrew Jeffery <andrew@aj.id.au>,
	Peter Maydell <peter.maydell@linaro.org>,
	"open list:ASPEED BMCs" <qemu-arm@nongnu.org>,
	"open list:All patches CC here" <qemu-devel@nongnu.org>
Subject: Re: [PATCH 2/2] aspeed: Add support for the g220a-bmc board
Date: Thu, 1 Oct 2020 16:56:42 +0200	[thread overview]
Message-ID: <a4ff4f18-34fa-d3bd-9a63-dfbc8fb41f84@kaod.org> (raw)
In-Reply-To: <20200929055309.509-2-wangzhiqiang.bj@bytedance.com>

On 9/29/20 7:53 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>

Reviewed-by: Cédric Le Goater <clg@kaod.org>


One quick question below.

> ---
>  hw/arm/aspeed.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 60 insertions(+)
> 
> diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
> index bdb981d2f8..04c8ad2bcd 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
>  
> @@ -559,6 +573,30 @@ static void witherspoon_bmc_i2c_init(AspeedMachineState *bmc)
>      /* Bus 11: TODO ucd90160@64 */
>  }
>  
> +static void g220a_bmc_i2c_init(AspeedMachineState *bmc)
> +{
> +    AspeedSoCState *soc = &bmc->soc;
> +    DeviceState *dev;
> +
> +    dev = DEVICE(i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 3),
> +                                         "emc1413", 0x4c));
> +    object_property_set_int(OBJECT(dev), "temperature0", 31000, &error_abort);
> +    object_property_set_int(OBJECT(dev), "temperature1", 28000, &error_abort);
> +    object_property_set_int(OBJECT(dev), "temperature2", 20000, &error_abort);
> +
> +    dev = DEVICE(i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 12),
> +                                         "emc1413", 0x4c));
> +    object_property_set_int(OBJECT(dev), "temperature0", 31000, &error_abort);
> +    object_property_set_int(OBJECT(dev), "temperature1", 28000, &error_abort);
> +    object_property_set_int(OBJECT(dev), "temperature2", 20000, &error_abort);
> +
> +    dev = DEVICE(i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 13),
> +                                         "emc1413", 0x4c));
> +    object_property_set_int(OBJECT(dev), "temperature0", 31000, &error_abort);
> +    object_property_set_int(OBJECT(dev), "temperature1", 28000, &error_abort);
> +    object_property_set_int(OBJECT(dev), "temperature2", 20000, &error_abort);
> +}
> +
>  static bool aspeed_get_mmio_exec(Object *obj, Error **errp)
>  {
>      return ASPEED_MACHINE(obj)->mmio_exec;
> @@ -798,6 +836,24 @@ 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";

On real HW, is it a mx25l25635e or a mx25l25635f ? 

Thanks

C.

> +    amc->num_cs    = 2;
> +    amc->macs_mask  = ASPEED_MAC1_ON | ASPEED_MAC2_ON;
> +    amc->i2c_init  = g220a_bmc_i2c_init;
> +    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 +891,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,
> 



  reply	other threads:[~2020-10-01 15:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-29  5:53 [PATCH 1/2] hw/misc: add an EMC141{3,4} device model John Wang
2020-09-29  5:53 ` [PATCH 2/2] aspeed: Add support for the g220a-bmc board John Wang
2020-10-01 14:56   ` Cédric Le Goater [this message]
2020-10-08  1:56     ` [External] " John Wang
2020-10-05 22:55   ` Joel Stanley
2020-10-01 15:04 ` [PATCH 1/2] hw/misc: add an EMC141{3,4} device model Cédric Le Goater
2020-10-08  2:21   ` [External] Re: [PATCH 1/2] hw/misc: add an EMC141{3, 4} " John Wang

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=a4ff4f18-34fa-d3bd-9a63-dfbc8fb41f84@kaod.org \
    --to=clg@kaod.org \
    --cc=andrew@aj.id.au \
    --cc=clkg@kaod.org \
    --cc=joel@jms.id.au \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wangzhiqiang.bj@bytedance.com \
    --cc=xuxiaohan@bytedance.com \
    --cc=yulei.sh@bytedance.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 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).