1139749Simp/*-
272017Scg * Copyright (c) 2000 Orion Hodson <O.Hodson@cs.ucl.ac.uk>
372017Scg * All rights reserved.
472017Scg *
572017Scg * Redistribution and use in source and binary forms, with or without
672017Scg * modification, are permitted provided that the following conditions
772017Scg * are met:
872017Scg * 1. Redistributions of source code must retain the above copyright
972017Scg *    notice, this list of conditions and the following disclaimer.
1072017Scg * 2. Redistributions in binary form must reproduce the above copyright
1172017Scg *    notice, this list of conditions and the following disclaimer in the
1272017Scg *    documentation and/or other materials provided with the distribution.
1372017Scg *
1472017Scg * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1572017Scg * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1672017Scg * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1772017Scg * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1872017Scg * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1972017Scg * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2072017Scg * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2172017Scg * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHERIN CONTRACT, STRICT
2272017Scg * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2372017Scg * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF
2472017Scg * SUCH DAMAGE.
2572017Scg *
2672017Scg * $FreeBSD$
2772017Scg */
2872017Scg
2972017Scg#ifndef _CS4281_H_
3072017Scg#define _CS4281_H_
3172017Scg
3272017Scg#define CS4281_PCI_ID 	0x60051013
3372017Scg
3472017Scg/* Ball Parks */
3572017Scg#define CS4281PCI_BA0_SIZE 	4096
3672017Scg#define CS4281PCI_BA1_SIZE	65536
3772017Scg
3872017Scg/* Register values */
3972017Scg#define CS4281PCI_HISR		0x000
4072017Scg#	define CS4281PCI_HISR_DMAI		0x00040000
4172017Scg#	define CS4281PCI_HISR_DMA(x)		(0x0100 << (x))
4272017Scg
4372017Scg#define CS4281PCI_HICR		0x008
4472017Scg#	define CS4281PCI_HICR_EOI		0x00000003
4572017Scg
4672017Scg#define CS4281PCI_HIMR		0x00c
4772017Scg#	define CS4281PCI_HIMR_DMAI		0x00040000
4872017Scg#	define CS4281PCI_HIMR_DMA(x)		(0x0100 << (x))
4972017Scg
5072017Scg#define CS4281PCI_IIER		0x010
5172017Scg
5272455Scg#define CS4281PCI_HDSR(x)	(0x0f0 + (x)*0x004)
5372017Scg#	define CS4281PCI_HDSR_CH1P		0x02000000
5472017Scg#	define CS4281PCI_HDSR_CH2P		0x01000000
5572017Scg#	define CS4281PCI_HDSR_HDTC		0x00020000
5672017Scg#	define CS4281PCI_HDSR_DTC		0x00010000
5772017Scg#	define CS4281PCI_HDSR_DRUN		0x00008000
5872017Scg#	define CS4281PCI_HDSR_RQ		0x00000080
5972017Scg
6072017Scg#define CS4281PCI_DCA(x)	(0x110 + (x) * 0x010)
6172017Scg#define CS4281PCI_DCC(x)	(0x114 + (x) * 0x010)
6272017Scg#define CS4281PCI_DBA(x)	(0x118 + (x) * 0x010)
6372017Scg#define CS4281PCI_DBC(x)	(0x11c + (x) * 0x010)
6472017Scg
6572017Scg#define CS4281PCI_DMR(x)	(0x150 + (x) * 0x008)
6672017Scg#	define CS4281PCI_DMR_DMA		0x20000000
6772017Scg#	define CS4281PCI_DMR_POLL		0x10000000
6872017Scg#	define CS4281PCI_DMR_TBC		0x02000000
6972017Scg#	define CS4281PCI_DMR_CBC		0x01000000
7072017Scg#	define CS4281PCI_DMR_SWAPC		0x00400000
7172017Scg#	define CS4281PCI_DMR_SIZE20		0x00100000
7272017Scg#	define CS4281PCI_DMR_USIGN		0x00080000
7372017Scg#	define CS4281PCI_DMR_BEND		0x00040000
7472017Scg#	define CS4281PCI_DMR_MONO		0x00020000
7572017Scg#	define CS4281PCI_DMR_SIZE8		0x00010000
7672017Scg#	define CS4281PCI_DMR_TYPE_DEMAND	0x00000000
7772017Scg#	define CS4281PCI_DMR_TYPE_SINGLE	0x00000040
7872017Scg#	define CS4281PCI_DMR_TYPE_BLOCK		0x00000080
7972017Scg#	define CS4281PCI_DMR_TYPE_CASCADE	0x000000c0
8072017Scg#	define CS4281PCI_DMR_DEC		0x00000020
8172017Scg#	define CS4281PCI_DMR_AUTO		0x00000010
8272017Scg#	define CS4281PCI_DMR_TR_PLAY		0x00000008
8372017Scg#	define CS4281PCI_DMR_TR_REC		0x00000004
8472017Scg
8572017Scg#define CS4281PCI_DCR(x)	(0x154 + (x) * 0x008)
8672017Scg#	define CS4281PCI_DCR_HTCIE		0x00020000
8772017Scg#	define CS4281PCI_DCR_TCIE		0x00010000
8872017Scg#	define CS4281PCI_DCR_MSK		0x00000001
8972017Scg
9072017Scg#define CS4281PCI_FCR(x)	(0x180 + (x) * 0x004)
9172017Scg#	define CS4281PCI_FCR_FEN		0x80000000
9272017Scg#	define CS4281PCI_FCR_DACZ		0x40000000
9372017Scg#	define CS4281PCI_FCR_PSH		0x20000000
9472017Scg#	define CS4281PCI_FCR_RS(x)		((x) << 24)
9572017Scg#	define CS4281PCI_FCR_LS(x)		((x) << 16)
9672017Scg#	define CS4281PCI_FCR_SZ(x)		((x) << 8)
9772017Scg#	define CS4281PCI_FCR_OF(x)		(x)
9872017Scg
9972017Scg#define CS4281PCI_FPDR(x)	(0x190 + (x) * 0x004)
10072017Scg
10172017Scg#define CS4281PCI_FCHS		0x20c
10272017Scg#define CS4281PCI_FSIC(x)	(0x210 + (x) * 0x004)
10372017Scg
10472455Scg#define CS4281PCI_PMCS		0x344
10572455Scg#	define CS4281PCI_PMCS_PS_MASK		0x00000003
10675702Sorion#define CS4281PCI_PMCS_OFFSET	(CS4281PCI_PMCS - 0x300)
10772017Scg
10872017Scg#define CS4281PCI_CWPR		0x3e0
10972017Scg#	define CS4281PCI_CWPR_MAGIC		0x00004281
11072017Scg
11172017Scg#define CS4281PCI_EPPMC		0x3e4
11272455Scg#	define CS4281PCI_EPPMC_FPDN		0x00004000
11372017Scg#define CS4281PCI_GPIOR		0x3e8
11472017Scg
11572455Scg#define CS4281PCI_SPMC		0x3ec
11672017Scg#	define CS4281PCI_SPMC_RSTN		0x00000001
11772017Scg#	define CS4281PCI_SPMC_ASYN		0x00000002
11872017Scg#	define CS4281PCI_SPMC_WUP1		0x00000004
11972017Scg#	define CS4281PCI_SPMC_WUP2		0x00000008
12072017Scg#	define CS4281PCI_SPMC_ASDO		0x00000080
12172017Scg#	define CS4281PCI_SPMC_ASDI2E		0x00000100
12272017Scg#	define CS4281PCI_SPMC_EESPD		0x00000200
12372017Scg#	define CS4281PCI_SPMC_GISPEN		0x00004000
12472017Scg#	define CS4281PCI_SPMC_GIPPEN		0x00008000
12572017Scg
12672017Scg#define CS4281PCI_CFLR		0x3f0
12772017Scg#define CS4281PCI_IISR		0x3f4
12872017Scg#define CS4281PCI_TMS		0x3f8
12972017Scg#define CS4281PCI_SSVID		0x3fc
13072017Scg
13172017Scg#define CS4281PCI_CLKCR1	0x400
13272017Scg#	define CS_4281PCI_CLKCR1_DLLSS_MASK	0x0000000c
13372017Scg#	define CS_4281PCI_CLKCR1_DLLSS_AC97	0x00000004
13472017Scg#	define CS4281PCI_CLKCR1_DLLP		0x00000010
13572017Scg#	define CS4281PCI_CLKCR1_SWCE		0x00000020
13672017Scg#	define CS4281PCI_CLKCR1_DLLOS		0x00000040
13772017Scg#	define CS4281PCI_CLKCR1_CKRA		0x00010000
13872017Scg#	define CS4281PCI_CLKCR1_DLLRDY		0x01000000
13972017Scg#	define CS4281PCI_CLKCR1_CLKON		0x02000000
14072017Scg
14172017Scg#define CS4281PCI_FRR		0x410
14272017Scg
14372017Scg#define CS4281PCI_SLT12O	0x41c
14472017Scg#define CS4281PCI_SERMC		0x420
14572017Scg#	define CS4281PCI_SERMC_PTC_AC97		0x00000002
14672017Scg#	define CS4281PCI_SERMC_PTC_MASK		0x0000000e
14772017Scg#	define CS4281PCI_SERMC_ODSEN1		0x01000000
14872017Scg#	define CS4281PCI_SERMC_ODSEN2		0x02000000
14972017Scg#define CS4281PCI_SERC1		0x428
15072017Scg#define CS4281PCI_SERC2		0x42c
15172017Scg
15272017Scg#define CS4281PCI_SLT12M	0x45c
15372017Scg#define CS4281PCI_ACCTL		0x460
15472017Scg#	define CS4281PCI_ACCTL_ESYN		0x00000002
15572017Scg#	define CS4281PCI_ACCTL_VFRM		0x00000004
15672017Scg#	define CS4281PCI_ACCTL_DCV		0x00000008
15772017Scg#	define CS4281PCI_ACCTL_CRW		0x00000010
15872017Scg#	define CS4281PCI_ACCTL_TC		0x00000040
15972017Scg
16072017Scg#define CS4281PCI_ACSTS		0x464
16172017Scg#	define CS4281PCI_ACSTS_CRDY		0x00000001
16272017Scg#	define CS4281PCI_ACSTS_VSTS		0x00000002
16372017Scg
16472017Scg#define CS4281PCI_ACOSV		0x468
16572455Scg#	define CS4281PCI_ACOSV_SLV(x)		(1 << (x - 3))
16672017Scg#define CS4281PCI_ACCAD		0x46c
16772017Scg#define CS4281PCI_ACCDA		0x470
16872017Scg#define CS4281PCI_ACISV		0x474
16972017Scg#	define CS4281PCI_ACISV_ISV(x)		(1 << (x - 3))
17072017Scg#define CS4281PCI_ACSAD		0x478
17172017Scg#define CS4281PCI_ACSDA		0x47c
17272017Scg#define CS4281PCI_JSPT		0x480
17372017Scg#define CS4281PCI_JSCTL		0x484
17472017Scg
17572017Scg#define CS4281PCI_SSPM		0x740
17672017Scg#	define CS4281PCI_SSPM_MIXEN		0x00000040
17772017Scg#	define CS4281PCI_SSPM_CSRCEN		0x00000020
17872017Scg#	define CS4281PCI_SSPM_PSRCEN		0x00000010
17972017Scg#	define CS4281PCI_SSPM_JSEN		0x00000008
18072017Scg#	define CS4281PCI_SSPM_ACLEN		0x00000004
18172017Scg#	define CS4281PCI_SSPM_FMEN		0x00000002
18272017Scg
18372017Scg#define CS4281PCI_DACSR		0x744
18472017Scg#define CS4281PCI_ADCSR		0x748
18572017Scg#define CS4281PCI_SSCR		0x74c
18672017Scg
18772017Scg#define CS4281PCI_SRCSA		0x75c
18872017Scg#	define CS4281PCI_SRCSA_PLSS(x)		(x)
18972017Scg#	define CS4281PCI_SRCSA_PRSS(x)		((x) << 8)
19072017Scg#	define CS4281PCI_SRCSA_CLSS(x)		((x) << 16)
19172017Scg#	define CS4281PCI_SRCSA_CRSS(x)		((x) << 24)
19272017Scg
19372017Scg#define CS4281PCI_PPLVC		0x760
19472017Scg#define CS4281PCI_PPRVC		0x764
19572017Scg
19672017Scg/* Slot definitions (minimal) */
19772017Scg#define CS4281PCI_LPCM_PLAY_SLOT	0x00
19872017Scg#define CS4281PCI_RPCM_PLAY_SLOT	0x01
19972017Scg
20072017Scg#define CS4281PCI_LPCM_REC_SLOT		0x0a
20172017Scg#define CS4281PCI_RPCM_REC_SLOT		0x0b
20272017Scg
20372017Scg#define CS4281PCI_DISABLED_SLOT		0x1f
20472017Scg
20572017Scg#endif /* _CS4281_H_ */
206