chickens: set WFI mode to clockgate only

This preserves CPU registers.

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2021-02-05 01:08:35 +09:00
parent 64e6595f64
commit aaab2c6ca1
2 changed files with 5 additions and 3 deletions

View file

@ -129,9 +129,9 @@ const char *init_cpu(void)
break;
}
/* Unmask external IRQs */
reg_mask(SYS_CYC_OVRD, CYC_OVRD_FIQ_MODE_MASK | CYC_OVRD_IRQ_MODE_MASK,
CYC_OVRD_FIQ_MODE(0) | CYC_OVRD_IRQ_MODE(0));
/* Unmask external IRQs, set WFI mode to up (2) */
reg_mask(SYS_CYC_OVRD, CYC_OVRD_FIQ_MODE_MASK | CYC_OVRD_IRQ_MODE_MASK | CYC_OVRD_WFI_MODE_MASK,
CYC_OVRD_FIQ_MODE(0) | CYC_OVRD_IRQ_MODE(0) | CYC_OVRD_WFI_MODE(2));
/* Enable branch prediction state retention across ACC sleep */
reg_mask(SYS_ACC_CFG, ACC_CFG_BP_SLEEP_MASK, ACC_CFG_BP_SLEEP(3));

View file

@ -101,3 +101,5 @@
#define CYC_OVRD_FIQ_MODE_MASK (3UL << 20)
#define CYC_OVRD_IRQ_MODE(x) (((unsigned long)x) << 22)
#define CYC_OVRD_IRQ_MODE_MASK (3UL << 22)
#define CYC_OVRD_WFI_MODE(x) (((unsigned long)x) << 24)
#define CYC_OVRD_WFI_MODE_MASK (3UL << 20)