mbox series

[v3,0/7] aspeed: Add blockdev support for flash device definition

Message ID 20230831123922.105200-1-clg@kaod.org (mailing list archive)
Headers show
Series aspeed: Add blockdev support for flash device definition | expand

Message

Cédric Le Goater Aug. 31, 2023, 12:39 p.m. UTC
Hello,

This is a respin of series [1] without the patches merged in 8.1.
Since I renamed a property as suggested, I though people might want to
see the result before the next aspeed PR.

It offers the capability to define all CS of all SPI controllers
without introducing new machine types, using blockdev on the command
line :

    -blockdev node-name=fmc0,driver=file,filename=./flash-ast2600-evb \
    -device mx66u51235f,bus=ssi.0,cs=0x0,drive=fmc0 \
    -blockdev node-name=fmc1,driver=file,filename=./flash-ast2600-evb-alt \
    -device mx66u51235f,bus=ssi.0,cs=0x1,drive=fmc1 \
    -blockdev node-name=spi1,driver=file,filename=./ast2600-evb.pnor \
    -device mx66u51235f,cs=0x0,bus=ssi.1,drive=spi1 \

With these changes, it is now possible :

 - to define block backends out of order instead relying on the command
   line order when using drives.
   
 - to define *all* devices backends. Some machines support up to 8.
 
 - to use different flash models without adding new boards. Machine
   options "spi-model" and "fmc-model" could be deprecated.
   
 - to start the machine with -nodefaults to let it fetch instructions
   from the FMC0 device, as HW does. Machine option "execute-in-place"
   could be deprecated.

Ultimately, we will get rid of drive_get(IF_MTD, ...) but we are not
there yet.

Thanks,

C.

[1] https://lore.kernel.org/qemu-devel/20230607043943.1837186-1-clg@kaod.org/

Changes in v3:

  - renamed "addr" property to "cs"

Changes in v2:

  - changed "addr" property to a uint8_t
  - renamed "uart" machine option to "bmc-console" 

Cédric Le Goater (7):
  hw/ssi: Add a "cs" property to SSIPeripheral
  hw/ssi: Introduce a ssi_get_cs() helper
  aspeed/smc: Wire CS lines at reset
  hw/ssi: Check for duplicate CS indexes
  aspeed: Create flash devices only when defaults are enabled
  m25p80: Introduce an helper to retrieve the BlockBackend of a device
  aspeed: Get the BlockBackend of FMC0 from the flash device

 include/hw/block/flash.h            |  4 +++
 include/hw/ssi/ssi.h                |  5 ++++
 hw/arm/aspeed.c                     | 19 +++++++------
 hw/arm/stellaris.c                  |  4 ++-
 hw/arm/xilinx_zynq.c                |  1 +
 hw/arm/xlnx-versal-virt.c           |  1 +
 hw/arm/xlnx-zcu102.c                |  2 ++
 hw/block/m25p80.c                   |  6 ++++
 hw/microblaze/petalogix_ml605_mmu.c |  1 +
 hw/ssi/aspeed_smc.c                 |  8 ++++++
 hw/ssi/ssi.c                        | 43 +++++++++++++++++++++++++++++
 11 files changed, 84 insertions(+), 10 deletions(-)