*******************************************
                 IMPORTANT
*******************************************
 5.X SDK frozen as of v5.6.3.0 (Feb 2022).
*******************************************

ChangeLog for the Linux device driver for EDT boards
====================================================

This file contains descriptions of the changes to the EDT Linux
device driver based on release numbers. The only changes are those for the
driver itself; changes to individual packages are in the separate files
CHANGELOG_PDV.txt, CHANGELOG_PCD.txt, etc. 

==============================================
==============================================
See the CHANELOG_<PCD|PDV>.txt file(s) for version change details.

==============================================
V. 5.5.4.8 1/26/2018 release
==============================================
- Updated driver to automatically use MSI interrupts
  if they are supported by a board. Fixed edtinit
  to allow driver removal with MSI interrupts.

==============================================
V. 5.5.4.2 11/07/2017 release
==============================================
- Updated driver for compatibility with Linux kernel 4.10.0+

==============================================
V. 5.4.9.7 08/19/2015 release
==============================================
- Removed UCD and USB code
- Removed automatic Doxygen generation from buildlinux_pkg (never finishes)

==============================================
V. 5.4.4.1 12/02/2013 release
==============================================
- fixed bug with linux sysctl 

----------------------------------------------
V. 5.4.3.7 11/05/2013 release
----------------------------------------------
- Production release includes support for the most recent linux kernels, up
  through 3.8.0-30

-----------------------------------------------
V. 5.3.9.2 3/1/2013
-----------------------------------------------
Added sysctl for max size of sg pages. To modify
sysctl -w dev.pcd.max_sg_pages=x
Values can be 1-8, sg size is the x * 4096. Default is 1.
Increasing this value lengthens the time between interrupts
for large buffers; the default value gives 2 MB of data between interrupts,
so setting this to 8 means 16 MB of data between interrupts.
Sg pages must be contiguous physical memory in the kernel, 
which can be a limited resource, so unless the data is coming 
in really fast there's no need to modify this value.

----------------------------------------------
V. 5.4.1.1 04/25/2013 PRODUCTION RELEASE
----------------------------------------------
- edt_read, edt_write re-coded to use 1 ring buffer
- see CHANGELOG_PCD.txt or CHANGELOG_PCD.txt for other changes
-----------------------------------------------
V. 5.3.8.2 11/13/2012
-----------------------------------------------
changed register lock to have one per unit rather than one per channel.
-----------------------------------------------
V. 5.3.8.1 11/8/2012
-----------------------------------------------
fixed bug in call to init_MUTEX, which changed to sema_init after 2.6.37.
-----------------------------------------------
V. 5.3.7.9 10/31/2012
-----------------------------------------------
Commented out sysctl for mem cache for kernels > 2.6.31 because syntax changed,
will be fixed in the future.

-----------------------------------------------
V. 5.3.7.6 10/10/2012
-----------------------------------------------

Added a mutex to prevent accessing registers while running mezzload.
Register accesses in another process will block until
mezzload is finished. This prevents the problem that 
monitoring UI registers will cause mezzload to fail.

-----------------------------------------------
V. 5.3.7.4 09/17/2012
-----------------------------------------------
Added sysctl option to clear pagecache when configuring ring buffers.

To use, put
dev.pcd.clear_cache=1 
in /etc/sysctl.conf

Or, type

sysctl -w dev.pcd.clear_cache=1

This is to fix memory allocation issues for some customers who have
problems configuring ring buffers when the cache uses all available
memory. To check cache, run "cat /proc/meminfo". 

This is the equivalent of running "echo 1 > /proc/sys/vm/drop_caches".

This is still experimental; it looks like this should have no ill
effects, but it will be turned off by default until further 
testing confirms it's OK.

-----------------------------------------------
V. 5.3.7.4 09/17/2012
-----------------------------------------------
fixed bug in driver load for PE4CDA
-----------------------------------------------
V. 5.3.7.1 09/17/2012
-----------------------------------------------
Fixed indirect register method 2
Added ioctl calls to allow setting/getting registers and returning width - in
library as edt_ind_2_read and edt_ind_2_write.
-----------------------------------------------
V. 5.3.6.6 08/18/2012
-----------------------------------------------
Removed mutex call around memory calls
Added spinlock to protect dma abort
-----------------------------------------------
V. 5.3.6.1 08/03/2012
-----------------------------------------------
fixed bug in scatter gather resize code
removed extra spinlocks from allocation
fixed indirect register accesses in kernel
-----------------------------------------------
V. 5.3.4.3 04/03/2012
-----------------------------------------------
added new boards
-----------------------------------------------
V. 5.3.3.1 02/17/2011
-----------------------------------------------
Currently support Linux versions 2.6.18 through 3.2.7

-----------------------------------------------
V. 4.2.4.3 04/27/2010
-----------------------------------------------

Currently support Linux versions 2.4.18 through 2.6.33.

-----------------------------------------------
V. 4.2.1.4 01/20/2009
-----------------------------------------------

1.  Updated driver to run with kernels > 2.6.25 with several API changes,
    including, but not limited to, fault() replacing nopage(). -mcm

2.  Mmapped kernel buffers now default for large memory systems due to
    reliability problems deciding when it was necessary.  AMD64 systems
    should run "setdebug -k 0" to take advantage of the MMU to eliminate
    a buffer copy.  -mcm

-----------------------------------------------
V. 4.1.9.5 08/10/2007
-----------------------------------------------

1.  Fixed device driver problem introduced in 4.1.9.2 that
    was causing system crashes on some 64-bit systems

-----------------------------------------------
V. 4.1.8.3 08/10/2007
-----------------------------------------------

1.  New working msdv.bit and dvb_asi.bit files.
2.  Minor diagnostic fixes to libedt_timing.c and msp430_load.c


-----------------------------------------------
No version specified
-----------------------------------------------

1.  Fixed debugging printout of buf_args struct. 
2.  Fixed a few cases where tabs were printing as %I in the kernel log.
3.  Fixed issue where edt_set_buffer_size() would fail if the size passed 
    in was equal to the previous buffer size. 

-----------------------------------------------
V. 4.1.6.7 08/10/2007
-----------------------------------------------

1.  Add 32-bit compatibility to 64-bit linux.


-----------------------------------------------
V. 4.1.6.5 07/18/2007
-----------------------------------------------

1.  Change all direct register writes to write-readback to correct a problem
    on certain computers where a sequence of simple writes was failing.
    Should not change functionality, but may slow register writes.


-----------------------------------------------
V. 4.1.6.4 07/08/2007
-----------------------------------------------

1.  Add edt_reg_clearset() and edt_reg_setclear() to perform double-register
    accesses efficiently (for ETW).


-----------------------------------------------
V. 4.1.5.11 06/13/2007
-----------------------------------------------

The following changes should not modify driver behaviour
except to make the driver thread-safe when accessing the
remote FPGA register set.

1. Critical sections were added where necessary to protect the two-step
   remote register access method.

2. Remote register writes using EDT_DMA_INTCFG were changed to use
   EDT_DMA_INTCFG_ONLY to avoid overwriting the remote register offset byte
   during the two-step remote register access method.

3. Solaris driver code which provides a data buffer to edt_ioctl was
   ported to edt_lnx.c.  A stack-based data buffer is used for small (<= 32
   bytes) transactions, and a large single buffer is used for
   large ioctl transactions.  Hence large ioctl transactions are still thread-unsafe
   and that will be addressed soon in a later driver. 

-----------------------------------------------------
V. 4.1.5.10      05/22/2007
-----------------------------------------------------

Added REMOTE_ADDR register readback to edt_set() that
was already in place in edt_get().  Fixes bug where
edt_set() followed by edt_get of a remote xilinx register
inside a driver critical section set the register to garbage.

-----------------------------------------------------
V. 4.1.5.9      05/18/2007
-----------------------------------------------------

Adjusted critical sections with respect to edt_device_ioctl()
code; was inconsistently covering two-step intfc register accesses.

Also split edt_timeout() into edt_timeout() for normal callback
and edt_timeout_intr() for pcd interrupt level callback to support
AbortDMAOnIntr (resolving conflicts with critical sections).

Should not change driver behaviour except to correct intfc register
access race conditions between interrupt routine and appliction programs.

-----------------------------------------------------
V. 4.1.5.4      03/30/2007 TESTED FOR PRODUCTION RELEASE
-----------------------------------------------------

Minor fixes and production testing for customer release

-----------------------------------------------------
V. 4.1.5.3      03/23/2007
-----------------------------------------------------

Fixed bug when loading the 4-lane PCI Express camera link board. It was creating 4 channels instead of three.

-----------------------------------------------------
V. 4.1.4.9      03/09/2007
-----------------------------------------------------

Added new libsg.c library file for getting and manipulating the scatter-gather
lists, including a new ioctl call ES_RAW_SGLIST, to completely set the scatter-gather list from user space.

-----------------------------------------------------
V. 4.1.4.8      02/20/2007
-----------------------------------------------------

Added reserved pages for EM64T intel processors, because the swiotlb functions
aren't reliable by themselves.

-----------------------------------------------------
V. 4.1.4.4      12/20/2006
-----------------------------------------------------

Added memory leak testing to edt_lnx_kernel.c To use uncomment DEBUG_LEAKS.
Diagnostics will be printed to the kernel syslog output.

-----------------------------------------------------
V. 4.1.3.9      10/20/2006
-----------------------------------------------------

Added a new ioctl call to determine whether to read back each time a
bit is written programming the interface Xilinx: EDTS_PROG_READBACK and
EDTG_PROG_READBACK. Speeds up bitload several times.

-----------------------------------------------------
V. 4.1.3.8      10/20/2006
-----------------------------------------------------

Fixed a slow memory leak.

Added code to edt_lnx_kernel.c that can search for memory leaks by
defining "DEBUG_LEAKS". Produces a lot of output.

Fixed edtinit to handle boards with PCI rev # set to non-zero.

-----------------------------------------------------
V. 4.1.3.7      10/16/2006
-----------------------------------------------------

Added a field "TraceLevel" to the driver, set using the upper short of
debug level - this increases the amount of trace information output by
"trace" command.

Added the idea of persistent buffers - when using the kernel buffers,
they can be tagged as persistent, meaning they will remain allocated
when the creating process exits. May be useful for situations where
kernel memory may get fragmented. To set using setdebug - "setdebug -k
mp" instead of "setdebug -k m".

-----------------------------------------------------
V. 4.1.3.3      8/1/2006
-----------------------------------------------------

The main change in this version is the addition of a new IOCTL to
provide info on the current dma status of all channels on a board. This
can be called from the library using edt_get_dma_info().

-----------------------------------------------------
V. 4.1.2.9      6/16/2006
-----------------------------------------------------

Fixed bug which caused a small memory leak loading/unloading the
module. On 2.4.21 there is still a 2-page leak associated with module
load/unload (other drivers have the same problem). In 2.6 kernels this
goes away.

-----------------------------------------------------
V. 4.1.2.8      6/8/2006
-----------------------------------------------------

Added mmaped kernel buffers, particularly for systems with > 3 GB of
RAM.  The driver still works with old compiled code as it did before,
but with the new library file libedt.c the buffers are allocated in the
kernel and the user space buffers are mapped to that memory. This
should be more reliable than the old copy method of using kernel
buffers.

To determine what method the kernel is using for kernel buffers run
setdebug with the -k option:

setdebug -k q : this returns the current state, either off, mmapped, or
copy

setdebug -k m : this sets the current state to mmapped

setdebug -k c : this sets the current state to copy

setdebug -k o : this sets the current state to off

One note about kernel buffers - the amount of ring-buffer space is
coming from a smaller pool than with user-space buffers, so the total
maximum buffer size is a few hundred megabytes, depending on what else
is using kernel memory.  Also, the buffer allocated size is currently
constrained to a multiple of the page size (4096 on x86), so even if
you request another size the amount allocated and mmapped is a multiple
of 4096. The memory is allocated as a single buffer in user-space, and
the ring-buffers are allocated at even intervals within that buffer. It
is no longer possible to pass in an array of buffer pointers if you are
using the mmapped buffer method.

-----------------------------------------------------
V. 4.1.2.7      6/5/2006
-----------------------------------------------------

This driver has the fval_done method for the PDV fixed for two
channels.

-----------------------------------------------------
V. 4.1.2.6      5/26/2006
-----------------------------------------------------

Fixed DMA routines to return failure when requested size was 0.

-----------------------------------------------------
V. 4.1.2.5      5/22/2006
-----------------------------------------------------

Fixed a memory leak when using kernel_buffers

-----------------------------------------------------
V. 4.1.2.4      4/26/2006
-----------------------------------------------------

Fixed bug which could cause a crash after hitting Ctrl-C while doing
DMA.

Also changed the tracing so that all trace info goes to channel 0, and
setdebug -g puts the channel id in front of each trace line.

Changed edt_get_current_pid to use the current tgid instead of pid, so
that all threads in a process shared the same id for allocating DMA
buffers.

-----------------------------------------------------
V. 4.1.2.2      4/7/2006
-----------------------------------------------------

Added ids for PCI Express boards to set of PCI ids

-----------------------------------------------------
V. 4.1.1.8      2/14/2006
-----------------------------------------------------

Added calls to sys_mlock and sys_munlock for kernels older than 2.6.11,
so mlock doesn't have to be called as root in user space. The edtinit
script gets the addresses for these functions from /boot/System.map

-----------------------------------------------------
V. 4.1.1.6      1/19/2006
-----------------------------------------------------

Fixed bug in use of swiotlb on EM64T

-----------------------------------------------------
V. 4.1.1.4      1/19/2006
-----------------------------------------------------

Removed use of PageReserved bit to lock pages - it led to instability
with some kernels.

-----------------------------------------------------
V. 4.0.1.0      10/04/2005
-----------------------------------------------------

Revamped DMA routines to use sg routines provided in kernel. This
precludes kernels older than 2.4.18.

