From: Vagrant Cascadian Date: Fri, 6 Jan 2023 03:38:24 +0000 (+0000) Subject: fix-qemu-ppce500-with-binutils-2.38 X-Git-Tag: archive/raspbian/2024.01+dfsg-5+rpi1~3^2^2^2^2^2^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=71e969aeaffc81501769c13ee44f52b6761b0d50;p=u-boot.git fix-qemu-ppce500-with-binutils-2.38 Fix building qemu-ppce500 target with binutils ~2.38. https://bugs.debian.org/1003490 The incompatibility was introduced in binutils commit: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=b25f942e18d6ecd7ec3e2d2e9930eb4f996c258a Gbp-Pq: Name fix-qemu-ppce500-with-binutils-2.38.patch --- diff --git a/arch/powerpc/cpu/mpc85xx/tlb.c b/arch/powerpc/cpu/mpc85xx/tlb.c index 81e60722f..0d24f480a 100644 --- a/arch/powerpc/cpu/mpc85xx/tlb.c +++ b/arch/powerpc/cpu/mpc85xx/tlb.c @@ -52,7 +52,10 @@ void read_tlbcam_entry(int idx, u32 *valid, u32 *tsize, unsigned long *epn, u32 _mas1; mtspr(MAS0, FSL_BOOKE_MAS0(1, idx, 0)); - asm volatile("tlbre;isync"); + asm volatile(".machine push;\n" + ".machine e500;\n" + "tlbre;isync;\n" + ".machine pop;\n"); _mas1 = mfspr(MAS1); *valid = (_mas1 & MAS1_VALID); @@ -111,7 +114,10 @@ void init_used_tlb_cams(void) /* walk all the entries */ for (i = 0; i < num_cam; i++) { mtspr(MAS0, FSL_BOOKE_MAS0(1, i, 0)); - asm volatile("tlbre;isync"); + asm volatile(".machine push;\n" + ".machine e500;\n" + "tlbre;isync;\n" + ".machine pop;"); if (mfspr(MAS1) & MAS1_VALID) use_tlb_cam(i); } @@ -185,7 +191,10 @@ void disable_tlb(u8 esel) #ifdef CONFIG_ENABLE_36BIT_PHYS mtspr(MAS7, 0); #endif - asm volatile("isync;msync;tlbwe;isync"); + asm volatile(".machine push;\n" + ".machine e500;\n" + "isync;msync;tlbwe;isync;\n" + ".machine pop;\n"); #ifdef CONFIG_ADDR_MAP if (gd->flags & GD_FLG_RELOC) @@ -195,7 +204,11 @@ void disable_tlb(u8 esel) static void tlbsx (const volatile unsigned *addr) { - __asm__ __volatile__ ("tlbsx 0,%0" : : "r" (addr), "m" (*addr)); + __asm__ __volatile__ (".machine push;\n" + ".machine e500;\n" + "tlbsx 0,%0;\n" + ".machine pop;\n" + : : "r" (addr), "m" (*addr)); } /* return -1 if we didn't find anything */