diff options
Diffstat (limited to 'arch/mips/mm/c-r4k.c')
-rw-r--r-- | arch/mips/mm/c-r4k.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index fbcd8674ff1d..dd261df005c2 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c | |||
@@ -917,6 +917,18 @@ static inline void alias_74k_erratum(struct cpuinfo_mips *c) | |||
917 | } | 917 | } |
918 | } | 918 | } |
919 | 919 | ||
920 | static void b5k_instruction_hazard(void) | ||
921 | { | ||
922 | __sync(); | ||
923 | __sync(); | ||
924 | __asm__ __volatile__( | ||
925 | " nop; nop; nop; nop; nop; nop; nop; nop\n" | ||
926 | " nop; nop; nop; nop; nop; nop; nop; nop\n" | ||
927 | " nop; nop; nop; nop; nop; nop; nop; nop\n" | ||
928 | " nop; nop; nop; nop; nop; nop; nop; nop\n" | ||
929 | : : : "memory"); | ||
930 | } | ||
931 | |||
920 | static char *way_string[] = { NULL, "direct mapped", "2-way", | 932 | static char *way_string[] = { NULL, "direct mapped", "2-way", |
921 | "3-way", "4-way", "5-way", "6-way", "7-way", "8-way" | 933 | "3-way", "4-way", "5-way", "6-way", "7-way", "8-way" |
922 | }; | 934 | }; |
@@ -1683,6 +1695,37 @@ void r4k_cache_init(void) | |||
1683 | 1695 | ||
1684 | coherency_setup(); | 1696 | coherency_setup(); |
1685 | board_cache_error_setup = r4k_cache_error_setup; | 1697 | board_cache_error_setup = r4k_cache_error_setup; |
1698 | |||
1699 | /* | ||
1700 | * Per-CPU overrides | ||
1701 | */ | ||
1702 | switch (current_cpu_type()) { | ||
1703 | case CPU_BMIPS4350: | ||
1704 | case CPU_BMIPS4380: | ||
1705 | /* No IPI is needed because all CPUs share the same D$ */ | ||
1706 | flush_data_cache_page = r4k_blast_dcache_page; | ||
1707 | break; | ||
1708 | case CPU_BMIPS5000: | ||
1709 | /* We lose our superpowers if L2 is disabled */ | ||
1710 | if (c->scache.flags & MIPS_CACHE_NOT_PRESENT) | ||
1711 | break; | ||
1712 | |||
1713 | /* I$ fills from D$ just by emptying the write buffers */ | ||
1714 | flush_cache_page = (void *)b5k_instruction_hazard; | ||
1715 | flush_cache_range = (void *)b5k_instruction_hazard; | ||
1716 | flush_cache_sigtramp = (void *)b5k_instruction_hazard; | ||
1717 | local_flush_data_cache_page = (void *)b5k_instruction_hazard; | ||
1718 | flush_data_cache_page = (void *)b5k_instruction_hazard; | ||
1719 | flush_icache_range = (void *)b5k_instruction_hazard; | ||
1720 | local_flush_icache_range = (void *)b5k_instruction_hazard; | ||
1721 | |||
1722 | /* Cache aliases are handled in hardware; allow HIGHMEM */ | ||
1723 | current_cpu_data.dcache.flags &= ~MIPS_CACHE_ALIASES; | ||
1724 | |||
1725 | /* Optimization: an L2 flush implicitly flushes the L1 */ | ||
1726 | current_cpu_data.options |= MIPS_CPU_INCLUSIVE_CACHES; | ||
1727 | break; | ||
1728 | } | ||
1686 | } | 1729 | } |
1687 | 1730 | ||
1688 | static int r4k_cache_pm_notifier(struct notifier_block *self, unsigned long cmd, | 1731 | static int r4k_cache_pm_notifier(struct notifier_block *self, unsigned long cmd, |