Yes, I know what you mean.
It can be another choice. Thanks.

Use 
 static int adi_jtag_scan_inout_check_u32(struct adiv5_dap *dap,
  uint8_t instr, uint8_t reg_addr, uint8_t RnW,
 uint32_t *buffer, uint32_t count)
instead of 
 static int adi_jtag_scan_inout_check_u32(struct adiv5_dap *dap,
  uint8_t instr, uint8_t reg_addr, uint8_t RnW,
 uint32_t outvalue, uint32_t *invalue)




simonqian.openocd

发件人: Sven Krauss
发送时间: 2012-03-13 15:59
收件人: openocd-devel
主题: Re: [OpenOCD-devel] make arm_adi_v5.c transport independent
Hi,

sorry for my long time of inactivity doe to other jobs. A while ago I send a 
patch making arm_adi_v5.c independent from transport layer. I created a third 
solution:
To preserve the performance I changed the interface to the transport layer. 
Both, dap_queue_ap_write and dap_queue_ap_read gets a pointer to a data array  
not a single value. The adi_v5_jtag now implements the loop reading the 
registers via jtag transport layer. So other transports like SWD can implement 
it's  own efficient method reading a register multiple times.

I don't know if the patch works, but it should be easy to adapt.

Best regards,

Svenwhile

Am 13.03.2012 05:30, schrieb simonqian.openocd: 
Hi,
Attachment is the patch for the latest OpenOCD.
Versaloon forum has been moved to http://groups.yahoo.com/group/versaloon/.

Actually, there are many patches to implement SWD.
I just want to find a start point, and original JTAG code is least affected.
So I want first make OpenOCD transport independent, so that JTAG is also 
usable(and testable) and meanwhile SWD code can be commited.




simonqian.openocd

From: Peter Stuge
Date: 2012-03-13 11:53
To: openocd-devel
Subject: Re: [OpenOCD-devel] make arm_adi_v5.c transport independent
Hi Simon,

simonqian.openocd wrote:
> I have recently read libswd code

Thank you very much for looking into this!


> and want to somewhat push the SWD progress.
> First modification should be to arm_adi_v5.c and/or adi_v5_jtag/swd.c,
> so that arm_adi_v5.c could be transport independent.
> 
> I found both libswd and my SWD patch modify 2 main functions in
> arm_adi_v5.c, which are ahbap_debugport_init and mem_ap_read_buf_u32.

Where can your most recent SWD patch be found?

http://www.versaloon.com/doc/versaloon/doc_versaloon_openocd_urjtag.html
has a patch from 2010-11-04, and unfortunately the versaloon.com
Forum seems to be unavailable since some time.


> ahbap_debugport_init should obviously be modified to initialize SWD
> if SWD transport is sellected.
> And mem_ap_read_buf_u32 should not call adi_jtag_dp_scan, or
> implement mem_ap_read_buf_u32_jtag and mem_ap_read_buf_u32_swd.
> 
> 2 solutions:
> 1. In my SWD patch, I add queue_dp_scan to dap->op, and implement
> dap_queue_dp_scan to call dap->op->queue_dp_scan instead of JTAG ones.
> And queue_dp_scan is implemented in both jtag_dp_ops and swd_dp_ops.
> 2. In libswd code, 2 functions are implemented for mem_ap_read_buf_u32,
> which are mem_ap_read_buf_u32_jtag and mem_ap_read_buf_u32_swd.
> And they are called in mem_ap_read_buf_u32 according to the transport
> sellected.
> 
> So the result is simple, choose one of the 2 methods above.

I can't make a useful comment at this point, but I would like to look
at the code and make a suggestion.


> Both are OK for me if we can make progress.
> And I can prepare the patch if any one want to try.

Thank you for this effort. I will be very happy to test patches.


//Peter

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d

_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to