Merge "ipq: Added validations for "dump_compressed" env variable"
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 937c825..9358328 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -67,7 +67,6 @@
 dtb-$(CONFIG_ARCH_IPQ6018) += ipq6018-cp01-c1.dtb \
 			ipq6018-cp02-c1.dtb \
 			ipq6018-cp03-c1.dtb \
-			ipq6018-emulation.dtb \
 			ipq6018-db-cp01.dtb \
 			ipq6018-db-cp02.dtb
 
diff --git a/arch/arm/dts/ipq6018-cp01-c1.dts b/arch/arm/dts/ipq6018-cp01-c1.dts
index c2e1e7e..d88d22d 100644
--- a/arch/arm/dts/ipq6018-cp01-c1.dts
+++ b/arch/arm/dts/ipq6018-cp01-c1.dts
@@ -14,8 +14,6 @@
 /dts-v1/;
 #include "ipq6018-soc.dtsi"
 / {
-	model ="QCA, IPQ6018-CP01-C1";
-	compatible = "qca,ipq6018", "qca,ipq6018-cp01-c1";
 	machid = <0x8030000>;
 	config_name = "config@cp01-c1";
 
diff --git a/arch/arm/dts/ipq6018-cp02-c1.dts b/arch/arm/dts/ipq6018-cp02-c1.dts
index b4fba66..4822dea 100644
--- a/arch/arm/dts/ipq6018-cp02-c1.dts
+++ b/arch/arm/dts/ipq6018-cp02-c1.dts
@@ -14,8 +14,6 @@
 /dts-v1/;
 #include "ipq6018-soc.dtsi"
 / {
-	model ="QCA, IPQ6018-CP02-c1";
-	compatible = "qca,ipq6018", "qca,ipq6018-cp02-c1";
 	machid = <0x8030100>;
 	config_name = "config@cp02-c1";
 
diff --git a/arch/arm/dts/ipq6018-cp03-c1.dts b/arch/arm/dts/ipq6018-cp03-c1.dts
index 7f3ef3b..fa2cc86 100644
--- a/arch/arm/dts/ipq6018-cp03-c1.dts
+++ b/arch/arm/dts/ipq6018-cp03-c1.dts
@@ -14,8 +14,6 @@
 /dts-v1/;
 #include "ipq6018-soc.dtsi"
 / {
-	model ="QCA, IPQ6018-CP03-C1";
-	compatible = "qca,ipq6018", "qca,ipq6018-cp03-c1";
 	machid = <0x8030200>;
 	config_name = "config@cp03-c1";
 
diff --git a/arch/arm/dts/ipq6018-db-cp01.dts b/arch/arm/dts/ipq6018-db-cp01.dts
index 8e82465..5480528 100644
--- a/arch/arm/dts/ipq6018-db-cp01.dts
+++ b/arch/arm/dts/ipq6018-db-cp01.dts
@@ -14,8 +14,6 @@
 /dts-v1/;
 #include "ipq6018-soc.dtsi"
 / {
-	model ="QCA, IPQ6018-DB.CP01";
-	compatible = "qca,ipq6018", "qca,ipq6018-db-cp01";
 	machid = <0x1030000>;
 	config_name = "config@db-cp01";
 
diff --git a/arch/arm/dts/ipq6018-db-cp02.dts b/arch/arm/dts/ipq6018-db-cp02.dts
index 11ac915..bf5b68d 100644
--- a/arch/arm/dts/ipq6018-db-cp02.dts
+++ b/arch/arm/dts/ipq6018-db-cp02.dts
@@ -14,8 +14,6 @@
 /dts-v1/;
 #include "ipq6018-soc.dtsi"
 / {
-	model ="QCA, IPQ6018-DB.CP02";
-	compatible = "qca,ipq6018", "qca,ipq6018-db-cp02";
 	machid = <0x1030100>;
 	config_name = "config@db-cp02";
 
diff --git a/board/qca/arm/common/cmd_bootqca.c b/board/qca/arm/common/cmd_bootqca.c
index f4aab67..4385a53 100644
--- a/board/qca/arm/common/cmd_bootqca.c
+++ b/board/qca/arm/common/cmd_bootqca.c
@@ -331,6 +331,8 @@
 		printf("runcmd: %s\n", runcmd);
 	if (run_command(runcmd, 0) != CMD_RET_SUCCESS)
 		return CMD_RET_FAILURE;
+
+	return 0;
 }
 
 #ifndef CONFIG_IPQ_ELF_AUTH
@@ -388,6 +390,7 @@
 static int authenticate_rootfs_elf(unsigned int rootfs_hdr)
 {
 	int ret;
+	unsigned int request;
 	image_info img_info;
 	struct {
 		unsigned long type;
@@ -395,16 +398,21 @@
 		unsigned long addr;
 	} rootfs_img_info;
 
-	rootfs_img_info.addr = rootfs_hdr;
+	request = CONFIG_ROOTFS_LOAD_ADDR;
+	rootfs_img_info.addr = request;
 	rootfs_img_info.type = SEC_AUTH_SW_ID;
 
 	if (parse_elf_image_phdr(&img_info, rootfs_hdr))
 		return CMD_RET_FAILURE;
 
-	/* copy rootfs from the boot device */
-	copy_rootfs(img_info.img_load_addr, img_info.img_size);
+	memcpy((void*)request, (void*)rootfs_hdr, img_info.img_offset);
 
-	rootfs_img_info.size = img_info.img_offset;
+	request += img_info.img_offset;
+
+	/* copy rootfs from the boot device */
+	copy_rootfs(request, img_info.img_size);
+
+	rootfs_img_info.size = img_info.img_offset + img_info.img_size;
 	ret = qca_scm_secure_authenticate(&rootfs_img_info, sizeof(rootfs_img_info));
 	if (ret)
 		return CMD_RET_FAILURE;