summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/Kconfig11
-rw-r--r--common/globalvar.c21
-rw-r--r--common/oftree.c19
3 files changed, 50 insertions, 1 deletions
diff --git a/common/Kconfig b/common/Kconfig
index 1ece3f7318..2d7888b9fa 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1376,6 +1376,12 @@ config DEBUG_RPI3_MINI_UART
config DEBUG_ERIZO
bool "Erizo ns16550 port"
depends on SOC_ERIZO
+ select DEBUG_LL_NS16550
+
+config DEBUG_STARFIVE
+ bool "Starfive ns16550 serial0 port"
+ depends on SOC_STARFIVE
+ select DEBUG_LL_NS16550
config DEBUG_SIFIVE
bool "SiFive serial0 port"
@@ -1383,6 +1389,11 @@ config DEBUG_SIFIVE
endchoice
+config DEBUG_LL_NS16550
+ bool
+ help
+ Selected by RISC-V platforms that use ns16550 for debug_ll
+
config DEBUG_IMX_UART_PORT
int "i.MX Debug UART Port Selection" if DEBUG_IMX1_UART || \
DEBUG_IMX21_UART || \
diff --git a/common/globalvar.c b/common/globalvar.c
index 8bb5015ce4..9e5a99f793 100644
--- a/common/globalvar.c
+++ b/common/globalvar.c
@@ -565,6 +565,27 @@ int globalvar_add_simple_int(const char *name, int *value,
return 0;
}
+int globalvar_add_simple_uint64(const char *name, u64 *value,
+ const char *format)
+{
+ struct param_d *p;
+ int ret;
+
+ ret = globalvar_remove_unqualified(name);
+ if (ret)
+ return ret;
+
+ p = dev_add_param_uint64(&global_device, name, NULL, NULL,
+ value, format, NULL);
+
+ if (IS_ERR(p))
+ return PTR_ERR(p);
+
+ globalvar_nv_sync(name);
+
+ return 0;
+}
+
int globalvar_add_bool(const char *name,
int (*set)(struct param_d *, void *),
int *value, void *priv)
diff --git a/common/oftree.c b/common/oftree.c
index 7028c49aca..962fff244d 100644
--- a/common/oftree.c
+++ b/common/oftree.c
@@ -232,7 +232,24 @@ static int of_fixup_bootargs(struct device_node *root, void *unused)
return err;
}
- return of_fixup_bootargs_bootsource(root, node);
+ err = of_fixup_bootargs_bootsource(root, node);
+ if (err)
+ return err;
+
+ if (IS_ENABLED(CONFIG_RISCV)) {
+ const char *hartid;
+
+ hartid = getenv("global.hartid");
+ if (hartid) {
+ unsigned long id;
+
+ err = kstrtoul(hartid, 10, &id);
+ if (!err)
+ err = of_property_write_u32(node, "boot-hartid", id);
+ }
+ }
+
+ return err;
}
static int of_register_bootargs_fixup(void)