qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gaurav Sharma <gaurav.sharma_7@nxp.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, peter.maydell@linaro.org,
	Gaurav Sharma <gaurav.sharma_7@nxp.com>
Subject: [PATCHv3 03/13] hw/arm/fsl-imx8mm: Implemented support for SNVS
Date: Wed, 19 Nov 2025 18:30:17 +0530	[thread overview]
Message-ID: <20251119130027.3312971-4-gaurav.sharma_7@nxp.com> (raw)
In-Reply-To: <20251119130027.3312971-1-gaurav.sharma_7@nxp.com>

SNVS contains an RTC which allows Linux to deal correctly with time

Signed-off-by: Gaurav Sharma <gaurav.sharma_7@nxp.com>
---
 docs/system/arm/imx8mm-evk.rst |  1 +
 hw/arm/fsl-imx8mm.c            | 10 ++++++++++
 include/hw/arm/fsl-imx8mm.h    |  2 ++
 3 files changed, 13 insertions(+)

diff --git a/docs/system/arm/imx8mm-evk.rst b/docs/system/arm/imx8mm-evk.rst
index 09aa63240a..231dae6624 100644
--- a/docs/system/arm/imx8mm-evk.rst
+++ b/docs/system/arm/imx8mm-evk.rst
@@ -12,6 +12,7 @@ The ``imx8mm-evk`` machine implements the following devices:
  * Up to 4 Cortex-A53 cores
  * Generic Interrupt Controller (GICv3)
  * 4 UARTs
+ * Secure Non-Volatile Storage (SNVS) including an RTC
  * Clock Tree
 
 Boot options
diff --git a/hw/arm/fsl-imx8mm.c b/hw/arm/fsl-imx8mm.c
index 5425dc8a53..4ca5dd0af1 100644
--- a/hw/arm/fsl-imx8mm.c
+++ b/hw/arm/fsl-imx8mm.c
@@ -170,6 +170,8 @@ static void fsl_imx8mm_init(Object *obj)
 
     object_initialize_child(obj, "analog", &s->analog, TYPE_IMX8MM_ANALOG);
 
+    object_initialize_child(obj, "snvs", &s->snvs, TYPE_IMX7_SNVS);
+
     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);
@@ -340,6 +342,13 @@ static void fsl_imx8mm_realize(DeviceState *dev, Error **errp)
                            qdev_get_gpio_in(gicdev, serial_table[i].irq));
     }
 
+    /* SNVS */
+    if (!sysbus_realize(SYS_BUS_DEVICE(&s->snvs), errp)) {
+        return;
+    }
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->snvs), 0,
+                    fsl_imx8mm_memmap[FSL_IMX8MM_SNVS_HP].addr);
+
     /* Unimplemented devices */
     for (i = 0; i < ARRAY_SIZE(fsl_imx8mm_memmap); i++) {
         switch (i) {
@@ -348,6 +357,7 @@ static void fsl_imx8mm_realize(DeviceState *dev, Error **errp)
         case FSL_IMX8MM_GIC_DIST:
         case FSL_IMX8MM_GIC_REDIST:
         case FSL_IMX8MM_RAM:
+        case FSL_IMX8MM_SNVS_HP:
         case FSL_IMX8MM_UART1 ... FSL_IMX8MM_UART4:
             /* device implemented and treated above */
             break;
diff --git a/include/hw/arm/fsl-imx8mm.h b/include/hw/arm/fsl-imx8mm.h
index 0716484429..4fd11798a5 100644
--- a/include/hw/arm/fsl-imx8mm.h
+++ b/include/hw/arm/fsl-imx8mm.h
@@ -12,6 +12,7 @@
 #include "cpu.h"
 #include "hw/char/imx_serial.h"
 #include "hw/intc/arm_gicv3_common.h"
+#include "hw/misc/imx7_snvs.h"
 #include "hw/misc/imx8mm_analog.h"
 #include "hw/misc/imx8mm_ccm.h"
 #include "qom/object.h"
@@ -36,6 +37,7 @@ struct FslImx8mmState {
     GICv3State         gic;
     IMX8MMCCMState     ccm;
     IMX8MMAnalogState  analog;
+    IMX7SNVSState      snvs;
     IMXSerialState     uart[FSL_IMX8MM_NUM_UARTS];
 };
 
-- 
2.34.1



  parent reply	other threads:[~2025-11-19 13:03 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-19 13:00 [PATCHv3 00/13] Adding comprehensive support for i.MX8MM EVK board Gaurav Sharma
2025-11-19 13:00 ` [PATCHv3 01/13] hw/arm: Add the i.MX 8MM EVK(Evaluation Kit) board Gaurav Sharma
2025-12-02  9:59   ` Peter Maydell
2025-12-02 10:33     ` [EXT] " Gaurav Sharma
2025-12-02 10:46       ` Peter Maydell
2025-12-02 11:09         ` Gaurav Sharma
2025-12-02 11:42   ` Bernhard Beschow
2025-12-02 15:10     ` [EXT] " Gaurav Sharma
2025-11-19 13:00 ` [PATCHv3 02/13] hw/arm/fsl-imx8mm: Implemented CCM(Clock Control Module) and Analog IP Gaurav Sharma
2025-12-01 20:52   ` Peter Maydell
2025-12-02  9:32     ` [EXT] " Gaurav Sharma
2025-12-02  9:47       ` Peter Maydell
2025-12-02  9:50         ` Gaurav Sharma
2025-11-19 13:00 ` Gaurav Sharma [this message]
2025-12-01 20:27   ` [PATCHv3 03/13] hw/arm/fsl-imx8mm: Implemented support for SNVS Peter Maydell
2025-11-19 13:00 ` [PATCHv3 04/13] hw/arm/fsl-imx8mm: Adding support for USDHC storage controllers Gaurav Sharma
2025-12-01 20:30   ` Peter Maydell
2025-11-19 13:00 ` [PATCHv3 05/13] hw/arm/fsl-imx8mm: Add PCIe support Gaurav Sharma
2025-12-01 20:28   ` Peter Maydell
2025-11-19 13:00 ` [PATCHv3 06/13] hw/arm/fsl-imx8mm: Add GPIO controllers Gaurav Sharma
2025-12-01 20:28   ` Peter Maydell
2025-11-19 13:00 ` [PATCHv3 07/13] hw/arm/fsl-imx8mm: Adding support for I2C emulation Gaurav Sharma
2025-12-01 20:29   ` Peter Maydell
2025-11-19 13:00 ` [PATCHv3 08/13] hw/arm/fsl-imx8mm: Adding support for SPI controller Gaurav Sharma
2025-12-01 20:30   ` Peter Maydell
2025-11-19 13:00 ` [PATCHv3 09/13] hw/arm/fsl-imx8mm: Adding support for Watchdog Timers Gaurav Sharma
2025-12-01 20:31   ` Peter Maydell
2025-12-02  5:27     ` [EXT] " Gaurav Sharma
2025-11-19 13:00 ` [PATCHv3 10/13] hw/arm/fsl-imx8mm: Adding support for General Purpose Timers Gaurav Sharma
2025-12-01 20:33   ` Peter Maydell
2025-11-19 13:00 ` [PATCHv3 11/13] hw/arm/fsl-imx8mm: Adding support for ENET ethernet controller Gaurav Sharma
2025-12-01 20:33   ` Peter Maydell
2025-11-19 13:00 ` [PATCHv3 12/13] hw/arm/fsl-imx8mm: Adding support for USB controller Gaurav Sharma
2025-12-01 20:34   ` Peter Maydell
2025-11-19 13:00 ` [PATCHv3 13/13] hw/arm/fsl-imx8mm: Adding functional testing of iMX8MM emulation Gaurav Sharma
2025-11-25  5:22 ` [PATCHv3 00/13] Adding comprehensive support for i.MX8MM EVK board Gaurav Sharma
2025-12-01 20:19   ` Peter Maydell
2025-12-02  5:19     ` [EXT] " Gaurav Sharma
2025-12-02  9:43       ` Peter Maydell
2025-12-02  9:46         ` Gaurav Sharma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251119130027.3312971-4-gaurav.sharma_7@nxp.com \
    --to=gaurav.sharma_7@nxp.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).