Other Parts Discussed in Thread: AM3517
Hi everyone,
I am trying to access UART registers using kgdb over serial line (UART0) on AM3517. Linux kernel 2.6.32 was build with kgdb support and debug symbols. The developer board is connected to the PC via RS232. After the kernel is started and kgdb is enabled, I can debug kernel using gdb over serial line. I can read/write global variables, run functions.But the problem is that I can't access the UART registers.
For example, I am trying to read MCR UART3. Kernel use this structure to read/write UART registers.
static struct plat_serial8250_port serial_platform_data2[] = {
{
.mapbase = OMAP_UART3_BASE,
.irq = 74,
.iotype = UPIO_MEM,
.regshift = 2,
OMAP_UART3_BASE is a physical address from Technical Reference Manual. It is 0x49020000.
So .mapbase has physical address and the field .membase contains a virtual address. .membase is initialised using ioremap() call for mapbase.
I can read these addresses using kgdb.
(gdb) p/x serial_platform_data2[0].mapbase
$34 = 0x49020000
(gdb) p/x serial_platform_data2[0].membase
$35 = 0xfb020000
MCR register has offset 0x10. Trying to read it.
(gdb) x serial_platform_data2[0].membase+0x10
0xfb020000: Cannot access memory at address 0xfb020010
(gdb) x serial_platform_data2[0].mapbase+0x10
0x49020000: Cannot access memory at address 0x49020010
Information about mapping:
$ cat /proc/iomem | grep serial
4806a000-4806a057 : serial
4806c000-4806c057 : serial
49020000-49020057 : serial
Why can't I read UART registers over KGDB?