Commit bf199e49 authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

wrs: fixed structure to export softpll stats

parent 36a79864
......@@ -31,8 +31,9 @@ ENTRY(_start)
MEMORY
{
ram : ORIGIN = 0x00000000, LENGTH = 0x7000
ram : ORIGIN = 0x0000, LENGTH = 0x7000
mbox : ORIGIN = 0x7000, LENGTH = 0x1000
stats : ORIGIN = 0x8000, LENGTH = 0x1000
}
SECTIONS
......@@ -60,6 +61,12 @@ SECTIONS
*(.mbox)
} > mbox
.stats : {
. = ALIGN(4);
_fstats = .;
*(.stats)
} > stats
/* First location in stack is highest address in RAM */
PROVIDE(_fstack = ORIGIN(ram) + LENGTH(ram) - 4);
}
......
......@@ -19,6 +19,10 @@ volatile struct PPSG_WB *PPSG;
int spll_n_chan_ref, spll_n_chan_out;
#if defined(CONFIG_WR_SWITCH)
struct spll_stats *stats_ptr = 0x8000;
#endif
/*
* The includes below contain code (not only declarations) to enable
* the compiler to inline functions where necessary and save some CPU
......@@ -636,12 +640,32 @@ void spll_set_dac(int index, int value)
void spll_update()
{
struct spll_stats temp_stats;
switch(softpll.mode) {
case SPLL_MODE_GRAND_MASTER:
external_align_fsm(&softpll.ext);
break;
}
spll_update_aux_clocks();
#if defined(CONFIG_WR_SWITCH)
/* for WRS update .stat section in memory */
temp_stats.magic = 0x5b1157a7;
temp_stats.ver = 1;
temp_stats.valid = 0;
temp_stats.mode = softpll.mode;
temp_stats.irq_cnt = irq_count;
temp_stats.seq_state = softpll.seq_state;
temp_stats.align_state = softpll.ext.align_state;
temp_stats.H_lock = softpll.helper.ld.locked;
temp_stats.M_lock = softpll.mpll.ld.locked;
temp_stats.H_y = softpll.helper.pi.y;
temp_stats.M_y = softpll.mpll.pi.y;
temp_stats.del_cnt = softpll.delock_count;
stats_ptr->valid = 0;
*stats_ptr = temp_stats;
stats_ptr->valid = 1;
#endif
}
static int spll_measure_frequency(int osc)
......
......@@ -129,5 +129,20 @@ int spll_get_dac(int out_channel);
void check_vco_frequencies();
/* info reported through .stat section */
struct spll_stats {
int magic; /* 0x5b1157a7 = SPLLSTAT ?;)*/
int ver; /* version of the structure */
char valid; /* is the stat info valid */
int mode;
int irq_cnt;
int seq_state;
int align_state;
int H_lock;
int M_lock;
int H_y, M_y;
int del_cnt;
};
#endif // __SOFTPLL_NG_H
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