Thanks Philippe for reviewing and catching this. Yes, it should be a 'static 
const' since we do not expect this struct to be modified. My bad. This pattern 
needs to be fixed in multiple patches. I will wait for additional review 
comments on the patch series before rolling out a v2. v2 will also have changes 
to remove iMX8MM CSI and DSI dtb nodes since they are unimplemented. 

-----Original Message-----
From: Philippe Mathieu-Daudé <[email protected]> 
Sent: 10 November 2025 20:35
To: Gaurav Sharma <[email protected]>; [email protected]
Cc: [email protected]; [email protected]
Subject: [EXT] Re: [PATCH 04/13] hw/arm/fsl-imx8mm: Adding support for USDHC 
storage controllers

[You don't often get email from [email protected]. Learn why this is important 
at https://aka.ms/LearnAboutSenderIdentification ]

Caution: This is an external email. Please take care when clicking links or 
opening attachments. When in doubt, report the message using the 'Report this 
email' button


On 10/11/25 12:22, Gaurav Sharma wrote:
> It enables emulation of SD/MMC cards through a virtual SDHCI interface 
> The emulated SDHCI controller allows guest OS to use emulated storage 
> as a standard block device.
> This will allow running the images such as those generated by 
> Buildroot.
>
> Signed-off-by: Gaurav Sharma <[email protected]>
> ---
>   docs/system/arm/imx8mm-evk.rst |  1 +
>   hw/arm/Kconfig                 |  1 +
>   hw/arm/fsl-imx8mm.c            | 25 +++++++++++++++++++++++++
>   hw/arm/imx8mm-evk.c            | 17 +++++++++++++++++
>   include/hw/arm/fsl-imx8mm.h    |  7 +++++++
>   5 files changed, 51 insertions(+)


> @@ -342,6 +346,26 @@ static void fsl_imx8mm_realize(DeviceState *dev, Error 
> **errp)
>                              qdev_get_gpio_in(gicdev, serial_table[i].irq));
>       }
>
> +    /* USDHCs */
> +    for (i = 0; i < FSL_IMX8MM_NUM_USDHCS; i++) {

static const?

> +        struct {
> +            hwaddr addr;
> +            unsigned int irq;
> +        } usdhc_table[FSL_IMX8MM_NUM_USDHCS] = {
> +            { fsl_imx8mm_memmap[FSL_IMX8MM_USDHC1].addr, 
> FSL_IMX8MM_USDHC1_IRQ },
> +            { fsl_imx8mm_memmap[FSL_IMX8MM_USDHC2].addr, 
> FSL_IMX8MM_USDHC2_IRQ },
> +            { fsl_imx8mm_memmap[FSL_IMX8MM_USDHC3].addr, 
> FSL_IMX8MM_USDHC3_IRQ },
> +        };
> +
> +        if (!sysbus_realize(SYS_BUS_DEVICE(&s->usdhc[i]), errp)) {
> +            return;
> +        }
> +
> +        sysbus_mmio_map(SYS_BUS_DEVICE(&s->usdhc[i]), 0, 
> usdhc_table[i].addr);
> +        sysbus_connect_irq(SYS_BUS_DEVICE(&s->usdhc[i]), 0,
> +                           qdev_get_gpio_in(gicdev, usdhc_table[i].irq));
> +    }

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>


Reply via email to