MIPS: Alchemy: Default to noncoherent IO on Au1200 AB
authorManuel Lauss <manuel.lauss@gmail.com>
Thu, 10 Apr 2014 20:57:59 +0000 (22:57 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 28 May 2014 09:04:48 +0000 (11:04 +0200)
CONFIG_DMA_COHERENT is no longer set; default to noncoherent io on
Au1200 revision AB to make USB work.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Cc: Linux-MIPS <linux-mips@linux-mips.org>
Patchwork: https://patchwork.linux-mips.org/patch/6745/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/alchemy/common/setup.c
arch/mips/alchemy/common/usb.c

index 566a174..8267e3c 100644 (file)
@@ -67,6 +67,12 @@ void __init plat_mem_setup(void)
        case ALCHEMY_CPU_AU1500:
        case ALCHEMY_CPU_AU1100:
                coherentio = 0;
+               break;
+       case ALCHEMY_CPU_AU1200:
+               /* Au1200 AB USB does not support coherent memory */
+               if (0 == (read_c0_prid() & PRID_REV_MASK))
+                       coherentio = 0;
+               break;
        }
 
        board_setup();  /* board specific setup */
index 2adc7ed..d193dbe 100644 (file)
@@ -355,47 +355,25 @@ static inline void __au1200_udc_control(void __iomem *base, int enable)
        }
 }
 
-static inline int au1200_coherency_bug(void)
-{
-#if defined(CONFIG_DMA_COHERENT)
-       /* Au1200 AB USB does not support coherent memory */
-       if (!(read_c0_prid() & PRID_REV_MASK)) {
-               printk(KERN_INFO "Au1200 USB: this is chip revision AB !!\n");
-               printk(KERN_INFO "Au1200 USB: update your board or re-configure"
-                                " the kernel\n");
-               return -ENODEV;
-       }
-#endif
-       return 0;
-}
-
 static inline int au1200_usb_control(int block, int enable)
 {
        void __iomem *base =
                        (void __iomem *)KSEG1ADDR(AU1200_USB_CTL_PHYS_ADDR);
-       int ret = 0;
 
        switch (block) {
        case ALCHEMY_USB_OHCI0:
-               ret = au1200_coherency_bug();
-               if (ret && enable)
-                       goto out;
                __au1200_ohci_control(base, enable);
                break;
        case ALCHEMY_USB_UDC0:
                __au1200_udc_control(base, enable);
                break;
        case ALCHEMY_USB_EHCI0:
-               ret = au1200_coherency_bug();
-               if (ret && enable)
-                       goto out;
                __au1200_ehci_control(base, enable);
                break;
        default:
-               ret = -ENODEV;
+               return -ENODEV;
        }
-out:
-       return ret;
+       return 0;
 }