riscv: sbi: Test for specific SBI implementation ID

Retrieve the ID from the SBI, and test it against the IMPL_ID
environment variable.

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
[Adjusted order of tests to match the function order of the spec.]
Signed-off-by: Andrew Jones <andrew.jones@linux.dev>
diff --git a/riscv/sbi.c b/riscv/sbi.c
index 72f1b19..cd36290 100644
--- a/riscv/sbi.c
+++ b/riscv/sbi.c
@@ -50,10 +50,10 @@
 
 	report_prefix_push("base");
 
-	report_prefix_push("mvendorid");
-	if (env_or_skip("MVENDORID")) {
-		expected = strtol(getenv("MVENDORID"), NULL, 0);
-		ret = __base_sbi_ecall(SBI_EXT_BASE_GET_MVENDORID, 0);
+	report_prefix_push("impl_id");
+	if (env_or_skip("IMPL_ID")) {
+		expected = strtol(getenv("IMPL_ID"), NULL, 0);
+		ret = __base_sbi_ecall(SBI_EXT_BASE_GET_IMP_ID, 0);
 		gen_report(&ret, 0, expected);
 	}
 	report_prefix_pop();
@@ -64,6 +64,14 @@
 	gen_report(&ret, 0, expected);
 	report_prefix_pop();
 
+	report_prefix_push("mvendorid");
+	if (env_or_skip("MVENDORID")) {
+		expected = strtol(getenv("MVENDORID"), NULL, 0);
+		ret = __base_sbi_ecall(SBI_EXT_BASE_GET_MVENDORID, 0);
+		gen_report(&ret, 0, expected);
+	}
+	report_prefix_pop();
+
 	report_prefix_push("marchid");
 	if (env_or_skip("MARCHID")) {
 		expected = strtol(getenv("MARCHID"), NULL, 0);