Skip to content

Commit b2a479f

Browse files
committed
chickens: Enable NEX power gating on P-cores
It seems we missed this config all along. Signed-off-by: Hector Martin <[email protected]>
1 parent 8f6e13b commit b2a479f

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/chickens.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ const char *init_cpu(void)
5050
else
5151
reg_set(SYS_IMP_APL_HID4, HID4_DISABLE_DC_MVA | HID4_DISABLE_DC_SW_L2_OPS);
5252

53+
/* Enable NEX powergating, the reset cycles might be overriden by chickens */
54+
if (!is_ecore()) {
55+
reg_mask(SYS_IMP_APL_HID13, HID13_RESET_CYCLES_MASK, HID13_RESET_CYCLES(12));
56+
reg_set(SYS_IMP_APL_HID14, HID14_ENABLE_NEX_POWER_GATING);
57+
}
58+
5359
uint64_t midr = mrs(MIDR_EL1);
5460
int part = FIELD_GET(MIDR_PART, midr);
5561
int rev = (FIELD_GET(MIDR_REV_HIGH, midr) << 4) | FIELD_GET(MIDR_REV_LOW, midr);

src/cpu_regs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@
113113
#define HID13_RESET_CYCLES(x) (((unsigned long)x) << 60)
114114
#define HID13_RESET_CYCLES_MASK (0xFUL << 60)
115115

116+
#define SYS_IMP_APL_HID14 sys_reg(3, 0, 15, 15, 0)
117+
#define HID14_ENABLE_NEX_POWER_GATING BIT(32)
118+
116119
#define SYS_IMP_APL_HID16 sys_reg(3, 0, 15, 15, 2)
117120
#define HID16_AVL_UNK12 BIT(12)
118121
#define HID16_SPAREBIT0 BIT(56)

0 commit comments

Comments
 (0)