[COMMON] serial: samsung: Add sfr dump function
authorKyungwoo Kang <kwoo.kang@samsung.com>
Mon, 23 Apr 2018 04:44:52 +0000 (13:44 +0900)
committerSunyoung Kang <sy0816.kang@samsung.com>
Wed, 30 May 2018 04:35:29 +0000 (13:35 +0900)
Change-Id: Ie12bae705cc959db18e6237ce4b0589f7a12a6fe
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
drivers/tty/serial/samsung.c

index 50b39725b3ba280c8bec36301f8fa0254c839219..ead6a9acf9d60be3a0e893996cdbceca96645e68 100644 (file)
@@ -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");