From 88e9a93c9d53ddcf633aa07f14245da7f30408c2 Mon Sep 17 00:00:00 2001 From: Manuel Lauss Date: Thu, 20 Feb 2014 14:59:23 +0100 Subject: MIPS: Alchemy: Determine cohereny at runtime based on cpu type All Alchemy chips have coherent DMA, but for example the USB or AC97 peripherals on the Au1000/1500/1100 are not. This patch uses DMA_MAYBE_COHERENT on Alchemy and sets coherentio based on CPU type. Signed-off-by: Manuel Lauss Cc: Linux-MIPS Patchwork: https://patchwork.linux-mips.org/patch/6576/ Signed-off-by: Ralf Baechle --- arch/mips/alchemy/common/setup.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'arch/mips/alchemy/common') diff --git a/arch/mips/alchemy/common/setup.c b/arch/mips/alchemy/common/setup.c index 62b4e7bbeab9..566a1743f685 100644 --- a/arch/mips/alchemy/common/setup.c +++ b/arch/mips/alchemy/common/setup.c @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -59,6 +60,15 @@ void __init plat_mem_setup(void) /* Clear to obtain best system bus performance */ clear_c0_config(1 << 19); /* Clear Config[OD] */ + hw_coherentio = 0; + coherentio = 1; + switch (alchemy_get_cputype()) { + case ALCHEMY_CPU_AU1000: + case ALCHEMY_CPU_AU1500: + case ALCHEMY_CPU_AU1100: + coherentio = 0; + } + board_setup(); /* board specific setup */ /* IO/MEM resources. */ -- cgit v1.2.3