bridge.h revision 224110
1224110Sjchandra/*-
2224110Sjchandra * Copyright 2003-2011 Netlogic Microsystems (Netlogic). All rights
3224110Sjchandra * reserved.
4224110Sjchandra *
5224110Sjchandra * Redistribution and use in source and binary forms, with or without
6224110Sjchandra * modification, are permitted provided that the following conditions are
7224110Sjchandra * met:
8224110Sjchandra *
9224110Sjchandra * 1. Redistributions of source code must retain the above copyright
10224110Sjchandra *    notice, this list of conditions and the following disclaimer.
11224110Sjchandra * 2. Redistributions in binary form must reproduce the above copyright
12224110Sjchandra *    notice, this list of conditions and the following disclaimer in
13224110Sjchandra *    the documentation and/or other materials provided with the
14224110Sjchandra *    distribution.
15224110Sjchandra *
16224110Sjchandra * THIS SOFTWARE IS PROVIDED BY Netlogic Microsystems ``AS IS'' AND
17224110Sjchandra * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18224110Sjchandra * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19224110Sjchandra * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE
20224110Sjchandra * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21224110Sjchandra * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22224110Sjchandra * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23224110Sjchandra * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24224110Sjchandra * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25224110Sjchandra * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26224110Sjchandra * THE POSSIBILITY OF SUCH DAMAGE.
27224110Sjchandra *
28224110Sjchandra * $FreeBSD: head/sys/mips/nlm/hal/bridge.h 224110 2011-07-16 19:35:44Z jchandra $
29224110Sjchandra * NETLOGIC_BSD */
30224110Sjchandra
31224110Sjchandra#ifndef __NLM_BRIDGE_H__
32224110Sjchandra#define __NLM_BRIDGE_H__
33224110Sjchandra
34224110Sjchandra/**
35224110Sjchandra* @file_name mio.h
36224110Sjchandra* @author Netlogic Microsystems
37224110Sjchandra* @brief Basic definitions of XLP memory and io subsystem
38224110Sjchandra*/
39224110Sjchandra
40224110Sjchandra/* BRIDGE specific registers */
41224110Sjchandra#define XLP_BRIDGE_MODE_REG			0x40
42224110Sjchandra#define XLP_BRIDGE_PCI_CFG_BASE_REG		0x41
43224110Sjchandra#define XLP_BRIDGE_PCI_CFG_LIMIT_REG		0x42
44224110Sjchandra#define XLP_BRIDGE_PCIE_CFG_BASE_REG		0x43
45224110Sjchandra#define XLP_BRIDGE_PCIE_CFG_LIMIT_REG		0x44
46224110Sjchandra#define XLP_BRIDGE_BUSNUM_BAR0_REG		0x45
47224110Sjchandra#define XLP_BRIDGE_BUSNUM_BAR1_REG		0x46
48224110Sjchandra#define XLP_BRIDGE_BUSNUM_BAR2_REG		0x47
49224110Sjchandra#define XLP_BRIDGE_BUSNUM_BAR3_REG		0x48
50224110Sjchandra#define XLP_BRIDGE_BUSNUM_BAR4_REG		0x49
51224110Sjchandra#define XLP_BRIDGE_BUSNUM_BAR5_REG		0x4a
52224110Sjchandra#define XLP_BRIDGE_BUSNUM_BAR6_REG		0x4b
53224110Sjchandra#define XLP_BRIDGE_FLASH_BAR0_REG		0x4c
54224110Sjchandra#define XLP_BRIDGE_FLASH_BAR1_REG		0x4d
55224110Sjchandra#define XLP_BRIDGE_FLASH_BAR2_REG		0x4e
56224110Sjchandra#define XLP_BRIDGE_FLASH_BAR3_REG		0x4f
57224110Sjchandra#define XLP_BRIDGE_FLASH_LIMIT0_REG		0x50
58224110Sjchandra#define XLP_BRIDGE_FLASH_LIMIT1_REG		0x51
59224110Sjchandra#define XLP_BRIDGE_FLASH_LIMIT2_REG		0x52
60224110Sjchandra#define XLP_BRIDGE_FLASH_LIMIT3_REG		0x53
61224110Sjchandra
62224110Sjchandra#define XLP_BRIDGE_DRAM_BAR_REG(i)		(0x54 + (i))
63224110Sjchandra#define XLP_BRIDGE_DRAM_BAR0_REG		0x54
64224110Sjchandra#define XLP_BRIDGE_DRAM_BAR1_REG		0x55
65224110Sjchandra#define XLP_BRIDGE_DRAM_BAR2_REG		0x56
66224110Sjchandra#define XLP_BRIDGE_DRAM_BAR3_REG		0x57
67224110Sjchandra#define XLP_BRIDGE_DRAM_BAR4_REG		0x58
68224110Sjchandra#define XLP_BRIDGE_DRAM_BAR5_REG		0x59
69224110Sjchandra#define XLP_BRIDGE_DRAM_BAR6_REG		0x5a
70224110Sjchandra#define XLP_BRIDGE_DRAM_BAR7_REG		0x5b
71224110Sjchandra
72224110Sjchandra#define XLP_BRIDGE_DRAM_LIMIT_REG(i)		(0x5c + (i))
73224110Sjchandra#define XLP_BRIDGE_DRAM_LIMIT0_REG		0x5c
74224110Sjchandra#define XLP_BRIDGE_DRAM_LIMIT1_REG		0x5d
75224110Sjchandra#define XLP_BRIDGE_DRAM_LIMIT2_REG		0x5e
76224110Sjchandra#define XLP_BRIDGE_DRAM_LIMIT3_REG		0x5f
77224110Sjchandra#define XLP_BRIDGE_DRAM_LIMIT4_REG		0x60
78224110Sjchandra#define XLP_BRIDGE_DRAM_LIMIT5_REG		0x61
79224110Sjchandra#define XLP_BRIDGE_DRAM_LIMIT6_REG		0x62
80224110Sjchandra#define XLP_BRIDGE_DRAM_LIMIT7_REG		0x63
81224110Sjchandra
82224110Sjchandra#define XLP_BRIDGE_DRAM_NODE_TRANSLN0_REG	0x64
83224110Sjchandra#define XLP_BRIDGE_DRAM_NODE_TRANSLN1_REG	0x65
84224110Sjchandra#define XLP_BRIDGE_DRAM_NODE_TRANSLN2_REG	0x66
85224110Sjchandra#define XLP_BRIDGE_DRAM_NODE_TRANSLN3_REG	0x67
86224110Sjchandra#define XLP_BRIDGE_DRAM_NODE_TRANSLN4_REG	0x68
87224110Sjchandra#define XLP_BRIDGE_DRAM_NODE_TRANSLN5_REG	0x69
88224110Sjchandra#define XLP_BRIDGE_DRAM_NODE_TRANSLN6_REG	0x6a
89224110Sjchandra#define XLP_BRIDGE_DRAM_NODE_TRANSLN7_REG	0x6b
90224110Sjchandra#define XLP_BRIDGE_DRAM_CHNL_TRANSLN0_REG	0x6c
91224110Sjchandra#define XLP_BRIDGE_DRAM_CHNL_TRANSLN1_REG	0x6d
92224110Sjchandra#define XLP_BRIDGE_DRAM_CHNL_TRANSLN2_REG	0x6e
93224110Sjchandra#define XLP_BRIDGE_DRAM_CHNL_TRANSLN3_REG	0x6f
94224110Sjchandra#define XLP_BRIDGE_DRAM_CHNL_TRANSLN4_REG	0x70
95224110Sjchandra#define XLP_BRIDGE_DRAM_CHNL_TRANSLN5_REG	0x71
96224110Sjchandra#define XLP_BRIDGE_DRAM_CHNL_TRANSLN6_REG	0x72
97224110Sjchandra#define XLP_BRIDGE_DRAM_CHNL_TRANSLN7_REG	0x73
98224110Sjchandra#define XLP_BRIDGE_PCIEMEM_BASE0_REG		0x74
99224110Sjchandra#define XLP_BRIDGE_PCIEMEM_BASE1_REG		0x75
100224110Sjchandra#define XLP_BRIDGE_PCIEMEM_BASE2_REG		0x76
101224110Sjchandra#define XLP_BRIDGE_PCIEMEM_BASE3_REG		0x77
102224110Sjchandra#define XLP_BRIDGE_PCIEMEM_LIMIT0_REG		0x78
103224110Sjchandra#define XLP_BRIDGE_PCIEMEM_LIMIT1_REG		0x79
104224110Sjchandra#define XLP_BRIDGE_PCIEMEM_LIMIT2_REG		0x7a
105224110Sjchandra#define XLP_BRIDGE_PCIEMEM_LIMIT3_REG		0x7b
106224110Sjchandra#define XLP_BRIDGE_PCIEIO_BASE0_REG		0x7c
107224110Sjchandra#define XLP_BRIDGE_PCIEIO_BASE1_REG		0x7d
108224110Sjchandra#define XLP_BRIDGE_PCIEIO_BASE2_REG		0x7e
109224110Sjchandra#define XLP_BRIDGE_PCIEIO_BASE3_REG		0x7f
110224110Sjchandra#define XLP_BRIDGE_PCIEIO_LIMIT0_REG		0x80
111224110Sjchandra#define XLP_BRIDGE_PCIEIO_LIMIT1_REG		0x81
112224110Sjchandra#define XLP_BRIDGE_PCIEIO_LIMIT2_REG		0x82
113224110Sjchandra#define XLP_BRIDGE_PCIEIO_LIMIT3_REG		0x83
114224110Sjchandra#define XLP_BRIDGE_PCIEMEM_BASE4_REG		0x84
115224110Sjchandra#define XLP_BRIDGE_PCIEMEM_BASE5_REG		0x85
116224110Sjchandra#define XLP_BRIDGE_PCIEMEM_BASE6_REG		0x86
117224110Sjchandra#define XLP_BRIDGE_PCIEMEM_LIMIT4_REG		0x87
118224110Sjchandra#define XLP_BRIDGE_PCIEMEM_LIMIT5_REG		0x88
119224110Sjchandra#define XLP_BRIDGE_PCIEMEM_LIMIT6_REG		0x89
120224110Sjchandra#define XLP_BRIDGE_PCIEIO_BASE4_REG		0x8a
121224110Sjchandra#define XLP_BRIDGE_PCIEIO_BASE5_REG		0x8b
122224110Sjchandra#define XLP_BRIDGE_PCIEIO_BASE6_REG		0x8c
123224110Sjchandra#define XLP_BRIDGE_PCIEIO_LIMIT4_REG		0x8d
124224110Sjchandra#define XLP_BRIDGE_PCIEIO_LIMIT5_REG		0x8e
125224110Sjchandra#define XLP_BRIDGE_PCIEIO_LIMIT6_REG		0x8f
126224110Sjchandra#define XLP_BRIDGE_NBU_EVENT_CNT_CTL_REG	0x90
127224110Sjchandra#define XLP_BRIDGE_EVNTCTR1_LOW_REG		0x91
128224110Sjchandra#define XLP_BRIDGE_EVNTCTR1_HI_REG		0x92
129224110Sjchandra#define XLP_BRIDGE_EVNT_CNT_CTL2_REG		0x93
130224110Sjchandra#define XLP_BRIDGE_EVNTCTR2_LOW_REG		0x94
131224110Sjchandra#define XLP_BRIDGE_EVNTCTR2_HI_REG		0x95
132224110Sjchandra#define XLP_BRIDGE_TRACEBUF_MATCH_REG0		0x96
133224110Sjchandra#define XLP_BRIDGE_TRACEBUF_MATCH_REG1		0x97
134224110Sjchandra#define XLP_BRIDGE_TRACEBUF_MATCH_LOW_REG	0x98
135224110Sjchandra#define XLP_BRIDGE_TRACEBUF_MATCH_HI_REG	0x99
136224110Sjchandra#define XLP_BRIDGE_TRACEBUF_CTRL_REG		0x9a
137224110Sjchandra#define XLP_BRIDGE_TRACEBUF_INIT_REG		0x9b
138224110Sjchandra#define XLP_BRIDGE_TRACEBUF_ACCESS_REG		0x9c
139224110Sjchandra#define XLP_BRIDGE_TRACEBUF_READ_DATA_REG0	0x9d
140224110Sjchandra#define XLP_BRIDGE_TRACEBUF_READ_DATA_REG1	0x9d
141224110Sjchandra#define XLP_BRIDGE_TRACEBUF_READ_DATA_REG2	0x9f
142224110Sjchandra#define XLP_BRIDGE_TRACEBUF_READ_DATA_REG3	0xa0
143224110Sjchandra#define XLP_BRIDGE_TRACEBUF_STATUS_REG		0xa1
144224110Sjchandra#define XLP_BRIDGE_ADDRESS_ERROR0_REG		0xa2
145224110Sjchandra#define XLP_BRIDGE_ADDRESS_ERROR1_REG		0xa3
146224110Sjchandra#define XLP_BRIDGE_ADDRESS_ERROR2_REG		0xa4
147224110Sjchandra#define XLP_BRIDGE_TAG_ECC_ADDR_ERROR0_REG	0xa5
148224110Sjchandra#define XLP_BRIDGE_TAG_ECC_ADDR_ERROR1_REG	0xa6
149224110Sjchandra#define XLP_BRIDGE_TAG_ECC_ADDR_ERROR2_REG	0xa7
150224110Sjchandra#define XLP_BRIDGE_LINE_FLUSH_REG0		0xa8
151224110Sjchandra#define XLP_BRIDGE_LINE_FLUSH_REG1		0xa9
152224110Sjchandra#define XLP_BRIDGE_NODE_ID_REG			0xaa
153224110Sjchandra#define XLP_BRIDGE_ERROR_INTERRUPT_EN_REG	0xab
154224110Sjchandra#define XLP_BRIDGE_PCIE0_WEIGHT_REG		0x300
155224110Sjchandra#define XLP_BRIDGE_PCIE1_WEIGHT_REG		0x301
156224110Sjchandra#define XLP_BRIDGE_PCIE2_WEIGHT_REG		0x302
157224110Sjchandra#define XLP_BRIDGE_PCIE3_WEIGHT_REG		0x303
158224110Sjchandra#define XLP_BRIDGE_USB_WEIGHT_REG		0x304
159224110Sjchandra#define XLP_BRIDGE_NET_WEIGHT_REG		0x305
160224110Sjchandra#define XLP_BRIDGE_POE_WEIGHT_REG		0x306
161224110Sjchandra#define XLP_BRIDGE_CMS_WEIGHT_REG		0x307
162224110Sjchandra#define XLP_BRIDGE_DMAENG_WEIGHT_REG		0x308
163224110Sjchandra#define XLP_BRIDGE_SEC_WEIGHT_REG		0x309
164224110Sjchandra#define XLP_BRIDGE_COMP_WEIGHT_REG		0x30a
165224110Sjchandra#define XLP_BRIDGE_GIO_WEIGHT_REG		0x30b
166224110Sjchandra#define XLP_BRIDGE_FLASH_WEIGHT_REG		0x30c
167224110Sjchandra
168224110Sjchandra#if !defined(LOCORE) && !defined(__ASSEMBLY__)
169224110Sjchandra
170224110Sjchandra#define nlm_rdreg_bridge(b, r)		nlm_read_reg_kseg(b, r)
171224110Sjchandra#define nlm_wreg_bridge(b, r, v)	nlm_write_reg_kseg(b, r, v)
172224110Sjchandra#define	nlm_pcibase_bridge(node)	nlm_pcicfg_base(XLP_IO_BRIDGE_OFFSET(node))
173224110Sjchandra#define	nlm_regbase_bridge(node)	nlm_pcibase_bridge(node)
174224110Sjchandra
175224110Sjchandra#endif
176224110Sjchandra
177224110Sjchandra#endif
178