platform: andes: Factor out is_andes() helper

We will need is_andes(45) in the following patch,
so factor out the code that parses marchid to make
it reusable for checking any Andes CPU variants.

Also improves the comment in ae350_hart_start().

Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Yu Chien Peter Lin
2023-11-30 20:42:09 +08:00
committed by Anup Patel
parent 0b3262efc6
commit 009ae4e602
2 changed files with 13 additions and 9 deletions

View File

@@ -43,6 +43,12 @@
#ifndef __ASSEMBLER__
#define is_andes(series) \
({ \
char value = csr_read(CSR_MARCHID) & 0xff; \
(series) == (value >> 4) * 10 + (value & 0x0f); \
})
#define has_andes_pmu() \
({ \
(((csr_read(CSR_MMSC_CFG) & \