serial: a37xx: Switch to XTAL clock when booting Linux kernel
authorPali Rohár <pali@kernel.org>
Tue, 25 May 2021 17:42:41 +0000 (19:42 +0200)
committerStefan Roese <sr@denx.de>
Thu, 8 Jul 2021 14:40:52 +0000 (16:40 +0200)
commit8214728e4fe6f4ed495a5f85d0fc921cef77e0e9
tree3f69207510bb29940dba6ad868d34b1f4cca5791
parent5f41bab86c57bb5f0e1ee335ae402c7559937416
serial: a37xx: Switch to XTAL clock when booting Linux kernel

Unfortunately the UART driver in current Linux for Armada 3700 expects
UART's parent clock to be XTAL and calculats baudrate divisor according
to XTAL clock. Therefore we must switch back to XTAL clock before
booting kernel.

Implement .remove method for this driver with DM_FLAG_OS_PREPARE flag
set.

If current baudrate is unsuitable for XTAL clock then we do not change
anything. This can only happen if the user either configured unsupported
settings or knows what they are doing and has kernel patches which allow
usage of non-XTAL parent clock.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
drivers/serial/serial_mvebu_a3700.c