]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: Add custom serial.h with BASE_BAUD override for generic kernel
authorMatt Redfearn <matt.redfearn@mips.com>
Tue, 28 Nov 2017 15:22:20 +0000 (15:22 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2017 15:53:24 +0000 (16:53 +0100)
commit6af81122fb2e0d0a4d9c3b9ac83b17e15a7c85c8
tree7cc42f7e6f100bc7293128eff92e225b6a9711b6
parent9483256e2844e1d588a5b331303337cfd09fd07f
MIPS: Add custom serial.h with BASE_BAUD override for generic kernel

Add a custom serial.h header for MIPS, allowing platforms to override
the asm-generic version if required.

The generic platform uses this header to set BASE_BAUD to 0. The
generic platform supports multiple boards, which may have different
UART clocks. Also one of the boards supported is the Boston FPGA board,
where the UART clock depends on the loaded FPGA bitfile. As such there
is no way that the generic kernel can set a compile time default
BASE_BAUD.

Commit 69d1a203e6cc ("earlycon: initialise baud field of earlycon device
structure") changed the behavior of of_setup_earlycon such that any baud
rate set in the device tree is now set in the earlycon structure. The
UART driver will then calculate a divisor based on BASE_BAUD and set it.
With MIPS generic kernels this resulted in garbage output due to the
incorrect uart clock rate being used to calculate a divisor. This
commit, combined with "serial: 8250_early: Only set divisor if valid clk
& baud" prevents the earlycon code setting a bad divisor and restores
earlycon output.

Fixes: 69d1a203e6cc ("earlycon: initialise baud field of earlycon device structure")
Cc: stable <stable@vger.kernel.org> # 4.14
Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/mips/include/asm/Kbuild
arch/mips/include/asm/serial.h [new file with mode: 0644]