Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions mepa/microchip/lan80xx/src/lan80xx_private.c
Original file line number Diff line number Diff line change
Expand Up @@ -3919,7 +3919,11 @@ mepa_rc lan80xx_rx_eye_scan_conf_set_priv (const mepa_device_t *dev,
cnt++;
}
if (!(value & LAN80XX_M_LINE_PMA_8BIT_LANE_DD_LN_ISCAN_DONE)) {
T_E(MEPA_TRACE_GRP_GEN, "Timed out after %d ms - bailing out", cnt);
T_E(MEPA_TRACE_GRP_GEN,
"port %u %s fast ISCAN_DONE poll timed out after %d ms "
"(PMA_8BIT_LANE_DD=0x%x) - bailing out (no signal/clock on "
"the scanned lane?)",
port_no, is_line ? "LINE" : "HOST", cnt, value);
MEPA_RC(lan80xx_rx_eye_scan_disable(dev, port_no, is_line));
return MEPA_RC_ERROR;
}
Expand All @@ -3946,7 +3950,11 @@ mepa_rc lan80xx_rx_eye_scan_conf_set_priv (const mepa_device_t *dev,
cnt++;
}
if (!(value & LAN80XX_M_LINE_PMA_8BIT_LANE_DD_LN_ISCAN_DONE)) {
T_E(MEPA_TRACE_GRP_GEN, "Timed out after %d ms - bailing out", cnt);
T_E(MEPA_TRACE_GRP_GEN,
"port %u %s normal ISCAN_DONE poll timed out after %d ms "
"(PMA_8BIT_LANE_DD=0x%x) - bailing out (no signal/clock on "
"the scanned lane?)",
port_no, is_line ? "LINE" : "HOST", cnt, value);
MEPA_RC(lan80xx_rx_eye_scan_disable(dev, port_no, is_line));
return MEPA_RC_ERROR;
}
Expand Down
6 changes: 6 additions & 0 deletions mesa/demo/mepa_apps/phy25g_diagnostics.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,12 +495,18 @@ static void cli_cmd_eye_diag(cli_req_t *req)
req->port_no, mreq->is_line, mreq->scan)) !=
MEPA_RC_OK) {
T_E("\n Error in Configuring Eye Diagram on port : %d \n", (req->port_no + 1));
cli_printf("Error: eye-scan conf failed on port %u (%s side, rc %d): "
"no signal/clock on the scanned lane? See trace log.\n",
(req->port_no + 1), mreq->is_line ? "line" : "host", rc);
return;
}
if ((rc = lan80xx_rx_eye_scan_status_get(meba_phy_diag_instance->phy_devices[req->port_no],
req->port_no, mreq->scan, &status)) != MEPA_RC_OK) {
T_E("\n Error in Getting the Eye Height and Eye Diagram on port : %d \n",
(req->port_no + 1));
cli_printf("Error: eye-scan status read failed on port %u (%s side, rc %d)"
" -- see trace log.\n",
(req->port_no + 1), mreq->is_line ? "line" : "host", rc);
return;
}
if ((rc = lan80xx_phy_tx_rx_equalization_status_get(meba_phy_diag_instance
Expand Down
24 changes: 19 additions & 5 deletions mesa/demo/mepa_apps/phy_port_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ static int mepa_drv_create(const mepa_port_no_t port_no)

if (meba_phy_inst->phy_devices[port_no]) {
T_E("Device Already existing on %d", port_no);
cli_printf("Error: device already exists on port %u (created at board init).\n"
"Run 'PHY Dev Del %u' first so Create re-probes and "
"runs the PRE/DEFAULT/POST reset sequence.\n",
iport2uport(port_no), iport2uport(port_no));
return MESA_RC_ERROR;
}

Expand Down Expand Up @@ -164,6 +168,7 @@ static void cli_cmd_dev_attach(cli_req_t *req)
{
mesa_port_conf_t conf;
port_cli_req_t *mreq = req->module_req;
mesa_rc rc;
mepa_device_t *dev;
dev = meba_phy_inst->phy_devices[req->port_no];
if (mesa_port_conf_get(NULL, req->port_no, &conf) != MESA_RC_OK) {
Expand All @@ -173,14 +178,14 @@ static void cli_cmd_dev_attach(cli_req_t *req)
req->rc = 0;
}
conf.if_type = mreq->interface;
if (mesa_port_conf_set(NULL, req->port_no, &conf) != MESA_RC_OK) {
if ((rc = mesa_port_conf_set(NULL, req->port_no, &conf)) != MESA_RC_OK) {
req->rc = -1;
T_E("mesa_port_conf_set(%u) failed %d\n", req->port_no);
T_E("mesa_port_conf_set(%u) failed %d\n", req->port_no, rc);
} else {
req->rc = 0;
}
if (mepa_if_set(dev, mreq->interface) != MESA_RC_OK) {
T_E("mepa_if_set(%u) failed %d\n", req->port_no);
if ((rc = mepa_if_set(dev, mreq->interface)) != MESA_RC_OK) {
T_E("mepa_if_set(%u) failed %d\n", req->port_no, rc);
} else {
req->rc = 0;
}
Expand All @@ -203,6 +208,7 @@ static void cli_cmd_phy_conf(cli_req_t *req)
struct json_object *jobj;
json_rpc_req_t json_req = {};
json_req.ptr = json_req.buf;
mepa_rc rc;
mepa_device_t *dev;
int size;
char port_config_file[100];
Expand Down Expand Up @@ -240,10 +246,18 @@ static void cli_cmd_phy_conf(cli_req_t *req)
}
if (json_rpc_get_mepa_conf_t(&json_req, json_req.params, &conf) != MESA_RC_OK) {
T_E("Error in the json configuration");
/* json_req.buf carries the parser's precise complaint */
cli_printf("json parse error: %s\n", json_req.buf);
goto file_close;
}
if (mepa_conf_set(dev, &conf) != MESA_RC_OK) {
if ((rc = mepa_conf_set(dev, &conf)) != MESA_RC_OK) {
T_E("Error in Configuring the PHY");
cli_printf("Error: mepa_conf_set failed on port %u (rc %d): "
"port is NOT configured; see the mesa-demo trace "
"log for the driver reason\n",
iport2uport(req->port_no), rc);
} else {
cli_printf("conf applied on port %u\n", iport2uport(req->port_no));
}
file_close:
free(buffer);
Expand Down