24 #define pch_gbe_bus_type_unknown 0
25 #define pch_gbe_bus_type_pci 1
26 #define pch_gbe_bus_type_pcix 2
27 #define pch_gbe_bus_type_pci_express 3
28 #define pch_gbe_bus_type_reserved 4
31 #define pch_gbe_bus_speed_unknown 0
32 #define pch_gbe_bus_speed_33 1
33 #define pch_gbe_bus_speed_66 2
34 #define pch_gbe_bus_speed_100 3
35 #define pch_gbe_bus_speed_120 4
36 #define pch_gbe_bus_speed_133 5
37 #define pch_gbe_bus_speed_2500 6
38 #define pch_gbe_bus_speed_reserved 7
41 #define pch_gbe_bus_width_unknown 0
42 #define pch_gbe_bus_width_pcie_x1 1
43 #define pch_gbe_bus_width_pcie_x2 2
44 #define pch_gbe_bus_width_pcie_x4 4
45 #define pch_gbe_bus_width_32 5
46 #define pch_gbe_bus_width_64 6
47 #define pch_gbe_bus_width_reserved 7
53 static void pch_gbe_plat_get_bus_info(
struct pch_gbe_hw *
hw)
73 pr_err(
"pch_gbe_phy_get_id error\n");
78 #ifdef PCH_GBE_MAC_IFOP_RGMII
85 .get_bus_info = pch_gbe_plat_get_bus_info,
86 .init_hw = pch_gbe_plat_init_hw,
100 static void pch_gbe_plat_init_function_pointers(
struct pch_gbe_hw *hw)
105 hw->
func = &pch_gbe_ops;
118 pr_err(
"ERROR: Registers not mapped\n");
121 pch_gbe_plat_init_function_pointers(hw);
131 if (!hw->
func->get_bus_info)
132 pr_err(
"ERROR: configuration\n");
134 hw->
func->get_bus_info(hw);
146 if (!hw->
func->init_hw) {
147 pr_err(
"ERROR: configuration\n");
150 return hw->
func->init_hw(hw);
165 if (!hw->
func->read_phy_reg)
167 return hw->
func->read_phy_reg(hw, offset, data);
182 if (!hw->
func->write_phy_reg)
184 return hw->
func->write_phy_reg(hw, offset, data);
193 if (!hw->
func->reset_phy)
194 pr_err(
"ERROR: configuration\n");
196 hw->
func->reset_phy(hw);
205 if (!hw->
func->sw_reset_phy)
206 pr_err(
"ERROR: configuration\n");
208 hw->
func->sw_reset_phy(hw);
220 if (!hw->
func->read_mac_addr) {
221 pr_err(
"ERROR: configuration\n");
224 return hw->
func->read_mac_addr(hw);
233 if (hw->
func->power_up_phy)
234 hw->
func->power_up_phy(hw);
243 if (hw->
func->power_down_phy)
244 hw->
func->power_down_phy(hw);