]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/qe/qe.c
Merge branch 'master' of git://www.denx.de/git/u-boot-imx
[karo-tx-uboot.git] / drivers / qe / qe.c
index b1da75ec4d924dc4471c7daabe77fdef81a7fa1c..4358a91adb5300911753416852654b63a1cc6faf 100644 (file)
 #include <command.h>
 #include "asm/errno.h"
 #include "asm/io.h"
-#include "asm/immap_qe.h"
+#include "linux/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;
@@ -329,7 +333,10 @@ int qe_upload_firmware(const struct qe_firmware *firmware)
        /* Check the magic */
        if ((hdr->magic[0] != 'Q') || (hdr->magic[1] != 'E') ||
            (hdr->magic[2] != 'F')) {
-               printf("Not a microcode\n");
+               printf("QE microcode not found\n");
+#ifdef CONFIG_DEEP_SLEEP
+               setbits_be32(&gur->devdisr, MPC85xx_DEVDISR_QE_DISABLE);
+#endif
                return -EPERM;
        }