xref: /openbsd/sys/dev/sbus/stp4020reg.h (revision d874cce4)
1*d874cce4Sray /*	$OpenBSD: stp4020reg.h,v 1.7 2008/06/26 05:42:18 ray Exp $	*/
21acdeabaSfgsch /*	$NetBSD: stp4020reg.h,v 1.1 1998/11/22 22:14:35 pk Exp $	*/
31acdeabaSfgsch 
41acdeabaSfgsch /*-
51acdeabaSfgsch  * Copyright (c) 1998 The NetBSD Foundation, Inc.
61acdeabaSfgsch  * All rights reserved.
71acdeabaSfgsch  *
81acdeabaSfgsch  * This code is derived from software contributed to The NetBSD Foundation
91acdeabaSfgsch  * by Paul Kranenburg.
101acdeabaSfgsch  *
111acdeabaSfgsch  * Redistribution and use in source and binary forms, with or without
121acdeabaSfgsch  * modification, are permitted provided that the following conditions
131acdeabaSfgsch  * are met:
141acdeabaSfgsch  * 1. Redistributions of source code must retain the above copyright
151acdeabaSfgsch  *    notice, this list of conditions and the following disclaimer.
161acdeabaSfgsch  * 2. Redistributions in binary form must reproduce the above copyright
171acdeabaSfgsch  *    notice, this list of conditions and the following disclaimer in the
181acdeabaSfgsch  *    documentation and/or other materials provided with the distribution.
191acdeabaSfgsch  *
201acdeabaSfgsch  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
211acdeabaSfgsch  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
221acdeabaSfgsch  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
231acdeabaSfgsch  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
241acdeabaSfgsch  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
251acdeabaSfgsch  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
261acdeabaSfgsch  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
271acdeabaSfgsch  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
281acdeabaSfgsch  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
291acdeabaSfgsch  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
301acdeabaSfgsch  * POSSIBILITY OF SUCH DAMAGE.
311acdeabaSfgsch  */
321acdeabaSfgsch 
331acdeabaSfgsch 
341acdeabaSfgsch #ifndef _STP4020_REG_H
351acdeabaSfgsch #define	_STP4020_REG_H
361acdeabaSfgsch 
371acdeabaSfgsch /*
38e242b534Smiod  * STP4020: SBus/PCMCIA bridge supporting one Type-3 PCMCIA card, or up to
39e242b534Smiod  * two Type-1 and Type-2 PCMCIA cards..
401acdeabaSfgsch  * Programming information source:
411acdeabaSfgsch  *	- http://www.sun.com/microelectronics/datasheets/stp4020/
421acdeabaSfgsch  *	- SunOS 5.5 header file
431acdeabaSfgsch  */
441acdeabaSfgsch 
451acdeabaSfgsch /*
460d4d03a0Smiod  * General chip attributes.
471acdeabaSfgsch  */
481acdeabaSfgsch #define	STP4020_NSOCK	2	/* number of PCCARD sockets per STP4020 */
491acdeabaSfgsch #define	STP4020_NWIN	3	/* number of windows per socket */
501acdeabaSfgsch 
511acdeabaSfgsch /*
521acdeabaSfgsch  * Socket control registers.
531acdeabaSfgsch  *
541acdeabaSfgsch  * Each PCMCIA socket has two interface control registers and two interface
551acdeabaSfgsch  * status registers associated with it.
561acdeabaSfgsch  */
571acdeabaSfgsch 
581acdeabaSfgsch /*
591acdeabaSfgsch  * Socket Interface Control register 0
601acdeabaSfgsch  */
611acdeabaSfgsch #define	STP4020_ICR0_rsvd1	0xc000	/* reserved bits */
621acdeabaSfgsch #define	STP4020_ICR0_PROMEN	0x2000	/* FCode PROM enable */
631acdeabaSfgsch /* Status change interrupts can be routed to one of two SBus interrupt levels:*/
641acdeabaSfgsch #define	STP4020_ICR0_SCILVL	0x1000	/* card status change interrupt level */
651acdeabaSfgsch #define	 STP4020_ICR0_SCILVL_SB0	0x0000	/* interrupt on *SB_INT[0] */
661acdeabaSfgsch #define	 STP4020_ICR0_SCILVL_SB1	0x1000	/* interrupt on *SB_INT[1] */
671acdeabaSfgsch /* Interrupt enable bits: */
681acdeabaSfgsch #define	STP4020_ICR0_CDIE	0x0800	/* card detect interrupt enable */
691acdeabaSfgsch #define	STP4020_ICR0_BVD2IE	0x0400	/* battery voltage detect 2 int en. */
701acdeabaSfgsch #define	STP4020_ICR0_BVD1IE	0x0200	/* battery voltage detect 1 int en. */
711acdeabaSfgsch #define	STP4020_ICR0_RDYIE	0x0100	/* ready/busy interrupt enable */
721acdeabaSfgsch #define	STP4020_ICR0_WPIE	0x0080	/* write protect interrupt enable */
731acdeabaSfgsch #define	STP4020_ICR0_CTOIE	0x0040	/* PC card timeout interrupt enable */
741acdeabaSfgsch #define	STP4020_ICR0_rsvd2	0x0020	/* */
751acdeabaSfgsch #define	STP4020_ICR0_IOIE	0x0010	/* I/O (*IRQ) interrupt enable */
761acdeabaSfgsch /* PC card I/O interrupts can also be routed to one of two SBus intr levels: */
771acdeabaSfgsch #define	STP4020_ICR0_IOILVL	0x0008	/* I/O (*IRQ) interrupt level (SBus) */
781acdeabaSfgsch #define	 STP4020_ICR0_IOILVL_SB0	0x0000	/* interrupt on *SB_INT[0] */
791acdeabaSfgsch #define	 STP4020_ICR0_IOILVL_SB1	0x0008	/* interrupt on *SB_INT[1] */
801acdeabaSfgsch 
811acdeabaSfgsch #define	STP4020_ICR0_SPKREN	0x0004	/* *SPKR_OUT enable */
821acdeabaSfgsch #define	STP4020_ICR0_RESET	0x0002	/* PC card reset */
831acdeabaSfgsch #define	STP4020_ICR0_IFTYPE	0x0001	/* PC card interface type */
841acdeabaSfgsch #define	 STP4020_ICR0_IFTYPE_MEM	0x0000	/* MEMORY only */
851acdeabaSfgsch #define	 STP4020_ICR0_IFTYPE_IO		0x0001	/* MEMORY and I/O */
8640f5a384Smickey #define STP4020_ICR0_BITS	"\010\1IFTYPE\2RESET\3SPKREN\4IOILVL\5IOIE" \
8740f5a384Smickey     "\7CTOIE\10WPIE\11RDYIE\12BVD1IE\13BVD2IE\14CDIE\15SCILV\16PROMEN"
881acdeabaSfgsch 
891acdeabaSfgsch /* Shorthand for all status change interrupts enables */
901acdeabaSfgsch #define	STP4020_ICR0_ALL_STATUS_IE (	\
911acdeabaSfgsch 	STP4020_ICR0_CDIE |		\
921acdeabaSfgsch 	STP4020_ICR0_BVD2IE |		\
931acdeabaSfgsch 	STP4020_ICR0_BVD1IE |		\
941acdeabaSfgsch 	STP4020_ICR0_RDYIE |		\
951acdeabaSfgsch 	STP4020_ICR0_WPIE |		\
961acdeabaSfgsch 	STP4020_ICR0_CTOIE		\
971acdeabaSfgsch )
981acdeabaSfgsch 
991acdeabaSfgsch /*
1001acdeabaSfgsch  * Socket Interface Control register 1
1011acdeabaSfgsch  */
1021acdeabaSfgsch #define	STP4020_ICR1_LPBKEN	0x8000	/* PC card data loopback enable */
1031acdeabaSfgsch #define	STP4020_ICR1_CD1DB	0x4000	/* card detect 1 diagnostic bit */
1041acdeabaSfgsch #define	STP4020_ICR1_BVD2DB	0x2000	/* battery voltage detect 2 diag bit */
1051acdeabaSfgsch #define	STP4020_ICR1_BVD1DB	0x1000	/* battery voltage detect 1 diag bit */
1061acdeabaSfgsch #define	STP4020_ICR1_RDYDB	0x0800	/* ready/busy diagnostic bit */
1071acdeabaSfgsch #define	STP4020_ICR1_WPDB	0x0400	/* write protect diagnostic bit */
1081acdeabaSfgsch #define	STP4020_ICR1_WAITDB	0x0200	/* *WAIT diagnostic bit */
1091acdeabaSfgsch #define	STP4020_ICR1_DIAGEN	0x0100	/* diagnostic enable bit */
1101acdeabaSfgsch #define	STP4020_ICR1_rsvd1	0x0080	/* reserved */
1111acdeabaSfgsch #define	STP4020_ICR1_APWREN	0x0040	/* PC card auto power switch enable */
1121acdeabaSfgsch 
1131acdeabaSfgsch /*
1141acdeabaSfgsch  * The Vpp controls are two-bit fields which specify which voltage
1151acdeabaSfgsch  * should be switched onto Vpp for this socket.
1161acdeabaSfgsch  *
1171acdeabaSfgsch  * Both of the "no connect" states are equal.
1181acdeabaSfgsch  */
1191acdeabaSfgsch #define	STP4020_ICR1_VPP2EN	0x0030	/* Vpp2 power enable */
1201acdeabaSfgsch #define	 STP4020_ICR1_VPP2_OFF	0x0000	/* no connect */
1211acdeabaSfgsch #define	 STP4020_ICR1_VPP2_VCC	0x0010	/* Vcc switched onto Vpp2 */
1221acdeabaSfgsch #define	 STP4020_ICR1_VPP2_VPP	0x0020	/* Vpp switched onto Vpp2 */
1231acdeabaSfgsch #define	 STP4020_ICR1_VPP2_ZIP	0x0030	/* no connect */
1241acdeabaSfgsch 
1251acdeabaSfgsch #define	STP4020_ICR1_VPP1EN	0x000c	/* Vpp1 power enable */
1261acdeabaSfgsch #define	 STP4020_ICR1_VPP1_OFF	0x0000	/* no connect */
1271acdeabaSfgsch #define	 STP4020_ICR1_VPP1_VCC	0x0004	/* Vcc switched onto Vpp1 */
1281acdeabaSfgsch #define	 STP4020_ICR1_VPP1_VPP	0x0008	/* Vpp switched onto Vpp1 */
1291acdeabaSfgsch #define	 STP4020_ICR1_VPP1_ZIP	0x000c	/* no connect */
1301acdeabaSfgsch 
1311acdeabaSfgsch #define	STP4020_ICR1_MSTPWR	0x0002	/* PC card master power enable */
1321acdeabaSfgsch #define	STP4020_ICR1_PCIFOE	0x0001	/* PC card interface output enable */
1331acdeabaSfgsch 
13440f5a384Smickey #define STP4020_ICR1_BITS	"\010\1PCIFOE\2MSTPWR\7APWREN\11DIAGEN" \
13540f5a384Smickey     "\12WAITDB\13WPDB\14RDYDB\15BVD1D\16BVD2D\17CD1DB\18LPBKEN"
1361acdeabaSfgsch 
1371acdeabaSfgsch /*
1381acdeabaSfgsch  * Socket Interface Status register 0
1391acdeabaSfgsch  *
1401acdeabaSfgsch  * Some signals in this register change meaning depending on whether
1411acdeabaSfgsch  * the socket is configured as MEMORY-ONLY or MEMORY & I/O:
1421acdeabaSfgsch  *	mo: valid only if the socket is in memory-only mode
1431acdeabaSfgsch  *	io: valid only if the socket is in memory and I/O mode.
1441acdeabaSfgsch  *
1451acdeabaSfgsch  * Pending interrupts are cleared by writing the corresponding status
1461acdeabaSfgsch  * bit set in the upper half of this register.
1471acdeabaSfgsch  */
1481acdeabaSfgsch #define	STP4020_ISR0_ZERO	0x8000	/* always reads back as zero (mo) */
1491acdeabaSfgsch #define	STP4020_ISR0_IOINT	0x8000	/* PC card I/O intr (*IRQ) posted (io)*/
1501acdeabaSfgsch #define	STP4020_ISR0_SCINT	0x4000	/* status change interrupt posted */
1511acdeabaSfgsch #define	STP4020_ISR0_CDCHG	0x2000	/* card detect status change */
1521acdeabaSfgsch #define	STP4020_ISR0_BVD2CHG	0x1000	/* battery voltage detect 2 status change */
1531acdeabaSfgsch #define	STP4020_ISR0_BVD1CHG	0x0800	/* battery voltage detect 1 status change */
1541acdeabaSfgsch #define	STP4020_ISR0_RDYCHG	0x0400	/* ready/busy status change */
1551acdeabaSfgsch #define	STP4020_ISR0_WPCHG	0x0200	/* write protect status change */
1561acdeabaSfgsch #define	STP4020_ISR0_PCTO	0x0100	/* PC card access timeout */
1571acdeabaSfgsch #define STP4020_ISR0_ALL_STATUS_IRQ	0x7f00
1581acdeabaSfgsch 
1591acdeabaSfgsch #define	STP4020_ISR0_LIVE	0x00ff	/* live status bit mask */
1601acdeabaSfgsch #define	STP4020_ISR0_CD2ST	0x0080	/* card detect 2 live status */
1611acdeabaSfgsch #define	STP4020_ISR0_CD1ST	0x0040	/* card detect 1 live status */
1621acdeabaSfgsch #define	STP4020_ISR0_BVD2ST	0x0020	/* battery voltage detect 2 live status (mo) */
1631acdeabaSfgsch #define	STP4020_ISR0_SPKR	0x0020	/* SPKR signal live status (io)*/
1641acdeabaSfgsch #define	STP4020_ISR0_BVD1ST	0x0010	/* battery voltage detect 1 live status (mo) */
1651acdeabaSfgsch #define	STP4020_ISR0_STSCHG	0x0010	/* I/O *STSCHG signal live status (io)*/
1661acdeabaSfgsch #define	STP4020_ISR0_RDYST	0x0008	/* ready/busy live status (mo) */
1671acdeabaSfgsch #define	STP4020_ISR0_IOREQ	0x0008	/* I/O *REQ signal live status (io) */
1681acdeabaSfgsch #define	STP4020_ISR0_WPST	0x0004	/* write protect live status (mo) */
1691acdeabaSfgsch #define	STP4020_ISR0_IOIS16	0x0004	/* IOIS16 signal live status (io) */
1701acdeabaSfgsch #define	STP4020_ISR0_WAITST	0x0002	/* wait signal live status */
1711acdeabaSfgsch #define	STP4020_ISR0_PWRON	0x0001	/* PC card power status */
1721acdeabaSfgsch 
17340f5a384Smickey #define STP4020_ISR0_IOBITS	"\010\1PWRON\2WAITST\3IOIS16\4IOREQ" \
17440f5a384Smickey     "\5STSCHG\6SPKR\7CD1ST\10CD2ST\11PCTO\12WPCHG\13RDYCHG\14BVD1CHG" \
17540f5a384Smickey     "\15BVD2CHG\16CDCHG\17SCINT\20IOINT"
17640f5a384Smickey #define STP4020_ISR0_MOBITS	"\010\1PWRON\2WAITST\3WPST\4RDYST" \
17740f5a384Smickey     "\5BVD1ST\6BVD2ST\7CD1ST\10CD2ST\11PCTO\12WPCHG\13RDYCHG\14BVD1CHG" \
17840f5a384Smickey     "\15BVD2CHG\16CDCHG\17SCINT"
1791acdeabaSfgsch 
1801acdeabaSfgsch /*
1811acdeabaSfgsch  * Socket Interface Status register 1
1821acdeabaSfgsch  */
1831acdeabaSfgsch #define	STP4020_ISR1_rsvd	0xffc0	/* reserved */
1841acdeabaSfgsch #define	STP4020_ISR1_PCTYPE_M	0x0030	/* PC card type(s) supported bit mask */
1851acdeabaSfgsch #define	STP4020_ISR1_PCTYPE_S	4	/* PC card type(s) supported bit shift */
1861acdeabaSfgsch #define	STP4020_ISR1_REV_M	0x000f	/* ASIC revision level bit mask */
1871acdeabaSfgsch #define	STP4020_ISR1_REV_S	0	/* ASIC revision level bit shift */
1881acdeabaSfgsch 
1891acdeabaSfgsch 
1901acdeabaSfgsch /*
1911acdeabaSfgsch  * Socket window control/status register definitions.
1921acdeabaSfgsch  *
1931acdeabaSfgsch  * According to SunOS 5.5:
1941acdeabaSfgsch  *	"Each PCMCIA socket has three windows associated with it; each of
1951acdeabaSfgsch  *	these windows can be programmed to map in either the AM, CM or IO
1961acdeabaSfgsch  *	space on the PC card.  Each window can also be programmed with a
1971acdeabaSfgsch  *	starting or base address relative to the PC card's address zero.
1981acdeabaSfgsch  *	Each window is a fixed 1Mb in size.
1991acdeabaSfgsch  *
2001acdeabaSfgsch  *	Each window has two window control registers associated with it to
2011acdeabaSfgsch  *	control the window's PCMCIA bus timing parameters, PC card address
2020f2aab0dStom  *	space that the window maps, and the base address in the
2031acdeabaSfgsch  *	selected PC card's address space."
2041acdeabaSfgsch  */
2051acdeabaSfgsch #define	STP4020_WINDOW_SIZE		(1024*1024) /* 1MB */
2061acdeabaSfgsch #define	STP4020_WINDOW_SHIFT	20	/* for 1MB */
2071acdeabaSfgsch 
2081acdeabaSfgsch /*
2091acdeabaSfgsch  * PC card Window Control register 0
2101acdeabaSfgsch  */
2111acdeabaSfgsch #define	STP4020_WCR0_rsvd	0x8000	/* reserved */
2121acdeabaSfgsch #define	STP4020_WCR0_CMDLNG_M	0x7c00	/* command strobe length bit mask */
2131acdeabaSfgsch #define	STP4020_WCR0_CMDLNG_S	10	/* command strobe length bit shift */
2141acdeabaSfgsch #define	STP4020_WCR0_CMDDLY_M	0x0300	/* command strobe delay bit mask */
2151acdeabaSfgsch #define	STP4020_WCR0_CMDDLY_S	8	/* command strobe delay bit shift */
2161acdeabaSfgsch #define	STP4020_MEM_SPEED_MIN	100
2171acdeabaSfgsch #define	STP4020_MEM_SPEED_MAX	1370
2181acdeabaSfgsch /*
2191acdeabaSfgsch  * The ASPSEL (Address Space Select) bits control which of the three PC card
2201acdeabaSfgsch  * address spaces this window maps in.
2211acdeabaSfgsch  */
2221acdeabaSfgsch #define	STP4020_WCR0_ASPSEL_M	0x00c0	/* address space select bit mask */
2231acdeabaSfgsch #define	 STP4020_WCR0_ASPSEL_AM	0x0000	/* attribute memory */
2241acdeabaSfgsch #define	 STP4020_WCR0_ASPSEL_CM	0x0040	/* common memory */
2251acdeabaSfgsch #define	 STP4020_WCR0_ASPSEL_IO	0x0080	/* I/O */
2261acdeabaSfgsch /*
2271acdeabaSfgsch  * The base address controls which 1MB range in the 64MB card address space
2281acdeabaSfgsch  * this window maps to.
2291acdeabaSfgsch  */
2301acdeabaSfgsch #define	STP4020_WCR0_BASE_M	0x0003f	/* base address bit mask */
2311acdeabaSfgsch #define	STP4020_WCR0_BASE_S	0	/* base address bit shift */
2321acdeabaSfgsch 
2331acdeabaSfgsch #define	STP4020_ADDR2PAGE(x)	((x) >> 20)
2341acdeabaSfgsch 
2351acdeabaSfgsch /*
2361acdeabaSfgsch  * PC card Window Control register 1
2371acdeabaSfgsch  */
2381acdeabaSfgsch #define	STP4020_WCR1_rsvd	0xffe0	/* reserved */
2391acdeabaSfgsch #define	STP4020_WCR1_RECDLY_M	0x0018	/* recovery delay bit mask */
2401acdeabaSfgsch #define	STP4020_WCR1_RECDLY_S	3	/* recovery delay bit shift */
2411acdeabaSfgsch #define	STP4020_WCR1_WAITDLY_M	0x0006	/* *WAIT signal delay bit mask */
2421acdeabaSfgsch #define	STP4020_WCR1_WAITDLY_S	1	/* *WAIT signal delay bit shift */
2431acdeabaSfgsch #define	STP4020_WCR1_WAITREQ_M	0x0001	/* *WAIT signal is required bit mask */
2441acdeabaSfgsch #define	STP4020_WCR1_WAITREQ_S	0	/* *WAIT signal is required bit shift */
2451acdeabaSfgsch 
2461acdeabaSfgsch #if for_reference_only
2471acdeabaSfgsch /*
2481acdeabaSfgsch  * STP4020 CSR structures
2491acdeabaSfgsch  *
2501acdeabaSfgsch  * There is one stp4020_regs_t structure per instance, and it refers to
2511acdeabaSfgsch  *	the complete Stp4020 register set.
2521acdeabaSfgsch  *
2531acdeabaSfgsch  * For each socket, there is one stp4020_socket_csr_t structure, which
2541acdeabaSfgsch  *	refers to all the registers for that socket.  That structure is
2551acdeabaSfgsch  *	made up of the window register structures as well as the registers
2561acdeabaSfgsch  *	that control overall socket operation.
2571acdeabaSfgsch  *
2581acdeabaSfgsch  * For each window, there is one stp4020_window_ctl_t structure, which
2591acdeabaSfgsch  *	refers to all the registers for that window.
2601acdeabaSfgsch  */
2611acdeabaSfgsch 
2621acdeabaSfgsch /*
2631acdeabaSfgsch  * per-window CSR structure
2641acdeabaSfgsch  */
2651acdeabaSfgsch typedef struct stp4020_window_ctl_t {
2661acdeabaSfgsch     volatile	ushort_t	ctl0;		/* window control register 0 */
2671acdeabaSfgsch     volatile	ushort_t	ctl1;		/* window control register 1 */
2681acdeabaSfgsch } stp4020_window_ctl_t;
2691acdeabaSfgsch 
2701acdeabaSfgsch /*
2711acdeabaSfgsch  * per-socket CSR structure
2721acdeabaSfgsch  */
2731acdeabaSfgsch typedef struct stp4020_socket_csr_t {
2741acdeabaSfgsch     volatile	struct stp4020_window_ctl_t	window[STP4020_NWIN];
2751acdeabaSfgsch     volatile	ushort_t	ctl0;		/* socket control register 0 */
2761acdeabaSfgsch     volatile	ushort_t	ctl1;		/* socket control register 1 */
2771acdeabaSfgsch     volatile	ushort_t	stat0;		/* socket status register 0 */
2781acdeabaSfgsch     volatile	ushort_t	stat1;		/* socket status register 1 */
2791acdeabaSfgsch     volatile	uchar_t	filler[12];	/* filler space */
2801acdeabaSfgsch } stp4020_socket_csr_t;
2811acdeabaSfgsch 
2821acdeabaSfgsch /*
2831acdeabaSfgsch  * per-instance CSR structure
2841acdeabaSfgsch  */
2851acdeabaSfgsch typedef struct stp4020_regs_t {
2861acdeabaSfgsch     struct stp4020_socket_csr_t	socket[STP4020_NSOCK];	/* socket CSRs */
2871acdeabaSfgsch } stp4020_regs_t;
2881acdeabaSfgsch #endif /* reference */
2891acdeabaSfgsch 
2901acdeabaSfgsch /* Size of control and status register banks */
2911acdeabaSfgsch #define STP4020_SOCKREGS_SIZE	32
2921acdeabaSfgsch #define STP4020_WINREGS_SIZE	 4
2931acdeabaSfgsch 
2941acdeabaSfgsch /* Relative socket control & status register offsets */
2951acdeabaSfgsch #define STP4020_ICR0_IDX	12
2961acdeabaSfgsch #define STP4020_ICR1_IDX	14
2971acdeabaSfgsch #define STP4020_ISR0_IDX	16
2981acdeabaSfgsch #define STP4020_ISR1_IDX	18
2991acdeabaSfgsch 
3001acdeabaSfgsch /* Relative Window control register offsets */
3011acdeabaSfgsch #define STP4020_WCR0_IDX	 0
3021acdeabaSfgsch #define STP4020_WCR1_IDX	 2
3031acdeabaSfgsch 
3041acdeabaSfgsch /* Socket control and status register offsets */
3051acdeabaSfgsch #define STP4020_ICR0_REG(s)	((32 * (s)) + STP4020_ICR0_IDX)
3061acdeabaSfgsch #define STP4020_ICR1_REG(s)	((32 * (s)) + STP4020_ICR1_IDX)
3071acdeabaSfgsch #define STP4020_ISR0_REG(s)	((32 * (s)) + STP4020_ISR0_IDX)
3081acdeabaSfgsch #define STP4020_ISR1_REG(s)	((32 * (s)) + STP4020_ISR1_IDX)
3091acdeabaSfgsch 
3101acdeabaSfgsch /* Window control and status registers; one set per socket */
3111acdeabaSfgsch #define STP4020_WCR0_REG(s,w)	((32 * (s)) + (4 * (w)) + STP4020_WCR0_IDX)
3121acdeabaSfgsch #define STP4020_WCR1_REG(s,w)	((32 * (s)) + (4 * (w)) + STP4020_WCR1_IDX)
3131acdeabaSfgsch 
3141acdeabaSfgsch #endif	/* _STP4020_REG_H */
315