Commit f849b7df authored by li hongming's avatar li hongming

add support for WRS-LJ.

    There are three types of wrs: normal wrs(mark as wrs), wrs with LJD
(mark as WRS-LJD), wrs with embedded lowjitter circuits(mark as WRSLJ).
    lj_loopback_i/o is used to distinguish wrs from WRS-LJD and WRSLJ.
    lj_osc_freq_i is used to distinguish WRSLJ from WRS-LJD.
        lj_osc_freq_i=111 means WRSLJ.
        lj_osc_freq_i=others means WRS-LJD.

    lj_osc_freq_i[2 downto 0] need to be pulled up
parent 27a29906
Pipeline #231 passed with stages
in 30 seconds
......@@ -14,6 +14,9 @@
#define GPIO_PLL_RESET_N 1
#define GPIO_PERIPH_RESET_N 3
#define GPIO_LJD_BOARD_DETECT 4
#define GPIO_LJD_OSC_FREQ_0 5
#define GPIO_LJD_OSC_FREQ_1 6
#define GPIO_LJD_OSC_FREQ_2 7
extern int ljd_present;
......
......@@ -30,6 +30,7 @@ void init_hw_after_reset(void)
int main(void)
{
uint32_t start_tics = timer_get_tics();
int osc_freq=0;
check_reset();
stats.start_cnt++;
......@@ -43,8 +44,11 @@ int main(void)
pp_printf("Start counter %d\n", stats.start_cnt);
/* Low-jitter Daughterboard detection */
ljd_present = gpio_in(GPIO_LJD_BOARD_DETECT);
osc_freq = gpio_in(GPIO_LJD_OSC_FREQ_0);
osc_freq += (gpio_in(GPIO_LJD_OSC_FREQ_1)<<1);
osc_freq += (gpio_in(GPIO_LJD_OSC_FREQ_2)<<2);
if (ljd_present) {
pp_printf("\n--- WRS Low jitter board detected. ---\n");
pp_printf("\n--- WRS Low jitter board detected. OSC FREQ is %d ---\n",osc_freq);
pp_printf("Allow 1 hour of warming up before starting measurements\n");
}
pp_printf("--\n");
......@@ -54,7 +58,10 @@ int main(void)
/* for sure problem is in calling second time ad9516_init,
* but not only */
}
ad9516_init(scb_ver, ljd_present);
if((ljd_present==1) && (osc_freq!=7))
ad9516_init(scb_ver, 1);
else
ad9516_init(scb_ver, 0);
rts_init();
rtipc_init();
spll_very_init();
......
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