aboutsummaryrefslogtreecommitdiff
path: root/include/hw/block
diff options
context:
space:
mode:
authorCédric Le Goater <clg@redhat.com>2024-03-19 08:33:20 +0100
committerCédric Le Goater <clg@redhat.com>2024-03-19 11:58:15 +0100
commita7538ca0791880b6aeb2cc4cc8c00305e2d975f8 (patch)
treebcdfc2b93d2987cad28387aea709117e7630b173 /include/hw/block
parent5b2b9450a2f83668bedd092b43233ad35f0d40bd (diff)
downloadqemu-a7538ca0791880b6aeb2cc4cc8c00305e2d975f8.zip
qemu-a7538ca0791880b6aeb2cc4cc8c00305e2d975f8.tar.gz
qemu-a7538ca0791880b6aeb2cc4cc8c00305e2d975f8.tar.bz2
aspeed/smc: Only wire flash devices at reset
The Aspeed machines have many Static Memory Controllers (SMC), up to 8, which can only drive flash memory devices. Commit 27a2c66c92ec ("aspeed/smc: Wire CS lines at reset") tried to ease the definitions of these devices by allowing flash devices from the command line to be attached to a SSI bus. For that, the wiring of the CS lines of the Aspeed SMC controller was moved at reset. Two assumptions are made though, first that the device has a SSI_GPIO_CS GPIO line, which is not always the case, and second that it is a flash device. Correct this problem by ensuring that the devices attached to the bus are of the correct flash type. This fixes a QEMU abort when devices without a CS line, such as the max111x, are passed on the command line. While at it, export TYPE_M25P80 used in the Xilinx Versal Virtual machine. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2228 Fixes: 27a2c66c92ec ("aspeed/smc: Wire CS lines at reset") Reported-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Tested-by: Thomas Huth <thuth@redhat.com> [ clg: minor fixes in the commit log ] Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'include/hw/block')
-rw-r--r--include/hw/block/flash.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/hw/block/flash.h b/include/hw/block/flash.h
index de93756..2b5ccd9 100644
--- a/include/hw/block/flash.h
+++ b/include/hw/block/flash.h
@@ -78,6 +78,8 @@ extern const VMStateDescription vmstate_ecc_state;
/* m25p80.c */
+#define TYPE_M25P80 "m25p80-generic"
+
BlockBackend *m25p80_get_blk(DeviceState *dev);
#endif