]> git.baikalelectronics.ru Git - uboot.git/commitdiff
MIPS: move create_tlb() in an proper header: mipsregs.h
authorGregory CLEMENT <gregory.clement@bootlin.com>
Fri, 14 Dec 2018 15:16:45 +0000 (16:16 +0100)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Wed, 19 Dec 2018 14:23:01 +0000 (15:23 +0100)
Export create_tlb() as an inline function in mipsregs.h. It allows to
remove the declaration of the function from the board files.

Then it will allow also to use this function very early in the boot when
the stack is not usable.

Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
arch/mips/cpu/cpu.c
arch/mips/include/asm/mipsregs.h

index 5c56ab0289e05173d02e51541abea724468ee590..a403ff729b182cd676016ce6590a9d1adbd95e64 100644 (file)
@@ -28,16 +28,6 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 }
 #endif
 
-void write_one_tlb(int index, u32 pagemask, u32 hi, u32 low0, u32 low1)
-{
-       write_c0_entrylo0(low0);
-       write_c0_pagemask(pagemask);
-       write_c0_entrylo1(low1);
-       write_c0_entryhi(hi);
-       write_c0_index(index);
-       tlb_write_indexed();
-}
-
 int arch_cpu_init(void)
 {
        mips_cache_probe();
index cdd546a3b2a8bc2da0b9aa85735962ec5c1be875..f80311e64e8c58d25e316b66149cec991d5499de 100644 (file)
@@ -1998,6 +1998,17 @@ static inline unsigned int get_ebase_cpunum(void)
        return read_c0_ebase() & 0x3ff;
 }
 
+static inline void write_one_tlb(int index, u32 pagemask, u32 hi, u32 low0,
+                                u32 low1)
+{
+       write_c0_entrylo0(low0);
+       write_c0_pagemask(pagemask);
+       write_c0_entrylo1(low1);
+       write_c0_entryhi(hi);
+       write_c0_index(index);
+       tlb_write_indexed();
+}
+
 #endif /* !__ASSEMBLY__ */
 
 #endif /* _ASM_MIPSREGS_H */