On qemu-riscv64_smode_defconfig the flash size was incorrectly reported.

The QEMU code has:

    hw/arm/virt.c:1792:    qdev_prop_set_uint8(dev, "width", 4);
    hw/riscv/virt.c:134:   qdev_prop_set_uint8(dev, "width", 4);

As U-Boot lacks autodetection of the port width, we need to set
CONFIG_SYS_FLASH_CFI_WIDTH_32BIT=y.

Signed-off-by: Heinrich Schuchardt <[email protected]>
---
 drivers/mtd/Kconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index f6bd9f6f2e9..b370b2b6726 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -60,6 +60,9 @@ config FLASH_CFI_DRIVER
 choice
        prompt "Data-width of the flash device"
        depends on FLASH_CFI_DRIVER
+       default SYS_FLASH_CFI_WIDTH_32BIT if \
+               TARGET_QEMU_ARM_32BIT || TARGET_QEMU_ARM_64BIT || \
+               TARGET_QEMU_VIRT
        default SYS_FLASH_CFI_WIDTH_8BIT
 
 config SYS_FLASH_CFI_WIDTH_8BIT
-- 
2.53.0

Reply via email to