Skip to content
Snippets Groups Projects
Commit a407864d authored by Adam Wujek's avatar Adam Wujek
Browse files

userspace/libwr/include/libwr: uplift softpll_export.h (SPLL_STATS_VER==5)


Copy softpll_export.h from wrpc-sw repo.

Signed-off-by: default avatarAdam Wujek <dev_public@wujek.eu>
parent e986ed1d
No related merge requests found
......@@ -3,6 +3,5 @@
#include "softpll_export.h"
#define FPGA_SPLL_STAT 0x10001000
#define SPLL_MAGIC 0x5b1157a7
#endif /* __SOFTPLL_H */
......@@ -17,6 +17,10 @@
/* SoftPLL operating modes, for mode parameter of spll_init(). */
/* Disabled mode: SoftPLL inactive.
Previously it was 4, but this was not very intuitive */
#define SPLL_MODE_DISABLED 0
/* Grand Master - lock to 10 MHz external reference */
#define SPLL_MODE_GRAND_MASTER 1
......@@ -26,9 +30,6 @@
/* Slave mode - 125 MHz reference locked to one of the input clocks */
#define SPLL_MODE_SLAVE 3
/* Disabled mode: SoftPLL inactive */
#define SPLL_MODE_DISABLED 4
#define SEQ_START_EXT 1
#define SEQ_WAIT_EXT 2
#define SEQ_START_HELPER 3
......@@ -43,7 +44,9 @@
#define AUX_DISABLED 1
#define AUX_LOCK_PLL 2
#define AUX_ALIGN_PHASE 3
#define AUX_READY 4
#define AUX_SLAVE_READY 4
#define AUX_WAIT_MONITOR_LOCK 5
#define AUX_MONITOR_READY 6
#define ALIGN_STATE_EXT_OFF 0
#define ALIGN_STATE_START 1
......@@ -57,7 +60,15 @@
#define ALIGN_STATE_WAIT_CLKIN 9
#define ALIGN_STATE_WAIT_PLOCK 10
#define SPLL_STATS_VER 4
#define SPLL_STATS_VER 5
#define SPLL_STATS_MAGIC 0x5b1157a7
struct spll_build_id {
char commit_id[32];
char build_date[16];
char build_time[16];
char build_by[32];
};
/* info reported through .stat section */
/* due to endiannes problem strings has to be 4 bytes alligned */
......@@ -74,14 +85,12 @@ struct spll_stats {
int H_y, M_y;
int del_cnt;
int start_cnt;
char commit_id[32];
char build_date[16];
char build_time[16];
char build_by[32];
struct spll_build_id build_id;
int ext_pps_latency_ps;
};
extern struct spll_stats stats;
extern struct spll_stats *stats;
extern const struct spll_build_id build_id;
#endif /* __SOFTPLL_EXPORT_H */
......@@ -814,20 +814,20 @@ struct dump_info spll_stats_info[] = {
DUMP_FIELD(int, M_y),
DUMP_FIELD(int, del_cnt),
DUMP_FIELD(int, start_cnt),
DUMP_FIELD_SIZE(char, commit_id, 32),
DUMP_FIELD_SIZE(char, build_date, 16),
DUMP_FIELD_SIZE(char, build_time, 16),
DUMP_FIELD_SIZE(char, build_by, 32),
DUMP_FIELD_SIZE(char, build_id.commit_id, 32),
DUMP_FIELD_SIZE(char, build_id.build_date, 16),
DUMP_FIELD_SIZE(char, build_id.build_time, 16),
DUMP_FIELD_SIZE(char, build_id.build_by, 32),
DUMP_FIELD(int, ext_pps_latency_ps),
};
static int dump_spll_mem(struct spll_stats *spll)
{
/* Check magic */
if (spll->magic != SPLL_MAGIC) {
if (spll->magic != SPLL_STATS_MAGIC) {
/* Wrong magic */
fprintf(stderr, "dump spll: unknown magic %x (known is %x)\n",
spll->magic, SPLL_MAGIC);
spll->magic, SPLL_STATS_MAGIC);
}
dump_many_fields(spll, spll_stats_info, ARRAY_SIZE(spll_stats_info),"SoftPll");
......
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