summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/8250/8250_uniphier.c
AgeCommit message (Collapse)Author
2016-11-10serial: 8250_uniphier: avoid locking for FCR register writeMasahiro Yamada
The hardware book says, the FCR is combined with a register called CHAR (it will trigger interrupt when a specific character is received). At first, I used lock/read/modify/write/unlock dance for the FCR to not affect the upper bits, but the CHAR is actually never used. It should not hurt to always clear the CHAR and to handle the FCR as a normal case. It can save the costly locking. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Suggested-by: Denys Vlasenko <dvlasenk@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-10serial: 8250_uniphier: hardcode regshift to avoid unneeded memory readMasahiro Yamada
For this driver, uart_port::regshift is always 2. Hardcode the shift value instead of reading ->regshift to get an already known value. (pointed out by Denys Vlasenko) Furthermore, I am using register macros that are already shifted, which will save code a bit. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-27serial: 8250_uniphier: fix clearing divisor latch access bitMasahiro Yamada
At this point, 'value' is always a byte, then this code is clearing bit 15, which is already clear. I meant to clear bit 7. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reported-by: Denys Vlasenko <dvlasenk@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-27serial: 8250_uniphier: fix more unterminated stringDenys Vlasenko
Commit 1681d2116c96 ("serial: 8250_uniphier: add "\n" at the end of error log") missed this. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com> [masahiro: add commit log] Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25serial: 8250_uniphier: drop !defined(MODULE) conditionalMasahiro Yamada
The !defined(MODULE) conditional has been added to the OF_EARLYCON_DECLARE() define. Now we can revert commit a2d3ea2f2399 ("serial: 8250/uniphier: fix modular build"). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-30serial: 8250_uniphier: add "\n" at the end of error logMasahiro Yamada
Just in case. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-07serial: 8250/uniphier: fix modular buildArnd Bergmann
The newly added uniphier serial port driver fails to build as a loadable module when the base 8250 driver is built-in and its console support enabled: ERROR: "early_serial8250_setup" [drivers/tty/serial/8250/8250_uniphier.ko] undefined! This changes the driver to only provide the early console support if it is built-in itself as well. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21Merge 4.4-rc6 into tty-nextGreg Kroah-Hartman
We want the serial/tty fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-13serial: 8250_uniphier: add earlycon supportMasahiro Yamada
This reuses the code of drivers/tty/serial/8250/8250_early.c except - Overwrite device->port.iotype and device->port.regshift for UPIO_MEM32 because of_setup_earlycon() has set them for UPIO_MEM. - Set device->baud to zero to prevent early8250_setup() from initializing the divisor register because port->uartclk does not match the frequency expected by this hardware. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-12serial: 8250_uniphier: fix dl_read and dl_write functionsMasahiro Yamada
The register offset must be shifted by regshift, otherwise the baudrate is not set. I missed the issue probably because the divisor register was already set by the boot loader. Fixes: 1a8d2903cb6a ("serial: 8250_uniphier: add UniPhier serial driver") Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-03serial: 8250_uniphier: call clk_disable_unprepare() on failure pathMasahiro Yamada
If serial8250_register_8250_port() fails, disable and unprepare the clock before exiting. Fixes: 1a8d2903cb6a ("serial: 8250_uniphier: add UniPhier serial driver") Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01serial: 8250_uniphier: add UniPhier serial driverMasahiro Yamada
Add the driver for on-chip UART used on UniPhier SoCs. This hardware is similar to 8250, but the register mapping is slightly different: - The offset to FCR, MCR is different. - The divisor latch access bit does not exist. Instead, the divisor latch register is available at offset 9. This driver overrides serial_{in,out}, dl_{read,write} callbacks, but wants to borrow most of code from 8250_core.c. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>