Patchwork [U-Boot,4/6] ARM: highbank: add reset support

login
register
mail settings
Submitter Rob Herring
Date Feb. 2, 2012, 2:57 a.m.
Message ID <1328151477-8026-5-git-send-email-robherring2@gmail.com>
Download mbox | patch
Permalink /patch/139068/
State Accepted
Commit 0c34e69f57ad94e0ba66ace657eda2fb80bc5847
Delegated to: Albert ARIBAUD
Headers show

Comments

Rob Herring - Feb. 2, 2012, 2:57 a.m.
From: Rob Herring <rob.herring@calxeda.com>

Implement reset for highbank platform. Reset is triggered via a wfi
instruction, so enabling armv7 for the compiler is necessary.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/cpu/armv7/highbank/config.mk |    1 +
 board/highbank/highbank.c             |    8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/highbank/config.mk

Patch

diff --git a/arch/arm/cpu/armv7/highbank/config.mk b/arch/arm/cpu/armv7/highbank/config.mk
new file mode 100644
index 0000000..935a147
--- /dev/null
+++ b/arch/arm/cpu/armv7/highbank/config.mk
@@ -0,0 +1 @@ 
+PLATFORM_CPPFLAGS += -march=armv7-a
diff --git a/board/highbank/highbank.c b/board/highbank/highbank.c
index 2de0091..b771cc8 100644
--- a/board/highbank/highbank.c
+++ b/board/highbank/highbank.c
@@ -22,6 +22,12 @@ 
 #include <asm/sizes.h>
 #include <asm/io.h>
 
+#define HB_SREG_A9_PWR_REQ		0xfff3cf00
+#define HB_PWR_SUSPEND			0
+#define HB_PWR_SOFT_RESET		1
+#define HB_PWR_HARD_RESET		2
+#define HB_PWR_SHUTDOWN			3
+
 DECLARE_GLOBAL_DATA_PTR;
 
 /*
@@ -67,4 +73,6 @@  void dram_init_banksize(void)
 
 void reset_cpu(ulong addr)
 {
+	writel(HB_PWR_HARD_RESET, HB_SREG_A9_PWR_REQ);
+	asm("	wfi");
 }