Linux-RISC-V Archive on lore.kernel.org
 help / Atom feed
* [PATCH 0/3] RISC-V SBI earlycon
@ 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
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Anup Patel @ 2018-12-04 13:55 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Palmer Dabbelt, Albert Ou
  Cc: Rob Herring, Anup Patel, linux-kernel, Christoph Hellwig,
	Atish Patra, linux-serial, linux-riscv

This patchset adds RISC-V SBI earlycon and removes RISC-V EARLY_PRINTK.

We should use earlycon over existing EARLY_PRINTK for SBI console because:
1. It's a more generic way of implementing early console for debugging
2. Current RISC-V EARLY_PRINTK is a compile-time option whereas earlycon
   is enabled at run-time via kernel parameters.
3. To use earlycon with SBI, we have to pass "earlycon=sbi" in kernel
   parameters. If earlycon kernel parameter is not provided then kernel
   boots much faster which is very useful in real-world RISC-V deployments.

The patchset is tested on QEMU virt machine. It is based on Linux-4.20-rc5
and can be found at riscv_earlycon_v1 branch of:
https://github.com/avpatel/linux.git

Anup Patel (3):
  tty/serial: Add RISC-V SBI earlycon support
  RISC-V: defconfig: Enable RISC-V SBI earlycon support
  RISC-V: Remove EARLY_PRINTK support

 arch/riscv/Kconfig.debug                |  2 --
 arch/riscv/configs/defconfig            |  1 +
 arch/riscv/kernel/setup.c               | 28 -------------------------
 drivers/tty/serial/Kconfig              | 12 +++++++++++
 drivers/tty/serial/Makefile             |  1 +
 drivers/tty/serial/earlycon-riscv-sbi.c | 28 +++++++++++++++++++++++++
 6 files changed, 42 insertions(+), 30 deletions(-)
 create mode 100644 drivers/tty/serial/earlycon-riscv-sbi.c

-- 
2.17.1


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/3] tty/serial: Add RISC-V SBI earlycon support
  2018-12-04 13:55 [PATCH 0/3] RISC-V SBI earlycon Anup Patel
@ 2018-12-04 13:55 ` Anup Patel
  2018-12-05  9:58   ` Greg Kroah-Hartman
  2018-12-07 18:30   ` Palmer Dabbelt
  2018-12-04 13:55 ` [PATCH 2/3] RISC-V: defconfig: Enable " Anup Patel
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 10+ messages in thread
From: Anup Patel @ 2018-12-04 13:55 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Palmer Dabbelt, Albert Ou
  Cc: Rob Herring, Anup Patel, linux-kernel, Christoph Hellwig,
	Atish Patra, linux-serial, linux-riscv

In RISC-V, the M-mode runtime firmware provide SBI calls for
debug prints. This patch adds earlycon support using RISC-V
SBI console calls. To enable it, just pass "earlycon=sbi" in
kernel parameters.

Signed-off-by: Anup Patel <anup@brainfault.org>
---
 drivers/tty/serial/Kconfig              | 12 +++++++++++
 drivers/tty/serial/Makefile             |  1 +
 drivers/tty/serial/earlycon-riscv-sbi.c | 28 +++++++++++++++++++++++++
 3 files changed, 41 insertions(+)
 create mode 100644 drivers/tty/serial/earlycon-riscv-sbi.c

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 32886c304641..287bb41ac814 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -85,6 +85,18 @@ config SERIAL_EARLYCON_ARM_SEMIHOST
 	  with "earlycon=smh" on the kernel command line. The console is
 	  enabled when early_param is processed.
 
+config SERIAL_EARLYCON_RISCV_SBI
+	bool "Early console using RISC-V SBI"
+	depends on RISCV
+	select SERIAL_CORE
+	select SERIAL_CORE_CONSOLE
+	select SERIAL_EARLYCON
+	help
+	  Support for early debug console using RISC-V SBI. This enables
+	  the console before standard serial driver is probed. This is enabled
+	  with "earlycon=sbi" on the kernel command line. The console is
+	  enabled when early_param is processed.
+
 config SERIAL_SB1250_DUART
 	tristate "BCM1xxx on-chip DUART serial support"
 	depends on SIBYTE_SB1xxx_SOC=y
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index daac675612df..3ce26ce08616 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -7,6 +7,7 @@ obj-$(CONFIG_SERIAL_CORE) += serial_core.o
 
 obj-$(CONFIG_SERIAL_EARLYCON) += earlycon.o
 obj-$(CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST) += earlycon-arm-semihost.o
+obj-$(CONFIG_SERIAL_EARLYCON_RISCV_SBI) += earlycon-riscv-sbi.o
 
 # These Sparc drivers have to appear before others such as 8250
 # which share ttySx minor node space.  Otherwise console device
diff --git a/drivers/tty/serial/earlycon-riscv-sbi.c b/drivers/tty/serial/earlycon-riscv-sbi.c
new file mode 100644
index 000000000000..e1a551aae336
--- /dev/null
+++ b/drivers/tty/serial/earlycon-riscv-sbi.c
@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * RISC-V SBI based earlycon
+ *
+ * Copyright (C) 2018 Anup Patel <anup@brainfault.org>
+ */
+#include <linux/kernel.h>
+#include <linux/console.h>
+#include <linux/init.h>
+#include <linux/serial_core.h>
+#include <asm/sbi.h>
+
+static void sbi_console_write(struct console *con,
+			      const char *s, unsigned int n)
+{
+	int i;
+
+	for (i = 0; i < n; ++i)
+		sbi_console_putchar(s[i]);
+}
+
+static int __init early_sbi_setup(struct earlycon_device *device,
+				  const char *opt)
+{
+	device->con->write = sbi_console_write;
+	return 0;
+}
+EARLYCON_DECLARE(sbi, early_sbi_setup);
-- 
2.17.1


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/3] RISC-V: defconfig: Enable RISC-V SBI earlycon support
  2018-12-04 13:55 [PATCH 0/3] RISC-V SBI earlycon 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-07 18:30   ` Palmer Dabbelt
  2018-12-04 13:55 ` [PATCH 3/3] RISC-V: Remove EARLY_PRINTK support Anup Patel
  2018-12-07 18:30 ` [PATCH 0/3] RISC-V SBI earlycon Palmer Dabbelt
  3 siblings, 1 reply; 10+ messages in thread
From: Anup Patel @ 2018-12-04 13:55 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Palmer Dabbelt, Albert Ou
  Cc: Rob Herring, Anup Patel, linux-kernel, Christoph Hellwig,
	Atish Patra, linux-serial, linux-riscv

This patch enables RISC-V SBI earlycon support in default defconfig
so that we can use "earlycon=sbi" in kernel parameters for early
debug prints.

Signed-off-by: Anup Patel <anup@brainfault.org>
---
 arch/riscv/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
index ef4f15df9adf..f399659d3b8d 100644
--- a/arch/riscv/configs/defconfig
+++ b/arch/riscv/configs/defconfig
@@ -46,6 +46,7 @@ CONFIG_INPUT_MOUSEDEV=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_SERIAL_EARLYCON_RISCV_SBI=y
 CONFIG_HVC_RISCV_SBI=y
 # CONFIG_PTP_1588_CLOCK is not set
 CONFIG_DRM=y
-- 
2.17.1


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 3/3] RISC-V: Remove EARLY_PRINTK support
  2018-12-04 13:55 [PATCH 0/3] RISC-V SBI earlycon 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 ` [PATCH 2/3] RISC-V: defconfig: Enable " Anup Patel
@ 2018-12-04 13:55 ` Anup Patel
  2018-12-07 18:30   ` Palmer Dabbelt
  2018-12-07 18:30 ` [PATCH 0/3] RISC-V SBI earlycon Palmer Dabbelt
  3 siblings, 1 reply; 10+ messages in thread
From: Anup Patel @ 2018-12-04 13:55 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Palmer Dabbelt, Albert Ou
  Cc: Rob Herring, Anup Patel, linux-kernel, Christoph Hellwig,
	Atish Patra, linux-serial, linux-riscv

The EARLY_PRINTK using SBI console calls is not required
any more because we now have RISC-V SBI support in generic
earlycon framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
---
 arch/riscv/Kconfig.debug  |  2 --
 arch/riscv/kernel/setup.c | 28 ----------------------------
 2 files changed, 30 deletions(-)

diff --git a/arch/riscv/Kconfig.debug b/arch/riscv/Kconfig.debug
index c5a72f17c469..e69de29bb2d1 100644
--- a/arch/riscv/Kconfig.debug
+++ b/arch/riscv/Kconfig.debug
@@ -1,2 +0,0 @@
-config EARLY_PRINTK
-	def_bool y
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index 2c290e6aaa6e..fc8006a042eb 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -35,31 +35,9 @@
 #include <asm/sections.h>
 #include <asm/pgtable.h>
 #include <asm/smp.h>
-#include <asm/sbi.h>
 #include <asm/tlbflush.h>
 #include <asm/thread_info.h>
 
-#ifdef CONFIG_EARLY_PRINTK
-static void sbi_console_write(struct console *co, const char *buf,
-			      unsigned int n)
-{
-	int i;
-
-	for (i = 0; i < n; ++i) {
-		if (buf[i] == '\n')
-			sbi_console_putchar('\r');
-		sbi_console_putchar(buf[i]);
-	}
-}
-
-struct console riscv_sbi_early_console_dev __initdata = {
-	.name	= "early",
-	.write	= sbi_console_write,
-	.flags	= CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME,
-	.index	= -1
-};
-#endif
-
 #ifdef CONFIG_DUMMY_CONSOLE
 struct screen_info screen_info = {
 	.orig_video_lines	= 30,
@@ -219,12 +197,6 @@ static void __init setup_bootmem(void)
 
 void __init setup_arch(char **cmdline_p)
 {
-#if defined(CONFIG_EARLY_PRINTK)
-       if (likely(early_console == NULL)) {
-               early_console = &riscv_sbi_early_console_dev;
-               register_console(early_console);
-       }
-#endif
 	*cmdline_p = boot_command_line;
 
 	parse_early_param();
-- 
2.17.1


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] tty/serial: Add RISC-V SBI earlycon support
  2018-12-04 13:55 ` [PATCH 1/3] tty/serial: Add RISC-V SBI earlycon support Anup Patel
@ 2018-12-05  9:58   ` Greg Kroah-Hartman
  2018-12-07 18:45     ` Palmer Dabbelt
  2018-12-07 18:30   ` Palmer Dabbelt
  1 sibling, 1 reply; 10+ messages in thread
From: Greg Kroah-Hartman @ 2018-12-05  9:58 UTC (permalink / raw)
  To: Anup Patel
  Cc: Rob Herring, Albert Ou, Palmer Dabbelt, linux-kernel,
	Christoph Hellwig, Atish Patra, linux-serial, Jiri Slaby,
	linux-riscv

On Tue, Dec 04, 2018 at 07:25:05PM +0530, Anup Patel wrote:
> In RISC-V, the M-mode runtime firmware provide SBI calls for
> debug prints. This patch adds earlycon support using RISC-V
> SBI console calls. To enable it, just pass "earlycon=sbi" in
> kernel parameters.
> 
> Signed-off-by: Anup Patel <anup@brainfault.org>

This makes more sense to take through the riscv tree, so feel free to
add:

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

to it and take it that way.

thanks,

greg k-h

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] tty/serial: Add RISC-V SBI earlycon support
  2018-12-04 13:55 ` [PATCH 1/3] tty/serial: Add RISC-V SBI earlycon support Anup Patel
  2018-12-05  9:58   ` Greg Kroah-Hartman
@ 2018-12-07 18:30   ` Palmer Dabbelt
  1 sibling, 0 replies; 10+ messages in thread
From: Palmer Dabbelt @ 2018-12-07 18:30 UTC (permalink / raw)
  To: anup
  Cc: robh, aou, Greg KH, anup, linux-kernel, Christoph Hellwig,
	atish.patra, linux-serial, jslaby, linux-riscv

On Tue, 04 Dec 2018 05:55:05 PST (-0800), anup@brainfault.org wrote:
> In RISC-V, the M-mode runtime firmware provide SBI calls for
> debug prints. This patch adds earlycon support using RISC-V
> SBI console calls. To enable it, just pass "earlycon=sbi" in
> kernel parameters.
>
> Signed-off-by: Anup Patel <anup@brainfault.org>
> ---
>  drivers/tty/serial/Kconfig              | 12 +++++++++++
>  drivers/tty/serial/Makefile             |  1 +
>  drivers/tty/serial/earlycon-riscv-sbi.c | 28 +++++++++++++++++++++++++
>  3 files changed, 41 insertions(+)
>  create mode 100644 drivers/tty/serial/earlycon-riscv-sbi.c
>
> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> index 32886c304641..287bb41ac814 100644
> --- a/drivers/tty/serial/Kconfig
> +++ b/drivers/tty/serial/Kconfig
> @@ -85,6 +85,18 @@ config SERIAL_EARLYCON_ARM_SEMIHOST
>  	  with "earlycon=smh" on the kernel command line. The console is
>  	  enabled when early_param is processed.
>
> +config SERIAL_EARLYCON_RISCV_SBI
> +	bool "Early console using RISC-V SBI"
> +	depends on RISCV
> +	select SERIAL_CORE
> +	select SERIAL_CORE_CONSOLE
> +	select SERIAL_EARLYCON
> +	help
> +	  Support for early debug console using RISC-V SBI. This enables
> +	  the console before standard serial driver is probed. This is enabled
> +	  with "earlycon=sbi" on the kernel command line. The console is
> +	  enabled when early_param is processed.
> +
>  config SERIAL_SB1250_DUART
>  	tristate "BCM1xxx on-chip DUART serial support"
>  	depends on SIBYTE_SB1xxx_SOC=y
> diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
> index daac675612df..3ce26ce08616 100644
> --- a/drivers/tty/serial/Makefile
> +++ b/drivers/tty/serial/Makefile
> @@ -7,6 +7,7 @@ obj-$(CONFIG_SERIAL_CORE) += serial_core.o
>
>  obj-$(CONFIG_SERIAL_EARLYCON) += earlycon.o
>  obj-$(CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST) += earlycon-arm-semihost.o
> +obj-$(CONFIG_SERIAL_EARLYCON_RISCV_SBI) += earlycon-riscv-sbi.o
>
>  # These Sparc drivers have to appear before others such as 8250
>  # which share ttySx minor node space.  Otherwise console device
> diff --git a/drivers/tty/serial/earlycon-riscv-sbi.c b/drivers/tty/serial/earlycon-riscv-sbi.c
> new file mode 100644
> index 000000000000..e1a551aae336
> --- /dev/null
> +++ b/drivers/tty/serial/earlycon-riscv-sbi.c
> @@ -0,0 +1,28 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * RISC-V SBI based earlycon
> + *
> + * Copyright (C) 2018 Anup Patel <anup@brainfault.org>
> + */
> +#include <linux/kernel.h>
> +#include <linux/console.h>
> +#include <linux/init.h>
> +#include <linux/serial_core.h>
> +#include <asm/sbi.h>
> +
> +static void sbi_console_write(struct console *con,
> +			      const char *s, unsigned int n)
> +{
> +	int i;
> +
> +	for (i = 0; i < n; ++i)
> +		sbi_console_putchar(s[i]);
> +}
> +
> +static int __init early_sbi_setup(struct earlycon_device *device,
> +				  const char *opt)
> +{
> +	device->con->write = sbi_console_write;
> +	return 0;
> +}
> +EARLYCON_DECLARE(sbi, early_sbi_setup);

Reviewed-by: Palmer Dabbelt <palmer@sifive.com>

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/3] RISC-V: defconfig: Enable RISC-V SBI earlycon support
  2018-12-04 13:55 ` [PATCH 2/3] RISC-V: defconfig: Enable " Anup Patel
@ 2018-12-07 18:30   ` Palmer Dabbelt
  0 siblings, 0 replies; 10+ messages in thread
From: Palmer Dabbelt @ 2018-12-07 18:30 UTC (permalink / raw)
  To: anup
  Cc: robh, aou, Greg KH, anup, linux-kernel, Christoph Hellwig,
	atish.patra, linux-serial, jslaby, linux-riscv

On Tue, 04 Dec 2018 05:55:06 PST (-0800), anup@brainfault.org wrote:
> This patch enables RISC-V SBI earlycon support in default defconfig
> so that we can use "earlycon=sbi" in kernel parameters for early
> debug prints.
>
> Signed-off-by: Anup Patel <anup@brainfault.org>
> ---
>  arch/riscv/configs/defconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
> index ef4f15df9adf..f399659d3b8d 100644
> --- a/arch/riscv/configs/defconfig
> +++ b/arch/riscv/configs/defconfig
> @@ -46,6 +46,7 @@ CONFIG_INPUT_MOUSEDEV=y
>  CONFIG_SERIAL_8250=y
>  CONFIG_SERIAL_8250_CONSOLE=y
>  CONFIG_SERIAL_OF_PLATFORM=y
> +CONFIG_SERIAL_EARLYCON_RISCV_SBI=y
>  CONFIG_HVC_RISCV_SBI=y
>  # CONFIG_PTP_1588_CLOCK is not set
>  CONFIG_DRM=y

Reviewed-by: Palmer Dabbelt <palmer@sifive.com>

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/3] RISC-V: Remove EARLY_PRINTK support
  2018-12-04 13:55 ` [PATCH 3/3] RISC-V: Remove EARLY_PRINTK support Anup Patel
@ 2018-12-07 18:30   ` Palmer Dabbelt
  0 siblings, 0 replies; 10+ messages in thread
From: Palmer Dabbelt @ 2018-12-07 18:30 UTC (permalink / raw)
  To: anup
  Cc: robh, aou, Greg KH, anup, linux-kernel, Christoph Hellwig,
	atish.patra, linux-serial, jslaby, linux-riscv

On Tue, 04 Dec 2018 05:55:07 PST (-0800), anup@brainfault.org wrote:
> The EARLY_PRINTK using SBI console calls is not required
> any more because we now have RISC-V SBI support in generic
> earlycon framework.
>
> Signed-off-by: Anup Patel <anup@brainfault.org>
> ---
>  arch/riscv/Kconfig.debug  |  2 --
>  arch/riscv/kernel/setup.c | 28 ----------------------------
>  2 files changed, 30 deletions(-)
>
> diff --git a/arch/riscv/Kconfig.debug b/arch/riscv/Kconfig.debug
> index c5a72f17c469..e69de29bb2d1 100644
> --- a/arch/riscv/Kconfig.debug
> +++ b/arch/riscv/Kconfig.debug
> @@ -1,2 +0,0 @@
> -config EARLY_PRINTK
> -	def_bool y
> diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
> index 2c290e6aaa6e..fc8006a042eb 100644
> --- a/arch/riscv/kernel/setup.c
> +++ b/arch/riscv/kernel/setup.c
> @@ -35,31 +35,9 @@
>  #include <asm/sections.h>
>  #include <asm/pgtable.h>
>  #include <asm/smp.h>
> -#include <asm/sbi.h>
>  #include <asm/tlbflush.h>
>  #include <asm/thread_info.h>
>
> -#ifdef CONFIG_EARLY_PRINTK
> -static void sbi_console_write(struct console *co, const char *buf,
> -			      unsigned int n)
> -{
> -	int i;
> -
> -	for (i = 0; i < n; ++i) {
> -		if (buf[i] == '\n')
> -			sbi_console_putchar('\r');
> -		sbi_console_putchar(buf[i]);
> -	}
> -}
> -
> -struct console riscv_sbi_early_console_dev __initdata = {
> -	.name	= "early",
> -	.write	= sbi_console_write,
> -	.flags	= CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME,
> -	.index	= -1
> -};
> -#endif
> -
>  #ifdef CONFIG_DUMMY_CONSOLE
>  struct screen_info screen_info = {
>  	.orig_video_lines	= 30,
> @@ -219,12 +197,6 @@ static void __init setup_bootmem(void)
>
>  void __init setup_arch(char **cmdline_p)
>  {
> -#if defined(CONFIG_EARLY_PRINTK)
> -       if (likely(early_console == NULL)) {
> -               early_console = &riscv_sbi_early_console_dev;
> -               register_console(early_console);
> -       }
> -#endif
>  	*cmdline_p = boot_command_line;
>
>  	parse_early_param();

Reviewed-by: Palmer Dabbelt <palmer@sifive.com>

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/3] RISC-V SBI earlycon
  2018-12-04 13:55 [PATCH 0/3] RISC-V SBI earlycon Anup Patel
                   ` (2 preceding siblings ...)
  2018-12-04 13:55 ` [PATCH 3/3] RISC-V: Remove EARLY_PRINTK support Anup Patel
@ 2018-12-07 18:30 ` Palmer Dabbelt
  3 siblings, 0 replies; 10+ messages in thread
From: Palmer Dabbelt @ 2018-12-07 18:30 UTC (permalink / raw)
  To: anup, Greg KH
  Cc: robh, aou, anup, linux-kernel, Christoph Hellwig, atish.patra,
	linux-serial, jslaby, linux-riscv

On Tue, 04 Dec 2018 05:55:04 PST (-0800), anup@brainfault.org wrote:
> This patchset adds RISC-V SBI earlycon and removes RISC-V EARLY_PRINTK.
>
> We should use earlycon over existing EARLY_PRINTK for SBI console because:
> 1. It's a more generic way of implementing early console for debugging
> 2. Current RISC-V EARLY_PRINTK is a compile-time option whereas earlycon
>    is enabled at run-time via kernel parameters.
> 3. To use earlycon with SBI, we have to pass "earlycon=sbi" in kernel
>    parameters. If earlycon kernel parameter is not provided then kernel
>    boots much faster which is very useful in real-world RISC-V deployments.
>
> The patchset is tested on QEMU virt machine. It is based on Linux-4.20-rc5
> and can be found at riscv_earlycon_v1 branch of:
> https://github.com/avpatel/linux.git
>
> Anup Patel (3):
>   tty/serial: Add RISC-V SBI earlycon support
>   RISC-V: defconfig: Enable RISC-V SBI earlycon support
>   RISC-V: Remove EARLY_PRINTK support
>
>  arch/riscv/Kconfig.debug                |  2 --
>  arch/riscv/configs/defconfig            |  1 +
>  arch/riscv/kernel/setup.c               | 28 -------------------------
>  drivers/tty/serial/Kconfig              | 12 +++++++++++
>  drivers/tty/serial/Makefile             |  1 +
>  drivers/tty/serial/earlycon-riscv-sbi.c | 28 +++++++++++++++++++++++++
>  6 files changed, 42 insertions(+), 30 deletions(-)
>  create mode 100644 drivers/tty/serial/earlycon-riscv-sbi.c

I'm adding these to my for-next.

Thanks!

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] tty/serial: Add RISC-V SBI earlycon support
  2018-12-05  9:58   ` Greg Kroah-Hartman
@ 2018-12-07 18:45     ` Palmer Dabbelt
  0 siblings, 0 replies; 10+ messages in thread
From: Palmer Dabbelt @ 2018-12-07 18:45 UTC (permalink / raw)
  To: Greg KH
  Cc: robh, aou, anup, linux-kernel, Christoph Hellwig, atish.patra,
	linux-serial, jslaby, linux-riscv

On Wed, 05 Dec 2018 01:58:46 PST (-0800), Greg KH wrote:
> On Tue, Dec 04, 2018 at 07:25:05PM +0530, Anup Patel wrote:
>> In RISC-V, the M-mode runtime firmware provide SBI calls for
>> debug prints. This patch adds earlycon support using RISC-V
>> SBI console calls. To enable it, just pass "earlycon=sbi" in
>> kernel parameters.
>>
>> Signed-off-by: Anup Patel <anup@brainfault.org>
>
> This makes more sense to take through the riscv tree, so feel free to
> add:
>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> to it and take it that way.

It should be in my for-next now.

Thanks!

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, back to index

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-04 13:55 [PATCH 0/3] RISC-V SBI earlycon Anup Patel
2018-12-04 13:55 ` [PATCH 1/3] tty/serial: Add RISC-V SBI earlycon support Anup Patel
2018-12-05  9:58   ` Greg Kroah-Hartman
2018-12-07 18:45     ` Palmer Dabbelt
2018-12-07 18:30   ` Palmer Dabbelt
2018-12-04 13:55 ` [PATCH 2/3] RISC-V: defconfig: Enable " Anup Patel
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-07 18:30   ` Palmer Dabbelt
2018-12-07 18:30 ` [PATCH 0/3] RISC-V SBI earlycon Palmer Dabbelt

Linux-RISC-V Archive on lore.kernel.org

Archives are clonable: git clone --mirror https://lore.kernel.org/linux-riscv/0 linux-riscv/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-riscv linux-riscv/ https://lore.kernel.org/linux-riscv \
		linux-riscv@lists.infradead.org infradead-linux-riscv@archiver.kernel.org
	public-inbox-index linux-riscv


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-riscv


AGPL code for this site: git clone https://public-inbox.org/ public-inbox