Home | History | Annotate | Line # | Download | only in ioc
      1  1.1  rumble /*	$NetBSD: oiocreg.h,v 1.1 2009/02/10 06:04:56 rumble Exp $	*/
      2  1.1  rumble 
      3  1.1  rumble /*
      4  1.1  rumble  * Copyright (c) 2009 Stephen M. Rumble
      5  1.1  rumble  * All rights reserved.
      6  1.1  rumble  *
      7  1.1  rumble  * Redistribution and use in source and binary forms, with or without
      8  1.1  rumble  * modification, are permitted provided that the following conditions
      9  1.1  rumble  * are met:
     10  1.1  rumble  * 1. Redistributions of source code must retain the above copyright
     11  1.1  rumble  *    notice, this list of conditions and the following disclaimer.
     12  1.1  rumble  * 2. The name of the author may not be used to endorse or promote products
     13  1.1  rumble  *    derived from this software without specific prior written permission.
     14  1.1  rumble  *
     15  1.1  rumble  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     16  1.1  rumble  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     17  1.1  rumble  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     18  1.1  rumble  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     19  1.1  rumble  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     20  1.1  rumble  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     21  1.1  rumble  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     22  1.1  rumble  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     23  1.1  rumble  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     24  1.1  rumble  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     25  1.1  rumble  */
     26  1.1  rumble 
     27  1.1  rumble #ifndef _ARCH_SGIMIPS_DEV_OIOCREG_H_
     28  1.1  rumble #define	_ARCH_SGIMIPS_DEV_OIOCREG_H_
     29  1.1  rumble 
     30  1.1  rumble /* Registers below are relative to: */
     31  1.1  rumble #define OIOC_BASE_ADDRESS	0x1f900000
     32  1.1  rumble 
     33  1.1  rumble /*
     34  1.1  rumble  * The IOC SCSI DMA engine consists of 257 16-bit address registers, which can
     35  1.1  rumble  * point to 256 4096-byte buffers.
     36  1.1  rumble  *
     37  1.1  rumble  * IOC_SCSI_DMA_LOW contains the first 12 bits of a starting offset within
     38  1.1  rumble  * the first page of a virtually contiguous buffer. The MSB indicates DMA
     39  1.1  rumble  * transfer direction.
     40  1.1  rumble  *
     41  1.1  rumble  * There are 256 high address registers starting at IOC_SCSI_DMA_HIGH_BASE
     42  1.1  rumble  * and occurring every 4 bytes. This provides 28 address bits - more than
     43  1.1  rumble  * sufficient for these old machines.
     44  1.1  rumble  */
     45  1.1  rumble #define OIOC_SCSI_REGS		0x00000000	/* SCSI registers offset */
     46  1.1  rumble #define OIOC_SCSI_REGS_SIZE	0x00200102	/* SCSI length */
     47  1.1  rumble 
     48  1.1  rumble #define OIOC_SCSI_DMA_LOW	0x00000002	/* 16-bit */
     49  1.1  rumble #define OIOC_SCSI_DMA_HIGH_BASE	0x00020002	/* 16-bit */
     50  1.1  rumble #define OIOC_SCSI_DMA_FLUSH	0x00040000	/* 32-bit; write 0 to flush */
     51  1.1  rumble 
     52  1.1  rumble #define OIOC_SCSI_DMA_NSEGS		256
     53  1.1  rumble #define OIOC_SCSI_DMA_HIGH(_x)		(OIOC_SCSI_DMA_HIGH_BASE + ((_x) << 2))
     54  1.1  rumble #define OIOC_SCSI_DMA_HIGH_SHFT		12
     55  1.1  rumble #define OIOC_SCSI_DMA_LOW_ADDR_MASK	0x0fff
     56  1.1  rumble #define OIOC_SCSI_DMA_LOW_ADDR_DMADIR	0x8000	/* if set: SCSI->MEM */
     57  1.1  rumble 
     58  1.1  rumble #define OIOC_SCSI_RESET_OFF	0x00180000	/* 32-bit; read to set _RESET */
     59  1.1  rumble #define OIOC_SCSI_RESET_ON	0x00180004	/* 32-bit; read to clr _RESET */
     60  1.1  rumble 
     61  1.1  rumble #define OIOC_WD33C93_ASR	0x00200001	/*  8-bit; scsi asr register */
     62  1.1  rumble #define OIOC_WD33C93_ASR_SIZE	1
     63  1.1  rumble #define OIOC_WD33C93_DATA	0x00200101	/*  8-bit; scsi data register */
     64  1.1  rumble #define OIOC_WD33C93_DATA_SIZE	1
     65  1.1  rumble 
     66  1.1  rumble /*
     67  1.1  rumble  * IOC has 64 (I think) 16-bit page remap registers occurring every 4 bytes
     68  1.1  rumble  * starting at 0xbf920802. Each register takes a physical page number, N, which
     69  1.1  rumble  * maps physical memory page N into LANCE's 24-bit address space at offset
     70  1.1  rumble  * (N * 4096).
     71  1.1  rumble  */
     72  1.1  rumble #define OIOC_ENET_PGMAP_BASE	0x00020802		/* 16-bit */
     73  1.1  rumble #define OIOC_ENET_NPGMAPS	64			/* 64 pages */
     74  1.1  rumble #define OIOC_ENET_PGMAP_SIZE	(OIOC_ENET_NPGMAPS * 4)
     75  1.1  rumble #define OIOC_ENET_PGMAP_OFF(n)	((n) << 2)		/* every 4 bytes */
     76  1.1  rumble 
     77  1.1  rumble #define OIOC_ENET_RESET_OFF	0x00060000	/* 8-bit; read to set _RESET */
     78  1.1  rumble #define OIOC_ENET_RESET_ON	0x00060004	/* 8-bit; read to clr _RESET */
     79  1.1  rumble #define OIOC_LANCE_RDP		0x00050000	/* 16-bit; le reg. data port */
     80  1.1  rumble #define OIOC_LANCE_RDP_SIZE	2
     81  1.1  rumble #define OIOC_LANCE_RAP		0x00050100	/* 16-bit; le reg. access port*/
     82  1.1  rumble #define OIOC_LANCE_RAP_SIZE	2
     83  1.1  rumble 
     84  1.1  rumble #define OIOC2_CONFIG		0x00180008	/* 32-bit; IOC2 (IP6/10) only */
     85  1.1  rumble 
     86  1.1  rumble /* OIOC2_CONFIG bits; only BURST, NOSYNC and HIWAT are writable. */
     87  1.1  rumble #define OIOC2_CONFIG_HIWAT_MASK		0x0000000f
     88  1.1  rumble #define OIOC2_CONFIG_HIWAT_SHFT		0x00000000
     89  1.1  rumble #define OIOC2_CONFIG_ID_MASK		0x00000030
     90  1.1  rumble #define OIOC2_CONFIG_ID_SHFT		0x00000004
     91  1.1  rumble #define OIOC2_CONFIG_NOSYNC_MASK	0x00000040
     92  1.1  rumble #define OIOC2_CONFIG_NOSYNC_SHFT	0x00000006
     93  1.1  rumble #define OIOC2_CONFIG_BURST_MASK		0x00000080
     94  1.1  rumble #define OIOC2_CONFIG_BURST_SHFT		0x00000007
     95  1.1  rumble #define OIOC2_CONFIG_COUNT_MASK		0x00007f00
     96  1.1  rumble #define OIOC2_CONFIG_COUNT_SHFT		0x00000008
     97  1.1  rumble #define OIOC2_CONFIG_RSRVD_MASK		0x00008000
     98  1.1  rumble #define OIOC2_CONFIG_RSRVD_SHFT		0x0000000f
     99  1.1  rumble #define OIOC2_CONFIG_SCP_MASK		0x003f0000
    100  1.1  rumble #define OIOC2_CONFIG_SCP_SHFT		0x00000010
    101  1.1  rumble #define OIOC2_CONFIG_RSRVD2_MASK 	0x0fc00000
    102  1.1  rumble #define OIOC2_CONFIG_RSRVD2_SHFT 	0x00000016
    103  1.1  rumble #define OIOC2_CONFIG_IOP_MASK		0xf0000000
    104  1.1  rumble #define OIOC2_CONFIG_IOP_SHFT		0x0000001c
    105  1.1  rumble 
    106  1.1  rumble #endif /* _ARCH_SGIMIPS_DEV_OIOCREG_H_ */
    107