• Hauke Mehrtens's avatar
    serial: lantiq: Do not swap register read/writes · d3a28a53
    Hauke Mehrtens authored
    The ltq_r32() and ltq_w32() macros use the __raw_readl() and
    __raw_writel() functions which do not swap the value to little endian.
    On the big endian vrx200 SoC the UART is operated in big endian IO mode,
    the readl() and write() functions convert the value to little endian
    first and then the driver does not work any more on this SoC.
    Currently the vrx200 SoC selects the CONFIG_SWAP_IO_SPACE option,
    without this option the serial driver would work, but PCI devices do not
    work any more.
    
    This patch makes the driver use the __raw_readl() and __raw_writel()
    functions which do not swap the endianness. On big endian system it is
    assumed that the device should be access in big endian IO mode and on a
    little endian system it would be access in little endian mode.
    
    Fixes: 89b8bd20 ("serial: lantiq: Use readl/writel instead of ltq_r32/ltq_w32")
    Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
    Acked-by: default avatarJohn Crispin <john@phrozen.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    d3a28a53
lantiq.c 18.7 KB