[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH v2 4/5] ast2400: create SPI flash slaves
From: |
Cédric Le Goater |
Subject: |
Re: [Qemu-arm] [PATCH v2 4/5] ast2400: create SPI flash slaves |
Date: |
Mon, 20 Jun 2016 18:02:03 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.1.0 |
On 06/20/2016 05:38 PM, Peter Maydell wrote:
> 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.
OK. I will rework that part.
Thanks,
C.
- [Qemu-arm] [PATCH v2 0/5] ast2400: SMC controllers, Cédric Le Goater, 2016/06/17
- [Qemu-arm] [PATCH v2 1/5] m25p80: qdev-ify drive property, Cédric Le Goater, 2016/06/17
- [Qemu-arm] [PATCH v2 2/5] ast2400: add SMC controllers (FMC and SPI), Cédric Le Goater, 2016/06/17
- [Qemu-arm] [PATCH v2 3/5] ast2400: add SPI flash slave object, Cédric Le Goater, 2016/06/17
- [Qemu-arm] [PATCH v2 4/5] ast2400: create SPI flash slaves, Cédric Le Goater, 2016/06/17
- [Qemu-arm] [PATCH v2 5/5] tests: add a m25p80 test, Cédric Le Goater, 2016/06/17