On Thu, Apr 8, 2021 at 1:27 PM Ooi, Cinly <[email protected]> wrote:
> ...
> >Being the libraries loaded at runtime through dlopen() is a good step.
> >OpenOCD can be distributed with aji support compiled in and without the 
> >extra libraries.
> >If the user selects aji driver and has the libraries, it will work.
>
> If possible I should follow the openocd approach where except for libraries 
> expected from the OS, e.g. ftdi and libusb, everything should be compiled 
> into openocd.

Yes, to keep it simple just use the same approach implemented for ftdi
and libusb.

> AJI commands can be queued.  I did not do it because as a newbie to openocd, 
> I am trying to avoid complexity in my code because it interferes with me 
> studying OpenOCD.  The other reason is  libaji_client has it own queueing 
> capability. However, looking at overhead of setting up for AJI in 
> interface_jtag_*() functions, a command queue might be able to reduce the 
> overhead and may be implemented.
>
> At present jtag_interface->execute_queue() is called to ensure all the 
> callbacks are executed.

Several adapters don't support queuing. So, even if OpenOCD queues the
commands, jtag_interface->execute_queue() is used to de-queue them.
That is my suggestion for you too. Just implement
jtag_interface->execute_queue() in which you de-queue the commands and
send them to aji, one by one.
If later you can improve it by using aji queueing, that's a plus!

> We are prepare to put the work in but we do need guidance from you and 
> OpenOCD folks on how to approach it.

I don't have a "general" set of info to share, but feel free to ask
either by email or on IRC.
Also posting an incomplete patch in github.com/intel or on gerrit
openocd.zylin.com can be useful to talk around the code.
The "core" of a JTAG driver is jtag_interface->execute_queue(). As
already mentioned, try to un-queue the command and check how to map
them to AJI. If that is feasible, the driver is done!

Antonio

Reply via email to