22
22
#include <zephyr/logging/log.h>
23
23
LOG_MODULE_REGISTER (LOG_MODULE_NAME );
24
24
25
+ #include "phy_common.h"
26
+
25
27
#define PHY_TI_DP83825_PHYSCR_REG 0x11
26
28
#define PHY_TI_DP83825_PHYSCR_REG_IE BIT(1)
27
29
#define PHY_TI_DP83825_PHYSCR_REG_IOE BIT(0)
@@ -43,6 +45,7 @@ struct ti_dp83825_config {
43
45
uint8_t addr ;
44
46
const struct device * mdio_dev ;
45
47
enum dp83825_interface phy_iface ;
48
+ enum phy_link_speed default_speeds ;
46
49
#if DT_ANY_INST_HAS_PROP_STATUS_OKAY (reset_gpios )
47
50
const struct gpio_dt_spec reset_gpio ;
48
51
#endif
@@ -563,6 +566,9 @@ static int phy_ti_dp83825_init(const struct device *dev)
563
566
phy_ti_dp83825_monitor_work_handler (& data -> phy_monitor_work .work );
564
567
#endif /* DT_ANY_INST_HAS_PROP_STATUS_OKAY(int_gpios) */
565
568
569
+ /* Advertise default speeds */
570
+ phy_ti_dp83825_cfg_link (dev , config -> default_speeds );
571
+
566
572
return 0 ;
567
573
}
568
574
@@ -591,6 +597,7 @@ static DEVICE_API(ethphy, ti_dp83825_phy_api) = {
591
597
.addr = DT_INST_REG_ADDR(n), \
592
598
.mdio_dev = DEVICE_DT_GET(DT_INST_PARENT(n)), \
593
599
.phy_iface = DT_INST_ENUM_IDX(n, ti_interface_type), \
600
+ .default_speeds = PHY_INST_GENERATE_DEFAULT_SPEEDS(n), \
594
601
RESET_GPIO(n) INTERRUPT_GPIO(n)}; \
595
602
\
596
603
static struct ti_dp83825_data ti_dp83825_##n##_data; \
0 commit comments