All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: Anup Patel <anup@brainfault.org>
Cc: Rob Herring <robh@kernel.org>, Albert Ou <aou@eecs.berkeley.edu>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Palmer Dabbelt <palmer@sifive.com>,
	"linux-kernel@vger.kernel.org List"
	<linux-kernel@vger.kernel.org>,
	Christoph Hellwig <hch@infradead.org>,
	Atish Patra <atish.patra@wdc.com>,
	linux-serial@vger.kernel.org, Jiri Slaby <jslaby@suse.com>,
	linux-riscv@lists.infradead.org
Subject: [PATCH] tty/serial: use uart_console_write in the RISC-V SBL early console
Date: Thu, 10 Jan 2019 18:11:39 +0100	[thread overview]
Message-ID: <mvmsgy0cu9g.fsf_-_@suse.de> (raw)
In-Reply-To: <CAAhSdy0suSgKpdz+NUrXzS9Ozp75hMC6ovW4yLf5s0KYJwwocw@mail.gmail.com> (Anup Patel's message of "Thu, 10 Jan 2019 21:47:07 +0530")

This enables proper NLCR processing.

Suggested-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Andreas Schwab <schwab@suse.de>
---
 drivers/tty/serial/earlycon-riscv-sbi.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serial/earlycon-riscv-sbi.c b/drivers/tty/serial/earlycon-riscv-sbi.c
index e1a551aae3..ce81523c31 100644
--- a/drivers/tty/serial/earlycon-riscv-sbi.c
+++ b/drivers/tty/serial/earlycon-riscv-sbi.c
@@ -10,13 +10,16 @@
 #include <linux/serial_core.h>
 #include <asm/sbi.h>
 
-static void sbi_console_write(struct console *con,
-			      const char *s, unsigned int n)
+static void sbi_putc(struct uart_port *port, int c)
 {
-	int i;
+	sbi_console_putchar(c);
+}
 
-	for (i = 0; i < n; ++i)
-		sbi_console_putchar(s[i]);
+static void sbi_console_write(struct console *con,
+			      const char *s, unsigned n)
+{
+	struct earlycon_device *dev = con->data;
+	uart_console_write(&dev->port, s, n, sbi_putc);
 }
 
 static int __init early_sbi_setup(struct earlycon_device *device,
-- 
2.20.1

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

WARNING: multiple messages have this Message-ID (diff)
From: Andreas Schwab <schwab@suse.de>
To: Anup Patel <anup@brainfault.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>, Palmer Dabbelt <palmer@sifive.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Atish Patra <atish.patra@wdc.com>,
	Christoph Hellwig <hch@infradead.org>,
	Rob Herring <robh@kernel.org>,
	linux-riscv@lists.infradead.org,
	"linux-kernel@vger.kernel.org List"
	<linux-kernel@vger.kernel.org>,
	linux-serial@vger.kernel.org
Subject: [PATCH] tty/serial: use uart_console_write in the RISC-V SBL early console
Date: Thu, 10 Jan 2019 18:11:39 +0100	[thread overview]
Message-ID: <mvmsgy0cu9g.fsf_-_@suse.de> (raw)
In-Reply-To: <CAAhSdy0suSgKpdz+NUrXzS9Ozp75hMC6ovW4yLf5s0KYJwwocw@mail.gmail.com> (Anup Patel's message of "Thu, 10 Jan 2019 21:47:07 +0530")

This enables proper NLCR processing.

Suggested-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Andreas Schwab <schwab@suse.de>
---
 drivers/tty/serial/earlycon-riscv-sbi.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serial/earlycon-riscv-sbi.c b/drivers/tty/serial/earlycon-riscv-sbi.c
index e1a551aae3..ce81523c31 100644
--- a/drivers/tty/serial/earlycon-riscv-sbi.c
+++ b/drivers/tty/serial/earlycon-riscv-sbi.c
@@ -10,13 +10,16 @@
 #include <linux/serial_core.h>
 #include <asm/sbi.h>
 
-static void sbi_console_write(struct console *con,
-			      const char *s, unsigned int n)
+static void sbi_putc(struct uart_port *port, int c)
 {
-	int i;
+	sbi_console_putchar(c);
+}
 
-	for (i = 0; i < n; ++i)
-		sbi_console_putchar(s[i]);
+static void sbi_console_write(struct console *con,
+			      const char *s, unsigned n)
+{
+	struct earlycon_device *dev = con->data;
+	uart_console_write(&dev->port, s, n, sbi_putc);
 }
 
 static int __init early_sbi_setup(struct earlycon_device *device,
-- 
2.20.1

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

  reply	other threads:[~2019-01-10 17:11 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-04 13:55 [PATCH 0/3] RISC-V SBI earlycon Anup Patel
2018-12-04 13:55 ` Anup Patel
2018-12-04 13:55 ` [PATCH 1/3] tty/serial: Add RISC-V SBI earlycon support Anup Patel
2018-12-04 13:55   ` Anup Patel
2018-12-05  9:58   ` Greg Kroah-Hartman
2018-12-05  9:58     ` Greg Kroah-Hartman
2018-12-07 18:45     ` Palmer Dabbelt
2018-12-07 18:45       ` Palmer Dabbelt
2018-12-07 18:30   ` Palmer Dabbelt
2018-12-07 18:30     ` Palmer Dabbelt
2019-01-10 14:07   ` [PATCH] tty/serial: emit CR before NL in RISC-V SBL console Andreas Schwab
2019-01-10 14:07     ` Andreas Schwab
2019-01-10 15:16     ` Anup Patel
2019-01-10 15:16       ` Anup Patel
2019-01-10 15:26       ` Andreas Schwab
2019-01-10 15:26         ` Andreas Schwab
2019-01-10 16:17         ` Anup Patel
2019-01-10 16:17           ` Anup Patel
2019-01-10 17:11           ` Andreas Schwab [this message]
2019-01-10 17:11             ` [PATCH] tty/serial: use uart_console_write in the RISC-V SBL early console Andreas Schwab
2019-01-11 11:13             ` Anup Patel
2019-01-11 11:13               ` Anup Patel
2019-01-23 23:58               ` Palmer Dabbelt
2019-01-23 23:58                 ` Palmer Dabbelt
2019-01-15 13:59             ` Christoph Hellwig
2019-01-15 13:59               ` Christoph Hellwig
2019-01-10 20:54           ` [PATCH] tty/serial: emit CR before NL in RISC-V SBL console Palmer Dabbelt
2019-01-10 20:54             ` Palmer Dabbelt
2018-12-04 13:55 ` [PATCH 2/3] RISC-V: defconfig: Enable RISC-V SBI earlycon support Anup Patel
2018-12-04 13:55   ` Anup Patel
2018-12-07 18:30   ` Palmer Dabbelt
2018-12-07 18:30     ` Palmer Dabbelt
2018-12-04 13:55 ` [PATCH 3/3] RISC-V: Remove EARLY_PRINTK support Anup Patel
2018-12-04 13:55   ` Anup Patel
2018-12-07 18:30   ` Palmer Dabbelt
2018-12-07 18:30     ` Palmer Dabbelt
2018-12-07 18:30 ` [PATCH 0/3] RISC-V SBI earlycon Palmer Dabbelt
2018-12-07 18:30   ` Palmer Dabbelt
2019-03-25 16:23 ` Andreas Schwab
2019-03-25 16:23   ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mvmsgy0cu9g.fsf_-_@suse.de \
    --to=schwab@suse.de \
    --cc=anup@brainfault.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=atish.patra@wdc.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@infradead.org \
    --cc=jslaby@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=palmer@sifive.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.