2024-02-05 14:26:30 +08:00
|
|
|
if(BOOTLOADER_BUILD)
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(srcs)
|
|
|
|
|
2024-04-19 12:12:53 +08:00
|
|
|
if(CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP OR
|
|
|
|
(CONFIG_SOC_CPU_IN_TOP_DOMAIN AND CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP))
|
2024-04-16 17:21:49 +08:00
|
|
|
list(APPEND srcs "port/${target}/sleep_cpu.c")
|
2024-02-05 14:26:30 +08:00
|
|
|
if(CONFIG_SOC_PM_CPU_RETENTION_BY_SW)
|
2024-04-16 17:21:49 +08:00
|
|
|
list(APPEND srcs "port/${target}/sleep_cpu_asm.S")
|
2024-02-05 14:26:30 +08:00
|
|
|
set_property(TARGET ${COMPONENT_LIB}
|
|
|
|
APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u rv_core_critical_regs_save")
|
|
|
|
set_property(TARGET ${COMPONENT_LIB}
|
|
|
|
APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u rv_core_critical_regs_restore")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2024-07-17 20:29:12 +08:00
|
|
|
if(CONFIG_SOC_PM_MMU_TABLE_RETENTION_WHEN_TOP_PD AND CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP)
|
2024-04-16 17:21:49 +08:00
|
|
|
list(APPEND srcs "port/${target}/sleep_mmu.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if((CONFIG_SOC_PM_SUPPORT_MODEM_PD OR CONFIG_SOC_PM_SUPPORT_TOP_PD) AND CONFIG_SOC_PAU_SUPPORTED)
|
|
|
|
list(APPEND srcs "port/${target}/sleep_clock.c")
|
2024-07-17 20:29:12 +08:00
|
|
|
endif()
|
|
|
|
|
2024-09-03 20:35:29 +08:00
|
|
|
if(CONFIG_SOC_PM_SUPPORT_PMU_MODEM_STATE)
|
|
|
|
list(APPEND srcs "port/${target}/sleep_modem_state.c")
|
|
|
|
endif()
|
|
|
|
|
2024-02-05 14:26:30 +08:00
|
|
|
add_prefix(srcs "${CMAKE_CURRENT_LIST_DIR}/" "${srcs}")
|
|
|
|
|
|
|
|
target_sources(${COMPONENT_LIB} PRIVATE "${srcs}")
|