Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Alchemy: Default to noncoherent IO on Au1200 AB

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>

authored by

Manuel Lauss and committed by
Ralf Baechle
739cec8f d19648d7

+8 -24
+6
arch/mips/alchemy/common/setup.c
··· 67 67 case ALCHEMY_CPU_AU1500: 68 68 case ALCHEMY_CPU_AU1100: 69 69 coherentio = 0; 70 + break; 71 + case ALCHEMY_CPU_AU1200: 72 + /* Au1200 AB USB does not support coherent memory */ 73 + if (0 == (read_c0_prid() & PRID_REV_MASK)) 74 + coherentio = 0; 75 + break; 70 76 } 71 77 72 78 board_setup(); /* board specific setup */
+2 -24
arch/mips/alchemy/common/usb.c
··· 355 355 } 356 356 } 357 357 358 - static inline int au1200_coherency_bug(void) 359 - { 360 - #if defined(CONFIG_DMA_COHERENT) 361 - /* Au1200 AB USB does not support coherent memory */ 362 - if (!(read_c0_prid() & PRID_REV_MASK)) { 363 - printk(KERN_INFO "Au1200 USB: this is chip revision AB !!\n"); 364 - printk(KERN_INFO "Au1200 USB: update your board or re-configure" 365 - " the kernel\n"); 366 - return -ENODEV; 367 - } 368 - #endif 369 - return 0; 370 - } 371 - 372 358 static inline int au1200_usb_control(int block, int enable) 373 359 { 374 360 void __iomem *base = 375 361 (void __iomem *)KSEG1ADDR(AU1200_USB_CTL_PHYS_ADDR); 376 - int ret = 0; 377 362 378 363 switch (block) { 379 364 case ALCHEMY_USB_OHCI0: 380 - ret = au1200_coherency_bug(); 381 - if (ret && enable) 382 - goto out; 383 365 __au1200_ohci_control(base, enable); 384 366 break; 385 367 case ALCHEMY_USB_UDC0: 386 368 __au1200_udc_control(base, enable); 387 369 break; 388 370 case ALCHEMY_USB_EHCI0: 389 - ret = au1200_coherency_bug(); 390 - if (ret && enable) 391 - goto out; 392 371 __au1200_ehci_control(base, enable); 393 372 break; 394 373 default: 395 - ret = -ENODEV; 374 + return -ENODEV; 396 375 } 397 - out: 398 - return ret; 376 + return 0; 399 377 } 400 378 401 379