Sysupgrade: Add support for devcfg version check

This change adds support to check devcfg version and
allows sysupgrade only if the version is higher.

Change-Id: I7192f428c50c1b1b9eeddd1aac0d57d341d32436
Signed-off-by: Pavithra Palanisamy <pavip@codeaurora.org>
diff --git a/tools/sysupgrade.c b/tools/sysupgrade.c
index bc14e1d..c8c0976 100644
--- a/tools/sysupgrade.c
+++ b/tools/sysupgrade.c
@@ -18,6 +18,7 @@
 #define HLOS_VERSION_FILE      "hlos_version"
 #define APPSBL_VERSION_FILE    "appsbl_version"
 #define RPM_VERSION_FILE       "rpm_version"
+#define DEVCFG_VERSION_FILE	"devcfg_version"
 #define VERSION_FILE_BASENAME  "/sys/devices/system/qfprom/qfprom0/"
 #define AUTHENTICATE_FILE	"/sys/devices/system/qfprom/qfprom0/authenticate"
 #define TEMP_KERNEL_PATH	"/tmp/tmp_kernel.bin"
@@ -26,6 +27,7 @@
 #define MAX_TZ_VERSION		14
 #define MAX_APPSBL_VERSION	14
 #define MAX_RPM_VERSION	8
+#define MAX_DEVCFG_VERSION	11
 #define HASH_P_FLAG		0x02200000
 #define TMP_FILE_DIR		"/tmp/"
 #define CERT_SIZE		2048
@@ -109,6 +111,14 @@
 		.version_file		= RPM_VERSION_FILE,
 		.is_present		= NOT_PRESENT,
 	},
+	{
+		.section_type		= DEVCFG_TYPE,
+		.type			= "devcfg",
+		.max_version		= MAX_DEVCFG_VERSION,
+		.file			= TMP_FILE_DIR,
+		.version_file		= DEVCFG_VERSION_FILE,
+		.is_present		= NOT_PRESENT,
+	},
 };
 
 #define NO_OF_SECTIONS		ARRAY_SIZE(sections)