Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
c22f5d5b
Commit
c22f5d5b
authored
Jun 17, 2002
by
Michael Weber
Committed by
David S. Miller
Jun 17, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sparc64: Use SUNW,power-off to power off some Ultra systems.
parent
e1dccf46
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
7 deletions
+47
-7
arch/sparc64/kernel/power.c
arch/sparc64/kernel/power.c
+16
-7
arch/sparc64/kernel/process.c
arch/sparc64/kernel/process.c
+15
-0
arch/sparc64/prom/misc.c
arch/sparc64/prom/misc.c
+13
-0
include/asm-sparc64/oplib.h
include/asm-sparc64/oplib.h
+3
-0
No files found.
arch/sparc64/kernel/power.c
View file @
c22f5d5b
...
@@ -34,20 +34,28 @@ static void power_handler(int irq, void *dev_id, struct pt_regs *regs)
...
@@ -34,20 +34,28 @@ static void power_handler(int irq, void *dev_id, struct pt_regs *regs)
#endif
/* CONFIG_PCI */
#endif
/* CONFIG_PCI */
extern
void
machine_halt
(
void
);
extern
void
machine_halt
(
void
);
extern
void
machine_alt_power_off
(
void
);
static
void
(
*
poweroff_method
)(
void
)
=
machine_alt_power_off
;
extern
int
serial_console
;
extern
int
serial_console
;
void
machine_power_off
(
void
)
void
machine_power_off
(
void
)
{
{
if
(
!
serial_console
)
{
#ifdef CONFIG_PCI
#ifdef CONFIG_PCI
if
(
power_reg
!=
0UL
&&
!
serial_console
)
{
if
(
power_reg
!=
0UL
)
{
/* Both register bits seem to have the
/* Both register bits seem to have the
* same effect, so until I figure out
* same effect, so until I figure out
* what the difference is...
* what the difference is...
*/
*/
writel
(
POWER_COURTESY_OFF
|
POWER_SYSTEM_OFF
,
power_reg
);
writel
(
POWER_COURTESY_OFF
|
POWER_SYSTEM_OFF
,
power_reg
);
}
}
else
#endif
/* CONFIG_PCI */
#endif
/* CONFIG_PCI */
if
(
poweroff_method
!=
NULL
)
{
poweroff_method
();
/* not reached */
}
}
machine_halt
();
machine_halt
();
}
}
...
@@ -98,6 +106,7 @@ void __init power_init(void)
...
@@ -98,6 +106,7 @@ void __init power_init(void)
found:
found:
power_reg
=
(
unsigned
long
)
ioremap
(
edev
->
resource
[
0
].
start
,
0x4
);
power_reg
=
(
unsigned
long
)
ioremap
(
edev
->
resource
[
0
].
start
,
0x4
);
printk
(
"power: Control reg at %016lx ... "
,
power_reg
);
printk
(
"power: Control reg at %016lx ... "
,
power_reg
);
poweroff_method
=
machine_halt
;
/* able to use the standard halt */
if
(
edev
->
irqs
[
0
]
!=
PCI_IRQ_NONE
)
{
if
(
edev
->
irqs
[
0
]
!=
PCI_IRQ_NONE
)
{
if
(
kernel_thread
(
powerd
,
0
,
CLONE_FS
)
<
0
)
{
if
(
kernel_thread
(
powerd
,
0
,
CLONE_FS
)
<
0
)
{
printk
(
"Failed to start power daemon.
\n
"
);
printk
(
"Failed to start power daemon.
\n
"
);
...
...
arch/sparc64/kernel/process.c
View file @
c22f5d5b
...
@@ -142,6 +142,21 @@ void machine_halt(void)
...
@@ -142,6 +142,21 @@ void machine_halt(void)
panic
(
"Halt failed!"
);
panic
(
"Halt failed!"
);
}
}
void
machine_alt_power_off
(
void
)
{
sti
();
mdelay
(
8
);
cli
();
#ifdef CONFIG_SUN_CONSOLE
if
(
!
serial_console
&&
prom_palette
)
prom_palette
(
1
);
#endif
if
(
prom_keyboard
)
prom_keyboard
();
prom_halt_power_off
();
panic
(
"Power-off failed!"
);
}
void
machine_restart
(
char
*
cmd
)
void
machine_restart
(
char
*
cmd
)
{
{
char
*
p
;
char
*
p
;
...
...
arch/sparc64/prom/misc.c
View file @
c22f5d5b
...
@@ -97,6 +97,19 @@ prom_halt(void)
...
@@ -97,6 +97,19 @@ prom_halt(void)
goto
again
;
/* PROM is out to get me -DaveM */
goto
again
;
/* PROM is out to get me -DaveM */
}
}
void
prom_halt_power_off
(
void
)
{
#ifdef CONFIG_SMP
smp_promstop_others
();
udelay
(
8000
);
#endif
p1275_cmd
(
"SUNW,power-off"
,
P1275_INOUT
(
0
,
0
));
/* if nothing else helps, we just halt */
prom_halt
();
}
/* Set prom sync handler to call function 'funcp'. */
/* Set prom sync handler to call function 'funcp'. */
void
void
prom_setcallback
(
callback_func_t
funcp
)
prom_setcallback
(
callback_func_t
funcp
)
...
...
include/asm-sparc64/oplib.h
View file @
c22f5d5b
...
@@ -113,6 +113,9 @@ extern void prom_cmdline(void);
...
@@ -113,6 +113,9 @@ extern void prom_cmdline(void);
*/
*/
extern
void
prom_halt
(
void
)
__attribute__
((
noreturn
));
extern
void
prom_halt
(
void
)
__attribute__
((
noreturn
));
/* Halt and power-off the machine. */
extern
void
prom_halt_power_off
(
void
)
__attribute__
((
noreturn
));
/* Set the PROM 'sync' callback function to the passed function pointer.
/* Set the PROM 'sync' callback function to the passed function pointer.
* When the user gives the 'sync' command at the prom prompt while the
* When the user gives the 'sync' command at the prom prompt while the
* kernel is still active, the prom will call this routine.
* kernel is still active, the prom will call this routine.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment