access to hardware registers using KGDB on ARM

Андрей Скворцов skvortsov.av at summatechnology.ru
Wed Apr 24 09:29:02 EDT 2013


Hello everyone,

I have arm SoC AM3517 (Cortex-A8) running linux 2.6.32. I am trying to
access hardware registers using kgdb. I can connect to the board via
RS232, can read variables in kernel space, control processes using
breakpoints, but I can't read hardware register.

For example, I am trying to read UART3 registers. Information about
UART3 is saved in structure:

static struct plat_serial8250_port serial_platform_data2[] = {
    {
        .mapbase    = OMAP_UART3_BASE,
        .irq        = 74,
        .iotype        = UPIO_MEM,
        .regshift    = 2,
	...
    }
}

mapbase is a physical address. According to the Technical Reference
Manual is should be 0x49020000.

I checked this field using kgdb:

(gdb) p/x serial_platform_data2[0].mapbase
$34 = 0x49020000


This structure has the field membase. As I understand, it contains
virtual address of the mapbase physical address. This field is
initialized on UART init via function ioremap().

I checked this field as well:

(gdb) p/x serial_platform_data2[0].membase
$35 = 0xfb020000


Now I am trying to read register MCR_REG, that has offset 0x10 from the
base address.

(gdb) x serial_platform_data2[0].membase+0x10
0xfb020010:    Cannot access memory at address 0xfb020010

(gdb) x serial_platform_data2[0].mapbase+0x10
0x49020010:   Cannot access memory at address 0x49020010


As I understand, the membase address should work. Right?
Why has access failed? Is it kgdb limitation?


-- 
Best regards,
Andrey Skvortsov



More information about the Kernelnewbies mailing list