public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: "Sangmoon Kim" <dogoil@etinsys•com>
To: <linuxppc-dev@ozlabs•org>
Subject: RE: [PATCH] kvme080 board support patch
Date: Mon, 15 Jan 2007 15:04:05 +0900	[thread overview]
Message-ID: <200701150604.l0F64SWL006151@jupiter.etinsys.com> (raw)
In-Reply-To: <200701150531.l0F5VWXJ004760@jupiter.etinsys.com>

Hi,

Please drop the last patch for kvme080 and aply this one.
I corrected some mistakes
This patch makes kvme080 board use hardware watchdog timer to restart.
This is an incremental patch of
http://patchwork.ozlabs.org/linuxppc/patch?id=8898
and http://patchwork.ozlabs.org/linuxppc/patch?id=8937.

Regards,
Sangmoon Kim

Signed-off-by: Sangmoon Kim <dogoil@etinsys•com>

diff --git a/arch/powerpc/boot/dts/kvme080.dts
b/arch/powerpc/boot/dts/kvme080.dts
index 8628421..6c02f2d 100644
--- a/arch/powerpc/boot/dts/kvme080.dts
+++ b/arch/powerpc/boot/dts/kvme080.dts
@@ -162,6 +162,12 @@
 		reg = <ff000000 7fff0>;
 	};
 
+	watchdog@ff07fff7 {
+		device_type = "watchdog";
+		compatible = "ds155x_wdt";
+		reg = <ff07fff7 1>;
+	};
+
 	rtc@ff07fff8 {
 		device_type = "rtc";
 		reg = <ff07fff8 8>;
diff --git a/arch/powerpc/platforms/embedded6xx/kvme080.c
b/arch/powerpc/platforms/embedded6xx/kvme080.c
index 8da3464..2e6feec 100644
--- a/arch/powerpc/platforms/embedded6xx/kvme080.c
+++ b/arch/powerpc/platforms/embedded6xx/kvme080.c
@@ -23,6 +23,7 @@ #include <asm/mpic.h>
 
 static unsigned char *nvram_base = (unsigned char *)NULL;
 static ssize_t nvram_size = 0;
+static unsigned char *watchdog_base = (unsigned char *)NULL;
 
 static int __init
 kvme080_probe(void)
@@ -96,6 +97,15 @@ #endif
 		}
 	}
 
+	dnp = of_find_compatible_node(NULL, "watchdog", "ds155x_wdt");
+	if (dnp) {
+		prop = of_get_address(dnp, 0, &size, NULL);
+		paddr = (phys_addr_t)of_translate_address(dnp, prop);
+		if (paddr != (phys_addr_t)OF_BAD_ADDR) {
+			watchdog_base = ioremap(paddr, (ssize_t)size);
+		}
+	}
+
 	printk(KERN_INFO "Etin Systems KVME080 Board\n");
 	printk(KERN_INFO "Port by Sangmoon Kim (dogoil@etinsys•com)\n");
 }
@@ -131,9 +141,10 @@ static void
 kvme080_restart(char *cmd)
 {
 	local_irq_disable();
-	mtspr(SPRN_SRR0, 0xfff00100);
-	mtspr(SPRN_SRR1, 0x00000000);
-	asm volatile("rfi");
+	if (watchdog_base)
+		writeb(0x84, watchdog_base);
+	for(;;);
+	/* NOTREACHED */
 }
 
 static void

      reply	other threads:[~2007-01-15  6:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-11  6:26 [PATCH] kvme080 board support patch Sangmoon Kim
2007-01-11 14:21 ` Kumar Gala
2007-01-12  1:45   ` Sangmoon Kim
2007-01-15  5:31     ` Sangmoon Kim
2007-01-15  6:04       ` Sangmoon Kim [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200701150604.l0F64SWL006151@jupiter.etinsys.com \
    --to=dogoil@etinsys$(echo .)com \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox