> diff --git a/arch/mips/include/asm/mach-loongson/dma-coherence.h b/arch/mips/include/asm/mach-loongson/dma-coherence.h > index e143305..b1dc286 100644 > --- a/arch/mips/include/asm/mach-loongson/dma-coherence.h > +++ b/arch/mips/include/asm/mach-loongson/dma-coherence.h [...] > static inline unsigned long plat_dma_addr_to_phys(struct device *dev, > dma_addr_t dma_addr) > { > -#if defined(CONFIG_CPU_LOONGSON2F) && defined(CONFIG_64BIT) > +#if defined(CONFIG_64BIT) > +#if defined(CONFIG_CPU_LOONGSON3) > + return (dma_addr < 0x90000000 && dma_addr >= 0x80000000) ? > + (dma_addr & 0x0fffffff) : dma_addr; > +#elif defined(CONFIG_CPU_LOONGSON2F) > return (dma_addr > 0x8fffffff) ? dma_addr : (dma_addr & 0x0fffffff); > +#endif /* CONFIG_CPU_LOONGSON3 */ > #else > return dma_addr & 0x7fffffff; > -#endif > +#endif /* CONFIG_64BIT */ > } This will break if 64bit is defined and neither LOONGSON2F/3 are not defined.