* [PATCH] hw/arm/aspeed: Add board model for Supermicro X11 BMC
@ 2020-07-14 20:36 erik-smit
2020-07-15 13:06 ` Cédric Le Goater
0 siblings, 1 reply; 3+ messages in thread
From: erik-smit @ 2020-07-14 20:36 UTC (permalink / raw)
Cc: Peter Maydell, Andrew Jeffery, open list:All patches CC here,
erik-smit, open list:ASPEED BMCs, Cédric Le Goater,
Joel Stanley
Signed-off-by: erik-smit <erik.lucas.smit@gmail.com>
--
checkpatch was complaining about the length of
aspeed_machine_supermicrox11_bmc_class_init(ObjectClass *oc, void *data)
so I renamed it to aspeed_machine_smx11_bmc_class_init. Not sure if
that's the right way to go, since then it's out of sync with the machine
name "supermicrox11-bmc". But renaming the machine name to "smx11-bmc"
makes it less descriptive...
---
hw/arm/aspeed.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 379f9672a5..e74a89f427 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -57,6 +57,20 @@ struct AspeedMachineState {
SCU_HW_STRAP_VGA_SIZE_SET(VGA_16M_DRAM) | \
SCU_AST2400_HW_STRAP_BOOT_MODE(AST2400_SPI_BOOT))
+/* TODO: Find the actual hardware value */
+#define SUPERMICROX11_BMC_HW_STRAP1 ( \
+ SCU_AST2400_HW_STRAP_DRAM_SIZE(DRAM_SIZE_128MB) | \
+ SCU_AST2400_HW_STRAP_DRAM_CONFIG(2) | \
+ SCU_AST2400_HW_STRAP_ACPI_DIS | \
+ SCU_AST2400_HW_STRAP_SET_CLK_SOURCE(AST2400_CLK_48M_IN) | \
+ SCU_HW_STRAP_VGA_CLASS_CODE | \
+ SCU_HW_STRAP_LPC_RESET_PIN | \
+ SCU_HW_STRAP_SPI_MODE(SCU_HW_STRAP_SPI_M_S_EN) | \
+ SCU_AST2400_HW_STRAP_SET_CPU_AHB_RATIO(AST2400_CPU_AHB_RATIO_2_1) | \
+ SCU_HW_STRAP_SPI_WIDTH | \
+ SCU_HW_STRAP_VGA_SIZE_SET(VGA_16M_DRAM) | \
+ SCU_AST2400_HW_STRAP_BOOT_MODE(AST2400_SPI_BOOT))
+
/* AST2500 evb hardware value: 0xF100C2E6 */
#define AST2500_EVB_HW_STRAP1 (( \
AST2500_HW_STRAP1_DEFAULTS | \
@@ -600,6 +614,22 @@ static void aspeed_machine_palmetto_class_init(ObjectClass *oc, void *data)
aspeed_soc_num_cpus(amc->soc_name);
};
+static void aspeed_machine_smx11_bmc_class_init(ObjectClass *oc, void *data)
+{
+ MachineClass *mc = MACHINE_CLASS(oc);
+ AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc);
+
+ mc->desc = "Supermicro X11 BMC (ARM926EJ-S)";
+ amc->soc_name = "ast2400-a1";
+ amc->hw_strap1 = SUPERMICROX11_BMC_HW_STRAP1;
+ amc->fmc_model = "mx25l25635e";
+ amc->spi_model = "mx25l25635e";
+ amc->num_cs = 1;
+ amc->macs_mask = ASPEED_MAC0_ON | ASPEED_MAC1_ON;
+ amc->i2c_init = palmetto_bmc_i2c_init;
+ mc->default_ram_size = 256 * MiB;
+}
+
static void aspeed_machine_ast2500_evb_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
@@ -728,6 +758,10 @@ static const TypeInfo aspeed_machine_types[] = {
.name = MACHINE_TYPE_NAME("palmetto-bmc"),
.parent = TYPE_ASPEED_MACHINE,
.class_init = aspeed_machine_palmetto_class_init,
+ }, {
+ .name = MACHINE_TYPE_NAME("supermicrox11-bmc"),
+ .parent = TYPE_ASPEED_MACHINE,
+ .class_init = aspeed_machine_smx11_bmc_class_init,
}, {
.name = MACHINE_TYPE_NAME("ast2500-evb"),
.parent = TYPE_ASPEED_MACHINE,
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/arm/aspeed: Add board model for Supermicro X11 BMC
2020-07-14 20:36 [PATCH] hw/arm/aspeed: Add board model for Supermicro X11 BMC erik-smit
@ 2020-07-15 13:06 ` Cédric Le Goater
2020-07-15 17:33 ` Erik Smit
0 siblings, 1 reply; 3+ messages in thread
From: Cédric Le Goater @ 2020-07-15 13:06 UTC (permalink / raw)
To: erik-smit
Cc: Andrew Jeffery, Peter Maydell, open list:ASPEED BMCs,
Joel Stanley, open list:All patches CC here
> Signed-off-by: erik-smit <erik.lucas.smit@gmail.com>
> --
> checkpatch was complaining about the length of
> aspeed_machine_supermicrox11_bmc_class_init(ObjectClass *oc, void *data)
in which way ? line too long ? If so, you can insert a return inside
the parameter list.
> so I renamed it to aspeed_machine_smx11_bmc_class_init. Not sure if
> that's the right way to go, since then it's out of sync with the machine
> name "supermicrox11-bmc". But renaming the machine name to "smx11-bmc"
> makes it less descriptive...
You should put the patch comments below the '---'
> ---
> hw/arm/aspeed.c | 34 ++++++++++++++++++++++++++++++++++
> 1 file changed, 34 insertions(+)
>
> diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
> index 379f9672a5..e74a89f427 100644
> --- a/hw/arm/aspeed.c
> +++ b/hw/arm/aspeed.c
> @@ -57,6 +57,20 @@ struct AspeedMachineState {
> SCU_HW_STRAP_VGA_SIZE_SET(VGA_16M_DRAM) | \
> SCU_AST2400_HW_STRAP_BOOT_MODE(AST2400_SPI_BOOT))
>
> +/* TODO: Find the actual hardware value */
If you can access the BMC console, you can do that from u-boot.
> +#define SUPERMICROX11_BMC_HW_STRAP1 ( \
> + SCU_AST2400_HW_STRAP_DRAM_SIZE(DRAM_SIZE_128MB) | \
> + SCU_AST2400_HW_STRAP_DRAM_CONFIG(2) | \
> + SCU_AST2400_HW_STRAP_ACPI_DIS | \
> + SCU_AST2400_HW_STRAP_SET_CLK_SOURCE(AST2400_CLK_48M_IN) | \
> + SCU_HW_STRAP_VGA_CLASS_CODE | \
> + SCU_HW_STRAP_LPC_RESET_PIN | \
> + SCU_HW_STRAP_SPI_MODE(SCU_HW_STRAP_SPI_M_S_EN) | \
> + SCU_AST2400_HW_STRAP_SET_CPU_AHB_RATIO(AST2400_CPU_AHB_RATIO_2_1) | \
> + SCU_HW_STRAP_SPI_WIDTH | \
> + SCU_HW_STRAP_VGA_SIZE_SET(VGA_16M_DRAM) | \
> + SCU_AST2400_HW_STRAP_BOOT_MODE(AST2400_SPI_BOOT))
> +
> /* AST2500 evb hardware value: 0xF100C2E6 */
> #define AST2500_EVB_HW_STRAP1 (( \
> AST2500_HW_STRAP1_DEFAULTS | \
> @@ -600,6 +614,22 @@ static void aspeed_machine_palmetto_class_init(ObjectClass *oc, void *data)
> aspeed_soc_num_cpus(amc->soc_name);
> };
>
> +static void aspeed_machine_smx11_bmc_class_init(ObjectClass *oc, void *data)
> +{
> + MachineClass *mc = MACHINE_CLASS(oc);
> + AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc);
> +
> + mc->desc = "Supermicro X11 BMC (ARM926EJ-S)";
> + amc->soc_name = "ast2400-a1";
> + amc->hw_strap1 = SUPERMICROX11_BMC_HW_STRAP1;
> + amc->fmc_model = "mx25l25635e";
> + amc->spi_model = "mx25l25635e";
> + amc->num_cs = 1;
> + amc->macs_mask = ASPEED_MAC0_ON | ASPEED_MAC1_ON;
> + amc->i2c_init = palmetto_bmc_i2c_init;
> + mc->default_ram_size = 256 * MiB;
> +}
> +
> static void aspeed_machine_ast2500_evb_class_init(ObjectClass *oc, void *data)
> {
> MachineClass *mc = MACHINE_CLASS(oc);
> @@ -728,6 +758,10 @@ static const TypeInfo aspeed_machine_types[] = {
> .name = MACHINE_TYPE_NAME("palmetto-bmc"),
> .parent = TYPE_ASPEED_MACHINE,
> .class_init = aspeed_machine_palmetto_class_init,
> + }, {
> + .name = MACHINE_TYPE_NAME("supermicrox11-bmc"),
> + .parent = TYPE_ASPEED_MACHINE,
> + .class_init = aspeed_machine_smx11_bmc_class_init,
> }, {
> .name = MACHINE_TYPE_NAME("ast2500-evb"),
> .parent = TYPE_ASPEED_MACHINE,
> --
> 2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/arm/aspeed: Add board model for Supermicro X11 BMC
2020-07-15 13:06 ` Cédric Le Goater
@ 2020-07-15 17:33 ` Erik Smit
0 siblings, 0 replies; 3+ messages in thread
From: Erik Smit @ 2020-07-15 17:33 UTC (permalink / raw)
To: Cédric Le Goater
Cc: Andrew Jeffery, Peter Maydell, open list:ASPEED BMCs,
Joel Stanley, open list:All patches CC here
Hey Cédric,
On Wed, 15 Jul 2020 at 15:07, Cédric Le Goater <clg@kaod.org> wrote:
> > Signed-off-by: erik-smit <erik.lucas.smit@gmail.com>
> > --
> > checkpatch was complaining about the length of
> > aspeed_machine_supermicrox11_bmc_class_init(ObjectClass *oc, void *data)
>
> in which way ? line too long ?
Yes.
> If so, you can insert a return inside the parameter list.
Ok. Next patch coming up. Thanks for the input.
>
> > so I renamed it to aspeed_machine_smx11_bmc_class_init. Not sure if
> > that's the right way to go, since then it's out of sync with the machine
> > name "supermicrox11-bmc". But renaming the machine name to "smx11-bmc"
> > makes it less descriptive...
>
> You should put the patch comments below the '---'
Thank you.
> > ---
> > hw/arm/aspeed.c | 34 ++++++++++++++++++++++++++++++++++
> > 1 file changed, 34 insertions(+)
> >
> > diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
> > index 379f9672a5..e74a89f427 100644
> > --- a/hw/arm/aspeed.c
> > +++ b/hw/arm/aspeed.c
> > @@ -57,6 +57,20 @@ struct AspeedMachineState {
> > SCU_HW_STRAP_VGA_SIZE_SET(VGA_16M_DRAM) | \
> > SCU_AST2400_HW_STRAP_BOOT_MODE(AST2400_SPI_BOOT))
> >
> > +/* TODO: Find the actual hardware value */
>
> If you can access the BMC console, you can do that from u-boot.
I don't own this hardware anymore. Missing playing with this hardware
is one of the reasons I'm emulating it.
--
Best regards,
Erik Smit
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-07-15 17:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-14 20:36 [PATCH] hw/arm/aspeed: Add board model for Supermicro X11 BMC erik-smit
2020-07-15 13:06 ` Cédric Le Goater
2020-07-15 17:33 ` Erik Smit
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).