Skip to contentSkip to conversation

qe/deep-sleep: add qe deep-sleep for generic board

PATCH New Zhao Qiang 3 participants 4 messages Nov 11, 2014 – Dec 15, 2014

lore
Share & tools
lore

Zhao Qiang

author
#0 lore raw

PATCH 1/1 qe/deep-sleep: add qe deep-sleep for generic board

Deep sleep for generic board is supported now,
and it use CONFIG_FSL_DEEP_SLEEP instead of CONFIG_DEEP_SLEEP, so modify it for qe.

---
 drivers/qe/qe.c | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)
drivers/qe/qe.c +21 -10
index 2c5b9bf..8687e73 100644
@@ -9,12 +9,15 @@
 
 #include "common.h"
 #include <command.h>
+#ifdef CONFIG_LS102XA
+#include <asm/arch/immap_ls102xa.h>
+#endif
 #include "asm/errno.h"
 #include "asm/io.h"
 #include "linux/immap_qe.h"
 #include "qe.h"
 
-#define MPC85xx_DEVDISR_QE_DISABLE	0x1
+#define DEVDISR_QE_DISABLE	0x1
 
 qe_map_t		*qe_immr = NULL;
 static qe_snum_t	snums[QE_NUM_OF_SNUM];
@@ -346,7 +349,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;
-#ifdef CONFIG_DEEP_SLEEP
+#if defined(CONFIG_FSL_DEEP_SLEEP) && defined(CONFIG_QE)
 	ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
 #endif
 	if (!firmware) {
@@ -361,8 +364,8 @@ 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);
+#if defined(CONFIG_FSL_DEEP_SLEEP) && defined(CONFIG_QE)
+		setbits_be32(&gur->devdisr, DEVDISR_QE_DISABLE);
 #endif
 		return -EPERM;
 	}
@@ -481,9 +484,13 @@ int u_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
+#ifdef CONFIG_FSL_DEEP_SLEEP
+#ifdef CONFIG_LS102XA
+	struct ccsr_gur __iomem *gur = (void *)CONFIG_SYS_FSL_GUTS_ADDR;
+#else
 	ccsr_gur_t __iomem *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
 #endif
+#endif
 	if (!firmware) {
 		printf("Invalid address\n");
 		return -EINVAL;
@@ -496,8 +503,8 @@ int u_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);
+#ifdef CONFIG_FSL_DEEP_SLEEP
+		setbits_be32(&gur->devdisr, DEVDISR_QE_DISABLE);
 #endif
 		return -EPERM;
 	}
@@ -588,9 +595,13 @@ int u_qe_firmware_resume(const struct qe_firmware *firmware, qe_map_t *qe_immrr)
 	unsigned int j;
 	const struct qe_header *hdr;
 	const u32 *code;
-#ifdef CONFIG_DEEP_SLEEP
+#ifdef CONFIG_FSL_DEEP_SLEEP
+#ifdef CONFIG_LS102XA
+	struct ccsr_gur __iomem *gur = (void *)CONFIG_SYS_FSL_GUTS_ADDR;
+#else
 	ccsr_gur_t __iomem *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
 #endif
+#endif
 
 	if (!firmware)
 		return -EINVAL;
@@ -600,8 +611,8 @@ int u_qe_firmware_resume(const struct qe_firmware *firmware, qe_map_t *qe_immrr)
 	/* Check the magic */
 	if ((hdr->magic[0] != 'Q') || (hdr->magic[1] != 'E') ||
 	    (hdr->magic[2] != 'F')) {
-#ifdef CONFIG_DEEP_SLEEP
-		setbits_be32(&gur->devdisr, MPC85xx_DEVDISR_QE_DISABLE);
+#ifdef CONFIG_FSL_DEEP_SLEEP
+		setbits_be32(&gur->devdisr, DEVDISR_QE_DISABLE);
 #endif
 		return -EPERM;
 	}
Signature · 1 line
2.1.0.27.g96db324
#1 lore raw

PATCH 1/1 qe/deep-sleep: add qe deep-sleep for generic board

Quoted 6 lines · Zhao Qiang

Deep sleep for generic board is supported now,
and it use CONFIG_FSL_DEEP_SLEEP instead of CONFIG_DEEP_SLEEP, so modify it for qe.

---

Qiang,

Can you rebase this patch and verify it on boards?

Thanks.

York

#2 lore raw

PATCH 1/1 qe/deep-sleep: add qe deep-sleep for generic board

Quoted 12 lines · York Sun

-----Original Message-----
From: York Sun [mailto:yorksun at freescale.com]
Sent: Saturday, December 13, 2014 5:27 AM
To: Zhao Qiang-B45475; u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH] qe/deep-sleep: add qe deep-sleep for generic board

Quoted 4 lines · Zhao Qiang

Deep sleep for generic board is supported now, and it use CONFIG_FSL_DEEP_SLEEP instead of CONFIG_DEEP_SLEEP, so modify it for qe.

Quoted 6 lines
Quoted 2 lines

---

Qiang,

Can you rebase this patch and verify it on boards?

This patch doesn't needed due to the modify of its based patch from tang yuantian. I will abandon it.
Thank you!

Quoted 5 lines

Thanks.

York

Best Regards
Zhao Qiang

#3 lore raw

PATCH 1/1 qe/deep-sleep: add qe deep-sleep for generic board

In reply to York Sun

Hi York,

I make mistake in previous email,
I have rebased the patch with link http://patchwork.ozlabs.org/patch/420999/.
Thank you!

Best Regards
Zhao Qiang

Quoted 23 lines

-----Original Message-----
From: York Sun [mailto:yorksun at freescale.com]
Sent: Saturday, December 13, 2014 5:27 AM
To: Zhao Qiang-B45475; u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH] qe/deep-sleep: add qe deep-sleep for generic board

Quoted 6 lines · Zhao Qiang

Deep sleep for generic board is supported now, and it use CONFIG_FSL_DEEP_SLEEP instead of CONFIG_DEEP_SLEEP, so modify it for qe.

---

Qiang,

Can you rebase this patch and verify it on boards?

Thanks.

York