]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mips: traps: Set WG bit in EBase register on Octeon
authorStefan Roese <sr@denx.de>
Thu, 14 May 2020 09:59:06 +0000 (11:59 +0200)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Sat, 18 Jul 2020 12:23:25 +0000 (14:23 +0200)
WG (bit 11) needs to be set on Octeon to enable writing bits 63:30 of
the exception base register.

Signed-off-by: Stefan Roese <sr@denx.de>
arch/mips/include/asm/mipsregs.h
arch/mips/lib/traps.c

index 7538e6b2e0bf62c608cdb1a3a74141cbfc42dee2..17381301ec9e8314f8339ca92866bea75e779809 100644 (file)
  * Bits in the coprocessor 0 EBase register.
  */
 #define EBASE_CPUNUM           0x3ff
+#define EBASE_WG               (_ULCAST_(1) << 11)
 
 /*
  * Bits in the coprocessor 0 config register.
index b1ae02fcab8abd064b6a0000c017c6cc0a58f438..6ff9d20bd611499812e1c094937288fd2139dd63 100644 (file)
@@ -108,6 +108,10 @@ void trap_init(ulong reloc_addr)
 
        saved_ebase = read_c0_ebase() & 0xfffff000;
 
+       /* Set WG bit on Octeon to enable writing to bits 63:30 */
+       if (IS_ENABLED(CONFIG_ARCH_OCTEON))
+               ebase |= EBASE_WG;
+
        write_c0_ebase(ebase);
        clear_c0_status(ST0_BEV);
        execution_hazard_barrier();