Dear All,
An update.
My setup: Linux is up-and-running on my target HW (Cortex-A8 based). Now via the debugger, a halt command is issued. Thereafter, using the debuggers memory window, I try to change the value of a global variable (virtual address) using “mww ”. Target HW uses AHB-AP path.
Currently, Cortex-A memory write via AHB-AP invalidates I/D cacheline with physical address when Linux OS is running (MMU enabled).
But, as per Cortex-A8 TRM [http://infocenter.arm.com/help/index.jsp], it should be virtual address.
Cortex-A series processors → Cortex-A8 → Revision: r3p2 → Cortex-A8 TRM → System Control Co-processor → System Control Co-processor registers → c7, Cache operations → Data formats for the cache operation → MVA
Current implementation in Openocd :
if (armv7a->memory_ap_available && (apsel == armv7a->memory_ap)) {
LOG_DEBUG(“Writing memory to address 0x%” PRIx32 “; size %” PRId32 “; count %” PRId32, address, size,
count);
if (mmu_enabled) {
virt = address;
retval = cortex_a8_virt2phys(target, virt, &phys);
if (retval != ERROR_OK)
return retval;
LOG_DEBUG(“Writing to virtual address. Translating v:0x%” PRIx32 " to r:0x%" PRIx32,
virt,
phys);
address = phys;
}
retval = cortex_a8_write_phys_memory(target, address, size,
count, buffer);
}
In cortex_a8_write_phys_memory(), from line 2213 to 2264, does, Invalidating I/D cacheline.
Proposed implementation :
if (armv7a->memory_ap_available && (apsel == armv7a->memory_ap)) {
LOG_DEBUG(“Writing memory to address 0x%” PRIx32 “; size %” PRId32 “; count %” PRId32, address, size,
count);
if (mmu_enabled) {
virt = address;
retval = cortex_a8_virt2phys(target, virt, &phys);
if (retval != ERROR_OK)
return retval;
LOG_DEBUG(“Writing to virtual address. Translating v:0x%” PRIx32 " to r:0x%" PRIx32,
virt,
phys);
address = phys;
}
retval = cortex_a8_write_phys_memory(target, address, size,
count, buffer);
if (retval == ERROR_OK && mmu_enabled)
retval = cortex_a8_invalidate_cache_mva_pou(target, virt, size, count);
}
Move from cortex_a8_write_phys_memory(), from line 2213 to 2264, does, Invalidating I/D cacheline to cortex_a8_invalidate_cache_mva_pou()
Any thoughts on this ?
Thanks and Regards,
Harish Kumar V