2 * Copyright 2014-2017 Broadcom.
4 * SPDX-License-Identifier: GPL-2.0+
7 #ifndef _BCM_SF2_ETH_H_
8 #define _BCM_SF2_ETH_H_
12 #define RX_BUF_SIZE 2048
13 /* RX_BUF_NUM must be power of 2 */
16 #define TX_BUF_SIZE 2048
17 /* TX_BUF_NUM must be power of 2 */
20 /* Support 2 Ethernet ports now */
21 #define BCM_ETH_MAX_PORT_NUM 2
23 #define CONFIG_BCM_SF2_ETH_DEFAULT_PORT 0
31 void *tx_desc_aligned;
32 void *rx_desc_aligned;
40 int (*tx_packet)(struct eth_dma *dma, void *packet, int length);
41 bool (*check_tx_done)(struct eth_dma *dma);
43 int (*check_rx_done)(struct eth_dma *dma, uint8_t *buf);
45 int (*enable_dma)(struct eth_dma *dma, int dir);
46 int (*disable_dma)(struct eth_dma *dma, int dir);
51 phy_interface_t phy_interface;
52 struct phy_device *port[BCM_ETH_MAX_PORT_NUM];
55 int (*miiphy_read)(struct mii_dev *bus, int phyaddr, int devad,
57 int (*miiphy_write)(struct mii_dev *bus, int phyaddr, int devad,
60 int (*mac_init)(struct eth_device *dev);
61 int (*enable_mac)(void);
62 int (*disable_mac)(void);
63 int (*set_mac_addr)(unsigned char *mac);
64 int (*set_mac_speed)(int speed, int duplex);
68 #endif /* _BCM_SF2_ETH_H_ */