serial: ns16550: add Ralink UART support
cover serial: ns16550: add Ralink UART support
Please dont apply this patchseries! It's for review only!
This patchseries adds support for ns16550-like UART used in Ralink/Mediatek SoCs. This UART uses non-standard register addresses.
This patchseries was tested on MT7620N SoC.
Antony Pavlov (2):
serial: ns16550: introduce custom divisor latch setter
serial: ns16550: add Ralink UART support
drivers/serial/Kconfig | 8 ++++ drivers/serial/serial_ns16550.c | 88 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 93 insertions(+), 3 deletions(-)
Signature · 7 lines
2.6.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
RFC 1/2 serial: ns16550: introduce custom divisor latch setter
--- drivers/serial/serial_ns16550.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/serial/serial_ns16550.c +9 -3
@@ -52,6 +52,7 @@ struct ns16550_priv {unsigned iobase;void (*write_reg)(struct ns16550_priv *,uint8_t val,unsigned offset);uint8_t (*read_reg)(struct ns16550_priv *,unsigned offset); +void (*dl_write)(struct ns16550_priv *,unsigned baud_divisor); };struct ns16550_drvdata {
@@ -188,9 +189,14 @@ static int ns16550_setbaudrate(struct console_device *cdev, int baud_rate)unsigned int baud_divisor =ns16550_calc_divisor (cdev, baud_rate);struct ns16550_priv *priv =to_ns16550_priv (cdev); -ns16550_write (cdev,LCR_BKSE , lcr); -ns16550_write (cdev, baud_divisor &0xff , dll); -ns16550_write (cdev, (baud_divisor >>8 ) &0xff , dlm); +if (priv->dl_write) { + priv->dl_write (priv, baud_divisor); + }else { +ns16550_write (cdev,LCR_BKSE , lcr); +ns16550_write (cdev, baud_divisor &0xff , dll); +ns16550_write (cdev, (baud_divisor >>8 ) &0xff , dlm); + } +ns16550_write (cdev,LCRVAL , lcr);ns16550_write (cdev,MCRVAL , mcr);ns16550_write (cdev, priv->fcrval, fcr);
Signature · 7 lines
2.6.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
RFC 2/2 serial: ns16550: add Ralink UART support
In reply to Antony Pavlov--- drivers/serial/Kconfig | 8 +++++ drivers/serial/serial_ns16550.c | 76 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+)
drivers/serial/Kconfig +8 -0
@@ -80,6 +80,14 @@ config DRIVER_SERIAL_NS16550 help Enable this to get support for NS16550 based serial devices +config DRIVER_SERIAL_NS16550_RT288X + bool "Ralink RT288x/RT305x/RT3662/RT3883 serial port support" + depends on DRIVER_SERIAL_NS16550 + help + Selecting this option will add support for the alternate register + layout used by Ralink RT288x/RT305x, Alchemy Au1xxx, and some others. + If unsure, say N. + config DRIVER_SERIAL_ATMEL depends on ARCH_AT91 default y
drivers/serial/serial_ns16550.c +76 -0
94 lines not on this page · raw message
Signature · 7 lines
2.6.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Hi Antony,
Quoted 5 lines · Antony Pavlov
Please dont apply this patchseries! It's for review only!
This patchseries adds support for ns16550-like UART used in Ralink/Mediatek SoCs. This UART uses non-standard register addresses.
I'm getting unsure how much sense it makes to expand the ns16550 driver like this and like we've done with Omap, Tegra and others. It's always a little weight that we add to the driver and maybe we have reached the point where we should split the driver into several SoC specific drivers and some common library helper code for the general ns16550 support.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox