xref: /freebsd/sys/dev/sound/pci/ich.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1098ca2bdSWarner Losh /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3718cf2ccSPedro F. Giffuni  *
441a019c0SCameron Grant  * Copyright (c) 2000 Katsurajima Naoto <raven@katsurajima.seya.yokohama.jp>
541a019c0SCameron Grant  * Copyright (c) 2001 Cameron Grant <cg@freebsd.org>
641a019c0SCameron Grant  * All rights reserved.
741a019c0SCameron Grant  *
841a019c0SCameron Grant  * Redistribution and use in source and binary forms, with or without
941a019c0SCameron Grant  * modification, are permitted provided that the following conditions
1041a019c0SCameron Grant  * are met:
1141a019c0SCameron Grant  * 1. Redistributions of source code must retain the above copyright
1241a019c0SCameron Grant  *    notice, this list of conditions and the following disclaimer.
1341a019c0SCameron Grant  * 2. Redistributions in binary form must reproduce the above copyright
1441a019c0SCameron Grant  *    notice, this list of conditions and the following disclaimer in the
1541a019c0SCameron Grant  *    documentation and/or other materials provided with the distribution.
1641a019c0SCameron Grant  *
1741a019c0SCameron Grant  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1841a019c0SCameron Grant  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1941a019c0SCameron Grant  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2041a019c0SCameron Grant  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2141a019c0SCameron Grant  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2241a019c0SCameron Grant  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2341a019c0SCameron Grant  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2441a019c0SCameron Grant  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHERIN CONTRACT, STRICT
2541a019c0SCameron Grant  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2641a019c0SCameron Grant  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF
2741a019c0SCameron Grant  * SUCH DAMAGE.
2841a019c0SCameron Grant  */
2941a019c0SCameron Grant 
3041a019c0SCameron Grant #define PCIR_NAMBAR 0x10
3141a019c0SCameron Grant #define PCIR_NABMBAR 0x14
3241a019c0SCameron Grant 
334cca7f0aSOrion Hodson #define PCIR_MMBAR 0x18
344cca7f0aSOrion Hodson #define PCIR_MBBAR 0x1C
354cca7f0aSOrion Hodson 
3614213e7dSOrion Hodson #define PCIR_ICH_LEGACY 0x41
3714213e7dSOrion Hodson #define ICH_LEGACY_ENABLE	0x01
3814213e7dSOrion Hodson 
3941a019c0SCameron Grant /* Native Audio Bus Master Control Registers */
4041a019c0SCameron Grant #define ICH_REG_X_BDBAR 0x00
4141a019c0SCameron Grant #define ICH_REG_X_CIV   0x04
4241a019c0SCameron Grant #define ICH_REG_X_LVI   0x05
4341a019c0SCameron Grant #define ICH_REG_X_SR    0x06
4441a019c0SCameron Grant #define ICH_REG_X_PICB  0x08
4541a019c0SCameron Grant #define ICH_REG_X_PIV   0x0a
4641a019c0SCameron Grant #define ICH_REG_X_CR    0x0b
4741a019c0SCameron Grant 
4841a019c0SCameron Grant #define ICH_REG_PI_BASE	0x00
4941a019c0SCameron Grant #define ICH_REG_PO_BASE	0x10
5041a019c0SCameron Grant #define ICH_REG_MC_BASE	0x20
5141a019c0SCameron Grant 
5241a019c0SCameron Grant #define ICH_REG_GLOB_CNT 0x2c
5341a019c0SCameron Grant #define ICH_REG_GLOB_STA 0x30
5441a019c0SCameron Grant #define ICH_REG_ACC_SEMA 0x34
5541a019c0SCameron Grant 
5641a019c0SCameron Grant /* Status Register Values */
5741a019c0SCameron Grant #define ICH_X_SR_DCH   0x0001
5841a019c0SCameron Grant #define ICH_X_SR_CELV  0x0002
5941a019c0SCameron Grant #define ICH_X_SR_LVBCI 0x0004
6041a019c0SCameron Grant #define ICH_X_SR_BCIS  0x0008
6141a019c0SCameron Grant #define ICH_X_SR_FIFOE 0x0010
6241a019c0SCameron Grant 
6341a019c0SCameron Grant /* Control Register Values */
6441a019c0SCameron Grant #define ICH_X_CR_RPBM  0x01
6541a019c0SCameron Grant #define ICH_X_CR_RR    0x02
6641a019c0SCameron Grant #define ICH_X_CR_LVBIE 0x04
6741a019c0SCameron Grant #define ICH_X_CR_FEIE  0x08
6841a019c0SCameron Grant #define ICH_X_CR_IOCE  0x10
6941a019c0SCameron Grant 
7041a019c0SCameron Grant /* Global Control Register Values */
7141a019c0SCameron Grant #define ICH_GLOB_CTL_GIE  0x00000001
7241a019c0SCameron Grant #define ICH_GLOB_CTL_COLD 0x00000002 /* negate */
7341a019c0SCameron Grant #define ICH_GLOB_CTL_WARM 0x00000004
7441a019c0SCameron Grant #define ICH_GLOB_CTL_SHUT 0x00000008
7541a019c0SCameron Grant #define ICH_GLOB_CTL_PRES 0x00000010
7641a019c0SCameron Grant #define ICH_GLOB_CTL_SRES 0x00000020
7741a019c0SCameron Grant 
7841a019c0SCameron Grant /* Global Status Register Values */
7941a019c0SCameron Grant #define ICH_GLOB_STA_GSCI   0x00000001
8041a019c0SCameron Grant #define ICH_GLOB_STA_MIINT  0x00000002
8141a019c0SCameron Grant #define ICH_GLOB_STA_MOINT  0x00000004
8241a019c0SCameron Grant #define ICH_GLOB_STA_PIINT  0x00000020
8341a019c0SCameron Grant #define ICH_GLOB_STA_POINT  0x00000040
8441a019c0SCameron Grant #define ICH_GLOB_STA_MINT   0x00000080
8541a019c0SCameron Grant #define ICH_GLOB_STA_PCR    0x00000100
8641a019c0SCameron Grant #define ICH_GLOB_STA_SCR    0x00000200
8741a019c0SCameron Grant #define ICH_GLOB_STA_PRES   0x00000400
8841a019c0SCameron Grant #define ICH_GLOB_STA_SRES   0x00000800
8941a019c0SCameron Grant #define ICH_GLOB_STA_SLOT12 0x00007000
9041a019c0SCameron Grant #define ICH_GLOB_STA_RCODEC 0x00008000
9141a019c0SCameron Grant #define ICH_GLOB_STA_AD3    0x00010000
9241a019c0SCameron Grant #define ICH_GLOB_STA_MD3    0x00020000
9341a019c0SCameron Grant #define ICH_GLOB_STA_IMASK  (ICH_GLOB_STA_MIINT | ICH_GLOB_STA_MOINT | ICH_GLOB_STA_PIINT | ICH_GLOB_STA_POINT | ICH_GLOB_STA_MINT | ICH_GLOB_STA_PRES | ICH_GLOB_STA_SRES)
9441a019c0SCameron Grant 
9541a019c0SCameron Grant /* play/record buffer */
9641a019c0SCameron Grant #define ICH_BDC_IOC 0x80000000
9741a019c0SCameron Grant #define ICH_BDC_BUP 0x40000000
98