diff mbox series

[U-Boot,v4,03/16] powerpc: mpc8xx: get rid of the multiple PVR_ values

Message ID b9ce0609d12beec864db96ee8320a4c07806216a.1521215903.git.christophe.leroy@c-s.fr
State Accepted
Commit fdef3895a03eb45245215eb319fbbbf519d3759c
Delegated to: Tom Rini
Headers show
Series Powerpc: mpc8xx: cleanup before migration to DM model | expand

Commit Message

Christophe Leroy March 16, 2018, 4:20 p.m. UTC
Avoid hardcoding the PVR values in C since they are defined
in processor.h

At the same time, remove those multiple PVR values for 8xx and
keep only one that we call PVR_8xx

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 arch/powerpc/cpu/mpc8xx/cpu.c        | 2 +-
 arch/powerpc/include/asm/processor.h | 6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

Comments

Tom Rini April 6, 2018, 9:02 p.m. UTC | #1
On Fri, Mar 16, 2018 at 05:20:35PM +0100, Christophe Leroy wrote:

> Avoid hardcoding the PVR values in C since they are defined
> in processor.h
> 
> At the same time, remove those multiple PVR values for 8xx and
> keep only one that we call PVR_8xx
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/arch/powerpc/cpu/mpc8xx/cpu.c b/arch/powerpc/cpu/mpc8xx/cpu.c
index 9da73ac22e2..5a81bed5a10 100644
--- a/arch/powerpc/cpu/mpc8xx/cpu.c
+++ b/arch/powerpc/cpu/mpc8xx/cpu.c
@@ -42,7 +42,7 @@  static int check_CPU(long clock, uint pvr, uint immr)
 
 	/* the highest 16 bits should be 0x0050 for a 860 */
 
-	if ((pvr >> 16) != 0x0050)
+	if (PVR_VER(pvr) != PVR_VER(PVR_8xx))
 		return -1;
 
 	k = (immr << 16) |
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index 57b11b83657..6fbe8c46b31 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -973,10 +973,8 @@ 
  * differentiated by the version number in the Communication Processor
  * Module (CPM).
  */
-#define PVR_821		0x00500000
-#define PVR_823		PVR_821
-#define PVR_850		PVR_821
-#define PVR_860		PVR_821
+#define PVR_8xx		0x00500000
+
 #define PVR_7400	0x000C0000
 
 /*