Commit c2e22790 authored by Alessandro Rubini's avatar Alessandro Rubini

softpll-unify: support different parameters in wrs/wrnode

This has no effect on rt_cpu.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 6f4ec509
......@@ -15,7 +15,7 @@ OBJS_PLATFORM=target/lm32/crt0.o target/lm32/irq.o
CC=$(CROSS_COMPILE)gcc
OBJCOPY=$(CROSS_COMPILE)objcopy
OBJDUMP=$(CROSS_COMPILE)objdump
CFLAGS= $(CFLAGS_PLATFORM) -ffunction-sections -fdata-sections -O3 -Iinclude/std -Iinclude -include include/trace.h -ffreestanding -Iipc -I$(LIBSOFTPLL_DIR) -I.
CFLAGS= $(CFLAGS_PLATFORM) -ffunction-sections -fdata-sections -O3 -Iinclude/std -Iinclude -include include/trace.h -ffreestanding -Iipc -I$(LIBSOFTPLL_DIR) -I. -DCONFIG_WR_SWITCH
LDFLAGS= $(LDFLAGS_PLATFORM) -Wl,--gc-sections -O3 -Iinclude -ffreestanding
SIZE = $(CROSS_COMPILE)size
OBJS += $(OBJS_PLATFORM)
......
......@@ -28,7 +28,13 @@ void external_init(volatile struct spll_external_state *s, int ext_ref,
s->pi.bias = 32768;
/* Phase branch lock detection */
#if defined(CONFIG_WR_SWITCH)
s->ld.threshold = 250;
#elif defined(CONFIG_WR_NODE)
s->ld.threshold = 1000;
#else
#error "Please set CONFIG for wr switch or wr node"
#endif
s->ld.lock_samples = 10000;
s->ld.delock_samples = 9990;
s->ref_src = ext_ref;
......
......@@ -28,8 +28,15 @@ void mpll_init(struct spll_main_state *s, int id_ref,
s->pi.y_max = 65530;
s->pi.anti_windup = 1;
s->pi.bias = 65000;
s->pi.kp = 1500; //1100; // / 2;
s->pi.ki = 7;//30; // / 2;
#if defined(CONFIG_WR_SWITCH)
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;
/* 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