Skip to content

Commit f473806

Browse files
maass-hamburgfabiobaltieri
authored andcommitted
drivers: ethernet: phy: ar8031: remove fixed link mode
fixed link mode is a mode where we don't comunicate with the phy, therefore we don't need it in other phys as the generic phy_mii one. Signed-off-by: Fin Maaß <[email protected]>
1 parent 0385831 commit f473806

File tree

1 file changed

+6
-32
lines changed

1 file changed

+6
-32
lines changed

drivers/ethernet/phy/phy_qualcomm_ar8031.c

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ LOG_MODULE_REGISTER(phy_qc_ar8031, CONFIG_PHY_LOG_LEVEL);
5757

5858
struct qc_ar8031_config {
5959
uint8_t addr;
60-
bool fixed_link;
6160
bool enable_eee;
62-
int fixed_speed;
6361
const struct device *mdio_dev;
6462
};
6563

@@ -414,36 +412,14 @@ static int qc_ar8031_init(const struct device *dev)
414412
}
415413
}
416414

417-
/* Fixed Link */
418-
if (cfg->fixed_link) {
419-
/* Disable isolate */
420-
ret = qc_ar8031_read(dev, MII_BMCR, &reg_value);
421-
if (ret) {
422-
return -EIO;
423-
}
424-
reg_value &= ~MII_BMCR_ISOLATE;
425-
ret = qc_ar8031_write(dev, MII_BMCR, reg_value);
426-
if (ret) {
427-
return -EIO;
428-
}
429-
430-
const static int speed_to_phy_link_speed[] = {
431-
LINK_HALF_10BASE, LINK_FULL_10BASE, LINK_HALF_100BASE,
432-
LINK_FULL_100BASE, LINK_HALF_1000BASE, LINK_FULL_1000BASE,
433-
};
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);
434419

435-
data->state.speed = speed_to_phy_link_speed[cfg->fixed_speed];
436-
data->state.is_up = true;
437-
} else { /* Auto negotiation */
438-
/* Advertise all speeds */
439-
qc_ar8031_cfg_link(dev, LINK_HALF_10BASE | LINK_FULL_10BASE |
440-
LINK_HALF_100BASE | LINK_FULL_100BASE |
441-
LINK_HALF_1000BASE | LINK_FULL_1000BASE, 0);
420+
k_work_init_delayable(&data->monitor_work, monitor_work_handler);
442421

443-
k_work_init_delayable(&data->monitor_work, monitor_work_handler);
444-
445-
monitor_work_handler(&data->monitor_work.work);
446-
}
422+
monitor_work_handler(&data->monitor_work.work);
447423

448424
return 0;
449425
}
@@ -459,8 +435,6 @@ static DEVICE_API(ethphy, ar8031_driver_api) = {
459435
#define AR8031_CONFIG(n) \
460436
static const struct qc_ar8031_config qc_ar8031_config_##n = { \
461437
.addr = DT_INST_REG_ADDR(n), \
462-
.fixed_link = DT_INST_NODE_HAS_PROP(n, fixed_link), \
463-
.fixed_speed = DT_INST_ENUM_IDX_OR(n, fixed_link, 0), \
464438
.mdio_dev = DEVICE_DT_GET(DT_INST_BUS(n)), \
465439
.enable_eee = DT_INST_NODE_HAS_PROP(n, eee_en), \
466440
};

0 commit comments

Comments
 (0)