@samitouri / QOSamiQemu / commits / 6d27cb19e8

hw/arm/fsl-imx8mm: Add Analog device IP to iMX8MM SOC

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. Reviewed-by: Bernhard Beschow <shentey@gmail.com> Signed-off-by: Gaurav Sharma <gaurav.sharma_7@nxp.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Gaurav Sharma committed Apr 21, 2026 at 12:22 UTC 6d27cb19e8d76bf0049f258521cd7f50f9f7f565
3 files changed +15
hw/arm/Kconfig
+1
@@ -620,6 +620,7 @@ config FSL_IMX8MP_EVK
620 config FSL_IMX8MM
621 bool
622 select ARM_GIC
623 + select FSL_IMX8MP_ANALOG
624 select IMX
625
626 config FSL_IMX8MM_EVK
hw/arm/fsl-imx8mm.c
+12
@@ -169,6 +169,8 @@ static void fsl_imx8mm_init(Object *obj)
169
170 object_initialize_child(obj, "gic", &s->gic, gicv3_class_name());
171
172 + object_initialize_child(obj, "analog", &s->analog, TYPE_IMX8MP_ANALOG);
173 +
174 for (i = 0; i < FSL_IMX8MM_NUM_UARTS; i++) {
175 g_autofree char *name = g_strdup_printf("uart%d", i + 1);
176 object_initialize_child(obj, name, &s->uart[i], TYPE_IMX_SERIAL);
@@ -303,6 +305,15 @@ static void fsl_imx8mm_realize(DeviceState *dev, Error **errp)
305 }
306 }
307
308 + /* Analog */
309 + object_property_set_uint(OBJECT(&s->analog), "arm-pll-fdiv-ctl0-reset",
310 + 0x000fa030, &error_abort);
311 + if (!sysbus_realize(SYS_BUS_DEVICE(&s->analog), errp)) {
312 + return;
313 + }
314 + sysbus_mmio_map(SYS_BUS_DEVICE(&s->analog), 0,
315 + fsl_imx8mm_memmap[FSL_IMX8MM_ANA_PLL].addr);
316 +
317 /* UARTs */
318 for (i = 0; i < FSL_IMX8MM_NUM_UARTS; i++) {
319 static const struct {
@@ -338,6 +349,7 @@ static void fsl_imx8mm_realize(DeviceState *dev, Error **errp)
349 /* Unimplemented devices */
350 for (i = 0; i < ARRAY_SIZE(fsl_imx8mm_memmap); i++) {
351 switch (i) {
352 + case FSL_IMX8MM_ANA_PLL:
353 case FSL_IMX8MM_GIC_DIST:
354 case FSL_IMX8MM_GIC_REDIST:
355 case FSL_IMX8MM_RAM:
include/hw/arm/fsl-imx8mm.h
+2
@@ -13,6 +13,7 @@
13 #include "cpu.h"
14 #include "hw/char/imx_serial.h"
15 #include "hw/intc/arm_gicv3_common.h"
16 +#include "hw/misc/imx8mp_analog.h"
17 #include "qom/object.h"
18 #include "qemu/units.h"
19
@@ -33,6 +34,7 @@ struct FslImx8mmState {
34
35 ARMCPU cpu[FSL_IMX8MM_NUM_CPUS];
36 GICv3State gic;
37 + IMX8MPAnalogState analog;
38 IMXSerialState uart[FSL_IMX8MM_NUM_UARTS];
39 MemoryRegion ocram;
40 };