XScale: setting hw breakpoint in Linux kernel possible?

Hi folks,

I’d like to set a breakpoint in a kernel I don’t have source code for, as I am just trying to see how it initializes some hardware… ie pci.

I have an Olimex Arm-Usb-OCD, and I have used OpenOCD v728 for most of my time with OpenOCD. Yesterday I pulled rev 1192 from svn. Whew! It has changed alot! Xscale support has improved. I’ll just name 2 items… but there are more.

xscale debug_handler

xscale vector_catch

I hope those 2 new additions can help me do what I need to do. I believe I have it setup correctly. It detects my flash chip, and I have working_area setup to speed things up a bit. :slight_smile:

When I get the target halted, with pc=0, and then do a resume, it will proceed for a bit but inevitably gets stuck with pc=0xffff0018. At that point the mmu, D-Cache, I-Cache are also enabled by that kernel.

Documents I have found that discuss what may be happening here.

www.arium.com/support/pdf/XScale_app_note.pdf

http://www.webetools.com/ultsol/users/k … d=39&sid2=

Dominic Rath’s master_thesis.pdf ‘out there’ mentions some of the inabilities of open source debuggers and mmu units. (I hope what he says there is still not the case!)

In openocd/src/target/xscale.c line 1735 it appears to use some hard coded locations… at 0x0 and 0xffff0000 in calls to xscale_load_ic but that may be insignificant.

I guess I should also mention this is an older 2.4 kernel.

I hope that I can get around this, even if I have to set some memory watches at the vector tables and do some fudging to make sure the mini ic is in agreement with the system.

well you learn something new everyday…

I had previously tried to set a wp point up at 0xffff0008, and then at 0xffff0012. Apparently I didn’t go high enough.

wp 0xFFFF001C 4 w

was the command I needed. Thank You!

As I was instructed:

"…you need to place a hw breakpoint at the point where the exception vectors get re-written to give the openocd a chance to re-read the new vectors otherwise your xscale is going to use stale data from the mini i-cache.

Breaking and resuming at some point after the new vectors have been written, but before the first exception occurs, solves this problem."

Again that’s:

mw 0xffff001c 4 w