/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Thomas.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _SPARC_DEV_TS102REG_H
#define _SPARC_DEV_TS102REG_H
/* The TS102 consumes a 256MB region of the SPARCbook 3's address space.
*/
#define TS102_OFFSET_REGISTERS 0x02000000
#define TS102_OFFSET_CARD_A_ATTR_SPACE 0x04000000
#define TS102_OFFSET_CARD_B_ATTR_SPACE 0x05000000
#define TS102_SIZE_ATTR_SPACE 0x01000000
#define TS102_OFFSET_CARD_A_IO_SPACE 0x06000000
#define TS102_OFFSET_CARD_B_IO_SPACE 0x07000000
#define TS102_SIZE_IO_SPACE 0x01000000
#define TS102_OFFSET_CARD_A_MEM_SPACE 0x08000000
#define TS102_OFFSET_CARD_B_MEM_SPACE 0x0c000000
#define TS102_SIZE_MEM_SPACE 0x04000000
/* There are two separate register blocks within the TS102. The first
* gives access to PCMCIA card specific resources, and the second gives
* access to the microcontroller interface
*/
#define TS102_REG_CARD_A_INT 0x0000 /* Card A Interrupt Register */
#define TS102_REG_CARD_A_STS 0x0004 /* Card A Status Register */
#define TS102_REG_CARD_A_CTL 0x0008 /* Card A Control Register */
#define TS102_REG_CARD_B_INT 0x0010 /* Card B Interrupt Register */
#define TS102_REG_CARD_B_STS 0x0014 /* Card B Status Register */
#define TS102_REG_CARD_B_CTL 0x0018 /* Card B Control Register */
#define TS102_REG_UCTRL_INT 0x0020 /* Microcontroller Interrupt Register */
#define TS102_REG_UCTRL_DATA 0x0024 /* Microcontroller Data Register */
#define TS102_REG_UCTRL_STS 0x0028 /* Microcontroller Status Register */
/* TS102 Card Interrupt Register definitions.
*
* There is one 16-bit interrupt register for each card. Each register
* contains interrupt status (read) and clear (write) bits and an
* interrupt mask for each of the four interrupt sources.
*
* The request bit is the logical AND of the status and the mask bit,
* and indicated and an interrupt is being requested. The mask bits
* allow masking of individual interrupts. An interrupt is enabled when
* the mask is set to 1 and is clear by write a 1 to the associated
* request bit.
*
* The card interrupt register also contain the soft reset flag.
* Setting this bit to 1 will the SPARCbook 3 to be reset.
*/
#define TS102_CARD_INT_RQST_IRQ 0x0001
#define TS102_CARD_INT_RQST_WP_STATUS_CHANGED 0x0002
#define TS102_CARD_INT_RQST_BATTERY_STATUS_CHANGED 0x0004
#define TS102_CARD_INT_RQST_CARDDETECT_STATUS_CHANGED 0x0008
#define TS102_CARD_INT_STATUS_IRQ 0x0010
#define TS102_CARD_INT_STATUS_WP_STATUS_CHANGED 0x0020
#define TS102_CARD_INT_STATUS_BATTERY_STATUS_CHANGED 0x0040
#define TS102_CARD_INT_STATUS_CARDDETECT_STATUS_CHANGED 0x0080
#define TS102_CARD_INT_MASK_IRQ 0x0100
#define TS102_CARD_INT_MASK_WP_STATUS 0x0200
#define TS102_CARD_INT_MASK_BATTERY_STATUS 0x0400
#define TS102_CARD_INT_MASK_CARDDETECT_STATUS 0x0800
#define TS102_CARD_INT_SOFT_RESET 0x1000