162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef BCM63XX_IUDMA_H_
362306a36Sopenharmony_ci#define BCM63XX_IUDMA_H_
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#include <linux/types.h>
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci/*
862306a36Sopenharmony_ci * rx/tx dma descriptor
962306a36Sopenharmony_ci */
1062306a36Sopenharmony_cistruct bcm_enet_desc {
1162306a36Sopenharmony_ci	u32 len_stat;
1262306a36Sopenharmony_ci	u32 address;
1362306a36Sopenharmony_ci};
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci/* control */
1662306a36Sopenharmony_ci#define DMADESC_LENGTH_SHIFT	16
1762306a36Sopenharmony_ci#define DMADESC_LENGTH_MASK	(0xfff << DMADESC_LENGTH_SHIFT)
1862306a36Sopenharmony_ci#define DMADESC_OWNER_MASK	(1 << 15)
1962306a36Sopenharmony_ci#define DMADESC_EOP_MASK	(1 << 14)
2062306a36Sopenharmony_ci#define DMADESC_SOP_MASK	(1 << 13)
2162306a36Sopenharmony_ci#define DMADESC_ESOP_MASK	(DMADESC_EOP_MASK | DMADESC_SOP_MASK)
2262306a36Sopenharmony_ci#define DMADESC_WRAP_MASK	(1 << 12)
2362306a36Sopenharmony_ci#define DMADESC_USB_NOZERO_MASK (1 << 1)
2462306a36Sopenharmony_ci#define DMADESC_USB_ZERO_MASK	(1 << 0)
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci/* status */
2762306a36Sopenharmony_ci#define DMADESC_UNDER_MASK	(1 << 9)
2862306a36Sopenharmony_ci#define DMADESC_APPEND_CRC	(1 << 8)
2962306a36Sopenharmony_ci#define DMADESC_OVSIZE_MASK	(1 << 4)
3062306a36Sopenharmony_ci#define DMADESC_RXER_MASK	(1 << 2)
3162306a36Sopenharmony_ci#define DMADESC_CRC_MASK	(1 << 1)
3262306a36Sopenharmony_ci#define DMADESC_OV_MASK		(1 << 0)
3362306a36Sopenharmony_ci#define DMADESC_ERR_MASK	(DMADESC_UNDER_MASK | \
3462306a36Sopenharmony_ci				DMADESC_OVSIZE_MASK | \
3562306a36Sopenharmony_ci				DMADESC_RXER_MASK | \
3662306a36Sopenharmony_ci				DMADESC_CRC_MASK | \
3762306a36Sopenharmony_ci				DMADESC_OV_MASK)
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci#endif /* ! BCM63XX_IUDMA_H_ */
40