162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * cirrus.h 1.4 1999/10/25 20:03:34
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci * The contents of this file are subject to the Mozilla Public License
562306a36Sopenharmony_ci * Version 1.1 (the "License"); you may not use this file except in
662306a36Sopenharmony_ci * compliance with the License. You may obtain a copy of the License
762306a36Sopenharmony_ci * at http://www.mozilla.org/MPL/
862306a36Sopenharmony_ci *
962306a36Sopenharmony_ci * Software distributed under the License is distributed on an "AS IS"
1062306a36Sopenharmony_ci * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
1162306a36Sopenharmony_ci * the License for the specific language governing rights and
1262306a36Sopenharmony_ci * limitations under the License.
1362306a36Sopenharmony_ci *
1462306a36Sopenharmony_ci * The initial developer of the original code is David A. Hinds
1562306a36Sopenharmony_ci * <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
1662306a36Sopenharmony_ci * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
1762306a36Sopenharmony_ci *
1862306a36Sopenharmony_ci * Alternatively, the contents of this file may be used under the
1962306a36Sopenharmony_ci * terms of the GNU General Public License version 2 (the "GPL"), in which
2062306a36Sopenharmony_ci * case the provisions of the GPL are applicable instead of the
2162306a36Sopenharmony_ci * above.  If you wish to allow the use of your version of this file
2262306a36Sopenharmony_ci * only under the terms of the GPL and not to allow others to use
2362306a36Sopenharmony_ci * your version of this file under the MPL, indicate your decision by
2462306a36Sopenharmony_ci * deleting the provisions above and replace them with the notice and
2562306a36Sopenharmony_ci * other provisions required by the GPL.  If you do not delete the
2662306a36Sopenharmony_ci * provisions above, a recipient may use your version of this file
2762306a36Sopenharmony_ci * under either the MPL or the GPL.
2862306a36Sopenharmony_ci */
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci#ifndef _LINUX_CIRRUS_H
3162306a36Sopenharmony_ci#define _LINUX_CIRRUS_H
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ci#define PD67_MISC_CTL_1		0x16	/* Misc control 1 */
3462306a36Sopenharmony_ci#define PD67_FIFO_CTL		0x17	/* FIFO control */
3562306a36Sopenharmony_ci#define PD67_MISC_CTL_2		0x1E	/* Misc control 2 */
3662306a36Sopenharmony_ci#define PD67_CHIP_INFO		0x1f	/* Chip information */
3762306a36Sopenharmony_ci#define PD67_ATA_CTL		0x026	/* 6730: ATA control */
3862306a36Sopenharmony_ci#define PD67_EXT_INDEX		0x2e	/* Extension index */
3962306a36Sopenharmony_ci#define PD67_EXT_DATA		0x2f	/* Extension data */
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci/* PD6722 extension registers -- indexed in PD67_EXT_INDEX */
4262306a36Sopenharmony_ci#define PD67_DATA_MASK0		0x01	/* Data mask 0 */
4362306a36Sopenharmony_ci#define PD67_DATA_MASK1		0x02	/* Data mask 1 */
4462306a36Sopenharmony_ci#define PD67_DMA_CTL		0x03	/* DMA control */
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci/* PD6730 extension registers -- indexed in PD67_EXT_INDEX */
4762306a36Sopenharmony_ci#define PD67_EXT_CTL_1		0x03	/* Extension control 1 */
4862306a36Sopenharmony_ci#define PD67_MEM_PAGE(n)	((n)+5)	/* PCI window bits 31:24 */
4962306a36Sopenharmony_ci#define PD67_EXTERN_DATA	0x0a
5062306a36Sopenharmony_ci#define PD67_MISC_CTL_3		0x25
5162306a36Sopenharmony_ci#define PD67_SMB_PWR_CTL	0x26
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci/* I/O window address offset */
5462306a36Sopenharmony_ci#define PD67_IO_OFF(w)		(0x36+((w)<<1))
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci/* Timing register sets */
5762306a36Sopenharmony_ci#define PD67_TIME_SETUP(n)	(0x3a + 3*(n))
5862306a36Sopenharmony_ci#define PD67_TIME_CMD(n)	(0x3b + 3*(n))
5962306a36Sopenharmony_ci#define PD67_TIME_RECOV(n)	(0x3c + 3*(n))
6062306a36Sopenharmony_ci
6162306a36Sopenharmony_ci/* Flags for PD67_MISC_CTL_1 */
6262306a36Sopenharmony_ci#define PD67_MC1_5V_DET		0x01	/* 5v detect */
6362306a36Sopenharmony_ci#define PD67_MC1_MEDIA_ENA	0x01	/* 6730: Multimedia enable */
6462306a36Sopenharmony_ci#define PD67_MC1_VCC_3V		0x02	/* 3.3v Vcc */
6562306a36Sopenharmony_ci#define PD67_MC1_PULSE_MGMT	0x04
6662306a36Sopenharmony_ci#define PD67_MC1_PULSE_IRQ	0x08
6762306a36Sopenharmony_ci#define PD67_MC1_SPKR_ENA	0x10
6862306a36Sopenharmony_ci#define PD67_MC1_INPACK_ENA	0x80
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_ci/* Flags for PD67_FIFO_CTL */
7162306a36Sopenharmony_ci#define PD67_FIFO_EMPTY		0x80
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci/* Flags for PD67_MISC_CTL_2 */
7462306a36Sopenharmony_ci#define PD67_MC2_FREQ_BYPASS	0x01
7562306a36Sopenharmony_ci#define PD67_MC2_DYNAMIC_MODE	0x02
7662306a36Sopenharmony_ci#define PD67_MC2_SUSPEND	0x04
7762306a36Sopenharmony_ci#define PD67_MC2_5V_CORE	0x08
7862306a36Sopenharmony_ci#define PD67_MC2_LED_ENA	0x10	/* IRQ 12 is LED enable */
7962306a36Sopenharmony_ci#define PD67_MC2_FAST_PCI	0x10	/* 6729: PCI bus > 25 MHz */
8062306a36Sopenharmony_ci#define PD67_MC2_3STATE_BIT7	0x20	/* Floppy change bit */
8162306a36Sopenharmony_ci#define PD67_MC2_DMA_MODE	0x40
8262306a36Sopenharmony_ci#define PD67_MC2_IRQ15_RI	0x80	/* IRQ 15 is ring enable */
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ci/* Flags for PD67_CHIP_INFO */
8562306a36Sopenharmony_ci#define PD67_INFO_SLOTS		0x20	/* 0 = 1 slot, 1 = 2 slots */
8662306a36Sopenharmony_ci#define PD67_INFO_CHIP_ID	0xc0
8762306a36Sopenharmony_ci#define PD67_INFO_REV		0x1c
8862306a36Sopenharmony_ci
8962306a36Sopenharmony_ci/* Fields in PD67_TIME_* registers */
9062306a36Sopenharmony_ci#define PD67_TIME_SCALE		0xc0
9162306a36Sopenharmony_ci#define PD67_TIME_SCALE_1	0x00
9262306a36Sopenharmony_ci#define PD67_TIME_SCALE_16	0x40
9362306a36Sopenharmony_ci#define PD67_TIME_SCALE_256	0x80
9462306a36Sopenharmony_ci#define PD67_TIME_SCALE_4096	0xc0
9562306a36Sopenharmony_ci#define PD67_TIME_MULT		0x3f
9662306a36Sopenharmony_ci
9762306a36Sopenharmony_ci/* Fields in PD67_DMA_CTL */
9862306a36Sopenharmony_ci#define PD67_DMA_MODE		0xc0
9962306a36Sopenharmony_ci#define PD67_DMA_OFF		0x00
10062306a36Sopenharmony_ci#define PD67_DMA_DREQ_INPACK	0x40
10162306a36Sopenharmony_ci#define PD67_DMA_DREQ_WP	0x80
10262306a36Sopenharmony_ci#define PD67_DMA_DREQ_BVD2	0xc0
10362306a36Sopenharmony_ci#define PD67_DMA_PULLUP		0x20	/* Disable socket pullups? */
10462306a36Sopenharmony_ci
10562306a36Sopenharmony_ci/* Fields in PD67_EXT_CTL_1 */
10662306a36Sopenharmony_ci#define PD67_EC1_VCC_PWR_LOCK	0x01
10762306a36Sopenharmony_ci#define PD67_EC1_AUTO_PWR_CLEAR	0x02
10862306a36Sopenharmony_ci#define PD67_EC1_LED_ENA	0x04
10962306a36Sopenharmony_ci#define PD67_EC1_INV_CARD_IRQ	0x08
11062306a36Sopenharmony_ci#define PD67_EC1_INV_MGMT_IRQ	0x10
11162306a36Sopenharmony_ci#define PD67_EC1_PULLUP_CTL	0x20
11262306a36Sopenharmony_ci
11362306a36Sopenharmony_ci/* Fields in PD67_MISC_CTL_3 */
11462306a36Sopenharmony_ci#define PD67_MC3_IRQ_MASK	0x03
11562306a36Sopenharmony_ci#define PD67_MC3_IRQ_PCPCI	0x00
11662306a36Sopenharmony_ci#define PD67_MC3_IRQ_EXTERN	0x01
11762306a36Sopenharmony_ci#define PD67_MC3_IRQ_PCIWAY	0x02
11862306a36Sopenharmony_ci#define PD67_MC3_IRQ_PCI	0x03
11962306a36Sopenharmony_ci#define PD67_MC3_PWR_MASK	0x0c
12062306a36Sopenharmony_ci#define PD67_MC3_PWR_SERIAL	0x00
12162306a36Sopenharmony_ci#define PD67_MC3_PWR_TI2202	0x08
12262306a36Sopenharmony_ci#define PD67_MC3_PWR_SMB	0x0c
12362306a36Sopenharmony_ci
12462306a36Sopenharmony_ci/* Register definitions for Cirrus PD6832 PCI-to-CardBus bridge */
12562306a36Sopenharmony_ci
12662306a36Sopenharmony_ci/* PD6832 extension registers -- indexed in PD67_EXT_INDEX */
12762306a36Sopenharmony_ci#define PD68_EXT_CTL_2			0x0b
12862306a36Sopenharmony_ci#define PD68_PCI_SPACE			0x22
12962306a36Sopenharmony_ci#define PD68_PCCARD_SPACE		0x23
13062306a36Sopenharmony_ci#define PD68_WINDOW_TYPE		0x24
13162306a36Sopenharmony_ci#define PD68_EXT_CSC			0x2e
13262306a36Sopenharmony_ci#define PD68_MISC_CTL_4			0x2f
13362306a36Sopenharmony_ci#define PD68_MISC_CTL_5			0x30
13462306a36Sopenharmony_ci#define PD68_MISC_CTL_6			0x31
13562306a36Sopenharmony_ci
13662306a36Sopenharmony_ci/* Extra flags in PD67_MISC_CTL_3 */
13762306a36Sopenharmony_ci#define PD68_MC3_HW_SUSP		0x10
13862306a36Sopenharmony_ci#define PD68_MC3_MM_EXPAND		0x40
13962306a36Sopenharmony_ci#define PD68_MC3_MM_ARM			0x80
14062306a36Sopenharmony_ci
14162306a36Sopenharmony_ci/* Bridge Control Register */
14262306a36Sopenharmony_ci#define  PD6832_BCR_MGMT_IRQ_ENA	0x0800
14362306a36Sopenharmony_ci
14462306a36Sopenharmony_ci/* Socket Number Register */
14562306a36Sopenharmony_ci#define PD6832_SOCKET_NUMBER		0x004c	/* 8 bit */
14662306a36Sopenharmony_ci
14762306a36Sopenharmony_ci#endif /* _LINUX_CIRRUS_H */
148