Anton Fedotov | 2 Apr 22:59 2010
Picon

[PATCH] <Cortex A8> MMU Support

Hello,

This patch adds MMU support for Cortex A8:
+ virt2phys() can now convert virtual address to real
+ read_memory() and write_memory() are renamed to read_phys_memory()
and write_phys_memory()
+ new read_memory() and write_memory() try to resolve real address if
mmu is enambled than perform real address reading/writing
   + if address is bellow 0xc000000 than TTB0 is used for page table
dereference, if above - than TTB1. Linux style of user/kernel address
separation
   + if above fails (i.e address is unspecified) than mode is checked
whether it is Supervisor (than TTB1) or User (than TTB0)
- Software breakpoints doesn't work. You should invoke
"gdb_breakpoint_override hard" before you start debugging
+ cortex_a8_mmu(), cortex_a8_enable_mmu_caches(),
cortex_a8_disable_mmu_caches() are implemented

This patch is not perfect. It needs at least some cleaning. And it
shouldn't be commited in current state.
But it works. I've tested it on DevKit8000 with Olimex ARM-USB-TINY.
Both MMU disabled u-boot and MMU enabled Linux can be debugged without
a problem.
Maybe it will help someone.

Signed-off-by: Anton Fedotov <AD.Fedotov at gmail.com>
Attachment (openocd_a8_mmu.diff): application/octet-stream, 24 KiB
_______________________________________________
(Continue reading)

Øyvind Harboe | 3 Apr 09:16 2010

Re: [PATCH] <Cortex A8> MMU Support

Hi Anton,

I can't look until after easter, but it is great to see some work
done in this area!

Hopefully you'll get some good feedback before then and it will
be ready to merge soon, so we can get it tested more widely!

--

-- 
Meet us in Paris at rts EMBEDDED SYSTEMS 2010 - March 30. and April 1.
http://www.zylin.com/events_rts.html

Øyvind Harboe
US toll free 1-866-980-3434 / International +47 51 63 25 00
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
_______________________________________________
Openocd-development mailing list
Openocd-development <at> lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development
Dirk Behme | 3 Apr 10:12 2010

Re: [PATCH] <Cortex A8> MMU Support

Hi Anton,

On 03.04.2010 09:16, Øyvind Harboe wrote:
> Hi Anton,
>
> I can't look until after easter, but it is great to see some work
> done in this area!

Yes, great! :)

> Hopefully you'll get some good feedback before then and it will
> be ready to merge soon, so we can get it tested more widely!

It would be nice if you could give some short examples how you tested 
it. E.g. how to load U-Boot and Linux debugging symbols, how you 
initialized OpenOCD, where you set breakpoints etc. Maybe you like to 
just copy & paste the log of an example debugging session?

Many thanks for the great work and best regards

Dirk

_______________________________________________
Openocd-development mailing list
Openocd-development <at> lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development
Anton Fedotov | 3 Apr 12:07 2010
Picon

Re: [PATCH] <Cortex A8> MMU Support

Hello,

Thanks for your replies. Let me tell a few words about debugging emvironment
I've used Devkit8000: http://www.armkits.com/Product/devkit8000.asp
It came with Linux preinstalled. From user guide I've taken an example
program that makes leds blink and cross-compiled it with debug symbols
included. I didn't recompile Linux kernel, but I think everything will be the
same.

I've launched the system this way:
1) Powered on Devkit8000
2) On my linux host launched OpenOCD:
sudo openocd -s /usr/local/share/openocd/ -f
interface/olimex-jtag-tiny.cfg -f target/omap3530.cfg -d 3
3) On cross-GDB (arm-linux-gnueabi-gdb) entered commands:
target remote localhost:3333
monitor gdb_breakpoint_override hard
monitor omap3_dbginit omap3530.cpu
monitor halt

Two last commands can be substituted with "monitor reset halt". Command
"monitor gdb_breakpoint_override hard" is critical. It tells gdb to use hardware
breakpoints.

Now GDB is connected to the device and device is stoped and ready to
be debugged.
You can use usual GDB commands like: backtrace, break, step, stepi,
print, x, ...
And also Openocd commands in GDB like: monitor virt2phys, monitor mww, ...

(Continue reading)

Anton Fedotov | 5 Apr 09:27 2010
Picon

Re: [PATCH] <Cortex A8> MMU Support

Hello,

    Please see logs of OpenOCD and GDB in attached files.

Anton Fedotov

2010/4/3 Anton Fedotov <AD.Fedotov@...>:
> Hello,
>
> Thanks for your replies. Let me tell a few words about debugging emvironment
> I've used Devkit8000: http://www.armkits.com/Product/devkit8000.asp
> It came with Linux preinstalled. From user guide I've taken an example
> program that makes leds blink and cross-compiled it with debug symbols
> included. I didn't recompile Linux kernel, but I think everything will be the
> same.
>
> I've launched the system this way:
> 1) Powered on Devkit8000
> 2) On my linux host launched OpenOCD:
> sudo openocd -s /usr/local/share/openocd/ -f
> interface/olimex-jtag-tiny.cfg -f target/omap3530.cfg -d 3
> 3) On cross-GDB (arm-linux-gnueabi-gdb) entered commands:
> target remote localhost:3333
> monitor gdb_breakpoint_override hard
> monitor omap3_dbginit omap3530.cpu
> monitor halt
>
> Two last commands can be substituted with "monitor reset halt". Command
> "monitor gdb_breakpoint_override hard" is critical. It tells gdb to use hardware
> breakpoints.
(Continue reading)

Øyvind Harboe | 11 Apr 08:57 2010

Re: [PATCH] <Cortex A8> MMU Support

Could you perform the cleanup you would like to have
done?

I would like to merge these changes so they can see wider
testing.

--

-- 
Meet us in Paris at rts EMBEDDED SYSTEMS 2010 - March 30. and April 1.
http://www.zylin.com/events_rts.html

Øyvind Harboe
US toll free 1-866-980-3434 / International +47 51 63 25 00
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
_______________________________________________
Openocd-development mailing list
Openocd-development <at> lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development
Anton Fedotov | 14 Apr 06:50 2010
Picon

Re: [PATCH] <Cortex A8> MMU Support

See updated patch in attach.

2010/4/11 Øyvind Harboe <oyvind.harboe@...>:
> Could you perform the cleanup you would like to have
> done?
>
> I would like to merge these changes so they can see wider
> testing.
>
>
> --
> Meet us in Paris at rts EMBEDDED SYSTEMS 2010 - March 30. and April 1.
> http://www.zylin.com/events_rts.html
>
> Øyvind Harboe
> US toll free 1-866-980-3434 / International +47 51 63 25 00
> http://www.zylin.com/zy1000.html
> ARM7 ARM9 ARM11 XScale Cortex
> JTAG debugger and flash programmer
>
_______________________________________________
Openocd-development mailing list
Openocd-development@...
https://lists.berlios.de/mailman/listinfo/openocd-development
Øyvind Harboe | 14 Apr 09:47 2010

Re: [PATCH] <Cortex A8> MMU Support

On Wed, Apr 14, 2010 at 6:50 AM, Anton Fedotov <AD.Fedotov <at> gmail.com> wrote:
> See updated patch in attach.

Merged.

Thanks!

--

-- 
Øyvind Harboe
US toll free 1-866-980-3434 / International +47 51 63 25 00
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
_______________________________________________
Openocd-development mailing list
Openocd-development <at> lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Gmane