Hello,

Background:
I want to create a script to recover an i-MX6 by doing:
 1) setup DDR3 RAM
 2) load a bootloader (here: barebox) into RAM
 3) resume at $bootloader_start_address

For that to work I need to disable the MMU to get a fixed memory layout
and also to disable caches which seems to be necessary. I didn't find a
dedicated command to do that though, so I used:

        arm mcr 15 0 1 0 0 [expr [arm mrc 15 0 1 0 0] & ~0xd]

which seems to work. But the problem now is that openocd's view about
the MMU doesn't change and so the load_image command fails with:

        Debug: 1457 578 armv7a.c:160 armv7a_mmu_translate_va(): 1st lvl desc: 
00000000
        Error: 1458 578 armv7a.c:163 armv7a_mmu_translate_va(): Address 
translation failure

I instrumented cortex_a8_write_memory and really cortex_a8_mmu(target,
&mmu_enabled) returns with mmu_enabled=1 even though the MMU is already
off. It seems

        target_to_cortex_a8(target)->armv7a_common.armv7a_mmu.mmu_enabled

is only updated in cortex_a8_post_debug_entry which isn't called at the
end of the command disabling the MMU above.

I also tried:

        # thats a 'b .'
        mww phys 0x00900000 0xeafffffe

        # disable MMU and caches
        arm mcr 15 0 1 0 0 [expr [arm mrc 15 0 1 0 0] & ~0xd]

        step 0x00900000

but this doesn't seem to be reliable. Sometimes it results in:

        Error: timeout waiting for target halt

Sometimes (if Linux is already booted) makes Linux unhappy and printing:

        Unable to handle kernel NULL pointer dereference at virtual address 
00000000

on the machine's console.

Any ideas? Did I miss anything?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to