Skip to contentSkip to conversation

powerpc/b4860: Disable unused devices using DEVDISR register

PATCH In review Sandeep Singh 2 participants 2 messages Jul 2, 2013 – Aug 9, 2013 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/b4860: Disable unused devices using DEVDISR register

Explicitly disabling unused IPs/blocks. This will lower power consumption.

---
 arch/powerpc/cpu/mpc85xx/Makefile    |    1 +
 arch/powerpc/cpu/mpc85xx/b4860_cpu.c |  130 ++++++++++++++++++++++++++++++++++
 arch/powerpc/include/asm/processor.h |    1 +
 board/freescale/b4860qds/b4860qds.c  |    2 +
 4 files changed, 134 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/cpu/mpc85xx/b4860_cpu.c
arch/powerpc/cpu/mpc85xx/Makefile +1 -0
index cefd57b..340f3dd 100644
@@ -149,6 +149,7 @@ COBJS-$(CONFIG_PPC_T4240) += t4240_serdes.o
 COBJS-$(CONFIG_PPC_T4160) += t4240_serdes.o
 COBJS-$(CONFIG_PPC_B4420) += b4860_serdes.o
 COBJS-$(CONFIG_PPC_B4860) += b4860_serdes.o
+COBJS-$(CONFIG_PPC_B4860) += b4860_cpu.o
 COBJS-$(CONFIG_BSC9132) += bsc9132_serdes.o
 COBJS-$(CONFIG_PPC_T1040) += t1040_serdes.o
 
arch/powerpc/cpu/mpc85xx/b4860_cpu.c new file +130 -0

130 lines not on this page · raw message

arch/powerpc/include/asm/processor.h +1 -0
index 64a6f9c..143d561 100644
@@ -1125,6 +1125,7 @@
 #define SVR_B4860	0X868000
 #define SVR_G4860	0x868001
 #define SVR_G4060	0x868003
+#define SVR_B4060	0x868002
 #define SVR_B4440	0x868100
 #define SVR_G4440	0x868101
 #define SVR_B4420	0x868102
board/freescale/b4860qds/b4860qds.c +2 -0
index b1b012c..5e2efd3 100644
@@ -575,6 +575,8 @@ int board_early_init_r(void)
 	int ret;
 	u32 svr = SVR_SOC_VER(get_svr());
 
+	cpu_device_disable();
+
 	/* Create law for MAPLE only for personalities having MAPLE */
 	if ((svr == SVR_B4860) || (svr == SVR_B4440) ||
 			(svr == SVR_B4420) || (svr == SVR_B4220)) {
Signature · 1 line
1.7.6.GIT
#1 lore raw
Quoted 5 lines · Sandeep Singh

Explicitly disabling unused IPs/blocks. This will lower power consumption.

<snip>

arch/powerpc/cpu/mpc85xx/b4860_cpu.c line 81

Quoted 12 lines
arch/powerpc/cpu/mpc85xx/b4860_cpu.c new file +12 -0
+
+void cpu_device_disable()
+{
+	ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
+
+	/* get devdisr */
+	u32 *devdisr1 = in_be32(&gur->devdisr);
+	u32 *devdisr2 = in_be32(&gur->devdisr2);
+	u32 *devdisr3 = in_be32(&gur->devdisr3);
+	u32 *devdisr4 = in_be32(&gur->devdisr4);
+	u32 *devdisr5 = in_be32(&gur->devdisr5);
+

in_be32 returns u32, not u32 *. You will have compiling warnings here.

<snip>

Quoted 17 lines
arch/powerpc/include/asm/processor.h +1 -0
index 64a6f9c..143d561 100644
@@ -1125,6 +1125,7 @@
 #define SVR_B4860	0X868000
 #define SVR_G4860	0x868001
 #define SVR_G4060	0x868003
+#define SVR_B4060	0x868002
 #define SVR_B4440	0x868100
 #define SVR_G4440	0x868101
 #define SVR_B4420	0x868102
board/freescale/b4860qds/b4860qds.c +0 -0
index b1b012c..5e2efd3 100644

board/freescale/b4860qds/b4860qds.c int board_early_init_r(void) · line 578

Quoted 4 lines
board/freescale/b4860qds/b4860qds.c +1 -0
@@ -575,6 +575,8 @@ int board_early_init_r(void)
 	int ret;
 	u32 svr = SVR_SOC_VER(get_svr());
 
+	cpu_device_disable();

You don't have prototype for this function.

board/freescale/b4860qds/b4860qds.c int board_early_init_r(void) · line 582

Quoted 5 lines
board/freescale/b4860qds/b4860qds.c +1 -0
+
 	/* Create law for MAPLE only for personalities having MAPLE */
 	if ((svr == SVR_B4860) || (svr == SVR_B4440) ||
 			(svr == SVR_B4420) || (svr == SVR_B4220)) {

This hunk doesn't apply. Please check your code base.

York