diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-04-29 21:13:14 +0000 |
---|---|---|
committer | <ralf@linux-mips.org> | 1997-04-29 21:13:14 +0000 |
commit | 19c9bba94152148523ba0f7ef7cffe3d45656b11 (patch) | |
tree | 40b1cb534496a7f1ca0f5c314a523c69f1fee464 /arch/sparc/kernel/auxio.c | |
parent | 7206675c40394c78a90e74812bbdbf8cf3cca1be (diff) |
Import of Linux/MIPS 2.1.36
Diffstat (limited to 'arch/sparc/kernel/auxio.c')
-rw-r--r-- | arch/sparc/kernel/auxio.c | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/arch/sparc/kernel/auxio.c b/arch/sparc/kernel/auxio.c index cd1fcca02..5835347d1 100644 --- a/arch/sparc/kernel/auxio.c +++ b/arch/sparc/kernel/auxio.c @@ -3,6 +3,8 @@ * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) */ +#include <linux/stddef.h> +#include <linux/init.h> #include <asm/oplib.h> #include <asm/io.h> #include <asm/auxio.h> @@ -10,8 +12,7 @@ /* Probe and map in the Auxiliary I/O register */ unsigned char *auxio_register; -void -auxio_probe(void) +__initfunc(void auxio_probe(void)) { int node, auxio_nd; struct linux_prom_registers auxregs[1]; @@ -27,6 +28,11 @@ auxio_probe(void) node = prom_getchild(node); auxio_nd = prom_searchsiblings(node, "auxio"); if(!auxio_nd) { + if(prom_searchsiblings(node, "leds")) { + /* VME chassis sun4m machine, no auxio exists. */ + auxio_register = 0; + return; + } prom_printf("Cannot find auxio node, cannot continue...\n"); prom_halt(); } @@ -45,3 +51,33 @@ auxio_probe(void) TURN_ON_LED; } + + +/* sun4m power control register (AUXIO2) */ + +volatile unsigned char * auxio_power_register = NULL; + +__initfunc(void auxio_power_probe(void)) +{ + struct linux_prom_registers regs; + int node; + + /* Attempt to find the sun4m power control node. */ + node = prom_getchild(prom_root_node); + node = prom_searchsiblings(node, "obio"); + node = prom_getchild(node); + node = prom_searchsiblings(node, "power"); + if (node == 0 || node == -1) + return; + + /* Map the power control register. */ + prom_getproperty(node, "reg", (char *)®s, sizeof(regs)); + prom_apply_obio_ranges(®s, 1); + auxio_power_register = (volatile unsigned char *) + sparc_alloc_io(regs.phys_addr, 0, regs.reg_size, + "power off control", regs.which_io, 0); + + /* Display a quick message on the console. */ + if (auxio_power_register) + printk(KERN_INFO "Power off control detected.\n"); +} |