root/include/asm-sparc/sbus.h

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

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. sbus_devaddr
  2. sbus_dev_slot
  3. sbus_dev_offset

   1 /* sbus.h:  Defines for the Sun SBus.
   2  *
   3  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
   4  */
   5 
   6 #ifndef _SPARC_SBUS_H
   7 #define _SPARC_SBUS_H
   8 
   9 #include <asm/openprom.h>  /* For linux_prom_registers and linux_prom_irqs */
  10 
  11 /* We scan which devices are on the SBus using the PROM node device
  12  * tree.  SBus devices are described in two different ways.  You can
  13  * either get an absolute address at which to access the device, or
  14  * you can get a SBus 'slot' number and an offset within that slot.
  15  */
  16 
  17 /* The base address at which to calculate device OBIO addresses. */
  18 #define SUN_SBUS_BVADDR        0xf8000000
  19 #define SBUS_OFF_MASK          0x01ffffff
  20 
  21 /* These routines are used to calculate device address from slot
  22  * numbers + offsets, and vice versa.
  23  */
  24 
  25 extern inline unsigned long sbus_devaddr(int slotnum, unsigned long offset)
     /* [previous][next][first][last][top][bottom][index][help] */
  26 {
  27   return (unsigned long) (SUN_SBUS_BVADDR+((slotnum)<<25)+(offset));
  28 }
  29 
  30 extern inline int sbus_dev_slot(unsigned long dev_addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  31 {
  32   return (int) (((dev_addr)-SUN_SBUS_BVADDR)>>25);
  33 }
  34 
  35 extern inline unsigned long sbus_dev_offset(unsigned long dev_addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  36 {
  37   return (unsigned long) (((dev_addr)-SUN_SBUS_BVADDR)&SBUS_OFF_MASK);
  38 }
  39 
  40 /* Handy macro */
  41 #define STRUCT_ALIGN(addr) ((addr+7)&(~7))
  42 
  43 /* Linus SBUS device tables */
  44 struct linux_sbus_device {
  45   struct linux_sbus_device *next;      /* next device on this SBus or null */
  46   int prom_node;                       /* PROM device tree node for this device */
  47   char *prom_name;                     /* PROM device name */
  48   char *linux_name;                    /* Name used internally by Linux */
  49 
  50   /* device register addresses */
  51   struct linux_prom_registers reg_addrs[PROMREG_MAX];
  52   int num_registers;
  53 
  54   /* List of IRQ's this device uses. */
  55   struct linux_prom_irqs irqs[PROMINTR_MAX];
  56   int num_irqs;
  57 
  58   unsigned long sbus_addr;             /* Absolute base address for device. */
  59   unsigned long sbus_vaddrs[PROMVADDR_MAX];
  60   unsigned long num_vaddrs;
  61   unsigned long offset;                /* Offset given by PROM */
  62   int slot;                            /* Device slot number */
  63 };
  64 
  65 /* This struct describes the SBus-es found on this machine. */
  66 struct linux_sbus {
  67   struct linux_sbus *next;             /* next SBus, if more than one SBus */
  68   struct linux_sbus_device *devices;   /* Link to devices on this SBus */
  69   int prom_node;                       /* PROM device tree node for this SBus */
  70   char *prom_name;                     /* Usually "sbus" */
  71   int clock_freq;                 /* Speed of this SBus */
  72 };
  73 
  74 extern struct linux_sbus Linux_SBus;
  75 
  76 #endif /* !(_SPARC_SBUS_H) */

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