Re: [Openocd-development] [PATCH 1/2] cortex a9: merge cortex a9 and a8 code

2011-04-19 Thread Wookey
+++ Øyvind Harboe [2011-03-22 09:23 +0100]:
 On Tue, Mar 22, 2011 at 9:18 AM, Tomek CEDRO tomek.ce...@gmail.com wrote:
 
  On Tue, Mar 22, 2011 at 6:22 AM, Øyvind Harboe oyvind.har...@zylin.com 
  wrote:
   cortex a8 and a9 are very similar, so they should be merged and
   conditional code used + configuration options.
  
   cortex m3 is more mature(hence breakage is more of an issue) and
   much more different so merging *all* cortex code is further down the
   road.
 
  Aaah, maybe cortex_m.c and cortex_a.c then? :-)
 
 Sounds sensible to me.

Yep - this is in line with how the chip families are designed (and
marketed). At some point we might find we can't accomodate all
cortex-A CPUs in one file (don't know how much they changed re JTAG in
A15, for example), but until then it makes sense to treat them as a
closely-relate family. Then we have separate Cortex R and Cortex M
support. 

Now that I'm inside ARM I poke people about OpenOCD when I get the
chance. The people here have lots of access to the really expensive
stuff so openOCD is not that high on the radar, but it is known about
and isn't being entirely ignored, which is a good start.

Wookey
-- 
Principal hats:  Linaro, Emdebian, Wookware, Balloonboard, ARM
http://wookware.org/
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] [PATCH 1/2] cortex a9: merge cortex a9 and a8 code

2011-03-25 Thread Marek Vasut
On Tuesday 22 March 2011 01:08:03 Aaron Carroll wrote:
 On 22 March 2011 01:53, luca ellero lro...@gmail.com wrote:
  Unfortunately at the moment I have no cortex A8 boards to test it.
  Anyway I wonder where 0x8000 come from, since I can't find any docs
  in
 
 This came from poking the omap4430.  The ROM (on the two rev's I
 tested, anyway) is bogus, so I don't think there's a sensible way to
 determine the addresses are run-time.

OMAP4430 has broken debug base address too ? Oh jeez :)

 ___
 Openocd-development mailing list
 Openocd-development@lists.berlios.de
 https://lists.berlios.de/mailman/listinfo/openocd-development
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] [PATCH 1/2] cortex a9: merge cortex a9 and a8 code

2011-03-22 Thread Øyvind Harboe
On Tue, Mar 22, 2011 at 12:22 AM, Tomek CEDRO tomek.ce...@gmail.com wrote:
 Hello world :-)

 On Mon, Mar 21, 2011 at 3:00 PM, Øyvind Harboe oyvind.har...@zylin.com 
 wrote:
 In terms of maintenance we can't really support
 two files that are so similar, so unless I hear major
 objections, I'd rather go with this patch and sort
 out any regressions afterwards.

 Maybe those two files are similar, but they are targeted for different
 cpu families that have different quirks to work, so I think they
 should be kept separated to avoid mess that can show up after some
 time - usually one more file is not a pain but can make solution more
 clear and elegant - thats only my opinion, not an objection :-) If you
 prefer one file, why not name it arm_cortex.c to avoid putting
 cortex_a9 stuff into cortex_a8 file? :-)

cortex a8 and a9 are very similar, so they should be merged and
conditional code used + configuration options.

cortex m3 is more mature(hence breakage is more of an issue) and
much more different so merging *all* cortex code is further down the
road.



-- 
Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 87 40 27

http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] [PATCH 1/2] cortex a9: merge cortex a9 and a8 code

2011-03-22 Thread Tomek CEDRO
On Tue, Mar 22, 2011 at 6:22 AM, Øyvind Harboe oyvind.har...@zylin.com wrote:
 cortex a8 and a9 are very similar, so they should be merged and
 conditional code used + configuration options.

 cortex m3 is more mature(hence breakage is more of an issue) and
 much more different so merging *all* cortex code is further down the
 road.

Aaah, maybe cortex_m.c and cortex_a.c then? :-)

Best regards! :-)
Tomek

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] [PATCH 1/2] cortex a9: merge cortex a9 and a8 code

2011-03-22 Thread Øyvind Harboe
On Tue, Mar 22, 2011 at 9:18 AM, Tomek CEDRO tomek.ce...@gmail.com wrote:

 On Tue, Mar 22, 2011 at 6:22 AM, Øyvind Harboe oyvind.har...@zylin.com 
 wrote:
  cortex a8 and a9 are very similar, so they should be merged and
  conditional code used + configuration options.
 
  cortex m3 is more mature(hence breakage is more of an issue) and
  much more different so merging *all* cortex code is further down the
  road.

 Aaah, maybe cortex_m.c and cortex_a.c then? :-)

Sounds sensible to me.


--
Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 87 40 27

http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] [PATCH 1/2] cortex a9: merge cortex a9 and a8 code

2011-03-21 Thread Øyvind Harboe
I didn't do anything clever here.

Reading the cortex_a9/a8.c logs it looked like Cortex A8 had simply
been abandoned, so I copied cortex_a9.c onto cortex_a8.c, did a quick
search and replace job and deleted cortex_a9.c.

Any objections?

Insights?

Does this look OK?

Are all the changes that went into cortex_a9.c appropriate for cortex_a8?

git log -- src/target/cortex_a9.c ll.txt


-- 
Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 87 40 27

http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
commit bd115084c2813d1a5e511c9e4b468c8dce783fee
Author: Øyvind Harboe oyvind.har...@zylin.com
Date:   Mon Mar 21 14:10:57 2011 +0100

cortex a9: merge cortex a9 and a8 code

better to keep this in a single file.

Signed-off-by: Øyvind Harboe oyvind.har...@zylin.com

commit fa93174a56c0aca1201bebf88795d6fe31c18aa1
Author: Luca Ellero lro...@gmail.com
Date:   Mon Feb 14 21:46:53 2011 +

arm_adi_v5: add/move apsel member in struct adiv5_dap

This patch tries to make some order in apsel mess.
dap apsel command was quite useless (and broken) by itself.
With this patch we can use it to select between AHB or APB memory access
(previous patch 05ab8bdb813acdcd74afa71d6656c2df816cb230 was somehow 
broken).

- moves member apsel (in struct adiv5_dap) to ap_current
- adds apsel member

this strange choice is made trying to keep coherence in dap apsel command
 and to keep compatibility with other code (for example cortex_a8).

Signed-off-by: Luca Ellero lro...@gmail.com

commit 779005f43dc372de937dfd4b445f31d882b98eca
Author: Luca Ellero lro...@gmail.com
Date:   Sat Feb 12 11:54:42 2011 +

cortex_a9: move dap_ap_select to arm_avi_v5

dap_ap_select was used in the code at various points, but that can lead to
confusion, without any knowledge of what AP is really selected at some
points.
Some bugs derive from this (for example md/mw doesn't work well after
issueing dap apsel command).
Moving it to arm_adi_v5.c (using  mem_ap_sel* functions instead of mem_ap_*)
make the code more clear and more easier to maintain.
In the future it should be made static to avoid its use outside arm_adi_v5

One further benefit is the various goto has been removed as well

Signed-off-by: Luca Ellero lro...@gmail.com

commit aaa52e16ce9b6d43d2fa578361a582ccd9e6c85d
Author: Luca Ellero lro...@gmail.com
Date:   Sat Feb 12 11:54:39 2011 +

cortex_a9: check if MMU is enabled on APB read/write memory

Signed-off-by: Luca Ellero lro...@gmail.com

commit f609d03f1fc0b722584f624fe25b04efd362ef00
Author: Luca Ellero lro...@gmail.com
Date:   Sat Feb 12 11:54:38 2011 +

cortex_a9: check target halted on APB read/write memory

Signed-off-by: Luca Ellero lro...@gmail.com

commit 28b953d0bd615ec6ec41a89546a757e73f9b0bdf
Author: Luca Ellero lro...@gmail.com
Date:   Sat Feb 12 11:54:37 2011 +

cortex_a9: trivial fixes

Signed-off-by: Luca Ellero lro...@gmail.com

commit 05ab8bdb813acdcd74afa71d6656c2df816cb230
Author: Luca Ellero lro...@gmail.com
Date:   Wed Feb 9 20:36:14 2011 +

cortex_a9: implement read/write memory through APB-AP

This patch adds read/write capability to memory addresses not
accessible through AHB-AP (for example boot ROM code).

To select AHB or APB, a dap apsel command must be issued:
dap apsel 0 - following memory accesses are through AHB
dap apsel 1 - following memory accesses are through APB

NOTE: at the moment APB memory accesses are very slow, compared
  to AHB accesses. Work has to be done to get it faster (for
  example LDR/STR instead od LDRB/STRB)

Signed-off-by: Luca Ellero lro...@gmail.com

commit 94e90cbf16cb14c997e68b780b1c4397f2cc2257
Author: Aaron Carroll aar...@cse.unsw.edu.au
Date:   Thu Feb 3 12:06:14 2011 +1100

cortex_a9: fix dap_ap_select() usage

Save, select and restore AP in cortex_a9_step and 
cortex_a9_init_debug_access.
Fixes a bug where the wrong AP is selected after a reset.

Signed-off-by: Aaron Carroll aar...@cse.unsw.edu.au

commit d51b561b10bc516bf76ced479b73ae1c7b170cf7
Author: Luca Ellero lro...@gmail.com
Date:   Tue Feb 8 05:16:54 2011 +

cortex_a8/a9: fix some comments

Signed-off-by: Luca Ellero lro...@gmail.com

commit c34e69cb10bb9c7502732d2bb0bc92fa73235aec
Author: Aaron Carroll aar...@cse.unsw.edu.au
Date:   Mon Jan 24 18:06:46 2011 +1100

cortex_a9: add source files for Cortex A9 support.

add target and build support for A9

Signed-off-by: Aaron Carroll aar...@cse.unsw.edu.au
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] [PATCH 1/2] cortex a9: merge cortex a9 and a8 code

2011-03-21 Thread luca ellero

On 21/03/2011 14.20, Øyvind Harboe wrote:

I didn't do anything clever here.

Reading the cortex_a9/a8.c logs it looked like Cortex A8 had simply
been abandoned, so I copied cortex_a9.c onto cortex_a8.c, did a quick
search and replace job and deleted cortex_a9.c.

Any objections?

Insights?

Does this look OK?

Are all the changes that went into cortex_a9.c appropriate for cortex_a8?

git log -- src/target/cortex_a9.cll.txt




I think they are OK.
The only thing to check is that cortex_a9.c is very OMAP4430 oriented 
and has some ROM table workarounds (in cortex_a9_examine_first) that 
could not work well on other CPUs.

Unfortunately at the moment I have no cortex A8 boards to test it.
Anyway I wonder where 0x8000 come from, since I can't find any docs 
in regard. Maybe Aaron is the right person here to answer (if he don't 
mind, of course :-)

Regards
Luca

___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] [PATCH 1/2] cortex a9: merge cortex a9 and a8 code

2011-03-21 Thread Øyvind Harboe
In terms of maintenance we can't really support
two files that are so similar, so unless I hear major
objections, I'd rather go with this patch and sort
out any regressions afterwards.

Previously the debug base was hardcoded, then logic
was added to autodetect it. The autodetection would
have been fairly straightforward, except there are
broken implementations out there. The autodetection
of the debug base was amended to automatically
detect the broken boards, which still needs a bit
of work last I heard.

-- 
Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 87 40 27

http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] [PATCH 1/2] cortex a9: merge cortex a9 and a8 code

2011-03-21 Thread Tomek CEDRO
Hello world :-)

On Mon, Mar 21, 2011 at 3:00 PM, Øyvind Harboe oyvind.har...@zylin.com wrote:
 In terms of maintenance we can't really support
 two files that are so similar, so unless I hear major
 objections, I'd rather go with this patch and sort
 out any regressions afterwards.

Maybe those two files are similar, but they are targeted for different
cpu families that have different quirks to work, so I think they
should be kept separated to avoid mess that can show up after some
time - usually one more file is not a pain but can make solution more
clear and elegant - thats only my opinion, not an objection :-) If you
prefer one file, why not name it arm_cortex.c to avoid putting
cortex_a9 stuff into cortex_a8 file? :-)

I dont have any experience with cortex a8/a9 but i have just ordered
them and should have in couple weeks for testing :-)

Best regards :-)
Tomek

ps/2: I got already into openocd internals, i like the idea of adding
openocd into existing application and sharing the api into tcl rather
than hardcoding :-)

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] [PATCH 1/2] cortex a9: merge cortex a9 and a8 code

2011-03-21 Thread Aaron Carroll
On 22 March 2011 01:53, luca ellero lro...@gmail.com wrote:
 Unfortunately at the moment I have no cortex A8 boards to test it.
 Anyway I wonder where 0x8000 come from, since I can't find any docs in

This came from poking the omap4430.  The ROM (on the two rev's I
tested, anyway) is bogus, so I don't think there's a sensible way to
determine the addresses are run-time.
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development