xref: /freebsd/sys/arm/ti/cpsw/if_cpswreg.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1e53470feSOleksandr Tymoshenko /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3af3dc4a7SPedro F. Giffuni  *
4e53470feSOleksandr Tymoshenko  * Copyright (c) 2012 Damjan Marion <dmarion@Freebsd.org>
5e53470feSOleksandr Tymoshenko  * All rights reserved.
6e53470feSOleksandr Tymoshenko  *
7e53470feSOleksandr Tymoshenko  * Redistribution and use in source and binary forms, with or without
8e53470feSOleksandr Tymoshenko  * modification, are permitted provided that the following conditions
9e53470feSOleksandr Tymoshenko  * are met:
10e53470feSOleksandr Tymoshenko  * 1. Redistributions of source code must retain the above copyright
11e53470feSOleksandr Tymoshenko  *    notice, this list of conditions and the following disclaimer.
12e53470feSOleksandr Tymoshenko  * 2. Redistributions in binary form must reproduce the above copyright
13e53470feSOleksandr Tymoshenko  *    notice, this list of conditions and the following disclaimer in the
14e53470feSOleksandr Tymoshenko  *    documentation and/or other materials provided with the distribution.
15e53470feSOleksandr Tymoshenko  *
16e53470feSOleksandr Tymoshenko  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17e53470feSOleksandr Tymoshenko  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18e53470feSOleksandr Tymoshenko  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19e53470feSOleksandr Tymoshenko  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20e53470feSOleksandr Tymoshenko  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21e53470feSOleksandr Tymoshenko  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22e53470feSOleksandr Tymoshenko  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23e53470feSOleksandr Tymoshenko  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24e53470feSOleksandr Tymoshenko  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25e53470feSOleksandr Tymoshenko  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26e53470feSOleksandr Tymoshenko  * SUCH DAMAGE.
27e53470feSOleksandr Tymoshenko  */
28e53470feSOleksandr Tymoshenko 
29e53470feSOleksandr Tymoshenko #ifndef	_IF_CPSWREG_H
30e53470feSOleksandr Tymoshenko #define	_IF_CPSWREG_H
31e53470feSOleksandr Tymoshenko 
32e53470feSOleksandr Tymoshenko #define	CPSW_SS_OFFSET			0x0000
33e53470feSOleksandr Tymoshenko #define	CPSW_SS_IDVER			(CPSW_SS_OFFSET + 0x00)
34e53470feSOleksandr Tymoshenko #define	CPSW_SS_SOFT_RESET		(CPSW_SS_OFFSET + 0x08)
35e53470feSOleksandr Tymoshenko #define	CPSW_SS_STAT_PORT_EN		(CPSW_SS_OFFSET + 0x0C)
36e53470feSOleksandr Tymoshenko #define	CPSW_SS_PTYPE			(CPSW_SS_OFFSET + 0x10)
37ae6aefafSTim Kientzle #define	CPSW_SS_FLOW_CONTROL		(CPSW_SS_OFFSET + 0x24)
38e53470feSOleksandr Tymoshenko 
39e53470feSOleksandr Tymoshenko #define	CPSW_PORT_OFFSET		0x0100
40ae6aefafSTim Kientzle #define	CPSW_PORT_P_MAX_BLKS(p)		(CPSW_PORT_OFFSET + 0x08 + ((p) * 0x100))
41ae6aefafSTim Kientzle #define	CPSW_PORT_P_BLK_CNT(p)		(CPSW_PORT_OFFSET + 0x0C + ((p) * 0x100))
4223cd11b6SLuiz Otavio O Souza #define	CPSW_PORT_P_VLAN(p)		(CPSW_PORT_OFFSET + 0x14 + ((p) * 0x100))
43e53470feSOleksandr Tymoshenko #define	CPSW_PORT_P_TX_PRI_MAP(p)	(CPSW_PORT_OFFSET + 0x118 + ((p-1) * 0x100))
44e53470feSOleksandr Tymoshenko #define	CPSW_PORT_P0_CPDMA_TX_PRI_MAP	(CPSW_PORT_OFFSET + 0x01C)
45e53470feSOleksandr Tymoshenko #define	CPSW_PORT_P0_CPDMA_RX_CH_MAP	(CPSW_PORT_OFFSET + 0x020)
46e53470feSOleksandr Tymoshenko #define	CPSW_PORT_P_SA_LO(p)		(CPSW_PORT_OFFSET + 0x120 + ((p-1) * 0x100))
47e53470feSOleksandr Tymoshenko #define	CPSW_PORT_P_SA_HI(p)		(CPSW_PORT_OFFSET + 0x124 + ((p-1) * 0x100))
48e53470feSOleksandr Tymoshenko 
49e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_OFFSET		0x0800
50e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_TX_CONTROL		(CPSW_CPDMA_OFFSET + 0x04)
515bf32555STim Kientzle #define	CPSW_CPDMA_TX_TEARDOWN		(CPSW_CPDMA_OFFSET + 0x08)
52e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_RX_CONTROL		(CPSW_CPDMA_OFFSET + 0x14)
535bf32555STim Kientzle #define	CPSW_CPDMA_RX_TEARDOWN		(CPSW_CPDMA_OFFSET + 0x18)
54e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_SOFT_RESET		(CPSW_CPDMA_OFFSET + 0x1c)
55e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_DMACONTROL		(CPSW_CPDMA_OFFSET + 0x20)
56e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_DMASTATUS		(CPSW_CPDMA_OFFSET + 0x24)
57e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_RX_BUFFER_OFFSET	(CPSW_CPDMA_OFFSET + 0x28)
58e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_TX_INTSTAT_RAW	(CPSW_CPDMA_OFFSET + 0x80)
59e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_TX_INTSTAT_MASKED	(CPSW_CPDMA_OFFSET + 0x84)
60e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_TX_INTMASK_SET	(CPSW_CPDMA_OFFSET + 0x88)
61e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_TX_INTMASK_CLEAR	(CPSW_CPDMA_OFFSET + 0x8C)
62e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_CPDMA_EOI_VECTOR	(CPSW_CPDMA_OFFSET + 0x94)
63e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_RX_INTSTAT_RAW	(CPSW_CPDMA_OFFSET + 0xA0)
64e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_RX_INTSTAT_MASKED	(CPSW_CPDMA_OFFSET + 0xA4)
65e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_RX_INTMASK_SET	(CPSW_CPDMA_OFFSET + 0xA8)
66e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_RX_INTMASK_CLEAR	(CPSW_CPDMA_OFFSET + 0xAc)
67ba14258fSLuiz Otavio O Souza #define	 CPSW_CPDMA_RX_INT_THRESH(_ch)	(1 << (8 + ((_ch) & 7)))
68ba14258fSLuiz Otavio O Souza #define	 CPSW_CPDMA_RX_INT(_ch)		(1 << (0 + ((_ch) & 7)))
69e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_DMA_INTSTAT_RAW	(CPSW_CPDMA_OFFSET + 0xB0)
70e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_DMA_INTSTAT_MASKED	(CPSW_CPDMA_OFFSET + 0xB4)
71e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_DMA_INTMASK_SET	(CPSW_CPDMA_OFFSET + 0xB8)
72e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_DMA_INTMASK_CLEAR	(CPSW_CPDMA_OFFSET + 0xBC)
73ba14258fSLuiz Otavio O Souza #define	CPSW_CPDMA_RX_PENDTHRESH(p)	(CPSW_CPDMA_OFFSET + 0x0c0 + ((p) * 0x04))
74e53470feSOleksandr Tymoshenko #define	CPSW_CPDMA_RX_FREEBUFFER(p)	(CPSW_CPDMA_OFFSET + 0x0e0 + ((p) * 0x04))
755bf32555STim Kientzle 
765bf32555STim Kientzle #define	CPSW_STATS_OFFSET		0x0900
775bf32555STim Kientzle 
785bf32555STim Kientzle #define	CPSW_STATERAM_OFFSET		0x0A00
795bf32555STim Kientzle #define	CPSW_CPDMA_TX_HDP(p)		(CPSW_STATERAM_OFFSET + 0x00 + ((p) * 0x04))
805bf32555STim Kientzle #define	CPSW_CPDMA_RX_HDP(p)		(CPSW_STATERAM_OFFSET + 0x20 + ((p) * 0x04))
815bf32555STim Kientzle #define	CPSW_CPDMA_TX_CP(p)		(CPSW_STATERAM_OFFSET + 0x40 + ((p) * 0x04))
825bf32555STim Kientzle #define	CPSW_CPDMA_RX_CP(p)		(CPSW_STATERAM_OFFSET + 0x60 + ((p) * 0x04))
83e53470feSOleksandr Tymoshenko 
84e53470feSOleksandr Tymoshenko #define	CPSW_CPTS_OFFSET		0x0C00
85e53470feSOleksandr Tymoshenko 
86e53470feSOleksandr Tymoshenko #define	CPSW_ALE_OFFSET			0x0D00
87e53470feSOleksandr Tymoshenko #define	CPSW_ALE_CONTROL		(CPSW_ALE_OFFSET + 0x08)
8823cd11b6SLuiz Otavio O Souza #define	 CPSW_ALE_CTL_ENABLE		(1U << 31)
8923cd11b6SLuiz Otavio O Souza #define	 CPSW_ALE_CTL_CLEAR_TBL		(1 << 30)
9023cd11b6SLuiz Otavio O Souza #define	 CPSW_ALE_CTL_BYPASS		(1 << 4)
9123cd11b6SLuiz Otavio O Souza #define	 CPSW_ALE_CTL_VLAN_AWARE	(1 << 2)
92e53470feSOleksandr Tymoshenko #define	CPSW_ALE_TBLCTL			(CPSW_ALE_OFFSET + 0x20)
93e53470feSOleksandr Tymoshenko #define	CPSW_ALE_TBLW2			(CPSW_ALE_OFFSET + 0x34)
94e53470feSOleksandr Tymoshenko #define	CPSW_ALE_TBLW1			(CPSW_ALE_OFFSET + 0x38)
95e53470feSOleksandr Tymoshenko #define	CPSW_ALE_TBLW0			(CPSW_ALE_OFFSET + 0x3C)
9623cd11b6SLuiz Otavio O Souza #define	 ALE_MCAST(_a)			((_a[1] >> 8) & 1)
9723cd11b6SLuiz Otavio O Souza #define	 ALE_MCAST_FWD			(3 << 30)
9823cd11b6SLuiz Otavio O Souza #define	 ALE_PORTS(_a)			((_a[2] >> 2) & 7)
9923cd11b6SLuiz Otavio O Souza #define	 ALE_TYPE(_a)			((_a[1] >> 28) & 3)
10023cd11b6SLuiz Otavio O Souza #define	 ALE_TYPE_ADDR			1
10123cd11b6SLuiz Otavio O Souza #define	 ALE_TYPE_VLAN			2
10223cd11b6SLuiz Otavio O Souza #define	 ALE_TYPE_VLAN_ADDR		3
10323cd11b6SLuiz Otavio O Souza #define	 ALE_VLAN(_a)			((_a[1] >> 16) & 0xfff)
10451f8a15cSLuiz Otavio O Souza #define	 ALE_VLAN_UNREGFLOOD(_a)	((_a[0] >> 8) & 7)
10551f8a15cSLuiz Otavio O Souza #define	 ALE_VLAN_REGFLOOD(_a)		((_a[0] >> 16) & 7)
10623cd11b6SLuiz Otavio O Souza #define	 ALE_VLAN_UNTAG(_a)		((_a[0] >> 24) & 7)
10723cd11b6SLuiz Otavio O Souza #define	 ALE_VLAN_MEMBERS(_a)		(_a[0] & 7)
108e53470feSOleksandr Tymoshenko #define	CPSW_ALE_PORTCTL(p)		(CPSW_ALE_OFFSET + 0x40 + ((p) * 0x04))
109a2c46b94SLuiz Otavio O Souza #define	 ALE_PORTCTL_NO_SA_UPDATE	(1 << 5)
110a2c46b94SLuiz Otavio O Souza #define	 ALE_PORTCTL_NO_LEARN		(1 << 4)
111a2c46b94SLuiz Otavio O Souza #define	 ALE_PORTCTL_INGRESS		(1 << 3)
112a2c46b94SLuiz Otavio O Souza #define	 ALE_PORTCTL_DROP_UNTAGGED	(1 << 2)
113a2c46b94SLuiz Otavio O Souza #define	 ALE_PORTCTL_FORWARD		3
114a2c46b94SLuiz Otavio O Souza #define	 ALE_PORTCTL_LEARN		2
115a2c46b94SLuiz Otavio O Souza #define	 ALE_PORTCTL_BLOCKED		1
116a2c46b94SLuiz Otavio O Souza #define	 ALE_PORTCTL_DISABLED		0
117e53470feSOleksandr Tymoshenko 
118ae6aefafSTim Kientzle /* SL1 is at 0x0D80, SL2 is at 0x0DC0 */
119e53470feSOleksandr Tymoshenko #define	CPSW_SL_OFFSET			0x0D80
120e53470feSOleksandr Tymoshenko #define	CPSW_SL_MACCONTROL(p)		(CPSW_SL_OFFSET + (0x40 * (p)) + 0x04)
12123cd11b6SLuiz Otavio O Souza #define	 CPSW_SL_MACTL_IFCTL_B		(1 << 16)
12223cd11b6SLuiz Otavio O Souza #define	 CPSW_SL_MACTL_IFCTL_A		(1 << 15)
12323cd11b6SLuiz Otavio O Souza #define	 CPSW_SL_MACTL_GIG		(1 << 7)
12423cd11b6SLuiz Otavio O Souza #define	 CPSW_SL_MACTL_GMII_ENABLE	(1 << 5)
12523cd11b6SLuiz Otavio O Souza #define	 CPSW_SL_MACTL_FULLDUPLEX	(1 << 0)
126ae6aefafSTim Kientzle #define	CPSW_SL_MACSTATUS(p)		(CPSW_SL_OFFSET + (0x40 * (p)) + 0x08)
127e53470feSOleksandr Tymoshenko #define	CPSW_SL_SOFT_RESET(p)		(CPSW_SL_OFFSET + (0x40 * (p)) + 0x0C)
128e53470feSOleksandr Tymoshenko #define	CPSW_SL_RX_MAXLEN(p)		(CPSW_SL_OFFSET + (0x40 * (p)) + 0x10)
129ae6aefafSTim Kientzle #define	CPSW_SL_RX_PAUSE(p)		(CPSW_SL_OFFSET + (0x40 * (p)) + 0x18)
130ae6aefafSTim Kientzle #define	CPSW_SL_TX_PAUSE(p)		(CPSW_SL_OFFSET + (0x40 * (p)) + 0x1C)
131e53470feSOleksandr Tymoshenko #define	CPSW_SL_RX_PRI_MAP(p)		(CPSW_SL_OFFSET + (0x40 * (p)) + 0x24)
132e53470feSOleksandr Tymoshenko 
133e53470feSOleksandr Tymoshenko #define	MDIO_OFFSET			0x1000
134e53470feSOleksandr Tymoshenko #define	MDIOCONTROL			(MDIO_OFFSET + 0x04)
13523cd11b6SLuiz Otavio O Souza #define	 MDIOCTL_ENABLE			(1 << 30)
13623cd11b6SLuiz Otavio O Souza #define	 MDIOCTL_FAULTENB		(1 << 18)
13723cd11b6SLuiz Otavio O Souza #define	MDIOLINKINTRAW			(MDIO_OFFSET + 0x10)
13823cd11b6SLuiz Otavio O Souza #define	MDIOLINKINTMASKED		(MDIO_OFFSET + 0x14)
139e53470feSOleksandr Tymoshenko #define	MDIOUSERACCESS0			(MDIO_OFFSET + 0x80)
140e53470feSOleksandr Tymoshenko #define	MDIOUSERPHYSEL0			(MDIO_OFFSET + 0x84)
14123cd11b6SLuiz Otavio O Souza #define	MDIOUSERACCESS1			(MDIO_OFFSET + 0x88)
14223cd11b6SLuiz Otavio O Souza #define	MDIOUSERPHYSEL1			(MDIO_OFFSET + 0x8C)
14323cd11b6SLuiz Otavio O Souza #define	 MDIO_PHYSEL_LINKINTENB		(1 << 6)
14423cd11b6SLuiz Otavio O Souza #define	 MDIO_PHYACCESS_GO		(1U << 31)
14523cd11b6SLuiz Otavio O Souza #define	 MDIO_PHYACCESS_WRITE		(1 << 30)
14623cd11b6SLuiz Otavio O Souza #define	 MDIO_PHYACCESS_ACK		(1 << 29)
147e53470feSOleksandr Tymoshenko 
148e53470feSOleksandr Tymoshenko #define	CPSW_WR_OFFSET			0x1200
149e53470feSOleksandr Tymoshenko #define	CPSW_WR_SOFT_RESET		(CPSW_WR_OFFSET + 0x04)
150e53470feSOleksandr Tymoshenko #define	CPSW_WR_CONTROL			(CPSW_WR_OFFSET + 0x08)
151e53470feSOleksandr Tymoshenko #define	CPSW_WR_INT_CONTROL		(CPSW_WR_OFFSET + 0x0c)
152feeb22f3SLuiz Otavio O Souza #define	 CPSW_WR_INT_C0_RX_PULSE	(1 << 16)
153feeb22f3SLuiz Otavio O Souza #define	 CPSW_WR_INT_C0_TX_PULSE	(1 << 17)
154feeb22f3SLuiz Otavio O Souza #define	 CPSW_WR_INT_C1_RX_PULSE	(1 << 18)
155feeb22f3SLuiz Otavio O Souza #define	 CPSW_WR_INT_C1_TX_PULSE	(1 << 19)
156feeb22f3SLuiz Otavio O Souza #define	 CPSW_WR_INT_C2_RX_PULSE	(1 << 20)
157feeb22f3SLuiz Otavio O Souza #define	 CPSW_WR_INT_C2_TX_PULSE	(1 << 21)
158feeb22f3SLuiz Otavio O Souza #define	 CPSW_WR_INT_PACE_EN						\
159feeb22f3SLuiz Otavio O Souza 	(CPSW_WR_INT_C0_RX_PULSE | CPSW_WR_INT_C0_TX_PULSE |		\
160feeb22f3SLuiz Otavio O Souza 	 CPSW_WR_INT_C1_RX_PULSE | CPSW_WR_INT_C1_TX_PULSE |		\
161feeb22f3SLuiz Otavio O Souza 	 CPSW_WR_INT_C2_RX_PULSE | CPSW_WR_INT_C2_TX_PULSE)
162feeb22f3SLuiz Otavio O Souza #define	 CPSW_WR_INT_PRESCALE_MASK	0xfff
163e53470feSOleksandr Tymoshenko #define	CPSW_WR_C_RX_THRESH_EN(p)	(CPSW_WR_OFFSET + (0x10 * (p)) + 0x10)
164e53470feSOleksandr Tymoshenko #define	CPSW_WR_C_RX_EN(p)		(CPSW_WR_OFFSET + (0x10 * (p)) + 0x14)
165e53470feSOleksandr Tymoshenko #define	CPSW_WR_C_TX_EN(p)		(CPSW_WR_OFFSET + (0x10 * (p)) + 0x18)
166e53470feSOleksandr Tymoshenko #define	CPSW_WR_C_MISC_EN(p)		(CPSW_WR_OFFSET + (0x10 * (p)) + 0x1C)
167e53470feSOleksandr Tymoshenko #define	CPSW_WR_C_RX_THRESH_STAT(p)	(CPSW_WR_OFFSET + (0x10 * (p)) + 0x40)
168e53470feSOleksandr Tymoshenko #define	CPSW_WR_C_RX_STAT(p)		(CPSW_WR_OFFSET + (0x10 * (p)) + 0x44)
169e53470feSOleksandr Tymoshenko #define	CPSW_WR_C_TX_STAT(p)		(CPSW_WR_OFFSET + (0x10 * (p)) + 0x48)
170e53470feSOleksandr Tymoshenko #define	CPSW_WR_C_MISC_STAT(p)		(CPSW_WR_OFFSET + (0x10 * (p)) + 0x4C)
17123cd11b6SLuiz Otavio O Souza #define	 CPSW_WR_C_MISC_EVNT_PEND	(1 << 4)
17223cd11b6SLuiz Otavio O Souza #define	 CPSW_WR_C_MISC_STAT_PEND	(1 << 3)
17323cd11b6SLuiz Otavio O Souza #define	 CPSW_WR_C_MISC_HOST_PEND	(1 << 2)
17423cd11b6SLuiz Otavio O Souza #define	 CPSW_WR_C_MISC_MDIOLINK	(1 << 1)
17523cd11b6SLuiz Otavio O Souza #define	 CPSW_WR_C_MISC_MDIOUSER	(1 << 0)
176feeb22f3SLuiz Otavio O Souza #define	CPSW_WR_C_RX_IMAX(p)		(CPSW_WR_OFFSET + (0x08 * (p)) + 0x70)
177feeb22f3SLuiz Otavio O Souza #define	CPSW_WR_C_TX_IMAX(p)		(CPSW_WR_OFFSET + (0x08 * (p)) + 0x74)
178feeb22f3SLuiz Otavio O Souza #define	 CPSW_WR_C_IMAX_MASK		0x3f
179feeb22f3SLuiz Otavio O Souza #define	 CPSW_WR_C_IMAX_MAX		63
180feeb22f3SLuiz Otavio O Souza #define	 CPSW_WR_C_IMAX_MIN		2
181feeb22f3SLuiz Otavio O Souza #define	 CPSW_WR_C_IMAX_US_MAX		500
182feeb22f3SLuiz Otavio O Souza #define	 CPSW_WR_C_IMAX_US_MIN		16
183e53470feSOleksandr Tymoshenko 
184e53470feSOleksandr Tymoshenko #define	CPSW_CPPI_RAM_OFFSET		0x2000
185ae6aefafSTim Kientzle #define	CPSW_CPPI_RAM_SIZE		0x2000
186ae6aefafSTim Kientzle 
1875b03aba6SOleksandr Tymoshenko #define	CPSW_MEMWINDOW_SIZE		0x4000
1885b03aba6SOleksandr Tymoshenko 
189ae6aefafSTim Kientzle #define	 CPDMA_BD_SOP			(1 << 15)
190ae6aefafSTim Kientzle #define	 CPDMA_BD_EOP			(1 << 14)
191ae6aefafSTim Kientzle #define	 CPDMA_BD_OWNER			(1 << 13)
192ae6aefafSTim Kientzle #define	 CPDMA_BD_EOQ			(1 << 12)
193ae6aefafSTim Kientzle #define	 CPDMA_BD_TDOWNCMPLT		(1 << 11)
194270da772SLuiz Otavio O Souza #define	 CPDMA_BD_PASS_CRC		(1 << 10)
195ae6aefafSTim Kientzle #define	 CPDMA_BD_PKT_ERR_MASK		(3 << 4)
19623cd11b6SLuiz Otavio O Souza #define	 CPDMA_BD_TO_PORT		(1 << 4)
19723cd11b6SLuiz Otavio O Souza #define	 CPDMA_BD_PORT_MASK		3
198ae6aefafSTim Kientzle 
199ae6aefafSTim Kientzle struct cpsw_cpdma_bd {
200ae6aefafSTim Kientzle 	volatile uint32_t next;
201ae6aefafSTim Kientzle 	volatile uint32_t bufptr;
202ae6aefafSTim Kientzle 	volatile uint16_t buflen;
203ae6aefafSTim Kientzle 	volatile uint16_t bufoff;
204ae6aefafSTim Kientzle 	volatile uint16_t pktlen;
205ae6aefafSTim Kientzle 	volatile uint16_t flags;
206ae6aefafSTim Kientzle };
207e53470feSOleksandr Tymoshenko 
208e53470feSOleksandr Tymoshenko #endif /*_IF_CPSWREG_H */
209