diff options
| author | Yu Chien Peter Lin <peterlin@andestech.com> | 2023-11-30 20:42:09 +0800 |
|---|---|---|
| committer | Anup Patel <anup@brainfault.org> | 2023-12-06 18:03:12 +0530 |
| commit | 009ae4e60221fd17858837460eb26a6a0a56d8f3 (patch) | |
| tree | 71f83411fb4f7b76b97f62f31b4bab3f7a86df76 /platform/generic/include | |
| parent | 0b3262efc6bcde391da84e49ec978804cc6eac37 (diff) | |
| download | opensbi-009ae4e60221fd17858837460eb26a6a0a56d8f3.tar.gz opensbi-009ae4e60221fd17858837460eb26a6a0a56d8f3.tar.bz2 opensbi-009ae4e60221fd17858837460eb26a6a0a56d8f3.zip | |
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>
Diffstat (limited to 'platform/generic/include')
| -rw-r--r-- | platform/generic/include/andes/andes45.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/generic/include/andes/andes45.h b/platform/generic/include/andes/andes45.h index ce31617c..01f63d44 100644 --- a/platform/generic/include/andes/andes45.h +++ b/platform/generic/include/andes/andes45.h @@ -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) & \ |
