Commit c3ef35fe authored by Alessandro Rubini's avatar Alessandro Rubini

softpll-unify: support different parameters in wrs/wrnode

This has no effect on wrc.bin. The commit unifies the directory
softpll/ between wr-switch and wr-node. No differences are left.

This is an ugly ifdef, but I prefer merging the code base (removing
duplicates) before addressing the configuration problem.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 5566c822
mainmenu "WR PTP Core software configuration" mainmenu "WR PTP Core software configuration"
# Later we'll build wr_cpu.bin for wr-switch from this code base
config WR_SWITCH
bool
default n
config WR_NODE
bool
default y
# most options with no prompt here are prompted-for in the "advanced" section # most options with no prompt here are prompted-for in the "advanced" section
config RAMSIZE config RAMSIZE
......
...@@ -28,7 +28,13 @@ void external_init(volatile struct spll_external_state *s, int ext_ref, ...@@ -28,7 +28,13 @@ void external_init(volatile struct spll_external_state *s, int ext_ref,
s->pi.bias = 32768; s->pi.bias = 32768;
/* Phase branch lock detection */ /* Phase branch lock detection */
#if defined(CONFIG_WR_SWITCH)
s->ld.threshold = 250;
#elif defined(CONFIG_WR_NODE)
s->ld.threshold = 400; s->ld.threshold = 400;
#else
#error "Please set CONFIG for wr switch or wr node"
#endif
s->ld.lock_samples = 10000; s->ld.lock_samples = 10000;
s->ld.delock_samples = 9990; s->ld.delock_samples = 9990;
s->ref_src = ext_ref; s->ref_src = ext_ref;
......
...@@ -28,8 +28,15 @@ void mpll_init(struct spll_main_state *s, int id_ref, ...@@ -28,8 +28,15 @@ void mpll_init(struct spll_main_state *s, int id_ref,
s->pi.y_max = 65530; s->pi.y_max = 65530;
s->pi.anti_windup = 1; s->pi.anti_windup = 1;
s->pi.bias = 65000; s->pi.bias = 65000;
s->pi.kp = 1100; // / 2; #if defined(CONFIG_WR_SWITCH)
s->pi.ki = 30; // / 2; s->pi.kp = 1500; // / 2;
s->pi.ki = 7; // / 2;
#elif defined(CONFIG_WR_NODE)
s->pi.kp = 1100; // / 2;
s->pi.ki = 30; // / 2;
#else
#error "Please set CONFIG for wr switch or wr node"
#endif
s->delock_count = 0; s->delock_count = 0;
/* Freqency branch lock detection */ /* Freqency branch lock detection */
......
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