Cédric Le Goater 27a2c66c92 aspeed/smc: Wire CS lines at reset
Currently, a set of default flash devices is created at machine init
and drives defined on the QEMU command line are associated to the FMC
and SPI controllers in sequence :

   -drive file<file>,format=raw,if=mtd
   -drive file<file1>,format=raw,if=mtd

The CS lines are wired in the same creation loop. This makes a strong
assumption on the ordering and is not very flexible since only a
limited set of flash devices can be defined : 1 FMC + 1 or 2 SPI,
which is less than what the SoC really supports.

A better alternative would be to define the flash devices on the
command line using a blockdev attached to a CS line of a SSI bus :

    -blockdev node-name=fmc0,driver=file,filename=./flash.img
    -device mx66u51235f,cs=0x0,bus=ssi.0,drive=fmc0

However, user created flash devices are not correctly wired to their
SPI controller and consequently can not be used by the machine. Fix
that and wire the CS lines of all available devices when the SSI bus
is reset.

Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2023-09-01 11:40:04 +02:00
..
2023-07-25 17:15:47 +03:00
2023-09-01 11:40:04 +02:00
2023-08-23 12:06:39 +02:00
2023-08-23 12:06:39 +02:00
2023-08-23 12:06:39 +02:00
2023-08-31 09:45:17 +01:00
2023-08-24 10:08:33 -04:00
2023-07-25 17:14:07 +03:00
2023-09-01 11:40:04 +02:00