Commit 2e9d656e authored by Tomasz Wlostowski's avatar Tomasz Wlostowski

dev/wdiags: put PHY Bitslide and PTP deltas in the wdiags

parent 8aebd99c
......@@ -120,6 +120,11 @@ void wdiags_write_temp(uint32_t temp)
void wdiags_init()
{
int i;
for( i = 0; i < 64; i++ )
wdiag_write( i * 4, 0 );
wdiag_write( WRC_DIAGS_VER, WDIAGS_VERSION );
}
......@@ -145,3 +150,15 @@ void wdiags_write_aux_clock_details( int clk_id, uint32_t mode, uint32_t phase,
wdiag_write( reg, v );
}
void wdiags_write_bitslide(int bitslide)
{
wdiag_write( WRC_DIAGS_WDIAG_BITSLIDE, bitslide );
}
void wdiags_write_ptp_deltas( int dtxm, int drxm, int dtxs, int drxs )
{
wdiag_write( WRC_DIAGS_WDIAG_DELTA_RX_M, drxm );
wdiag_write( WRC_DIAGS_WDIAG_DELTA_RX_S, drxs );
wdiag_write( WRC_DIAGS_WDIAG_DELTA_TX_M, dtxm );
wdiag_write( WRC_DIAGS_WDIAG_DELTA_TX_S, dtxs );
}
\ No newline at end of file
......@@ -26,5 +26,7 @@ void wdiags_write_time(uint64_t sec, uint32_t nsec);
void wdiags_write_temp(uint32_t temp);
void wdiags_write_aux_clock_details( int clk_id, uint32_t mode, uint32_t phase, int enabled, int ready );
void wdiags_init(void);
void wdiags_write_bitslide(int bitslide);
void wdiags_write_ptp_deltas( int dtxm, int drxm, int dtxs, int drxs );
#endif
......@@ -105,6 +105,14 @@
/* WRPC Diag: Servo restart count */
#define WRC_DIAGS_WDIAG_SERVO_RESTART_COUNT 0x6cUL
#define WRC_DIAGS_WDIAG_BITSLIDE 0x70UL
#define WRC_DIAGS_WDIAG_DELTA_RX_M 0x74UL
#define WRC_DIAGS_WDIAG_DELTA_RX_S 0x78UL
#define WRC_DIAGS_WDIAG_DELTA_TX_M 0x7cUL
#define WRC_DIAGS_WDIAG_DELTA_TX_S 0x80UL
struct wrc_diags {
/* [0x0]: REG (rw) Version register */
uint32_t VER;
......@@ -189,6 +197,8 @@ struct wrc_diags {
/* [0x6c]: REG (ro) WRPC Diag: Servo restart count */
uint32_t WDIAG_SERVO_RESTART_COUNT;
uint32_t WDIAG_BITSLIDE;
};
#endif /* __CHEBY__WRC_DIAGS__H__ */
......@@ -521,6 +521,8 @@ int wrc_wr_diags(void)
wdiags_write_servo_state(wr_mode, servostate, ss->picos_mu,
ss->delta_ms, asym, ss->offset,
ss->cur_setpoint,ss->update_count, 0, 0); // fixme: add wdiags v2
wdiags_write_ptp_deltas( ss->delta_tx_m, ss->delta_rx_m, ss->delta_tx_s, ss->delta_rx_s );
}
/* auxiliar channels (if any) */
......@@ -558,6 +560,7 @@ int wrc_wr_diags(void)
}
wdiags_write_bitslide( ep_get_bitslide(&wrc_endpoint_dev) );
/* temperature */
temp = wrc_temp_get("pcb");
......
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