Skip to content

Commit aab1f7c

Browse files
committed
drivers: ethernet: phy: ar8031: 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 7ab0f61 commit aab1f7c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

drivers/ethernet/phy/phy_qualcomm_ar8031.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ LOG_MODULE_REGISTER(phy_qc_ar8031, CONFIG_PHY_LOG_LEVEL);
5858
struct qc_ar8031_config {
5959
uint8_t addr;
6060
bool enable_eee;
61+
enum phy_link_speed default_speeds;
6162
const struct device *mdio_dev;
6263
};
6364

@@ -412,10 +413,8 @@ static int qc_ar8031_init(const struct device *dev)
412413
}
413414
}
414415

415-
/* Advertise all speeds */
416-
qc_ar8031_cfg_link(dev, LINK_HALF_10BASE | LINK_FULL_10BASE |
417-
LINK_HALF_100BASE | LINK_FULL_100BASE |
418-
LINK_HALF_1000BASE | LINK_FULL_1000BASE, 0);
416+
/* Advertise default speeds */
417+
qc_ar8031_cfg_link(dev, cfg->default_speeds, 0);
419418

420419
k_work_init_delayable(&data->monitor_work, monitor_work_handler);
421420

@@ -436,6 +435,7 @@ static DEVICE_API(ethphy, ar8031_driver_api) = {
436435
static const struct qc_ar8031_config qc_ar8031_config_##n = { \
437436
.addr = DT_INST_REG_ADDR(n), \
438437
.mdio_dev = DEVICE_DT_GET(DT_INST_BUS(n)), \
438+
.default_speeds = PHY_INST_GENERATE_DEFAULT_SPEEDS(n), \
439439
.enable_eee = DT_INST_NODE_HAS_PROP(n, eee_en), \
440440
};
441441

dts/bindings/ethernet/phy/qca,ar8031.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ properties:
1313
description: |
1414
Enable IEEE 802.3az Energy Efficient Ethernet which provides a mechanism
1515
to greatly save the power consumption between data packets burst.
16+
default-speeds:
17+
default: ["10BASE Half-Duplex", "10BASE Full-Duplex", "100BASE Half-Duplex",
18+
"100BASE Full-Duplex", "1000BASE Half-Duplex", "1000BASE Full-Duplex"]

0 commit comments

Comments
 (0)