target: init: Correct few macros w.r.t AVB v2.0
Correct few macros in AVB v2.0 code path and also adds
function declarations which is used across multiple files.
Change-Id: Icca7fe5cca50f4f4ba530327d0cc41f1050ee2fb
diff --git a/include/target.h b/include/target.h
index 7b92dfb..2151f05 100644
--- a/include/target.h
+++ b/include/target.h
@@ -33,6 +33,7 @@
{
VB_L = 1,
VB_M = 2,
+ VB_AVB2 = 4,
};
/* Target helper functions exposed to USB driver */
diff --git a/target/init.c b/target/init.c
index e8189cc..386f5c6 100644
--- a/target/init.c
+++ b/target/init.c
@@ -43,8 +43,8 @@
#include <pm_fg_adc_usr.h>
#endif
-#if VERIFIED_BOOT
#include <partition_parser.h>
+#if VERIFIED_BOOT || VERIFIED_BOOT_2
#include <ab_partition_parser.h>
#endif
@@ -62,10 +62,9 @@
#define BATT_VOLTAGE_NUMR 122070
#define QGAUGE_VOLTAGE_NUMR 194637
#define BATT_VOLTAGE_DENR 1000
-
-#if VERIFIED_BOOT
+#define INVALID -1
static int vb_version = INVALID;
-#endif
+
/*
* default implementations of these routines, if the target code
* chooses not to implement.
@@ -300,7 +299,6 @@
return ret;
}
-#if VERIFIED_BOOT
int target_get_vb_version()
{
if (vb_version == INVALID)
@@ -315,7 +313,6 @@
}
return vb_version;
}
-#endif
#if VERIFIED_BOOT_LE
int verified_boot_le = 1;