xref: /freebsd/sys/contrib/alpine-hal/al_hal_unit_adapter_regs.h (revision d002f039aeb370370cd2cba63ad55cc4cf16c932)
1f4b37ed0SZbigniew Bodek /*-
2f4b37ed0SZbigniew Bodek ********************************************************************************
3f4b37ed0SZbigniew Bodek Copyright (C) 2015 Annapurna Labs Ltd.
4f4b37ed0SZbigniew Bodek 
5f4b37ed0SZbigniew Bodek This file may be licensed under the terms of the Annapurna Labs Commercial
6f4b37ed0SZbigniew Bodek License Agreement.
7f4b37ed0SZbigniew Bodek 
8f4b37ed0SZbigniew Bodek Alternatively, this file can be distributed under the terms of the GNU General
9f4b37ed0SZbigniew Bodek Public License V2 as published by the Free Software Foundation and can be
10f4b37ed0SZbigniew Bodek found at http://www.gnu.org/licenses/gpl-2.0.html
11f4b37ed0SZbigniew Bodek 
12f4b37ed0SZbigniew Bodek Alternatively, redistribution and use in source and binary forms, with or
13f4b37ed0SZbigniew Bodek without modification, are permitted provided that the following conditions are
14f4b37ed0SZbigniew Bodek met:
15f4b37ed0SZbigniew Bodek 
16f4b37ed0SZbigniew Bodek     *     Redistributions of source code must retain the above copyright notice,
17f4b37ed0SZbigniew Bodek this list of conditions and the following disclaimer.
18f4b37ed0SZbigniew Bodek 
19f4b37ed0SZbigniew Bodek     *     Redistributions in binary form must reproduce the above copyright
20f4b37ed0SZbigniew Bodek notice, this list of conditions and the following disclaimer in
21f4b37ed0SZbigniew Bodek the documentation and/or other materials provided with the
22f4b37ed0SZbigniew Bodek distribution.
23f4b37ed0SZbigniew Bodek 
24f4b37ed0SZbigniew Bodek THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
25f4b37ed0SZbigniew Bodek ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26f4b37ed0SZbigniew Bodek WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27f4b37ed0SZbigniew Bodek DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
28f4b37ed0SZbigniew Bodek ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29f4b37ed0SZbigniew Bodek (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30f4b37ed0SZbigniew Bodek LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
31f4b37ed0SZbigniew Bodek ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32f4b37ed0SZbigniew Bodek (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33f4b37ed0SZbigniew Bodek SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34f4b37ed0SZbigniew Bodek 
35f4b37ed0SZbigniew Bodek *******************************************************************************/
36f4b37ed0SZbigniew Bodek 
37f4b37ed0SZbigniew Bodek #ifndef __AL_HAL_UNIT_ADAPTER_REGS_H__
38f4b37ed0SZbigniew Bodek #define __AL_HAL_UNIT_ADAPTER_REGS_H__
39f4b37ed0SZbigniew Bodek 
40f4b37ed0SZbigniew Bodek #ifdef __cplusplus
41f4b37ed0SZbigniew Bodek extern "C" {
42f4b37ed0SZbigniew Bodek #endif
43f4b37ed0SZbigniew Bodek 
44f4b37ed0SZbigniew Bodek #define AL_PCI_COMMAND		0x04	/* 16 bits */
45f4b37ed0SZbigniew Bodek #define  AL_PCI_COMMAND_IO		0x1	/* Enable response in I/O space */
46f4b37ed0SZbigniew Bodek #define  AL_PCI_COMMAND_MEMORY	0x2	/* Enable response in Memory space */
47f4b37ed0SZbigniew Bodek #define  AL_PCI_COMMAND_MASTER	0x4	/* Enable bus mastering */
48f4b37ed0SZbigniew Bodek 
49f4b37ed0SZbigniew Bodek #define PCI_CLASS_REVISION      0x08    /* High 24 bits are class, low 8 revision */
50f4b37ed0SZbigniew Bodek 
51f4b37ed0SZbigniew Bodek #define  AL_PCI_BASE_ADDRESS_SPACE_IO        0x01
52f4b37ed0SZbigniew Bodek #define  AL_PCI_BASE_ADDRESS_MEM_TYPE_64     0x04    /* 64 bit address */
53f4b37ed0SZbigniew Bodek #define  AL_PCI_BASE_ADDRESS_MEM_PREFETCH    0x08    /* prefetchable? */
54f4b37ed0SZbigniew Bodek #define  AL_PCI_BASE_ADDRESS_DEVICE_ID	     0x0c
55f4b37ed0SZbigniew Bodek 
56f4b37ed0SZbigniew Bodek #define  AL_PCI_BASE_ADDRESS_0			0x10
57f4b37ed0SZbigniew Bodek #define  AL_PCI_BASE_ADDRESS_0_HI		0x14
58f4b37ed0SZbigniew Bodek #define  AL_PCI_BASE_ADDRESS_2			0x18
59f4b37ed0SZbigniew Bodek #define  AL_PCI_BASE_ADDRESS_2_HI		0x1c
60f4b37ed0SZbigniew Bodek #define  AL_PCI_BASE_ADDRESS_4			0x20
61f4b37ed0SZbigniew Bodek #define  AL_PCI_BASE_ADDRESS_4_HI		0x24
62f4b37ed0SZbigniew Bodek 
63f4b37ed0SZbigniew Bodek #define	AL_PCI_EXP_ROM_BASE_ADDRESS		0x30
64f4b37ed0SZbigniew Bodek 
65f4b37ed0SZbigniew Bodek #define  AL_PCI_AXI_CFG_AND_CTR_0           0x110
66f4b37ed0SZbigniew Bodek #define  AL_PCI_AXI_CFG_AND_CTR_1           0x130
67f4b37ed0SZbigniew Bodek #define  AL_PCI_AXI_CFG_AND_CTR_2           0x150
68f4b37ed0SZbigniew Bodek #define  AL_PCI_AXI_CFG_AND_CTR_3           0x170
69f4b37ed0SZbigniew Bodek 
70f4b37ed0SZbigniew Bodek #define  AL_PCI_APP_CONTROL                 0x220
71f4b37ed0SZbigniew Bodek 
72f4b37ed0SZbigniew Bodek #define  AL_PCI_SRIOV_TOTAL_AND_INITIAL_VFS 0x30c
73f4b37ed0SZbigniew Bodek 
74f4b37ed0SZbigniew Bodek #define  AL_PCI_VF_BASE_ADDRESS_0           0x324
75f4b37ed0SZbigniew Bodek 
76f4b37ed0SZbigniew Bodek 
77f4b37ed0SZbigniew Bodek #define AL_PCI_EXP_CAP_BASE	0x40
78f4b37ed0SZbigniew Bodek #define AL_PCI_EXP_DEVCAP          4       /* Device capabilities */
79f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCAP_PAYLOAD 0x07    /* Max_Payload_Size */
80f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCAP_PHANTOM 0x18    /* Phantom functions */
81f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCAP_EXT_TAG 0x20    /* Extended tags */
82f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCAP_L0S     0x1c0   /* L0s Acceptable Latency */
83f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCAP_L1      0xe00   /* L1 Acceptable Latency */
84f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCAP_ATN_BUT 0x1000  /* Attention Button Present */
85f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCAP_ATN_IND 0x2000  /* Attention Indicator Present */
86f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCAP_PWR_IND 0x4000  /* Power Indicator Present */
87f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCAP_RBER    0x8000  /* Role-Based Error Reporting */
88f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000 /* Slot Power Limit Value */
89f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCAP_PWR_SCL 0xc000000 /* Slot Power Limit Scale */
90f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCAP_FLR     0x10000000 /* Function Level Reset */
91f4b37ed0SZbigniew Bodek #define AL_PCI_EXP_DEVCTL          8       /* Device Control */
92f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCTL_CERE    0x0001  /* Correctable Error Reporting En. */
93f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCTL_NFERE   0x0002  /* Non-Fatal Error Reporting Enable */
94f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCTL_FERE    0x0004  /* Fatal Error Reporting Enable */
95f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCTL_URRE    0x0008  /* Unsupported Request Reporting En. */
96f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCTL_RELAX_EN 0x0010 /* Enable relaxed ordering */
97f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCTL_PAYLOAD 0x00e0  /* Max_Payload_Size */
98f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCTL_EXT_TAG 0x0100  /* Extended Tag Field Enable */
99f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCTL_PHANTOM 0x0200  /* Phantom Functions Enable */
100f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCTL_AUX_PME 0x0400  /* Auxiliary Power PM Enable */
101f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800  /* Enable No Snoop */
102f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCTL_READRQ  0x7000  /* Max_Read_Request_Size */
103f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVCTL_BCR_FLR 0x8000  /* Bridge Configuration Retry / FLR */
104f4b37ed0SZbigniew Bodek #define AL_PCI_EXP_DEVSTA          0xA      /* Device Status */
105f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVSTA_CED     0x01    /* Correctable Error Detected */
106f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVSTA_NFED    0x02    /* Non-Fatal Error Detected */
107f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVSTA_FED     0x04    /* Fatal Error Detected */
108f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVSTA_URD     0x08    /* Unsupported Request Detected */
109f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVSTA_AUXPD   0x10    /* AUX Power Detected */
110f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_DEVSTA_TRPND   0x20    /* Transactions Pending */
111f4b37ed0SZbigniew Bodek #define AL_PCI_EXP_LNKCAP	   0xC	   /* Link Capabilities */
112f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKCAP_SLS	   0xf	   /* Supported Link Speeds */
113f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKCAP_SLS_2_5GB 0x1   /* LNKCAP2 SLS Vector bit 0 (2.5GT/s) */
114f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKCAP_SLS_5_0GB 0x2   /* LNKCAP2 SLS Vector bit 1 (5.0GT/s) */
115f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKCAP_MLW	   0x3f0   /* Maximum Link Width */
116f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKCAP_ASPMS   0xc00   /* ASPM Support */
117f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKCAP_L0SEL   0x7000  /* L0s Exit Latency */
118f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKCAP_L1EL	   0x38000 /* L1 Exit Latency */
119f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKCAP_CLKPM   0x40000 /* L1 Clock Power Management */
120f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKCAP_SDERC   0x80000 /* Surprise Down Error Reporting Capable */
121f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKCAP_DLLLARC 0x100000 /* Data Link Layer Link Active Reporting Capable */
122f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKCAP_LBNC	   0x200000 /* Link Bandwidth Notification Capability */
123f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKCAP_PN	   0xff000000 /* Port Number */
124f4b37ed0SZbigniew Bodek 
125f4b37ed0SZbigniew Bodek #define AL_PCI_EXP_LNKCTL          0x10      /* Link Control */
126f4b37ed0SZbigniew Bodek #define AL_PCI_EXP_LNKCTL_LNK_DIS  0x4       /* Link Disable Status */
127f4b37ed0SZbigniew Bodek #define AL_PCI_EXP_LNKCTL_LNK_RTRN 0x5       /* Link Retrain Status */
128f4b37ed0SZbigniew Bodek 
129f4b37ed0SZbigniew Bodek #define AL_PCI_EXP_LNKSTA            0x12      /* Link Status */
130f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKSTA_CLS       0x000f  /* Current Link Speed */
131f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKSTA_CLS_2_5GB 0x01    /* Current Link Speed 2.5GT/s */
132f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKSTA_CLS_5_0GB 0x02    /* Current Link Speed 5.0GT/s */
133f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKSTA_CLS_8_0GB 0x03    /* Current Link Speed 8.0GT/s */
134f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKSTA_NLW       0x03f0  /* Nogotiated Link Width */
135f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKSTA_NLW_SHIFT 4       /* start of NLW mask in link status */
136f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKSTA_LT        0x0800  /* Link Training */
137f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKSTA_SLC       0x1000  /* Slot Clock Configuration */
138f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKSTA_DLLLA     0x2000  /* Data Link Layer Link Active */
139f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKSTA_LBMS      0x4000  /* Link Bandwidth Management Status */
140f4b37ed0SZbigniew Bodek #define  AL_PCI_EXP_LNKSTA_LABS      0x8000  /* Link Autonomous Bandwidth Status */
141f4b37ed0SZbigniew Bodek 
142f4b37ed0SZbigniew Bodek #define AL_PCI_EXP_LNKCTL2           0x30      /* Link Control 2 */
143f4b37ed0SZbigniew Bodek 
144f4b37ed0SZbigniew Bodek #define AL_PCI_MSIX_MSGCTRL                 0            /* MSIX message control reg */
145f4b37ed0SZbigniew Bodek #define AL_PCI_MSIX_MSGCTRL_TBL_SIZE        0x7ff        /* MSIX table size */
146f4b37ed0SZbigniew Bodek #define AL_PCI_MSIX_MSGCTRL_TBL_SIZE_SHIFT  16           /* MSIX table size shift */
147f4b37ed0SZbigniew Bodek #define AL_PCI_MSIX_MSGCTRL_EN              0x80000000   /* MSIX enable */
148f4b37ed0SZbigniew Bodek #define AL_PCI_MSIX_MSGCTRL_MASK            0x40000000   /* MSIX mask */
149f4b37ed0SZbigniew Bodek 
150f4b37ed0SZbigniew Bodek #define AL_PCI_MSIX_TABLE            0x4          /* MSIX table offset and bar reg */
151f4b37ed0SZbigniew Bodek #define AL_PCI_MSIX_TABLE_OFFSET     0xfffffff8   /* MSIX table offset */
152f4b37ed0SZbigniew Bodek #define AL_PCI_MSIX_TABLE_BAR        0x7          /* MSIX table BAR */
153f4b37ed0SZbigniew Bodek 
154f4b37ed0SZbigniew Bodek #define AL_PCI_MSIX_PBA              0x8          /* MSIX pba offset and bar reg */
155f4b37ed0SZbigniew Bodek #define AL_PCI_MSIX_PBA_OFFSET       0xfffffff8   /* MSIX pba offset */
156f4b37ed0SZbigniew Bodek #define AL_PCI_MSIX_PBA_BAR          0x7          /* MSIX pba BAR */
157f4b37ed0SZbigniew Bodek 
158f4b37ed0SZbigniew Bodek 
159f4b37ed0SZbigniew Bodek /* Adapter power management register 0 */
160f4b37ed0SZbigniew Bodek #define AL_ADAPTER_PM_0				0x80
161f4b37ed0SZbigniew Bodek #define  AL_ADAPTER_PM_0_PM_NEXT_CAP_MASK	0xff00
162f4b37ed0SZbigniew Bodek #define  AL_ADAPTER_PM_0_PM_NEXT_CAP_SHIFT	8
163f4b37ed0SZbigniew Bodek #define  AL_ADAPTER_PM_0_PM_NEXT_CAP_VAL_MSIX	0x90
164f4b37ed0SZbigniew Bodek 
165f4b37ed0SZbigniew Bodek /* Adapter power management register 1 */
166f4b37ed0SZbigniew Bodek #define AL_ADAPTER_PM_1			0x84
167f4b37ed0SZbigniew Bodek #define  AL_ADAPTER_PM_1_PME_EN		0x100	/* PM enable */
168f4b37ed0SZbigniew Bodek #define  AL_ADAPTER_PM_1_PWR_STATE_MASK	0x3	/* PM state mask */
169f4b37ed0SZbigniew Bodek #define  AL_ADAPTER_PM_1_PWR_STATE_D3	0x3	/* PM D3 state */
170f4b37ed0SZbigniew Bodek 
171f4b37ed0SZbigniew Bodek /* Sub Master Configuration & Control */
172f4b37ed0SZbigniew Bodek #define AL_ADAPTER_SMCC				0x110
173f4b37ed0SZbigniew Bodek #define AL_ADAPTER_SMCC_CONF_2		0x114
174f4b37ed0SZbigniew Bodek 
175f4b37ed0SZbigniew Bodek /* Interrupt_Cause register */
176f4b37ed0SZbigniew Bodek #define AL_ADAPTER_INT_CAUSE			0x1B0
177f4b37ed0SZbigniew Bodek #define AL_ADAPTER_INT_CAUSE_WR_ERR		AL_BIT(1)
178f4b37ed0SZbigniew Bodek #define AL_ADAPTER_INT_CAUSE_RD_ERR		AL_BIT(0)
179f4b37ed0SZbigniew Bodek 
180f4b37ed0SZbigniew Bodek /* AXI_Master_Write_Error_Attribute_Latch register */
181f4b37ed0SZbigniew Bodek /* AXI_Master_Read_Error_Attribute_Latch register */
182f4b37ed0SZbigniew Bodek #define AL_ADAPTER_AXI_MSTR_WR_ERR_ATTR			0x1B4
183f4b37ed0SZbigniew Bodek #define AL_ADAPTER_AXI_MSTR_RD_ERR_ATTR			0x1B8
184f4b37ed0SZbigniew Bodek 
185f4b37ed0SZbigniew Bodek #define AL_ADAPTER_AXI_MSTR_RD_WR_ERR_ATTR_COMP_STAT_MASK	AL_FIELD_MASK(1, 0)
186f4b37ed0SZbigniew Bodek #define AL_ADAPTER_AXI_MSTR_RD_WR_ERR_ATTR_COMP_STAT_SHIFT	0
187f4b37ed0SZbigniew Bodek #define AL_ADAPTER_AXI_MSTR_RD_WR_ERR_ATTR_MSTR_ID_MASK		AL_FIELD_MASK(4, 2)
188f4b37ed0SZbigniew Bodek #define AL_ADAPTER_AXI_MSTR_RD_WR_ERR_ATTR_MSTR_ID_SHIFT	2
189f4b37ed0SZbigniew Bodek #define AL_ADAPTER_AXI_MSTR_RD_WR_ERR_ATTR_ADDR_TO		AL_BIT(8)
190f4b37ed0SZbigniew Bodek #define AL_ADAPTER_AXI_MSTR_RD_WR_ERR_ATTR_COMP_ERR		AL_BIT(9)
191f4b37ed0SZbigniew Bodek #define AL_ADAPTER_AXI_MSTR_RD_WR_ERR_ATTR_COMP_TO		AL_BIT(10)
192f4b37ed0SZbigniew Bodek #define AL_ADAPTER_AXI_MSTR_RD_WR_ERR_ATTR_ERR_BLK		AL_BIT(11)
193f4b37ed0SZbigniew Bodek #define AL_ADAPTER_AXI_MSTR_RD_ERR_ATTR_RD_PARITY_ERR		AL_BIT(12)
194f4b37ed0SZbigniew Bodek 
195f4b37ed0SZbigniew Bodek /* Interrupt_Cause_mask register */
196f4b37ed0SZbigniew Bodek #define AL_ADAPTER_INT_CAUSE_MASK		0x1BC
197f4b37ed0SZbigniew Bodek #define AL_ADAPTER_INT_CAUSE_MASK_WR_ERR	AL_BIT(1)
198f4b37ed0SZbigniew Bodek #define AL_ADAPTER_INT_CAUSE_MASK_RD_ERR	AL_BIT(0)
199f4b37ed0SZbigniew Bodek 
200f4b37ed0SZbigniew Bodek /* AXI_Master_write_error_address_Latch register */
201f4b37ed0SZbigniew Bodek #define AL_ADAPTER_AXI_MSTR_WR_ERR_LO_LATCH	0x1C0
202f4b37ed0SZbigniew Bodek 
203f4b37ed0SZbigniew Bodek /* AXI_Master_write_error_address_high_Latch register */
204f4b37ed0SZbigniew Bodek #define AL_ADAPTER_AXI_MSTR_WR_ERR_HI_LATCH	0x1C4
205f4b37ed0SZbigniew Bodek 
206f4b37ed0SZbigniew Bodek /* AXI_Master_read_error_address_Latch register */
207f4b37ed0SZbigniew Bodek #define AL_ADAPTER_AXI_MSTR_RD_ERR_LO_LATCH	0x1C8
208f4b37ed0SZbigniew Bodek 
209f4b37ed0SZbigniew Bodek /* AXI_Master_read_error_address_high_Latch register */
210f4b37ed0SZbigniew Bodek #define AL_ADAPTER_AXI_MSTR_RD_ERR_HI_LATCH	0x1CC
211f4b37ed0SZbigniew Bodek 
212f4b37ed0SZbigniew Bodek /* AXI_Master_Timeout register */
213f4b37ed0SZbigniew Bodek #define AL_ADAPTER_AXI_MSTR_TO			0x1D0
214f4b37ed0SZbigniew Bodek #define AL_ADAPTER_AXI_MSTR_TO_WR_MASK		AL_FIELD_MASK(31, 16)
215f4b37ed0SZbigniew Bodek #define AL_ADAPTER_AXI_MSTR_TO_WR_SHIFT		16
216f4b37ed0SZbigniew Bodek #define AL_ADAPTER_AXI_MSTR_TO_RD_MASK		AL_FIELD_MASK(15, 0)
217f4b37ed0SZbigniew Bodek #define AL_ADAPTER_AXI_MSTR_TO_RD_SHIFT		0
218f4b37ed0SZbigniew Bodek 
219f4b37ed0SZbigniew Bodek /*
220f4b37ed0SZbigniew Bodek  * Generic control registers
221f4b37ed0SZbigniew Bodek  */
222f4b37ed0SZbigniew Bodek 
223f4b37ed0SZbigniew Bodek /* Control 0 */
224f4b37ed0SZbigniew Bodek #define AL_ADAPTER_GENERIC_CONTROL_0			0x1E0
225f4b37ed0SZbigniew Bodek /* Control 2 */
226f4b37ed0SZbigniew Bodek #define AL_ADAPTER_GENERIC_CONTROL_2			0x1E8
227f4b37ed0SZbigniew Bodek /* Control 3 */
228f4b37ed0SZbigniew Bodek #define AL_ADAPTER_GENERIC_CONTROL_3			0x1EC
229f4b37ed0SZbigniew Bodek /* Control 9 */
230f4b37ed0SZbigniew Bodek #define AL_ADAPTER_GENERIC_CONTROL_9			0x218
231f4b37ed0SZbigniew Bodek /* Control 10 */
232f4b37ed0SZbigniew Bodek #define AL_ADAPTER_GENERIC_CONTROL_10			0x21C
233f4b37ed0SZbigniew Bodek /* Control 11 */
234f4b37ed0SZbigniew Bodek #define AL_ADAPTER_GENERIC_CONTROL_11			0x220
235f4b37ed0SZbigniew Bodek /* Control 12 */
236f4b37ed0SZbigniew Bodek #define AL_ADAPTER_GENERIC_CONTROL_12			0x224
237f4b37ed0SZbigniew Bodek /* Control 13 */
238f4b37ed0SZbigniew Bodek #define AL_ADAPTER_GENERIC_CONTROL_13			0x228
239f4b37ed0SZbigniew Bodek /* Control 14 */
240f4b37ed0SZbigniew Bodek #define AL_ADAPTER_GENERIC_CONTROL_14			0x22C
241f4b37ed0SZbigniew Bodek /* Control 15 */
242f4b37ed0SZbigniew Bodek #define AL_ADAPTER_GENERIC_CONTROL_15			0x230
243f4b37ed0SZbigniew Bodek /* Control 16 */
244f4b37ed0SZbigniew Bodek #define AL_ADAPTER_GENERIC_CONTROL_16			0x234
245f4b37ed0SZbigniew Bodek /* Control 17 */
246f4b37ed0SZbigniew Bodek #define AL_ADAPTER_GENERIC_CONTROL_17			0x238
247f4b37ed0SZbigniew Bodek /* Control 18 */
248f4b37ed0SZbigniew Bodek #define AL_ADAPTER_GENERIC_CONTROL_18			0x23C
249f4b37ed0SZbigniew Bodek /* Control 19 */
250f4b37ed0SZbigniew Bodek #define AL_ADAPTER_GENERIC_CONTROL_19			0x240
251f4b37ed0SZbigniew Bodek 
252f4b37ed0SZbigniew Bodek /* Enable clock gating */
253f4b37ed0SZbigniew Bodek #define AL_ADAPTER_GENERIC_CONTROL_0_CLK_GATE_EN	0x01
254f4b37ed0SZbigniew Bodek /* When set, all transactions through the PCI conf & mem BARs get timeout */
255f4b37ed0SZbigniew Bodek #define AL_ADAPTER_GENERIC_CONTROL_0_ADAPTER_DIS	0x40
256f4b37ed0SZbigniew Bodek #define AL_ADAPTER_GENERIC_CONTROL_0_ETH_RESET_1GMAC	AL_BIT(18)
257f4b37ed0SZbigniew Bodek #define AL_ADAPTER_GENERIC_CONTROL_0_ETH_RESET_1GMAC_ON_FLR	AL_BIT(26)
258f4b37ed0SZbigniew Bodek 
259f4b37ed0SZbigniew Bodek /*
260f4b37ed0SZbigniew Bodek  * SATA registers only
261f4b37ed0SZbigniew Bodek  */
262f4b37ed0SZbigniew Bodek /* Select 125MHz free running clock from IOFAB main PLL as SATA OOB clock
263f4b37ed0SZbigniew Bodek  * instead of using power management ref clock
264f4b37ed0SZbigniew Bodek  */
265f4b37ed0SZbigniew Bodek #define AL_ADAPTER_GENERIC_CONTROL_10_SATA_OOB_CLK_SEL	AL_BIT(26)
266f4b37ed0SZbigniew Bodek /* AXUSER selection and value per bit (1 = address, 0 = register) */
267f4b37ed0SZbigniew Bodek /* Rx */
268f4b37ed0SZbigniew Bodek #define AL_ADPTR_GEN_CTL_12_SATA_AWUSER_VAL_MASK	AL_FIELD_MASK(15, 0)
269f4b37ed0SZbigniew Bodek #define AL_ADPTR_GEN_CTL_12_SATA_AWUSER_VAL_SHIFT	0
270f4b37ed0SZbigniew Bodek #define AL_ADPTR_GEN_CTL_12_SATA_AWUSER_SEL_MASK	AL_FIELD_MASK(31, 16)
271f4b37ed0SZbigniew Bodek #define AL_ADPTR_GEN_CTL_12_SATA_AWUSER_SEL_SHIFT	16
272f4b37ed0SZbigniew Bodek /* Tx */
273f4b37ed0SZbigniew Bodek #define AL_ADPTR_GEN_CTL_13_SATA_ARUSER_VAL_MASK	AL_FIELD_MASK(15, 0)
274f4b37ed0SZbigniew Bodek #define AL_ADPTR_GEN_CTL_13_SATA_ARUSER_VAL_SHIFT	0
275f4b37ed0SZbigniew Bodek #define AL_ADPTR_GEN_CTL_13_SATA_ARUSER_SEL_MASK	AL_FIELD_MASK(31, 16)
276f4b37ed0SZbigniew Bodek #define AL_ADPTR_GEN_CTL_13_SATA_ARUSER_SEL_SHIFT	16
277*3fc36ee0SWojciech Macek /* Central Target-ID enabler. If set, then each entry will be used as programmed */
278*3fc36ee0SWojciech Macek #define AL_ADPTR_GEN_CTL_14_SATA_MSIX_TGTID_SEL		AL_BIT(0)
279*3fc36ee0SWojciech Macek /* Allow access to store Target-ID values per entry */
280*3fc36ee0SWojciech Macek #define AL_ADPTR_GEN_CTL_14_SATA_MSIX_TGTID_ACCESS_EN	AL_BIT(1)
281*3fc36ee0SWojciech Macek /* Target-ID Address select */
282f4b37ed0SZbigniew Bodek /* Tx */
283f4b37ed0SZbigniew Bodek #define AL_ADPTR_GEN_CTL_14_SATA_VM_ARADDR_SEL_MASK	AL_FIELD_MASK(13, 8)
284f4b37ed0SZbigniew Bodek #define AL_ADPTR_GEN_CTL_14_SATA_VM_ARADDR_SEL_SHIFT	8
285f4b37ed0SZbigniew Bodek /* Rx */
286f4b37ed0SZbigniew Bodek #define AL_ADPTR_GEN_CTL_14_SATA_VM_AWADDR_SEL_MASK	AL_FIELD_MASK(21, 16)
287f4b37ed0SZbigniew Bodek #define AL_ADPTR_GEN_CTL_14_SATA_VM_AWADDR_SEL_SHIFT	16
288f4b37ed0SZbigniew Bodek /* Address Value */
289f4b37ed0SZbigniew Bodek /* Rx */
290f4b37ed0SZbigniew Bodek #define AL_ADPTR_GEN_CTL_15_SATA_VM_AWDDR_HI	AL_FIELD_MASK(31, 0)
291f4b37ed0SZbigniew Bodek /* Tx */
292f4b37ed0SZbigniew Bodek #define AL_ADPTR_GEN_CTL_16_SATA_VM_ARDDR_HI	AL_FIELD_MASK(31, 0)
293f4b37ed0SZbigniew Bodek 
294f4b37ed0SZbigniew Bodek /*
295f4b37ed0SZbigniew Bodek  * ROB registers
296f4b37ed0SZbigniew Bodek  */
297*3fc36ee0SWojciech Macek /* Read ROB Enable, when disabled the read ROB is bypassed */
298f4b37ed0SZbigniew Bodek #define AL_ADPTR_GEN_CTL_19_READ_ROB_EN			AL_BIT(0)
299f4b37ed0SZbigniew Bodek /* Read force in-order of every read transaction */
300f4b37ed0SZbigniew Bodek #define AL_ADPTR_GEN_CTL_19_READ_ROB_FORCE_INORDER	AL_BIT(1)
301f4b37ed0SZbigniew Bodek /* Read software reset */
302f4b37ed0SZbigniew Bodek #define AL_ADPTR_GEN_CTL_19_READ_ROB_SW_RESET		AL_BIT(15)
303*3fc36ee0SWojciech Macek /* Write ROB Enable, when disabled the Write ROB is bypassed */
304f4b37ed0SZbigniew Bodek #define AL_ADPTR_GEN_CTL_19_WRITE_ROB_EN		AL_BIT(16)
305f4b37ed0SZbigniew Bodek /* Write force in-order of every write transaction */
306f4b37ed0SZbigniew Bodek #define AL_ADPTR_GEN_CTL_19_WRITE_ROB_FORCE_INORDER	AL_BIT(17)
307f4b37ed0SZbigniew Bodek /* Write software reset */
308f4b37ed0SZbigniew Bodek #define AL_ADPTR_GEN_CTL_19_WRITE_ROB_SW_RESET		AL_BIT(31)
309f4b37ed0SZbigniew Bodek 
310f4b37ed0SZbigniew Bodek #ifdef __cplusplus
311f4b37ed0SZbigniew Bodek }
312f4b37ed0SZbigniew Bodek #endif
313f4b37ed0SZbigniew Bodek 
314f4b37ed0SZbigniew Bodek #endif
315