firmware: fw_base: Don't OR forced FW_OPTIONS
authorAnup Patel <anup.patel@wdc.com>
Sat, 23 May 2020 06:39:57 +0000 (12:09 +0530)
committerAnup Patel <anup@brainfault.org>
Fri, 5 Jun 2020 03:32:32 +0000 (09:02 +0530)
Currently, we are ORing FW_OPTIONS with the options passed by
previous booting stage to fw_dynamic. This causes confusion
because compiling fw_dynamic with FW_OPTIONS=0x2 does not force
enable boot prints as the U-Boot SPL passes options=0x1 in
fw_dyanmic_info.

The best thing to do is always prefer FW_OPTIONS when available.
This is intuitive for OpenSBI users and easy in debugging.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
firmware/fw_base.S

index b28119a..b354cb8 100644 (file)
@@ -268,13 +268,11 @@ _scratch_init:
        /* Store firmware options in scratch space */
        MOV_3R  s0, a0, s1, a1, s2, a2
 #ifdef FW_OPTIONS
-       li      a4, FW_OPTIONS
+       li      a0, FW_OPTIONS
 #else
-       add     a4, zero, zero
-#endif
        call    fw_options
-       or      a4, a4, a0
-       REG_S   a4, SBI_SCRATCH_OPTIONS_OFFSET(tp)
+#endif
+       REG_S   a0, SBI_SCRATCH_OPTIONS_OFFSET(tp)
        MOV_3R  a0, s0, a1, s1, a2, s2
        /* Move to next scratch space */
        add     t1, t1, t2