Skip to content

Commit e1b6493

Browse files
committed
drivers: ethernet: phy: dp83825: use default speeds
use default speeds from dt to configure phy on init. Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
1 parent 8b246fd commit e1b6493

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

drivers/ethernet/phy/phy_ti_dp83825.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ struct ti_dp83825_config {
4545
uint8_t addr;
4646
const struct device *mdio_dev;
4747
enum dp83825_interface phy_iface;
48+
enum phy_link_speed default_speeds;
4849
#if DT_ANY_INST_HAS_PROP_STATUS_OKAY(reset_gpios)
4950
const struct gpio_dt_spec reset_gpio;
5051
#endif
@@ -537,6 +538,9 @@ static int phy_ti_dp83825_init(const struct device *dev)
537538
phy_ti_dp83825_monitor_work_handler(&data->phy_monitor_work.work);
538539
#endif /* DT_ANY_INST_HAS_PROP_STATUS_OKAY(int_gpios) */
539540

541+
/* Advertise default speeds */
542+
phy_ti_dp83825_cfg_link(dev, config->default_speeds, 0);
543+
540544
return 0;
541545
}
542546

@@ -565,6 +569,7 @@ static DEVICE_API(ethphy, ti_dp83825_phy_api) = {
565569
.addr = DT_INST_REG_ADDR(n), \
566570
.mdio_dev = DEVICE_DT_GET(DT_INST_PARENT(n)), \
567571
.phy_iface = DT_INST_ENUM_IDX(n, ti_interface_type), \
572+
.default_speeds = PHY_INST_GENERATE_DEFAULT_SPEEDS(n), \
568573
RESET_GPIO(n) INTERRUPT_GPIO(n)}; \
569574
\
570575
static struct ti_dp83825_data ti_dp83825_##n##_data; \

dts/bindings/ethernet/phy/ti,dp83825.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ properties:
2121
enum:
2222
- "rmii"
2323
- "rmii-25MHz"
24+
default-speeds:
25+
default: ["10BASE Half-Duplex", "10BASE Full-Duplex", "100BASE Half-Duplex",
26+
"100BASE Full-Duplex"]

0 commit comments

Comments
 (0)