We need to include unistd.h for usleep():
hardware/asix-sigma/asix-sigma.c: In function 'sigma_fpga_init_bitbang':
hardware/asix-sigma/asix-sigma.c:450:3: warning: implicit declaration of function 'usleep'
usleep(10000);
And we need to tweak the type of chunks_per_read to match dl_lines_total:
hardware/asix-sigma/asix-sigma.c: In function 'download_capture':
hardware/asix-sigma/asix-sigma.c:1161:39: warning: comparison between signed and unsigned integer expressions
dl_lines_curr = MIN(chunks_per_read, dl_lines_total);
Init the cur_sample_rate to 200kHz. This is now the default sample
rate for the ASIX Sigma if no other is specified by -c samplerate=N
on the command line. Without this change, the driver would crash on
SIGFPE because a division by zero would happen.
Signed-off-by: Marek Vasut <marex@denx.de>
Due to the recent changes in the sigma driver, the trigger handling got
broken. Fix this by properly calculating and propagating the fact that
the trigger happened.
Signed-off-by: Marek Vasut <marex@denx.de>
Pull out the code for decoding the DRAM clusters into separate function.
This shall improve readability some more.
Signed-off-by: Marek Vasut <marex@denx.de>
These two values can pulled out from devc->state, so there really is
no need to pass them as function argument when we already pass the
devc.
Signed-off-by: Marek Vasut <marex@denx.de>
This function could have never returned correct data. Rework the decoding
logic according to the Sigma documentation. This patch also fixes the
handling of partial DRAM lines and partial DRAM clusters.
While at it, do not allocate megabytes of data on stack, just allocate 2KiB
which is plenty for all the work this function needs to do.
Signed-off-by: Marek Vasut <marex@denx.de>
The support for trailing DRAM lines was broken. This patch starts
rework of support for this, but in order to do that, we need to
rework decode_chunk_ts() a little first.
This patch adjusts the decode_chunk_ts() a little to receive the
total amount of events in DRAM line instead of some nonsense value.
This patch temporarily removes the support for the trailing DRAM
lines until the decode_chunk_ts() is fixed to cope with this, so
yes, this patch introduces breakage!
Signed-off-by: Marek Vasut <marex@denx.de>
Instead of this ad-hoc readout voodoo, use proper function to read
the timestemp. One which will not break even on big-endian machines.
Signed-off-by: Marek Vasut <marex@denx.de>