aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/firmware/fw.md15
-rw-r--r--include/sbi/sbi_scratch.h6
-rw-r--r--lib/sbi_init.c3
3 files changed, 23 insertions, 1 deletions
diff --git a/docs/firmware/fw.md b/docs/firmware/fw.md
index acff4a6..8ca54b6 100644
--- a/docs/firmware/fw.md
+++ b/docs/firmware/fw.md
@@ -75,3 +75,18 @@ make PLATFORM=<platform_subdir> FW_PAYLOAD_PATH=<payload path>
The instructions to build each payload is different and the details can
be found in the
*docs/firmware/payload_<payload_name>.md* files.
+
+Options for OpenSBI Firmware behaviors
+--------------------------------------
+An optional compile time flag FW_OPTIONS can be used to control the OpenSBI
+firmware run-time behaviors.
+
+```
+make PLATFORM=<platform_subdir> FW_OPTIONS=<options>
+```
+
+FW_OPTIONS is a bitwise or'ed value of various options, eg: *FW_OPTIONS=0x1*
+stands for disabling boot prints from the OpenSBI library.
+
+For all supported options, please check "enum sbi_scratch_options" in the
+*include/sbi/sbi_scratch.h* header file.
diff --git a/include/sbi/sbi_scratch.h b/include/sbi/sbi_scratch.h
index 4cba233..759e564 100644
--- a/include/sbi/sbi_scratch.h
+++ b/include/sbi/sbi_scratch.h
@@ -70,6 +70,12 @@ struct sbi_scratch {
unsigned long options;
} __packed;
+/** Possible options for OpenSBI library */
+enum sbi_scratch_options {
+ /** Disable prints during boot */
+ SBI_SCRATCH_NO_BOOT_PRINTS = (1 << 0),
+};
+
/** Get pointer to sbi_scratch for current HART */
#define sbi_scratch_thishart_ptr() \
((struct sbi_scratch *)csr_read(CSR_MSCRATCH))
diff --git a/lib/sbi_init.c b/lib/sbi_init.c
index bc27436..32ad822 100644
--- a/lib/sbi_init.c
+++ b/lib/sbi_init.c
@@ -91,7 +91,8 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
if (rc)
sbi_hart_hang();
- sbi_boot_prints(scratch, hartid);
+ if (!(scratch->options & SBI_SCRATCH_NO_BOOT_PRINTS))
+ sbi_boot_prints(scratch, hartid);
if (!sbi_platform_has_hart_hotplug(plat))
sbi_hart_wake_coldboot_harts(scratch, hartid);