18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef FS_ENET_FEC_H
38c2ecf20Sopenharmony_ci#define FS_ENET_FEC_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#define FEC_MAX_MULTICAST_ADDRS	64
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci/* Interrupt events/masks.
88c2ecf20Sopenharmony_ci*/
98c2ecf20Sopenharmony_ci#define FEC_ENET_HBERR	0x80000000U	/* Heartbeat error          */
108c2ecf20Sopenharmony_ci#define FEC_ENET_BABR	0x40000000U	/* Babbling receiver        */
118c2ecf20Sopenharmony_ci#define FEC_ENET_BABT	0x20000000U	/* Babbling transmitter     */
128c2ecf20Sopenharmony_ci#define FEC_ENET_GRA	0x10000000U	/* Graceful stop complete   */
138c2ecf20Sopenharmony_ci#define FEC_ENET_TXF	0x08000000U	/* Full frame transmitted   */
148c2ecf20Sopenharmony_ci#define FEC_ENET_TXB	0x04000000U	/* A buffer was transmitted */
158c2ecf20Sopenharmony_ci#define FEC_ENET_RXF	0x02000000U	/* Full frame received      */
168c2ecf20Sopenharmony_ci#define FEC_ENET_RXB	0x01000000U	/* A buffer was received    */
178c2ecf20Sopenharmony_ci#define FEC_ENET_MII	0x00800000U	/* MII interrupt            */
188c2ecf20Sopenharmony_ci#define FEC_ENET_EBERR	0x00400000U	/* SDMA bus error           */
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci#define FEC_ECNTRL_PINMUX	0x00000004
218c2ecf20Sopenharmony_ci#define FEC_ECNTRL_ETHER_EN	0x00000002
228c2ecf20Sopenharmony_ci#define FEC_ECNTRL_RESET	0x00000001
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci/* RMII mode enabled only when MII_MODE bit is set too. */
258c2ecf20Sopenharmony_ci#define FEC_RCNTRL_RMII_MODE	(0x00000100 | \
268c2ecf20Sopenharmony_ci				 FEC_RCNTRL_MII_MODE | FEC_RCNTRL_FCE)
278c2ecf20Sopenharmony_ci#define FEC_RCNTRL_FCE		0x00000020
288c2ecf20Sopenharmony_ci#define FEC_RCNTRL_BC_REJ	0x00000010
298c2ecf20Sopenharmony_ci#define FEC_RCNTRL_PROM		0x00000008
308c2ecf20Sopenharmony_ci#define FEC_RCNTRL_MII_MODE	0x00000004
318c2ecf20Sopenharmony_ci#define FEC_RCNTRL_DRT		0x00000002
328c2ecf20Sopenharmony_ci#define FEC_RCNTRL_LOOP		0x00000001
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#define FEC_TCNTRL_FDEN		0x00000004
358c2ecf20Sopenharmony_ci#define FEC_TCNTRL_HBC		0x00000002
368c2ecf20Sopenharmony_ci#define FEC_TCNTRL_GTS		0x00000001
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci/*
398c2ecf20Sopenharmony_ci * Delay to wait for FEC reset command to complete (in us)
408c2ecf20Sopenharmony_ci */
418c2ecf20Sopenharmony_ci#define FEC_RESET_DELAY		50
428c2ecf20Sopenharmony_ci#endif
43