Commit f46d1268 authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

shell: adding command for getting RX bitslide value

parent 35f12f60
...@@ -148,6 +148,12 @@ int ep_link_up(uint16_t * lpa) ...@@ -148,6 +148,12 @@ int ep_link_up(uint16_t * lpa)
return (msr & flags) == flags ? 1 : 0; return (msr & flags) == flags ? 1 : 0;
} }
int ep_get_bitslide()
{
return PICOS_PER_SERIAL_BIT *
MDIO_WR_SPEC_BSLIDE_R(pcs_read(MDIO_REG_WR_SPEC));
}
/* Returns the TX/RX latencies. They are valid only when the link is up. */ /* Returns the TX/RX latencies. They are valid only when the link is up. */
int ep_get_deltas(uint32_t * delta_tx, uint32_t * delta_rx) int ep_get_deltas(uint32_t * delta_tx, uint32_t * delta_rx)
{ {
......
...@@ -702,6 +702,7 @@ function to initialize SoftPll ...@@ -702,6 +702,7 @@ function to initialize SoftPll
@item @code{stat} @tab prints one line log message @item @code{stat} @tab prints one line log message
@item @code{stat cont} @tab prints log message for each second (Esc to exit back to shell) @item @code{stat cont} @tab prints log message for each second (Esc to exit back to shell)
@item @code{stat bts} @tab prints bitslide value for established WR Link, needed by calibration procedure
@item @code{ptp start} @tab start WR PTP daemon @item @code{ptp start} @tab start WR PTP daemon
@item @code{ptp stop} @tab stops WR PTP daemon @item @code{ptp stop} @tab stops WR PTP daemon
......
...@@ -22,6 +22,7 @@ void get_mac_addr(uint8_t dev_addr[]); ...@@ -22,6 +22,7 @@ void get_mac_addr(uint8_t dev_addr[]);
void set_mac_addr(uint8_t dev_addr[]); void set_mac_addr(uint8_t dev_addr[]);
int ep_enable(int enabled, int autoneg); int ep_enable(int enabled, int autoneg);
int ep_link_up(uint16_t * lpa); int ep_link_up(uint16_t * lpa);
int ep_get_bitslide();
int ep_get_deltas(uint32_t * delta_tx, uint32_t * delta_rx); int ep_get_deltas(uint32_t * delta_tx, uint32_t * delta_rx);
int ep_get_psval(int32_t * psval); int ep_get_psval(int32_t * psval);
int ep_cal_pattern_enable(); int ep_cal_pattern_enable();
......
#include "shell.h" #include "shell.h"
#include "endpoint.h"
#include <string.h> #include <string.h>
#include <wrc.h> #include <wrc.h>
...@@ -6,7 +7,9 @@ int cmd_stat(const char *args[]) ...@@ -6,7 +7,9 @@ int cmd_stat(const char *args[])
{ {
if (!strcasecmp(args[0], "cont")) { if (!strcasecmp(args[0], "cont")) {
wrc_ui_mode = UI_STAT_MODE; wrc_ui_mode = UI_STAT_MODE;
} else } else if (!strcasecmp(args[0], "bts"))
mprintf("%d ps\n", ep_get_bitslide());
else
wrc_log_stats(1); wrc_log_stats(1);
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment