[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH v5 14/14] aspeed: allocate RAM after the memory co
From: |
Andrew Jeffery |
Subject: |
Re: [Qemu-arm] [PATCH v5 14/14] aspeed: allocate RAM after the memory controller has checked the size |
Date: |
Tue, 13 Sep 2016 12:26:39 +0930 |
On Fri, 2016-09-09 at 18:22 +0200, Cédric Le Goater wrote:
> If the RAM size is invalid, the memory controller will use a default
> value.
>
> Signed-off-by: Cédric Le Goater <address@hidden>
Reviewed-by: Andrew Jeffery <address@hidden>
> ---
> hw/arm/aspeed.c | 18 +++++++++++++-----
> 1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
> index 562bbb253391..6b18c7f1727c 100644
> --- a/hw/arm/aspeed.c
> +++ b/hw/arm/aspeed.c
> @@ -108,11 +108,6 @@ static void aspeed_board_init(MachineState *machine,
>
> sc = ASPEED_SOC_GET_CLASS(&bmc->soc);
>
> - memory_region_allocate_system_memory(&bmc->ram, NULL, "ram", ram_size);
> - memory_region_add_subregion(get_system_memory(), sc->info->sdram_base,
> - &bmc->ram);
> - object_property_add_const_link(OBJECT(&bmc->soc), "ram",
> OBJECT(&bmc->ram),
> - &error_abort);
> object_property_set_int(OBJECT(&bmc->soc), ram_size, "ram-size",
> &error_abort);
> object_property_set_int(OBJECT(&bmc->soc), cfg->hw_strap1, "hw-strap1",
> @@ -120,6 +115,19 @@ static void aspeed_board_init(MachineState *machine,
> object_property_set_bool(OBJECT(&bmc->soc), true, "realized",
> &error_abort);
>
> + /*
> + * Allocate RAM after the memory controller has checked the size
> + * was valid. If not, a default value is used.
> + */
> + ram_size = object_property_get_int(OBJECT(&bmc->soc), "ram-size",
> + &error_abort);
> +
> + memory_region_allocate_system_memory(&bmc->ram, NULL, "ram", ram_size);
> + memory_region_add_subregion(get_system_memory(), sc->info->sdram_base,
> + &bmc->ram);
> + object_property_add_const_link(OBJECT(&bmc->soc), "ram",
> OBJECT(&bmc->ram),
> + &error_abort);
> +
> aspeed_board_init_flashes(&bmc->soc.smc, "n25q256a", &error_abort);
> aspeed_board_init_flashes(&bmc->soc.spi, "mx25l25635e", &error_abort);
>
signature.asc
Description: This is a digitally signed message part
- [Qemu-arm] [PATCH v5 08/14] aspeed: add a ast2500 SoC and support to the SCU and SDMC controllers, (continued)
- [Qemu-arm] [PATCH v5 08/14] aspeed: add a ast2500 SoC and support to the SCU and SDMC controllers, Cédric Le Goater, 2016/09/09
- [Qemu-arm] [PATCH v5 09/14] arm: add support for an ast2500 evaluation board, Cédric Le Goater, 2016/09/09
- [Qemu-arm] [PATCH v5 10/14] palmetto-bmc: remove extra no_sdcard assignement, Cédric Le Goater, 2016/09/09
- [Qemu-arm] [PATCH v5 11/14] aspeed: calculate the RAM size bits at realize time, Cédric Le Goater, 2016/09/09
- [Qemu-arm] [PATCH v5 12/14] aspeed: use error_report instead of LOG_GUEST_ERROR, Cédric Le Goater, 2016/09/09
- [Qemu-arm] [PATCH v5 13/14] aspeed: add a ram_size property to the memory controller, Cédric Le Goater, 2016/09/09
- [Qemu-arm] [PATCH v5 14/14] aspeed: allocate RAM after the memory controller has checked the size, Cédric Le Goater, 2016/09/09
- Re: [Qemu-arm] [PATCH v5 14/14] aspeed: allocate RAM after the memory controller has checked the size,
Andrew Jeffery <=
- Re: [Qemu-arm] [PATCH v5 00/14] arm: add ast2500 support, Peter Maydell, 2016/09/19