Skip to content

Commit 040370e

Browse files
jerome-pouillerjhedberg
authored andcommitted
wiseconnect: Drop orphan functions sl_si91x_trigger_sleep()
Wiseconnect has been original developed for FreeRTOS. sl_si91x_trigger_sleep() directly relies of FreeRTOS services. This function does not compile. However, it is never called and can be safely removed. Upstream-status: Pending Signed-off-by: Jérôme Pouiller <[email protected]>
1 parent 2505738 commit 040370e

File tree

1 file changed

+0
-151
lines changed

1 file changed

+0
-151
lines changed

wiseconnect/components/device/silabs/si91x/wireless/ahb_interface/src/sl_platform_wireless.c

Lines changed: 0 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -214,157 +214,6 @@ void sli_si91x_configure_wireless_frontend_controls(uint32_t switch_sel)
214214
#endif
215215
}
216216

217-
/**
218-
* @brief Configure the default hardware configuration required for 'WiSeMCU' mode.
219-
* @param[in] sleepType - Select the retention or non-retention mode of processor; refer to 'SLEEP_TYPE_T'.
220-
* \n SLEEP_WITH_RETENTION : When used, user must configure the RAMs to be retained during sleep by using the 'RSI_PS_SetRamRetention()' function.
221-
* @param[in] lf_clk_mode - This parameter is used to switch the processor clock from high frequency clock to low-frequency clock. This is used in some critical power save cases.
222-
* \n '0' : ' \ref DISABLE_LF_MODE' Normal mode of operation , recommended in most applications.
223-
* \n '1' : ' \ref LF_32_KHZ_RC' Processor clock is configured to low-frequency RC clock.
224-
* \n '2' : ' \ref LF_32_KHZ_XTAL' Processor clock is configured to low-frequency XTAL clock.
225-
* @param[in] stack_address - Stack pointer address to be used by bootloader.
226-
* @param[in] jump_cb_address - Control block memory address or function address to be branched up on Wake-up
227-
* @param[in] vector_offset - IVT offset to be programmed by boot-loader up on Wake-up.
228-
* @param[in] mode - Possible parameters as follows:
229-
* \n \ref RSI_WAKEUP_FROM_FLASH_MODE : Wakes from flash with retention. Upon wake up, control jumps to wake up handler in flash.
230-
* In this mode, ULPSS RAMs are used to store the stack pointer and Wake-up handler address.
231-
* \n \ref RSI_WAKEUP_WITH_OUT_RETENTION : Without retention sleep common for both FLASH/RAM based execution.
232-
* In this mode, ULPSS RAMs are used to store the stack pointer and control block address.
233-
* if stack_addr and jump_cb_addr are not valid, then 0x2404_0C00 and 0x2404_0000 are used
234-
* for stack and control block address respectively.
235-
* \n \ref RSI_WAKEUP_WITH_RETENTION : With retention branches to wake up handler in RAM.
236-
* In this mode, ULPSS RAMs are used to store the wake up handler address.
237-
* \n \ref RSI_WAKEUP_WITH_RETENTION_WO_ULPSS_RAM : In this mode, ULPSS RAMs are not used by boot-loader, instead it uses the NPSS battery flip flops.
238-
* \n \ref RSI_WAKEUP_WO_RETENTION_WO_ULPSS_RAM : In this mode, ULPSS RAMs are not used by boot-loader, instead it uses the NPSS battery flip flops to store
239-
* the stack and derives the control block address by adding 0XC00
240-
* to the stack address stored in battery flops.
241-
* @return Void
242-
*/
243-
244-
void sl_si91x_trigger_sleep(SLEEP_TYPE_T sleepType,
245-
uint8_t lf_clk_mode,
246-
uint32_t stack_address,
247-
uint32_t jump_cb_address,
248-
uint32_t vector_offset,
249-
uint32_t mode)
250-
{
251-
// Turn on the ULPSS RAM domains and retain ULPSS RAMs
252-
if ((mode != RSI_WAKEUP_WITH_RETENTION_WO_ULPSS_RAM) || (mode != RSI_WAKEUP_WO_RETENTION_WO_ULPSS_RAM)) {
253-
/* Turn on ULPSS SRAM domains*/
254-
RSI_PS_UlpssRamBanksPowerUp(ULPSS_2K_BANK_0 | ULPSS_2K_BANK_1 | ULPSS_2K_BANK_2 | ULPSS_2K_BANK_3);
255-
256-
/* Turn on ULPSS SRAM Core/Periphery domains*/
257-
RSI_PS_UlpssRamBanksPeriPowerUp(ULPSS_2K_BANK_0 | ULPSS_2K_BANK_1 | ULPSS_2K_BANK_2 | ULPSS_2K_BANK_3);
258-
259-
if ((mode == RSI_WAKEUP_FROM_FLASH_MODE) || (mode == RSI_WAKEUP_WITH_RETENTION)
260-
#if defined(SLI_SI917B0) || defined(SLI_SI915)
261-
|| (mode == SL_SI91X_MCU_WAKEUP_PSRAM_MODE)
262-
#endif // SLI_SI917B0
263-
) {
264-
/* Retain ULPSS RAM*/
265-
RSI_PS_SetRamRetention(ULPSS_RAM_RETENTION_MODE_EN);
266-
}
267-
}
268-
269-
// Peripherals needed on Wake-up (without RAM retention) needs to be powered up before going to sleep
270-
if ((mode == RSI_WAKEUP_WITH_OUT_RETENTION) || (mode == RSI_WAKEUP_WO_RETENTION_WO_ULPSS_RAM)) {
271-
272-
RSI_PS_M4ssPeriPowerUp(M4SS_PWRGATE_ULP_M4_DEBUG_FPU);
273-
}
274-
275-
#if (SL_SI91X_TICKLESS_MODE == 0)
276-
277-
if ((osEventFlagsGet(si91x_events) | osEventFlagsGet(si91x_async_events))
278-
#ifdef SL_SI91X_SIDE_BAND_CRYPTO
279-
|| (osMutexGetOwner(side_band_crypto_mutex) != NULL)
280-
#endif
281-
|| (sli_si91x_host_queue_status(&cmd_queues[SI91X_COMMON_CMD].tx_queue)
282-
| sli_si91x_host_queue_status(&cmd_queues[SLI_SI91X_WLAN_CMD].tx_queue)
283-
| sli_si91x_host_queue_status(&cmd_queues[SLI_SI91X_NETWORK_CMD].tx_queue)
284-
| sli_si91x_host_queue_status(&cmd_queues[SLI_SI91X_SOCKET_CMD].tx_queue)
285-
| sli_si91x_host_queue_status(&cmd_queues[SLI_SI91X_BT_CMD].tx_queue))) {
286-
return;
287-
}
288-
// Disabling the interrupts & clearing m4_is_active as m4 is going to sleep
289-
__disable_irq();
290-
291-
// Indicate M4 is Inactive
292-
P2P_STATUS_REG &= ~M4_is_active;
293-
P2P_STATUS_REG;
294-
// Adding delay to sync m4 with NWP
295-
for (volatile uint8_t delay = 0; delay < 10; delay++) {
296-
__ASM("NOP");
297-
}
298-
299-
// Checking if already NWP have triggered the packet to M4
300-
// RX_BUFFER_VALID will be cleared by NWP if any packet is triggered
301-
if ((P2P_STATUS_REG & TA_wakeup_M4) || (P2P_STATUS_REG & M4_wakeup_TA)
302-
|| (!(M4SS_P2P_INTR_SET_REG & RX_BUFFER_VALID))) {
303-
P2P_STATUS_REG |= M4_is_active;
304-
__enable_irq();
305-
return;
306-
}
307-
308-
//Disbling systick & clearing interrupt as systick is non-maskable interrupt
309-
SysTick->CTRL = DISABLE;
310-
NVIC_ClearPendingIRQ(SysTick_IRQn);
311-
312-
//!Clear RX_BUFFER_VALID
313-
M4SS_P2P_INTR_CLR_REG = RX_BUFFER_VALID;
314-
M4SS_P2P_INTR_CLR_REG;
315-
#endif // SL_SI91X_TICKLESS_MODE == 0
316-
317-
#ifndef ENABLE_DEBUG_MODULE
318-
RSI_PS_M4ssPeriPowerDown(M4SS_PWRGATE_ULP_M4_DEBUG_FPU);
319-
#endif // ENABLE_DEBUG_MODULE
320-
321-
/* Define 'SLI_SI91X_MCU_ENABLE_FLASH_BASED_EXECUTION' macro if FLASH execution is needed*/
322-
#ifndef SLI_SI91X_MCU_ENABLE_FLASH_BASED_EXECUTION
323-
RSI_PS_M4ssPeriPowerDown(M4SS_PWRGATE_ULP_QSPI_ICACHE);
324-
// Remove this if MCU is executing from Flash
325-
#endif //SLI_SI91X_MCU_ENABLE_FLASH_BASED_EXECUTION
326-
327-
// Move M4 SOC clock to ULP reference clock before going to PowerSave
328-
if (RSI_CLK_M4SocClkConfig(M4CLK, M4_ULPREFCLK, 0) != RSI_OK) {
329-
printf("RSI_CLK_M4SocClkConfig failed\n");
330-
}
331-
332-
/* Check whether M4 is using XTAL */
333-
if (sli_si91x_is_xtal_in_use_by_m4() == true) {
334-
/* If M4 is using XTAL then request NWP to turn OFF XTAL as M4 is going to sleep */
335-
sli_si91x_raise_xtal_interrupt_to_ta(TURN_OFF_XTAL_REQUEST);
336-
}
337-
338-
// Configure sleep parameters required by bootloader upon Wake-up
339-
RSI_PS_RetentionSleepConfig(stack_address, jump_cb_address, vector_offset, mode);
340-
341-
// Trigger M4 to sleep
342-
RSI_PS_EnterDeepSleep(sleepType, lf_clk_mode);
343-
344-
/* Check whether M4 is using XTAL */
345-
if (sli_si91x_is_xtal_in_use_by_m4() == true) {
346-
/* If M4 is using XTAL then request NWP to turn ON XTAL as M4 is going to sleep */
347-
sli_si91x_raise_xtal_interrupt_to_ta(TURN_ON_XTAL_REQUEST);
348-
}
349-
350-
#if defined(SLI_SI917) || defined(SLI_SI915)
351-
// Upon wake up program wireless GPIO frontend switch controls
352-
if (frontend_switch_control != 0) {
353-
sli_si91x_configure_wireless_frontend_controls(frontend_switch_control);
354-
}
355-
#endif
356-
357-
#if (SL_SI91X_TICKLESS_MODE == 0)
358-
//!Indicate M4 is active and rx buffer valid
359-
P2P_STATUS_REG |= M4_is_active;
360-
M4SS_P2P_INTR_SET_REG = RX_BUFFER_VALID;
361-
__enable_irq();
362-
363-
// Systick configuration upon Wake-up
364-
SysTick_Config(SystemCoreClock / SL_OS_SYSTEM_TICK_RATE);
365-
#endif // SL_SI91X_TICKLESS_MODE == 0
366-
}
367-
368217
/**
369218
* @brief Configure the default hardware configuration required for 'WiSeMCU' mode.
370219
* @param[in] rams_in_use - RAMs to be powered functionally (the rest of the RAM banks will be power gates)

0 commit comments

Comments
 (0)