serial: ucc_uart: factor out soft_uart initialization
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Thu, 28 Nov 2019 14:55:35 +0000 (15:55 +0100)
committerLi Yang <leoyang.li@nxp.com>
Mon, 9 Dec 2019 19:54:34 +0000 (13:54 -0600)
commit96b6b6aaac79c5cef667a80c88e87b9fe147ef9a
tree58068b2554186dbd06582fd55fcc09f9b78f84d9
parent8b1cdc4033bd1659c5499c918d4e59bf8253abec
serial: ucc_uart: factor out soft_uart initialization

The "soft uart" mechanism is a workaround for a silicon bug which (as
far as I know) only affects some PPC-based SOCs.

The code that determines which microcode blob to request relies on
some powerpc-specific bits (e.g. the mfspr(SPRN_SVR) and hence also
the asm/reg.h header). This makes it a little awkward to allow this
driver to be built for non-PPC based SOCs with a QE, even if they are
not affected by that silicon bug and thus don't need any of the Soft
UART logic.

There's no way around guarding those bits with some ifdeffery, so to
keep that isolated, factor out the
do-we-need-soft-uart-and-if-so-handle-the-firmware to a separate
function, which we can then easily stub out for non-PPC.

Reviewed-by: Timur Tabi <timur@kernel.org>
Acked-by: Timur Tabi <timur@kernel.org>
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
drivers/tty/serial/ucc_uart.c