1 /* auxio.c: Probing for the Sparc AUXIO register at boot time.
3 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
6 #include <linux/config.h>
7 #include <linux/stddef.h>
8 #include <linux/kernel.h>
9 #include <linux/sched.h>
10 #include <linux/smp.h>
11 #include <linux/init.h>
12 #include <linux/delay.h>
13 #include <linux/ioport.h>
15 #include <asm/oplib.h>
17 #include <asm/auxio.h>
22 /* Probe and map in the Auxiliary I/O register */
23 unsigned char *auxio_register
;
25 void __init
auxio_probe(void)
27 struct linux_sbus
*bus
;
28 struct linux_sbus_device
*sdev
= 0;
29 struct linux_prom_registers auxregs
[1];
32 for_each_sbusdev(sdev
, bus
) {
33 if(!strcmp(sdev
->prom_name
, "auxio")) {
41 struct linux_ebus
*ebus
;
42 struct linux_ebus_device
*edev
= 0;
43 unsigned long led_auxio
;
46 for_each_ebusdev(edev
, ebus
) {
47 if (!strcmp(edev
->prom_name
, "auxio"))
54 led_auxio
= edev
->resource
[0].start
;
55 outl(0x01, led_auxio
);
60 auxio_register
= NULL
;
63 prom_printf("Cannot find auxio node, cannot continue...\n");
67 prom_getproperty(sdev
->prom_node
, "reg", (char *) auxregs
, sizeof(auxregs
));
68 prom_apply_sbus_ranges(sdev
->my_bus
, auxregs
, 0x1, sdev
);
69 /* Map the register both read and write */
70 auxio_register
= (unsigned char *) sparc_alloc_io(auxregs
[0].phys_addr
, 0,
73 auxregs
[0].which_io
, 0x0);