Am 5. Dezember 2025 05:38:07 UTC schrieb Gaurav Sharma <[email protected]>: >Add the Analog IP to i.MX8MM SoC. iMX8MM and i.MX8MP uses >the same Analog IP so the analog ip source will be shared. > >The ARM PLL divider control register (arm-pll-fdiv-ctl0) has >a different reset value on i.MX8MM (0x000fa030) compared to >i.MX8MP (0x000fa031). So iMX8MM will be overriding this property >with its own reset-value. > >Signed-off-by: Gaurav Sharma <[email protected]> >--- > hw/arm/Kconfig | 1 + > hw/arm/fsl-imx8mm.c | 12 ++++++++++++ > include/hw/arm/fsl-imx8mm.h | 2 ++ > 3 files changed, 15 insertions(+) > >diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig >index be38c67a1c..3737335841 100644 >--- a/hw/arm/Kconfig >+++ b/hw/arm/Kconfig >@@ -629,6 +629,7 @@ config FSL_IMX8MP_EVK > config FSL_IMX8MM > bool > select ARM_GIC >+ select FSL_IMX8MP_ANALOG > select IMX > > config FSL_IMX8MM_EVK >diff --git a/hw/arm/fsl-imx8mm.c b/hw/arm/fsl-imx8mm.c >index fb6a78adba..2c84e70c01 100644 >--- a/hw/arm/fsl-imx8mm.c >+++ b/hw/arm/fsl-imx8mm.c >@@ -169,6 +169,8 @@ static void fsl_imx8mm_init(Object *obj) > > object_initialize_child(obj, "gic", &s->gic, gicv3_class_name()); > >+ object_initialize_child(obj, "analog", &s->analog, TYPE_IMX8MP_ANALOG); >+ > for (i = 0; i < FSL_IMX8MM_NUM_UARTS; i++) { > g_autofree char *name = g_strdup_printf("uart%d", i + 1); > object_initialize_child(obj, name, &s->uart[i], TYPE_IMX_SERIAL); >@@ -303,6 +305,15 @@ static void fsl_imx8mm_realize(DeviceState *dev, Error >**errp) > } > } > >+ /* Analog */ >+ object_property_set_uint(OBJECT(&s->analog), "arm-pll-fdiv-ctl0-reset", >+ 0x000fa030, &error_abort); >+ if (!sysbus_realize(SYS_BUS_DEVICE(&s->analog), errp)) { >+ return; >+ } >+ sysbus_mmio_map(SYS_BUS_DEVICE(&s->analog), 0, >+ fsl_imx8mm_memmap[FSL_IMX8MM_ANA_PLL].addr); >+ > /* UARTs */ > for (i = 0; i < FSL_IMX8MM_NUM_UARTS; i++) { > static const struct { >@@ -328,6 +339,7 @@ static void fsl_imx8mm_realize(DeviceState *dev, Error >**errp) > /* Unimplemented devices */ > for (i = 0; i < ARRAY_SIZE(fsl_imx8mm_memmap); i++) { > switch (i) { >+ case FSL_IMX8MM_ANA_PLL: > case FSL_IMX8MM_GIC_DIST: > case FSL_IMX8MM_GIC_REDIST: > case FSL_IMX8MM_RAM: >diff --git a/include/hw/arm/fsl-imx8mm.h b/include/hw/arm/fsl-imx8mm.h >index 133f519b7c..4601f57f2b 100644 >--- a/include/hw/arm/fsl-imx8mm.h >+++ b/include/hw/arm/fsl-imx8mm.h >@@ -13,6 +13,7 @@ > #include "cpu.h" > #include "hw/char/imx_serial.h" > #include "hw/intc/arm_gicv3_common.h" >+#include "hw/misc/imx8mp_analog.h" > #include "qom/object.h" > #include "qemu/units.h" > >@@ -33,6 +34,7 @@ struct FslImx8mmState { > > ARMCPU cpu[FSL_IMX8MM_NUM_CPUS]; > GICv3State gic; >+ IMX8MPAnalogState analog; > IMXSerialState uart[FSL_IMX8MM_NUM_UARTS]; > }; > Reviewed-by: Bernhard Beschow <[email protected]>
