···1515#include <asm/page.h>1616#include <asm/cacheflush.h>1717#include <arch/icache.h>1818+#include <arch/spr_def.h>181919202021void __flush_icache_range(unsigned long start, unsigned long end)···4039 char *p, *base;4140 size_t step_size, load_count;4241 const unsigned long STRIPE_WIDTH = 8192;4242+#ifdef __tilegx__4343+ /*4444+ * On TILE-Gx, we must disable the dstream prefetcher before doing4545+ * a cache flush; otherwise, we could end up with data in the cache4646+ * that we don't want there. Note that normally we'd do an mf4747+ * after the SPR write to disabling the prefetcher, but we do one4848+ * below, before any further loads, so there's no need to do it4949+ * here.5050+ */5151+ uint_reg_t old_dstream_pf = __insn_mfspr(SPR_DSTREAM_PF);5252+ __insn_mtspr(SPR_DSTREAM_PF, 0);5353+#endif43544455 /*4556 * Flush and invalidate the buffer out of the local L1/L2···135122136123 /* Wait for the load+inv's (and thus finvs) to have completed. */137124 __insn_mf();125125+126126+#ifdef __tilegx__127127+ /* Reenable the prefetcher. */128128+ __insn_mtspr(SPR_DSTREAM_PF, old_dstream_pf);129129+#endif138130}