Skip to content

Commit bd3ceaf

Browse files
drivers: mdio: Update the change from migrating FSP 6.0.0
Midify to use ``p_phy_lsi_cfg_list`` in ``ether_phy_cfg.p_extend`` instead of using ``phy_lsi_type`` and ``phy_lsi_address`` in ``ether_phy_cfg``. Update for mdio_renesas_ra Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
1 parent 2dfa30b commit bd3ceaf

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

drivers/mdio/mdio_renesas_ra.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ static int renesas_ra_mdio_read(const struct device *dev, uint8_t prtad, uint8_t
3535
uint16_t *data)
3636
{
3737
struct renesas_ra_mdio_data *dev_data = dev->data;
38+
ether_phy_extended_cfg_t *ext_cfg =
39+
(ether_phy_extended_cfg_t *)dev_data->ether_phy_cfg.p_extend;
3840
uint32_t read;
3941
fsp_err_t err;
4042

41-
dev_data->ether_phy_ctrl.phy_lsi_address = prtad;
43+
ext_cfg->p_phy_lsi_cfg_list[0]->address = prtad;
4244

4345
k_mutex_lock(&dev_data->rw_mutex, K_FOREVER);
4446

@@ -59,9 +61,11 @@ static int renesas_ra_mdio_write(const struct device *dev, uint8_t prtad, uint8_
5961
uint16_t data)
6062
{
6163
struct renesas_ra_mdio_data *dev_data = dev->data;
64+
ether_phy_extended_cfg_t *ext_cfg =
65+
(ether_phy_extended_cfg_t *)dev_data->ether_phy_cfg.p_extend;
6266
fsp_err_t err;
6367

64-
dev_data->ether_phy_ctrl.phy_lsi_address = prtad;
68+
ext_cfg->p_phy_lsi_cfg_list[0]->address = prtad;
6569

6670
k_mutex_lock(&dev_data->rw_mutex, K_FOREVER);
6771

@@ -106,13 +110,22 @@ static DEVICE_API(mdio, renesas_ra_mdio_api) = {
106110

107111
#define RENSAS_RA_MDIO_INSTANCE_DEFINE(node) \
108112
PINCTRL_DT_INST_DEFINE(node); \
113+
static ether_phy_lsi_cfg_t renesas_ra_mdio##node##_lsi_cfg_list = { \
114+
.type = ETHER_PHY_LSI_TYPE_CUSTOM, \
115+
}; \
116+
static ether_phy_extended_cfg_t renesas_ra_mdio##node##_extend = { \
117+
.p_phy_lsi_cfg_list = \
118+
{ \
119+
&renesas_ra_mdio##node##_lsi_cfg_list, \
120+
}, \
121+
}; \
109122
static struct renesas_ra_mdio_data renesas_ra_mdio##node##_data = { \
110123
.ether_phy_cfg = { \
111124
.channel = 0, \
112125
.phy_reset_wait_time = 0x00020000, \
113126
.mii_bit_access_wait_time = 8, \
114-
.phy_lsi_type = ETHER_PHY_LSI_TYPE_CUSTOM, \
115127
.flow_control = ETHER_PHY_FLOW_CONTROL_DISABLE, \
128+
.p_extend = &renesas_ra_mdio##node##_extend, \
116129
}}; \
117130
static const struct renesas_ra_mdio_config renesas_ra_mdio##node##_cfg = { \
118131
.pincfg = PINCTRL_DT_INST_DEV_CONFIG_GET(node)}; \

0 commit comments

Comments
 (0)