Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
sbus.c File Reference
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/export.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <asm/page.h>
#include <asm/io.h>
#include <asm/upa.h>
#include <asm/cache.h>
#include <asm/dma.h>
#include <asm/irq.h>
#include <asm/prom.h>
#include <asm/oplib.h>
#include <asm/starfire.h>
#include "iommu_common.h"

Go to the source code of this file.

Macros

#define MAP_BASE   ((u32)0xc0000000)
 
#define SYSIO_IOMMUREG_BASE   0x2400UL
 
#define IOMMU_CONTROL   (0x2400UL - 0x2400UL) /* IOMMU control register */
 
#define IOMMU_TSBBASE   (0x2408UL - 0x2400UL) /* TSB base address register */
 
#define IOMMU_FLUSH   (0x2410UL - 0x2400UL) /* IOMMU flush register */
 
#define IOMMU_VADIAG   (0x4400UL - 0x2400UL) /* SBUS virtual address diagnostic */
 
#define IOMMU_TAGCMP   (0x4408UL - 0x2400UL) /* TLB tag compare diagnostics */
 
#define IOMMU_LRUDIAG   (0x4500UL - 0x2400UL) /* IOMMU LRU queue diagnostics */
 
#define IOMMU_TAGDIAG   (0x4580UL - 0x2400UL) /* TLB tag diagnostics */
 
#define IOMMU_DRAMDIAG   (0x4600UL - 0x2400UL) /* TLB data RAM diagnostics */
 
#define IOMMU_DRAM_VALID   (1UL << 30UL)
 
#define SYSIO_STRBUFREG_BASE   0x2800UL
 
#define STRBUF_CONTROL   (0x2800UL - 0x2800UL) /* Control */
 
#define STRBUF_PFLUSH   (0x2808UL - 0x2800UL) /* Page flush/invalidate */
 
#define STRBUF_FSYNC   (0x2810UL - 0x2800UL) /* Flush synchronization */
 
#define STRBUF_DRAMDIAG   (0x5000UL - 0x2800UL) /* data RAM diagnostic */
 
#define STRBUF_ERRDIAG   (0x5400UL - 0x2800UL) /* error status diagnostics */
 
#define STRBUF_PTAGDIAG   (0x5800UL - 0x2800UL) /* Page tag diagnostics */
 
#define STRBUF_LTAGDIAG   (0x5900UL - 0x2800UL) /* Line tag diagnostics */
 
#define STRBUF_TAG_VALID   0x02UL
 
#define SYSIO_IMAP_SLOT0   0x2c00UL
 
#define SYSIO_IMAP_SLOT1   0x2c08UL
 
#define SYSIO_IMAP_SLOT2   0x2c10UL
 
#define SYSIO_IMAP_SLOT3   0x2c18UL
 
#define SYSIO_IMAP_SCSI   0x3000UL
 
#define SYSIO_IMAP_ETH   0x3008UL
 
#define SYSIO_IMAP_BPP   0x3010UL
 
#define SYSIO_IMAP_AUDIO   0x3018UL
 
#define SYSIO_IMAP_PFAIL   0x3020UL
 
#define SYSIO_IMAP_KMS   0x3028UL
 
#define SYSIO_IMAP_FLPY   0x3030UL
 
#define SYSIO_IMAP_SHW   0x3038UL
 
#define SYSIO_IMAP_KBD   0x3040UL
 
#define SYSIO_IMAP_MS   0x3048UL
 
#define SYSIO_IMAP_SER   0x3050UL
 
#define SYSIO_IMAP_TIM0   0x3060UL
 
#define SYSIO_IMAP_TIM1   0x3068UL
 
#define SYSIO_IMAP_UE   0x3070UL
 
#define SYSIO_IMAP_CE   0x3078UL
 
#define SYSIO_IMAP_SBERR   0x3080UL
 
#define SYSIO_IMAP_PMGMT   0x3088UL
 
#define SYSIO_IMAP_GFX   0x3090UL
 
#define SYSIO_IMAP_EUPA   0x3098UL
 
#define bogon   ((unsigned long) -1)
 
#define NUM_SYSIO_OFFSETS   ARRAY_SIZE(sysio_irq_offsets)
 
#define SYSIO_ICLR_UNUSED0   0x3400UL
 
#define SYSIO_ICLR_SLOT0   0x3408UL
 
#define SYSIO_ICLR_SLOT1   0x3448UL
 
#define SYSIO_ICLR_SLOT2   0x3488UL
 
#define SYSIO_ICLR_SLOT3   0x34c8UL
 
#define SYSIO_UE_AFSR   0x0030UL
 
#define SYSIO_UE_AFAR   0x0038UL
 
#define SYSIO_UEAFSR_PPIO   0x8000000000000000UL /* Primary PIO cause */
 
#define SYSIO_UEAFSR_PDRD   0x4000000000000000UL /* Primary DVMA read cause */
 
#define SYSIO_UEAFSR_PDWR   0x2000000000000000UL /* Primary DVMA write cause */
 
#define SYSIO_UEAFSR_SPIO   0x1000000000000000UL /* Secondary PIO is cause */
 
#define SYSIO_UEAFSR_SDRD   0x0800000000000000UL /* Secondary DVMA read cause */
 
#define SYSIO_UEAFSR_SDWR   0x0400000000000000UL /* Secondary DVMA write cause*/
 
#define SYSIO_UEAFSR_RESV1   0x03ff000000000000UL /* Reserved */
 
#define SYSIO_UEAFSR_DOFF   0x0000e00000000000UL /* Doubleword Offset */
 
#define SYSIO_UEAFSR_SIZE   0x00001c0000000000UL /* Bad transfer size 2^SIZE */
 
#define SYSIO_UEAFSR_MID   0x000003e000000000UL /* UPA MID causing the fault */
 
#define SYSIO_UEAFSR_RESV2   0x0000001fffffffffUL /* Reserved */
 
#define SYSIO_CE_AFSR   0x0040UL
 
#define SYSIO_CE_AFAR   0x0048UL
 
#define SYSIO_CEAFSR_PPIO   0x8000000000000000UL /* Primary PIO cause */
 
#define SYSIO_CEAFSR_PDRD   0x4000000000000000UL /* Primary DVMA read cause */
 
#define SYSIO_CEAFSR_PDWR   0x2000000000000000UL /* Primary DVMA write cause */
 
#define SYSIO_CEAFSR_SPIO   0x1000000000000000UL /* Secondary PIO cause */
 
#define SYSIO_CEAFSR_SDRD   0x0800000000000000UL /* Secondary DVMA read cause */
 
#define SYSIO_CEAFSR_SDWR   0x0400000000000000UL /* Secondary DVMA write cause*/
 
#define SYSIO_CEAFSR_RESV1   0x0300000000000000UL /* Reserved */
 
#define SYSIO_CEAFSR_ESYND   0x00ff000000000000UL /* Syndrome Bits */
 
#define SYSIO_CEAFSR_DOFF   0x0000e00000000000UL /* Double Offset */
 
#define SYSIO_CEAFSR_SIZE   0x00001c0000000000UL /* Bad transfer size 2^SIZE */
 
#define SYSIO_CEAFSR_MID   0x000003e000000000UL /* UPA MID causing the fault */
 
#define SYSIO_CEAFSR_RESV2   0x0000001fffffffffUL /* Reserved */
 
#define SYSIO_SBUS_AFSR   0x2010UL
 
#define SYSIO_SBUS_AFAR   0x2018UL
 
#define SYSIO_SBAFSR_PLE   0x8000000000000000UL /* Primary Late PIO Error */
 
#define SYSIO_SBAFSR_PTO   0x4000000000000000UL /* Primary SBUS Timeout */
 
#define SYSIO_SBAFSR_PBERR   0x2000000000000000UL /* Primary SBUS Error ACK */
 
#define SYSIO_SBAFSR_SLE   0x1000000000000000UL /* Secondary Late PIO Error */
 
#define SYSIO_SBAFSR_STO   0x0800000000000000UL /* Secondary SBUS Timeout */
 
#define SYSIO_SBAFSR_SBERR   0x0400000000000000UL /* Secondary SBUS Error ACK */
 
#define SYSIO_SBAFSR_RESV1   0x03ff000000000000UL /* Reserved */
 
#define SYSIO_SBAFSR_RD   0x0000800000000000UL /* Primary was late PIO read */
 
#define SYSIO_SBAFSR_RESV2   0x0000600000000000UL /* Reserved */
 
#define SYSIO_SBAFSR_SIZE   0x00001c0000000000UL /* Size of transfer */
 
#define SYSIO_SBAFSR_MID   0x000003e000000000UL /* MID causing the error */
 
#define SYSIO_SBAFSR_RESV3   0x0000001fffffffffUL /* Reserved */
 
#define ECC_CONTROL   0x0020UL
 
#define SYSIO_ECNTRL_ECCEN   0x8000000000000000UL /* Enable ECC Checking */
 
#define SYSIO_ECNTRL_UEEN   0x4000000000000000UL /* Enable UE Interrupts */
 
#define SYSIO_ECNTRL_CEEN   0x2000000000000000UL /* Enable CE Interrupts */
 
#define SYSIO_UE_INO   0x34
 
#define SYSIO_CE_INO   0x35
 
#define SYSIO_SBUSERR_INO   0x36
 

Functions

void sbus_set_sbus64 (struct device *dev, int bursts)
 
 EXPORT_SYMBOL (sbus_set_sbus64)
 
 subsys_initcall (sbus_init)
 

Macro Definition Documentation

#define bogon   ((unsigned long) -1)

Definition at line 151 of file sbus.c.

#define ECC_CONTROL   0x0020UL

Definition at line 483 of file sbus.c.

#define IOMMU_CONTROL   (0x2400UL - 0x2400UL) /* IOMMU control register */

Definition at line 34 of file sbus.c.

#define IOMMU_DRAM_VALID   (1UL << 30UL)

Definition at line 43 of file sbus.c.

#define IOMMU_DRAMDIAG   (0x4600UL - 0x2400UL) /* TLB data RAM diagnostics */

Definition at line 41 of file sbus.c.

#define IOMMU_FLUSH   (0x2410UL - 0x2400UL) /* IOMMU flush register */

Definition at line 36 of file sbus.c.

#define IOMMU_LRUDIAG   (0x4500UL - 0x2400UL) /* IOMMU LRU queue diagnostics */

Definition at line 39 of file sbus.c.

#define IOMMU_TAGCMP   (0x4408UL - 0x2400UL) /* TLB tag compare diagnostics */

Definition at line 38 of file sbus.c.

#define IOMMU_TAGDIAG   (0x4580UL - 0x2400UL) /* TLB tag diagnostics */

Definition at line 40 of file sbus.c.

#define IOMMU_TSBBASE   (0x2408UL - 0x2400UL) /* TSB base address register */

Definition at line 35 of file sbus.c.

#define IOMMU_VADIAG   (0x4400UL - 0x2400UL) /* SBUS virtual address diagnostic */

Definition at line 37 of file sbus.c.

#define MAP_BASE   ((u32)0xc0000000)

Definition at line 30 of file sbus.c.

#define NUM_SYSIO_OFFSETS   ARRAY_SIZE(sysio_irq_offsets)

Definition at line 192 of file sbus.c.

#define STRBUF_CONTROL   (0x2800UL - 0x2800UL) /* Control */

Definition at line 47 of file sbus.c.

#define STRBUF_DRAMDIAG   (0x5000UL - 0x2800UL) /* data RAM diagnostic */

Definition at line 50 of file sbus.c.

#define STRBUF_ERRDIAG   (0x5400UL - 0x2800UL) /* error status diagnostics */

Definition at line 51 of file sbus.c.

#define STRBUF_FSYNC   (0x2810UL - 0x2800UL) /* Flush synchronization */

Definition at line 49 of file sbus.c.

#define STRBUF_LTAGDIAG   (0x5900UL - 0x2800UL) /* Line tag diagnostics */

Definition at line 53 of file sbus.c.

#define STRBUF_PFLUSH   (0x2808UL - 0x2800UL) /* Page flush/invalidate */

Definition at line 48 of file sbus.c.

#define STRBUF_PTAGDIAG   (0x5800UL - 0x2800UL) /* Page tag diagnostics */

Definition at line 52 of file sbus.c.

#define STRBUF_TAG_VALID   0x02UL

Definition at line 55 of file sbus.c.

#define SYSIO_CE_AFAR   0x0048UL

Definition at line 330 of file sbus.c.

#define SYSIO_CE_AFSR   0x0040UL

Definition at line 329 of file sbus.c.

#define SYSIO_CE_INO   0x35

Definition at line 489 of file sbus.c.

#define SYSIO_CEAFSR_DOFF   0x0000e00000000000UL /* Double Offset */

Definition at line 339 of file sbus.c.

#define SYSIO_CEAFSR_ESYND   0x00ff000000000000UL /* Syndrome Bits */

Definition at line 338 of file sbus.c.

#define SYSIO_CEAFSR_MID   0x000003e000000000UL /* UPA MID causing the fault */

Definition at line 341 of file sbus.c.

#define SYSIO_CEAFSR_PDRD   0x4000000000000000UL /* Primary DVMA read cause */

Definition at line 332 of file sbus.c.

#define SYSIO_CEAFSR_PDWR   0x2000000000000000UL /* Primary DVMA write cause */

Definition at line 333 of file sbus.c.

#define SYSIO_CEAFSR_PPIO   0x8000000000000000UL /* Primary PIO cause */

Definition at line 331 of file sbus.c.

#define SYSIO_CEAFSR_RESV1   0x0300000000000000UL /* Reserved */

Definition at line 337 of file sbus.c.

#define SYSIO_CEAFSR_RESV2   0x0000001fffffffffUL /* Reserved */

Definition at line 342 of file sbus.c.

#define SYSIO_CEAFSR_SDRD   0x0800000000000000UL /* Secondary DVMA read cause */

Definition at line 335 of file sbus.c.

#define SYSIO_CEAFSR_SDWR   0x0400000000000000UL /* Secondary DVMA write cause*/

Definition at line 336 of file sbus.c.

#define SYSIO_CEAFSR_SIZE   0x00001c0000000000UL /* Bad transfer size 2^SIZE */

Definition at line 340 of file sbus.c.

#define SYSIO_CEAFSR_SPIO   0x1000000000000000UL /* Secondary PIO cause */

Definition at line 334 of file sbus.c.

#define SYSIO_ECNTRL_CEEN   0x2000000000000000UL /* Enable CE Interrupts */

Definition at line 486 of file sbus.c.

#define SYSIO_ECNTRL_ECCEN   0x8000000000000000UL /* Enable ECC Checking */

Definition at line 484 of file sbus.c.

#define SYSIO_ECNTRL_UEEN   0x4000000000000000UL /* Enable UE Interrupts */

Definition at line 485 of file sbus.c.

#define SYSIO_ICLR_SLOT0   0x3408UL

Definition at line 198 of file sbus.c.

#define SYSIO_ICLR_SLOT1   0x3448UL

Definition at line 199 of file sbus.c.

#define SYSIO_ICLR_SLOT2   0x3488UL

Definition at line 200 of file sbus.c.

#define SYSIO_ICLR_SLOT3   0x34c8UL

Definition at line 201 of file sbus.c.

#define SYSIO_ICLR_UNUSED0   0x3400UL

Definition at line 197 of file sbus.c.

#define SYSIO_IMAP_AUDIO   0x3018UL

Definition at line 134 of file sbus.c.

#define SYSIO_IMAP_BPP   0x3010UL

Definition at line 133 of file sbus.c.

#define SYSIO_IMAP_CE   0x3078UL

Definition at line 145 of file sbus.c.

#define SYSIO_IMAP_ETH   0x3008UL

Definition at line 132 of file sbus.c.

#define SYSIO_IMAP_EUPA   0x3098UL

Definition at line 149 of file sbus.c.

#define SYSIO_IMAP_FLPY   0x3030UL

Definition at line 137 of file sbus.c.

#define SYSIO_IMAP_GFX   0x3090UL

Definition at line 148 of file sbus.c.

#define SYSIO_IMAP_KBD   0x3040UL

Definition at line 139 of file sbus.c.

#define SYSIO_IMAP_KMS   0x3028UL

Definition at line 136 of file sbus.c.

#define SYSIO_IMAP_MS   0x3048UL

Definition at line 140 of file sbus.c.

#define SYSIO_IMAP_PFAIL   0x3020UL

Definition at line 135 of file sbus.c.

#define SYSIO_IMAP_PMGMT   0x3088UL

Definition at line 147 of file sbus.c.

#define SYSIO_IMAP_SBERR   0x3080UL

Definition at line 146 of file sbus.c.

#define SYSIO_IMAP_SCSI   0x3000UL

Definition at line 131 of file sbus.c.

#define SYSIO_IMAP_SER   0x3050UL

Definition at line 141 of file sbus.c.

#define SYSIO_IMAP_SHW   0x3038UL

Definition at line 138 of file sbus.c.

#define SYSIO_IMAP_SLOT0   0x2c00UL

Definition at line 127 of file sbus.c.

#define SYSIO_IMAP_SLOT1   0x2c08UL

Definition at line 128 of file sbus.c.

#define SYSIO_IMAP_SLOT2   0x2c10UL

Definition at line 129 of file sbus.c.

#define SYSIO_IMAP_SLOT3   0x2c18UL

Definition at line 130 of file sbus.c.

#define SYSIO_IMAP_TIM0   0x3060UL

Definition at line 142 of file sbus.c.

#define SYSIO_IMAP_TIM1   0x3068UL

Definition at line 143 of file sbus.c.

#define SYSIO_IMAP_UE   0x3070UL

Definition at line 144 of file sbus.c.

#define SYSIO_IOMMUREG_BASE   0x2400UL

Definition at line 33 of file sbus.c.

#define SYSIO_SBAFSR_MID   0x000003e000000000UL /* MID causing the error */

Definition at line 420 of file sbus.c.

#define SYSIO_SBAFSR_PBERR   0x2000000000000000UL /* Primary SBUS Error ACK */

Definition at line 412 of file sbus.c.

#define SYSIO_SBAFSR_PLE   0x8000000000000000UL /* Primary Late PIO Error */

Definition at line 410 of file sbus.c.

#define SYSIO_SBAFSR_PTO   0x4000000000000000UL /* Primary SBUS Timeout */

Definition at line 411 of file sbus.c.

#define SYSIO_SBAFSR_RD   0x0000800000000000UL /* Primary was late PIO read */

Definition at line 417 of file sbus.c.

#define SYSIO_SBAFSR_RESV1   0x03ff000000000000UL /* Reserved */

Definition at line 416 of file sbus.c.

#define SYSIO_SBAFSR_RESV2   0x0000600000000000UL /* Reserved */

Definition at line 418 of file sbus.c.

#define SYSIO_SBAFSR_RESV3   0x0000001fffffffffUL /* Reserved */

Definition at line 421 of file sbus.c.

#define SYSIO_SBAFSR_SBERR   0x0400000000000000UL /* Secondary SBUS Error ACK */

Definition at line 415 of file sbus.c.

#define SYSIO_SBAFSR_SIZE   0x00001c0000000000UL /* Size of transfer */

Definition at line 419 of file sbus.c.

#define SYSIO_SBAFSR_SLE   0x1000000000000000UL /* Secondary Late PIO Error */

Definition at line 413 of file sbus.c.

#define SYSIO_SBAFSR_STO   0x0800000000000000UL /* Secondary SBUS Timeout */

Definition at line 414 of file sbus.c.

#define SYSIO_SBUS_AFAR   0x2018UL

Definition at line 409 of file sbus.c.

#define SYSIO_SBUS_AFSR   0x2010UL

Definition at line 408 of file sbus.c.

#define SYSIO_SBUSERR_INO   0x36

Definition at line 490 of file sbus.c.

#define SYSIO_STRBUFREG_BASE   0x2800UL

Definition at line 46 of file sbus.c.

#define SYSIO_UE_AFAR   0x0038UL

Definition at line 257 of file sbus.c.

#define SYSIO_UE_AFSR   0x0030UL

Definition at line 256 of file sbus.c.

#define SYSIO_UE_INO   0x34

Definition at line 488 of file sbus.c.

#define SYSIO_UEAFSR_DOFF   0x0000e00000000000UL /* Doubleword Offset */

Definition at line 265 of file sbus.c.

#define SYSIO_UEAFSR_MID   0x000003e000000000UL /* UPA MID causing the fault */

Definition at line 267 of file sbus.c.

#define SYSIO_UEAFSR_PDRD   0x4000000000000000UL /* Primary DVMA read cause */

Definition at line 259 of file sbus.c.

#define SYSIO_UEAFSR_PDWR   0x2000000000000000UL /* Primary DVMA write cause */

Definition at line 260 of file sbus.c.

#define SYSIO_UEAFSR_PPIO   0x8000000000000000UL /* Primary PIO cause */

Definition at line 258 of file sbus.c.

#define SYSIO_UEAFSR_RESV1   0x03ff000000000000UL /* Reserved */

Definition at line 264 of file sbus.c.

#define SYSIO_UEAFSR_RESV2   0x0000001fffffffffUL /* Reserved */

Definition at line 268 of file sbus.c.

#define SYSIO_UEAFSR_SDRD   0x0800000000000000UL /* Secondary DVMA read cause */

Definition at line 262 of file sbus.c.

#define SYSIO_UEAFSR_SDWR   0x0400000000000000UL /* Secondary DVMA write cause*/

Definition at line 263 of file sbus.c.

#define SYSIO_UEAFSR_SIZE   0x00001c0000000000UL /* Bad transfer size 2^SIZE */

Definition at line 266 of file sbus.c.

#define SYSIO_UEAFSR_SPIO   0x1000000000000000UL /* Secondary PIO is cause */

Definition at line 261 of file sbus.c.

Function Documentation

EXPORT_SYMBOL ( sbus_set_sbus64  )
void sbus_set_sbus64 ( struct device dev,
int  bursts 
)

Definition at line 58 of file sbus.c.

subsys_initcall ( sbus_init  )