summaryrefslogtreecommitdiff
path: root/drivers/qe
diff options
context:
space:
mode:
authorZhao Qiang <B45475@freescale.com>2014-04-30 16:45:31 +0800
committerYork Sun <yorksun@freescale.com>2014-05-13 08:26:56 -0700
commitca721fb292c0d17c586caf1993a22a10f6fffd9c (patch)
treec633ff87d0120eb58cfa202901912f6c1e2b087f /drivers/qe
parenteab3bfbcd18daa8c29c8b6eda00527c01d6f8f27 (diff)
qe: disable qe when qe-ucode fails to be uploaded for "deep sleep"
when qe-ucode fails to be uploaded, "deep sleep" will hang. if there is no qe-ucode, disable qe module for platforms which support "deep sleep" Signed-off-by: Zhao Qiang <B45475@freescale.com>
Diffstat (limited to 'drivers/qe')
-rw-r--r--drivers/qe/qe.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/qe/qe.c b/drivers/qe/qe.c
index b1da75ec4d..9c5fbd1d69 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,7 +319,9 @@ 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;
-
+#ifdef CONFIG_DEEP_SLEEP
+ ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+#endif
if (!firmware) {
printf("Invalid address\n");
return -EINVAL;
@@ -330,6 +334,9 @@ 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");
+#ifdef CONFIG_DEEP_SLEEP
+ setbits_be32(&gur->devdisr, MPC85xx_DEVDISR_QE_DISABLE);
+#endif
return -EPERM;
}