• Wang YanQing's avatar
    serial: 8250_pci: Add WCH CH352 quirk to avoid Xscale detection · 8b5c913f
    Wang YanQing authored
    The code in 8250.c for detecting ARM/XScale UARTs says:
    
      * Try writing and reading the UART_IER_UUE bit (b6).
      * If it works, this is probably one of the Xscale platform's
      * internal UARTs.
    
    If the above passes, it then goes on to:
    
         * It's an Xscale.
         * We'll leave the UART_IER_UUE bit set to 1 (enabled).
    
    However, the CH352 uses the UART_IER_UUE as the LOWPOWER function,
    so it is readable and writable.  According to the datasheet:
    
        "LOWPOWER:When the bit is 1, close the internal benchmark
         clock of serial port to set into low-power status.
    
    So it essentially gets mis-detected as Xscale, and gets
    powered down in the process.  The device in question where
    this was seen is listed by lspci as:
    
     Serial controller: Device 4348:3253 (rev 10) (prog-if 02 [16550])
    
    Re-using the 353 quirk which just sets flags to fixed and type
    to 16550 is suitable for fixing the 352 as well.
    Signed-off-by: default avatarWang YanQing <udknight@gmail.com>
    Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    8b5c913f
8250_pci.c 126 KB