Received: from eggs.gnu.org ([209.51.188.92]:34274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLr9b-0006NM-Gm for qemu-devel@nongnu.org; Wed, 01 May 2019 11:28:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLr9Y-0002lU-Er for qemu-devel@nongnu.org; Wed, 01 May 2019 11:28:15 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:40916) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hLr9Y-0002kv-9P for qemu-devel@nongnu.org; Wed, 01 May 2019 11:28:12 -0400 Received: by mail-wr1-f67.google.com with SMTP id h4so24970716wre.7 for ; Wed, 01 May 2019 08:28:12 -0700 (PDT) References: <20190501061827.23080-1-joel@jms.id.au> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: <2f92e14a-28f7-3c03-8fb8-ca2a0c407cc0@redhat.com> Date: Wed, 1 May 2019 17:28:09 +0200 MIME-Version: 1.0 In-Reply-To: <20190501061827.23080-1-joel@jms.id.au> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] arm: aspeed: Set SDRAM size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Joel Stanley , Peter Maydell , =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Cc: Andrew Jeffery , qemu-arm@nongnu.org, qemu-devel@nongnu.org On 5/1/19 8:18 AM, Joel Stanley wrote: > We currently use Qemu's default of 128MB. As we know how much ram each > machine ships with, make it easier on users by setting a default. > > It can still be overridden with -m on the command line. > > Signed-off-by: Joel Stanley > --- > hw/arm/aspeed.c | 6 ++++++ > include/hw/arm/aspeed.h | 1 + > 2 files changed, 7 insertions(+) > > diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c > index 1c23ebd99252..3f3d4162b3c5 100644 > --- a/hw/arm/aspeed.c > +++ b/hw/arm/aspeed.c > @@ -331,6 +331,8 @@ static void aspeed_machine_class_init(ObjectClass *oc, void *data) > mc->no_floppy = 1; > mc->no_cdrom = 1; > mc->no_parallel = 1; > + if (board->ram) > + mc->default_ram_size = board->ram; > amc->board = board; > } > > @@ -352,6 +354,7 @@ static const AspeedBoardConfig aspeed_boards[] = { > .spi_model = "mx25l25635e", > .num_cs = 1, > .i2c_init = palmetto_bmc_i2c_init, > + .ram = 256 << 20, > }, { > .name = MACHINE_TYPE_NAME("ast2500-evb"), > .desc = "Aspeed AST2500 EVB (ARM1176)", > @@ -361,6 +364,7 @@ static const AspeedBoardConfig aspeed_boards[] = { > .spi_model = "mx25l25635e", > .num_cs = 1, > .i2c_init = ast2500_evb_i2c_init, > + .ram = 512 << 20, > }, { > .name = MACHINE_TYPE_NAME("romulus-bmc"), > .desc = "OpenPOWER Romulus BMC (ARM1176)", > @@ -370,6 +374,7 @@ static const AspeedBoardConfig aspeed_boards[] = { > .spi_model = "mx66l1g45g", > .num_cs = 2, > .i2c_init = romulus_bmc_i2c_init, > + .ram = 512 << 20, > }, { > .name = MACHINE_TYPE_NAME("witherspoon-bmc"), > .desc = "OpenPOWER Witherspoon BMC (ARM1176)", > @@ -379,6 +384,7 @@ static const AspeedBoardConfig aspeed_boards[] = { > .spi_model = "mx66l1g45g", > .num_cs = 2, > .i2c_init = witherspoon_bmc_i2c_init, > + .ram = 512 << 20, > }, > }; > > diff --git a/include/hw/arm/aspeed.h b/include/hw/arm/aspeed.h > index 325c091d09e4..02073a6b4d61 100644 > --- a/include/hw/arm/aspeed.h > +++ b/include/hw/arm/aspeed.h > @@ -22,6 +22,7 @@ typedef struct AspeedBoardConfig { > const char *spi_model; > uint32_t num_cs; > void (*i2c_init)(AspeedBoardState *bmc); > + uint32_t ram; default_ram_size is of type 'const ram_addr_t', can you use the same type here? > } AspeedBoardConfig; > > #define TYPE_ASPEED_MACHINE MACHINE_TYPE_NAME("aspeed") > Using macros from "qemu/units.h" as suggested by Richard: Reviewed-by: Philippe Mathieu-Daudé