qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/7] m25p80: add a m25p80_set_rom_storage() rout


From: mar.krzeminski
Subject: Re: [Qemu-devel] [PATCH 4/7] m25p80: add a m25p80_set_rom_storage() routine
Date: Wed, 6 Jul 2016 19:44:09 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0



W dniu 06.07.2016 o 18:30, Cédric Le Goater pisze:
On 07/04/2016 08:12 PM, Cédric Le Goater wrote:
On 07/04/2016 07:57 PM, mar.krzeminski wrote:

W dniu 04.07.2016 o 14:18, Cédric Le Goater pisze:
Some SPI controllers, such as the Aspeed AST2400, have a mode in which
accesses to the flash content are no different than doing MMIOs. The
controller generates all the necessary commands to load (or store)
data in memory.

To emulate such a behavior, we need to have access to the underlying
storage of the flash object. The purpose of the routine is to set the
storage of a preinitialized SPI flash object, which can then be used
by the object itself but also by a SPI controller to handled the
MMIOs.
Hi,

I am not sure if this approach is correct. I can not find any datasheet
to this SPI controller, but as you mentioned in first paragraph, controller
generates all commands (probably ones are somehow configurable).
yes. see this patch :

        http://lists.nongnu.org/archive/html/qemu-devel/2016-06/msg08229.html

        /* CEx Control Register */
        #define R_CTRL0           (0x10 / 4)
        #define   CTRL_CMD_SHIFT           16
        #define   CTRL_CMD_MASK            0xff


In this series you hack this behaviour and you do direct access to file.
It is true it is not very respectful of the m25p80 interface.

IMHO you should emulate sending such commands in SPI controller
model.
I will give it a try. I don't think the alternative is a complex
change anyhow.
So yes, that would work out pretty well. But there is another need
that does not show up in the series (I am not splitting the patches
correctly I guess) We would like to boot directly from a flash image.
For this purpose, the pflash_cfi object uses a memory region of type
rom and uses the storage behind the region.

m25p80_set_rom_storage() is probably not the right API to share the
storage. I am looking for a way to handle this without changing too
much m25p80, which does not have a mem region currently. Suggestions
welcomed ! :)
I do not know if this is a good idea - for sure yet another complication,
but we still should process like the HW. The flash is memory mapped
to some memory area, so maybe creating alias to this memory area
would help with the implementation?
Then read will be still done by SPI and m25p80. Some configuration
from the board level might be needed to initialise the controller
(or maybe defaults are ok - depends how it is done in hw).

Regards,
Marcin
Thanks,

C.






reply via email to

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