1*f016e292Stsutsui /* $NetBSD: hpcreg.h,v 1.20 2011/01/25 12:21:04 tsutsui Exp $ */ 2c4173c40Sthorpej 3c4173c40Sthorpej /* 4c4173c40Sthorpej * Copyright (c) 2001 Rafal K. Boni 5c4173c40Sthorpej * All rights reserved. 6c4173c40Sthorpej * 7c4173c40Sthorpej * Redistribution and use in source and binary forms, with or without 8c4173c40Sthorpej * modification, are permitted provided that the following conditions 9c4173c40Sthorpej * are met: 10c4173c40Sthorpej * 1. Redistributions of source code must retain the above copyright 11c4173c40Sthorpej * notice, this list of conditions and the following disclaimer. 12c4173c40Sthorpej * 2. Redistributions in binary form must reproduce the above copyright 13c4173c40Sthorpej * notice, this list of conditions and the following disclaimer in the 14c4173c40Sthorpej * documentation and/or other materials provided with the distribution. 15c4173c40Sthorpej * 3. The name of the author may not be used to endorse or promote products 16c4173c40Sthorpej * derived from this software without specific prior written permission. 17c4173c40Sthorpej * 18c4173c40Sthorpej * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19c4173c40Sthorpej * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20c4173c40Sthorpej * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21c4173c40Sthorpej * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22c4173c40Sthorpej * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23c4173c40Sthorpej * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24c4173c40Sthorpej * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25c4173c40Sthorpej * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26c4173c40Sthorpej * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27c4173c40Sthorpej * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28c4173c40Sthorpej */ 29c4173c40Sthorpej 30c4173c40Sthorpej #ifndef _ARCH_SGIMIPS_HPC_HPCREG_H_ 31c4173c40Sthorpej #define _ARCH_SGIMIPS_HPC_HPCREG_H_ 32c4173c40Sthorpej 33bc577449Ssekiya /* 3438bbaabcSrumble * HPC locations are identical across all HPC-supported 3538bbaabcSrumble * platforms. 3638bbaabcSrumble */ 3738bbaabcSrumble #define HPC_BASE_ADDRESS_0 0x1fb80000 /* Primary onboard */ 3838bbaabcSrumble #define HPC_BASE_ADDRESS_1 0x1fb00000 3938bbaabcSrumble #define HPC_BASE_ADDRESS_2 0x1f980000 40b8f12e02Srumble #define HPC_BASE_ADDRESS_3 0x1f900000 /* NB: Never supported in h/w */ 4138bbaabcSrumble 4238bbaabcSrumble /* 43bc577449Ssekiya * HPC3 descriptor layout. 44bc577449Ssekiya */ 45c4173c40Sthorpej struct hpc_dma_desc { 46*f016e292Stsutsui uint32_t hdd_bufptr; /* Physical address of buffer */ 47*f016e292Stsutsui uint32_t hdd_ctl; /* Control flags and byte count */ 48*f016e292Stsutsui uint32_t hdd_descptr; /* Physical address of next descr. */ 49*f016e292Stsutsui uint32_t hdd_pad; /* Pad out to quadword alignment */ 50c4173c40Sthorpej }; 51c4173c40Sthorpej 52c4173c40Sthorpej /* 53bc577449Ssekiya * The hdd_bufptr and hdd_ctl fields are swapped between HPC1 and 54bc577449Ssekiya * HPC3. These fields are referenced by macro for readability. 55bc577449Ssekiya */ 56bc577449Ssekiya #define hpc1_hdd_ctl hdd_bufptr 57bc577449Ssekiya #define hpc1_hdd_bufptr hdd_ctl 58bc577449Ssekiya #define hpc3_hdd_ctl hdd_ctl 59bc577449Ssekiya #define hpc3_hdd_bufptr hdd_bufptr 60bc577449Ssekiya 61bc577449Ssekiya /* 62c4173c40Sthorpej * Control flags 63c4173c40Sthorpej */ 64801f5271Srumble #define HPC3_HDD_CTL_EOCHAIN 0x80000000 /* End of descriptor chain */ 65801f5271Srumble #define HPC3_HDD_CTL_EOPACKET 0x40000000 /* Ethernet: end of packet */ 66801f5271Srumble #define HPC3_HDD_CTL_INTR 0x20000000 /* Interrupt when finished */ 67801f5271Srumble #define HPC3_HDD_CTL_XMITDONE 0x00008000 /* Ethernet transmit done */ 68801f5271Srumble #define HPC3_HDD_CTL_OWN 0x00004000 /* CPU owns this frame */ 69c4173c40Sthorpej 70801f5271Srumble #define HPC3_HDD_CTL_BYTECNT(x) ((x) & 0x3fff) /* Byte count: for ethernet 71c4173c40Sthorpej * rcv channel also doubles as 72c4173c40Sthorpej * length of packet received 73c4173c40Sthorpej */ 74c4173c40Sthorpej 75c4173c40Sthorpej /* 76c4173c40Sthorpej * HPC memory map, as offsets from HPC base 77c4173c40Sthorpej * 78c4173c40Sthorpej * XXXrkb: should each section be used as a base and have the specific 79c4173c40Sthorpej * registers offset from there?? 80c4173c40Sthorpej * 81c4173c40Sthorpej * XXX: define register values as well as their offsets. 82c4173c40Sthorpej * 83c4173c40Sthorpej */ 84801f5271Srumble #define HPC3_PBUS_DMAREGS 0x00000000 /* DMA registers for PBus */ 85801f5271Srumble #define HPC3_PBUS_DMAREGS_SIZE 0x0000ffff /* channels 0 - 7 */ 86c4173c40Sthorpej 87801f5271Srumble #define HPC3_PBUS_CH0_BP 0x00000000 /* Chan 0 Buffer Ptr */ 88801f5271Srumble #define HPC3_PBUS_CH0_DP 0x00000004 /* Chan 0 Descriptor Ptr */ 89801f5271Srumble #define HPC3_PBUS_CH0_CTL 0x00001000 /* Chan 0 Control Register */ 90c4173c40Sthorpej 91801f5271Srumble #define HPC3_PBUS_CH1_BP 0x00002000 /* Chan 1 Buffer Ptr */ 92801f5271Srumble #define HPC3_PBUS_CH1_DP 0x00002004 /* Chan 1 Descriptor Ptr */ 93801f5271Srumble #define HPC3_PBUS_CH1_CTL 0x00003000 /* Chan 1 Control Register */ 94c4173c40Sthorpej 95801f5271Srumble #define HPC3_PBUS_CH2_BP 0x00004000 /* Chan 2 Buffer Ptr */ 96801f5271Srumble #define HPC3_PBUS_CH2_DP 0x00004004 /* Chan 2 Descriptor Ptr */ 97801f5271Srumble #define HPC3_PBUS_CH2_CTL 0x00005000 /* Chan 2 Control Register */ 98c4173c40Sthorpej 99801f5271Srumble #define HPC3_PBUS_CH3_BP 0x00006000 /* Chan 3 Buffer Ptr */ 100801f5271Srumble #define HPC3_PBUS_CH3_DP 0x00006004 /* Chan 3 Descriptor Ptr */ 101801f5271Srumble #define HPC3_PBUS_CH3_CTL 0x00007000 /* Chan 3 Control Register */ 102c4173c40Sthorpej 103801f5271Srumble #define HPC3_PBUS_CH4_BP 0x00008000 /* Chan 4 Buffer Ptr */ 104801f5271Srumble #define HPC3_PBUS_CH4_DP 0x00008004 /* Chan 4 Descriptor Ptr */ 105801f5271Srumble #define HPC3_PBUS_CH4_CTL 0x00009000 /* Chan 4 Control Register */ 106c4173c40Sthorpej 107801f5271Srumble #define HPC3_PBUS_CH5_BP 0x0000a000 /* Chan 5 Buffer Ptr */ 108801f5271Srumble #define HPC3_PBUS_CH5_DP 0x0000a004 /* Chan 5 Descriptor Ptr */ 109801f5271Srumble #define HPC3_PBUS_CH5_CTL 0x0000b000 /* Chan 5 Control Register */ 110c4173c40Sthorpej 111801f5271Srumble #define HPC3_PBUS_CH6_BP 0x0000c000 /* Chan 6 Buffer Ptr */ 112801f5271Srumble #define HPC3_PBUS_CH6_DP 0x0000c004 /* Chan 6 Descriptor Ptr */ 113801f5271Srumble #define HPC3_PBUS_CH6_CTL 0x0000d000 /* Chan 6 Control Register */ 114c4173c40Sthorpej 115801f5271Srumble #define HPC3_PBUS_CH7_BP 0x0000e000 /* Chan 7 Buffer Ptr */ 116801f5271Srumble #define HPC3_PBUS_CH7_DP 0x0000e004 /* Chan 7 Descriptor Ptr */ 117801f5271Srumble #define HPC3_PBUS_CH7_CTL 0x0000f000 /* Chan 7 Control Register */ 118c4173c40Sthorpej 119801f5271Srumble #define HPC3_SCSI0_REGS 0x00010000 /* SCSI channel 0 registers */ 120801f5271Srumble #define HPC3_SCSI0_REGS_SIZE 0x00001fff 121c4173c40Sthorpej 122801f5271Srumble #define HPC3_SCSI0_CBP 0x00000000 /* Current buffer ptr */ 123801f5271Srumble #define HPC3_SCSI0_NDBP 0x00000004 /* Next descriptor ptr */ 124c4173c40Sthorpej 125801f5271Srumble #define HPC3_SCSI0_BC 0x00001000 /* DMA byte count & flags */ 126801f5271Srumble #define HPC3_SCSI0_CTL 0x00001004 /* DMA control flags */ 127801f5271Srumble #define HPC3_SCSI0_GIO 0x00001008 /* GIO DMA FIFO pointer */ 128801f5271Srumble #define HPC3_SCSI0_DEV 0x0000100c /* Device DMA FIFO pointer */ 129801f5271Srumble #define HPC3_SCSI0_DMACFG 0x00001010 /* DMA configururation */ 130801f5271Srumble #define HPC3_SCSI0_PIOCFG 0x00001014 /* PIO configururation */ 131c4173c40Sthorpej 132801f5271Srumble #define HPC3_SCSI1_REGS 0x00012000 /* SCSI channel 1 registers */ 133801f5271Srumble #define HPC3_SCSI1_REGS_SIZE 0x00001fff 134c4173c40Sthorpej 135801f5271Srumble #define HPC3_SCSI1_CBP 0x00000000 /* Current buffer ptr */ 136801f5271Srumble #define HPC3_SCSI1_NDBP 0x00000004 /* Next descriptor ptr */ 137c4173c40Sthorpej 138801f5271Srumble #define HPC3_SCSI1_BC 0x00001000 /* DMA byte count & flags */ 139801f5271Srumble #define HPC3_SCSI1_CTL 0x00001004 /* DMA control flags */ 140801f5271Srumble #define HPC3_SCSI1_GIO 0x00001008 /* GIO DMA FIFO pointer */ 141801f5271Srumble #define HPC3_SCSI1_DEV 0x0000100c /* Device DMA FIFO pointer */ 142801f5271Srumble #define HPC3_SCSI1_DMACFG 0x00001010 /* DMA configururation */ 143801f5271Srumble #define HPC3_SCSI1_PIOCFG 0x00001014 /* PIO configururation */ 144c4173c40Sthorpej 145ee970eecSrumble /* HPC3_SCSIx_CTL "SCSI control register" flags: */ 146ee970eecSrumble #define HPC3_SCSI_DMACTL_IRQ 0x01 /* IRQ asserted, dma done or parity */ 147ee970eecSrumble #define HPC3_SCSI_DMACTL_ENDIAN 0x02 /* DMA endian mode, 0=BE, 1=LE */ 148ee970eecSrumble #define HPC3_SCSI_DMACTL_DIR 0x04 /* DMA direction, 0=dev->mem, 1=mem->dev */ 149ee970eecSrumble #define HPC3_SCSI_DMACTL_FLUSH 0x08 /* Flush DMA FIFO's */ 150ee970eecSrumble #define HPC3_SCSI_DMACTL_ACTIVE 0x10 /* DMA channel is active */ 151ee970eecSrumble #define HPC3_SCSI_DMACTL_AMASK 0x20 /* DMA active inhibits PIO */ 152ee970eecSrumble #define HPC3_SCSI_DMACTL_RESET 0x40 /* Reset dma channel and ext. controller */ 153ee970eecSrumble #define HPC3_SCSI_DMACTL_PERR 0x80 /* Parity error: interface to controller */ 1540ac0d0d4Swdk 155ae33e68dSlonewolf /* HPC_PBUS_CHx_CTL read: */ 156801f5271Srumble #define HPC3_PBUS_DMACTL_IRQ 0x01 /* IRQ asserted, DMA done */ 157801f5271Srumble #define HPC3_PBUS_DMACTL_ISACT 0x02 /* DMA channel is active */ 158801f5271Srumble 159ae33e68dSlonewolf /* HPC_PBUS_CHx_CTL write: */ 160801f5271Srumble #define HPC3_PBUS_DMACTL_ENDIAN 0x02 /* DMA endianness, 0=BE 1=LE */ 161801f5271Srumble #define HPC3_PBUS_DMACTL_RECEIVE 0x04 /* DMA direction, 1=dev->mem, 0=mem->dev*/ 162801f5271Srumble #define HPC3_PBUS_DMACTL_FLUSH 0x08 /* Flush DMA FIFO */ 163801f5271Srumble #define HPC3_PBUS_DMACTL_ACT 0x10 /* Activate DMA channel */ 164801f5271Srumble #define HPC3_PBUS_DMACTL_ACT_LD 0x20 /* Load enable for ACT */ 165801f5271Srumble #define HPC3_PBUS_DMACTL_RT 0x40 /* Enable real time GIO service for DMA */ 166801f5271Srumble #define HPC3_PBUS_DMACTL_HIGHWATER_SHIFT 8 167801f5271Srumble #define HPC3_PBUS_DMACTL_FIFOBEG_SHIFT 16 168801f5271Srumble #define HPC3_PBUS_DMACTL_FIFOEND_SHIFT 24 1690ac0d0d4Swdk 170801f5271Srumble #define HPC3_ENET_REGS 0x00014000 /* Ethernet registers */ 171801f5271Srumble #define HPC3_ENET_REGS_SIZE 0x00003fff 172c4173c40Sthorpej 173801f5271Srumble #define HPC3_ENETR_CBP 0x00000000 /* Recv: Current buffer ptr */ 174801f5271Srumble #define HPC3_ENETR_NDBP 0x00000004 /* Recv: Next descriptor ptr */ 175c4173c40Sthorpej 176801f5271Srumble #define HPC3_ENETR_BC 0x00001000 /* Recv: DMA byte cnt/flags */ 177801f5271Srumble #define HPC3_ENETR_CTL 0x00001004 /* Recv: DMA control flags */ 17863f856cbSrafal 179801f5271Srumble #define HPC3_ENETR_CTL_STAT_5_0 0x003f /* Seeq irq status: bits 0-5 */ 180801f5271Srumble #define HPC3_ENETR_CTL_STAT_6 0x0040 /* Irq status: late_rxdc */ 181801f5271Srumble #define HPC3_ENETR_CTL_STAT_7 0x0080 /* Irq status: old/new bit */ 182801f5271Srumble #define HPC3_ENETR_CTL_LENDIAN 0x0100 /* DMA channel endian mode */ 183801f5271Srumble #define HPC3_ENETR_CTL_ACTIVE 0x0200 /* DMA channel active? */ 184801f5271Srumble #define HPC3_ENETR_CTL_ACTIVE_MSK 0x0400 /* DMA channel active? */ 185801f5271Srumble #define HPC3_ENETR_CTL_RBO 0x0800 /* Recv buffer overflow */ 18663f856cbSrafal 187801f5271Srumble #define HPC3_ENETR_GIO 0x00001008 /* Recv: GIO DMA FIFO ptr */ 188801f5271Srumble #define HPC3_ENETR_DEV 0x0000100c /* Recv: Device DMA FIFO ptr */ 189801f5271Srumble #define HPC3_ENETR_RESET 0x00001014 /* Recv: Ethernet chip reset */ 19063f856cbSrafal 191801f5271Srumble #define HPC3_ENETR_RESET_CH 0x0001 /* Reset controller & chan */ 192801f5271Srumble #define HPC3_ENETR_RESET_CLRINT 0x0002 /* Clear channel interrupt */ 193801f5271Srumble #define HPC3_ENETR_RESET_LOOPBK 0x0004 /* External loopback enable */ 194801f5271Srumble #define HPC3_ENETR_RESET_CLRRBO 0x0008 /* Clear RBO condition (??) */ 19563f856cbSrafal 196801f5271Srumble #define HPC3_ENETR_DMACFG 0x00001018 /* Recv: DMA configururation */ 197c4173c40Sthorpej 1982c7e4582Srumble #define HPC3_ENETR_DMACFG_D1(_x) (((_x) << 0) & 0x000f) /* D1 gio_clk cycles */ 1992c7e4582Srumble #define HPC3_ENETR_DMACFG_D2(_x) (((_x) << 4) & 0x00f0) /* D2 gio_clk cycles */ 2002c7e4582Srumble #define HPC3_ENETR_DMACFG_D3(_x) (((_x) << 8) & 0x0f00) /* D3 gio_clk cycles */ 201801f5271Srumble #define HPC3_ENETR_DMACFG_WRCTL 0x01000 /* Enable IPG write */ 20263f856cbSrafal 20363f856cbSrafal /* 20463f856cbSrafal * The following three bits work around bugs in the Seeq 8003; if you 20563f856cbSrafal * don't set them, the Seeq gets wonky pretty often. 20663f856cbSrafal */ 207801f5271Srumble #define HPC3_ENETR_DMACFG_FIX_RXDC 0x02000 /* Clear EOP bits on RXDC */ 208801f5271Srumble #define HPC3_ENETR_DMACFG_FIX_EOP 0x04000 /* Enable rxintr timeout */ 209801f5271Srumble #define HPC3_ENETR_DMACFG_FIX_INTR 0x08000 /* Enable EOP timeout */ 2102c7e4582Srumble #define HPC3_ENETR_DMACFG_TIMEOUT 0x30000 /* Timeout value for above two*/ 21163f856cbSrafal 212801f5271Srumble #define HPC3_ENETR_PIOCFG 0x0000101c /* Recv: PIO configururation */ 213c4173c40Sthorpej 2142c7e4582Srumble #define HPC3_ENETR_PIOCFG_P1(_x) (((_x) << 0) & 0x000f) /* P1 gio_clk cycles */ 2152c7e4582Srumble #define HPC3_ENETR_PIOCFG_P2(_x) (((_x) << 4) & 0x00f0) /* P2 gio_clk cycles */ 2162c7e4582Srumble #define HPC3_ENETR_PIOCFG_P3(_x) (((_x) << 8) & 0x0f00) /* P3 gio_clk cycles */ 2172c7e4582Srumble 218801f5271Srumble #define HPC3_ENETX_CBP 0x00002000 /* Xmit: Current buffer ptr */ 219801f5271Srumble #define HPC3_ENETX_NDBP 0x00002004 /* Xmit: Next descriptor ptr */ 220c4173c40Sthorpej 221801f5271Srumble #define HPC3_ENETX_BC 0x00003000 /* Xmit: DMA byte cnt/flags */ 222801f5271Srumble #define HPC3_ENETX_CTL 0x00003004 /* Xmit: DMA control flags */ 22363f856cbSrafal 224801f5271Srumble #define HPC3_ENETX_CTL_STAT_5_0 0x003f /* Seeq irq status: bits 0-5 */ 225801f5271Srumble #define HPC3_ENETX_CTL_STAT_6 0x0040 /* Irq status: late_rxdc */ 226801f5271Srumble #define HPC3_ENETX_CTL_STAT_7 0x0080 /* Irq status: old/new bit */ 227801f5271Srumble #define HPC3_ENETX_CTL_LENDIAN 0x0100 /* DMA channel endian mode */ 228801f5271Srumble #define HPC3_ENETX_CTL_ACTIVE 0x0200 /* DMA channel active? */ 229801f5271Srumble #define HPC3_ENETX_CTL_ACTIVE_MSK 0x0400 /* DMA channel active? */ 230801f5271Srumble #define HPC3_ENETX_CTL_RBO 0x0800 /* Recv buffer overflow */ 23163f856cbSrafal 232801f5271Srumble #define HPC3_ENETX_GIO 0x00003008 /* Xmit: GIO DMA FIFO ptr */ 233801f5271Srumble #define HPC3_ENETX_DEV 0x0000300c /* Xmit: Device DMA FIFO ptr */ 234c4173c40Sthorpej 235801f5271Srumble #define HPC3_PBUS_FIFO 0x00020000 /* PBus DMA FIFO */ 236801f5271Srumble #define HPC3_PBUS_FIFO_SIZE 0x00007fff /* PBus DMA FIFO size */ 237c4173c40Sthorpej 238801f5271Srumble #define HPC3_SCSI0_FIFO 0x00028000 /* SCSI0 DMA FIFO */ 239801f5271Srumble #define HPC3_SCSI0_FIFO_SIZE 0x00001fff /* SCSI0 DMA FIFO size */ 240c4173c40Sthorpej 241801f5271Srumble #define HPC3_SCSI1_FIFO 0x0002a000 /* SCSI1 DMA FIFO */ 242801f5271Srumble #define HPC3_SCSI1_FIFO_SIZE 0x00001fff /* SCSI1 DMA FIFO size */ 243c4173c40Sthorpej 244801f5271Srumble #define HPC3_ENETR_FIFO 0x0002c000 /* Ether recv DMA FIFO */ 245801f5271Srumble #define HPC3_ENETR_FIFO_SIZE 0x00001fff /* Ether recv DMA FIFO size */ 246c4173c40Sthorpej 247801f5271Srumble #define HPC3_ENETX_FIFO 0x0002e000 /* Ether xmit DMA FIFO */ 248801f5271Srumble #define HPC3_ENETX_FIFO_SIZE 0x00001fff /* Ether xmit DMA FIFO size */ 249c4173c40Sthorpej 250c4173c40Sthorpej /* 251c4173c40Sthorpej * HPCBUG: The interrupt status is split amongst two registers, and they're 252c4173c40Sthorpej * not even consecutive in the HPC address space. This is documented as a 253c4173c40Sthorpej * bug by SGI. 254c4173c40Sthorpej */ 255801f5271Srumble #define HPC3_INTRSTAT_40 0x00030000 /* Interrupt stat, bits 4:0 */ 256801f5271Srumble #define HPC3_INTRSTAT_95 0x0003000c /* Interrupt stat, bits 9:5 */ 257c4173c40Sthorpej 258801f5271Srumble #define HPC3_GIO_MISC 0x00030004 /* GIO64 misc register */ 259c4173c40Sthorpej 260121e1e9bSrumble #define HPC3_EEPROM_DATA 0x0003000b /* Serial EEPROM data reg. */ 261121e1e9bSrumble /* (byte) */ 262c4173c40Sthorpej 263801f5271Srumble #define HPC3_GIO_BUSERR 0x00030010 /* GIO64 bus error intr stat */ 264c4173c40Sthorpej 265801f5271Srumble #define HPC3_SCSI0_DEVREGS 0x00044000 /* SCSI channel 0 chip regs */ 266801f5271Srumble #define HPC3_SCSI0_DEVREGS_SIZE 0x000003ff /* Size of chip registers */ 267c4173c40Sthorpej 268801f5271Srumble #define HPC3_SCSI1_DEVREGS 0x0004c000 /* SCSI channel 1 chip regs */ 269801f5271Srumble #define HPC3_SCSI1_DEVREGS_SIZE 0x000003ff /* Size of chip registers */ 270c4173c40Sthorpej 271801f5271Srumble #define HPC3_ENET_DEVREGS 0x00054000 /* Ethernet chip registers */ 272801f5271Srumble #define HPC3_ENET_DEVREGS_SIZE 0x000004ff /* Size of chip registers */ 273c4173c40Sthorpej 274801f5271Srumble #define HPC3_PBUS_DEVREGS 0x00054000 /* PBus PIO chip registers */ 275801f5271Srumble #define HPC3_PBUS_DEVREGS_SIZE 0x000003ff /* PBus PIO chip registers */ 276c4173c40Sthorpej 277801f5271Srumble #define HPC3_PBUS_CH0_DEVREGS 0x00058000 /* PBus ch. 0 chip registers */ 278801f5271Srumble #define HPC3_PBUS_CH0_DEVREGS_SIZE 0x03ff 279c4173c40Sthorpej 280801f5271Srumble #define HPC3_PBUS_CH1_DEVREGS 0x00058400 /* PBus ch. 1 chip registers */ 281801f5271Srumble #define HPC3_PBUS_CH1_DEVREGS_SIZE 0x03ff 282c4173c40Sthorpej 283801f5271Srumble #define HPC3_PBUS_CH2_DEVREGS 0x00058800 /* PBus ch. 2 chip registers */ 284801f5271Srumble #define HPC3_PBUS_CH2_DEVREGS_SIZE 0x03ff 285c4173c40Sthorpej 286801f5271Srumble #define HPC3_PBUS_CH3_DEVREGS 0x00058c00 /* PBus ch. 3 chip registers */ 287801f5271Srumble #define HPC3_PBUS_CH3_DEVREGS_SIZE 0x03ff 288c4173c40Sthorpej 289801f5271Srumble #define HPC3_PBUS_CH4_DEVREGS 0x00059000 /* PBus ch. 4 chip registers */ 290801f5271Srumble #define HPC3_PBUS_CH4_DEVREGS_SIZE 0x03ff 291c4173c40Sthorpej 292801f5271Srumble #define HPC3_PBUS_CH5_DEVREGS 0x00059400 /* PBus ch. 5 chip registers */ 293801f5271Srumble #define HPC3_PBUS_CH5_DEVREGS_SIZE 0x03ff 294c4173c40Sthorpej 295801f5271Srumble #define HPC3_PBUS_CH6_DEVREGS 0x00059800 /* PBus ch. 6 chip registers */ 296801f5271Srumble #define HPC3_PBUS_CH6_DEVREGS_SIZE 0x03ff 297c4173c40Sthorpej 298801f5271Srumble #define HPC3_PBUS_CH7_DEVREGS 0x00059c00 /* PBus ch. 7 chip registers */ 299801f5271Srumble #define HPC3_PBUS_CH7_DEVREGS_SIZE 0x03ff 300c4173c40Sthorpej 301801f5271Srumble #define HPC3_PBUS_CH8_DEVREGS 0x0005a000 /* PBus ch. 8 chip registers */ 302801f5271Srumble #define HPC3_PBUS_CH8_DEVREGS_SIZE 0x03ff 303c4173c40Sthorpej 304801f5271Srumble #define HPC3_PBUS_CH9_DEVREGS 0x0005a400 /* PBus ch. 9 chip registers */ 305801f5271Srumble #define HPC3_PBUS_CH9_DEVREGS_SIZE 0x03ff 306c4173c40Sthorpej 307801f5271Srumble #define HPC3_PBUS_CH8_DEVREGS_2 0x0005a800 /* PBus ch. 8 chip registers */ 308801f5271Srumble #define HPC3_PBUS_CH8_DEVREGS_2_SIZE 0x03ff 309c4173c40Sthorpej 310801f5271Srumble #define HPC3_PBUS_CH9_DEVREGS_2 0x0005ac00 /* PBus ch. 9 chip registers */ 311801f5271Srumble #define HPC3_PBUS_CH9_DEVREGS_2_SIZE 0x03ff 312c4173c40Sthorpej 313801f5271Srumble #define HPC3_PBUS_CH8_DEVREGS_3 0x0005b000 /* PBus ch. 8 chip registers */ 314801f5271Srumble #define HPC3_PBUS_CH8_DEVREGS_3_SIZE 0x03ff 315c4173c40Sthorpej 316801f5271Srumble #define HPC3_PBUS_CH9_DEVREGS_3 0x0005b400 /* PBus ch. 9 chip registers */ 317801f5271Srumble #define HPC3_PBUS_CH9_DEVREGS_3_SIZE 0x03ff 318c4173c40Sthorpej 319801f5271Srumble #define HPC3_PBUS_CH8_DEVREGS_4 0x0005b800 /* PBus ch. 8 chip registers */ 320801f5271Srumble #define HPC3_PBUS_CH8_DEVREGS_4_SIZE 0x03ff 321c4173c40Sthorpej 322801f5271Srumble #define HPC3_PBUS_CH9_DEVREGS_4 0x0005bc00 /* PBus ch. 9 chip registers */ 323801f5271Srumble #define HPC3_PBUS_CH9_DEVREGS_4_SIZE 0x03ff 324c4173c40Sthorpej 325801f5271Srumble #define HPC3_PBUS_CFGDMA_REGS 0x0005c000 /* PBus DMA config registers */ 326801f5271Srumble #define HPC3_PBUS_CFGDMA_REGS_SIZE 0x0fff 327c4173c40Sthorpej 328801f5271Srumble #define HPC3_PBUS_CH0_CFGDMA 0x0005c000 /* PBus Ch. 0 DMA config */ 329801f5271Srumble #define HPC3_PBUS_CH0_CFGDMA_SIZE 0x01ff 330c4173c40Sthorpej 331801f5271Srumble #define HPC3_PBUS_CH1_CFGDMA 0x0005c200 /* PBus Ch. 1 DMA config */ 332801f5271Srumble #define HPC3_PBUS_CH1_CFGDMA_SIZE 0x01ff 333c4173c40Sthorpej 334801f5271Srumble #define HPC3_PBUS_CH2_CFGDMA 0x0005c400 /* PBus Ch. 2 DMA config */ 335801f5271Srumble #define HPC3_PBUS_CH2_CFGDMA_SIZE 0x01ff 336c4173c40Sthorpej 337801f5271Srumble #define HPC3_PBUS_CH3_CFGDMA 0x0005c600 /* PBus Ch. 3 DMA config */ 338801f5271Srumble #define HPC3_PBUS_CH3_CFGDMA_SIZE 0x01ff 339c4173c40Sthorpej 340801f5271Srumble #define HPC3_PBUS_CH4_CFGDMA 0x0005c800 /* PBus Ch. 4 DMA config */ 341801f5271Srumble #define HPC3_PBUS_CH4_CFGDMA_SIZE 0x01ff 342c4173c40Sthorpej 343801f5271Srumble #define HPC3_PBUS_CH5_CFGDMA 0x0005ca00 /* PBus Ch. 5 DMA config */ 344801f5271Srumble #define HPC3_PBUS_CH5_CFGDMA_SIZE 0x01ff 345c4173c40Sthorpej 346801f5271Srumble #define HPC3_PBUS_CH6_CFGDMA 0x0005cc00 /* PBus Ch. 6 DMA config */ 347801f5271Srumble #define HPC3_PBUS_CH6_CFGDMA_SIZE 0x01ff 348c4173c40Sthorpej 349801f5271Srumble #define HPC3_PBUS_CH7_CFGDMA 0x0005ce00 /* PBus Ch. 7 DMA config */ 350801f5271Srumble #define HPC3_PBUS_CH7_CFGDMA_SIZE 0x01ff 351c4173c40Sthorpej 352801f5271Srumble #define HPC3_PBUS_CFGPIO_REGS 0x0005d000 /* PBus PIO config registers */ 353801f5271Srumble #define HPC3_PBUS_CFGPIO_REGS_SIZE 0x0fff 354c4173c40Sthorpej 355801f5271Srumble #define HPC3_PBUS_CH0_CFGPIO 0x0005d000 /* PBus Ch. 0 PIO config */ 356801f5271Srumble #define HPC3_PBUS_CH1_CFGPIO 0x0005d100 /* PBus Ch. 1 PIO config */ 357801f5271Srumble #define HPC3_PBUS_CH2_CFGPIO 0x0005d200 /* PBus Ch. 2 PIO config */ 358801f5271Srumble #define HPC3_PBUS_CH3_CFGPIO 0x0005d300 /* PBus Ch. 3 PIO config */ 359801f5271Srumble #define HPC3_PBUS_CH4_CFGPIO 0x0005d400 /* PBus Ch. 4 PIO config */ 360801f5271Srumble #define HPC3_PBUS_CH5_CFGPIO 0x0005d500 /* PBus Ch. 5 PIO config */ 361801f5271Srumble #define HPC3_PBUS_CH6_CFGPIO 0x0005d600 /* PBus Ch. 6 PIO config */ 362801f5271Srumble #define HPC3_PBUS_CH7_CFGPIO 0x0005d700 /* PBus Ch. 7 PIO config */ 363801f5271Srumble #define HPC3_PBUS_CH8_CFGPIO 0x0005d800 /* PBus Ch. 8 PIO config */ 364801f5271Srumble #define HPC3_PBUS_CH9_CFGPIO 0x0005d900 /* PBus Ch. 9 PIO config */ 365801f5271Srumble #define HPC3_PBUS_CH8_CFGPIO_2 0x0005da00 /* PBus Ch. 8 PIO config */ 366801f5271Srumble #define HPC3_PBUS_CH9_CFGPIO_2 0x0005db00 /* PBus Ch. 9 PIO config */ 367801f5271Srumble #define HPC3_PBUS_CH8_CFGPIO_3 0x0005dc00 /* PBus Ch. 8 PIO config */ 368801f5271Srumble #define HPC3_PBUS_CH9_CFGPIO_3 0x0005dd00 /* PBus Ch. 9 PIO config */ 369801f5271Srumble #define HPC3_PBUS_CH8_CFGPIO_4 0x0005de00 /* PBus Ch. 8 PIO config */ 370801f5271Srumble #define HPC3_PBUS_CH9_CFGPIO_4 0x0005df00 /* PBus Ch. 9 PIO config */ 371c4173c40Sthorpej 372801f5271Srumble #define HPC3_PBUS_PROM_WE 0x0005e000 /* PBus boot-prom write 373c4173c40Sthorpej * enable register 374c4173c40Sthorpej */ 375c4173c40Sthorpej 376801f5271Srumble #define HPC3_PBUS_PROM_SWAP 0x0005e800 /* PBus boot-prom chip-select 377c4173c40Sthorpej * swap register 378c4173c40Sthorpej */ 379c4173c40Sthorpej 380801f5271Srumble #define HPC3_PBUS_GEN_OUT 0x0005f000 /* PBus general-purpose output 381c4173c40Sthorpej * register 382c4173c40Sthorpej */ 383c4173c40Sthorpej 384801f5271Srumble #define HPC3_PBUS_BBRAM 0x00060000 /* PBus battery-backed RAM 385c4173c40Sthorpej * external registers 386c4173c40Sthorpej */ 3878e5c74aaSsekiya 3888e5c74aaSsekiya /* HPC1/HPC1.5 differs from HPC3 in several details. */ 3898e5c74aaSsekiya 390af4ac18eSsekiya #define HPC1_HDD_CTL_EOCHAIN 0x80000000 /* End of descriptor chain */ 391af4ac18eSsekiya #define HPC1_HDD_CTL_EOPACKET 0x80000000 /* Ethernet: end of packet */ 392af4ac18eSsekiya #define HPC1_HDD_CTL_INTR 0x00008000 /* Interrupt when finished */ 393af4ac18eSsekiya #define HPC1_HDD_CTL_OWN 0x40000000 /* CPU owns this frame */ 394af4ac18eSsekiya #define HPC1_HDD_CTL_BYTECNT(x) ((x) & 0x1fff) /* Byte count: for ethernet */ 395af4ac18eSsekiya #define HPC1_BIGENDIAN 0x000000c0 /* Endianness:5 revision:2 */ 396af4ac18eSsekiya #define HPC1_REVSHIFT 0x00000006 /* Revision rshft */ 397af4ac18eSsekiya #define HPC1_REVMASK 0x00000003 /* Revision mask */ 398bc577449Ssekiya #define HPC1_REV15 0x00000001 /* HPC Revision 1.5 */ 399af4ac18eSsekiya #define HPC1_SCSI0_REGS 0x00000088 400af4ac18eSsekiya #define HPC1_SCSI0_REGS_SIZE 0x00000018 401af4ac18eSsekiya #define HPC1_SCSI0_CBP 0x00000004 /* Current buffer ptr */ 402af4ac18eSsekiya #define HPC1_SCSI0_NDBP 0x00000008 /* Next descriptor ptr */ 403af4ac18eSsekiya #define HPC1_SCSI0_BC 0x00000000 /* DMA byte count & flags */ 404af4ac18eSsekiya #define HPC1_SCSI0_CTL 0x0000000c /* DMA control flags */ 405af4ac18eSsekiya #define HPC1_SCSI0_DEV 0x00000014 /* Device DMA FIFO pointer */ 406af4ac18eSsekiya #define HPC1_SCSI0_DMACFG 0x00000010 /* DMA configuration */ 407af4ac18eSsekiya #define HPC1_SCSI0_GIO 0x00001008 /* GIO DMA FIFO pointer */ 408af4ac18eSsekiya #define HPC1_SCSI0_PIOCFG 0x00001014 /* PIO configuration */ 409ee970eecSrumble #define HPC1_SCSI_DMACTL_RESET 0x01 /* Reset dma channel and ext. controller */ 410ee970eecSrumble #define HPC1_SCSI_DMACTL_FLUSH 0x02 /* Flush DMA FIFO's */ 411ee970eecSrumble #define HPC1_SCSI_DMACTL_DIR 0x10 /* DMA direction: 1=dev->mem, 0=mem->dev */ 412ee970eecSrumble #define HPC1_SCSI_DMACTL_ACTIVE 0x80 /* DMA channel is active */ 413af4ac18eSsekiya #define HPC1_ENET_REGS 0x00000000 /* Ethernet registers */ 414af4ac18eSsekiya #define HPC1_ENET_REGS_SIZE 0x00000100 415af4ac18eSsekiya #define HPC1_ENET_INTDELAY 0x0000002c /* Interrupt Delay Count */ 4164aa50cacSrumble #define HPC1_ENET_INTDELAY_OFF 0x01000000 /* Disable Interrupt Delay */ 417af4ac18eSsekiya #define HPC1_ENETR_CBP 0x00000054 /* Recv: Current buffer ptr */ 418af4ac18eSsekiya #define HPC1_ENETR_NDBP 0x00000050 /* Recv: Next descriptor ptr */ 419af4ac18eSsekiya #define HPC1_ENETR_BC 0x00000048 /* Recv: DMA byte cnt/flags */ 420af4ac18eSsekiya #define HPC1_ENETR_CTL 0x00000038 /* Recv: DMA control flags */ 421af4ac18eSsekiya #define HPC1_ENETR_CTL_ACTIVE 0x00004000 /* DMA channel active? */ 422af4ac18eSsekiya #define HPC1_ENETR_RESET 0x0000003c /* Recv: Ethernet chip reset */ 423af4ac18eSsekiya #define HPC1_ENETR_RESET_CH 0x0001 /* Reset controller & chan */ 424af4ac18eSsekiya #define HPC1_ENETR_RESET_CLRINT 0x0002 /* Clear channel interrupt */ 425af4ac18eSsekiya #define HPC1_ENETR_RESET_LOOPBK 0x0004 /* External loopback enable */ 426af4ac18eSsekiya #define HPC1_ENETR_RESET_CLRRBO 0x0008 /* Clear RBO condition (??) */ 427af4ac18eSsekiya #define HPC1_ENETX_CBP 0x00000020 /* Xmit: Current buffer ptr */ 428af4ac18eSsekiya #define HPC1_ENETX_NDBP 0x00000010 /* Xmit: Next descriptor ptr */ 429af4ac18eSsekiya #define HPC1_ENETX_CFXBP 0x00000024 /* Xmit: Current first buf */ 430af4ac18eSsekiya #define HPC1_ENETX_PFXBP 0x00000028 /* Xmit: Prev. first buf */ 431af4ac18eSsekiya #define HPC1_ENETX_BC 0x00000014 /* Xmit: DMA byte cnt/flags */ 432af4ac18eSsekiya #define HPC1_ENETX_CTL 0x00000034 /* Xmit: DMA control flags */ 433af4ac18eSsekiya #define HPC1_ENETX_CTL_ACTIVE 0x00400000 434af4ac18eSsekiya #define HPC1_ENETR_FIFO 0x0002c000 /* Ether recv DMA FIFO */ 435af4ac18eSsekiya #define HPC1_ENETR_FIFO_SIZE 0x00001fff /* Ether recv DMA FIFO size */ 436af4ac18eSsekiya #define HPC1_ENETX_FIFO 0x0002e000 /* Ether xmit DMA FIFO */ 437af4ac18eSsekiya #define HPC1_ENETX_FIFO_SIZE 0x00001fff /* Ether xmit DMA FIFO size */ 438af4ac18eSsekiya #define HPC1_SCSI0_DEVREGS 0x0000011f 439af4ac18eSsekiya #define HPC1_SCSI0_DEVREGS_SIZE 0x00000008 440af4ac18eSsekiya #define HPC1_ENET_DEVREGS 0x00000100 /* Ethernet chip registers */ 441af4ac18eSsekiya #define HPC1_ENET_DEVREGS_SIZE 0x00000020 /* Size of chip registers */ 442af4ac18eSsekiya #define HPC1_PBUS_BBRAM 0x00000e00 /* PBus battery-backed RAM */ 443af4ac18eSsekiya #define HPC1_LPT_REGS 0x000000a8 /* LPT HPC Registers */ 444af4ac18eSsekiya #define HPC1_LPT_REGS_SIZE 0x00000018 445af4ac18eSsekiya #define HPC1_LPT_BC 0x00000000 /* Byte Count */ 446af4ac18eSsekiya #define HPC1_LPT_CBP 0x00000004 /* Current Buffer Ptr */ 447af4ac18eSsekiya #define HPC1_LPT_NDBP 0x00000008 /* Next Buffer Ptr */ 448af4ac18eSsekiya #define HPC1_LPT_CTL 0x0000000c /* DMA Control Flags */ 449af4ac18eSsekiya #define HPC1_LPT_DEV 0x00000010 /* DMA Fifo Ptr */ 450af4ac18eSsekiya #define HPC1_LPT_DMACFG 0x00000014 /* DMA Configuration */ 451af4ac18eSsekiya #define HPC1_LPT_DEVREGS 0x00000132 /* Ext. Parallel Registers */ 452af4ac18eSsekiya #define HPC1_LPT_DEVREGS_SIZE 0x00000001 /* Size of External Registers */ 453ee970eecSrumble 454ee970eecSrumble /* AUX regs on the primary HPC */ 455e42e4bd9Srumble #define HPC1_AUX_REGS 0x000001bf /* EEPROM/LED Control (byte) */ 456af4ac18eSsekiya #define HPC1_AUX_CONSLED 0x01 /* Console LED */ 457af4ac18eSsekiya 458c4173c40Sthorpej #endif /* _ARCH_SGIMIPS_HPC_HPCREG_H_ */ 459