This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 6f859b56c7d0c72f242b6f11dcbf4874bd95a60d
Author: Maarten Zanders <[email protected]>
AuthorDate: Mon Feb 23 21:27:34 2026 +0100

    arch/arm/imx9: clockconfig: preparatory cleanup for i.MX93 support.
    
    - Guard imx9_gpc.h inclusion with CONFIG_IMX9_WFI_AWAKES_AT_SYSTICK
      to avoid a GPC dependency on chips that lack GPC
    - Add depends on ARCH_CHIP_IMX95_M7 to IMX9_WFI_AWAKES_AT_SYSTICK
      since GPC wake configuration is i.MX95-specific
    - Move XTAL_FREQ and ROOT_CLOCK_OFFSET defines to imx95_clock.h
    - Make imx9_sm_setrootclock() and imx9_sm_getipfreq() static;
      they are not referenced outside this translation unit
    
    Signed-off-by: Maarten Zanders <[email protected]>
---
 arch/arm/src/imx9/Kconfig                      |  1 +
 arch/arm/src/imx9/hardware/imx95/imx95_clock.h |  3 +++
 arch/arm/src/imx9/imx9_clockconfig.c           | 14 ++++++--------
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/arch/arm/src/imx9/Kconfig b/arch/arm/src/imx9/Kconfig
index 0fe2d362e41..e46d311e34e 100644
--- a/arch/arm/src/imx9/Kconfig
+++ b/arch/arm/src/imx9/Kconfig
@@ -49,6 +49,7 @@ endif
 config IMX9_WFI_AWAKES_AT_SYSTICK
        bool "WFI awakes at systick interrupts"
        default y
+       depends on ARCH_CHIP_IMX95_M7
        ---help---
        Configure the GPC to wake up from systick interrupts at WFI
        instruction
diff --git a/arch/arm/src/imx9/hardware/imx95/imx95_clock.h 
b/arch/arm/src/imx9/hardware/imx95/imx95_clock.h
index 2d55f26d4a4..71e400c3bd7 100644
--- a/arch/arm/src/imx9/hardware/imx95/imx95_clock.h
+++ b/arch/arm/src/imx9/hardware/imx95/imx95_clock.h
@@ -37,6 +37,9 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
+#define XTAL_FREQ 24000000u
+#define ROOT_CLOCK_OFFSET 41
+
 typedef enum
 {
     EXT_CLK  = 0,
diff --git a/arch/arm/src/imx9/imx9_clockconfig.c 
b/arch/arm/src/imx9/imx9_clockconfig.c
index b0a06ea03e5..54a430c4771 100644
--- a/arch/arm/src/imx9/imx9_clockconfig.c
+++ b/arch/arm/src/imx9/imx9_clockconfig.c
@@ -37,7 +37,11 @@
 #include <arch/barriers.h>
 
 #include "arm_internal.h"
+
+#ifdef CONFIG_IMX9_WFI_AWAKES_AT_SYSTICK
 #include "hardware/imx9_gpc.h"
+#endif
+
 #include "imx9_clockconfig.h"
 #include "imx9_scmi.h"
 
@@ -45,12 +49,6 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-/* The base oscillator frequency is 24MHz */
-
-#define XTAL_FREQ 24000000u
-
-#define ROOT_CLOCK_OFFSET 41
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
@@ -87,7 +85,7 @@ void imx9_clockconfig(void)
 }
 
 #ifdef CONFIG_IMX9_CLK_OVER_SCMI
-int imx9_sm_setrootclock(sm_clock_t *sm_clk)
+static int imx9_sm_setrootclock(sm_clock_t *sm_clk)
 {
   scmi_clock_rate_t rate = /* clang-format off */
     {
@@ -156,7 +154,7 @@ int imx9_sm_setrootclock(sm_clock_t *sm_clk)
   return OK;
 }
 
-int imx9_sm_getipfreq(sm_clock_t *sm_clk)
+static int imx9_sm_getipfreq(sm_clock_t *sm_clk)
 {
   scmi_clock_rate_t rate = /* clang-format off */
     {

Reply via email to