Skip to content

Commit 8b246fd

Browse files
committed
drivers: ethernet: phy: rtl8211f: 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 aab1f7c commit 8b246fd

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

drivers/ethernet/phy/phy_realtek_rtl8211f.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
6161
struct rt_rtl8211f_config {
6262
uint8_t addr;
6363
const struct device *mdio_dev;
64+
enum phy_link_speed default_speeds;
6465
#if DT_ANY_INST_HAS_PROP_STATUS_OKAY(reset_gpios)
6566
const struct gpio_dt_spec reset_gpio;
6667
#endif
@@ -599,6 +600,9 @@ static int phy_rt_rtl8211f_init(const struct device *dev)
599600
phy_rt_rtl8211f_monitor_work_handler(&data->phy_monitor_work.work);
600601
#endif /* DT_ANY_INST_HAS_PROP_STATUS_OKAY(int_gpios) */
601602

603+
/* Advertise default speeds */
604+
phy_rt_rtl8211f_cfg_link(dev, config->default_speeds, 0);
605+
602606
return 0;
603607
}
604608

@@ -628,6 +632,7 @@ static DEVICE_API(ethphy, rt_rtl8211f_phy_api) = {
628632
static const struct rt_rtl8211f_config rt_rtl8211f_##n##_config = { \
629633
.addr = DT_INST_REG_ADDR(n), \
630634
.mdio_dev = DEVICE_DT_GET(DT_INST_PARENT(n)), \
635+
.default_speeds = PHY_INST_GENERATE_DEFAULT_SPEEDS(n), \
631636
RESET_GPIO(n) \
632637
INTERRUPT_GPIO(n) \
633638
}; \

dts/bindings/ethernet/phy/realtek,rtl8211f.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ properties:
1414
int-gpios:
1515
type: phandle-array
1616
description: GPIO for interrupt signal indicating PHY state change.
17+
default-speeds:
18+
default: ["10BASE Half-Duplex", "10BASE Full-Duplex", "100BASE Half-Duplex",
19+
"100BASE Full-Duplex", "1000BASE Half-Duplex", "1000BASE Full-Duplex"]

0 commit comments

Comments
 (0)