Skip to content

Commit f5375bc

Browse files
SiFiveHollandavpatel
authored andcommitted
platform: generic: allwinner: Optimize current hart scratch access
The address of the local scratch area is stored in each hart's mscratch CSR. It is more efficient to read the CSR than to compute the address from the hart ID. Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
1 parent b94396c commit f5375bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

platform/generic/allwinner/sun20i-d1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static void sun20i_d1_riscv_cfg_restore(void)
142142

143143
static void sun20i_d1_riscv_cfg_init(void)
144144
{
145-
u64 entry = sbi_hartid_to_scratch(0)->warmboot_addr;
145+
u64 entry = sbi_scratch_thishart_ptr()->warmboot_addr;
146146

147147
/* Enable MMIO access. */
148148
writel_relaxed(CCU_BGR_ENABLE, SUN20I_D1_CCU_BASE + RISCV_CFG_BGR_REG);

0 commit comments

Comments
 (0)