From 4d69a3f3d49703f9ddd0790a7b2c15b9a7a765ea Mon Sep 17 00:00:00 2001 From: Kyungwoo Kang Date: Mon, 23 Apr 2018 13:44:52 +0900 Subject: [PATCH] [COMMON] serial: samsung: Add sfr dump function Change-Id: Ie12bae705cc959db18e6237ce4b0589f7a12a6fe Signed-off-by: Kyungwoo Kang --- drivers/tty/serial/samsung.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index 50b39725b3ba..ead6a9acf9d6 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -109,6 +109,34 @@ EXPORT_SYMBOL_GPL(s3c2410_serial_wake_peer); #define RTS_PINCTRL (1) #define DEFAULT_PINCTRL (0) +static void uart_sfr_dump(struct s3c24xx_uart_port *ourport) +{ + struct uart_port *port = &ourport->port; + + dev_err(ourport->port.dev, " Register dump\n" + "ULCON 0x%08x " + "UCON 0x%08x " + "UFCON 0x%08x \n" + "UMCON 0x%08x " + "UTRSTAT 0x%08x " + "UERSTAT 0x%08x " + "UMSTAT 0x%08x \n" + "UBRDIV 0x%08x " + "UINTP 0x%08x " + "UINTM 0x%08x \n" + , readl(port->membase + S3C2410_ULCON) + , readl(port->membase + S3C2410_UCON) + , readl(port->membase + S3C2410_UFCON) + , readl(port->membase + S3C2410_UMCON) + , readl(port->membase + S3C2410_UTRSTAT) + , readl(port->membase + S3C2410_UERSTAT) + , readl(port->membase + S3C2410_UMSTAT) + , readl(port->membase + S3C2410_UBRDIV) + , readl(port->membase + S3C64XX_UINTP) + , readl(port->membase + S3C64XX_UINTM) + ); +} + static void change_uart_gpio(int value, struct s3c24xx_uart_port *ourport) { int status = 0; @@ -463,6 +491,8 @@ s3c24xx_serial_rx_chars(int irq, void *dev_id) dbg("rxerr: port ch=0x%02x, rxs=0x%08x\n", ch, uerstat); + uart_sfr_dump(ourport); + /* check for break */ if (uerstat & S3C2410_UERSTAT_BREAK) { dbg("break!\n"); -- 2.20.1