]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
arm64: print pre-relocation addresses in register dump
authorLothar Waßmann <LW@KARO-electronics.de>
Wed, 8 Mar 2017 15:13:38 +0000 (16:13 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Mon, 13 Mar 2017 15:36:33 +0000 (16:36 +0100)
The addresses in ELR and LR are not meaningful after relocation of
U-Boot. Print the pre-relocation values that can easily be matched
with the source code in the register dump.

arch/arm/lib/interrupts_64.c

index 7c9cfce69fafe7f1ef4055e2af69a1d67ca3c7ca..17807822158423ab23c44c66fafacb95fa13bee9 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/compiler.h>
 #include <efi_loader.h>
 
+DECLARE_GLOBAL_DATA_PTR;
 
 int interrupt_init(void)
 {
@@ -29,8 +30,15 @@ void show_regs(struct pt_regs *regs)
 {
        int i;
 
-       printf("ELR:     %lx\n", regs->elr);
-       printf("LR:      %lx\n", regs->regs[30]);
+       if (gd->flags & GD_FLG_RELOC) {
+               printf("ELR:     %08lx (pre-reloc: %08lx)\n",
+                       regs->elr, regs->elr - gd->reloc_off);
+               printf("LR:      %08lx (pre-reloc: %08lx)\n",
+                       regs->regs[30], regs->regs[30] - gd->reloc_off);
+       } else {
+               printf("ELR:     %08lx\n", regs->elr);
+               printf("LR:      %08lx\n", regs->regs[30]);
+       }
        for (i = 0; i < 29; i += 2)
                printf("x%-2d: %016lx x%-2d: %016lx\n",
                       i, regs->regs[i], i+1, regs->regs[i+1]);