[U-Boot] [PATCH] qe: disable qe when qe-ucode fails to be uploaded

Zhao Qiang B45475 at freescale.com
Fri Apr 25 11:14:49 CEST 2014


when qe-ucode fails to be uploaded, disable qe.

Signed-off-by: Zhao Qiang <B45475 at freescale.com>
---
 drivers/qe/qe.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/qe/qe.c b/drivers/qe/qe.c
index b1da75e..c77cc16 100644
--- a/drivers/qe/qe.c
+++ b/drivers/qe/qe.c
@@ -14,6 +14,8 @@
 #include "asm/immap_qe.h"
 #include "qe.h"
 
+#define MPC85xx_DEVDISR_QE_DISABLE	0x1
+
 qe_map_t		*qe_immr = NULL;
 static qe_snum_t	snums[QE_NUM_OF_SNUM];
 
@@ -317,6 +319,7 @@ int qe_upload_firmware(const struct qe_firmware *firmware)
 	size_t calc_size = sizeof(struct qe_firmware);
 	size_t length;
 	const struct qe_header *hdr;
+	ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
 
 	if (!firmware) {
 		printf("Invalid address\n");
@@ -330,6 +333,7 @@ int qe_upload_firmware(const struct qe_firmware *firmware)
 	if ((hdr->magic[0] != 'Q') || (hdr->magic[1] != 'E') ||
 	    (hdr->magic[2] != 'F')) {
 		printf("Not a microcode\n");
+		setbits_be32(&gur->devdisr, MPC85xx_DEVDISR_QE_DISABLE);
 		return -EPERM;
 	}
 
-- 
1.8.5



More information about the U-Boot mailing list