bdi
GDB
for BDI3000 (QorIQ P3/P4/P5)
User Manual
38
© Copyright 1997-2012 by ABATRON AG Switzerland
V 1.03
3.3.5 Embedded Linux MMU Support
The bdiGDB system supports Linux kernel debugging when MMU is on. The MMU configuration pa-
rameter enables this mode of operation. In this mode, all addresses received from GDB are assumed
to be virtual. Before the BDI accesses memory, it translates this address into a physical one based
on information found in the TLB’s or kernel/user page table.
If PTBASE is not defined, the BDI does TLB1, TLB0 and if enabled default translation (in this order).
In order to search the page tables, the BDI needs to know the start addresses of the first level page
table. The configuration parameter PTBASE defines the physical address where the BDI looks for
the virtual/physical address of an array with two virtual/physical addresses of first level page tables.
The first one points normally to the kernel page table, the second one can point to the current user
page table. As long as the base pointer or the first entry is zero, the BDI does only L2 CAM (L2 TLB1)
and default translation. Default translation maps a 256 Mbyte range starting at KERNELBASE to
0x00000000. The second page table is only searched if its address is not zero and there was no
match in the first one.
The pointer structure is as follows:
PTBASE (physical address) ->
PTE pointer pointer(virtual or physical address) ->
PTE kernel pointer (virtual or physical address)
PTE user pointer (virtual or physical address)
The pointers are assumed virtual if they are >= KERNELBASE. In that case, default translation is ap-
plied to get the physical address.
Newer versions of "arch/ppc/kernel/head.S" support the automatic update of the BDI page table in-
formation structure. Search "head.S" for "abatron" and you will find the BDI specific extensions.
Extract from the configuration file:
[INIT]
......
WM32 0x000000f0 0x00000000 ;invalidate page table base
[TARGET]
....
MMU
XLAT
;translate effective to physical address
PTBASE 0x000000f0 ;here is the pointer to the page table pointers