diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2021-06-19 06:50:31 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-06-24 08:53:43 +0200 |
commit | 1f3ce24ef52f2ec4473801a4bf49f86f0936b4c2 (patch) | |
tree | daa5f6683e54ad17228ae55bbff19d04470c23e0 /include | |
parent | f13e72db3e2e90b57521c0859365dc78fb807aa6 (diff) | |
download | barebox-1f3ce24ef52f2ec4473801a4bf49f86f0936b4c2.tar.gz barebox-1f3ce24ef52f2ec4473801a4bf49f86f0936b4c2.tar.xz |
RISC-V: S-Mode: propagate Hart ID
Unlike other architectures we support, Linux must apparently be
booted on all cores by the bootloader. To achieve this, the bootloaders
running on the multiple cores synchronize via IPIs.
We will get there eventually, but for now, let's restrict barebox
to boot Linux on a single core. S-Mode firmware is passed hart (core) id
in a0. This is propagated via the thread pointer register, which is
unused by GCC and made available as:
- cpuinfo output when running in S-Mode
- $global.hartid
- a0 when booting via bootm
- /chosen/boot-hartid fixup: will come in handy when we gain EFI
loading support
- single /cpus/*/reg: All other CPU nodes are deleted via fixup
For M-Mode, we can query hart id via CSR. It's unknown whether erizo
supports it and we don't yet have exception support to handle it not
being available, so changes are only done for S-Mode for now.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20210619045055.779-6-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/globalvar.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/globalvar.h b/include/globalvar.h index 84bee9102c..476bb920f3 100644 --- a/include/globalvar.h +++ b/include/globalvar.h @@ -20,6 +20,8 @@ void globalvar_set(const char *name, const char *val); int globalvar_add_simple_string(const char *name, char **value); int globalvar_add_simple_int(const char *name, int *value, const char *format); +int globalvar_add_simple_uint64(const char *name, u64 *value, + const char *format); int globalvar_add_bool(const char *name, int (*set)(struct param_d *, void *), int *value, void *priv); @@ -55,6 +57,12 @@ static inline int globalvar_add_simple_int(const char *name, return 0; } +static inline int globalvar_add_simple_uint64(const char *name, + u64 *value, const char *format) +{ + return 0; +} + static inline int globalvar_add_bool(const char *name, int (*set)(struct param_d *, void *), int *value, void *priv) |