Skip to content

Commit 8e7c839

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 d09f2cd commit 8e7c839

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

drivers/ethernet/phy/phy_ti_dp83825.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include <zephyr/logging/log.h>
2323
LOG_MODULE_REGISTER(LOG_MODULE_NAME);
2424

25+
#include "phy_common.h"
26+
2527
#define PHY_TI_DP83825_PHYSCR_REG 0x11
2628
#define PHY_TI_DP83825_PHYSCR_REG_IE BIT(1)
2729
#define PHY_TI_DP83825_PHYSCR_REG_IOE BIT(0)
@@ -43,6 +45,7 @@ struct ti_dp83825_config {
4345
uint8_t addr;
4446
const struct device *mdio_dev;
4547
enum dp83825_interface phy_iface;
48+
enum phy_link_speed default_speeds;
4649
#if DT_ANY_INST_HAS_PROP_STATUS_OKAY(reset_gpios)
4750
const struct gpio_dt_spec reset_gpio;
4851
#endif
@@ -563,6 +566,9 @@ static int phy_ti_dp83825_init(const struct device *dev)
563566
phy_ti_dp83825_monitor_work_handler(&data->phy_monitor_work.work);
564567
#endif /* DT_ANY_INST_HAS_PROP_STATUS_OKAY(int_gpios) */
565568

569+
/* Advertise default speeds */
570+
phy_ti_dp83825_cfg_link(dev, config->default_speeds);
571+
566572
return 0;
567573
}
568574

@@ -591,6 +597,7 @@ static DEVICE_API(ethphy, ti_dp83825_phy_api) = {
591597
.addr = DT_INST_REG_ADDR(n), \
592598
.mdio_dev = DEVICE_DT_GET(DT_INST_PARENT(n)), \
593599
.phy_iface = DT_INST_ENUM_IDX(n, ti_interface_type), \
600+
.default_speeds = PHY_INST_GENERATE_DEFAULT_SPEEDS(n), \
594601
RESET_GPIO(n) INTERRUPT_GPIO(n)}; \
595602
\
596603
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)