cardbusreg.h revision 1.8 1 1.8 andvar /* $NetBSD: cardbusreg.h,v 1.8 2023/05/06 22:17:28 andvar Exp $ */
2 1.1 haya
3 1.1 haya /*
4 1.1 haya * Copyright (c) 2001
5 1.1 haya * HAYAKAWA Koichi. All rights reserved.
6 1.1 haya *
7 1.1 haya * Redistribution and use in source and binary forms, with or without
8 1.1 haya * modification, are permitted provided that the following conditions
9 1.1 haya * are met:
10 1.1 haya * 1. Redistributions of source code must retain the above copyright
11 1.1 haya * notice, this list of conditions and the following disclaimer.
12 1.1 haya * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 haya * notice, this list of conditions and the following disclaimer in the
14 1.1 haya * documentation and/or other materials provided with the distribution.
15 1.1 haya *
16 1.1 haya * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 1.1 haya * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 1.1 haya * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 1.1 haya * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
20 1.1 haya * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 1.1 haya * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 1.1 haya * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 1.1 haya * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
24 1.1 haya * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
25 1.1 haya * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 1.1 haya * POSSIBILITY OF SUCH DAMAGE.
27 1.1 haya */
28 1.1 haya
29 1.1 haya #ifndef _DEV_CARDBUS_CARDBUSREG_H_
30 1.1 haya #define _DEV_CARDBUS_CARDBUSREG_H_
31 1.1 haya
32 1.1 haya #include <dev/pci/pcivar.h> /* for pcitag_t */
33 1.1 haya
34 1.8 andvar /* Base Registers */
35 1.1 haya #define CARDBUS_CIS_REG 0x28
36 1.1 haya #define CARDBUS_ROM_REG 0x30
37 1.1 haya # define CARDBUS_CIS_ASIMASK 0x07
38 1.1 haya # define CARDBUS_CIS_ASI(x) (CARDBUS_CIS_ASIMASK & (x))
39 1.1 haya # define CARDBUS_CIS_ASI_TUPLE 0x00
40 1.1 haya # define CARDBUS_CIS_ASI_BAR0 0x01
41 1.1 haya # define CARDBUS_CIS_ASI_BAR1 0x02
42 1.1 haya # define CARDBUS_CIS_ASI_BAR2 0x03
43 1.1 haya # define CARDBUS_CIS_ASI_BAR3 0x04
44 1.1 haya # define CARDBUS_CIS_ASI_BAR4 0x05
45 1.1 haya # define CARDBUS_CIS_ASI_BAR5 0x06
46 1.1 haya # define CARDBUS_CIS_ASI_ROM 0x07
47 1.1 haya # define CARDBUS_CIS_ADDRMASK 0x0ffffff8
48 1.1 haya # define CARDBUS_CIS_ADDR(x) (CARDBUS_CIS_ADDRMASK & (x))
49 1.6 dyoung # define CARDBUS_CIS_ASI_BAR(x) (((CARDBUS_CIS_ASIMASK & (x))-1)*4+PCI_BAR0)
50 1.1 haya # define CARDBUS_CIS_ASI_ROM_IMAGE(x) (((x) >> 28) & 0xf)
51 1.1 haya
52 1.1 haya #endif /* !_DEV_CARDBUS_CARDBUSREG_H_ */
53