Skip to content

Commit 517ea59

Browse files
MEPA-1030 Bug Fix: M10G Link Broken
1 parent 841a318 commit 517ea59

File tree

4 files changed

+28
-15
lines changed

4 files changed

+28
-15
lines changed

board-configs/src/meba_phy_generic.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,10 @@ static void meba_phy_config(meba_inst_t inst, const vtss_inst_t vtss_instance, m
7171
mepa_reset_param_t phy_reset = {};
7272

7373
/* Pre Reset Configuration */
74-
phy_reset.media_intf = MESA_PHY_MEDIA_IF_CU;
74+
phy_reset.media_intf = MESA_PHY_MEDIA_IF_FI_10G_LAN;
7575
phy_reset.reset_point = MEPA_RESET_POINT_PRE;
7676
meba_phy_reset(inst, port_no, &phy_reset);
7777

78-
/* PHY Info Get */
79-
meba_phy_info_get(inst, port_no, &phy_info);
80-
81-
if(phy_info.part_number == MEBA_10GPHY_8258) {
82-
phy_reset.media_intf = MESA_PHY_MEDIA_IF_FI_10G_LAN;
83-
m10g_mode_conf(vtss_instance, inst, port_no, base_port_no);
84-
}
85-
8678
/* Default Reset Point */
8779
phy_reset.reset_point = MEPA_RESET_POINT_DEFAULT;
8880
meba_phy_reset(inst, port_no, &phy_reset);
@@ -91,6 +83,13 @@ static void meba_phy_config(meba_inst_t inst, const vtss_inst_t vtss_instance, m
9183
phy_reset.reset_point = MEPA_RESET_POINT_POST;
9284
meba_phy_reset(inst, port_no, &phy_reset);
9385

86+
/* PHY Info Get */
87+
meba_phy_info_get(inst, port_no, &phy_info);
88+
89+
if(phy_info.part_number == MEBA_10GPHY_8258) {
90+
m10g_mode_conf(vtss_instance, inst, port_no, base_port_no);
91+
}
92+
9493
}
9594

9695
uint16_t slot1_map[] = {0x1b, 0x1a, 0x19, 0x18};

board-configs/src/meba_phy_malibu.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ void m10g_mode_conf(const vtss_inst_t inst, meba_inst_t meba_inst, mepa_port_no_
4545
mesa_rc rc = MESA_RC_OK;
4646
vtss_gpio_10g_gpio_mode_t gpio_conf;
4747
const edsx_phy_config_map_t *gmap = &vsc825x_gpio_map[iport - slot_port]; /*have to be changed to respective slot */
48-
mepa_conf_t conf;
48+
mepa_conf_t conf = {0};
49+
50+
if ((rc = mepa_conf_get(meba_inst->phy_devices[iport], &conf)) != MESA_RC_OK) {
51+
printf("mepa_conf_get failed on port %u", iport);
52+
return;
53+
}
4954
conf.speed = MESA_SPEED_10G;
5055
conf.conf_10g.oper_mode = MEPA_PHY_LAN_MODE;
5156
conf.conf_10g.interface_mode = MEPA_PHY_SFI_XFI;
@@ -56,6 +61,12 @@ void m10g_mode_conf(const vtss_inst_t inst, meba_inst_t meba_inst, mepa_port_no_
5661
if(conf.conf_10g.channel_high_to_low == false ) {
5762
conf.conf_10g.channel_id = VTSS_CHANNEL_AUTO;
5863
}
64+
conf.conf_10g.polarity.host_rx = false;
65+
conf.conf_10g.polarity.line_rx = false;
66+
conf.conf_10g.polarity.host_tx = false;
67+
conf.conf_10g.polarity.line_tx = false;
68+
conf.conf_10g.h_clk_src_is_high_amp = true;
69+
conf.conf_10g.l_clk_src_is_high_amp = true;
5970
if ((rc = mepa_conf_set(meba_inst->phy_devices[iport], &conf)) != MESA_RC_OK) {
6071
printf("mepa_conf_set failed on port %u", iport);
6172
return;

mepa/vtss/src/vtss.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,8 +1050,10 @@ static mepa_rc malibu_10g_reset(mepa_device_t *dev,
10501050
if(vtss_phy_10g_init(data->vtss_instance, data->port_no, NULL) != VTSS_RC_OK) {
10511051
return MEPA_RC_ERROR;
10521052
}
1053+
break;
10531054
default:
10541055
// No other RESET POINTs needed
1056+
break;
10551057
}
10561058

10571059
return MEPA_RC_OK;
@@ -1108,8 +1110,10 @@ static mepa_rc phy_10g_poll(mepa_device_t *dev,
11081110
static mepa_rc phy_10g_conf_set(mepa_device_t *dev, const mepa_conf_t *config)
11091111
{
11101112
phy_data_t *data = (phy_data_t *)dev->data;
1111-
vtss_phy_10g_mode_t mode = {};
1112-
1113+
vtss_phy_10g_mode_t mode = {0};
1114+
if(vtss_phy_10g_init(data->vtss_instance, data->port_no, NULL) != VTSS_RC_OK) {
1115+
return MEPA_RC_ERROR;
1116+
}
11131117
mode.oper_mode = config->conf_10g.oper_mode;
11141118
mode.interface = config->conf_10g.interface_mode;
11151119
mode.channel_id = config->conf_10g.channel_id;
@@ -1125,7 +1129,6 @@ static mepa_rc phy_10g_conf_set(mepa_device_t *dev, const mepa_conf_t *config)
11251129
mode.lref_for_host = config->conf_10g.lref_for_host;
11261130
mode.h_clk_src.is_high_amp = config->conf_10g.h_clk_src_is_high_amp;
11271131
mode.l_clk_src.is_high_amp = config->conf_10g.l_clk_src_is_high_amp;
1128-
11291132
if (config->speed == MESA_SPEED_1G || config->speed == MESA_SPEED_AUTO) {
11301133
/* Need to flip the lanes to match JR XAUI-lane-0 and 8487 XAUI-lane-0
11311134
* This only applies to PHY's with a XAUI MAC Interface */

mepa_demo/mepa_scripts/port_config_json.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
"hl_clk_synth": 0,
4141
"is_host_wan" : 0,
4242
"lref_for_host" : 0,
43-
"h_clk_src_is_high_amp" : 0,
44-
"l_clk_src_is_high_amp" : 0
43+
"h_clk_src_is_high_amp" : 1,
44+
"l_clk_src_is_high_amp" : 1
4545
}
4646
}
4747
}

0 commit comments

Comments
 (0)