PDK-7618: Board: Created different init/deinit clock groups for j7 boards
authorM V Pratap Reddy <x0257344@ti.com>
Fri, 16 Oct 2020 13:25:46 +0000 (18:55 +0530)
committerSujith Shivalingappa <sujith.s@ti.com>
Thu, 29 Oct 2020 08:56:42 +0000 (03:56 -0500)
 - Board library for j721e and j7200 evm is updated to provide the flexibility of
   choosing clock modules which will be enabled/disabled during the boot process.
   Two different clock groups are created to choose between RTOS normal boot flow
   and RTOS+HLOS boot flow.
   Clock resources which are used during RTOS boot can be released using
   Board_releaseResource function before switching to HLOS.

packages/ti/board/board.h
packages/ti/board/src/j7200_evm/board_clock.c
packages/ti/board/src/j7200_evm/board_init.c
packages/ti/board/src/j7200_evm/include/board_utils.h
packages/ti/board/src/j721e_evm/board_clock.c
packages/ti/board/src/j721e_evm/board_init.c
packages/ti/board/src/j721e_evm/include/board_utils.h
packages/ti/boot/sbl/board/k3/sbl_main.c
packages/ti/boot/sbl/soc/k3/sbl_slave_core_boot.c

index 510092063f45939b9eb72df679ec86a01e6f3d2d..b0abb86eea3af28945dd637d9070b30d292b74eb 100755 (executable)
@@ -372,6 +372,13 @@ typedef uint32_t Board_initCfg;
 #define BOARD_DEINIT_UART_STDIO         (1 << 3U)
 #define BOARD_DEINIT_DEFAULT            BOARD_DEINIT_ALL
 
+#define BOARD_RESOURCE_ALL              (0xFFFFU)
+#define BOARD_RESOURCE_MMR              (1U)
+#define BOARD_RESOURCE_MODULE_CLOCK     (2U)
+#define BOARD_RESOURCE_UART_STDIO       (3U)
+#define BOARD_RESOURCE_SCICLIENT        (4U)
+
+
 typedef void (*Board_thermalMgmtCallbackFunction_t)(Board_DDRTempEventType DDRTempEventType);
 
 /* @} */
@@ -458,6 +465,15 @@ Board_STATUS Board_init(Board_initCfg cfg);
  */
 Board_STATUS Board_deinit(Board_initCfg cfg);
 
+/**
+ * \brief  Board library function to release the resources
+ *
+ * \param   resourceID [IN]    Resource ID
+ *
+ * \return  BOARD_SOK in case of success or appropriate error code
+ */
+Board_STATUS Board_releaseResource (uint32_t resourceID);
+
 /**
  *  @brief      Initialize Board DDR Temperature monitoring.
  *
index 3956975196a3b17e35640f093930c9d43f304760..9030a9a1eb0baf712b78e95da0f2f64d0bb472d1 100755 (executable)
 
 extern Board_initParams_t gBoardInitParams;
 
-uint32_t gBoardClkModuleMcuID[] = {
-    TISCI_DEV_MCU_ADC0,
-    TISCI_DEV_MCU_CPSW0,
+uint32_t gBoardClkModuleMcuIDInitGroupl[] = {
     TISCI_DEV_MCU_TIMER0,
     TISCI_DEV_MCU_FSS0_HYPERBUS1P0_0,
     TISCI_DEV_MCU_FSS0_OSPI_0,
+    TISCI_DEV_MCU_UART0,
+    TISCI_DEV_WKUP_I2C0,
+    TISCI_DEV_WKUP_UART0,
+};
+
+uint32_t gBoardClkModuleMcuIDInitGroup2[] = {
+    TISCI_DEV_MCU_ADC0,
+    TISCI_DEV_MCU_CPSW0,
     TISCI_DEV_WKUP_GPIO0,
     TISCI_DEV_WKUP_GPIO1,
     TISCI_DEV_WKUP_GPIOMUX_INTRTR0,
-    TISCI_DEV_MCU_UART0,
     TISCI_DEV_MCU_MCAN0,
     TISCI_DEV_MCU_MCAN1,
     TISCI_DEV_MCU_I2C0,
     TISCI_DEV_MCU_I2C1,
-    TISCI_DEV_WKUP_I2C0,
     TISCI_DEV_MCU_SA2_UL0,
-    TISCI_DEV_WKUP_UART0,  //Note: Keep the wakeup UART at end to skip it during clock deinit
 };
 
-uint32_t gBoardClkModuleMainIDGroup1[] = {
+uint32_t gBoardClkModuleMcuIDDeinitGroupl[] = {
+    TISCI_DEV_MCU_FSS0_OSPI_0,
+    TISCI_DEV_WKUP_I2C0,
+};
+
+uint32_t gBoardClkModuleMainIDInitGroup1[] = {
     TISCI_DEV_DDR0,
     TISCI_DEV_EMIF_DATA_0_VD,
     TISCI_DEV_MMCSD0,
@@ -73,6 +81,12 @@ uint32_t gBoardClkModuleMainIDGroup1[] = {
     TISCI_DEV_GTC0,
 };
 
+uint32_t gBoardClkModuleMainIDDeinitGroup1[] = {
+    TISCI_DEV_MMCSD0,
+    TISCI_DEV_MMCSD1,
+    TISCI_DEV_GTC0,
+};
+
 uint32_t gBoardClkModuleMainIDGroup2[] = {
     TISCI_DEV_TIMER0,
     TISCI_DEV_TIMER1,
@@ -304,8 +318,27 @@ Board_STATUS Board_moduleClockInitMcu(void)
     /* Restoring MCU DMtimer0 FCLK to HFOSC0 (changed by ROM) */
     HW_WR_REG32((CSL_MCU_CTRL_MMR0_CFG0_BASE + CSL_MCU_CTRL_MMR_CFG0_MCU_TIMER0_CLKSEL), 0);
 
-    size = sizeof(gBoardClkModuleMcuID) / sizeof(uint32_t);
-    status = Board_moduleClockInit(gBoardClkModuleMcuID, size);
+    if((gBoardInitParams.mcuClkGrp == BOARD_MCU_CLOCK_GROUP_ALL) ||
+       (gBoardInitParams.mcuClkGrp == BOARD_MCU_CLOCK_GROUP1))
+    {
+        size = sizeof(gBoardClkModuleMcuIDInitGroupl) / sizeof(uint32_t);
+        status = Board_moduleClockInit(gBoardClkModuleMcuIDInitGroupl, size);
+        if(status != BOARD_SOK)
+        {
+            return status;
+        }
+    }
+
+    if((gBoardInitParams.mcuClkGrp == BOARD_MCU_CLOCK_GROUP_ALL) ||
+       (gBoardInitParams.mcuClkGrp == BOARD_MCU_CLOCK_GROUP2))
+    {
+        size = sizeof(gBoardClkModuleMcuIDInitGroup2) / sizeof(uint32_t);
+        status = Board_moduleClockInit(gBoardClkModuleMcuIDInitGroup2, size);
+        if(status != BOARD_SOK)
+        {
+            return status;
+        }
+    }
 
 #if defined(BUILD_MCU)
     if(status == BOARD_SOK)
@@ -364,8 +397,8 @@ Board_STATUS Board_moduleClockInitMain(void)
     if((gBoardInitParams.mainClkGrp == BOARD_MAIN_CLOCK_GROUP_ALL) ||
        (gBoardInitParams.mainClkGrp == BOARD_MAIN_CLOCK_GROUP1))
     {
-        size = sizeof(gBoardClkModuleMainIDGroup1) / sizeof(uint32_t);
-        status = Board_moduleClockInit(gBoardClkModuleMainIDGroup1, size);
+        size = sizeof(gBoardClkModuleMainIDInitGroup1) / sizeof(uint32_t);
+        status = Board_moduleClockInit(gBoardClkModuleMainIDInitGroup1, size);
         if(status != BOARD_SOK)
         {
             return status;
@@ -396,9 +429,27 @@ Board_STATUS Board_moduleClockDeinitMcu(void)
        Board_STATUS  status = BOARD_SOK;
     uint32_t size;
 
-    size = sizeof(gBoardClkModuleMcuID) / sizeof(uint32_t);
-    /* (size - 1) to avoid wakeup UART disable which is used by DMSC */
-    Board_moduleClockDeinit(gBoardClkModuleMcuID, (size - 1));
+    if((gBoardInitParams.mcuClkGrp == BOARD_MCU_CLOCK_GROUP_ALL) ||
+       (gBoardInitParams.mcuClkGrp == BOARD_MCU_CLOCK_GROUP1))
+    {
+        size = sizeof(gBoardClkModuleMcuIDDeinitGroupl) / sizeof(uint32_t);
+        status = Board_moduleClockDeinit(gBoardClkModuleMcuIDDeinitGroupl, size);
+        if(status != BOARD_SOK)
+        {
+            return status;
+        }
+    }
+
+    if((gBoardInitParams.mcuClkGrp == BOARD_MCU_CLOCK_GROUP_ALL) ||
+       (gBoardInitParams.mcuClkGrp == BOARD_MCU_CLOCK_GROUP2))
+    {
+        size = sizeof(gBoardClkModuleMcuIDInitGroup2) / sizeof(uint32_t);
+        status = Board_moduleClockDeinit(gBoardClkModuleMcuIDInitGroup2, size);
+        if(status != BOARD_SOK)
+        {
+            return status;
+        }
+    }
 
     return status;
 }
@@ -420,8 +471,8 @@ Board_STATUS Board_moduleClockDeinitMain(void)
     if((gBoardInitParams.mainClkGrp == BOARD_MAIN_CLOCK_GROUP_ALL) ||
        (gBoardInitParams.mainClkGrp == BOARD_MAIN_CLOCK_GROUP1))
     {
-        size = sizeof(gBoardClkModuleMainIDGroup1) / sizeof(uint32_t);
-        status = Board_moduleClockDeinit(gBoardClkModuleMainIDGroup1, size);
+        size = sizeof(gBoardClkModuleMainIDDeinitGroup1) / sizeof(uint32_t);
+        status = Board_moduleClockDeinit(gBoardClkModuleMainIDDeinitGroup1, size);
         if(status != BOARD_SOK)
         {
             return status;
index 534175f614677ef8504e49f11f4b51ccf0cfb55e..907f43b53f6d24db91f8a7706b6d8d81b86e3db6 100644 (file)
@@ -313,8 +313,6 @@ Board_STATUS Board_deinit(Board_initCfg cfg)
 {
     Board_STATUS ret = BOARD_SOK;
 
-    Board_sysDeinit();
-
     if (cfg & BOARD_DEINIT_UART_STDIO)
         ret = Board_uartDeInit();
     if (ret != BOARD_SOK)
@@ -335,5 +333,68 @@ Board_STATUS Board_deinit(Board_initCfg cfg)
     if (ret != BOARD_SOK)
         return ret;
 
+    Board_sysDeinit();
+
+    return ret;
+}
+
+/**
+ * \brief  Board library function to release the resources
+ *
+ *  resourceID selects the resource to be released as per below IDs.
+ *  Only one resource sould be released in one function call.
+ *
+ *  BOARD_RESOURCE_MMR -
+ *      Locks the MMR registers of the SoC.
+ *
+ *  BOARD_RESOURCE_UART_STDIO -
+ *      Closes the board UART instance configured for serial console logs
+ *
+ *  BOARD_RESOURCE_MODULE_CLOCK -
+ *      Releases the PSC clocks for all the modules listed by the clock groups
+ *
+ *  BOARD_RESOURCE_ALL -
+ *      Releases All the resources held by board library
+ *
+ * \param   resourceID [IN]    Resource ID
+ *
+ * \return  BOARD_SOK in case of success or appropriate error code
+ */
+Board_STATUS Board_releaseResource (uint32_t resourceID)
+{
+    Board_STATUS ret = BOARD_SOK;
+
+    switch(resourceID)
+    {
+        case BOARD_RESOURCE_UART_STDIO:
+            ret = Board_uartDeInit();
+            break;
+
+        case BOARD_RESOURCE_MODULE_CLOCK:
+            ret = Board_moduleClockDeinitMcu();
+            ret |= Board_moduleClockDeinitMain();
+            break;
+
+        case BOARD_RESOURCE_MMR:
+            ret = Board_lockMMR();
+            break;
+
+        case BOARD_RESOURCE_SCICLIENT:
+            ret = Board_sysDeinit();
+            break;
+
+        case BOARD_RESOURCE_ALL:
+            ret  = Board_uartDeInit();
+            ret |= Board_moduleClockDeinitMcu();
+            ret |= Board_moduleClockDeinitMain();
+            ret |= Board_lockMMR();
+            ret |= Board_sysDeinit();
+            break;
+
+        default:
+            ret = BOARD_INVALID_PARAM;
+            break;
+    }
+
     return ret;
 }
index def56ade4d32c694491d31193a02f130b02c633b..7dcaebd3eae542b15d8959473ee49b132cb171f7 100755 (executable)
@@ -109,7 +109,6 @@ typedef struct Board_initParams_s
         BOARD_MCU_CLOCK_GROUP_ALL - Enable clock for all groups in mcu domain
         BOARD_MCU_CLOCK_GROUP1 - Enable clock for all group1 in mcu domain
         BOARD_MCU_CLOCK_GROUP2 - Enable clock for all group2 in mcu domain */
-    /** Note: This parameter is currently not in use. Place holder for future use */
     uint8_t mcuClkGrp;
 } Board_initParams_t;
 
index 03979c9a67dcd14a128067d60a437ba4bdca5b70..a78e58ba08215b15a85f6c0309a2a034e5df16c3 100755 (executable)
 
 extern Board_initParams_t gBoardInitParams;
 
-uint32_t gBoardClkModuleMcuID[] = {
-    TISCI_DEV_MCU_ADC12_16FFC0,
-    TISCI_DEV_MCU_ADC12_16FFC1,
-    TISCI_DEV_MCU_CPSW0,
+uint32_t gBoardClkModuleMcuIDInitGroupl[] = {
     TISCI_DEV_MCU_TIMER0,
     TISCI_DEV_MCU_FSS0_HYPERBUS1P0_0,
     TISCI_DEV_MCU_FSS0_OSPI_0,
     TISCI_DEV_MCU_FSS0_OSPI_1,
+    TISCI_DEV_MCU_UART0,
+    TISCI_DEV_WKUP_I2C0,
+    TISCI_DEV_WKUP_UART0,
+};
+
+uint32_t gBoardClkModuleMcuIDInitGroup2[] = {
+    TISCI_DEV_MCU_ADC12_16FFC0,
+    TISCI_DEV_MCU_ADC12_16FFC1,
+    TISCI_DEV_MCU_CPSW0,
     TISCI_DEV_WKUP_GPIO0,
     TISCI_DEV_WKUP_GPIO1,
     TISCI_DEV_WKUP_GPIOMUX_INTRTR0,
-    TISCI_DEV_MCU_UART0,
     TISCI_DEV_MCU_MCAN0,
     TISCI_DEV_MCU_MCAN1,
     TISCI_DEV_MCU_I2C0,
     TISCI_DEV_MCU_I2C1,
-    TISCI_DEV_WKUP_I2C0,
     TISCI_DEV_MCU_SA2_UL0,
     TISCI_DEV_WKUPMCU2MAIN_VD,
     TISCI_DEV_MAIN2WKUPMCU_VD,
-    TISCI_DEV_WKUP_UART0,  //Note: Keep the wakeup UART at end to skip it during clock deinit
+};
+
+uint32_t gBoardClkModuleMcuIDDeinitGroupl[] = {
+    TISCI_DEV_MCU_FSS0_HYPERBUS1P0_0,
+    TISCI_DEV_MCU_FSS0_OSPI_0,
+    TISCI_DEV_MCU_FSS0_OSPI_1,
+    TISCI_DEV_WKUP_I2C0,
 };
 
 uint32_t gBoardClkModuleMainIDGroup1[] = {
@@ -78,6 +88,12 @@ uint32_t gBoardClkModuleMainIDGroup1[] = {
     TISCI_DEV_GTC0,
 };
 
+uint32_t gBoardClkModuleMainIDDeinitGroup1[] = {
+    TISCI_DEV_MMCSD0,
+    TISCI_DEV_MMCSD1,
+    TISCI_DEV_GTC0,
+};
+
 uint32_t gBoardClkModuleMainIDGroup2[] = {
     TISCI_DEV_TIMER0,
     TISCI_DEV_TIMER1,
@@ -333,8 +349,27 @@ Board_STATUS Board_moduleClockInitMcu(void)
     /* Restoring MCU DMtimer0 FCLK to HFOSC0 (changed by ROM) */
     HW_WR_REG32((CSL_MCU_CTRL_MMR0_CFG0_BASE + CSL_MCU_CTRL_MMR_CFG0_MCU_TIMER0_CLKSEL), 0);
 
-    size = sizeof(gBoardClkModuleMcuID) / sizeof(uint32_t);
-    status = Board_moduleClockInit(gBoardClkModuleMcuID, size);
+    if((gBoardInitParams.mcuClkGrp == BOARD_MCU_CLOCK_GROUP_ALL) ||
+       (gBoardInitParams.mcuClkGrp == BOARD_MCU_CLOCK_GROUP1))
+    {
+        size = sizeof(gBoardClkModuleMcuIDInitGroupl) / sizeof(uint32_t);
+        status = Board_moduleClockInit(gBoardClkModuleMcuIDInitGroupl, size);
+        if(status != BOARD_SOK)
+        {
+            return status;
+        }
+    }
+
+    if((gBoardInitParams.mcuClkGrp == BOARD_MCU_CLOCK_GROUP_ALL) ||
+       (gBoardInitParams.mcuClkGrp == BOARD_MCU_CLOCK_GROUP2))
+    {
+        size = sizeof(gBoardClkModuleMcuIDInitGroup2) / sizeof(uint32_t);
+        status = Board_moduleClockInit(gBoardClkModuleMcuIDInitGroup2, size);
+        if(status != BOARD_SOK)
+        {
+            return status;
+        }
+    }
 
 #if defined(BUILD_MCU)
     if(status == BOARD_SOK)
@@ -425,9 +460,27 @@ Board_STATUS Board_moduleClockDeinitMcu(void)
        Board_STATUS  status = BOARD_SOK;
     uint32_t size;
 
-    size = sizeof(gBoardClkModuleMcuID) / sizeof(uint32_t);
-    /* (size - 1) to avoid wakeup UART disable which is used by DMSC */
-    Board_moduleClockDeinit(gBoardClkModuleMcuID, (size - 1));
+    if((gBoardInitParams.mcuClkGrp == BOARD_MCU_CLOCK_GROUP_ALL) ||
+       (gBoardInitParams.mcuClkGrp == BOARD_MCU_CLOCK_GROUP1))
+    {
+        size = sizeof(gBoardClkModuleMcuIDDeinitGroupl) / sizeof(uint32_t);
+        status = Board_moduleClockDeinit(gBoardClkModuleMcuIDDeinitGroupl, size);
+        if(status != BOARD_SOK)
+        {
+            return status;
+        }
+    }
+
+    if((gBoardInitParams.mcuClkGrp == BOARD_MCU_CLOCK_GROUP_ALL) ||
+       (gBoardInitParams.mcuClkGrp == BOARD_MCU_CLOCK_GROUP2))
+    {
+        size = sizeof(gBoardClkModuleMcuIDInitGroup2) / sizeof(uint32_t);
+        status = Board_moduleClockDeinit(gBoardClkModuleMcuIDInitGroup2, size);
+        if(status != BOARD_SOK)
+        {
+            return status;
+        }
+    }
 
     return status;
 }
@@ -449,8 +502,8 @@ Board_STATUS Board_moduleClockDeinitMain(void)
     if((gBoardInitParams.mainClkGrp == BOARD_MAIN_CLOCK_GROUP_ALL) ||
        (gBoardInitParams.mainClkGrp == BOARD_MAIN_CLOCK_GROUP1))
     {
-        size = sizeof(gBoardClkModuleMainIDGroup1) / sizeof(uint32_t);
-        status = Board_moduleClockDeinit(gBoardClkModuleMainIDGroup1, size);
+        size = sizeof(gBoardClkModuleMainIDDeinitGroup1) / sizeof(uint32_t);
+        status = Board_moduleClockDeinit(gBoardClkModuleMainIDDeinitGroup1, size);
         if(status != BOARD_SOK)
         {
             return status;
index a713cc7f8e5bfd149b4c092b6393f3d6076c7f8b..523d6014e9695a52395debbfa30ee8ec8529f421 100755 (executable)
@@ -360,3 +360,64 @@ Board_STATUS Board_deinit(Board_initCfg cfg)
 
     return ret;
 }
+
+/**
+ * \brief  Board library function to release the resources
+ *
+ *  resourceID selects the resource to be released as per below IDs.
+ *  Only one resource sould be released in one function call.
+ *
+ *  BOARD_RESOURCE_MMR -
+ *      Locks the MMR registers of the SoC.
+ *
+ *  BOARD_RESOURCE_UART_STDIO -
+ *      Closes the board UART instance configured for serial console logs
+ *
+ *  BOARD_RESOURCE_MODULE_CLOCK -
+ *      Releases the PSC clocks for all the modules listed by the clock groups
+ *
+ *  BOARD_RESOURCE_ALL -
+ *      Releases All the resources held by board library
+ *
+ * \param   resourceID [IN]    Resource ID
+ *
+ * \return  BOARD_SOK in case of success or appropriate error code
+ */
+Board_STATUS Board_releaseResource (uint32_t resourceID)
+{
+    Board_STATUS ret = BOARD_SOK;
+
+    switch(resourceID)
+    {
+        case BOARD_RESOURCE_UART_STDIO:
+            ret = Board_uartDeInit();
+            break;
+
+        case BOARD_RESOURCE_MODULE_CLOCK:
+            ret = Board_moduleClockDeinitMcu();
+            ret |= Board_moduleClockDeinitMain();
+            break;
+
+        case BOARD_RESOURCE_MMR:
+            ret = Board_lockMMR();
+            break;
+
+        case BOARD_RESOURCE_SCICLIENT:
+            ret = Board_sysDeinit();
+            break;
+
+        case BOARD_RESOURCE_ALL:
+            ret  = Board_uartDeInit();
+            ret |= Board_moduleClockDeinitMcu();
+            ret |= Board_moduleClockDeinitMain();
+            ret |= Board_lockMMR();
+            ret |= Board_sysDeinit();
+            break;
+
+        default:
+            ret = BOARD_INVALID_PARAM;
+            break;
+    }
+
+    return ret;
+}
index c57b76f9e10d6b4e029764fd7dbb80be3aae2b07..f45fa18b344eff62b7f1b60d18cada8990724a76 100755 (executable)
@@ -110,7 +110,6 @@ typedef struct Board_initParams_s
         BOARD_MCU_CLOCK_GROUP_ALL - Enable clock for all groups in mcu domain
         BOARD_MCU_CLOCK_GROUP1 - Enable clock for all group1 in mcu domain
         BOARD_MCU_CLOCK_GROUP2 - Enable clock for all group2 in mcu domain */
-    /** Note: This parameter is currently not in use. Place holder for future use */
     uint8_t mcuClkGrp;
 } Board_initParams_t;
 
index 736ddab3d18bedfff1cff56a6993d5093d7c175a..c436622eada6deb3ed6f89d8aba886167fe1fe06 100644 (file)
@@ -496,6 +496,7 @@ int main()
     Board_initParams_t initParams;
     Board_getInitParams(&initParams);
     initParams.mainClkGrp = BOARD_MAIN_CLOCK_GROUP1;
+    initParams.mcuClkGrp  = BOARD_MCU_CLOCK_GROUP1;
     Board_setInitParams(&initParams);
 #endif
 #endif
@@ -536,6 +537,9 @@ int main()
         if (k3xx_evmEntry.CpuEntryPoint[core_id] != SBL_INVALID_ENTRY_ADDR)
             SBL_SlaveCoreBoot(core_id, NULL, &k3xx_evmEntry, SBL_REQUEST_CORE);
     }
+
+    Board_releaseResource(BOARD_RESOURCE_MODULE_CLOCK);
+
     /* Boot the HLOS on the Cortex-A cores towards the end */
     for (core_id = MPU1_CPU0_ID; core_id <= MPU1_CPU1_ID; core_id ++)
     {
index 6867a56a59cf0baec09f6a634e72a2ab7e8d80d8..4a6e8faa927269a9e138d7183fc39878ed824fc8 100644 (file)
@@ -402,9 +402,9 @@ int32_t SBL_BootImage(sblEntryPoint_t *pEntry)
     Sciclient_pmSetModuleState(TISCI_DEV_MMCSD0, TISCI_MSG_VALUE_DEVICE_SW_STATE_AUTO_OFF, TISCI_MSG_FLAG_AOP, SCICLIENT_SERVICE_WAIT_FOREVER);
     SBL_log(SBL_LOG_MAX, "Sciclient_pmSetModuleState Off, DevId: %d \n", TISCI_DEV_MMCSD1);
     Sciclient_pmSetModuleState(TISCI_DEV_MMCSD1, TISCI_MSG_VALUE_DEVICE_SW_STATE_AUTO_OFF, TISCI_MSG_FLAG_AOP, SCICLIENT_SERVICE_WAIT_FOREVER);
+#if defined(SOC_J721E)
     SBL_log(SBL_LOG_MAX, "Sciclient_pmSetModuleState Off, DevId: %d \n", TISCI_DEV_MCU_FSS0_OSPI_0);
     Sciclient_pmSetModuleState(TISCI_DEV_MCU_FSS0_OSPI_0, TISCI_MSG_VALUE_DEVICE_SW_STATE_AUTO_OFF, TISCI_MSG_FLAG_AOP, SCICLIENT_SERVICE_WAIT_FOREVER);
-#if defined(SOC_J721E)
     SBL_log(SBL_LOG_MAX, "Sciclient_pmSetModuleState Off, DevId: %d \n", TISCI_DEV_MCU_FSS0_OSPI_1);
     Sciclient_pmSetModuleState(TISCI_DEV_MCU_FSS0_OSPI_1, TISCI_MSG_VALUE_DEVICE_SW_STATE_AUTO_OFF, TISCI_MSG_FLAG_AOP, SCICLIENT_SERVICE_WAIT_FOREVER);
     SBL_log(SBL_LOG_MAX, "Sciclient_pmSetModuleState Off, DevId: %d \n", TISCI_DEV_MCU_FSS0_HYPERBUS1P0_0);