1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 2015 Freescale Semiconductor
6 #ifndef __LDPAA_WRIOP_H
7 #define __LDPAA_WRIOP_H
11 #define DEFAULT_WRIOP_MDIO1_NAME "FSL_MDIO0"
12 #define DEFAULT_WRIOP_MDIO2_NAME "FSL_MDIO1"
13 #define WRIOP_MAX_PHY_NUM 2
43 struct wriop_dpmac_info {
47 int phy_addr[WRIOP_MAX_PHY_NUM];
48 phy_interface_t enet_if;
49 struct phy_device *phydev[WRIOP_MAX_PHY_NUM];
53 extern struct wriop_dpmac_info dpmac_info[NUM_WRIOP_PORTS];
55 void wriop_init_dpmac(int sd, int dpmac_id, int lane_prtcl);
56 void wriop_init_dpmac_enet_if(int dpmac_id, phy_interface_t enet_if);
57 int wriop_disable_dpmac(int dpmac_id);
58 int wriop_enable_dpmac(int dpmac_id);
59 int wriop_is_enabled_dpmac(int dpmac_id);
60 int wriop_set_mdio(int dpmac_id, struct mii_dev *bus);
61 struct mii_dev *wriop_get_mdio(int dpmac_id);
62 int wriop_set_phy_address(int dpmac_id, int phy_num, int address);
63 int wriop_get_phy_address(int dpmac_id, int phy_num);
64 int wriop_set_phy_dev(int dpmac_id, int phy_num, struct phy_device *phydev);
65 struct phy_device *wriop_get_phy_dev(int dpmac_id, int phy_num);
66 phy_interface_t wriop_get_enet_if(int dpmac_id);
68 void wriop_dpmac_disable(int dpmac_id);
69 void wriop_dpmac_enable(int dpmac_id);
70 phy_interface_t wriop_dpmac_enet_if(int dpmac_id, int lane_prtcl);
71 void wriop_init_dpmac_qsgmii(int sd, int lane_prtcl);
72 void wriop_init_rgmii(void);
73 #endif /* __LDPAA_WRIOP_H */