Skip to content

Commit

Permalink
armv7a_mmu: Check earlier for PAR read
Browse files Browse the repository at this point in the history
Check earlier that the read of the PAR register was successful instead
of starting the decoding and then checking for an error reading that
register.

Change-Id: Id96c2b2f76d2d1c745fcfa55ad4c1e6db92106f9
Signed-off-by: Florian Fainelli <[email protected]>
Reviewed-on: http:https://openocd.zylin.com/5215
Tested-by: jenkins
Reviewed-by: Antonio Borneo <[email protected]>
Reviewed-by: Matthias Welwarsky <[email protected]>
  • Loading branch information
ffainelli authored and thinkfat committed Jun 12, 2019
1 parent 6f87df8 commit ba11adb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/target/armv7a_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ int armv7a_mmu_translate_va_pa(struct target *target, uint32_t va,
retval = dpm->instr_read_data_r0(dpm,
ARMV4_5_MRC(15, 0, 0, 7, 4, 0),
val);
if (retval != ERROR_OK)
goto done;
/* decode memory attribute */
NOS = (*val >> 10) & 1; /* Not Outer shareable */
NS = (*val >> 9) & 1; /* Non secure */
INNER = (*val >> 4) & 0x7;
OUTER = (*val >> 2) & 0x3;

if (retval != ERROR_OK)
goto done;
*val = (*val & ~0xfff) + (va & 0xfff);
if (meminfo) {
LOG_INFO("%" PRIx32 " : %" PRIx32 " %s outer shareable %s secured",
Expand Down

0 comments on commit ba11adb

Please sign in to comment.