qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 4/5] ast2400: create SPI flash slaves


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v2 4/5] ast2400: create SPI flash slaves
Date: Mon, 20 Jun 2016 16:38:10 +0100

On 17 June 2016 at 13:15, Cédric Le Goater <address@hidden> wrote:
> A set of SPI flash slaves is attached under the flash controllers of
> the palmetto platform. "n25q256a" flash modules are used for the BMC
> and "mx25l25635e" for the host. These types are common in the
> OpenPower ecosystem.
>
> The segment addresses used for the memory mappings are the defaults
> provided by the specs. They can be changed with the Segment Address
> Register but this is not supported in the current implementation.
>
> Signed-off-by: Cédric Le Goater <address@hidden>
> ---

> diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
> index 6a02906c8f97..a8337eb81975 100644
> --- a/hw/ssi/aspeed_smc.c
> +++ b/hw/ssi/aspeed_smc.c

> +void aspeed_smc_init_flashes(AspeedSMCState *s, const char *flashtype,
> +                             Error **errp)
> +{
> +    int i ;
> +    char name[32];
> +
> +    for (i = 0; i < s->num_cs; ++i) {
> +        Object *obj = object_new(TYPE_ASPEED_SMC_FLASH);
> +        AspeedSMCFlashState *fl = ASPEED_SMC_FLASH(obj);
> +        DriveInfo *dinfo = drive_get_next(IF_MTD);

You don't want to be calling drive_get_next() in code in
hw/ssi -- that should be done at the board level, and then
the board creates the flash device and sets its drive property
and connects the flash device up to the SSI controller.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]