Skip to content

aspeed: Add blockdev support for flash device definition

Cédric Le Goater qemu-arm qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest7 patches 5 repliesIn review

Changes in v3 from the cover letter

- renamed "addr" property to "cs"

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7hw/ssi: Add a "cs" property to SSIPeripheralhw/ssi/ssi.c include/hw/ssi/ssi.h+10 -00 replies
2/7hw/ssi: Introduce a ssi_get_cs() helperhw/ssi/ssi.c include/hw/ssi/ssi.h+17 -00 replies
3/7aspeed/smc: Wire CS lines at resethw/arm/aspeed.c hw/ssi/aspeed_smc.c+9 -40 replies
4/7hw/ssi: Check for duplicate CS indexeshw/arm/stellaris.c hw/arm/xilinx_zynq.c hw/arm/xlnx-versal-virt.c +3 more+29 -10 replies
5/7aspeed: Create flash devices only when defaults are enabledhw/arm/aspeed.c+4 -24 replies
5/7aspeed: Create flash devices only when defaults are enableddocs/system/arm/aspeed.rst hw/arm/aspeed.c+33 -81 reply
6/7m25p80: Introduce an helper to retrieve the BlockBackend of a devicehw/block/m25p80.c include/hw/block/flash.h+10 -00 replies
7/7aspeed: Get the BlockBackend of FMC0 from the flash devicehw/arm/aspeed.c+5 -30 replies

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchPhilippe Mathieu-DaudéJoel Stanley
1/7R-b R-b
2/7R-b R-b
3/7R-b
4/7R-b R-b
5/7R-b R-b
5/7R-b R-b
6/7R-b R-b
7/7R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/7] aspeed: Add blockdev support for flash device definition

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/[email protected]/

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(-)
Signature · 1 line
2.41.0