arm: imx: Add function to validate i.MX8 containers

Add a function to abstract the common task of validating i.MX8 container
image headers.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
diff --git a/arch/arm/mach-imx/parse-container.c b/arch/arm/mach-imx/parse-container.c
index 48cffb3..d57f25d 100644
--- a/arch/arm/mach-imx/parse-container.c
+++ b/arch/arm/mach-imx/parse-container.c
@@ -85,7 +85,7 @@
 		goto end;
 	}
 
-	if (container->tag != 0x87 && container->version != 0x0) {
+	if (!valid_container_hdr(container)) {
 		log_err("Wrong container header\n");
 		ret = -ENOENT;
 		goto end;