Avoid using a magic number, instead use a macro for the version of
struct fw_dynamic_info.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Xiang W <wxjstz@126.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
bgt a0, a1, _bad_dynamic_info
/* Read boot HART id */
- li a1, 0x2
+ li a1, FW_DYNAMIC_INFO_VERSION_2
blt a0, a1, 2f
REG_L a0, FW_DYNAMIC_INFO_BOOT_HART_OFFSET(a2)
ret
REG_S a3, (a4)
/* Save version == 0x2 fields */
- li a4, 0x2
+ li a4, FW_DYNAMIC_INFO_VERSION_2
REG_L a3, FW_DYNAMIC_INFO_VERSION_OFFSET(a2)
blt a3, a4, 2f
lla a4, _dynamic_boot_hart
#define FW_DYNAMIC_INFO_MAGIC_VALUE 0x4942534f
/** Maximum supported info version */
-#define FW_DYNAMIC_INFO_VERSION_MAX 0x2
+#define FW_DYNAMIC_INFO_VERSION_2 0x2
+#define FW_DYNAMIC_INFO_VERSION_MAX FW_DYNAMIC_INFO_VERSION_2
/** Possible next mode values */
#define FW_DYNAMIC_INFO_NEXT_MODE_U 0x0