]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/mips/rt305x/rt_swreg.h
Fix extattr getters in case of neither uio nor buffer was not passed to VOP_*.
[FreeBSD/FreeBSD.git] / sys / mips / rt305x / rt_swreg.h
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3  *
4  * Copyright (c) 2010 Aleksandr Rybalko.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26  * SUCH DAMAGE.
27  *
28  * $FreeBSD$
29  */
30
31 #ifndef _RT_SWREG_H_
32 #define _RT_SWREG_H_
33
34 /* XXX: must move to config */
35 #define RT3052F
36
37 #define RT_SW_BASE      0x10110000
38
39 #define RT_SW_ISR               0x00
40
41 #define         WATCHDOG1_TMR_EXPIRED   (1<<29)
42 #define         WATCHDOG0_TMR_EXPIRED   (1<<28)
43 #define         HAS_INTRUDER            (1<<27)
44 #define         PORT_ST_CHG             (1<<26)
45 #define         BC_STORM                (1<<25)
46 #define         MUST_DROP_LAN           (1<<24)
47 #define         GLOBAL_QUE_FULL         (1<<23)
48 #define         LAN_QUE_FULL6           (1<<20)
49 #define         LAN_QUE_FULL5           (1<<19)
50 #define         LAN_QUE_FULL4           (1<<18)
51 #define         LAN_QUE_FULL3           (1<<17)
52 #define         LAN_QUE_FULL2           (1<<16)
53 #define         LAN_QUE_FULL1           (1<<15)
54 #define         LAN_QUE_FULL0           (1<<14)
55
56 #define RT_SW_IMR               0x04
57
58 #define RT_SW_FCT0              0x08
59 #define RT_SW_FCT1              0x0c
60 #define RT_SW_PFC0              0x10
61 #define RT_SW_PFC1              0x14
62 #define RT_SW_PFC2              0x18
63 #define RT_SW_GQS0              0x1c
64 #define RT_SW_GQS1              0x20
65 #define RT_SW_ATS               0x24
66 #define RT_SW_ATS0              0x28
67 #define RT_SW_ATS1              0x2c
68 #define RT_SW_ATS2              0x30
69 #define RT_SW_WMAD0             0x34
70 #define RT_SW_WMAD1             0x38
71 #define RT_SW_WMAD2             0x3c
72 #define RT_SW_PVIDC0            0x40
73 #define RT_SW_PVIDC1            0x44
74 #define RT_SW_PVIDC2            0x48
75 #define RT_SW_PVIDC3            0x4c
76 #define RT_SW_VID0              0x50
77 #define RT_SW_VID1              0x54
78 #define RT_SW_VID2              0x58
79 #define RT_SW_VID3              0x5c
80 #define RT_SW_VID4              0x60
81 #define RT_SW_VID5              0x64
82 #define RT_SW_VID6              0x68
83 #define RT_SW_VID7              0x6c
84 #define RT_SW_VMSC0             0x70
85 #define RT_SW_VMSC1             0x74
86 #define RT_SW_VMSC2             0x78
87 #define RT_SW_VMSC3             0x7c
88 #define RT_SW_POA               0x80
89 #define RT_SW_FPA               0x84
90 #define RT_SW_PTS               0x88
91 #define RT_SW_SOCPC             0x8c
92 #define RT_SW_POC0              0x90
93 #define RT_SW_POC1              0x94
94 #define RT_SW_POC2              0x98
95 #define RT_SW_SGC               0x9c
96 #define RT_SW_STRT              0xa0
97 #define RT_SW_LEDP0             0xa4
98 #define RT_SW_LEDP1             0xa8
99 #define RT_SW_LEDP2             0xac
100 #define RT_SW_LEDP3             0xb0
101 #define RT_SW_LEDP4             0xb4
102 #define RT_SW_WDTR              0xb8
103 #define RT_SW_DES               0xbc
104 #define RT_SW_PCR0              0xc0
105 #define RT_SW_PCR1              0xc4
106 #define RT_SW_FPA               0xc8
107 #define RT_SW_FCT2              0xcc
108 #define RT_SW_QSS0              0xd0
109
110 #define RT_SW_QSS1              0xd4
111 #define RT_SW_DEC               0xd8
112 #define         BRIDGE_IPG_SHIFT        24
113 #define         DEBUG_SW_PORT_SEL_SHIFT 3
114 #define         DEBUG_SW_PORT_SEL_MASK  0x00000038
115
116 #define RT_SW_MTI               0xdc
117 #define         SKIP_BLOCKS_SHIFT       7
118 #define         SKIP_BLOCKS_MASK        0x0000ff80
119 #define         SW_RAM_TEST_DONE        (1<<6)
120 #define         AT_RAM_TEST_DONE        (1<<5)
121 #define         AT_RAM_TEST_FAIL        (1<<4)
122 #define         LK_RAM_TEST_DONE        (1<<3)
123 #define         LK_RAM_TEST_FAIL        (1<<2)
124 #define         DT_RAM_TEST_DONE        (1<<1)
125 #define         DT_RAM_TEST_FAIL        (1<<0)
126
127 #define RT_SW_PPC               0xe0
128 #define         SW2FE_CNT_SHIFT         16
129 #define         FE2SW_CNT_SHIFT         0
130
131 #define RT_SW_SGC2              0xe4
132 #define         FE2SW_WL_FC_EN  (1<<30)
133 #define         LAN_PMAP_P0_IS_LAN              (1<<24)
134 #define         LAN_PMAP_P1_IS_LAN              (1<<25)
135 #define         LAN_PMAP_P2_IS_LAN              (1<<26)
136 #define         LAN_PMAP_P3_IS_LAN              (1<<27)
137 #define         LAN_PMAP_P4_IS_LAN              (1<<28)
138 #define         LAN_PMAP_P5_IS_LAN              (1<<29)
139 /* Transmit CPU TPID(810x) port bit map */
140 #define         TX_CPU_TPID_BIT_MAP_SHIFT       16
141 #define         TX_CPU_TPID_BIT_MAP_MASK        0x007f0000
142 #define         ARBITER_LAN_EN                  (1<<11)
143 #define         CPU_TPID_EN                     (1<<10)
144 #define         P0_DOUBLE_TAG_EN                (1<<0)
145 #define         P1_DOUBLE_TAG_EN                (1<<1)
146 #define         P2_DOUBLE_TAG_EN                (1<<2)
147 #define         P3_DOUBLE_TAG_EN                (1<<3)
148 #define         P4_DOUBLE_TAG_EN                (1<<4)
149 #define         P5_DOUBLE_TAG_EN                (1<<5)
150
151 #define RT_SW_P0PC              0xe8
152 #define RT_SW_P1PC              0xec
153 #define RT_SW_P2PC              0xf0
154 #define RT_SW_P3PC              0xf4
155 #define RT_SW_P4PC              0xf8
156 #define RT_SW_P5PC              0xfc
157 #define         BAD_PCOUNT_SHIFT        16
158 #define         BAD_PCOUNT_MASK         0xffff0000
159 #define         GOOD_PCOUNT_SHIFT       0
160 #define         GOOD_PCOUNT_MASK        0x0000ffff
161
162 #endif /* _RT_SWREG_H_ */