All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mpc83xx: remove redundant MPC83xx_RESET #define
@ 2020-05-04 22:21 Rasmus Villemoes
  2020-05-20 12:22 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Rasmus Villemoes @ 2020-05-04 22:21 UTC (permalink / raw)
  To: u-boot

This macro is only used (tested for existence) in mpc83xx.c, which
unconditionally includes mpc83xx.h where it is unconditionally
defined. Removing it makes the remaining code easier to read.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
---
 arch/powerpc/cpu/mpc83xx/cpu.c | 24 ------------------------
 include/mpc83xx.h              |  5 -----
 2 files changed, 29 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/cpu.c b/arch/powerpc/cpu/mpc83xx/cpu.c
index 1ecc5ab7ce..118c79c4a3 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu.c
@@ -126,16 +126,10 @@ int
 do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong msr;
-#ifndef MPC83xx_RESET
-	ulong addr;
-#endif
-
 	volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
 
 	puts("Resetting the board.\n");
 
-#ifdef MPC83xx_RESET
-
 	/* Interrupts and MMU off */
 	msr = mfmsr();
 	msr &= ~(MSR_EE | MSR_IR | MSR_DR);
@@ -155,24 +149,6 @@ do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 	/* perform reset, only one bit */
 	immap->reset.rcr = RCR_SWHR;
 
-#else	/* ! MPC83xx_RESET */
-
-	immap->reset.rmr = RMR_CSRE;    /* Checkstop Reset enable */
-
-	/* Interrupts and MMU off */
-	msr = mfmsr();
-	msr &= ~(MSR_ME | MSR_EE | MSR_IR | MSR_DR);
-	mtmsr(msr);
-
-	/*
-	 * Trying to execute the next instruction at a non-existing address
-	 * should cause a machine check, resulting in reset
-	 */
-	addr = CONFIG_SYS_RESET_ADDRESS;
-
-	((void (*)(void)) addr) ();
-#endif	/* MPC83xx_RESET */
-
 	return 1;
 }
 #endif
diff --git a/include/mpc83xx.h b/include/mpc83xx.h
index c2a185321a..ea67868ea0 100644
--- a/include/mpc83xx.h
+++ b/include/mpc83xx.h
@@ -12,11 +12,6 @@
 #include <asm/e300.h>
 #endif
 
-/*
- * MPC83xx cpu provide RCR register to do reset thing specially
- */
-#define MPC83xx_RESET
-
 /*
  * System reset offset (PowerPC standard)
  */
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] mpc83xx: remove redundant MPC83xx_RESET #define
  2020-05-04 22:21 [PATCH] mpc83xx: remove redundant MPC83xx_RESET #define Rasmus Villemoes
@ 2020-05-20 12:22 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2020-05-20 12:22 UTC (permalink / raw)
  To: u-boot

On Tue, May 05, 2020 at 12:21:18AM +0200, Rasmus Villemoes wrote:

> This macro is only used (tested for existence) in mpc83xx.c, which
> unconditionally includes mpc83xx.h where it is unconditionally
> defined. Removing it makes the remaining code easier to read.
> 
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200520/b22965c3/attachment.sig>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-20 12:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-04 22:21 [PATCH] mpc83xx: remove redundant MPC83xx_RESET #define Rasmus Villemoes
2020-05-20 12:22 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.