root/arch/sparc/kernel/auxio.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. auxio_probe

   1 /* auxio.c: Probing for the Sparc AUXIO register at boot time.
   2  *
   3  * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
   4  */
   5 
   6 #include <asm/oplib.h>
   7 #include <asm/io.h>
   8 
   9 /* Probe and map in the Auxiliary I/O register */
  10 unsigned char *auxio_register;
  11 
  12 void
  13 auxio_probe(void)
     /* [previous][next][first][last][top][bottom][index][help] */
  14 {
  15         int node, auxio_nd;
  16         struct linux_prom_registers auxregs[1];
  17 
  18         node = prom_getchild(prom_root_node);
  19         auxio_nd = prom_searchsiblings(node, "auxiliary-io");
  20         if(!auxio_nd) {
  21                 node = prom_searchsiblings(node, "obio");
  22                 node = prom_getchild(node);
  23                 auxio_nd = prom_searchsiblings(node, "auxio");
  24                 if(!auxio_nd) {
  25                         prom_printf("Cannot find auxio node, cannot continue...\n");
  26                         prom_halt();
  27                 }
  28         }
  29         prom_getproperty(auxio_nd, "reg", (char *) auxregs, sizeof(auxregs));
  30         prom_apply_obio_ranges(auxregs, 0x1);
  31         /* Map the register both read and write */
  32         auxio_register = (unsigned char *) sparc_alloc_io(auxregs[0].phys_addr, 0,
  33                                                           auxregs[0].reg_size,
  34                                                           "auxiliaryIO",
  35                                                           auxregs[0].which_io, 0x0);
  36         /* Fix the address on sun4m and sun4c. */
  37         if((((unsigned long) auxregs[0].phys_addr) & 3) == 3 ||
  38            sparc_cpu_model == sun4c)
  39                 auxio_register = (unsigned char *) ((int)auxio_register | 3);
  40 }

/* [previous][next][first][last][top][bottom][index][help] */