linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: ppopov@linux-mips.org
Date: Sat, 19 Mar 2005 07:17:58 +0000
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ppopov@ftp.linux-mips.org       05/03/19 07:17:52

Modified files:
        arch/mips/au1000/common: Tag: linux_2_4 reset.c 
        arch/mips/au1000/db1x00: Tag: linux_2_4 board_setup.c 
        arch/mips/au1000/ficmmp: Tag: linux_2_4 board_setup.c 
        arch/mips/au1000/hydrogen3: Tag: linux_2_4 board_setup.c 
        arch/mips/au1000/pb1000: Tag: linux_2_4 board_setup.c 
        arch/mips/au1000/pb1100: Tag: linux_2_4 board_setup.c 
        arch/mips/au1000/pb1200: Tag: linux_2_4 board_setup.c 
        arch/mips/au1000/pb1500: Tag: linux_2_4 board_setup.c 
        arch/mips/au1000/pb1550: Tag: linux_2_4 board_setup.c 

Log message:
        power off cleanups.

diff -urN linux/arch/mips/au1000/common/reset.c 
linux/arch/mips/au1000/common/reset.c
--- linux/arch/mips/au1000/common/reset.c       2005/02/27 22:11:54     1.2.2.14
+++ linux/arch/mips/au1000/common/reset.c       2005/03/19 07:17:51     1.2.2.15
@@ -37,8 +37,6 @@
 #include <asm/system.h>
 #include <asm/au1000.h>
 
-extern int au_sleep(void);
-
 void au1000_restart(char *command)
 {
        /* Set all integrated peripherals to disabled states */
@@ -183,32 +181,23 @@
 
 void au1000_halt(void)
 {
-#if defined(CONFIG_MIPS_PB1550)
-       /* power off system */
-       printk("\n** Powering off Pb1550\n");
-       au_writew(au_readw(0xAF00001C) | (3<<14), 0xAF00001C); 
-       au_sync();
-       while(1); /* should not get here */
-#endif
-       printk(KERN_NOTICE "\n** You can safely turn off the power\n");
-#ifdef CONFIG_MIPS_MIRAGE
-       au_writel((1 << 26) | (1 << 10), GPIO2_OUTPUT);
-#endif
-#ifdef CONFIG_PM
-       au_sleep();
-
-       /* should not get here */
-       printk(KERN_ERR "Unable to put cpu in sleep mode\n");
-       while(1);
-#else
-       while (1)
+       /* Use WAIT in a low-power infinite spin loop */
+       while (1) {
                __asm__(".set\tmips3\n\t"
                        "wait\n\t"
                        ".set\tmips0");
-#endif
+       }
 }
 
 void au1000_power_off(void)
 {
+       extern void board_power_off (void);
+
+       printk(KERN_NOTICE "\n** You can safely turn off the power\n");
+
+       /* Give board a chance to power-off */
+       board_power_off();
+
+       /* If board can't power-off, spin forever */
        au1000_halt();
 }
diff -urN linux/arch/mips/au1000/db1x00/board_setup.c 
linux/arch/mips/au1000/db1x00/board_setup.c
--- linux/arch/mips/au1000/db1x00/board_setup.c 2005/01/30 08:06:19     1.1.2.6
+++ linux/arch/mips/au1000/db1x00/board_setup.c 2005/03/19 07:17:51     1.1.2.7
@@ -69,6 +69,13 @@
        au_writel(0x00000000, 0xAE00001C);
 }
 
+void board_power_off (void)
+{
+#ifdef CONFIG_MIPS_MIRAGE
+       au_writel((1 << 26) | (1 << 10), GPIO2_OUTPUT);
+#endif
+}
+
 void __init board_setup(void)
 {
        u32 pin_func;
diff -urN linux/arch/mips/au1000/ficmmp/board_setup.c 
linux/arch/mips/au1000/ficmmp/board_setup.c
--- linux/arch/mips/au1000/ficmmp/Attic/board_setup.c   2005/03/13 08:04:16     
1.1.2.2
+++ linux/arch/mips/au1000/ficmmp/Attic/board_setup.c   2005/03/19 07:17:51     
1.1.2.3
@@ -74,6 +74,10 @@
        au_writel(0, 0xAD80001C);
 }
 
+void board_power_off (void)
+{
+}
+
 void __init board_setup(void)
 {
        char *argptr = NULL;
diff -urN linux/arch/mips/au1000/hydrogen3/board_setup.c 
linux/arch/mips/au1000/hydrogen3/board_setup.c
--- linux/arch/mips/au1000/hydrogen3/board_setup.c      2005/01/30 08:07:57     
1.1.2.4
+++ linux/arch/mips/au1000/hydrogen3/board_setup.c      2005/03/19 07:17:51     
1.1.2.5
@@ -51,6 +51,10 @@
 {
 }
 
+void board_power_off (void)
+{
+}
+
 void __init board_setup(void)
 {
        u32 pin_func;
diff -urN linux/arch/mips/au1000/pb1000/board_setup.c 
linux/arch/mips/au1000/pb1000/board_setup.c
--- linux/arch/mips/au1000/pb1000/board_setup.c 2004/07/14 05:43:49     1.1.2.3
+++ linux/arch/mips/au1000/pb1000/board_setup.c 2005/03/19 07:17:51     1.1.2.4
@@ -58,6 +58,10 @@
 {
 }
 
+void board_power_off (void)
+{
+}
+
 void __init board_setup(void)
 {
        u32 pin_func, static_cfg0;
diff -urN linux/arch/mips/au1000/pb1100/board_setup.c 
linux/arch/mips/au1000/pb1100/board_setup.c
--- linux/arch/mips/au1000/pb1100/board_setup.c 2004/07/14 05:43:49     1.1.2.3
+++ linux/arch/mips/au1000/pb1100/board_setup.c 2005/03/19 07:17:51     1.1.2.4
@@ -62,6 +62,10 @@
     au_writel(0x00000000, 0xAE00001C);
 }
 
+void board_power_off (void)
+{
+}
+
 void __init board_setup(void)
 {
        u32 pin_func;
diff -urN linux/arch/mips/au1000/pb1200/board_setup.c 
linux/arch/mips/au1000/pb1200/board_setup.c
--- linux/arch/mips/au1000/pb1200/board_setup.c 2005/03/13 08:04:16     1.1.2.2
+++ linux/arch/mips/au1000/pb1200/board_setup.c 2005/03/19 07:17:51     1.1.2.3
@@ -81,6 +81,11 @@
        bcsr->resets = 0;
 }
 
+void board_power_off (void)
+{
+       bcsr->resets = 0xC000;
+}
+
 void __init board_setup(void)
 {
        char *argptr = NULL;
diff -urN linux/arch/mips/au1000/pb1500/board_setup.c 
linux/arch/mips/au1000/pb1500/board_setup.c
--- linux/arch/mips/au1000/pb1500/board_setup.c 2004/07/14 05:43:49     1.1.2.3
+++ linux/arch/mips/au1000/pb1500/board_setup.c 2005/03/19 07:17:51     1.1.2.4
@@ -62,6 +62,10 @@
     au_writel(0x00000000, 0xAE00001C);
 }
 
+void board_power_off (void)
+{
+}
+
 void __init board_setup(void)
 {
        u32 pin_func;
diff -urN linux/arch/mips/au1000/pb1550/board_setup.c 
linux/arch/mips/au1000/pb1550/board_setup.c
--- linux/arch/mips/au1000/pb1550/board_setup.c 2005/01/30 08:01:28     1.1.2.7
+++ linux/arch/mips/au1000/pb1550/board_setup.c 2005/03/19 07:17:51     1.1.2.8
@@ -64,6 +64,15 @@
        au_writew(au_readw(0xAF00001C) & ~(1<<15), 0xAF00001C);
 }
 
+void board_power_off (void)
+{
+       /* power off system */
+       printk("\n** Powering off Pb1550\n");
+       au_writew(au_readw(0xAF00001C) | (3<<14), 0xAF00001C); 
+       au_sync();
+       while(1); /* should not get here */
+}
+
 void __init board_setup(void)
 {
        u32 pin_func;

<Prev in Thread] Current Thread [Next in Thread>