Commit 367b21af authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

ljd: rename to LJD everything related

parent ea23c90c
......@@ -290,17 +290,17 @@ int ad9516_init(int scb_version, int ljd_present)
return 0;
}
int ext_ad9516_init (void) {
pp_printf("Initializing external AD9516 PLL...\n");
oc_spi_init((void *)BASE_SPI_EXT_BOARD);
void *spi_base = (void *)BASE_SPI_EXT_BOARD;
int ljd_ad9516_init (void) {
pp_printf("Initializing Low-Jitter Daughterboard AD9516 PLL...\n");
oc_spi_init((void *)BASE_SPI_LJD_BOARD);
void *spi_base = (void *)BASE_SPI_LJD_BOARD;
/* Use unidirectional SPI mode */
ad9516_write_reg((void *)spi_base, 0x000, 0x99);
/* Check the presence of the chip */
if (ad9516_read_reg((void *)spi_base, 0x3) != 0xc3) {
pp_printf("Error: External AD9516 PLL not responding.\n");
pp_printf("Error: Low-Jitter Daughterboard AD9516 PLL not responding.\n");
return -1;
}
ad9516_write_reg(spi_base, 0x018, 0x0); // reset VCO calibration
......@@ -309,7 +309,7 @@ int ext_ad9516_init (void) {
ad9516_write_reg(spi_base, 0x232, 0x0);
ad9516_set_vco_divider(spi_base, 3);
ad9516_load_regset(spi_base, ad9516_ext_base_config, ARRAY_SIZE(ad9516_ext_base_config), 1);
ad9516_load_regset(spi_base, ad9516_ljd_base_config, ARRAY_SIZE(ad9516_ljd_base_config), 1);
ad9516_set_output_divider(spi_base, 6, 8, 0); // OUT6. 62.5MHz
ad9516_set_output_divider(spi_base, 8, 20, 0); // OUT6. 62.5MHz
......
......@@ -146,7 +146,7 @@ const struct ad9516_reg ad9516_base_config_34[] = {
/* Configuration for the SCB version greater than or equal 3.4: Base + 6, 7, 8, 9 outputs*/
const struct ad9516_reg ad9516_ext_base_config[] = {
const struct ad9516_reg ad9516_ljd_base_config[] = {
{0x0000, 0x99},
{0x0001, 0x00},
{0x0002, 0x10},
......
......@@ -21,7 +21,7 @@
#define BASE_GPIO 0x10300
#define BASE_TIMER 0x10400
#define BASE_PPS_GEN 0x10500
#define BASE_SPI_EXT_BOARD 0x10700
#define BASE_SPI_LJD_BOARD 0x10700
/* spll parameter that are board-specific */
#define BOARD_DIVIDE_DMTD_CLOCKS 0
......
......@@ -13,11 +13,7 @@
#define GPIO_SYS_CLK_SEL 0
#define GPIO_PLL_RESET_N 1
#define GPIO_PERIPH_RESET_N 3
#define GPIO_EXT_PLL_RESET_N 4
#define GPIO_EXT_BOARD_DETECT 5
#define GPIO_EXT_OSC_FRED_D0 6
#define GPIO_EXT_OSC_FRED_D1 7
#define GPIO_EXT_OSC_FRED_D2 8
#define GPIO_LJD_BOARD_DETECT 4
extern int ljd_present;
......
......@@ -71,7 +71,7 @@ extern int wrc_ui_refperiod;
/* Init functions and defaults for the wrs build */
int ad9516_init(int scb_ver, int ljd_present);
int ext_ad9516_init(void);
int ljd_ad9516_init(void);
void rts_init(void);
int rtipc_init(void);
void rts_update(void);
......
......@@ -118,7 +118,7 @@ int external_align_fsm(volatile struct spll_external_state *s)
timer_delay(10);
SPLL->ECCR &= (~SPLL_ECCR_EXT_REF_PLLRST);
timer_delay(10);
ljd_ad9516_stat = ext_ad9516_init();
ljd_ad9516_stat = ljd_ad9516_init();
f_ext = spll_measure_frequency(SPLL_OSC_EXT);
if (!ljd_ad9516_stat && (f_ext > 9999000) && (f_ext < 10001000)) {
s->align_state = ALIGN_STATE_WAIT_PLOCK;
......
......@@ -42,7 +42,7 @@ int main(void)
pp_printf("SCB version: %d. %s\n", scb_ver,(scb_ver>=34)?"10 MHz SMC Output.":"" );
pp_printf("Start counter %d\n", stats.start_cnt);
/* Low-jitter Daughterboard detection */
ljd_present = gpio_in(GPIO_EXT_BOARD_DETECT);
ljd_present = gpio_in(GPIO_LJD_BOARD_DETECT);
if (ljd_present)
pp_printf("\n--- WRS Low jitter board detected. ---\nAllow 1 hour of warming \
up before starting measurements\n");
......
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