All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] Generic serial earlycon
@ 2014-03-21 21:08 ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-21 21:08 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-serial
  Cc: Greg Kroah-Hartman, Jiri Slaby, Catalin Marinas, Russell King,
	Will Deacon, x86, Arnd Bergmann, Rob Herring

From: Rob Herring <robh@kernel.org>

This started out as an attempt to add arm64's earlyprintk support to ARM
in order to get an earlier, runtime setup console on multi-platform
kernels. The first issue was needing the fixmap support which
conveniently Mark Salter was working on and is mostly in place now. Like
many things on ARM and arm64 now, it then became where do I put the now
common, shared code. After digging more into various early console/printk
support, it turns out the 8250_early.c setup code was the best starting
point. 

This is based on Mark Salter's fixmap support currently in linux-next.
This is tested on arm64 and ARM with pl011 and 8250. The ARM support
also requires fixmap and fixed mapping support which are not yet in place.
I have some patches in my tree to support fixmap, but they need some more
work. Fortunately, once fixmap is in place, it is just a Kconfig option
to enable earlycon support on ARM. A git tree is available here[1].

Based on this series, I would like to add support for doing earlycon
setup using DT.

Rob

[1] git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git earlycon

Rob Herring (8):
  x86: move FIX_EARLYCON_MEM kconfig into x86
  arm64: add FIXMAP_PAGE_NOCACHE definition
  arm64: enable FIX_EARLYCON_MEM kconfig
  tty/serial: add generic serial earlycon
  tty/serial: convert 8250 to generic earlycon
  tty/serial: pl011: add generic earlycon support
  tty/serial: add arm64 semihosting earlycon
  arm64: remove arch specific earlyprintk

 Documentation/kernel-parameters.txt        |   6 +-
 arch/arm64/Kconfig                         |   3 +
 arch/arm64/Kconfig.debug                   |   9 --
 arch/arm64/include/asm/fixmap.h            |   3 +-
 arch/arm64/kernel/Makefile                 |   1 -
 arch/arm64/kernel/early_printk.c           | 158 -----------------------------
 arch/x86/Kconfig                           |   3 +
 drivers/tty/serial/8250/8250_early.c       | 138 +++----------------------
 drivers/tty/serial/8250/Kconfig            |   5 -
 drivers/tty/serial/Kconfig                 |  24 ++++-
 drivers/tty/serial/Makefile                |   3 +
 drivers/tty/serial/amba-pl011.c            |  30 +++++-
 drivers/tty/serial/earlycon-arm-semihost.c |  44 ++++++++
 drivers/tty/serial/earlycon.c              | 148 +++++++++++++++++++++++++++
 include/linux/serial_core.h                |  16 +++
 15 files changed, 287 insertions(+), 304 deletions(-)
 delete mode 100644 arch/arm64/kernel/early_printk.c
 create mode 100644 drivers/tty/serial/earlycon-arm-semihost.c
 create mode 100644 drivers/tty/serial/earlycon.c

-- 
1.8.3.2


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

* [PATCH 0/8] Generic serial earlycon
@ 2014-03-21 21:08 ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-21 21:08 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <robh@kernel.org>

This started out as an attempt to add arm64's earlyprintk support to ARM
in order to get an earlier, runtime setup console on multi-platform
kernels. The first issue was needing the fixmap support which
conveniently Mark Salter was working on and is mostly in place now. Like
many things on ARM and arm64 now, it then became where do I put the now
common, shared code. After digging more into various early console/printk
support, it turns out the 8250_early.c setup code was the best starting
point. 

This is based on Mark Salter's fixmap support currently in linux-next.
This is tested on arm64 and ARM with pl011 and 8250. The ARM support
also requires fixmap and fixed mapping support which are not yet in place.
I have some patches in my tree to support fixmap, but they need some more
work. Fortunately, once fixmap is in place, it is just a Kconfig option
to enable earlycon support on ARM. A git tree is available here[1].

Based on this series, I would like to add support for doing earlycon
setup using DT.

Rob

[1] git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git earlycon

Rob Herring (8):
  x86: move FIX_EARLYCON_MEM kconfig into x86
  arm64: add FIXMAP_PAGE_NOCACHE definition
  arm64: enable FIX_EARLYCON_MEM kconfig
  tty/serial: add generic serial earlycon
  tty/serial: convert 8250 to generic earlycon
  tty/serial: pl011: add generic earlycon support
  tty/serial: add arm64 semihosting earlycon
  arm64: remove arch specific earlyprintk

 Documentation/kernel-parameters.txt        |   6 +-
 arch/arm64/Kconfig                         |   3 +
 arch/arm64/Kconfig.debug                   |   9 --
 arch/arm64/include/asm/fixmap.h            |   3 +-
 arch/arm64/kernel/Makefile                 |   1 -
 arch/arm64/kernel/early_printk.c           | 158 -----------------------------
 arch/x86/Kconfig                           |   3 +
 drivers/tty/serial/8250/8250_early.c       | 138 +++----------------------
 drivers/tty/serial/8250/Kconfig            |   5 -
 drivers/tty/serial/Kconfig                 |  24 ++++-
 drivers/tty/serial/Makefile                |   3 +
 drivers/tty/serial/amba-pl011.c            |  30 +++++-
 drivers/tty/serial/earlycon-arm-semihost.c |  44 ++++++++
 drivers/tty/serial/earlycon.c              | 148 +++++++++++++++++++++++++++
 include/linux/serial_core.h                |  16 +++
 15 files changed, 287 insertions(+), 304 deletions(-)
 delete mode 100644 arch/arm64/kernel/early_printk.c
 create mode 100644 drivers/tty/serial/earlycon-arm-semihost.c
 create mode 100644 drivers/tty/serial/earlycon.c

-- 
1.8.3.2

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

* [PATCH 1/8] x86: move FIX_EARLYCON_MEM kconfig into x86
  2014-03-21 21:08 ` Rob Herring
  (?)
@ 2014-03-21 21:08   ` Rob Herring
  -1 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-21 21:08 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-serial
  Cc: Greg Kroah-Hartman, Jiri Slaby, Catalin Marinas, Russell King,
	Will Deacon, x86, Arnd Bergmann, Rob Herring, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin

From: Rob Herring <robh@kernel.org>

In preparation to support FIX_EARLYCON_MEM on other arches, make the
option per arch.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
---
 arch/x86/Kconfig                | 3 +++
 drivers/tty/serial/8250/Kconfig | 5 -----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 9c0a657..600046c 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -261,6 +261,9 @@ config ARCH_HWEIGHT_CFLAGS
 config ARCH_SUPPORTS_UPROBES
 	def_bool y
 
+config FIX_EARLYCON_MEM
+	def_bool y
+
 source "init/Kconfig"
 source "kernel/Kconfig.freezer"
 
diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
index 2332991..91f1d83 100644
--- a/drivers/tty/serial/8250/Kconfig
+++ b/drivers/tty/serial/8250/Kconfig
@@ -90,11 +90,6 @@ config SERIAL_8250_CONSOLE
 
 	  If unsure, say N.
 
-config FIX_EARLYCON_MEM
-	bool
-	depends on X86
-	default y
-
 config SERIAL_8250_GSC
 	tristate
 	depends on SERIAL_8250 && GSC
-- 
1.8.3.2


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

* [PATCH 1/8] x86: move FIX_EARLYCON_MEM kconfig into x86
@ 2014-03-21 21:08   ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-21 21:08 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-serial
  Cc: Rob Herring, Russell King, Arnd Bergmann, Greg Kroah-Hartman,
	x86, Will Deacon, Ingo Molnar, H. Peter Anvin, Catalin Marinas,
	Thomas Gleixner, Jiri Slaby

From: Rob Herring <robh@kernel.org>

In preparation to support FIX_EARLYCON_MEM on other arches, make the
option per arch.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
---
 arch/x86/Kconfig                | 3 +++
 drivers/tty/serial/8250/Kconfig | 5 -----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 9c0a657..600046c 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -261,6 +261,9 @@ config ARCH_HWEIGHT_CFLAGS
 config ARCH_SUPPORTS_UPROBES
 	def_bool y
 
+config FIX_EARLYCON_MEM
+	def_bool y
+
 source "init/Kconfig"
 source "kernel/Kconfig.freezer"
 
diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
index 2332991..91f1d83 100644
--- a/drivers/tty/serial/8250/Kconfig
+++ b/drivers/tty/serial/8250/Kconfig
@@ -90,11 +90,6 @@ config SERIAL_8250_CONSOLE
 
 	  If unsure, say N.
 
-config FIX_EARLYCON_MEM
-	bool
-	depends on X86
-	default y
-
 config SERIAL_8250_GSC
 	tristate
 	depends on SERIAL_8250 && GSC
-- 
1.8.3.2

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

* [PATCH 1/8] x86: move FIX_EARLYCON_MEM kconfig into x86
@ 2014-03-21 21:08   ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-21 21:08 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <robh@kernel.org>

In preparation to support FIX_EARLYCON_MEM on other arches, make the
option per arch.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86 at kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
---
 arch/x86/Kconfig                | 3 +++
 drivers/tty/serial/8250/Kconfig | 5 -----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 9c0a657..600046c 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -261,6 +261,9 @@ config ARCH_HWEIGHT_CFLAGS
 config ARCH_SUPPORTS_UPROBES
 	def_bool y
 
+config FIX_EARLYCON_MEM
+	def_bool y
+
 source "init/Kconfig"
 source "kernel/Kconfig.freezer"
 
diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
index 2332991..91f1d83 100644
--- a/drivers/tty/serial/8250/Kconfig
+++ b/drivers/tty/serial/8250/Kconfig
@@ -90,11 +90,6 @@ config SERIAL_8250_CONSOLE
 
 	  If unsure, say N.
 
-config FIX_EARLYCON_MEM
-	bool
-	depends on X86
-	default y
-
 config SERIAL_8250_GSC
 	tristate
 	depends on SERIAL_8250 && GSC
-- 
1.8.3.2

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

* [PATCH 2/8] arm64: add FIXMAP_PAGE_NOCACHE definition
  2014-03-21 21:08 ` Rob Herring
@ 2014-03-21 21:08   ` Rob Herring
  -1 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-21 21:08 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-serial
  Cc: Greg Kroah-Hartman, Jiri Slaby, Catalin Marinas, Russell King,
	Will Deacon, x86, Arnd Bergmann, Rob Herring

From: Rob Herring <robh@kernel.org>

Similar to ioremap and ioremap_nocache, we want the same definition for
both using PROT_DEVICE_nGnRE.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
---
 arch/arm64/include/asm/fixmap.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/fixmap.h b/arch/arm64/include/asm/fixmap.h
index 5f7bfe6..68eab3c 100644
--- a/arch/arm64/include/asm/fixmap.h
+++ b/arch/arm64/include/asm/fixmap.h
@@ -54,7 +54,8 @@ enum fixed_addresses {
 #define FIXADDR_SIZE	(__end_of_permanent_fixed_addresses << PAGE_SHIFT)
 #define FIXADDR_START	(FIXADDR_TOP - FIXADDR_SIZE)
 
-#define FIXMAP_PAGE_IO     __pgprot(PROT_DEVICE_nGnRE)
+#define FIXMAP_PAGE_IO		__pgprot(PROT_DEVICE_nGnRE)
+#define FIXMAP_PAGE_NOCACHE	__pgprot(PROT_DEVICE_nGnRE)
 
 extern void __early_set_fixmap(enum fixed_addresses idx,
 			       phys_addr_t phys, pgprot_t flags);
-- 
1.8.3.2


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

* [PATCH 2/8] arm64: add FIXMAP_PAGE_NOCACHE definition
@ 2014-03-21 21:08   ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-21 21:08 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <robh@kernel.org>

Similar to ioremap and ioremap_nocache, we want the same definition for
both using PROT_DEVICE_nGnRE.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
---
 arch/arm64/include/asm/fixmap.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/fixmap.h b/arch/arm64/include/asm/fixmap.h
index 5f7bfe6..68eab3c 100644
--- a/arch/arm64/include/asm/fixmap.h
+++ b/arch/arm64/include/asm/fixmap.h
@@ -54,7 +54,8 @@ enum fixed_addresses {
 #define FIXADDR_SIZE	(__end_of_permanent_fixed_addresses << PAGE_SHIFT)
 #define FIXADDR_START	(FIXADDR_TOP - FIXADDR_SIZE)
 
-#define FIXMAP_PAGE_IO     __pgprot(PROT_DEVICE_nGnRE)
+#define FIXMAP_PAGE_IO		__pgprot(PROT_DEVICE_nGnRE)
+#define FIXMAP_PAGE_NOCACHE	__pgprot(PROT_DEVICE_nGnRE)
 
 extern void __early_set_fixmap(enum fixed_addresses idx,
 			       phys_addr_t phys, pgprot_t flags);
-- 
1.8.3.2

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

* [PATCH 3/8] arm64: enable FIX_EARLYCON_MEM kconfig
  2014-03-21 21:08 ` Rob Herring
@ 2014-03-21 21:08   ` Rob Herring
  -1 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-21 21:08 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-serial
  Cc: Greg Kroah-Hartman, Jiri Slaby, Catalin Marinas, Russell King,
	Will Deacon, x86, Arnd Bergmann, Rob Herring

From: Rob Herring <robh@kernel.org>

In order to support earlycon on arm64, we need to enable earlycon fixmap
support.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
---
 arch/arm64/Kconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index e2424f9..a839444 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -112,6 +112,9 @@ config IOMMU_HELPER
 config KERNEL_MODE_NEON
 	def_bool y
 
+config FIX_EARLYCON_MEM
+	def_bool y
+
 source "init/Kconfig"
 
 source "kernel/Kconfig.freezer"
-- 
1.8.3.2


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

* [PATCH 3/8] arm64: enable FIX_EARLYCON_MEM kconfig
@ 2014-03-21 21:08   ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-21 21:08 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <robh@kernel.org>

In order to support earlycon on arm64, we need to enable earlycon fixmap
support.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
---
 arch/arm64/Kconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index e2424f9..a839444 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -112,6 +112,9 @@ config IOMMU_HELPER
 config KERNEL_MODE_NEON
 	def_bool y
 
+config FIX_EARLYCON_MEM
+	def_bool y
+
 source "init/Kconfig"
 
 source "kernel/Kconfig.freezer"
-- 
1.8.3.2

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

* [PATCH 4/8] tty/serial: add generic serial earlycon
  2014-03-21 21:08 ` Rob Herring
@ 2014-03-21 21:08   ` Rob Herring
  -1 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-21 21:08 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-serial
  Cc: Greg Kroah-Hartman, Jiri Slaby, Catalin Marinas, Russell King,
	Will Deacon, x86, Arnd Bergmann, Rob Herring

From: Rob Herring <robh@kernel.org>

This introduces generic earlycon infrastructure for serial devices
based on the 8250 earlycon. This allows for supporting earlycon option
with other serial devices. The earlycon output is enabled at the time
early_params are processed.

Only architectures that have fixmap support or have functional ioremap
when early_params are processed are supported. This is the same
restriction that the 8250 driver had.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
---
 drivers/tty/serial/Kconfig    |   7 ++
 drivers/tty/serial/Makefile   |   2 +
 drivers/tty/serial/earlycon.c | 148 ++++++++++++++++++++++++++++++++++++++++++
 include/linux/serial_core.h   |  16 +++++
 4 files changed, 173 insertions(+)
 create mode 100644 drivers/tty/serial/earlycon.c

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 2e6d8dd..1685189 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -7,6 +7,13 @@ if TTY
 menu "Serial drivers"
 	depends on HAS_IOMEM
 
+config SERIAL_EARLYCON
+	bool "Early console for serial ports"
+	help
+	  Support for early consoles with the earlycon parameter. This enables
+	  the console before standard serial driver is probed. The console is
+	  enabled when early_param is processed.
+
 source "drivers/tty/serial/8250/Kconfig"
 
 comment "Non-8250 serial port support"
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index 3680854..8af1415 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -5,6 +5,8 @@
 obj-$(CONFIG_SERIAL_CORE) += serial_core.o
 obj-$(CONFIG_SERIAL_21285) += 21285.o
 
+obj-$(CONFIG_SERIAL_EARLYCON) += earlycon.o
+
 # These Sparc drivers have to appear before others such as 8250
 # which share ttySx minor node space.  Otherwise console device
 # names change and other unplesantries.
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
new file mode 100644
index 0000000..241757a
--- /dev/null
+++ b/drivers/tty/serial/earlycon.c
@@ -0,0 +1,148 @@
+/*
+ * Copyright (C) 2014 Linaro Ltd.
+ * Author: Rob Herring <robh@kernel.org>
+ *
+ * Based on 8250 earlycon:
+ * (c) Copyright 2004 Hewlett-Packard Development Company, L.P.
+ *	Bjorn Helgaas <bjorn.helgaas@hp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/console.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/serial_core.h>
+
+#include <asm/fixmap.h>
+#include <asm/serial.h>
+
+static struct console early_con = {
+	.name =		"earlycon",
+	.flags =	CON_PRINTBUFFER | CON_BOOT,
+	.index =	-1,
+};
+
+static struct earlycon_device early_console_dev = {
+	.con = &early_con,
+};
+
+static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
+{
+	void __iomem *base;
+#ifdef CONFIG_FIX_EARLYCON_MEM
+	set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK);
+	base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
+	base += paddr & ~PAGE_MASK;
+#else
+	base = ioremap_nocache(paddr, size);
+#endif
+	if (!base)
+		pr_err("%s: Couldn't map 0x%llx\n", __func__,
+		       (unsigned long long)paddr);
+
+	return base;
+}
+
+static int __init parse_options(struct earlycon_device *device,
+				char *options)
+{
+	struct uart_port *port = &device->port;
+	int mmio, mmio32, length, ret;
+	unsigned long addr;
+
+	if (!options)
+		return -ENODEV;
+
+	mmio = !strncmp(options, "mmio,", 5);
+	mmio32 = !strncmp(options, "mmio32,", 7);
+	if (mmio || mmio32) {
+		port->iotype = (mmio ? UPIO_MEM : UPIO_MEM32);
+		options += mmio ? 5 : 7;
+		ret = kstrtoul(options, 0, &addr);
+		if (ret)
+			return ret;
+		port->mapbase = addr;
+		if (mmio32)
+			port->regshift = 2;
+	} else if (!strncmp(options, "io,", 3)) {
+		port->iotype = UPIO_PORT;
+		options += 3;
+		ret = kstrtoul(options, 0, &addr);
+		if (ret)
+			return ret;
+		port->iobase = addr;
+		mmio = 0;
+	} else if (!strncmp(options, "0x", 2)) {
+		port->iotype = UPIO_MEM;
+		ret = kstrtoul(options, 0, &addr);
+		if (ret)
+			return ret;
+		port->mapbase = addr;
+	} else {
+		return -EINVAL;
+	}
+
+	if (port->mapbase)
+		port->membase = earlycon_map(port->mapbase, 64);
+
+	port->uartclk = BASE_BAUD * 16;
+
+	options = strchr(options, ',');
+	if (options) {
+		options++;
+		ret = kstrtouint(options, 0, &device->baud);
+		if (ret)
+			return ret;
+		length = min(strcspn(options, " ") + 1,
+			     (size_t)(sizeof(device->options)));
+		strlcpy(device->options, options, length);
+	}
+
+	if (mmio || mmio32)
+		pr_info("Early serial console at MMIO%s 0x%llx (options '%s')\n",
+			mmio32 ? "32" : "",
+			(unsigned long long)port->mapbase,
+			device->options);
+	else
+		pr_info("Early serial console at I/O port 0x%lx (options '%s')\n",
+			port->iobase,
+			device->options);
+
+	return 0;
+}
+
+int __init setup_earlycon(char *buf, const char *match,
+			  int (*setup)(struct earlycon_device *, const char *))
+{
+	int err;
+	size_t len;
+
+	if (!buf || !match || !setup)
+		return -EINVAL;
+
+	len = strlen(match);
+	if (strncmp(buf, match, len))
+		return 0;
+	if (buf[len] && (buf[len] != ','))
+		return 0;
+
+	buf += len + 1;
+
+	err = parse_options(&early_console_dev, buf);
+	/* On parsing error, pass the options buf to the setup function */
+	if (!err)
+		buf = NULL;
+
+	early_console_dev.con->data = &early_console_dev;
+	err = setup(&early_console_dev, buf);
+	if (err < 0)
+		return err;
+	if (!early_console_dev.con->write)
+		return -ENODEV;
+
+	register_console(early_console_dev.con);
+	return 0;
+}
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index f729be9..7a15b5b 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -285,6 +285,22 @@ static inline int uart_poll_timeout(struct uart_port *port)
 /*
  * Console helpers.
  */
+struct earlycon_device {
+	struct console *con;
+	struct uart_port port;
+	char options[16];		/* e.g., 115200n8 */
+	unsigned int baud;
+};
+int setup_earlycon(char *buf, const char *match,
+		   int (*setup)(struct earlycon_device *, const char *));
+
+#define EARLYCON_DECLARE(name, func) \
+static int __init name ## _setup_earlycon(char *buf) \
+{ \
+	return setup_earlycon(buf, __stringify(name), func); \
+} \
+early_param("earlycon", name ## _setup_earlycon);
+
 struct uart_port *uart_get_console(struct uart_port *ports, int nr,
 				   struct console *c);
 void uart_parse_options(char *options, int *baud, int *parity, int *bits,
-- 
1.8.3.2


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

* [PATCH 4/8] tty/serial: add generic serial earlycon
@ 2014-03-21 21:08   ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-21 21:08 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <robh@kernel.org>

This introduces generic earlycon infrastructure for serial devices
based on the 8250 earlycon. This allows for supporting earlycon option
with other serial devices. The earlycon output is enabled at the time
early_params are processed.

Only architectures that have fixmap support or have functional ioremap
when early_params are processed are supported. This is the same
restriction that the 8250 driver had.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
---
 drivers/tty/serial/Kconfig    |   7 ++
 drivers/tty/serial/Makefile   |   2 +
 drivers/tty/serial/earlycon.c | 148 ++++++++++++++++++++++++++++++++++++++++++
 include/linux/serial_core.h   |  16 +++++
 4 files changed, 173 insertions(+)
 create mode 100644 drivers/tty/serial/earlycon.c

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 2e6d8dd..1685189 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -7,6 +7,13 @@ if TTY
 menu "Serial drivers"
 	depends on HAS_IOMEM
 
+config SERIAL_EARLYCON
+	bool "Early console for serial ports"
+	help
+	  Support for early consoles with the earlycon parameter. This enables
+	  the console before standard serial driver is probed. The console is
+	  enabled when early_param is processed.
+
 source "drivers/tty/serial/8250/Kconfig"
 
 comment "Non-8250 serial port support"
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index 3680854..8af1415 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -5,6 +5,8 @@
 obj-$(CONFIG_SERIAL_CORE) += serial_core.o
 obj-$(CONFIG_SERIAL_21285) += 21285.o
 
+obj-$(CONFIG_SERIAL_EARLYCON) += earlycon.o
+
 # These Sparc drivers have to appear before others such as 8250
 # which share ttySx minor node space.  Otherwise console device
 # names change and other unplesantries.
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
new file mode 100644
index 0000000..241757a
--- /dev/null
+++ b/drivers/tty/serial/earlycon.c
@@ -0,0 +1,148 @@
+/*
+ * Copyright (C) 2014 Linaro Ltd.
+ * Author: Rob Herring <robh@kernel.org>
+ *
+ * Based on 8250 earlycon:
+ * (c) Copyright 2004 Hewlett-Packard Development Company, L.P.
+ *	Bjorn Helgaas <bjorn.helgaas@hp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/console.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/serial_core.h>
+
+#include <asm/fixmap.h>
+#include <asm/serial.h>
+
+static struct console early_con = {
+	.name =		"earlycon",
+	.flags =	CON_PRINTBUFFER | CON_BOOT,
+	.index =	-1,
+};
+
+static struct earlycon_device early_console_dev = {
+	.con = &early_con,
+};
+
+static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
+{
+	void __iomem *base;
+#ifdef CONFIG_FIX_EARLYCON_MEM
+	set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK);
+	base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
+	base += paddr & ~PAGE_MASK;
+#else
+	base = ioremap_nocache(paddr, size);
+#endif
+	if (!base)
+		pr_err("%s: Couldn't map 0x%llx\n", __func__,
+		       (unsigned long long)paddr);
+
+	return base;
+}
+
+static int __init parse_options(struct earlycon_device *device,
+				char *options)
+{
+	struct uart_port *port = &device->port;
+	int mmio, mmio32, length, ret;
+	unsigned long addr;
+
+	if (!options)
+		return -ENODEV;
+
+	mmio = !strncmp(options, "mmio,", 5);
+	mmio32 = !strncmp(options, "mmio32,", 7);
+	if (mmio || mmio32) {
+		port->iotype = (mmio ? UPIO_MEM : UPIO_MEM32);
+		options += mmio ? 5 : 7;
+		ret = kstrtoul(options, 0, &addr);
+		if (ret)
+			return ret;
+		port->mapbase = addr;
+		if (mmio32)
+			port->regshift = 2;
+	} else if (!strncmp(options, "io,", 3)) {
+		port->iotype = UPIO_PORT;
+		options += 3;
+		ret = kstrtoul(options, 0, &addr);
+		if (ret)
+			return ret;
+		port->iobase = addr;
+		mmio = 0;
+	} else if (!strncmp(options, "0x", 2)) {
+		port->iotype = UPIO_MEM;
+		ret = kstrtoul(options, 0, &addr);
+		if (ret)
+			return ret;
+		port->mapbase = addr;
+	} else {
+		return -EINVAL;
+	}
+
+	if (port->mapbase)
+		port->membase = earlycon_map(port->mapbase, 64);
+
+	port->uartclk = BASE_BAUD * 16;
+
+	options = strchr(options, ',');
+	if (options) {
+		options++;
+		ret = kstrtouint(options, 0, &device->baud);
+		if (ret)
+			return ret;
+		length = min(strcspn(options, " ") + 1,
+			     (size_t)(sizeof(device->options)));
+		strlcpy(device->options, options, length);
+	}
+
+	if (mmio || mmio32)
+		pr_info("Early serial console at MMIO%s 0x%llx (options '%s')\n",
+			mmio32 ? "32" : "",
+			(unsigned long long)port->mapbase,
+			device->options);
+	else
+		pr_info("Early serial console at I/O port 0x%lx (options '%s')\n",
+			port->iobase,
+			device->options);
+
+	return 0;
+}
+
+int __init setup_earlycon(char *buf, const char *match,
+			  int (*setup)(struct earlycon_device *, const char *))
+{
+	int err;
+	size_t len;
+
+	if (!buf || !match || !setup)
+		return -EINVAL;
+
+	len = strlen(match);
+	if (strncmp(buf, match, len))
+		return 0;
+	if (buf[len] && (buf[len] != ','))
+		return 0;
+
+	buf += len + 1;
+
+	err = parse_options(&early_console_dev, buf);
+	/* On parsing error, pass the options buf to the setup function */
+	if (!err)
+		buf = NULL;
+
+	early_console_dev.con->data = &early_console_dev;
+	err = setup(&early_console_dev, buf);
+	if (err < 0)
+		return err;
+	if (!early_console_dev.con->write)
+		return -ENODEV;
+
+	register_console(early_console_dev.con);
+	return 0;
+}
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index f729be9..7a15b5b 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -285,6 +285,22 @@ static inline int uart_poll_timeout(struct uart_port *port)
 /*
  * Console helpers.
  */
+struct earlycon_device {
+	struct console *con;
+	struct uart_port port;
+	char options[16];		/* e.g., 115200n8 */
+	unsigned int baud;
+};
+int setup_earlycon(char *buf, const char *match,
+		   int (*setup)(struct earlycon_device *, const char *));
+
+#define EARLYCON_DECLARE(name, func) \
+static int __init name ## _setup_earlycon(char *buf) \
+{ \
+	return setup_earlycon(buf, __stringify(name), func); \
+} \
+early_param("earlycon", name ## _setup_earlycon);
+
 struct uart_port *uart_get_console(struct uart_port *ports, int nr,
 				   struct console *c);
 void uart_parse_options(char *options, int *baud, int *parity, int *bits,
-- 
1.8.3.2

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

* [PATCH 5/8] tty/serial: convert 8250 to generic earlycon
  2014-03-21 21:08 ` Rob Herring
@ 2014-03-21 21:08   ` Rob Herring
  -1 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-21 21:08 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-serial
  Cc: Greg Kroah-Hartman, Jiri Slaby, Catalin Marinas, Russell King,
	Will Deacon, x86, Arnd Bergmann, Rob Herring

From: Rob Herring <robh@kernel.org>

With the generic earlycon infrastructure in place, convert the 8250
early console to use it.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
---
 drivers/tty/serial/8250/8250_early.c | 138 ++++-------------------------------
 1 file changed, 15 insertions(+), 123 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_early.c b/drivers/tty/serial/8250/8250_early.c
index c100d63..e83c9db 100644
--- a/drivers/tty/serial/8250/8250_early.c
+++ b/drivers/tty/serial/8250/8250_early.c
@@ -35,18 +35,8 @@
 #include <linux/serial_8250.h>
 #include <asm/io.h>
 #include <asm/serial.h>
-#ifdef CONFIG_FIX_EARLYCON_MEM
-#include <asm/pgtable.h>
-#include <asm/fixmap.h>
-#endif
 
-struct early_serial8250_device {
-	struct uart_port port;
-	char options[16];		/* e.g., 115200n8 */
-	unsigned int baud;
-};
-
-static struct early_serial8250_device early_device;
+static struct earlycon_device *early_device;
 
 unsigned int __weak __init serial8250_early_in(struct uart_port *port, int offset)
 {
@@ -100,7 +90,7 @@ static void __init serial_putc(struct uart_port *port, int c)
 static void __init early_serial8250_write(struct console *console,
 					const char *s, unsigned int count)
 {
-	struct uart_port *port = &early_device.port;
+	struct uart_port *port = &early_device->port;
 	unsigned int ier;
 
 	/* Save the IER and disable interrupts */
@@ -129,7 +119,7 @@ static unsigned int __init probe_baud(struct uart_port *port)
 	return (port->uartclk / 16) / quot;
 }
 
-static void __init init_port(struct early_serial8250_device *device)
+static void __init init_port(struct earlycon_device *device)
 {
 	struct uart_port *port = &device->port;
 	unsigned int divisor;
@@ -148,128 +138,32 @@ static void __init init_port(struct early_serial8250_device *device)
 	serial8250_early_out(port, UART_LCR, c & ~UART_LCR_DLAB);
 }
 
-static int __init parse_options(struct early_serial8250_device *device,
-								char *options)
-{
-	struct uart_port *port = &device->port;
-	int mmio, mmio32, length;
-
-	if (!options)
-		return -ENODEV;
-
-	port->uartclk = BASE_BAUD * 16;
-
-	mmio = !strncmp(options, "mmio,", 5);
-	mmio32 = !strncmp(options, "mmio32,", 7);
-	if (mmio || mmio32) {
-		port->iotype = (mmio ? UPIO_MEM : UPIO_MEM32);
-		port->mapbase = simple_strtoul(options + (mmio ? 5 : 7),
-					       &options, 0);
-		if (mmio32)
-			port->regshift = 2;
-#ifdef CONFIG_FIX_EARLYCON_MEM
-		set_fixmap_nocache(FIX_EARLYCON_MEM_BASE,
-					port->mapbase & PAGE_MASK);
-		port->membase =
-			(void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
-		port->membase += port->mapbase & ~PAGE_MASK;
-#else
-		port->membase = ioremap_nocache(port->mapbase, 64);
-		if (!port->membase) {
-			printk(KERN_ERR "%s: Couldn't ioremap 0x%llx\n",
-				__func__,
-			       (unsigned long long) port->mapbase);
-			return -ENOMEM;
-		}
-#endif
-	} else if (!strncmp(options, "io,", 3)) {
-		port->iotype = UPIO_PORT;
-		port->iobase = simple_strtoul(options + 3, &options, 0);
-		mmio = 0;
-	} else
-		return -EINVAL;
-
-	options = strchr(options, ',');
-	if (options) {
-		options++;
-		device->baud = simple_strtoul(options, NULL, 0);
-		length = min(strcspn(options, " ") + 1,
-			     (size_t)(sizeof(device->options)));
-		strlcpy(device->options, options, length);
-	} else {
-		device->baud = probe_baud(port);
-		snprintf(device->options, sizeof(device->options), "%u",
-			device->baud);
-	}
-
-	if (mmio || mmio32)
-		printk(KERN_INFO
-		       "Early serial console at MMIO%s 0x%llx (options '%s')\n",
-			mmio32 ? "32" : "",
-			(unsigned long long)port->mapbase,
-			device->options);
-	else
-		printk(KERN_INFO
-		      "Early serial console at I/O port 0x%lx (options '%s')\n",
-			port->iobase,
-			device->options);
-
-	return 0;
-}
-
-static struct console early_serial8250_console __initdata = {
-	.name	= "uart",
-	.write	= early_serial8250_write,
-	.flags	= CON_PRINTBUFFER | CON_BOOT,
-	.index	= -1,
-};
-
-static int __init early_serial8250_setup(char *options)
+static int __init early_serial8250_setup(struct earlycon_device *device,
+					 const char *options)
 {
-	struct early_serial8250_device *device = &early_device;
-	int err;
-
-	if (device->port.membase || device->port.iobase)
+	if (!(device->port.membase || device->port.iobase))
 		return 0;
 
-	err = parse_options(device, options);
-	if (err < 0)
-		return err;
+	if (!device->baud)
+		device->baud = probe_baud(&device->port);
 
 	init_port(device);
-	return 0;
-}
-
-int __init setup_early_serial8250_console(char *cmdline)
-{
-	char *options;
-	int err;
-
-	options = strstr(cmdline, "uart8250,");
-	if (!options) {
-		options = strstr(cmdline, "uart,");
-		if (!options)
-			return 0;
-	}
-
-	options = strchr(cmdline, ',') + 1;
-	err = early_serial8250_setup(options);
-	if (err < 0)
-		return err;
-
-	register_console(&early_serial8250_console);
 
+	early_device = device;
+	device->con->write = early_serial8250_write;
 	return 0;
 }
+EARLYCON_DECLARE(uart8250, early_serial8250_setup);
+EARLYCON_DECLARE(uart, early_serial8250_setup);
 
 int serial8250_find_port_for_earlycon(void)
 {
-	struct early_serial8250_device *device = &early_device;
-	struct uart_port *port = &device->port;
+	struct earlycon_device *device = early_device;
+	struct uart_port *port = device ? &device->port : NULL;
 	int line;
 	int ret;
 
-	if (!device->port.membase && !device->port.iobase)
+	if (!port || (!port->membase && !port->iobase))
 		return -ENODEV;
 
 	line = serial8250_find_port(port);
@@ -284,5 +178,3 @@ int serial8250_find_port_for_earlycon(void)
 
 	return ret;
 }
-
-early_param("earlycon", setup_early_serial8250_console);
-- 
1.8.3.2


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

* [PATCH 5/8] tty/serial: convert 8250 to generic earlycon
@ 2014-03-21 21:08   ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-21 21:08 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <robh@kernel.org>

With the generic earlycon infrastructure in place, convert the 8250
early console to use it.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
---
 drivers/tty/serial/8250/8250_early.c | 138 ++++-------------------------------
 1 file changed, 15 insertions(+), 123 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_early.c b/drivers/tty/serial/8250/8250_early.c
index c100d63..e83c9db 100644
--- a/drivers/tty/serial/8250/8250_early.c
+++ b/drivers/tty/serial/8250/8250_early.c
@@ -35,18 +35,8 @@
 #include <linux/serial_8250.h>
 #include <asm/io.h>
 #include <asm/serial.h>
-#ifdef CONFIG_FIX_EARLYCON_MEM
-#include <asm/pgtable.h>
-#include <asm/fixmap.h>
-#endif
 
-struct early_serial8250_device {
-	struct uart_port port;
-	char options[16];		/* e.g., 115200n8 */
-	unsigned int baud;
-};
-
-static struct early_serial8250_device early_device;
+static struct earlycon_device *early_device;
 
 unsigned int __weak __init serial8250_early_in(struct uart_port *port, int offset)
 {
@@ -100,7 +90,7 @@ static void __init serial_putc(struct uart_port *port, int c)
 static void __init early_serial8250_write(struct console *console,
 					const char *s, unsigned int count)
 {
-	struct uart_port *port = &early_device.port;
+	struct uart_port *port = &early_device->port;
 	unsigned int ier;
 
 	/* Save the IER and disable interrupts */
@@ -129,7 +119,7 @@ static unsigned int __init probe_baud(struct uart_port *port)
 	return (port->uartclk / 16) / quot;
 }
 
-static void __init init_port(struct early_serial8250_device *device)
+static void __init init_port(struct earlycon_device *device)
 {
 	struct uart_port *port = &device->port;
 	unsigned int divisor;
@@ -148,128 +138,32 @@ static void __init init_port(struct early_serial8250_device *device)
 	serial8250_early_out(port, UART_LCR, c & ~UART_LCR_DLAB);
 }
 
-static int __init parse_options(struct early_serial8250_device *device,
-								char *options)
-{
-	struct uart_port *port = &device->port;
-	int mmio, mmio32, length;
-
-	if (!options)
-		return -ENODEV;
-
-	port->uartclk = BASE_BAUD * 16;
-
-	mmio = !strncmp(options, "mmio,", 5);
-	mmio32 = !strncmp(options, "mmio32,", 7);
-	if (mmio || mmio32) {
-		port->iotype = (mmio ? UPIO_MEM : UPIO_MEM32);
-		port->mapbase = simple_strtoul(options + (mmio ? 5 : 7),
-					       &options, 0);
-		if (mmio32)
-			port->regshift = 2;
-#ifdef CONFIG_FIX_EARLYCON_MEM
-		set_fixmap_nocache(FIX_EARLYCON_MEM_BASE,
-					port->mapbase & PAGE_MASK);
-		port->membase =
-			(void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
-		port->membase += port->mapbase & ~PAGE_MASK;
-#else
-		port->membase = ioremap_nocache(port->mapbase, 64);
-		if (!port->membase) {
-			printk(KERN_ERR "%s: Couldn't ioremap 0x%llx\n",
-				__func__,
-			       (unsigned long long) port->mapbase);
-			return -ENOMEM;
-		}
-#endif
-	} else if (!strncmp(options, "io,", 3)) {
-		port->iotype = UPIO_PORT;
-		port->iobase = simple_strtoul(options + 3, &options, 0);
-		mmio = 0;
-	} else
-		return -EINVAL;
-
-	options = strchr(options, ',');
-	if (options) {
-		options++;
-		device->baud = simple_strtoul(options, NULL, 0);
-		length = min(strcspn(options, " ") + 1,
-			     (size_t)(sizeof(device->options)));
-		strlcpy(device->options, options, length);
-	} else {
-		device->baud = probe_baud(port);
-		snprintf(device->options, sizeof(device->options), "%u",
-			device->baud);
-	}
-
-	if (mmio || mmio32)
-		printk(KERN_INFO
-		       "Early serial console at MMIO%s 0x%llx (options '%s')\n",
-			mmio32 ? "32" : "",
-			(unsigned long long)port->mapbase,
-			device->options);
-	else
-		printk(KERN_INFO
-		      "Early serial console at I/O port 0x%lx (options '%s')\n",
-			port->iobase,
-			device->options);
-
-	return 0;
-}
-
-static struct console early_serial8250_console __initdata = {
-	.name	= "uart",
-	.write	= early_serial8250_write,
-	.flags	= CON_PRINTBUFFER | CON_BOOT,
-	.index	= -1,
-};
-
-static int __init early_serial8250_setup(char *options)
+static int __init early_serial8250_setup(struct earlycon_device *device,
+					 const char *options)
 {
-	struct early_serial8250_device *device = &early_device;
-	int err;
-
-	if (device->port.membase || device->port.iobase)
+	if (!(device->port.membase || device->port.iobase))
 		return 0;
 
-	err = parse_options(device, options);
-	if (err < 0)
-		return err;
+	if (!device->baud)
+		device->baud = probe_baud(&device->port);
 
 	init_port(device);
-	return 0;
-}
-
-int __init setup_early_serial8250_console(char *cmdline)
-{
-	char *options;
-	int err;
-
-	options = strstr(cmdline, "uart8250,");
-	if (!options) {
-		options = strstr(cmdline, "uart,");
-		if (!options)
-			return 0;
-	}
-
-	options = strchr(cmdline, ',') + 1;
-	err = early_serial8250_setup(options);
-	if (err < 0)
-		return err;
-
-	register_console(&early_serial8250_console);
 
+	early_device = device;
+	device->con->write = early_serial8250_write;
 	return 0;
 }
+EARLYCON_DECLARE(uart8250, early_serial8250_setup);
+EARLYCON_DECLARE(uart, early_serial8250_setup);
 
 int serial8250_find_port_for_earlycon(void)
 {
-	struct early_serial8250_device *device = &early_device;
-	struct uart_port *port = &device->port;
+	struct earlycon_device *device = early_device;
+	struct uart_port *port = device ? &device->port : NULL;
 	int line;
 	int ret;
 
-	if (!device->port.membase && !device->port.iobase)
+	if (!port || (!port->membase && !port->iobase))
 		return -ENODEV;
 
 	line = serial8250_find_port(port);
@@ -284,5 +178,3 @@ int serial8250_find_port_for_earlycon(void)
 
 	return ret;
 }
-
-early_param("earlycon", setup_early_serial8250_console);
-- 
1.8.3.2

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

* [PATCH 6/8] tty/serial: pl011: add generic earlycon support
  2014-03-21 21:08 ` Rob Herring
@ 2014-03-21 21:08   ` Rob Herring
  -1 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-21 21:08 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-serial
  Cc: Greg Kroah-Hartman, Jiri Slaby, Catalin Marinas, Russell King,
	Will Deacon, x86, Arnd Bergmann, Rob Herring

From: Rob Herring <robh@kernel.org>

Add earlycon support for the pl011 serial port. This allows enabling
the pl011 for console when early_params are processed. This is based
on the arm64 earlyprintk support and is intended to replace it.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
---
 Documentation/kernel-parameters.txt |  5 +++--
 drivers/tty/serial/amba-pl011.c     | 30 +++++++++++++++++++++++++++++-
 2 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 5ce8b7a..81bdd52 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -887,8 +887,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 		uart[8250],io,<addr>[,options]
 		uart[8250],mmio,<addr>[,options]
 		uart[8250],mmio32,<addr>[,options]
-			Start an early, polled-mode console on the 8250/16550
-			UART at the specified I/O port or MMIO address.
+		pl011,<addr>
+			Start an early, polled-mode console on a serial port
+			at the specified I/O port or MMIO address. 8250
 			MMIO inter-register address stride is either 8-bit
 			(mmio) or 32-bit (mmio32).
 			The options are the same as for ttyS, above.
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index d4eda24..4227c0a 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -303,7 +303,7 @@ static void pl011_dma_probe_initcall(struct device *dev, struct uart_amba_port *
 
 	/* Optionally make use of an RX channel as well */
 	chan = dma_request_slave_channel(dev, "rx");
-	
+
 	if (!chan && plat->dma_rx_param) {
 		chan = dma_request_channel(mask, plat->dma_filter, plat->dma_rx_param);
 
@@ -2045,6 +2045,34 @@ static struct console amba_console = {
 };
 
 #define AMBA_CONSOLE	(&amba_console)
+
+static void pl011_putc(struct uart_port *port, int c)
+{
+	while (readl(port->membase + UART01x_FR) & UART01x_FR_TXFF)
+		;
+	writeb(c, port->membase + UART01x_DR);
+	while (readl(port->membase + UART01x_FR) & UART01x_FR_BUSY)
+		;
+}
+
+static void pl011_early_write(struct console *con, const char *s, unsigned n)
+{
+	struct earlycon_device *dev = con->data;
+
+	uart_console_write(&dev->port, s, n, pl011_putc);
+}
+
+static int __init pl011_early_console_setup(struct earlycon_device *device,
+					    const char *opt)
+{
+	if (!device->port.membase)
+		return -ENODEV;
+
+	device->con->write = pl011_early_write;
+	return 0;
+}
+EARLYCON_DECLARE(pl011, pl011_early_console_setup);
+
 #else
 #define AMBA_CONSOLE	NULL
 #endif
-- 
1.8.3.2


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

* [PATCH 6/8] tty/serial: pl011: add generic earlycon support
@ 2014-03-21 21:08   ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-21 21:08 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <robh@kernel.org>

Add earlycon support for the pl011 serial port. This allows enabling
the pl011 for console when early_params are processed. This is based
on the arm64 earlyprintk support and is intended to replace it.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
---
 Documentation/kernel-parameters.txt |  5 +++--
 drivers/tty/serial/amba-pl011.c     | 30 +++++++++++++++++++++++++++++-
 2 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 5ce8b7a..81bdd52 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -887,8 +887,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 		uart[8250],io,<addr>[,options]
 		uart[8250],mmio,<addr>[,options]
 		uart[8250],mmio32,<addr>[,options]
-			Start an early, polled-mode console on the 8250/16550
-			UART at the specified I/O port or MMIO address.
+		pl011,<addr>
+			Start an early, polled-mode console on a serial port
+			at the specified I/O port or MMIO address. 8250
 			MMIO inter-register address stride is either 8-bit
 			(mmio) or 32-bit (mmio32).
 			The options are the same as for ttyS, above.
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index d4eda24..4227c0a 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -303,7 +303,7 @@ static void pl011_dma_probe_initcall(struct device *dev, struct uart_amba_port *
 
 	/* Optionally make use of an RX channel as well */
 	chan = dma_request_slave_channel(dev, "rx");
-	
+
 	if (!chan && plat->dma_rx_param) {
 		chan = dma_request_channel(mask, plat->dma_filter, plat->dma_rx_param);
 
@@ -2045,6 +2045,34 @@ static struct console amba_console = {
 };
 
 #define AMBA_CONSOLE	(&amba_console)
+
+static void pl011_putc(struct uart_port *port, int c)
+{
+	while (readl(port->membase + UART01x_FR) & UART01x_FR_TXFF)
+		;
+	writeb(c, port->membase + UART01x_DR);
+	while (readl(port->membase + UART01x_FR) & UART01x_FR_BUSY)
+		;
+}
+
+static void pl011_early_write(struct console *con, const char *s, unsigned n)
+{
+	struct earlycon_device *dev = con->data;
+
+	uart_console_write(&dev->port, s, n, pl011_putc);
+}
+
+static int __init pl011_early_console_setup(struct earlycon_device *device,
+					    const char *opt)
+{
+	if (!device->port.membase)
+		return -ENODEV;
+
+	device->con->write = pl011_early_write;
+	return 0;
+}
+EARLYCON_DECLARE(pl011, pl011_early_console_setup);
+
 #else
 #define AMBA_CONSOLE	NULL
 #endif
-- 
1.8.3.2

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

* [PATCH 7/8] tty/serial: add arm64 semihosting earlycon
  2014-03-21 21:08 ` Rob Herring
@ 2014-03-21 21:08   ` Rob Herring
  -1 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-21 21:08 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-serial
  Cc: Greg Kroah-Hartman, Jiri Slaby, Catalin Marinas, Russell King,
	Will Deacon, x86, Arnd Bergmann, Rob Herring

From: Rob Herring <robh@kernel.org>

Add earlycon support for the arm64 semihosting debug serial interface.
This allows enabling a debug console when early_params are processed.
This is based on the arm64 earlyprintk smh support and is intended to
replace it.

This is named arm rather than arm64 in hopes it will be used for both,
but only arm64 is supported ATM.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
---
 Documentation/kernel-parameters.txt        |  1 +
 drivers/tty/serial/Kconfig                 | 17 +++++++++---
 drivers/tty/serial/Makefile                |  1 +
 drivers/tty/serial/earlycon-arm-semihost.c | 44 ++++++++++++++++++++++++++++++
 4 files changed, 59 insertions(+), 4 deletions(-)
 create mode 100644 drivers/tty/serial/earlycon-arm-semihost.c

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 81bdd52..e96e2ba 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -888,6 +888,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 		uart[8250],mmio,<addr>[,options]
 		uart[8250],mmio32,<addr>[,options]
 		pl011,<addr>
+		smh
 			Start an early, polled-mode console on a serial port
 			at the specified I/O port or MMIO address. 8250
 			MMIO inter-register address stride is either 8-bit
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 1685189..8b8f40e 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -14,6 +14,15 @@ config SERIAL_EARLYCON
 	  the console before standard serial driver is probed. The console is
 	  enabled when early_param is processed.
 
+config SERIAL_EARLYCON_ARM_SEMIHOST
+	bool "Early console using ARM64 semihosting"
+	depends on ARM64
+	help
+	  Support for early debug console using ARM64 semihosting. This enables
+	  the console before standard serial driver is probed. This is enabled
+	  with "earlycon=smh" on the kernel command line. The console is
+	  enabled when early_param is processed.
+
 source "drivers/tty/serial/8250/Kconfig"
 
 comment "Non-8250 serial port support"
@@ -230,7 +239,7 @@ config SERIAL_SAMSUNG_UARTS
 	help
 	  Select the number of available UART ports for the Samsung S3C
 	  serial driver
-	
+
 config SERIAL_SAMSUNG_DEBUG
 	bool "Samsung SoC serial debug"
 	depends on SERIAL_SAMSUNG && DEBUG_LL
@@ -666,8 +675,8 @@ config PDC_CONSOLE
 	depends on PARISC && !SERIAL_MUX && VT
 	default n
 	help
-	  Saying Y here will enable the software based PDC console to be 
-	  used as the system console.  This is useful for machines in 
+	  Saying Y here will enable the software based PDC console to be
+	  used as the system console.  This is useful for machines in
 	  which the hardware based console has not been written yet.  The
 	  following steps must be competed to use the PDC console:
 
@@ -858,7 +867,7 @@ config SERIAL_CPM
 	depends on CPM2 || 8xx
 	select SERIAL_CORE
 	help
-	  This driver supports the SCC and SMC serial ports on Motorola 
+	  This driver supports the SCC and SMC serial ports on Motorola
 	  embedded PowerPC that contain a CPM1 (8xx) or CPM2 (8xxx)
 
 config SERIAL_CPM_CONSOLE
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index 8af1415..9965b65 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -6,6 +6,7 @@ obj-$(CONFIG_SERIAL_CORE) += serial_core.o
 obj-$(CONFIG_SERIAL_21285) += 21285.o
 
 obj-$(CONFIG_SERIAL_EARLYCON) += earlycon.o
+obj-$(CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST) += earlycon-arm-semihost.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-arm-semihost.c b/drivers/tty/serial/earlycon-arm-semihost.c
new file mode 100644
index 0000000..fecec9a
--- /dev/null
+++ b/drivers/tty/serial/earlycon-arm-semihost.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2012 ARM Ltd.
+ * Author: Catalin Marinas <catalin.marinas@arm.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+#include <linux/kernel.h>
+#include <linux/console.h>
+#include <linux/init.h>
+#include <linux/serial_core.h>
+
+/*
+ * Semihosting-based debug console
+ */
+static void smh_putc(struct uart_port *port, int c)
+{
+	asm volatile("mov  x1, %0\n"
+		     "mov  x0, #3\n"
+		     "hlt  0xf000\n"
+		     : : "r" (&c) : "x0", "x1", "memory");
+}
+
+static void smh_write(struct console *con, const char *s, unsigned n)
+{
+	struct earlycon_device *dev = con->data;
+	uart_console_write(&dev->port, s, n, smh_putc);
+}
+
+int __init early_smh_setup(struct earlycon_device *device, const char *opt)
+{
+	device->con->write = smh_write;
+	return 0;
+}
+EARLYCON_DECLARE(smh, early_smh_setup);
-- 
1.8.3.2


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

* [PATCH 7/8] tty/serial: add arm64 semihosting earlycon
@ 2014-03-21 21:08   ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-21 21:08 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <robh@kernel.org>

Add earlycon support for the arm64 semihosting debug serial interface.
This allows enabling a debug console when early_params are processed.
This is based on the arm64 earlyprintk smh support and is intended to
replace it.

This is named arm rather than arm64 in hopes it will be used for both,
but only arm64 is supported ATM.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
---
 Documentation/kernel-parameters.txt        |  1 +
 drivers/tty/serial/Kconfig                 | 17 +++++++++---
 drivers/tty/serial/Makefile                |  1 +
 drivers/tty/serial/earlycon-arm-semihost.c | 44 ++++++++++++++++++++++++++++++
 4 files changed, 59 insertions(+), 4 deletions(-)
 create mode 100644 drivers/tty/serial/earlycon-arm-semihost.c

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 81bdd52..e96e2ba 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -888,6 +888,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 		uart[8250],mmio,<addr>[,options]
 		uart[8250],mmio32,<addr>[,options]
 		pl011,<addr>
+		smh
 			Start an early, polled-mode console on a serial port
 			at the specified I/O port or MMIO address. 8250
 			MMIO inter-register address stride is either 8-bit
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 1685189..8b8f40e 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -14,6 +14,15 @@ config SERIAL_EARLYCON
 	  the console before standard serial driver is probed. The console is
 	  enabled when early_param is processed.
 
+config SERIAL_EARLYCON_ARM_SEMIHOST
+	bool "Early console using ARM64 semihosting"
+	depends on ARM64
+	help
+	  Support for early debug console using ARM64 semihosting. This enables
+	  the console before standard serial driver is probed. This is enabled
+	  with "earlycon=smh" on the kernel command line. The console is
+	  enabled when early_param is processed.
+
 source "drivers/tty/serial/8250/Kconfig"
 
 comment "Non-8250 serial port support"
@@ -230,7 +239,7 @@ config SERIAL_SAMSUNG_UARTS
 	help
 	  Select the number of available UART ports for the Samsung S3C
 	  serial driver
-	
+
 config SERIAL_SAMSUNG_DEBUG
 	bool "Samsung SoC serial debug"
 	depends on SERIAL_SAMSUNG && DEBUG_LL
@@ -666,8 +675,8 @@ config PDC_CONSOLE
 	depends on PARISC && !SERIAL_MUX && VT
 	default n
 	help
-	  Saying Y here will enable the software based PDC console to be 
-	  used as the system console.  This is useful for machines in 
+	  Saying Y here will enable the software based PDC console to be
+	  used as the system console.  This is useful for machines in
 	  which the hardware based console has not been written yet.  The
 	  following steps must be competed to use the PDC console:
 
@@ -858,7 +867,7 @@ config SERIAL_CPM
 	depends on CPM2 || 8xx
 	select SERIAL_CORE
 	help
-	  This driver supports the SCC and SMC serial ports on Motorola 
+	  This driver supports the SCC and SMC serial ports on Motorola
 	  embedded PowerPC that contain a CPM1 (8xx) or CPM2 (8xxx)
 
 config SERIAL_CPM_CONSOLE
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index 8af1415..9965b65 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -6,6 +6,7 @@ obj-$(CONFIG_SERIAL_CORE) += serial_core.o
 obj-$(CONFIG_SERIAL_21285) += 21285.o
 
 obj-$(CONFIG_SERIAL_EARLYCON) += earlycon.o
+obj-$(CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST) += earlycon-arm-semihost.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-arm-semihost.c b/drivers/tty/serial/earlycon-arm-semihost.c
new file mode 100644
index 0000000..fecec9a
--- /dev/null
+++ b/drivers/tty/serial/earlycon-arm-semihost.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2012 ARM Ltd.
+ * Author: Catalin Marinas <catalin.marinas@arm.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+#include <linux/kernel.h>
+#include <linux/console.h>
+#include <linux/init.h>
+#include <linux/serial_core.h>
+
+/*
+ * Semihosting-based debug console
+ */
+static void smh_putc(struct uart_port *port, int c)
+{
+	asm volatile("mov  x1, %0\n"
+		     "mov  x0, #3\n"
+		     "hlt  0xf000\n"
+		     : : "r" (&c) : "x0", "x1", "memory");
+}
+
+static void smh_write(struct console *con, const char *s, unsigned n)
+{
+	struct earlycon_device *dev = con->data;
+	uart_console_write(&dev->port, s, n, smh_putc);
+}
+
+int __init early_smh_setup(struct earlycon_device *device, const char *opt)
+{
+	device->con->write = smh_write;
+	return 0;
+}
+EARLYCON_DECLARE(smh, early_smh_setup);
-- 
1.8.3.2

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

* [PATCH 8/8] arm64: remove arch specific earlyprintk
  2014-03-21 21:08 ` Rob Herring
@ 2014-03-21 21:08   ` Rob Herring
  -1 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-21 21:08 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-serial
  Cc: Greg Kroah-Hartman, Jiri Slaby, Catalin Marinas, Russell King,
	Will Deacon, x86, Arnd Bergmann, Rob Herring

From: Rob Herring <robh@kernel.org>

Now that we have equivalent earlycon support, arm64's earlyprintk code
can be removed.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
---
 arch/arm64/Kconfig.debug         |   9 ---
 arch/arm64/kernel/Makefile       |   1 -
 arch/arm64/kernel/early_printk.c | 158 ---------------------------------------
 3 files changed, 168 deletions(-)
 delete mode 100644 arch/arm64/kernel/early_printk.c

diff --git a/arch/arm64/Kconfig.debug b/arch/arm64/Kconfig.debug
index 835c5597..7d7fb6f 100644
--- a/arch/arm64/Kconfig.debug
+++ b/arch/arm64/Kconfig.debug
@@ -6,15 +6,6 @@ config FRAME_POINTER
 	bool
 	default y
 
-config EARLY_PRINTK
-	bool "Early printk support"
-	default y
-	help
-	  Say Y here if you want to have an early console using the
-	  earlyprintk=<name>[,<addr>][,<options>] kernel parameter. It
-	  is assumed that the early console device has been initialised
-	  by the boot loader prior to starting the Linux kernel.
-
 config PID_IN_CONTEXTIDR
 	bool "Write the current PID to the CONTEXTIDR register"
 	help
diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
index 7d811d9..7a6fce5 100644
--- a/arch/arm64/kernel/Makefile
+++ b/arch/arm64/kernel/Makefile
@@ -18,7 +18,6 @@ arm64-obj-$(CONFIG_SMP)			+= smp.o smp_spin_table.o topology.o
 arm64-obj-$(CONFIG_PERF_EVENTS)		+= perf_regs.o
 arm64-obj-$(CONFIG_HW_PERF_EVENTS)	+= perf_event.o
 arm64-obj-$(CONFIG_HAVE_HW_BREAKPOINT)	+= hw_breakpoint.o
-arm64-obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 arm64-obj-$(CONFIG_ARM64_CPU_SUSPEND)	+= sleep.o suspend.o
 arm64-obj-$(CONFIG_JUMP_LABEL)		+= jump_label.o
 arm64-obj-$(CONFIG_KGDB)		+= kgdb.o
diff --git a/arch/arm64/kernel/early_printk.c b/arch/arm64/kernel/early_printk.c
deleted file mode 100644
index ffbbdde..0000000
--- a/arch/arm64/kernel/early_printk.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Earlyprintk support.
- *
- * Copyright (C) 2012 ARM Ltd.
- * Author: Catalin Marinas <catalin.marinas@arm.com>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-#include <linux/kernel.h>
-#include <linux/console.h>
-#include <linux/init.h>
-#include <linux/string.h>
-#include <linux/mm.h>
-#include <linux/io.h>
-
-#include <linux/amba/serial.h>
-#include <linux/serial_reg.h>
-
-#include <asm/fixmap.h>
-
-static void __iomem *early_base;
-static void (*printch)(char ch);
-
-/*
- * PL011 single character TX.
- */
-static void pl011_printch(char ch)
-{
-	while (readl_relaxed(early_base + UART01x_FR) & UART01x_FR_TXFF)
-		;
-	writeb_relaxed(ch, early_base + UART01x_DR);
-	while (readl_relaxed(early_base + UART01x_FR) & UART01x_FR_BUSY)
-		;
-}
-
-/*
- * Semihosting-based debug console
- */
-static void smh_printch(char ch)
-{
-	asm volatile("mov  x1, %0\n"
-		     "mov  x0, #3\n"
-		     "hlt  0xf000\n"
-		     : : "r" (&ch) : "x0", "x1", "memory");
-}
-
-/*
- * 8250/16550 (8-bit aligned registers) single character TX.
- */
-static void uart8250_8bit_printch(char ch)
-{
-	while (!(readb_relaxed(early_base + UART_LSR) & UART_LSR_THRE))
-		;
-	writeb_relaxed(ch, early_base + UART_TX);
-}
-
-/*
- * 8250/16550 (32-bit aligned registers) single character TX.
- */
-static void uart8250_32bit_printch(char ch)
-{
-	while (!(readl_relaxed(early_base + (UART_LSR << 2)) & UART_LSR_THRE))
-		;
-	writel_relaxed(ch, early_base + (UART_TX << 2));
-}
-
-struct earlycon_match {
-	const char *name;
-	void (*printch)(char ch);
-};
-
-static const struct earlycon_match earlycon_match[] __initconst = {
-	{ .name = "pl011", .printch = pl011_printch, },
-	{ .name = "smh", .printch = smh_printch, },
-	{ .name = "uart8250-8bit", .printch = uart8250_8bit_printch, },
-	{ .name = "uart8250-32bit", .printch = uart8250_32bit_printch, },
-	{}
-};
-
-static void early_write(struct console *con, const char *s, unsigned n)
-{
-	while (n-- > 0) {
-		if (*s == '\n')
-			printch('\r');
-		printch(*s);
-		s++;
-	}
-}
-
-static struct console early_console_dev = {
-	.name =		"earlycon",
-	.write =	early_write,
-	.flags =	CON_PRINTBUFFER | CON_BOOT,
-	.index =	-1,
-};
-
-/*
- * Parse earlyprintk=... parameter in the format:
- *
- *   <name>[,<addr>][,<options>]
- *
- * and register the early console. It is assumed that the UART has been
- * initialised by the bootloader already.
- */
-static int __init setup_early_printk(char *buf)
-{
-	const struct earlycon_match *match = earlycon_match;
-	phys_addr_t paddr = 0;
-
-	if (!buf) {
-		pr_warning("No earlyprintk arguments passed.\n");
-		return 0;
-	}
-
-	while (match->name) {
-		size_t len = strlen(match->name);
-		if (!strncmp(buf, match->name, len)) {
-			buf += len;
-			break;
-		}
-		match++;
-	}
-	if (!match->name) {
-		pr_warning("Unknown earlyprintk arguments: %s\n", buf);
-		return 0;
-	}
-
-	/* I/O address */
-	if (!strncmp(buf, ",0x", 3)) {
-		char *e;
-		paddr = simple_strtoul(buf + 1, &e, 16);
-		buf = e;
-	}
-	/* no options parsing yet */
-
-	if (paddr) {
-		set_fixmap_io(FIX_EARLYCON_MEM_BASE, paddr);
-		early_base = (void __iomem *)fix_to_virt(FIX_EARLYCON_MEM_BASE);
-	}
-
-	printch = match->printch;
-	early_console = &early_console_dev;
-	register_console(&early_console_dev);
-
-	return 0;
-}
-
-early_param("earlyprintk", setup_early_printk);
-- 
1.8.3.2


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

* [PATCH 8/8] arm64: remove arch specific earlyprintk
@ 2014-03-21 21:08   ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-21 21:08 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <robh@kernel.org>

Now that we have equivalent earlycon support, arm64's earlyprintk code
can be removed.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
---
 arch/arm64/Kconfig.debug         |   9 ---
 arch/arm64/kernel/Makefile       |   1 -
 arch/arm64/kernel/early_printk.c | 158 ---------------------------------------
 3 files changed, 168 deletions(-)
 delete mode 100644 arch/arm64/kernel/early_printk.c

diff --git a/arch/arm64/Kconfig.debug b/arch/arm64/Kconfig.debug
index 835c5597..7d7fb6f 100644
--- a/arch/arm64/Kconfig.debug
+++ b/arch/arm64/Kconfig.debug
@@ -6,15 +6,6 @@ config FRAME_POINTER
 	bool
 	default y
 
-config EARLY_PRINTK
-	bool "Early printk support"
-	default y
-	help
-	  Say Y here if you want to have an early console using the
-	  earlyprintk=<name>[,<addr>][,<options>] kernel parameter. It
-	  is assumed that the early console device has been initialised
-	  by the boot loader prior to starting the Linux kernel.
-
 config PID_IN_CONTEXTIDR
 	bool "Write the current PID to the CONTEXTIDR register"
 	help
diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
index 7d811d9..7a6fce5 100644
--- a/arch/arm64/kernel/Makefile
+++ b/arch/arm64/kernel/Makefile
@@ -18,7 +18,6 @@ arm64-obj-$(CONFIG_SMP)			+= smp.o smp_spin_table.o topology.o
 arm64-obj-$(CONFIG_PERF_EVENTS)		+= perf_regs.o
 arm64-obj-$(CONFIG_HW_PERF_EVENTS)	+= perf_event.o
 arm64-obj-$(CONFIG_HAVE_HW_BREAKPOINT)	+= hw_breakpoint.o
-arm64-obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 arm64-obj-$(CONFIG_ARM64_CPU_SUSPEND)	+= sleep.o suspend.o
 arm64-obj-$(CONFIG_JUMP_LABEL)		+= jump_label.o
 arm64-obj-$(CONFIG_KGDB)		+= kgdb.o
diff --git a/arch/arm64/kernel/early_printk.c b/arch/arm64/kernel/early_printk.c
deleted file mode 100644
index ffbbdde..0000000
--- a/arch/arm64/kernel/early_printk.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Earlyprintk support.
- *
- * Copyright (C) 2012 ARM Ltd.
- * Author: Catalin Marinas <catalin.marinas@arm.com>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-#include <linux/kernel.h>
-#include <linux/console.h>
-#include <linux/init.h>
-#include <linux/string.h>
-#include <linux/mm.h>
-#include <linux/io.h>
-
-#include <linux/amba/serial.h>
-#include <linux/serial_reg.h>
-
-#include <asm/fixmap.h>
-
-static void __iomem *early_base;
-static void (*printch)(char ch);
-
-/*
- * PL011 single character TX.
- */
-static void pl011_printch(char ch)
-{
-	while (readl_relaxed(early_base + UART01x_FR) & UART01x_FR_TXFF)
-		;
-	writeb_relaxed(ch, early_base + UART01x_DR);
-	while (readl_relaxed(early_base + UART01x_FR) & UART01x_FR_BUSY)
-		;
-}
-
-/*
- * Semihosting-based debug console
- */
-static void smh_printch(char ch)
-{
-	asm volatile("mov  x1, %0\n"
-		     "mov  x0, #3\n"
-		     "hlt  0xf000\n"
-		     : : "r" (&ch) : "x0", "x1", "memory");
-}
-
-/*
- * 8250/16550 (8-bit aligned registers) single character TX.
- */
-static void uart8250_8bit_printch(char ch)
-{
-	while (!(readb_relaxed(early_base + UART_LSR) & UART_LSR_THRE))
-		;
-	writeb_relaxed(ch, early_base + UART_TX);
-}
-
-/*
- * 8250/16550 (32-bit aligned registers) single character TX.
- */
-static void uart8250_32bit_printch(char ch)
-{
-	while (!(readl_relaxed(early_base + (UART_LSR << 2)) & UART_LSR_THRE))
-		;
-	writel_relaxed(ch, early_base + (UART_TX << 2));
-}
-
-struct earlycon_match {
-	const char *name;
-	void (*printch)(char ch);
-};
-
-static const struct earlycon_match earlycon_match[] __initconst = {
-	{ .name = "pl011", .printch = pl011_printch, },
-	{ .name = "smh", .printch = smh_printch, },
-	{ .name = "uart8250-8bit", .printch = uart8250_8bit_printch, },
-	{ .name = "uart8250-32bit", .printch = uart8250_32bit_printch, },
-	{}
-};
-
-static void early_write(struct console *con, const char *s, unsigned n)
-{
-	while (n-- > 0) {
-		if (*s == '\n')
-			printch('\r');
-		printch(*s);
-		s++;
-	}
-}
-
-static struct console early_console_dev = {
-	.name =		"earlycon",
-	.write =	early_write,
-	.flags =	CON_PRINTBUFFER | CON_BOOT,
-	.index =	-1,
-};
-
-/*
- * Parse earlyprintk=... parameter in the format:
- *
- *   <name>[,<addr>][,<options>]
- *
- * and register the early console. It is assumed that the UART has been
- * initialised by the bootloader already.
- */
-static int __init setup_early_printk(char *buf)
-{
-	const struct earlycon_match *match = earlycon_match;
-	phys_addr_t paddr = 0;
-
-	if (!buf) {
-		pr_warning("No earlyprintk arguments passed.\n");
-		return 0;
-	}
-
-	while (match->name) {
-		size_t len = strlen(match->name);
-		if (!strncmp(buf, match->name, len)) {
-			buf += len;
-			break;
-		}
-		match++;
-	}
-	if (!match->name) {
-		pr_warning("Unknown earlyprintk arguments: %s\n", buf);
-		return 0;
-	}
-
-	/* I/O address */
-	if (!strncmp(buf, ",0x", 3)) {
-		char *e;
-		paddr = simple_strtoul(buf + 1, &e, 16);
-		buf = e;
-	}
-	/* no options parsing yet */
-
-	if (paddr) {
-		set_fixmap_io(FIX_EARLYCON_MEM_BASE, paddr);
-		early_base = (void __iomem *)fix_to_virt(FIX_EARLYCON_MEM_BASE);
-	}
-
-	printch = match->printch;
-	early_console = &early_console_dev;
-	register_console(&early_console_dev);
-
-	return 0;
-}
-
-early_param("earlyprintk", setup_early_printk);
-- 
1.8.3.2

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

* Re: [PATCH 0/8] Generic serial earlycon
  2014-03-21 21:08 ` Rob Herring
  (?)
@ 2014-03-22  9:54   ` Arnd Bergmann
  -1 siblings, 0 replies; 90+ messages in thread
From: Arnd Bergmann @ 2014-03-22  9:54 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Catalin Marinas, Russell King, Will Deacon, x86,
	Rob Herring

On Friday 21 March 2014, Rob Herring wrote:
> From: Rob Herring <robh@kernel.org>
> 
> This started out as an attempt to add arm64's earlyprintk support to ARM
> in order to get an earlier, runtime setup console on multi-platform
> kernels. The first issue was needing the fixmap support which
> conveniently Mark Salter was working on and is mostly in place now. Like
> many things on ARM and arm64 now, it then became where do I put the now
> common, shared code. After digging more into various early console/printk
> support, it turns out the 8250_early.c setup code was the best starting
> point. 
> 
> This is based on Mark Salter's fixmap support currently in linux-next.
> This is tested on arm64 and ARM with pl011 and 8250. The ARM support
> also requires fixmap and fixed mapping support which are not yet in place.
> I have some patches in my tree to support fixmap, but they need some more
> work. Fortunately, once fixmap is in place, it is just a Kconfig option
> to enable earlycon support on ARM. A git tree is available here[1].
> 
> Based on this series, I would like to add support for doing earlycon
> setup using DT.

Hi Rob,

I like this series a lot, great work!

I would consider the DT parsing support essential here, we should not
merge the patches until that is done as well, because I don't want
to see users pass earlycon command line options in DT when they can
use the established "linux,stdout-path" property instead. I would
expect that in almost every case in which we are booting using DT
today, we can just use linux,stdout-path to locate the device that
the boot loader has already set up and start usign it.

	Arnd

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

* Re: [PATCH 0/8] Generic serial earlycon
@ 2014-03-22  9:54   ` Arnd Bergmann
  0 siblings, 0 replies; 90+ messages in thread
From: Arnd Bergmann @ 2014-03-22  9:54 UTC (permalink / raw)
  To: Rob Herring
  Cc: Rob Herring, Russell King, Catalin Marinas, x86, Will Deacon,
	linux-kernel, linux-serial, Greg Kroah-Hartman, Jiri Slaby,
	linux-arm-kernel

On Friday 21 March 2014, Rob Herring wrote:
> From: Rob Herring <robh@kernel.org>
> 
> This started out as an attempt to add arm64's earlyprintk support to ARM
> in order to get an earlier, runtime setup console on multi-platform
> kernels. The first issue was needing the fixmap support which
> conveniently Mark Salter was working on and is mostly in place now. Like
> many things on ARM and arm64 now, it then became where do I put the now
> common, shared code. After digging more into various early console/printk
> support, it turns out the 8250_early.c setup code was the best starting
> point. 
> 
> This is based on Mark Salter's fixmap support currently in linux-next.
> This is tested on arm64 and ARM with pl011 and 8250. The ARM support
> also requires fixmap and fixed mapping support which are not yet in place.
> I have some patches in my tree to support fixmap, but they need some more
> work. Fortunately, once fixmap is in place, it is just a Kconfig option
> to enable earlycon support on ARM. A git tree is available here[1].
> 
> Based on this series, I would like to add support for doing earlycon
> setup using DT.

Hi Rob,

I like this series a lot, great work!

I would consider the DT parsing support essential here, we should not
merge the patches until that is done as well, because I don't want
to see users pass earlycon command line options in DT when they can
use the established "linux,stdout-path" property instead. I would
expect that in almost every case in which we are booting using DT
today, we can just use linux,stdout-path to locate the device that
the boot loader has already set up and start usign it.

	Arnd

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

* [PATCH 0/8] Generic serial earlycon
@ 2014-03-22  9:54   ` Arnd Bergmann
  0 siblings, 0 replies; 90+ messages in thread
From: Arnd Bergmann @ 2014-03-22  9:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 21 March 2014, Rob Herring wrote:
> From: Rob Herring <robh@kernel.org>
> 
> This started out as an attempt to add arm64's earlyprintk support to ARM
> in order to get an earlier, runtime setup console on multi-platform
> kernels. The first issue was needing the fixmap support which
> conveniently Mark Salter was working on and is mostly in place now. Like
> many things on ARM and arm64 now, it then became where do I put the now
> common, shared code. After digging more into various early console/printk
> support, it turns out the 8250_early.c setup code was the best starting
> point. 
> 
> This is based on Mark Salter's fixmap support currently in linux-next.
> This is tested on arm64 and ARM with pl011 and 8250. The ARM support
> also requires fixmap and fixed mapping support which are not yet in place.
> I have some patches in my tree to support fixmap, but they need some more
> work. Fortunately, once fixmap is in place, it is just a Kconfig option
> to enable earlycon support on ARM. A git tree is available here[1].
> 
> Based on this series, I would like to add support for doing earlycon
> setup using DT.

Hi Rob,

I like this series a lot, great work!

I would consider the DT parsing support essential here, we should not
merge the patches until that is done as well, because I don't want
to see users pass earlycon command line options in DT when they can
use the established "linux,stdout-path" property instead. I would
expect that in almost every case in which we are booting using DT
today, we can just use linux,stdout-path to locate the device that
the boot loader has already set up and start usign it.

	Arnd

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

* Re: [PATCH 0/8] Generic serial earlycon
  2014-03-22  9:54   ` Arnd Bergmann
  (?)
@ 2014-03-22 14:14     ` Rob Herring
  -1 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-22 14:14 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Catalin Marinas, Russell King, Will Deacon, x86

On Sat, Mar 22, 2014 at 4:54 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Friday 21 March 2014, Rob Herring wrote:
>> From: Rob Herring <robh@kernel.org>
>>
>> This started out as an attempt to add arm64's earlyprintk support to ARM
>> in order to get an earlier, runtime setup console on multi-platform
>> kernels. The first issue was needing the fixmap support which
>> conveniently Mark Salter was working on and is mostly in place now. Like
>> many things on ARM and arm64 now, it then became where do I put the now
>> common, shared code. After digging more into various early console/printk
>> support, it turns out the 8250_early.c setup code was the best starting
>> point.
>>
>> This is based on Mark Salter's fixmap support currently in linux-next.
>> This is tested on arm64 and ARM with pl011 and 8250. The ARM support
>> also requires fixmap and fixed mapping support which are not yet in place.
>> I have some patches in my tree to support fixmap, but they need some more
>> work. Fortunately, once fixmap is in place, it is just a Kconfig option
>> to enable earlycon support on ARM. A git tree is available here[1].
>>
>> Based on this series, I would like to add support for doing earlycon
>> setup using DT.
>
> Hi Rob,
>
> I like this series a lot, great work!
>
> I would consider the DT parsing support essential here, we should not
> merge the patches until that is done as well, because I don't want
> to see users pass earlycon command line options in DT when they can
> use the established "linux,stdout-path" property instead. I would
> expect that in almost every case in which we are booting using DT
> today, we can just use linux,stdout-path to locate the device that
> the boot loader has already set up and start usign it.

I think this series stands on its own. It is largely refactoring
existing code and supporting existing command line options (arm64 just
changes from earlyprintk= to earlycon=). There will be cases where
changing the kernel command line is the only way to setup the
earlycon. Also, I think we would still want the kernel command line to
control whether or not we enable the earlycon (i.e. earlycon=dt).
There's not a standard way for how bootloaders would decide to set
"linux,stdout-path" or not.

The DT support won't be all that quick to implement. The challenge
with the DT parsing is we have to do it on the flattened DT. I have
something functioning, but it doesn't do any address translation which
is the hard part.

Rob

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

* Re: [PATCH 0/8] Generic serial earlycon
@ 2014-03-22 14:14     ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-22 14:14 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Catalin Marinas, Russell King, Will Deacon, x86

On Sat, Mar 22, 2014 at 4:54 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Friday 21 March 2014, Rob Herring wrote:
>> From: Rob Herring <robh@kernel.org>
>>
>> This started out as an attempt to add arm64's earlyprintk support to ARM
>> in order to get an earlier, runtime setup console on multi-platform
>> kernels. The first issue was needing the fixmap support which
>> conveniently Mark Salter was working on and is mostly in place now. Like
>> many things on ARM and arm64 now, it then became where do I put the now
>> common, shared code. After digging more into various early console/printk
>> support, it turns out the 8250_early.c setup code was the best starting
>> point.
>>
>> This is based on Mark Salter's fixmap support currently in linux-next.
>> This is tested on arm64 and ARM with pl011 and 8250. The ARM support
>> also requires fixmap and fixed mapping support which are not yet in place.
>> I have some patches in my tree to support fixmap, but they need some more
>> work. Fortunately, once fixmap is in place, it is just a Kconfig option
>> to enable earlycon support on ARM. A git tree is available here[1].
>>
>> Based on this series, I would like to add support for doing earlycon
>> setup using DT.
>
> Hi Rob,
>
> I like this series a lot, great work!
>
> I would consider the DT parsing support essential here, we should not
> merge the patches until that is done as well, because I don't want
> to see users pass earlycon command line options in DT when they can
> use the established "linux,stdout-path" property instead. I would
> expect that in almost every case in which we are booting using DT
> today, we can just use linux,stdout-path to locate the device that
> the boot loader has already set up and start usign it.

I think this series stands on its own. It is largely refactoring
existing code and supporting existing command line options (arm64 just
changes from earlyprintk= to earlycon=). There will be cases where
changing the kernel command line is the only way to setup the
earlycon. Also, I think we would still want the kernel command line to
control whether or not we enable the earlycon (i.e. earlycon=dt).
There's not a standard way for how bootloaders would decide to set
"linux,stdout-path" or not.

The DT support won't be all that quick to implement. The challenge
with the DT parsing is we have to do it on the flattened DT. I have
something functioning, but it doesn't do any address translation which
is the hard part.

Rob

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

* [PATCH 0/8] Generic serial earlycon
@ 2014-03-22 14:14     ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-22 14:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Mar 22, 2014 at 4:54 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Friday 21 March 2014, Rob Herring wrote:
>> From: Rob Herring <robh@kernel.org>
>>
>> This started out as an attempt to add arm64's earlyprintk support to ARM
>> in order to get an earlier, runtime setup console on multi-platform
>> kernels. The first issue was needing the fixmap support which
>> conveniently Mark Salter was working on and is mostly in place now. Like
>> many things on ARM and arm64 now, it then became where do I put the now
>> common, shared code. After digging more into various early console/printk
>> support, it turns out the 8250_early.c setup code was the best starting
>> point.
>>
>> This is based on Mark Salter's fixmap support currently in linux-next.
>> This is tested on arm64 and ARM with pl011 and 8250. The ARM support
>> also requires fixmap and fixed mapping support which are not yet in place.
>> I have some patches in my tree to support fixmap, but they need some more
>> work. Fortunately, once fixmap is in place, it is just a Kconfig option
>> to enable earlycon support on ARM. A git tree is available here[1].
>>
>> Based on this series, I would like to add support for doing earlycon
>> setup using DT.
>
> Hi Rob,
>
> I like this series a lot, great work!
>
> I would consider the DT parsing support essential here, we should not
> merge the patches until that is done as well, because I don't want
> to see users pass earlycon command line options in DT when they can
> use the established "linux,stdout-path" property instead. I would
> expect that in almost every case in which we are booting using DT
> today, we can just use linux,stdout-path to locate the device that
> the boot loader has already set up and start usign it.

I think this series stands on its own. It is largely refactoring
existing code and supporting existing command line options (arm64 just
changes from earlyprintk= to earlycon=). There will be cases where
changing the kernel command line is the only way to setup the
earlycon. Also, I think we would still want the kernel command line to
control whether or not we enable the earlycon (i.e. earlycon=dt).
There's not a standard way for how bootloaders would decide to set
"linux,stdout-path" or not.

The DT support won't be all that quick to implement. The challenge
with the DT parsing is we have to do it on the flattened DT. I have
something functioning, but it doesn't do any address translation which
is the hard part.

Rob

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

* Re: [PATCH 0/8] Generic serial earlycon
  2014-03-22 14:14     ` Rob Herring
  (?)
@ 2014-03-22 22:01       ` Arnd Bergmann
  -1 siblings, 0 replies; 90+ messages in thread
From: Arnd Bergmann @ 2014-03-22 22:01 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Catalin Marinas, Russell King, Will Deacon, x86

On Saturday 22 March 2014, Rob Herring wrote:
> I think this series stands on its own. It is largely refactoring
> existing code and supporting existing command line options (arm64 just
> changes from earlyprintk= to earlycon=). There will be cases where
> changing the kernel command line is the only way to setup the
> earlycon. Also, I think we would still want the kernel command line to
> control whether or not we enable the earlycon (i.e. earlycon=dt).
> There's not a standard way for how bootloaders would decide to set
> "linux,stdout-path" or not.
> 
> The DT support won't be all that quick to implement. The challenge
> with the DT parsing is we have to do it on the flattened DT. I have
> something functioning, but it doesn't do any address translation which
> is the hard part.

Ah, I hadn't realized that we call parse_early_param() twice, both
in start_kernel() and before that in setup_arch(). You are right
that the first one of these can only look at the flat device tree
at the moment. I wonder if that's out of necessity or just coincidence
though.

There is relatively little going on between the first parse_early_param()
and the call to unflatten_device_tree(), so it may be possible to move
the former down, or the latter up.

        parse_early_param();

        sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);

        early_paging_init(mdesc, lookup_processor_type(read_cpuid_id()));
        setup_dma_zone(mdesc);  
        sanity_check_meminfo();
        arm_memblock_init(&meminfo, mdesc);
                                
        paging_init(mdesc);
        request_standard_resources(mdesc);
                
        if (mdesc->restart)
                arm_pm_restart = mdesc->restart;
        
        unflatten_device_tree();

On powerpc, unflatten_device_tree is called way before paging_init, so I assume
it has to be possible, but it might end up being harder to do than what you
have in mind with parsing the flat device tree.

	Arnd

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

* Re: [PATCH 0/8] Generic serial earlycon
@ 2014-03-22 22:01       ` Arnd Bergmann
  0 siblings, 0 replies; 90+ messages in thread
From: Arnd Bergmann @ 2014-03-22 22:01 UTC (permalink / raw)
  To: Rob Herring
  Cc: Russell King, Catalin Marinas, x86, Will Deacon, linux-kernel,
	linux-serial, Greg Kroah-Hartman, Jiri Slaby, linux-arm-kernel

On Saturday 22 March 2014, Rob Herring wrote:
> I think this series stands on its own. It is largely refactoring
> existing code and supporting existing command line options (arm64 just
> changes from earlyprintk= to earlycon=). There will be cases where
> changing the kernel command line is the only way to setup the
> earlycon. Also, I think we would still want the kernel command line to
> control whether or not we enable the earlycon (i.e. earlycon=dt).
> There's not a standard way for how bootloaders would decide to set
> "linux,stdout-path" or not.
> 
> The DT support won't be all that quick to implement. The challenge
> with the DT parsing is we have to do it on the flattened DT. I have
> something functioning, but it doesn't do any address translation which
> is the hard part.

Ah, I hadn't realized that we call parse_early_param() twice, both
in start_kernel() and before that in setup_arch(). You are right
that the first one of these can only look at the flat device tree
at the moment. I wonder if that's out of necessity or just coincidence
though.

There is relatively little going on between the first parse_early_param()
and the call to unflatten_device_tree(), so it may be possible to move
the former down, or the latter up.

        parse_early_param();

        sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);

        early_paging_init(mdesc, lookup_processor_type(read_cpuid_id()));
        setup_dma_zone(mdesc);  
        sanity_check_meminfo();
        arm_memblock_init(&meminfo, mdesc);
                                
        paging_init(mdesc);
        request_standard_resources(mdesc);
                
        if (mdesc->restart)
                arm_pm_restart = mdesc->restart;
        
        unflatten_device_tree();

On powerpc, unflatten_device_tree is called way before paging_init, so I assume
it has to be possible, but it might end up being harder to do than what you
have in mind with parsing the flat device tree.

	Arnd

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

* [PATCH 0/8] Generic serial earlycon
@ 2014-03-22 22:01       ` Arnd Bergmann
  0 siblings, 0 replies; 90+ messages in thread
From: Arnd Bergmann @ 2014-03-22 22:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Saturday 22 March 2014, Rob Herring wrote:
> I think this series stands on its own. It is largely refactoring
> existing code and supporting existing command line options (arm64 just
> changes from earlyprintk= to earlycon=). There will be cases where
> changing the kernel command line is the only way to setup the
> earlycon. Also, I think we would still want the kernel command line to
> control whether or not we enable the earlycon (i.e. earlycon=dt).
> There's not a standard way for how bootloaders would decide to set
> "linux,stdout-path" or not.
> 
> The DT support won't be all that quick to implement. The challenge
> with the DT parsing is we have to do it on the flattened DT. I have
> something functioning, but it doesn't do any address translation which
> is the hard part.

Ah, I hadn't realized that we call parse_early_param() twice, both
in start_kernel() and before that in setup_arch(). You are right
that the first one of these can only look at the flat device tree
at the moment. I wonder if that's out of necessity or just coincidence
though.

There is relatively little going on between the first parse_early_param()
and the call to unflatten_device_tree(), so it may be possible to move
the former down, or the latter up.

        parse_early_param();

        sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);

        early_paging_init(mdesc, lookup_processor_type(read_cpuid_id()));
        setup_dma_zone(mdesc);  
        sanity_check_meminfo();
        arm_memblock_init(&meminfo, mdesc);
                                
        paging_init(mdesc);
        request_standard_resources(mdesc);
                
        if (mdesc->restart)
                arm_pm_restart = mdesc->restart;
        
        unflatten_device_tree();

On powerpc, unflatten_device_tree is called way before paging_init, so I assume
it has to be possible, but it might end up being harder to do than what you
have in mind with parsing the flat device tree.

	Arnd

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

* Re: [PATCH 0/8] Generic serial earlycon
  2014-03-22 22:01       ` Arnd Bergmann
  (?)
@ 2014-03-23 15:09         ` Rob Herring
  -1 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-23 15:09 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Catalin Marinas, Russell King, Will Deacon, x86

On Sat, Mar 22, 2014 at 5:01 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Saturday 22 March 2014, Rob Herring wrote:
>> I think this series stands on its own. It is largely refactoring
>> existing code and supporting existing command line options (arm64 just
>> changes from earlyprintk= to earlycon=). There will be cases where
>> changing the kernel command line is the only way to setup the
>> earlycon. Also, I think we would still want the kernel command line to
>> control whether or not we enable the earlycon (i.e. earlycon=dt).
>> There's not a standard way for how bootloaders would decide to set
>> "linux,stdout-path" or not.
>>
>> The DT support won't be all that quick to implement. The challenge
>> with the DT parsing is we have to do it on the flattened DT. I have
>> something functioning, but it doesn't do any address translation which
>> is the hard part.
>
> Ah, I hadn't realized that we call parse_early_param() twice, both
> in start_kernel() and before that in setup_arch(). You are right
> that the first one of these can only look at the flat device tree
> at the moment. I wonder if that's out of necessity or just coincidence
> though.
>
> There is relatively little going on between the first parse_early_param()
> and the call to unflatten_device_tree(), so it may be possible to move
> the former down, or the latter up.
>
>         parse_early_param();
>
>         sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);
>
>         early_paging_init(mdesc, lookup_processor_type(read_cpuid_id()));
>         setup_dma_zone(mdesc);
>         sanity_check_meminfo();
>         arm_memblock_init(&meminfo, mdesc);
>
>         paging_init(mdesc);
>         request_standard_resources(mdesc);
>
>         if (mdesc->restart)
>                 arm_pm_restart = mdesc->restart;
>
>         unflatten_device_tree();
>
> On powerpc, unflatten_device_tree is called way before paging_init, so I assume
> it has to be possible, but it might end up being harder to do than what you
> have in mind with parsing the flat device tree.

IIRC, the unflattening cannot be done before memblock is up which is
in arm_memblock_init. I believe that will get done earlier similar to
PPC with Laura's meminfo removal series. However, in interest of
getting output enabled as early as possible, the earliest point is
always going to be with a flat tree. So I think we do want to be able
to parse the flat tree for this. There's code in u-boot to do the
address translation on FDT we can steal. Really, i'd like to put that
code in libfdt, but there's a licensing problem with the u-boot code
being GPL and libfdt being BSD.

Rob

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

* Re: [PATCH 0/8] Generic serial earlycon
@ 2014-03-23 15:09         ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-23 15:09 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Catalin Marinas, Russell King, Will Deacon, x86

On Sat, Mar 22, 2014 at 5:01 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Saturday 22 March 2014, Rob Herring wrote:
>> I think this series stands on its own. It is largely refactoring
>> existing code and supporting existing command line options (arm64 just
>> changes from earlyprintk= to earlycon=). There will be cases where
>> changing the kernel command line is the only way to setup the
>> earlycon. Also, I think we would still want the kernel command line to
>> control whether or not we enable the earlycon (i.e. earlycon=dt).
>> There's not a standard way for how bootloaders would decide to set
>> "linux,stdout-path" or not.
>>
>> The DT support won't be all that quick to implement. The challenge
>> with the DT parsing is we have to do it on the flattened DT. I have
>> something functioning, but it doesn't do any address translation which
>> is the hard part.
>
> Ah, I hadn't realized that we call parse_early_param() twice, both
> in start_kernel() and before that in setup_arch(). You are right
> that the first one of these can only look at the flat device tree
> at the moment. I wonder if that's out of necessity or just coincidence
> though.
>
> There is relatively little going on between the first parse_early_param()
> and the call to unflatten_device_tree(), so it may be possible to move
> the former down, or the latter up.
>
>         parse_early_param();
>
>         sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);
>
>         early_paging_init(mdesc, lookup_processor_type(read_cpuid_id()));
>         setup_dma_zone(mdesc);
>         sanity_check_meminfo();
>         arm_memblock_init(&meminfo, mdesc);
>
>         paging_init(mdesc);
>         request_standard_resources(mdesc);
>
>         if (mdesc->restart)
>                 arm_pm_restart = mdesc->restart;
>
>         unflatten_device_tree();
>
> On powerpc, unflatten_device_tree is called way before paging_init, so I assume
> it has to be possible, but it might end up being harder to do than what you
> have in mind with parsing the flat device tree.

IIRC, the unflattening cannot be done before memblock is up which is
in arm_memblock_init. I believe that will get done earlier similar to
PPC with Laura's meminfo removal series. However, in interest of
getting output enabled as early as possible, the earliest point is
always going to be with a flat tree. So I think we do want to be able
to parse the flat tree for this. There's code in u-boot to do the
address translation on FDT we can steal. Really, i'd like to put that
code in libfdt, but there's a licensing problem with the u-boot code
being GPL and libfdt being BSD.

Rob

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

* [PATCH 0/8] Generic serial earlycon
@ 2014-03-23 15:09         ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-23 15:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Mar 22, 2014 at 5:01 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Saturday 22 March 2014, Rob Herring wrote:
>> I think this series stands on its own. It is largely refactoring
>> existing code and supporting existing command line options (arm64 just
>> changes from earlyprintk= to earlycon=). There will be cases where
>> changing the kernel command line is the only way to setup the
>> earlycon. Also, I think we would still want the kernel command line to
>> control whether or not we enable the earlycon (i.e. earlycon=dt).
>> There's not a standard way for how bootloaders would decide to set
>> "linux,stdout-path" or not.
>>
>> The DT support won't be all that quick to implement. The challenge
>> with the DT parsing is we have to do it on the flattened DT. I have
>> something functioning, but it doesn't do any address translation which
>> is the hard part.
>
> Ah, I hadn't realized that we call parse_early_param() twice, both
> in start_kernel() and before that in setup_arch(). You are right
> that the first one of these can only look at the flat device tree
> at the moment. I wonder if that's out of necessity or just coincidence
> though.
>
> There is relatively little going on between the first parse_early_param()
> and the call to unflatten_device_tree(), so it may be possible to move
> the former down, or the latter up.
>
>         parse_early_param();
>
>         sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);
>
>         early_paging_init(mdesc, lookup_processor_type(read_cpuid_id()));
>         setup_dma_zone(mdesc);
>         sanity_check_meminfo();
>         arm_memblock_init(&meminfo, mdesc);
>
>         paging_init(mdesc);
>         request_standard_resources(mdesc);
>
>         if (mdesc->restart)
>                 arm_pm_restart = mdesc->restart;
>
>         unflatten_device_tree();
>
> On powerpc, unflatten_device_tree is called way before paging_init, so I assume
> it has to be possible, but it might end up being harder to do than what you
> have in mind with parsing the flat device tree.

IIRC, the unflattening cannot be done before memblock is up which is
in arm_memblock_init. I believe that will get done earlier similar to
PPC with Laura's meminfo removal series. However, in interest of
getting output enabled as early as possible, the earliest point is
always going to be with a flat tree. So I think we do want to be able
to parse the flat tree for this. There's code in u-boot to do the
address translation on FDT we can steal. Really, i'd like to put that
code in libfdt, but there's a licensing problem with the u-boot code
being GPL and libfdt being BSD.

Rob

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

* Re: [PATCH 0/8] Generic serial earlycon
  2014-03-23 15:09         ` Rob Herring
  (?)
@ 2014-03-23 19:49           ` Arnd Bergmann
  -1 siblings, 0 replies; 90+ messages in thread
From: Arnd Bergmann @ 2014-03-23 19:49 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Catalin Marinas, Russell King, Will Deacon, x86

On Sunday 23 March 2014, Rob Herring wrote:
> IIRC, the unflattening cannot be done before memblock is up which is
> in arm_memblock_init. I believe that will get done earlier similar to
> PPC with Laura's meminfo removal series. However, in interest of
> getting output enabled as early as possible, the earliest point is
> always going to be with a flat tree. So I think we do want to be able
> to parse the flat tree for this. There's code in u-boot to do the
> address translation on FDT we can steal. Really, i'd like to put that
> code in libfdt, but there's a licensing problem with the u-boot code
> being GPL and libfdt being BSD.

I suppose it depends on what the goal is. If you are trying to get as
close as possible to the debug_ll functionality without losing the
ability to turn it on unconditionally, I agree that it needs to be done
on the flat tree.

However, the goal that interests me more at the moment is to have
reliable debug output done in a simple way earlier than what we have
today with the normal console support. For this, it seems a better
tradeoff to initialize the early console slightly later. This
can actually be done independent of the the command line option,
I don't see any downsides from having a compile-time option that
would initialize the early console from setup_arch (after
unflatten_device_tree) whenever there is a linux,stdout-path
property that points to a usable device.

	Arnd

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

* Re: [PATCH 0/8] Generic serial earlycon
@ 2014-03-23 19:49           ` Arnd Bergmann
  0 siblings, 0 replies; 90+ messages in thread
From: Arnd Bergmann @ 2014-03-23 19:49 UTC (permalink / raw)
  To: Rob Herring
  Cc: Russell King, Catalin Marinas, x86, Will Deacon, linux-kernel,
	linux-serial, Greg Kroah-Hartman, Jiri Slaby, linux-arm-kernel

On Sunday 23 March 2014, Rob Herring wrote:
> IIRC, the unflattening cannot be done before memblock is up which is
> in arm_memblock_init. I believe that will get done earlier similar to
> PPC with Laura's meminfo removal series. However, in interest of
> getting output enabled as early as possible, the earliest point is
> always going to be with a flat tree. So I think we do want to be able
> to parse the flat tree for this. There's code in u-boot to do the
> address translation on FDT we can steal. Really, i'd like to put that
> code in libfdt, but there's a licensing problem with the u-boot code
> being GPL and libfdt being BSD.

I suppose it depends on what the goal is. If you are trying to get as
close as possible to the debug_ll functionality without losing the
ability to turn it on unconditionally, I agree that it needs to be done
on the flat tree.

However, the goal that interests me more at the moment is to have
reliable debug output done in a simple way earlier than what we have
today with the normal console support. For this, it seems a better
tradeoff to initialize the early console slightly later. This
can actually be done independent of the the command line option,
I don't see any downsides from having a compile-time option that
would initialize the early console from setup_arch (after
unflatten_device_tree) whenever there is a linux,stdout-path
property that points to a usable device.

	Arnd

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

* [PATCH 0/8] Generic serial earlycon
@ 2014-03-23 19:49           ` Arnd Bergmann
  0 siblings, 0 replies; 90+ messages in thread
From: Arnd Bergmann @ 2014-03-23 19:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Sunday 23 March 2014, Rob Herring wrote:
> IIRC, the unflattening cannot be done before memblock is up which is
> in arm_memblock_init. I believe that will get done earlier similar to
> PPC with Laura's meminfo removal series. However, in interest of
> getting output enabled as early as possible, the earliest point is
> always going to be with a flat tree. So I think we do want to be able
> to parse the flat tree for this. There's code in u-boot to do the
> address translation on FDT we can steal. Really, i'd like to put that
> code in libfdt, but there's a licensing problem with the u-boot code
> being GPL and libfdt being BSD.

I suppose it depends on what the goal is. If you are trying to get as
close as possible to the debug_ll functionality without losing the
ability to turn it on unconditionally, I agree that it needs to be done
on the flat tree.

However, the goal that interests me more at the moment is to have
reliable debug output done in a simple way earlier than what we have
today with the normal console support. For this, it seems a better
tradeoff to initialize the early console slightly later. This
can actually be done independent of the the command line option,
I don't see any downsides from having a compile-time option that
would initialize the early console from setup_arch (after
unflatten_device_tree) whenever there is a linux,stdout-path
property that points to a usable device.

	Arnd

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

* Re: [PATCH 7/8] tty/serial: add arm64 semihosting earlycon
  2014-03-21 21:08   ` Rob Herring
@ 2014-03-23 20:04     ` Nicolas Pitre
  -1 siblings, 0 replies; 90+ messages in thread
From: Nicolas Pitre @ 2014-03-23 20:04 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Catalin Marinas, Russell King, Will Deacon, x86,
	Arnd Bergmann, Rob Herring

On Fri, 21 Mar 2014, Rob Herring wrote:

> From: Rob Herring <robh@kernel.org>
> 
> Add earlycon support for the arm64 semihosting debug serial interface.
> This allows enabling a debug console when early_params are processed.
> This is based on the arm64 earlyprintk smh support and is intended to
> replace it.
> 
> This is named arm rather than arm64 in hopes it will be used for both,
> but only arm64 is supported ATM.

It can't be used for both as the semihosting calls themselves need 
assembly code and this is not compatible with the equivalent ARM32 
calls.  So I'd suggest naming this "arm64" to avoid potential confusion.

> Signed-off-by: Rob Herring <robh@kernel.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Jiri Slaby <jslaby@suse.cz>
> ---
>  Documentation/kernel-parameters.txt        |  1 +
>  drivers/tty/serial/Kconfig                 | 17 +++++++++---
>  drivers/tty/serial/Makefile                |  1 +
>  drivers/tty/serial/earlycon-arm-semihost.c | 44 ++++++++++++++++++++++++++++++
>  4 files changed, 59 insertions(+), 4 deletions(-)
>  create mode 100644 drivers/tty/serial/earlycon-arm-semihost.c
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 81bdd52..e96e2ba 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -888,6 +888,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>  		uart[8250],mmio,<addr>[,options]
>  		uart[8250],mmio32,<addr>[,options]
>  		pl011,<addr>
> +		smh
>  			Start an early, polled-mode console on a serial port
>  			at the specified I/O port or MMIO address. 8250
>  			MMIO inter-register address stride is either 8-bit
> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> index 1685189..8b8f40e 100644
> --- a/drivers/tty/serial/Kconfig
> +++ b/drivers/tty/serial/Kconfig
> @@ -14,6 +14,15 @@ config SERIAL_EARLYCON
>  	  the console before standard serial driver is probed. The console is
>  	  enabled when early_param is processed.
>  
> +config SERIAL_EARLYCON_ARM_SEMIHOST
> +	bool "Early console using ARM64 semihosting"
> +	depends on ARM64
> +	help
> +	  Support for early debug console using ARM64 semihosting. This enables
> +	  the console before standard serial driver is probed. This is enabled
> +	  with "earlycon=smh" on the kernel command line. The console is
> +	  enabled when early_param is processed.
> +
>  source "drivers/tty/serial/8250/Kconfig"
>  
>  comment "Non-8250 serial port support"
> @@ -230,7 +239,7 @@ config SERIAL_SAMSUNG_UARTS
>  	help
>  	  Select the number of available UART ports for the Samsung S3C
>  	  serial driver
> -	
> +
>  config SERIAL_SAMSUNG_DEBUG
>  	bool "Samsung SoC serial debug"
>  	depends on SERIAL_SAMSUNG && DEBUG_LL
> @@ -666,8 +675,8 @@ config PDC_CONSOLE
>  	depends on PARISC && !SERIAL_MUX && VT
>  	default n
>  	help
> -	  Saying Y here will enable the software based PDC console to be 
> -	  used as the system console.  This is useful for machines in 
> +	  Saying Y here will enable the software based PDC console to be
> +	  used as the system console.  This is useful for machines in
>  	  which the hardware based console has not been written yet.  The
>  	  following steps must be competed to use the PDC console:
>  
> @@ -858,7 +867,7 @@ config SERIAL_CPM
>  	depends on CPM2 || 8xx
>  	select SERIAL_CORE
>  	help
> -	  This driver supports the SCC and SMC serial ports on Motorola 
> +	  This driver supports the SCC and SMC serial ports on Motorola
>  	  embedded PowerPC that contain a CPM1 (8xx) or CPM2 (8xxx)
>  
>  config SERIAL_CPM_CONSOLE
> diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
> index 8af1415..9965b65 100644
> --- a/drivers/tty/serial/Makefile
> +++ b/drivers/tty/serial/Makefile
> @@ -6,6 +6,7 @@ obj-$(CONFIG_SERIAL_CORE) += serial_core.o
>  obj-$(CONFIG_SERIAL_21285) += 21285.o
>  
>  obj-$(CONFIG_SERIAL_EARLYCON) += earlycon.o
> +obj-$(CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST) += earlycon-arm-semihost.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-arm-semihost.c b/drivers/tty/serial/earlycon-arm-semihost.c
> new file mode 100644
> index 0000000..fecec9a
> --- /dev/null
> +++ b/drivers/tty/serial/earlycon-arm-semihost.c
> @@ -0,0 +1,44 @@
> +/*
> + * Copyright (C) 2012 ARM Ltd.
> + * Author: Catalin Marinas <catalin.marinas@arm.com>
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + */
> +#include <linux/kernel.h>
> +#include <linux/console.h>
> +#include <linux/init.h>
> +#include <linux/serial_core.h>
> +
> +/*
> + * Semihosting-based debug console
> + */
> +static void smh_putc(struct uart_port *port, int c)
> +{
> +	asm volatile("mov  x1, %0\n"
> +		     "mov  x0, #3\n"
> +		     "hlt  0xf000\n"
> +		     : : "r" (&c) : "x0", "x1", "memory");
> +}
> +
> +static void smh_write(struct console *con, const char *s, unsigned n)
> +{
> +	struct earlycon_device *dev = con->data;
> +	uart_console_write(&dev->port, s, n, smh_putc);
> +}
> +
> +int __init early_smh_setup(struct earlycon_device *device, const char *opt)
> +{
> +	device->con->write = smh_write;
> +	return 0;
> +}
> +EARLYCON_DECLARE(smh, early_smh_setup);
> -- 
> 1.8.3.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

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

* [PATCH 7/8] tty/serial: add arm64 semihosting earlycon
@ 2014-03-23 20:04     ` Nicolas Pitre
  0 siblings, 0 replies; 90+ messages in thread
From: Nicolas Pitre @ 2014-03-23 20:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 21 Mar 2014, Rob Herring wrote:

> From: Rob Herring <robh@kernel.org>
> 
> Add earlycon support for the arm64 semihosting debug serial interface.
> This allows enabling a debug console when early_params are processed.
> This is based on the arm64 earlyprintk smh support and is intended to
> replace it.
> 
> This is named arm rather than arm64 in hopes it will be used for both,
> but only arm64 is supported ATM.

It can't be used for both as the semihosting calls themselves need 
assembly code and this is not compatible with the equivalent ARM32 
calls.  So I'd suggest naming this "arm64" to avoid potential confusion.

> Signed-off-by: Rob Herring <robh@kernel.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Jiri Slaby <jslaby@suse.cz>
> ---
>  Documentation/kernel-parameters.txt        |  1 +
>  drivers/tty/serial/Kconfig                 | 17 +++++++++---
>  drivers/tty/serial/Makefile                |  1 +
>  drivers/tty/serial/earlycon-arm-semihost.c | 44 ++++++++++++++++++++++++++++++
>  4 files changed, 59 insertions(+), 4 deletions(-)
>  create mode 100644 drivers/tty/serial/earlycon-arm-semihost.c
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 81bdd52..e96e2ba 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -888,6 +888,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>  		uart[8250],mmio,<addr>[,options]
>  		uart[8250],mmio32,<addr>[,options]
>  		pl011,<addr>
> +		smh
>  			Start an early, polled-mode console on a serial port
>  			at the specified I/O port or MMIO address. 8250
>  			MMIO inter-register address stride is either 8-bit
> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> index 1685189..8b8f40e 100644
> --- a/drivers/tty/serial/Kconfig
> +++ b/drivers/tty/serial/Kconfig
> @@ -14,6 +14,15 @@ config SERIAL_EARLYCON
>  	  the console before standard serial driver is probed. The console is
>  	  enabled when early_param is processed.
>  
> +config SERIAL_EARLYCON_ARM_SEMIHOST
> +	bool "Early console using ARM64 semihosting"
> +	depends on ARM64
> +	help
> +	  Support for early debug console using ARM64 semihosting. This enables
> +	  the console before standard serial driver is probed. This is enabled
> +	  with "earlycon=smh" on the kernel command line. The console is
> +	  enabled when early_param is processed.
> +
>  source "drivers/tty/serial/8250/Kconfig"
>  
>  comment "Non-8250 serial port support"
> @@ -230,7 +239,7 @@ config SERIAL_SAMSUNG_UARTS
>  	help
>  	  Select the number of available UART ports for the Samsung S3C
>  	  serial driver
> -	
> +
>  config SERIAL_SAMSUNG_DEBUG
>  	bool "Samsung SoC serial debug"
>  	depends on SERIAL_SAMSUNG && DEBUG_LL
> @@ -666,8 +675,8 @@ config PDC_CONSOLE
>  	depends on PARISC && !SERIAL_MUX && VT
>  	default n
>  	help
> -	  Saying Y here will enable the software based PDC console to be 
> -	  used as the system console.  This is useful for machines in 
> +	  Saying Y here will enable the software based PDC console to be
> +	  used as the system console.  This is useful for machines in
>  	  which the hardware based console has not been written yet.  The
>  	  following steps must be competed to use the PDC console:
>  
> @@ -858,7 +867,7 @@ config SERIAL_CPM
>  	depends on CPM2 || 8xx
>  	select SERIAL_CORE
>  	help
> -	  This driver supports the SCC and SMC serial ports on Motorola 
> +	  This driver supports the SCC and SMC serial ports on Motorola
>  	  embedded PowerPC that contain a CPM1 (8xx) or CPM2 (8xxx)
>  
>  config SERIAL_CPM_CONSOLE
> diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
> index 8af1415..9965b65 100644
> --- a/drivers/tty/serial/Makefile
> +++ b/drivers/tty/serial/Makefile
> @@ -6,6 +6,7 @@ obj-$(CONFIG_SERIAL_CORE) += serial_core.o
>  obj-$(CONFIG_SERIAL_21285) += 21285.o
>  
>  obj-$(CONFIG_SERIAL_EARLYCON) += earlycon.o
> +obj-$(CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST) += earlycon-arm-semihost.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-arm-semihost.c b/drivers/tty/serial/earlycon-arm-semihost.c
> new file mode 100644
> index 0000000..fecec9a
> --- /dev/null
> +++ b/drivers/tty/serial/earlycon-arm-semihost.c
> @@ -0,0 +1,44 @@
> +/*
> + * Copyright (C) 2012 ARM Ltd.
> + * Author: Catalin Marinas <catalin.marinas@arm.com>
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + */
> +#include <linux/kernel.h>
> +#include <linux/console.h>
> +#include <linux/init.h>
> +#include <linux/serial_core.h>
> +
> +/*
> + * Semihosting-based debug console
> + */
> +static void smh_putc(struct uart_port *port, int c)
> +{
> +	asm volatile("mov  x1, %0\n"
> +		     "mov  x0, #3\n"
> +		     "hlt  0xf000\n"
> +		     : : "r" (&c) : "x0", "x1", "memory");
> +}
> +
> +static void smh_write(struct console *con, const char *s, unsigned n)
> +{
> +	struct earlycon_device *dev = con->data;
> +	uart_console_write(&dev->port, s, n, smh_putc);
> +}
> +
> +int __init early_smh_setup(struct earlycon_device *device, const char *opt)
> +{
> +	device->con->write = smh_write;
> +	return 0;
> +}
> +EARLYCON_DECLARE(smh, early_smh_setup);
> -- 
> 1.8.3.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

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

* Re: [PATCH 7/8] tty/serial: add arm64 semihosting earlycon
  2014-03-23 20:04     ` Nicolas Pitre
@ 2014-03-23 20:23       ` Arnd Bergmann
  -1 siblings, 0 replies; 90+ messages in thread
From: Arnd Bergmann @ 2014-03-23 20:23 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Nicolas Pitre, Rob Herring, Rob Herring, Russell King,
	Catalin Marinas, x86, Will Deacon, linux-kernel, linux-serial,
	Greg Kroah-Hartman, Jiri Slaby

On Sunday 23 March 2014 16:04:41 Nicolas Pitre wrote:
> On Fri, 21 Mar 2014, Rob Herring wrote:
> 
> > From: Rob Herring <robh@kernel.org>
> > 
> > Add earlycon support for the arm64 semihosting debug serial interface.
> > This allows enabling a debug console when early_params are processed.
> > This is based on the arm64 earlyprintk smh support and is intended to
> > replace it.
> > 
> > This is named arm rather than arm64 in hopes it will be used for both,
> > but only arm64 is supported ATM.
> 
> It can't be used for both as the semihosting calls themselves need 
> assembly code and this is not compatible with the equivalent ARM32 
> calls.  So I'd suggest naming this "arm64" to avoid potential confusion.

How about using an compile-time conditional to put both inline assemblies
in there? While the driver is rather trivial to start with, I don't see
a point in duplicating it either.

	Arnd

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

* [PATCH 7/8] tty/serial: add arm64 semihosting earlycon
@ 2014-03-23 20:23       ` Arnd Bergmann
  0 siblings, 0 replies; 90+ messages in thread
From: Arnd Bergmann @ 2014-03-23 20:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Sunday 23 March 2014 16:04:41 Nicolas Pitre wrote:
> On Fri, 21 Mar 2014, Rob Herring wrote:
> 
> > From: Rob Herring <robh@kernel.org>
> > 
> > Add earlycon support for the arm64 semihosting debug serial interface.
> > This allows enabling a debug console when early_params are processed.
> > This is based on the arm64 earlyprintk smh support and is intended to
> > replace it.
> > 
> > This is named arm rather than arm64 in hopes it will be used for both,
> > but only arm64 is supported ATM.
> 
> It can't be used for both as the semihosting calls themselves need 
> assembly code and this is not compatible with the equivalent ARM32 
> calls.  So I'd suggest naming this "arm64" to avoid potential confusion.

How about using an compile-time conditional to put both inline assemblies
in there? While the driver is rather trivial to start with, I don't see
a point in duplicating it either.

	Arnd

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

* Re: [PATCH 7/8] tty/serial: add arm64 semihosting earlycon
  2014-03-23 20:23       ` Arnd Bergmann
@ 2014-03-23 21:48         ` Nicolas Pitre
  -1 siblings, 0 replies; 90+ messages in thread
From: Nicolas Pitre @ 2014-03-23 21:48 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, Rob Herring, Rob Herring, Russell King,
	Catalin Marinas, x86, Will Deacon, linux-kernel, linux-serial,
	Greg Kroah-Hartman, Jiri Slaby

On Sun, 23 Mar 2014, Arnd Bergmann wrote:

> On Sunday 23 March 2014 16:04:41 Nicolas Pitre wrote:
> > On Fri, 21 Mar 2014, Rob Herring wrote:
> > 
> > > From: Rob Herring <robh@kernel.org>
> > > 
> > > Add earlycon support for the arm64 semihosting debug serial interface.
> > > This allows enabling a debug console when early_params are processed.
> > > This is based on the arm64 earlyprintk smh support and is intended to
> > > replace it.
> > > 
> > > This is named arm rather than arm64 in hopes it will be used for both,
> > > but only arm64 is supported ATM.
> > 
> > It can't be used for both as the semihosting calls themselves need 
> > assembly code and this is not compatible with the equivalent ARM32 
> > calls.  So I'd suggest naming this "arm64" to avoid potential confusion.
> 
> How about using an compile-time conditional to put both inline assemblies
> in there? While the driver is rather trivial to start with, I don't see
> a point in duplicating it either.

Sure.  But it can be trivially renamed at that point.

Or, even better would be to add the ARM calls right away.  And of course 
ARM in Thumb mode has yet another call convention.

The printascii and printch code in arch/arm/kernel/debug.S for
CONFIG_DEBUG_SEMIHOSTING can be copied almost as is.


Nicolas

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

* [PATCH 7/8] tty/serial: add arm64 semihosting earlycon
@ 2014-03-23 21:48         ` Nicolas Pitre
  0 siblings, 0 replies; 90+ messages in thread
From: Nicolas Pitre @ 2014-03-23 21:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, 23 Mar 2014, Arnd Bergmann wrote:

> On Sunday 23 March 2014 16:04:41 Nicolas Pitre wrote:
> > On Fri, 21 Mar 2014, Rob Herring wrote:
> > 
> > > From: Rob Herring <robh@kernel.org>
> > > 
> > > Add earlycon support for the arm64 semihosting debug serial interface.
> > > This allows enabling a debug console when early_params are processed.
> > > This is based on the arm64 earlyprintk smh support and is intended to
> > > replace it.
> > > 
> > > This is named arm rather than arm64 in hopes it will be used for both,
> > > but only arm64 is supported ATM.
> > 
> > It can't be used for both as the semihosting calls themselves need 
> > assembly code and this is not compatible with the equivalent ARM32 
> > calls.  So I'd suggest naming this "arm64" to avoid potential confusion.
> 
> How about using an compile-time conditional to put both inline assemblies
> in there? While the driver is rather trivial to start with, I don't see
> a point in duplicating it either.

Sure.  But it can be trivially renamed at that point.

Or, even better would be to add the ARM calls right away.  And of course 
ARM in Thumb mode has yet another call convention.

The printascii and printch code in arch/arm/kernel/debug.S for
CONFIG_DEBUG_SEMIHOSTING can be copied almost as is.


Nicolas

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

* Re: [PATCH 2/8] arm64: add FIXMAP_PAGE_NOCACHE definition
  2014-03-21 21:08   ` Rob Herring
  (?)
@ 2014-03-24 11:13     ` Catalin Marinas
  -1 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-03-24 11:13 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Russell King, Will Deacon, x86, Arnd Bergmann,
	Rob Herring

On Fri, Mar 21, 2014 at 09:08:42PM +0000, Rob Herring wrote:
> From: Rob Herring <robh@kernel.org>
> 
> Similar to ioremap and ioremap_nocache, we want the same definition for
> both using PROT_DEVICE_nGnRE.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

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

* Re: [PATCH 2/8] arm64: add FIXMAP_PAGE_NOCACHE definition
@ 2014-03-24 11:13     ` Catalin Marinas
  0 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-03-24 11:13 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Russell King, Will Deacon, x86, Arnd Bergmann,
	Rob Herring

On Fri, Mar 21, 2014 at 09:08:42PM +0000, Rob Herring wrote:
> From: Rob Herring <robh@kernel.org>
> 
> Similar to ioremap and ioremap_nocache, we want the same definition for
> both using PROT_DEVICE_nGnRE.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

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

* [PATCH 2/8] arm64: add FIXMAP_PAGE_NOCACHE definition
@ 2014-03-24 11:13     ` Catalin Marinas
  0 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-03-24 11:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 21, 2014 at 09:08:42PM +0000, Rob Herring wrote:
> From: Rob Herring <robh@kernel.org>
> 
> Similar to ioremap and ioremap_nocache, we want the same definition for
> both using PROT_DEVICE_nGnRE.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

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

* Re: [PATCH 4/8] tty/serial: add generic serial earlycon
  2014-03-21 21:08   ` Rob Herring
  (?)
@ 2014-03-24 11:22     ` Catalin Marinas
  -1 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-03-24 11:22 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Russell King, Will Deacon, x86, Arnd Bergmann,
	Rob Herring

On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote:
> diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
> new file mode 100644
> index 0000000..241757a
> --- /dev/null
> +++ b/drivers/tty/serial/earlycon.c
[...]
> +static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
> +{
> +	void __iomem *base;
> +#ifdef CONFIG_FIX_EARLYCON_MEM
> +	set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK);
> +	base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
> +	base += paddr & ~PAGE_MASK;
> +#else
> +	base = ioremap_nocache(paddr, size);
> +#endif

Just curious why not set_fixmap_io (and plain ioremap)?

> +static int __init parse_options(struct earlycon_device *device,
> +				char *options)
> +{
[...]
> +	if (port->mapbase)
> +		port->membase = earlycon_map(port->mapbase, 64);

I would move the earlycon_map() call in setup_earlycon() (personal
preference, parse_options() implies just parsing the options rather than
having additional side-effects).

-- 
Catalin

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

* Re: [PATCH 4/8] tty/serial: add generic serial earlycon
@ 2014-03-24 11:22     ` Catalin Marinas
  0 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-03-24 11:22 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Russell King, Will Deacon, x86, Arnd Bergmann,
	Rob Herring

On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote:
> diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
> new file mode 100644
> index 0000000..241757a
> --- /dev/null
> +++ b/drivers/tty/serial/earlycon.c
[...]
> +static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
> +{
> +	void __iomem *base;
> +#ifdef CONFIG_FIX_EARLYCON_MEM
> +	set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK);
> +	base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
> +	base += paddr & ~PAGE_MASK;
> +#else
> +	base = ioremap_nocache(paddr, size);
> +#endif

Just curious why not set_fixmap_io (and plain ioremap)?

> +static int __init parse_options(struct earlycon_device *device,
> +				char *options)
> +{
[...]
> +	if (port->mapbase)
> +		port->membase = earlycon_map(port->mapbase, 64);

I would move the earlycon_map() call in setup_earlycon() (personal
preference, parse_options() implies just parsing the options rather than
having additional side-effects).

-- 
Catalin

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

* [PATCH 4/8] tty/serial: add generic serial earlycon
@ 2014-03-24 11:22     ` Catalin Marinas
  0 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-03-24 11:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote:
> diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
> new file mode 100644
> index 0000000..241757a
> --- /dev/null
> +++ b/drivers/tty/serial/earlycon.c
[...]
> +static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
> +{
> +	void __iomem *base;
> +#ifdef CONFIG_FIX_EARLYCON_MEM
> +	set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK);
> +	base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
> +	base += paddr & ~PAGE_MASK;
> +#else
> +	base = ioremap_nocache(paddr, size);
> +#endif

Just curious why not set_fixmap_io (and plain ioremap)?

> +static int __init parse_options(struct earlycon_device *device,
> +				char *options)
> +{
[...]
> +	if (port->mapbase)
> +		port->membase = earlycon_map(port->mapbase, 64);

I would move the earlycon_map() call in setup_earlycon() (personal
preference, parse_options() implies just parsing the options rather than
having additional side-effects).

-- 
Catalin

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

* Re: [PATCH 6/8] tty/serial: pl011: add generic earlycon support
  2014-03-21 21:08   ` Rob Herring
  (?)
@ 2014-03-24 11:28     ` Catalin Marinas
  -1 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-03-24 11:28 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Russell King, Will Deacon, x86, Arnd Bergmann,
	Rob Herring

On Fri, Mar 21, 2014 at 09:08:46PM +0000, Rob Herring wrote:
> From: Rob Herring <robh@kernel.org>
> 
> Add earlycon support for the pl011 serial port. This allows enabling
> the pl011 for console when early_params are processed. This is based
> on the arm64 earlyprintk support and is intended to replace it.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Jiri Slaby <jslaby@suse.cz>
> ---
>  Documentation/kernel-parameters.txt |  5 +++--
>  drivers/tty/serial/amba-pl011.c     | 30 +++++++++++++++++++++++++++++-
>  2 files changed, 32 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 5ce8b7a..81bdd52 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -887,8 +887,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>  		uart[8250],io,<addr>[,options]
>  		uart[8250],mmio,<addr>[,options]
>  		uart[8250],mmio32,<addr>[,options]
> -			Start an early, polled-mode console on the 8250/16550
> -			UART at the specified I/O port or MMIO address.
> +		pl011,<addr>
> +			Start an early, polled-mode console on a serial port
> +			at the specified I/O port or MMIO address. 8250
>  			MMIO inter-register address stride is either 8-bit
>  			(mmio) or 32-bit (mmio32).
>  			The options are the same as for ttyS, above.

I think the last line is a bit misleading. Or did you intend to leave it
with the uart[8250] parameter? See below:

> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> index d4eda24..4227c0a 100644
> --- a/drivers/tty/serial/amba-pl011.c
> +++ b/drivers/tty/serial/amba-pl011.c
[...]
> +static int __init pl011_early_console_setup(struct earlycon_device *device,
> +					    const char *opt)
> +{
> +	if (!device->port.membase)
> +		return -ENODEV;
> +
> +	device->con->write = pl011_early_write;
> +	return 0;
> +}
> +EARLYCON_DECLARE(pl011, pl011_early_console_setup);

Here we expect the PL011 to be already initialised by the boot loader
and the kernel continues using the same settings. So maybe clarify this
in the pl011 kernel parameter doc and we can add proper configuration
using a separate patch.

-- 
Catalin

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

* Re: [PATCH 6/8] tty/serial: pl011: add generic earlycon support
@ 2014-03-24 11:28     ` Catalin Marinas
  0 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-03-24 11:28 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Russell King, Will Deacon, x86, Arnd Bergmann,
	Rob Herring

On Fri, Mar 21, 2014 at 09:08:46PM +0000, Rob Herring wrote:
> From: Rob Herring <robh@kernel.org>
> 
> Add earlycon support for the pl011 serial port. This allows enabling
> the pl011 for console when early_params are processed. This is based
> on the arm64 earlyprintk support and is intended to replace it.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Jiri Slaby <jslaby@suse.cz>
> ---
>  Documentation/kernel-parameters.txt |  5 +++--
>  drivers/tty/serial/amba-pl011.c     | 30 +++++++++++++++++++++++++++++-
>  2 files changed, 32 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 5ce8b7a..81bdd52 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -887,8 +887,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>  		uart[8250],io,<addr>[,options]
>  		uart[8250],mmio,<addr>[,options]
>  		uart[8250],mmio32,<addr>[,options]
> -			Start an early, polled-mode console on the 8250/16550
> -			UART at the specified I/O port or MMIO address.
> +		pl011,<addr>
> +			Start an early, polled-mode console on a serial port
> +			at the specified I/O port or MMIO address. 8250
>  			MMIO inter-register address stride is either 8-bit
>  			(mmio) or 32-bit (mmio32).
>  			The options are the same as for ttyS, above.

I think the last line is a bit misleading. Or did you intend to leave it
with the uart[8250] parameter? See below:

> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> index d4eda24..4227c0a 100644
> --- a/drivers/tty/serial/amba-pl011.c
> +++ b/drivers/tty/serial/amba-pl011.c
[...]
> +static int __init pl011_early_console_setup(struct earlycon_device *device,
> +					    const char *opt)
> +{
> +	if (!device->port.membase)
> +		return -ENODEV;
> +
> +	device->con->write = pl011_early_write;
> +	return 0;
> +}
> +EARLYCON_DECLARE(pl011, pl011_early_console_setup);

Here we expect the PL011 to be already initialised by the boot loader
and the kernel continues using the same settings. So maybe clarify this
in the pl011 kernel parameter doc and we can add proper configuration
using a separate patch.

-- 
Catalin

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

* [PATCH 6/8] tty/serial: pl011: add generic earlycon support
@ 2014-03-24 11:28     ` Catalin Marinas
  0 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-03-24 11:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 21, 2014 at 09:08:46PM +0000, Rob Herring wrote:
> From: Rob Herring <robh@kernel.org>
> 
> Add earlycon support for the pl011 serial port. This allows enabling
> the pl011 for console when early_params are processed. This is based
> on the arm64 earlyprintk support and is intended to replace it.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Jiri Slaby <jslaby@suse.cz>
> ---
>  Documentation/kernel-parameters.txt |  5 +++--
>  drivers/tty/serial/amba-pl011.c     | 30 +++++++++++++++++++++++++++++-
>  2 files changed, 32 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 5ce8b7a..81bdd52 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -887,8 +887,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>  		uart[8250],io,<addr>[,options]
>  		uart[8250],mmio,<addr>[,options]
>  		uart[8250],mmio32,<addr>[,options]
> -			Start an early, polled-mode console on the 8250/16550
> -			UART at the specified I/O port or MMIO address.
> +		pl011,<addr>
> +			Start an early, polled-mode console on a serial port
> +			at the specified I/O port or MMIO address. 8250
>  			MMIO inter-register address stride is either 8-bit
>  			(mmio) or 32-bit (mmio32).
>  			The options are the same as for ttyS, above.

I think the last line is a bit misleading. Or did you intend to leave it
with the uart[8250] parameter? See below:

> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> index d4eda24..4227c0a 100644
> --- a/drivers/tty/serial/amba-pl011.c
> +++ b/drivers/tty/serial/amba-pl011.c
[...]
> +static int __init pl011_early_console_setup(struct earlycon_device *device,
> +					    const char *opt)
> +{
> +	if (!device->port.membase)
> +		return -ENODEV;
> +
> +	device->con->write = pl011_early_write;
> +	return 0;
> +}
> +EARLYCON_DECLARE(pl011, pl011_early_console_setup);

Here we expect the PL011 to be already initialised by the boot loader
and the kernel continues using the same settings. So maybe clarify this
in the pl011 kernel parameter doc and we can add proper configuration
using a separate patch.

-- 
Catalin

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

* Re: [PATCH 4/8] tty/serial: add generic serial earlycon
  2014-03-24 11:22     ` Catalin Marinas
@ 2014-03-24 11:29       ` Arnd Bergmann
  -1 siblings, 0 replies; 90+ messages in thread
From: Arnd Bergmann @ 2014-03-24 11:29 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Catalin Marinas, Rob Herring, Rob Herring, Russell King,
	Greg Kroah-Hartman, x86, Will Deacon, linux-kernel, linux-serial,
	Jiri Slaby

On Monday 24 March 2014 11:22:03 Catalin Marinas wrote:
> On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote:
> > diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
> > new file mode 100644
> > index 0000000..241757a
> > --- /dev/null
> > +++ b/drivers/tty/serial/earlycon.c
> [...]
> > +static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
> > +{
> > +	void __iomem *base;
> > +#ifdef CONFIG_FIX_EARLYCON_MEM
> > +	set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK);
> > +	base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
> > +	base += paddr & ~PAGE_MASK;
> > +#else
> > +	base = ioremap_nocache(paddr, size);
> > +#endif
> 
> Just curious why not set_fixmap_io (and plain ioremap)?

Good point. Note that ioremap_nocache() is the same as ioremap()
on *all* architectures.

	Arnd

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

* [PATCH 4/8] tty/serial: add generic serial earlycon
@ 2014-03-24 11:29       ` Arnd Bergmann
  0 siblings, 0 replies; 90+ messages in thread
From: Arnd Bergmann @ 2014-03-24 11:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 24 March 2014 11:22:03 Catalin Marinas wrote:
> On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote:
> > diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
> > new file mode 100644
> > index 0000000..241757a
> > --- /dev/null
> > +++ b/drivers/tty/serial/earlycon.c
> [...]
> > +static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
> > +{
> > +	void __iomem *base;
> > +#ifdef CONFIG_FIX_EARLYCON_MEM
> > +	set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK);
> > +	base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
> > +	base += paddr & ~PAGE_MASK;
> > +#else
> > +	base = ioremap_nocache(paddr, size);
> > +#endif
> 
> Just curious why not set_fixmap_io (and plain ioremap)?

Good point. Note that ioremap_nocache() is the same as ioremap()
on *all* architectures.

	Arnd

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

* Re: [PATCH 7/8] tty/serial: add arm64 semihosting earlycon
  2014-03-21 21:08   ` Rob Herring
  (?)
@ 2014-03-24 11:38     ` Catalin Marinas
  -1 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-03-24 11:38 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Russell King, Will Deacon, x86, Arnd Bergmann,
	Rob Herring

On Fri, Mar 21, 2014 at 09:08:47PM +0000, Rob Herring wrote:
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 81bdd52..e96e2ba 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -888,6 +888,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>  		uart[8250],mmio,<addr>[,options]
>  		uart[8250],mmio32,<addr>[,options]
>  		pl011,<addr>
> +		smh
>  			Start an early, polled-mode console on a serial port
>  			at the specified I/O port or MMIO address. 8250
>  			MMIO inter-register address stride is either 8-bit

Same comment as per a previous patch, "smh" does not take any parameters
at all here.

> --- /dev/null
> +++ b/drivers/tty/serial/earlycon-arm-semihost.c
> @@ -0,0 +1,44 @@
> +/*
> + * Copyright (C) 2012 ARM Ltd.
> + * Author: Catalin Marinas <catalin.marinas@arm.com>

Nitpick: author should be Mark Zyngier <marc.zyngier@arm.com> as per
commit 0492f72508184 (arm64: early_printk: add support for FastModel
console output)

-- 
Catalin

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

* Re: [PATCH 7/8] tty/serial: add arm64 semihosting earlycon
@ 2014-03-24 11:38     ` Catalin Marinas
  0 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-03-24 11:38 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Russell King, Will Deacon, x86, Arnd Bergmann,
	Rob Herring

On Fri, Mar 21, 2014 at 09:08:47PM +0000, Rob Herring wrote:
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 81bdd52..e96e2ba 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -888,6 +888,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>  		uart[8250],mmio,<addr>[,options]
>  		uart[8250],mmio32,<addr>[,options]
>  		pl011,<addr>
> +		smh
>  			Start an early, polled-mode console on a serial port
>  			at the specified I/O port or MMIO address. 8250
>  			MMIO inter-register address stride is either 8-bit

Same comment as per a previous patch, "smh" does not take any parameters
at all here.

> --- /dev/null
> +++ b/drivers/tty/serial/earlycon-arm-semihost.c
> @@ -0,0 +1,44 @@
> +/*
> + * Copyright (C) 2012 ARM Ltd.
> + * Author: Catalin Marinas <catalin.marinas@arm.com>

Nitpick: author should be Mark Zyngier <marc.zyngier@arm.com> as per
commit 0492f72508184 (arm64: early_printk: add support for FastModel
console output)

-- 
Catalin

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

* [PATCH 7/8] tty/serial: add arm64 semihosting earlycon
@ 2014-03-24 11:38     ` Catalin Marinas
  0 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-03-24 11:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 21, 2014 at 09:08:47PM +0000, Rob Herring wrote:
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 81bdd52..e96e2ba 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -888,6 +888,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>  		uart[8250],mmio,<addr>[,options]
>  		uart[8250],mmio32,<addr>[,options]
>  		pl011,<addr>
> +		smh
>  			Start an early, polled-mode console on a serial port
>  			at the specified I/O port or MMIO address. 8250
>  			MMIO inter-register address stride is either 8-bit

Same comment as per a previous patch, "smh" does not take any parameters
at all here.

> --- /dev/null
> +++ b/drivers/tty/serial/earlycon-arm-semihost.c
> @@ -0,0 +1,44 @@
> +/*
> + * Copyright (C) 2012 ARM Ltd.
> + * Author: Catalin Marinas <catalin.marinas@arm.com>

Nitpick: author should be Mark Zyngier <marc.zyngier@arm.com> as per
commit 0492f72508184 (arm64: early_printk: add support for FastModel
console output)

-- 
Catalin

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

* Re: [PATCH 3/8] arm64: enable FIX_EARLYCON_MEM kconfig
  2014-03-21 21:08   ` Rob Herring
  (?)
@ 2014-03-24 11:38     ` Catalin Marinas
  -1 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-03-24 11:38 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Russell King, Will Deacon, x86, Arnd Bergmann,
	Rob Herring

On Fri, Mar 21, 2014 at 09:08:43PM +0000, Rob Herring wrote:
> From: Rob Herring <robh@kernel.org>
> 
> In order to support earlycon on arm64, we need to enable earlycon fixmap
> support.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

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

* Re: [PATCH 3/8] arm64: enable FIX_EARLYCON_MEM kconfig
@ 2014-03-24 11:38     ` Catalin Marinas
  0 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-03-24 11:38 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Russell King, Will Deacon, x86, Arnd Bergmann,
	Rob Herring

On Fri, Mar 21, 2014 at 09:08:43PM +0000, Rob Herring wrote:
> From: Rob Herring <robh@kernel.org>
> 
> In order to support earlycon on arm64, we need to enable earlycon fixmap
> support.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

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

* [PATCH 3/8] arm64: enable FIX_EARLYCON_MEM kconfig
@ 2014-03-24 11:38     ` Catalin Marinas
  0 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-03-24 11:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 21, 2014 at 09:08:43PM +0000, Rob Herring wrote:
> From: Rob Herring <robh@kernel.org>
> 
> In order to support earlycon on arm64, we need to enable earlycon fixmap
> support.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

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

* Re: [PATCH 7/8] tty/serial: add arm64 semihosting earlycon
  2014-03-24 11:38     ` Catalin Marinas
  (?)
@ 2014-03-24 11:48       ` Catalin Marinas
  -1 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-03-24 11:48 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Russell King, Will Deacon, x86, Arnd Bergmann,
	Rob Herring

On Mon, Mar 24, 2014 at 11:38:21AM +0000, Catalin Marinas wrote:
> On Fri, Mar 21, 2014 at 09:08:47PM +0000, Rob Herring wrote:
> > --- /dev/null
> > +++ b/drivers/tty/serial/earlycon-arm-semihost.c
> > @@ -0,0 +1,44 @@
> > +/*
> > + * Copyright (C) 2012 ARM Ltd.
> > + * Author: Catalin Marinas <catalin.marinas@arm.com>
> 
> Nitpick: author should be Mark Zyngier <marc.zyngier@arm.com> 

And a typo in my email: s/Mark/Marc/.

Thanks.

-- 
Catalin

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

* Re: [PATCH 7/8] tty/serial: add arm64 semihosting earlycon
@ 2014-03-24 11:48       ` Catalin Marinas
  0 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-03-24 11:48 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Russell King, Will Deacon, x86, Arnd Bergmann,
	Rob Herring

On Mon, Mar 24, 2014 at 11:38:21AM +0000, Catalin Marinas wrote:
> On Fri, Mar 21, 2014 at 09:08:47PM +0000, Rob Herring wrote:
> > --- /dev/null
> > +++ b/drivers/tty/serial/earlycon-arm-semihost.c
> > @@ -0,0 +1,44 @@
> > +/*
> > + * Copyright (C) 2012 ARM Ltd.
> > + * Author: Catalin Marinas <catalin.marinas@arm.com>
> 
> Nitpick: author should be Mark Zyngier <marc.zyngier@arm.com> 

And a typo in my email: s/Mark/Marc/.

Thanks.

-- 
Catalin

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

* [PATCH 7/8] tty/serial: add arm64 semihosting earlycon
@ 2014-03-24 11:48       ` Catalin Marinas
  0 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-03-24 11:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 24, 2014 at 11:38:21AM +0000, Catalin Marinas wrote:
> On Fri, Mar 21, 2014 at 09:08:47PM +0000, Rob Herring wrote:
> > --- /dev/null
> > +++ b/drivers/tty/serial/earlycon-arm-semihost.c
> > @@ -0,0 +1,44 @@
> > +/*
> > + * Copyright (C) 2012 ARM Ltd.
> > + * Author: Catalin Marinas <catalin.marinas@arm.com>
> 
> Nitpick: author should be Mark Zyngier <marc.zyngier@arm.com> 

And a typo in my email: s/Mark/Marc/.

Thanks.

-- 
Catalin

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

* Re: [PATCH 4/8] tty/serial: add generic serial earlycon
  2014-03-24 11:29       ` Arnd Bergmann
  (?)
@ 2014-03-24 13:36         ` Rob Herring
  -1 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-24 13:36 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, Catalin Marinas, Russell King,
	Greg Kroah-Hartman, x86, Will Deacon, linux-kernel, linux-serial,
	Jiri Slaby

On Mon, Mar 24, 2014 at 6:29 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Monday 24 March 2014 11:22:03 Catalin Marinas wrote:
>> On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote:
>> > diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
>> > new file mode 100644
>> > index 0000000..241757a
>> > --- /dev/null
>> > +++ b/drivers/tty/serial/earlycon.c
>> [...]
>> > +static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
>> > +{
>> > +   void __iomem *base;
>> > +#ifdef CONFIG_FIX_EARLYCON_MEM
>> > +   set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK);
>> > +   base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
>> > +   base += paddr & ~PAGE_MASK;
>> > +#else
>> > +   base = ioremap_nocache(paddr, size);
>> > +#endif
>>
>> Just curious why not set_fixmap_io (and plain ioremap)?
>
> Good point. Note that ioremap_nocache() is the same as ioremap()
> on *all* architectures.

I investigated this before adding this to arm64. set_fixmap_io and
set_fixmap_nocache are not the same settings on x86. Whether the
mapping type really matters on x86 or not, I don't know. So I added
the nocache variant to arm64 to avoid a change to x86.

Rob

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

* Re: [PATCH 4/8] tty/serial: add generic serial earlycon
@ 2014-03-24 13:36         ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-24 13:36 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, Catalin Marinas, Russell King,
	Greg Kroah-Hartman, x86, Will Deacon, linux-kernel, linux-serial,
	Jiri Slaby

On Mon, Mar 24, 2014 at 6:29 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Monday 24 March 2014 11:22:03 Catalin Marinas wrote:
>> On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote:
>> > diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
>> > new file mode 100644
>> > index 0000000..241757a
>> > --- /dev/null
>> > +++ b/drivers/tty/serial/earlycon.c
>> [...]
>> > +static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
>> > +{
>> > +   void __iomem *base;
>> > +#ifdef CONFIG_FIX_EARLYCON_MEM
>> > +   set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK);
>> > +   base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
>> > +   base += paddr & ~PAGE_MASK;
>> > +#else
>> > +   base = ioremap_nocache(paddr, size);
>> > +#endif
>>
>> Just curious why not set_fixmap_io (and plain ioremap)?
>
> Good point. Note that ioremap_nocache() is the same as ioremap()
> on *all* architectures.

I investigated this before adding this to arm64. set_fixmap_io and
set_fixmap_nocache are not the same settings on x86. Whether the
mapping type really matters on x86 or not, I don't know. So I added
the nocache variant to arm64 to avoid a change to x86.

Rob

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

* [PATCH 4/8] tty/serial: add generic serial earlycon
@ 2014-03-24 13:36         ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-24 13:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 24, 2014 at 6:29 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Monday 24 March 2014 11:22:03 Catalin Marinas wrote:
>> On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote:
>> > diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
>> > new file mode 100644
>> > index 0000000..241757a
>> > --- /dev/null
>> > +++ b/drivers/tty/serial/earlycon.c
>> [...]
>> > +static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
>> > +{
>> > +   void __iomem *base;
>> > +#ifdef CONFIG_FIX_EARLYCON_MEM
>> > +   set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK);
>> > +   base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
>> > +   base += paddr & ~PAGE_MASK;
>> > +#else
>> > +   base = ioremap_nocache(paddr, size);
>> > +#endif
>>
>> Just curious why not set_fixmap_io (and plain ioremap)?
>
> Good point. Note that ioremap_nocache() is the same as ioremap()
> on *all* architectures.

I investigated this before adding this to arm64. set_fixmap_io and
set_fixmap_nocache are not the same settings on x86. Whether the
mapping type really matters on x86 or not, I don't know. So I added
the nocache variant to arm64 to avoid a change to x86.

Rob

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

* Re: [PATCH 4/8] tty/serial: add generic serial earlycon
  2014-03-24 13:36         ` Rob Herring
  (?)
@ 2014-03-24 15:42           ` Arnd Bergmann
  -1 siblings, 0 replies; 90+ messages in thread
From: Arnd Bergmann @ 2014-03-24 15:42 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, Catalin Marinas, Russell King,
	Greg Kroah-Hartman, x86, Will Deacon, linux-kernel, linux-serial,
	Jiri Slaby

On Monday 24 March 2014 08:36:46 Rob Herring wrote:
> On Mon, Mar 24, 2014 at 6:29 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Monday 24 March 2014 11:22:03 Catalin Marinas wrote:
> >> On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote:
> >> > diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
> >> > new file mode 100644
> >> > index 0000000..241757a
> >> > --- /dev/null
> >> > +++ b/drivers/tty/serial/earlycon.c
> >> [...]
> >> > +static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
> >> > +{
> >> > +   void __iomem *base;
> >> > +#ifdef CONFIG_FIX_EARLYCON_MEM
> >> > +   set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK);
> >> > +   base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
> >> > +   base += paddr & ~PAGE_MASK;
> >> > +#else
> >> > +   base = ioremap_nocache(paddr, size);
> >> > +#endif
> >>
> >> Just curious why not set_fixmap_io (and plain ioremap)?
> >
> > Good point. Note that ioremap_nocache() is the same as ioremap()
> > on *all* architectures.
> 
> I investigated this before adding this to arm64. set_fixmap_io and
> set_fixmap_nocache are not the same settings on x86. Whether the
> mapping type really matters on x86 or not, I don't know. So I added
> the nocache variant to arm64 to avoid a change to x86.

My best guess is that it's an x86 bug. ioremap() always uses an uncached
mapping on x86, so it's strange to see early_ioremap() and set_fixmap_io()
use a cached mapping. It probably doesn't matter as long as the mtrr is
set up to treat all MMIO registers as non-cacheable, but I think there
should not be a difference.

	Arnd

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

* Re: [PATCH 4/8] tty/serial: add generic serial earlycon
@ 2014-03-24 15:42           ` Arnd Bergmann
  0 siblings, 0 replies; 90+ messages in thread
From: Arnd Bergmann @ 2014-03-24 15:42 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, Catalin Marinas, Russell King,
	Greg Kroah-Hartman, x86, Will Deacon, linux-kernel, linux-serial,
	Jiri Slaby

On Monday 24 March 2014 08:36:46 Rob Herring wrote:
> On Mon, Mar 24, 2014 at 6:29 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Monday 24 March 2014 11:22:03 Catalin Marinas wrote:
> >> On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote:
> >> > diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
> >> > new file mode 100644
> >> > index 0000000..241757a
> >> > --- /dev/null
> >> > +++ b/drivers/tty/serial/earlycon.c
> >> [...]
> >> > +static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
> >> > +{
> >> > +   void __iomem *base;
> >> > +#ifdef CONFIG_FIX_EARLYCON_MEM
> >> > +   set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK);
> >> > +   base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
> >> > +   base += paddr & ~PAGE_MASK;
> >> > +#else
> >> > +   base = ioremap_nocache(paddr, size);
> >> > +#endif
> >>
> >> Just curious why not set_fixmap_io (and plain ioremap)?
> >
> > Good point. Note that ioremap_nocache() is the same as ioremap()
> > on *all* architectures.
> 
> I investigated this before adding this to arm64. set_fixmap_io and
> set_fixmap_nocache are not the same settings on x86. Whether the
> mapping type really matters on x86 or not, I don't know. So I added
> the nocache variant to arm64 to avoid a change to x86.

My best guess is that it's an x86 bug. ioremap() always uses an uncached
mapping on x86, so it's strange to see early_ioremap() and set_fixmap_io()
use a cached mapping. It probably doesn't matter as long as the mtrr is
set up to treat all MMIO registers as non-cacheable, but I think there
should not be a difference.

	Arnd

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

* [PATCH 4/8] tty/serial: add generic serial earlycon
@ 2014-03-24 15:42           ` Arnd Bergmann
  0 siblings, 0 replies; 90+ messages in thread
From: Arnd Bergmann @ 2014-03-24 15:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 24 March 2014 08:36:46 Rob Herring wrote:
> On Mon, Mar 24, 2014 at 6:29 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Monday 24 March 2014 11:22:03 Catalin Marinas wrote:
> >> On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote:
> >> > diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
> >> > new file mode 100644
> >> > index 0000000..241757a
> >> > --- /dev/null
> >> > +++ b/drivers/tty/serial/earlycon.c
> >> [...]
> >> > +static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
> >> > +{
> >> > +   void __iomem *base;
> >> > +#ifdef CONFIG_FIX_EARLYCON_MEM
> >> > +   set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK);
> >> > +   base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
> >> > +   base += paddr & ~PAGE_MASK;
> >> > +#else
> >> > +   base = ioremap_nocache(paddr, size);
> >> > +#endif
> >>
> >> Just curious why not set_fixmap_io (and plain ioremap)?
> >
> > Good point. Note that ioremap_nocache() is the same as ioremap()
> > on *all* architectures.
> 
> I investigated this before adding this to arm64. set_fixmap_io and
> set_fixmap_nocache are not the same settings on x86. Whether the
> mapping type really matters on x86 or not, I don't know. So I added
> the nocache variant to arm64 to avoid a change to x86.

My best guess is that it's an x86 bug. ioremap() always uses an uncached
mapping on x86, so it's strange to see early_ioremap() and set_fixmap_io()
use a cached mapping. It probably doesn't matter as long as the mtrr is
set up to treat all MMIO registers as non-cacheable, but I think there
should not be a difference.

	Arnd

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

* Re: [PATCH 0/8] Generic serial earlycon
  2014-03-22 14:14     ` Rob Herring
  (?)
@ 2014-03-29  0:17       ` Grant Likely
  -1 siblings, 0 replies; 90+ messages in thread
From: Grant Likely @ 2014-03-29  0:17 UTC (permalink / raw)
  To: Rob Herring, Arnd Bergmann
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Catalin Marinas, Russell King, Will Deacon, x86

On Sat, 22 Mar 2014 09:14:31 -0500, Rob Herring <robherring2@gmail.com> wrote:
> On Sat, Mar 22, 2014 at 4:54 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Friday 21 March 2014, Rob Herring wrote:
> >> From: Rob Herring <robh@kernel.org>
> >>
> >> This started out as an attempt to add arm64's earlyprintk support to ARM
> >> in order to get an earlier, runtime setup console on multi-platform
> >> kernels. The first issue was needing the fixmap support which
> >> conveniently Mark Salter was working on and is mostly in place now. Like
> >> many things on ARM and arm64 now, it then became where do I put the now
> >> common, shared code. After digging more into various early console/printk
> >> support, it turns out the 8250_early.c setup code was the best starting
> >> point.
> >>
> >> This is based on Mark Salter's fixmap support currently in linux-next.
> >> This is tested on arm64 and ARM with pl011 and 8250. The ARM support
> >> also requires fixmap and fixed mapping support which are not yet in place.
> >> I have some patches in my tree to support fixmap, but they need some more
> >> work. Fortunately, once fixmap is in place, it is just a Kconfig option
> >> to enable earlycon support on ARM. A git tree is available here[1].
> >>
> >> Based on this series, I would like to add support for doing earlycon
> >> setup using DT.
> >
> > Hi Rob,
> >
> > I like this series a lot, great work!
> >
> > I would consider the DT parsing support essential here, we should not
> > merge the patches until that is done as well, because I don't want
> > to see users pass earlycon command line options in DT when they can
> > use the established "linux,stdout-path" property instead. I would
> > expect that in almost every case in which we are booting using DT
> > today, we can just use linux,stdout-path to locate the device that
> > the boot loader has already set up and start usign it.
> 
> I think this series stands on its own. It is largely refactoring
> existing code and supporting existing command line options (arm64 just
> changes from earlyprintk= to earlycon=). There will be cases where
> changing the kernel command line is the only way to setup the
> earlycon. Also, I think we would still want the kernel command line to
> control whether or not we enable the earlycon (i.e. earlycon=dt).
> There's not a standard way for how bootloaders would decide to set
> "linux,stdout-path" or not.

I agree. I really like this series and I don't think it needs to wait
for DT parsing.

Another issue is that the earlycon assumes the port is already set up,
but the /chosen/stdout-path binding doesn't guarantee that. We'll have
to make sure the kernel knows when it is valid to use
/chosen/stdout-path before enabling an early console.

g.


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

* Re: [PATCH 0/8] Generic serial earlycon
@ 2014-03-29  0:17       ` Grant Likely
  0 siblings, 0 replies; 90+ messages in thread
From: Grant Likely @ 2014-03-29  0:17 UTC (permalink / raw)
  To: Rob Herring, Arnd Bergmann
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Catalin Marinas, Russell King, Will Deacon, x86

On Sat, 22 Mar 2014 09:14:31 -0500, Rob Herring <robherring2@gmail.com> wrote:
> On Sat, Mar 22, 2014 at 4:54 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Friday 21 March 2014, Rob Herring wrote:
> >> From: Rob Herring <robh@kernel.org>
> >>
> >> This started out as an attempt to add arm64's earlyprintk support to ARM
> >> in order to get an earlier, runtime setup console on multi-platform
> >> kernels. The first issue was needing the fixmap support which
> >> conveniently Mark Salter was working on and is mostly in place now. Like
> >> many things on ARM and arm64 now, it then became where do I put the now
> >> common, shared code. After digging more into various early console/printk
> >> support, it turns out the 8250_early.c setup code was the best starting
> >> point.
> >>
> >> This is based on Mark Salter's fixmap support currently in linux-next.
> >> This is tested on arm64 and ARM with pl011 and 8250. The ARM support
> >> also requires fixmap and fixed mapping support which are not yet in place.
> >> I have some patches in my tree to support fixmap, but they need some more
> >> work. Fortunately, once fixmap is in place, it is just a Kconfig option
> >> to enable earlycon support on ARM. A git tree is available here[1].
> >>
> >> Based on this series, I would like to add support for doing earlycon
> >> setup using DT.
> >
> > Hi Rob,
> >
> > I like this series a lot, great work!
> >
> > I would consider the DT parsing support essential here, we should not
> > merge the patches until that is done as well, because I don't want
> > to see users pass earlycon command line options in DT when they can
> > use the established "linux,stdout-path" property instead. I would
> > expect that in almost every case in which we are booting using DT
> > today, we can just use linux,stdout-path to locate the device that
> > the boot loader has already set up and start usign it.
> 
> I think this series stands on its own. It is largely refactoring
> existing code and supporting existing command line options (arm64 just
> changes from earlyprintk= to earlycon=). There will be cases where
> changing the kernel command line is the only way to setup the
> earlycon. Also, I think we would still want the kernel command line to
> control whether or not we enable the earlycon (i.e. earlycon=dt).
> There's not a standard way for how bootloaders would decide to set
> "linux,stdout-path" or not.

I agree. I really like this series and I don't think it needs to wait
for DT parsing.

Another issue is that the earlycon assumes the port is already set up,
but the /chosen/stdout-path binding doesn't guarantee that. We'll have
to make sure the kernel knows when it is valid to use
/chosen/stdout-path before enabling an early console.

g.


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

* [PATCH 0/8] Generic serial earlycon
@ 2014-03-29  0:17       ` Grant Likely
  0 siblings, 0 replies; 90+ messages in thread
From: Grant Likely @ 2014-03-29  0:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, 22 Mar 2014 09:14:31 -0500, Rob Herring <robherring2@gmail.com> wrote:
> On Sat, Mar 22, 2014 at 4:54 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Friday 21 March 2014, Rob Herring wrote:
> >> From: Rob Herring <robh@kernel.org>
> >>
> >> This started out as an attempt to add arm64's earlyprintk support to ARM
> >> in order to get an earlier, runtime setup console on multi-platform
> >> kernels. The first issue was needing the fixmap support which
> >> conveniently Mark Salter was working on and is mostly in place now. Like
> >> many things on ARM and arm64 now, it then became where do I put the now
> >> common, shared code. After digging more into various early console/printk
> >> support, it turns out the 8250_early.c setup code was the best starting
> >> point.
> >>
> >> This is based on Mark Salter's fixmap support currently in linux-next.
> >> This is tested on arm64 and ARM with pl011 and 8250. The ARM support
> >> also requires fixmap and fixed mapping support which are not yet in place.
> >> I have some patches in my tree to support fixmap, but they need some more
> >> work. Fortunately, once fixmap is in place, it is just a Kconfig option
> >> to enable earlycon support on ARM. A git tree is available here[1].
> >>
> >> Based on this series, I would like to add support for doing earlycon
> >> setup using DT.
> >
> > Hi Rob,
> >
> > I like this series a lot, great work!
> >
> > I would consider the DT parsing support essential here, we should not
> > merge the patches until that is done as well, because I don't want
> > to see users pass earlycon command line options in DT when they can
> > use the established "linux,stdout-path" property instead. I would
> > expect that in almost every case in which we are booting using DT
> > today, we can just use linux,stdout-path to locate the device that
> > the boot loader has already set up and start usign it.
> 
> I think this series stands on its own. It is largely refactoring
> existing code and supporting existing command line options (arm64 just
> changes from earlyprintk= to earlycon=). There will be cases where
> changing the kernel command line is the only way to setup the
> earlycon. Also, I think we would still want the kernel command line to
> control whether or not we enable the earlycon (i.e. earlycon=dt).
> There's not a standard way for how bootloaders would decide to set
> "linux,stdout-path" or not.

I agree. I really like this series and I don't think it needs to wait
for DT parsing.

Another issue is that the earlycon assumes the port is already set up,
but the /chosen/stdout-path binding doesn't guarantee that. We'll have
to make sure the kernel knows when it is valid to use
/chosen/stdout-path before enabling an early console.

g.

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

* Re: [PATCH 0/8] Generic serial earlycon
  2014-03-29  0:17       ` Grant Likely
  (?)
@ 2014-03-29 14:33         ` Rob Herring
  -1 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-29 14:33 UTC (permalink / raw)
  To: Grant Likely
  Cc: Arnd Bergmann, linux-arm-kernel, linux-kernel, linux-serial,
	Greg Kroah-Hartman, Jiri Slaby, Catalin Marinas, Russell King,
	Will Deacon, x86

On Fri, Mar 28, 2014 at 7:17 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
> On Sat, 22 Mar 2014 09:14:31 -0500, Rob Herring <robherring2@gmail.com> wrote:
>> On Sat, Mar 22, 2014 at 4:54 AM, Arnd Bergmann <arnd@arndb.de> wrote:
>> > On Friday 21 March 2014, Rob Herring wrote:
>> >> From: Rob Herring <robh@kernel.org>
>> >>
>> >> This started out as an attempt to add arm64's earlyprintk support to ARM
>> >> in order to get an earlier, runtime setup console on multi-platform
>> >> kernels. The first issue was needing the fixmap support which
>> >> conveniently Mark Salter was working on and is mostly in place now. Like
>> >> many things on ARM and arm64 now, it then became where do I put the now
>> >> common, shared code. After digging more into various early console/printk
>> >> support, it turns out the 8250_early.c setup code was the best starting
>> >> point.
>> >>
>> >> This is based on Mark Salter's fixmap support currently in linux-next.
>> >> This is tested on arm64 and ARM with pl011 and 8250. The ARM support
>> >> also requires fixmap and fixed mapping support which are not yet in place.
>> >> I have some patches in my tree to support fixmap, but they need some more
>> >> work. Fortunately, once fixmap is in place, it is just a Kconfig option
>> >> to enable earlycon support on ARM. A git tree is available here[1].
>> >>
>> >> Based on this series, I would like to add support for doing earlycon
>> >> setup using DT.
>> >
>> > Hi Rob,
>> >
>> > I like this series a lot, great work!
>> >
>> > I would consider the DT parsing support essential here, we should not
>> > merge the patches until that is done as well, because I don't want
>> > to see users pass earlycon command line options in DT when they can
>> > use the established "linux,stdout-path" property instead. I would
>> > expect that in almost every case in which we are booting using DT
>> > today, we can just use linux,stdout-path to locate the device that
>> > the boot loader has already set up and start usign it.
>>
>> I think this series stands on its own. It is largely refactoring
>> existing code and supporting existing command line options (arm64 just
>> changes from earlyprintk= to earlycon=). There will be cases where
>> changing the kernel command line is the only way to setup the
>> earlycon. Also, I think we would still want the kernel command line to
>> control whether or not we enable the earlycon (i.e. earlycon=dt).
>> There's not a standard way for how bootloaders would decide to set
>> "linux,stdout-path" or not.
>
> I agree. I really like this series and I don't think it needs to wait
> for DT parsing.
>
> Another issue is that the earlycon assumes the port is already set up,
> but the /chosen/stdout-path binding doesn't guarantee that. We'll have
> to make sure the kernel knows when it is valid to use
> /chosen/stdout-path before enabling an early console.

It's driver dependent whether the port setup is done in the earlycon
driver or not. The 8250 driver does port setup while the pl011 driver
does not. We could add setup to the pl011 or checks that it is setup
already, but then it would not work with SBSA compliant UARTs.

I don't think we want to enable earlycon solely if stdout-path is set.
My plan here is that adding "earlycon" with no parameters to the
command line enables DT based setup of earlycon. That doesn't really
solve the issue with setup, but does limit it to a developer's feature
at least.

Rob

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

* Re: [PATCH 0/8] Generic serial earlycon
@ 2014-03-29 14:33         ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-29 14:33 UTC (permalink / raw)
  To: Grant Likely
  Cc: Arnd Bergmann, linux-arm-kernel, linux-kernel, linux-serial,
	Greg Kroah-Hartman, Jiri Slaby, Catalin Marinas, Russell King,
	Will Deacon, x86

On Fri, Mar 28, 2014 at 7:17 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
> On Sat, 22 Mar 2014 09:14:31 -0500, Rob Herring <robherring2@gmail.com> wrote:
>> On Sat, Mar 22, 2014 at 4:54 AM, Arnd Bergmann <arnd@arndb.de> wrote:
>> > On Friday 21 March 2014, Rob Herring wrote:
>> >> From: Rob Herring <robh@kernel.org>
>> >>
>> >> This started out as an attempt to add arm64's earlyprintk support to ARM
>> >> in order to get an earlier, runtime setup console on multi-platform
>> >> kernels. The first issue was needing the fixmap support which
>> >> conveniently Mark Salter was working on and is mostly in place now. Like
>> >> many things on ARM and arm64 now, it then became where do I put the now
>> >> common, shared code. After digging more into various early console/printk
>> >> support, it turns out the 8250_early.c setup code was the best starting
>> >> point.
>> >>
>> >> This is based on Mark Salter's fixmap support currently in linux-next.
>> >> This is tested on arm64 and ARM with pl011 and 8250. The ARM support
>> >> also requires fixmap and fixed mapping support which are not yet in place.
>> >> I have some patches in my tree to support fixmap, but they need some more
>> >> work. Fortunately, once fixmap is in place, it is just a Kconfig option
>> >> to enable earlycon support on ARM. A git tree is available here[1].
>> >>
>> >> Based on this series, I would like to add support for doing earlycon
>> >> setup using DT.
>> >
>> > Hi Rob,
>> >
>> > I like this series a lot, great work!
>> >
>> > I would consider the DT parsing support essential here, we should not
>> > merge the patches until that is done as well, because I don't want
>> > to see users pass earlycon command line options in DT when they can
>> > use the established "linux,stdout-path" property instead. I would
>> > expect that in almost every case in which we are booting using DT
>> > today, we can just use linux,stdout-path to locate the device that
>> > the boot loader has already set up and start usign it.
>>
>> I think this series stands on its own. It is largely refactoring
>> existing code and supporting existing command line options (arm64 just
>> changes from earlyprintk= to earlycon=). There will be cases where
>> changing the kernel command line is the only way to setup the
>> earlycon. Also, I think we would still want the kernel command line to
>> control whether or not we enable the earlycon (i.e. earlycon=dt).
>> There's not a standard way for how bootloaders would decide to set
>> "linux,stdout-path" or not.
>
> I agree. I really like this series and I don't think it needs to wait
> for DT parsing.
>
> Another issue is that the earlycon assumes the port is already set up,
> but the /chosen/stdout-path binding doesn't guarantee that. We'll have
> to make sure the kernel knows when it is valid to use
> /chosen/stdout-path before enabling an early console.

It's driver dependent whether the port setup is done in the earlycon
driver or not. The 8250 driver does port setup while the pl011 driver
does not. We could add setup to the pl011 or checks that it is setup
already, but then it would not work with SBSA compliant UARTs.

I don't think we want to enable earlycon solely if stdout-path is set.
My plan here is that adding "earlycon" with no parameters to the
command line enables DT based setup of earlycon. That doesn't really
solve the issue with setup, but does limit it to a developer's feature
at least.

Rob

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

* [PATCH 0/8] Generic serial earlycon
@ 2014-03-29 14:33         ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-03-29 14:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 28, 2014 at 7:17 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
> On Sat, 22 Mar 2014 09:14:31 -0500, Rob Herring <robherring2@gmail.com> wrote:
>> On Sat, Mar 22, 2014 at 4:54 AM, Arnd Bergmann <arnd@arndb.de> wrote:
>> > On Friday 21 March 2014, Rob Herring wrote:
>> >> From: Rob Herring <robh@kernel.org>
>> >>
>> >> This started out as an attempt to add arm64's earlyprintk support to ARM
>> >> in order to get an earlier, runtime setup console on multi-platform
>> >> kernels. The first issue was needing the fixmap support which
>> >> conveniently Mark Salter was working on and is mostly in place now. Like
>> >> many things on ARM and arm64 now, it then became where do I put the now
>> >> common, shared code. After digging more into various early console/printk
>> >> support, it turns out the 8250_early.c setup code was the best starting
>> >> point.
>> >>
>> >> This is based on Mark Salter's fixmap support currently in linux-next.
>> >> This is tested on arm64 and ARM with pl011 and 8250. The ARM support
>> >> also requires fixmap and fixed mapping support which are not yet in place.
>> >> I have some patches in my tree to support fixmap, but they need some more
>> >> work. Fortunately, once fixmap is in place, it is just a Kconfig option
>> >> to enable earlycon support on ARM. A git tree is available here[1].
>> >>
>> >> Based on this series, I would like to add support for doing earlycon
>> >> setup using DT.
>> >
>> > Hi Rob,
>> >
>> > I like this series a lot, great work!
>> >
>> > I would consider the DT parsing support essential here, we should not
>> > merge the patches until that is done as well, because I don't want
>> > to see users pass earlycon command line options in DT when they can
>> > use the established "linux,stdout-path" property instead. I would
>> > expect that in almost every case in which we are booting using DT
>> > today, we can just use linux,stdout-path to locate the device that
>> > the boot loader has already set up and start usign it.
>>
>> I think this series stands on its own. It is largely refactoring
>> existing code and supporting existing command line options (arm64 just
>> changes from earlyprintk= to earlycon=). There will be cases where
>> changing the kernel command line is the only way to setup the
>> earlycon. Also, I think we would still want the kernel command line to
>> control whether or not we enable the earlycon (i.e. earlycon=dt).
>> There's not a standard way for how bootloaders would decide to set
>> "linux,stdout-path" or not.
>
> I agree. I really like this series and I don't think it needs to wait
> for DT parsing.
>
> Another issue is that the earlycon assumes the port is already set up,
> but the /chosen/stdout-path binding doesn't guarantee that. We'll have
> to make sure the kernel knows when it is valid to use
> /chosen/stdout-path before enabling an early console.

It's driver dependent whether the port setup is done in the earlycon
driver or not. The 8250 driver does port setup while the pl011 driver
does not. We could add setup to the pl011 or checks that it is setup
already, but then it would not work with SBSA compliant UARTs.

I don't think we want to enable earlycon solely if stdout-path is set.
My plan here is that adding "earlycon" with no parameters to the
command line enables DT based setup of earlycon. That doesn't really
solve the issue with setup, but does limit it to a developer's feature
at least.

Rob

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

* Re: [PATCH 0/8] Generic serial earlycon
  2014-03-29 14:33         ` Rob Herring
  (?)
@ 2014-03-29 15:34           ` Grant Likely
  -1 siblings, 0 replies; 90+ messages in thread
From: Grant Likely @ 2014-03-29 15:34 UTC (permalink / raw)
  To: Rob Herring
  Cc: Arnd Bergmann, linux-arm-kernel, linux-kernel, linux-serial,
	Greg Kroah-Hartman, Jiri Slaby, Catalin Marinas, Russell King,
	Will Deacon, x86

On Sat, 29 Mar 2014 09:33:22 -0500, Rob Herring <robherring2@gmail.com> wrote:
> On Fri, Mar 28, 2014 at 7:17 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
> > On Sat, 22 Mar 2014 09:14:31 -0500, Rob Herring <robherring2@gmail.com> wrote:
> >> On Sat, Mar 22, 2014 at 4:54 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> >> > On Friday 21 March 2014, Rob Herring wrote:
> >> >> From: Rob Herring <robh@kernel.org>
> >> >>
> >> >> This started out as an attempt to add arm64's earlyprintk support to ARM
> >> >> in order to get an earlier, runtime setup console on multi-platform
> >> >> kernels. The first issue was needing the fixmap support which
> >> >> conveniently Mark Salter was working on and is mostly in place now. Like
> >> >> many things on ARM and arm64 now, it then became where do I put the now
> >> >> common, shared code. After digging more into various early console/printk
> >> >> support, it turns out the 8250_early.c setup code was the best starting
> >> >> point.
> >> >>
> >> >> This is based on Mark Salter's fixmap support currently in linux-next.
> >> >> This is tested on arm64 and ARM with pl011 and 8250. The ARM support
> >> >> also requires fixmap and fixed mapping support which are not yet in place.
> >> >> I have some patches in my tree to support fixmap, but they need some more
> >> >> work. Fortunately, once fixmap is in place, it is just a Kconfig option
> >> >> to enable earlycon support on ARM. A git tree is available here[1].
> >> >>
> >> >> Based on this series, I would like to add support for doing earlycon
> >> >> setup using DT.
> >> >
> >> > Hi Rob,
> >> >
> >> > I like this series a lot, great work!
> >> >
> >> > I would consider the DT parsing support essential here, we should not
> >> > merge the patches until that is done as well, because I don't want
> >> > to see users pass earlycon command line options in DT when they can
> >> > use the established "linux,stdout-path" property instead. I would
> >> > expect that in almost every case in which we are booting using DT
> >> > today, we can just use linux,stdout-path to locate the device that
> >> > the boot loader has already set up and start usign it.
> >>
> >> I think this series stands on its own. It is largely refactoring
> >> existing code and supporting existing command line options (arm64 just
> >> changes from earlyprintk= to earlycon=). There will be cases where
> >> changing the kernel command line is the only way to setup the
> >> earlycon. Also, I think we would still want the kernel command line to
> >> control whether or not we enable the earlycon (i.e. earlycon=dt).
> >> There's not a standard way for how bootloaders would decide to set
> >> "linux,stdout-path" or not.
> >
> > I agree. I really like this series and I don't think it needs to wait
> > for DT parsing.
> >
> > Another issue is that the earlycon assumes the port is already set up,
> > but the /chosen/stdout-path binding doesn't guarantee that. We'll have
> > to make sure the kernel knows when it is valid to use
> > /chosen/stdout-path before enabling an early console.
> 
> It's driver dependent whether the port setup is done in the earlycon
> driver or not. The 8250 driver does port setup while the pl011 driver
> does not. We could add setup to the pl011 or checks that it is setup
> already, but then it would not work with SBSA compliant UARTs.

Well, it would work in most cases, but would be unnecessary and makes it
more likely that there will be no output if the kernel gets the setup
wrong.

> I don't think we want to enable earlycon solely if stdout-path is set.
> My plan here is that adding "earlycon" with no parameters to the
> command line enables DT based setup of earlycon. That doesn't really
> solve the issue with setup, but does limit it to a developer's feature
> at least.

That is reasonable. Alternately, we could also add a property to chosen
indicating that the console is set up and ready to go.

g.

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

* Re: [PATCH 0/8] Generic serial earlycon
@ 2014-03-29 15:34           ` Grant Likely
  0 siblings, 0 replies; 90+ messages in thread
From: Grant Likely @ 2014-03-29 15:34 UTC (permalink / raw)
  To: Rob Herring
  Cc: Arnd Bergmann, linux-arm-kernel, linux-kernel, linux-serial,
	Greg Kroah-Hartman, Jiri Slaby, Catalin Marinas, Russell King,
	Will Deacon, x86

On Sat, 29 Mar 2014 09:33:22 -0500, Rob Herring <robherring2@gmail.com> wrote:
> On Fri, Mar 28, 2014 at 7:17 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
> > On Sat, 22 Mar 2014 09:14:31 -0500, Rob Herring <robherring2@gmail.com> wrote:
> >> On Sat, Mar 22, 2014 at 4:54 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> >> > On Friday 21 March 2014, Rob Herring wrote:
> >> >> From: Rob Herring <robh@kernel.org>
> >> >>
> >> >> This started out as an attempt to add arm64's earlyprintk support to ARM
> >> >> in order to get an earlier, runtime setup console on multi-platform
> >> >> kernels. The first issue was needing the fixmap support which
> >> >> conveniently Mark Salter was working on and is mostly in place now. Like
> >> >> many things on ARM and arm64 now, it then became where do I put the now
> >> >> common, shared code. After digging more into various early console/printk
> >> >> support, it turns out the 8250_early.c setup code was the best starting
> >> >> point.
> >> >>
> >> >> This is based on Mark Salter's fixmap support currently in linux-next.
> >> >> This is tested on arm64 and ARM with pl011 and 8250. The ARM support
> >> >> also requires fixmap and fixed mapping support which are not yet in place.
> >> >> I have some patches in my tree to support fixmap, but they need some more
> >> >> work. Fortunately, once fixmap is in place, it is just a Kconfig option
> >> >> to enable earlycon support on ARM. A git tree is available here[1].
> >> >>
> >> >> Based on this series, I would like to add support for doing earlycon
> >> >> setup using DT.
> >> >
> >> > Hi Rob,
> >> >
> >> > I like this series a lot, great work!
> >> >
> >> > I would consider the DT parsing support essential here, we should not
> >> > merge the patches until that is done as well, because I don't want
> >> > to see users pass earlycon command line options in DT when they can
> >> > use the established "linux,stdout-path" property instead. I would
> >> > expect that in almost every case in which we are booting using DT
> >> > today, we can just use linux,stdout-path to locate the device that
> >> > the boot loader has already set up and start usign it.
> >>
> >> I think this series stands on its own. It is largely refactoring
> >> existing code and supporting existing command line options (arm64 just
> >> changes from earlyprintk= to earlycon=). There will be cases where
> >> changing the kernel command line is the only way to setup the
> >> earlycon. Also, I think we would still want the kernel command line to
> >> control whether or not we enable the earlycon (i.e. earlycon=dt).
> >> There's not a standard way for how bootloaders would decide to set
> >> "linux,stdout-path" or not.
> >
> > I agree. I really like this series and I don't think it needs to wait
> > for DT parsing.
> >
> > Another issue is that the earlycon assumes the port is already set up,
> > but the /chosen/stdout-path binding doesn't guarantee that. We'll have
> > to make sure the kernel knows when it is valid to use
> > /chosen/stdout-path before enabling an early console.
> 
> It's driver dependent whether the port setup is done in the earlycon
> driver or not. The 8250 driver does port setup while the pl011 driver
> does not. We could add setup to the pl011 or checks that it is setup
> already, but then it would not work with SBSA compliant UARTs.

Well, it would work in most cases, but would be unnecessary and makes it
more likely that there will be no output if the kernel gets the setup
wrong.

> I don't think we want to enable earlycon solely if stdout-path is set.
> My plan here is that adding "earlycon" with no parameters to the
> command line enables DT based setup of earlycon. That doesn't really
> solve the issue with setup, but does limit it to a developer's feature
> at least.

That is reasonable. Alternately, we could also add a property to chosen
indicating that the console is set up and ready to go.

g.

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

* [PATCH 0/8] Generic serial earlycon
@ 2014-03-29 15:34           ` Grant Likely
  0 siblings, 0 replies; 90+ messages in thread
From: Grant Likely @ 2014-03-29 15:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, 29 Mar 2014 09:33:22 -0500, Rob Herring <robherring2@gmail.com> wrote:
> On Fri, Mar 28, 2014 at 7:17 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
> > On Sat, 22 Mar 2014 09:14:31 -0500, Rob Herring <robherring2@gmail.com> wrote:
> >> On Sat, Mar 22, 2014 at 4:54 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> >> > On Friday 21 March 2014, Rob Herring wrote:
> >> >> From: Rob Herring <robh@kernel.org>
> >> >>
> >> >> This started out as an attempt to add arm64's earlyprintk support to ARM
> >> >> in order to get an earlier, runtime setup console on multi-platform
> >> >> kernels. The first issue was needing the fixmap support which
> >> >> conveniently Mark Salter was working on and is mostly in place now. Like
> >> >> many things on ARM and arm64 now, it then became where do I put the now
> >> >> common, shared code. After digging more into various early console/printk
> >> >> support, it turns out the 8250_early.c setup code was the best starting
> >> >> point.
> >> >>
> >> >> This is based on Mark Salter's fixmap support currently in linux-next.
> >> >> This is tested on arm64 and ARM with pl011 and 8250. The ARM support
> >> >> also requires fixmap and fixed mapping support which are not yet in place.
> >> >> I have some patches in my tree to support fixmap, but they need some more
> >> >> work. Fortunately, once fixmap is in place, it is just a Kconfig option
> >> >> to enable earlycon support on ARM. A git tree is available here[1].
> >> >>
> >> >> Based on this series, I would like to add support for doing earlycon
> >> >> setup using DT.
> >> >
> >> > Hi Rob,
> >> >
> >> > I like this series a lot, great work!
> >> >
> >> > I would consider the DT parsing support essential here, we should not
> >> > merge the patches until that is done as well, because I don't want
> >> > to see users pass earlycon command line options in DT when they can
> >> > use the established "linux,stdout-path" property instead. I would
> >> > expect that in almost every case in which we are booting using DT
> >> > today, we can just use linux,stdout-path to locate the device that
> >> > the boot loader has already set up and start usign it.
> >>
> >> I think this series stands on its own. It is largely refactoring
> >> existing code and supporting existing command line options (arm64 just
> >> changes from earlyprintk= to earlycon=). There will be cases where
> >> changing the kernel command line is the only way to setup the
> >> earlycon. Also, I think we would still want the kernel command line to
> >> control whether or not we enable the earlycon (i.e. earlycon=dt).
> >> There's not a standard way for how bootloaders would decide to set
> >> "linux,stdout-path" or not.
> >
> > I agree. I really like this series and I don't think it needs to wait
> > for DT parsing.
> >
> > Another issue is that the earlycon assumes the port is already set up,
> > but the /chosen/stdout-path binding doesn't guarantee that. We'll have
> > to make sure the kernel knows when it is valid to use
> > /chosen/stdout-path before enabling an early console.
> 
> It's driver dependent whether the port setup is done in the earlycon
> driver or not. The 8250 driver does port setup while the pl011 driver
> does not. We could add setup to the pl011 or checks that it is setup
> already, but then it would not work with SBSA compliant UARTs.

Well, it would work in most cases, but would be unnecessary and makes it
more likely that there will be no output if the kernel gets the setup
wrong.

> I don't think we want to enable earlycon solely if stdout-path is set.
> My plan here is that adding "earlycon" with no parameters to the
> command line enables DT based setup of earlycon. That doesn't really
> solve the issue with setup, but does limit it to a developer's feature
> at least.

That is reasonable. Alternately, we could also add a property to chosen
indicating that the console is set up and ready to go.

g.

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

* Re: [PATCH 6/8] tty/serial: pl011: add generic earlycon support
  2014-03-24 11:28     ` Catalin Marinas
  (?)
@ 2014-04-16 22:14       ` Rob Herring
  -1 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-04-16 22:14 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Russell King, Will Deacon, x86, Arnd Bergmann

On Mon, Mar 24, 2014 at 6:28 AM, Catalin Marinas
<catalin.marinas@arm.com> wrote:
> On Fri, Mar 21, 2014 at 09:08:46PM +0000, Rob Herring wrote:
>> From: Rob Herring <robh@kernel.org>
>>
>> Add earlycon support for the pl011 serial port. This allows enabling
>> the pl011 for console when early_params are processed. This is based
>> on the arm64 earlyprintk support and is intended to replace it.
>>
>> Signed-off-by: Rob Herring <robh@kernel.org>
>> Cc: Russell King <linux@arm.linux.org.uk>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: Jiri Slaby <jslaby@suse.cz>
>> ---
>>  Documentation/kernel-parameters.txt |  5 +++--
>>  drivers/tty/serial/amba-pl011.c     | 30 +++++++++++++++++++++++++++++-
>>  2 files changed, 32 insertions(+), 3 deletions(-)
>>
>> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
>> index 5ce8b7a..81bdd52 100644
>> --- a/Documentation/kernel-parameters.txt
>> +++ b/Documentation/kernel-parameters.txt
>> @@ -887,8 +887,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>>               uart[8250],io,<addr>[,options]
>>               uart[8250],mmio,<addr>[,options]
>>               uart[8250],mmio32,<addr>[,options]
>> -                     Start an early, polled-mode console on the 8250/16550
>> -                     UART at the specified I/O port or MMIO address.
>> +             pl011,<addr>
>> +                     Start an early, polled-mode console on a serial port
>> +                     at the specified I/O port or MMIO address. 8250
>>                       MMIO inter-register address stride is either 8-bit
>>                       (mmio) or 32-bit (mmio32).
>>                       The options are the same as for ttyS, above.
>
> I think the last line is a bit misleading. Or did you intend to leave it
> with the uart[8250] parameter? See below:

How about this (excuse the gmail lack of tabs):

earlycon= [KNL] Output early console device and options.

 uart[8250],io,<addr>[,options]
 uart[8250],mmio,<addr>[,options]
 uart[8250],mmio32,<addr>[,options]
  Start an early, polled-mode console on an 8250 serial
  port at the specified I/O port or MMIO address. 8250
  MMIO inter-register address stride is either 8-bit
  (mmio) or 32-bit (mmio32).

  The options are the same as for ttyS, above.

 pl011,<addr>
  Start an early, polled-mode console on a pl011 serial
  port at the specified address. The pl011 serial port
  must already be setup and configured. Options are not
  yet supported.

 smh Use ARM semihosting calls for early console.


>
>> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
>> index d4eda24..4227c0a 100644
>> --- a/drivers/tty/serial/amba-pl011.c
>> +++ b/drivers/tty/serial/amba-pl011.c
> [...]
>> +static int __init pl011_early_console_setup(struct earlycon_device *device,
>> +                                         const char *opt)
>> +{
>> +     if (!device->port.membase)
>> +             return -ENODEV;
>> +
>> +     device->con->write = pl011_early_write;
>> +     return 0;
>> +}
>> +EARLYCON_DECLARE(pl011, pl011_early_console_setup);
>
> Here we expect the PL011 to be already initialised by the boot loader
> and the kernel continues using the same settings. So maybe clarify this
> in the pl011 kernel parameter doc and we can add proper configuration
> using a separate patch.

Enabling and setup would not be too hard, but either baud rate will
always have to be configured or we'll have to specify the input clock
rate too. The 8250 driver basically does the former or assumes a fixed
clock.

Adding any setup will also break any non-pl011 based SBSA compliant
uart since the configuration registers are not standardized. I guess
we can add "sbsauart" when/if that happens.

Rob

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

* Re: [PATCH 6/8] tty/serial: pl011: add generic earlycon support
@ 2014-04-16 22:14       ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-04-16 22:14 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Russell King, Will Deacon, x86, Arnd Bergmann

On Mon, Mar 24, 2014 at 6:28 AM, Catalin Marinas
<catalin.marinas@arm.com> wrote:
> On Fri, Mar 21, 2014 at 09:08:46PM +0000, Rob Herring wrote:
>> From: Rob Herring <robh@kernel.org>
>>
>> Add earlycon support for the pl011 serial port. This allows enabling
>> the pl011 for console when early_params are processed. This is based
>> on the arm64 earlyprintk support and is intended to replace it.
>>
>> Signed-off-by: Rob Herring <robh@kernel.org>
>> Cc: Russell King <linux@arm.linux.org.uk>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: Jiri Slaby <jslaby@suse.cz>
>> ---
>>  Documentation/kernel-parameters.txt |  5 +++--
>>  drivers/tty/serial/amba-pl011.c     | 30 +++++++++++++++++++++++++++++-
>>  2 files changed, 32 insertions(+), 3 deletions(-)
>>
>> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
>> index 5ce8b7a..81bdd52 100644
>> --- a/Documentation/kernel-parameters.txt
>> +++ b/Documentation/kernel-parameters.txt
>> @@ -887,8 +887,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>>               uart[8250],io,<addr>[,options]
>>               uart[8250],mmio,<addr>[,options]
>>               uart[8250],mmio32,<addr>[,options]
>> -                     Start an early, polled-mode console on the 8250/16550
>> -                     UART at the specified I/O port or MMIO address.
>> +             pl011,<addr>
>> +                     Start an early, polled-mode console on a serial port
>> +                     at the specified I/O port or MMIO address. 8250
>>                       MMIO inter-register address stride is either 8-bit
>>                       (mmio) or 32-bit (mmio32).
>>                       The options are the same as for ttyS, above.
>
> I think the last line is a bit misleading. Or did you intend to leave it
> with the uart[8250] parameter? See below:

How about this (excuse the gmail lack of tabs):

earlycon= [KNL] Output early console device and options.

 uart[8250],io,<addr>[,options]
 uart[8250],mmio,<addr>[,options]
 uart[8250],mmio32,<addr>[,options]
  Start an early, polled-mode console on an 8250 serial
  port at the specified I/O port or MMIO address. 8250
  MMIO inter-register address stride is either 8-bit
  (mmio) or 32-bit (mmio32).

  The options are the same as for ttyS, above.

 pl011,<addr>
  Start an early, polled-mode console on a pl011 serial
  port at the specified address. The pl011 serial port
  must already be setup and configured. Options are not
  yet supported.

 smh Use ARM semihosting calls for early console.


>
>> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
>> index d4eda24..4227c0a 100644
>> --- a/drivers/tty/serial/amba-pl011.c
>> +++ b/drivers/tty/serial/amba-pl011.c
> [...]
>> +static int __init pl011_early_console_setup(struct earlycon_device *device,
>> +                                         const char *opt)
>> +{
>> +     if (!device->port.membase)
>> +             return -ENODEV;
>> +
>> +     device->con->write = pl011_early_write;
>> +     return 0;
>> +}
>> +EARLYCON_DECLARE(pl011, pl011_early_console_setup);
>
> Here we expect the PL011 to be already initialised by the boot loader
> and the kernel continues using the same settings. So maybe clarify this
> in the pl011 kernel parameter doc and we can add proper configuration
> using a separate patch.

Enabling and setup would not be too hard, but either baud rate will
always have to be configured or we'll have to specify the input clock
rate too. The 8250 driver basically does the former or assumes a fixed
clock.

Adding any setup will also break any non-pl011 based SBSA compliant
uart since the configuration registers are not standardized. I guess
we can add "sbsauart" when/if that happens.

Rob

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

* [PATCH 6/8] tty/serial: pl011: add generic earlycon support
@ 2014-04-16 22:14       ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-04-16 22:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 24, 2014 at 6:28 AM, Catalin Marinas
<catalin.marinas@arm.com> wrote:
> On Fri, Mar 21, 2014 at 09:08:46PM +0000, Rob Herring wrote:
>> From: Rob Herring <robh@kernel.org>
>>
>> Add earlycon support for the pl011 serial port. This allows enabling
>> the pl011 for console when early_params are processed. This is based
>> on the arm64 earlyprintk support and is intended to replace it.
>>
>> Signed-off-by: Rob Herring <robh@kernel.org>
>> Cc: Russell King <linux@arm.linux.org.uk>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: Jiri Slaby <jslaby@suse.cz>
>> ---
>>  Documentation/kernel-parameters.txt |  5 +++--
>>  drivers/tty/serial/amba-pl011.c     | 30 +++++++++++++++++++++++++++++-
>>  2 files changed, 32 insertions(+), 3 deletions(-)
>>
>> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
>> index 5ce8b7a..81bdd52 100644
>> --- a/Documentation/kernel-parameters.txt
>> +++ b/Documentation/kernel-parameters.txt
>> @@ -887,8 +887,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>>               uart[8250],io,<addr>[,options]
>>               uart[8250],mmio,<addr>[,options]
>>               uart[8250],mmio32,<addr>[,options]
>> -                     Start an early, polled-mode console on the 8250/16550
>> -                     UART at the specified I/O port or MMIO address.
>> +             pl011,<addr>
>> +                     Start an early, polled-mode console on a serial port
>> +                     at the specified I/O port or MMIO address. 8250
>>                       MMIO inter-register address stride is either 8-bit
>>                       (mmio) or 32-bit (mmio32).
>>                       The options are the same as for ttyS, above.
>
> I think the last line is a bit misleading. Or did you intend to leave it
> with the uart[8250] parameter? See below:

How about this (excuse the gmail lack of tabs):

earlycon= [KNL] Output early console device and options.

 uart[8250],io,<addr>[,options]
 uart[8250],mmio,<addr>[,options]
 uart[8250],mmio32,<addr>[,options]
  Start an early, polled-mode console on an 8250 serial
  port at the specified I/O port or MMIO address. 8250
  MMIO inter-register address stride is either 8-bit
  (mmio) or 32-bit (mmio32).

  The options are the same as for ttyS, above.

 pl011,<addr>
  Start an early, polled-mode console on a pl011 serial
  port at the specified address. The pl011 serial port
  must already be setup and configured. Options are not
  yet supported.

 smh Use ARM semihosting calls for early console.


>
>> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
>> index d4eda24..4227c0a 100644
>> --- a/drivers/tty/serial/amba-pl011.c
>> +++ b/drivers/tty/serial/amba-pl011.c
> [...]
>> +static int __init pl011_early_console_setup(struct earlycon_device *device,
>> +                                         const char *opt)
>> +{
>> +     if (!device->port.membase)
>> +             return -ENODEV;
>> +
>> +     device->con->write = pl011_early_write;
>> +     return 0;
>> +}
>> +EARLYCON_DECLARE(pl011, pl011_early_console_setup);
>
> Here we expect the PL011 to be already initialised by the boot loader
> and the kernel continues using the same settings. So maybe clarify this
> in the pl011 kernel parameter doc and we can add proper configuration
> using a separate patch.

Enabling and setup would not be too hard, but either baud rate will
always have to be configured or we'll have to specify the input clock
rate too. The 8250 driver basically does the former or assumes a fixed
clock.

Adding any setup will also break any non-pl011 based SBSA compliant
uart since the configuration registers are not standardized. I guess
we can add "sbsauart" when/if that happens.

Rob

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

* Re: [PATCH 4/8] tty/serial: add generic serial earlycon
  2014-03-24 15:42           ` Arnd Bergmann
  (?)
@ 2014-04-17 18:27             ` Rob Herring
  -1 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-04-17 18:27 UTC (permalink / raw)
  To: Arnd Bergmann, Alan Cox
  Cc: linux-arm-kernel, Catalin Marinas, Russell King,
	Greg Kroah-Hartman, x86, Will Deacon, linux-kernel, linux-serial,
	Jiri Slaby

On Mon, Mar 24, 2014 at 10:42 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Monday 24 March 2014 08:36:46 Rob Herring wrote:
>> On Mon, Mar 24, 2014 at 6:29 AM, Arnd Bergmann <arnd@arndb.de> wrote:
>> > On Monday 24 March 2014 11:22:03 Catalin Marinas wrote:
>> >> On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote:
>> >> > diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
>> >> > new file mode 100644
>> >> > index 0000000..241757a
>> >> > --- /dev/null
>> >> > +++ b/drivers/tty/serial/earlycon.c
>> >> [...]
>> >> > +static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
>> >> > +{
>> >> > +   void __iomem *base;
>> >> > +#ifdef CONFIG_FIX_EARLYCON_MEM
>> >> > +   set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK);
>> >> > +   base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
>> >> > +   base += paddr & ~PAGE_MASK;
>> >> > +#else
>> >> > +   base = ioremap_nocache(paddr, size);
>> >> > +#endif
>> >>
>> >> Just curious why not set_fixmap_io (and plain ioremap)?
>> >
>> > Good point. Note that ioremap_nocache() is the same as ioremap()
>> > on *all* architectures.

Did you mean "not the same"? Why are there 2 flavors if they are
always the same.


>> I investigated this before adding this to arm64. set_fixmap_io and
>> set_fixmap_nocache are not the same settings on x86. Whether the
>> mapping type really matters on x86 or not, I don't know. So I added
>> the nocache variant to arm64 to avoid a change to x86.
>
> My best guess is that it's an x86 bug. ioremap() always uses an uncached
> mapping on x86, so it's strange to see early_ioremap() and set_fixmap_io()
> use a cached mapping. It probably doesn't matter as long as the mtrr is
> set up to treat all MMIO registers as non-cacheable, but I think there
> should not be a difference.

At some point it was believed to be needed on the 8250 driver. Perhaps
Alan can comment since the commit message tells us nothing:

commit 6f441fe99814f64315b8c11890744230b990c460
Author: Alan Cox <alan@lxorguk.ukuu.org.uk>
Date:   Thu May 1 04:34:59 2008 -0700

    8250: switch 8250 drivers to use _nocache ioremaps

    Signed-off-by: Alan Cox <alan@redhat.com>
    Cc: Russell King <rmk@arm.linux.org.uk>
    Cc: Ingo Molnar <mingo@elte.hu>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Rob

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

* Re: [PATCH 4/8] tty/serial: add generic serial earlycon
@ 2014-04-17 18:27             ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-04-17 18:27 UTC (permalink / raw)
  To: Arnd Bergmann, Alan Cox
  Cc: linux-arm-kernel, Catalin Marinas, Russell King,
	Greg Kroah-Hartman, x86, Will Deacon, linux-kernel, linux-serial,
	Jiri Slaby

On Mon, Mar 24, 2014 at 10:42 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Monday 24 March 2014 08:36:46 Rob Herring wrote:
>> On Mon, Mar 24, 2014 at 6:29 AM, Arnd Bergmann <arnd@arndb.de> wrote:
>> > On Monday 24 March 2014 11:22:03 Catalin Marinas wrote:
>> >> On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote:
>> >> > diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
>> >> > new file mode 100644
>> >> > index 0000000..241757a
>> >> > --- /dev/null
>> >> > +++ b/drivers/tty/serial/earlycon.c
>> >> [...]
>> >> > +static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
>> >> > +{
>> >> > +   void __iomem *base;
>> >> > +#ifdef CONFIG_FIX_EARLYCON_MEM
>> >> > +   set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK);
>> >> > +   base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
>> >> > +   base += paddr & ~PAGE_MASK;
>> >> > +#else
>> >> > +   base = ioremap_nocache(paddr, size);
>> >> > +#endif
>> >>
>> >> Just curious why not set_fixmap_io (and plain ioremap)?
>> >
>> > Good point. Note that ioremap_nocache() is the same as ioremap()
>> > on *all* architectures.

Did you mean "not the same"? Why are there 2 flavors if they are
always the same.


>> I investigated this before adding this to arm64. set_fixmap_io and
>> set_fixmap_nocache are not the same settings on x86. Whether the
>> mapping type really matters on x86 or not, I don't know. So I added
>> the nocache variant to arm64 to avoid a change to x86.
>
> My best guess is that it's an x86 bug. ioremap() always uses an uncached
> mapping on x86, so it's strange to see early_ioremap() and set_fixmap_io()
> use a cached mapping. It probably doesn't matter as long as the mtrr is
> set up to treat all MMIO registers as non-cacheable, but I think there
> should not be a difference.

At some point it was believed to be needed on the 8250 driver. Perhaps
Alan can comment since the commit message tells us nothing:

commit 6f441fe99814f64315b8c11890744230b990c460
Author: Alan Cox <alan@lxorguk.ukuu.org.uk>
Date:   Thu May 1 04:34:59 2008 -0700

    8250: switch 8250 drivers to use _nocache ioremaps

    Signed-off-by: Alan Cox <alan@redhat.com>
    Cc: Russell King <rmk@arm.linux.org.uk>
    Cc: Ingo Molnar <mingo@elte.hu>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Rob

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

* [PATCH 4/8] tty/serial: add generic serial earlycon
@ 2014-04-17 18:27             ` Rob Herring
  0 siblings, 0 replies; 90+ messages in thread
From: Rob Herring @ 2014-04-17 18:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 24, 2014 at 10:42 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Monday 24 March 2014 08:36:46 Rob Herring wrote:
>> On Mon, Mar 24, 2014 at 6:29 AM, Arnd Bergmann <arnd@arndb.de> wrote:
>> > On Monday 24 March 2014 11:22:03 Catalin Marinas wrote:
>> >> On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote:
>> >> > diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
>> >> > new file mode 100644
>> >> > index 0000000..241757a
>> >> > --- /dev/null
>> >> > +++ b/drivers/tty/serial/earlycon.c
>> >> [...]
>> >> > +static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
>> >> > +{
>> >> > +   void __iomem *base;
>> >> > +#ifdef CONFIG_FIX_EARLYCON_MEM
>> >> > +   set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK);
>> >> > +   base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
>> >> > +   base += paddr & ~PAGE_MASK;
>> >> > +#else
>> >> > +   base = ioremap_nocache(paddr, size);
>> >> > +#endif
>> >>
>> >> Just curious why not set_fixmap_io (and plain ioremap)?
>> >
>> > Good point. Note that ioremap_nocache() is the same as ioremap()
>> > on *all* architectures.

Did you mean "not the same"? Why are there 2 flavors if they are
always the same.


>> I investigated this before adding this to arm64. set_fixmap_io and
>> set_fixmap_nocache are not the same settings on x86. Whether the
>> mapping type really matters on x86 or not, I don't know. So I added
>> the nocache variant to arm64 to avoid a change to x86.
>
> My best guess is that it's an x86 bug. ioremap() always uses an uncached
> mapping on x86, so it's strange to see early_ioremap() and set_fixmap_io()
> use a cached mapping. It probably doesn't matter as long as the mtrr is
> set up to treat all MMIO registers as non-cacheable, but I think there
> should not be a difference.

At some point it was believed to be needed on the 8250 driver. Perhaps
Alan can comment since the commit message tells us nothing:

commit 6f441fe99814f64315b8c11890744230b990c460
Author: Alan Cox <alan@lxorguk.ukuu.org.uk>
Date:   Thu May 1 04:34:59 2008 -0700

    8250: switch 8250 drivers to use _nocache ioremaps

    Signed-off-by: Alan Cox <alan@redhat.com>
    Cc: Russell King <rmk@arm.linux.org.uk>
    Cc: Ingo Molnar <mingo@elte.hu>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Rob

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

* Re: [PATCH 4/8] tty/serial: add generic serial earlycon
  2014-04-17 18:27             ` Rob Herring
  (?)
@ 2014-04-17 20:16               ` Alan Cox
  -1 siblings, 0 replies; 90+ messages in thread
From: Alan Cox @ 2014-04-17 20:16 UTC (permalink / raw)
  To: Rob Herring
  Cc: Arnd Bergmann, linux-arm-kernel, Catalin Marinas, Russell King,
	Greg Kroah-Hartman, x86, Will Deacon, linux-kernel, linux-serial,
	Jiri Slaby

> At some point it was believed to be needed on the 8250 driver. Perhaps
> Alan can comment since the commit message tells us nothing:

Don't remember sorry - I guess at the time someone had ioremap on their
plaform acting as cached. It was a long time ago 8)

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

* Re: [PATCH 4/8] tty/serial: add generic serial earlycon
@ 2014-04-17 20:16               ` Alan Cox
  0 siblings, 0 replies; 90+ messages in thread
From: Alan Cox @ 2014-04-17 20:16 UTC (permalink / raw)
  To: Rob Herring
  Cc: Arnd Bergmann, linux-arm-kernel, Catalin Marinas, Russell King,
	Greg Kroah-Hartman, x86, Will Deacon, linux-kernel, linux-serial,
	Jiri Slaby

> At some point it was believed to be needed on the 8250 driver. Perhaps
> Alan can comment since the commit message tells us nothing:

Don't remember sorry - I guess at the time someone had ioremap on their
plaform acting as cached. It was a long time ago 8)

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

* [PATCH 4/8] tty/serial: add generic serial earlycon
@ 2014-04-17 20:16               ` Alan Cox
  0 siblings, 0 replies; 90+ messages in thread
From: Alan Cox @ 2014-04-17 20:16 UTC (permalink / raw)
  To: linux-arm-kernel

> At some point it was believed to be needed on the 8250 driver. Perhaps
> Alan can comment since the commit message tells us nothing:

Don't remember sorry - I guess at the time someone had ioremap on their
plaform acting as cached. It was a long time ago 8)

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

* Re: [PATCH 4/8] tty/serial: add generic serial earlycon
  2014-04-17 18:27             ` Rob Herring
  (?)
@ 2014-04-19 11:32               ` Arnd Bergmann
  -1 siblings, 0 replies; 90+ messages in thread
From: Arnd Bergmann @ 2014-04-19 11:32 UTC (permalink / raw)
  To: Rob Herring
  Cc: Alan Cox, linux-arm-kernel, Catalin Marinas, Russell King,
	Greg Kroah-Hartman, x86, Will Deacon, linux-kernel, linux-serial,
	Jiri Slaby

On Thursday 17 April 2014, Rob Herring wrote:
> On Mon, Mar 24, 2014 at 10:42 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Monday 24 March 2014 08:36:46 Rob Herring wrote:
> >> On Mon, Mar 24, 2014 at 6:29 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> >> > On Monday 24 March 2014 11:22:03 Catalin Marinas wrote:
> >> >> On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote:
> >> >> > diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
> >> >> > new file mode 100644
> >> >> > index 0000000..241757a
> >> >> > --- /dev/null
> >> >> > +++ b/drivers/tty/serial/earlycon.c
> >> >> [...]
> >> >> > +static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
> >> >> > +{
> >> >> > +   void __iomem *base;
> >> >> > +#ifdef CONFIG_FIX_EARLYCON_MEM
> >> >> > +   set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK);
> >> >> > +   base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
> >> >> > +   base += paddr & ~PAGE_MASK;
> >> >> > +#else
> >> >> > +   base = ioremap_nocache(paddr, size);
> >> >> > +#endif
> >> >>
> >> >> Just curious why not set_fixmap_io (and plain ioremap)?
> >> >
> >> > Good point. Note that ioremap_nocache() is the same as ioremap()
> >> > on *all* architectures.
> 
> Did you mean "not the same"?

No

> Why are there 2 flavors if they are
> always the same.

I assume it's just a mistake someone made a long time ago and nobody
ever changed it because they didn't want to break obscure code.

x86 seems to be a bit odd here, because is has both page-table
and MTRR method of setting up whether an access can be cached or not.
This may have led to the introduction of the _nocache variant, when
the regular ioremap was already uncached on all other architectures
but cached on x86.

	Arnd

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

* Re: [PATCH 4/8] tty/serial: add generic serial earlycon
@ 2014-04-19 11:32               ` Arnd Bergmann
  0 siblings, 0 replies; 90+ messages in thread
From: Arnd Bergmann @ 2014-04-19 11:32 UTC (permalink / raw)
  To: Rob Herring
  Cc: Alan Cox, linux-arm-kernel, Catalin Marinas, Russell King,
	Greg Kroah-Hartman, x86, Will Deacon, linux-kernel, linux-serial,
	Jiri Slaby

On Thursday 17 April 2014, Rob Herring wrote:
> On Mon, Mar 24, 2014 at 10:42 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Monday 24 March 2014 08:36:46 Rob Herring wrote:
> >> On Mon, Mar 24, 2014 at 6:29 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> >> > On Monday 24 March 2014 11:22:03 Catalin Marinas wrote:
> >> >> On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote:
> >> >> > diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
> >> >> > new file mode 100644
> >> >> > index 0000000..241757a
> >> >> > --- /dev/null
> >> >> > +++ b/drivers/tty/serial/earlycon.c
> >> >> [...]
> >> >> > +static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
> >> >> > +{
> >> >> > +   void __iomem *base;
> >> >> > +#ifdef CONFIG_FIX_EARLYCON_MEM
> >> >> > +   set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK);
> >> >> > +   base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
> >> >> > +   base += paddr & ~PAGE_MASK;
> >> >> > +#else
> >> >> > +   base = ioremap_nocache(paddr, size);
> >> >> > +#endif
> >> >>
> >> >> Just curious why not set_fixmap_io (and plain ioremap)?
> >> >
> >> > Good point. Note that ioremap_nocache() is the same as ioremap()
> >> > on *all* architectures.
> 
> Did you mean "not the same"?

No

> Why are there 2 flavors if they are
> always the same.

I assume it's just a mistake someone made a long time ago and nobody
ever changed it because they didn't want to break obscure code.

x86 seems to be a bit odd here, because is has both page-table
and MTRR method of setting up whether an access can be cached or not.
This may have led to the introduction of the _nocache variant, when
the regular ioremap was already uncached on all other architectures
but cached on x86.

	Arnd

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

* [PATCH 4/8] tty/serial: add generic serial earlycon
@ 2014-04-19 11:32               ` Arnd Bergmann
  0 siblings, 0 replies; 90+ messages in thread
From: Arnd Bergmann @ 2014-04-19 11:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 17 April 2014, Rob Herring wrote:
> On Mon, Mar 24, 2014 at 10:42 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Monday 24 March 2014 08:36:46 Rob Herring wrote:
> >> On Mon, Mar 24, 2014 at 6:29 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> >> > On Monday 24 March 2014 11:22:03 Catalin Marinas wrote:
> >> >> On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote:
> >> >> > diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
> >> >> > new file mode 100644
> >> >> > index 0000000..241757a
> >> >> > --- /dev/null
> >> >> > +++ b/drivers/tty/serial/earlycon.c
> >> >> [...]
> >> >> > +static void __iomem * __init earlycon_map(unsigned long paddr, size_t size)
> >> >> > +{
> >> >> > +   void __iomem *base;
> >> >> > +#ifdef CONFIG_FIX_EARLYCON_MEM
> >> >> > +   set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK);
> >> >> > +   base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
> >> >> > +   base += paddr & ~PAGE_MASK;
> >> >> > +#else
> >> >> > +   base = ioremap_nocache(paddr, size);
> >> >> > +#endif
> >> >>
> >> >> Just curious why not set_fixmap_io (and plain ioremap)?
> >> >
> >> > Good point. Note that ioremap_nocache() is the same as ioremap()
> >> > on *all* architectures.
> 
> Did you mean "not the same"?

No

> Why are there 2 flavors if they are
> always the same.

I assume it's just a mistake someone made a long time ago and nobody
ever changed it because they didn't want to break obscure code.

x86 seems to be a bit odd here, because is has both page-table
and MTRR method of setting up whether an access can be cached or not.
This may have led to the introduction of the _nocache variant, when
the regular ioremap was already uncached on all other architectures
but cached on x86.

	Arnd

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

* Re: [PATCH 6/8] tty/serial: pl011: add generic earlycon support
  2014-04-16 22:14       ` Rob Herring
  (?)
@ 2014-04-23 16:39         ` Catalin Marinas
  -1 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-04-23 16:39 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Russell King, Will Deacon, x86, Arnd Bergmann

On Wed, Apr 16, 2014 at 11:14:28PM +0100, Rob Herring wrote:
> On Mon, Mar 24, 2014 at 6:28 AM, Catalin Marinas
> <catalin.marinas@arm.com> wrote:
> > On Fri, Mar 21, 2014 at 09:08:46PM +0000, Rob Herring wrote:
> >> From: Rob Herring <robh@kernel.org>
> >>
> >> Add earlycon support for the pl011 serial port. This allows enabling
> >> the pl011 for console when early_params are processed. This is based
> >> on the arm64 earlyprintk support and is intended to replace it.
> >>
> >> Signed-off-by: Rob Herring <robh@kernel.org>
> >> Cc: Russell King <linux@arm.linux.org.uk>
> >> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >> Cc: Jiri Slaby <jslaby@suse.cz>
> >> ---
> >>  Documentation/kernel-parameters.txt |  5 +++--
> >>  drivers/tty/serial/amba-pl011.c     | 30 +++++++++++++++++++++++++++++-
> >>  2 files changed, 32 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> >> index 5ce8b7a..81bdd52 100644
> >> --- a/Documentation/kernel-parameters.txt
> >> +++ b/Documentation/kernel-parameters.txt
> >> @@ -887,8 +887,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
> >>               uart[8250],io,<addr>[,options]
> >>               uart[8250],mmio,<addr>[,options]
> >>               uart[8250],mmio32,<addr>[,options]
> >> -                     Start an early, polled-mode console on the 8250/16550
> >> -                     UART at the specified I/O port or MMIO address.
> >> +             pl011,<addr>
> >> +                     Start an early, polled-mode console on a serial port
> >> +                     at the specified I/O port or MMIO address. 8250
> >>                       MMIO inter-register address stride is either 8-bit
> >>                       (mmio) or 32-bit (mmio32).
> >>                       The options are the same as for ttyS, above.
> >
> > I think the last line is a bit misleading. Or did you intend to leave it
> > with the uart[8250] parameter? See below:
> 
> How about this (excuse the gmail lack of tabs):
> 
> earlycon= [KNL] Output early console device and options.
> 
>  uart[8250],io,<addr>[,options]
>  uart[8250],mmio,<addr>[,options]
>  uart[8250],mmio32,<addr>[,options]
>   Start an early, polled-mode console on an 8250 serial
>   port at the specified I/O port or MMIO address. 8250
>   MMIO inter-register address stride is either 8-bit
>   (mmio) or 32-bit (mmio32).
> 
>   The options are the same as for ttyS, above.
> 
>  pl011,<addr>
>   Start an early, polled-mode console on a pl011 serial
>   port at the specified address. The pl011 serial port
>   must already be setup and configured. Options are not
>   yet supported.
> 
>  smh Use ARM semihosting calls for early console.

It looks fine.

> >> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> >> index d4eda24..4227c0a 100644
> >> --- a/drivers/tty/serial/amba-pl011.c
> >> +++ b/drivers/tty/serial/amba-pl011.c
> > [...]
> >> +static int __init pl011_early_console_setup(struct earlycon_device *device,
> >> +                                         const char *opt)
> >> +{
> >> +     if (!device->port.membase)
> >> +             return -ENODEV;
> >> +
> >> +     device->con->write = pl011_early_write;
> >> +     return 0;
> >> +}
> >> +EARLYCON_DECLARE(pl011, pl011_early_console_setup);
> >
> > Here we expect the PL011 to be already initialised by the boot loader
> > and the kernel continues using the same settings. So maybe clarify this
> > in the pl011 kernel parameter doc and we can add proper configuration
> > using a separate patch.
> 
> Enabling and setup would not be too hard, but either baud rate will
> always have to be configured or we'll have to specify the input clock
> rate too. The 8250 driver basically does the former or assumes a fixed
> clock.
> 
> Adding any setup will also break any non-pl011 based SBSA compliant
> uart since the configuration registers are not standardized. I guess
> we can add "sbsauart" when/if that happens.

I think for now we can assume that the pl011 is initialised at the
right baud rate prior to starting the kernel.

-- 
Catalin

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

* Re: [PATCH 6/8] tty/serial: pl011: add generic earlycon support
@ 2014-04-23 16:39         ` Catalin Marinas
  0 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-04-23 16:39 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-arm-kernel, linux-kernel, linux-serial, Greg Kroah-Hartman,
	Jiri Slaby, Russell King, Will Deacon, x86, Arnd Bergmann

On Wed, Apr 16, 2014 at 11:14:28PM +0100, Rob Herring wrote:
> On Mon, Mar 24, 2014 at 6:28 AM, Catalin Marinas
> <catalin.marinas@arm.com> wrote:
> > On Fri, Mar 21, 2014 at 09:08:46PM +0000, Rob Herring wrote:
> >> From: Rob Herring <robh@kernel.org>
> >>
> >> Add earlycon support for the pl011 serial port. This allows enabling
> >> the pl011 for console when early_params are processed. This is based
> >> on the arm64 earlyprintk support and is intended to replace it.
> >>
> >> Signed-off-by: Rob Herring <robh@kernel.org>
> >> Cc: Russell King <linux@arm.linux.org.uk>
> >> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >> Cc: Jiri Slaby <jslaby@suse.cz>
> >> ---
> >>  Documentation/kernel-parameters.txt |  5 +++--
> >>  drivers/tty/serial/amba-pl011.c     | 30 +++++++++++++++++++++++++++++-
> >>  2 files changed, 32 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> >> index 5ce8b7a..81bdd52 100644
> >> --- a/Documentation/kernel-parameters.txt
> >> +++ b/Documentation/kernel-parameters.txt
> >> @@ -887,8 +887,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
> >>               uart[8250],io,<addr>[,options]
> >>               uart[8250],mmio,<addr>[,options]
> >>               uart[8250],mmio32,<addr>[,options]
> >> -                     Start an early, polled-mode console on the 8250/16550
> >> -                     UART at the specified I/O port or MMIO address.
> >> +             pl011,<addr>
> >> +                     Start an early, polled-mode console on a serial port
> >> +                     at the specified I/O port or MMIO address. 8250
> >>                       MMIO inter-register address stride is either 8-bit
> >>                       (mmio) or 32-bit (mmio32).
> >>                       The options are the same as for ttyS, above.
> >
> > I think the last line is a bit misleading. Or did you intend to leave it
> > with the uart[8250] parameter? See below:
> 
> How about this (excuse the gmail lack of tabs):
> 
> earlycon= [KNL] Output early console device and options.
> 
>  uart[8250],io,<addr>[,options]
>  uart[8250],mmio,<addr>[,options]
>  uart[8250],mmio32,<addr>[,options]
>   Start an early, polled-mode console on an 8250 serial
>   port at the specified I/O port or MMIO address. 8250
>   MMIO inter-register address stride is either 8-bit
>   (mmio) or 32-bit (mmio32).
> 
>   The options are the same as for ttyS, above.
> 
>  pl011,<addr>
>   Start an early, polled-mode console on a pl011 serial
>   port at the specified address. The pl011 serial port
>   must already be setup and configured. Options are not
>   yet supported.
> 
>  smh Use ARM semihosting calls for early console.

It looks fine.

> >> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> >> index d4eda24..4227c0a 100644
> >> --- a/drivers/tty/serial/amba-pl011.c
> >> +++ b/drivers/tty/serial/amba-pl011.c
> > [...]
> >> +static int __init pl011_early_console_setup(struct earlycon_device *device,
> >> +                                         const char *opt)
> >> +{
> >> +     if (!device->port.membase)
> >> +             return -ENODEV;
> >> +
> >> +     device->con->write = pl011_early_write;
> >> +     return 0;
> >> +}
> >> +EARLYCON_DECLARE(pl011, pl011_early_console_setup);
> >
> > Here we expect the PL011 to be already initialised by the boot loader
> > and the kernel continues using the same settings. So maybe clarify this
> > in the pl011 kernel parameter doc and we can add proper configuration
> > using a separate patch.
> 
> Enabling and setup would not be too hard, but either baud rate will
> always have to be configured or we'll have to specify the input clock
> rate too. The 8250 driver basically does the former or assumes a fixed
> clock.
> 
> Adding any setup will also break any non-pl011 based SBSA compliant
> uart since the configuration registers are not standardized. I guess
> we can add "sbsauart" when/if that happens.

I think for now we can assume that the pl011 is initialised at the
right baud rate prior to starting the kernel.

-- 
Catalin

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

* [PATCH 6/8] tty/serial: pl011: add generic earlycon support
@ 2014-04-23 16:39         ` Catalin Marinas
  0 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2014-04-23 16:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 16, 2014 at 11:14:28PM +0100, Rob Herring wrote:
> On Mon, Mar 24, 2014 at 6:28 AM, Catalin Marinas
> <catalin.marinas@arm.com> wrote:
> > On Fri, Mar 21, 2014 at 09:08:46PM +0000, Rob Herring wrote:
> >> From: Rob Herring <robh@kernel.org>
> >>
> >> Add earlycon support for the pl011 serial port. This allows enabling
> >> the pl011 for console when early_params are processed. This is based
> >> on the arm64 earlyprintk support and is intended to replace it.
> >>
> >> Signed-off-by: Rob Herring <robh@kernel.org>
> >> Cc: Russell King <linux@arm.linux.org.uk>
> >> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >> Cc: Jiri Slaby <jslaby@suse.cz>
> >> ---
> >>  Documentation/kernel-parameters.txt |  5 +++--
> >>  drivers/tty/serial/amba-pl011.c     | 30 +++++++++++++++++++++++++++++-
> >>  2 files changed, 32 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> >> index 5ce8b7a..81bdd52 100644
> >> --- a/Documentation/kernel-parameters.txt
> >> +++ b/Documentation/kernel-parameters.txt
> >> @@ -887,8 +887,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
> >>               uart[8250],io,<addr>[,options]
> >>               uart[8250],mmio,<addr>[,options]
> >>               uart[8250],mmio32,<addr>[,options]
> >> -                     Start an early, polled-mode console on the 8250/16550
> >> -                     UART at the specified I/O port or MMIO address.
> >> +             pl011,<addr>
> >> +                     Start an early, polled-mode console on a serial port
> >> +                     at the specified I/O port or MMIO address. 8250
> >>                       MMIO inter-register address stride is either 8-bit
> >>                       (mmio) or 32-bit (mmio32).
> >>                       The options are the same as for ttyS, above.
> >
> > I think the last line is a bit misleading. Or did you intend to leave it
> > with the uart[8250] parameter? See below:
> 
> How about this (excuse the gmail lack of tabs):
> 
> earlycon= [KNL] Output early console device and options.
> 
>  uart[8250],io,<addr>[,options]
>  uart[8250],mmio,<addr>[,options]
>  uart[8250],mmio32,<addr>[,options]
>   Start an early, polled-mode console on an 8250 serial
>   port at the specified I/O port or MMIO address. 8250
>   MMIO inter-register address stride is either 8-bit
>   (mmio) or 32-bit (mmio32).
> 
>   The options are the same as for ttyS, above.
> 
>  pl011,<addr>
>   Start an early, polled-mode console on a pl011 serial
>   port at the specified address. The pl011 serial port
>   must already be setup and configured. Options are not
>   yet supported.
> 
>  smh Use ARM semihosting calls for early console.

It looks fine.

> >> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> >> index d4eda24..4227c0a 100644
> >> --- a/drivers/tty/serial/amba-pl011.c
> >> +++ b/drivers/tty/serial/amba-pl011.c
> > [...]
> >> +static int __init pl011_early_console_setup(struct earlycon_device *device,
> >> +                                         const char *opt)
> >> +{
> >> +     if (!device->port.membase)
> >> +             return -ENODEV;
> >> +
> >> +     device->con->write = pl011_early_write;
> >> +     return 0;
> >> +}
> >> +EARLYCON_DECLARE(pl011, pl011_early_console_setup);
> >
> > Here we expect the PL011 to be already initialised by the boot loader
> > and the kernel continues using the same settings. So maybe clarify this
> > in the pl011 kernel parameter doc and we can add proper configuration
> > using a separate patch.
> 
> Enabling and setup would not be too hard, but either baud rate will
> always have to be configured or we'll have to specify the input clock
> rate too. The 8250 driver basically does the former or assumes a fixed
> clock.
> 
> Adding any setup will also break any non-pl011 based SBSA compliant
> uart since the configuration registers are not standardized. I guess
> we can add "sbsauart" when/if that happens.

I think for now we can assume that the pl011 is initialised at the
right baud rate prior to starting the kernel.

-- 
Catalin

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

end of thread, other threads:[~2014-04-23 16:40 UTC | newest]

Thread overview: 90+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-21 21:08 [PATCH 0/8] Generic serial earlycon Rob Herring
2014-03-21 21:08 ` Rob Herring
     [not found] ` < 201403221054.39799.arnd@arndb.de>
     [not found]   ` < CAL_JsqKjGjyYypwneCmNc1qeKe0ZOG9gz3QSJ37-HwHXKu3iRA@mail.gmail.com>
     [not found]     ` < 20140329001732.BECE2C41FF4@trevor.secretlab.ca>
2014-03-21 21:08 ` [PATCH 1/8] x86: move FIX_EARLYCON_MEM kconfig into x86 Rob Herring
2014-03-21 21:08   ` Rob Herring
2014-03-21 21:08   ` Rob Herring
2014-03-21 21:08 ` [PATCH 2/8] arm64: add FIXMAP_PAGE_NOCACHE definition Rob Herring
2014-03-21 21:08   ` Rob Herring
2014-03-24 11:13   ` Catalin Marinas
2014-03-24 11:13     ` Catalin Marinas
2014-03-24 11:13     ` Catalin Marinas
2014-03-21 21:08 ` [PATCH 3/8] arm64: enable FIX_EARLYCON_MEM kconfig Rob Herring
2014-03-21 21:08   ` Rob Herring
2014-03-24 11:38   ` Catalin Marinas
2014-03-24 11:38     ` Catalin Marinas
2014-03-24 11:38     ` Catalin Marinas
2014-03-21 21:08 ` [PATCH 4/8] tty/serial: add generic serial earlycon Rob Herring
2014-03-21 21:08   ` Rob Herring
2014-03-24 11:22   ` Catalin Marinas
2014-03-24 11:22     ` Catalin Marinas
2014-03-24 11:22     ` Catalin Marinas
2014-03-24 11:29     ` Arnd Bergmann
2014-03-24 11:29       ` Arnd Bergmann
2014-03-24 13:36       ` Rob Herring
2014-03-24 13:36         ` Rob Herring
2014-03-24 13:36         ` Rob Herring
2014-03-24 15:42         ` Arnd Bergmann
2014-03-24 15:42           ` Arnd Bergmann
2014-03-24 15:42           ` Arnd Bergmann
2014-04-17 18:27           ` Rob Herring
2014-04-17 18:27             ` Rob Herring
2014-04-17 18:27             ` Rob Herring
2014-04-17 20:16             ` Alan Cox
2014-04-17 20:16               ` Alan Cox
2014-04-17 20:16               ` Alan Cox
2014-04-19 11:32             ` Arnd Bergmann
2014-04-19 11:32               ` Arnd Bergmann
2014-04-19 11:32               ` Arnd Bergmann
2014-03-21 21:08 ` [PATCH 5/8] tty/serial: convert 8250 to generic earlycon Rob Herring
2014-03-21 21:08   ` Rob Herring
2014-03-21 21:08 ` [PATCH 6/8] tty/serial: pl011: add generic earlycon support Rob Herring
2014-03-21 21:08   ` Rob Herring
2014-03-24 11:28   ` Catalin Marinas
2014-03-24 11:28     ` Catalin Marinas
2014-03-24 11:28     ` Catalin Marinas
2014-04-16 22:14     ` Rob Herring
2014-04-16 22:14       ` Rob Herring
2014-04-16 22:14       ` Rob Herring
2014-04-23 16:39       ` Catalin Marinas
2014-04-23 16:39         ` Catalin Marinas
2014-04-23 16:39         ` Catalin Marinas
2014-03-21 21:08 ` [PATCH 7/8] tty/serial: add arm64 semihosting earlycon Rob Herring
2014-03-21 21:08   ` Rob Herring
2014-03-23 20:04   ` Nicolas Pitre
2014-03-23 20:04     ` Nicolas Pitre
2014-03-23 20:23     ` Arnd Bergmann
2014-03-23 20:23       ` Arnd Bergmann
2014-03-23 21:48       ` Nicolas Pitre
2014-03-23 21:48         ` Nicolas Pitre
2014-03-24 11:38   ` Catalin Marinas
2014-03-24 11:38     ` Catalin Marinas
2014-03-24 11:38     ` Catalin Marinas
2014-03-24 11:48     ` Catalin Marinas
2014-03-24 11:48       ` Catalin Marinas
2014-03-24 11:48       ` Catalin Marinas
2014-03-21 21:08 ` [PATCH 8/8] arm64: remove arch specific earlyprintk Rob Herring
2014-03-21 21:08   ` Rob Herring
2014-03-22  9:54 ` [PATCH 0/8] Generic serial earlycon Arnd Bergmann
2014-03-22  9:54   ` Arnd Bergmann
2014-03-22  9:54   ` Arnd Bergmann
2014-03-22 14:14   ` Rob Herring
2014-03-22 14:14     ` Rob Herring
2014-03-22 14:14     ` Rob Herring
2014-03-22 22:01     ` Arnd Bergmann
2014-03-22 22:01       ` Arnd Bergmann
2014-03-22 22:01       ` Arnd Bergmann
2014-03-23 15:09       ` Rob Herring
2014-03-23 15:09         ` Rob Herring
2014-03-23 15:09         ` Rob Herring
2014-03-23 19:49         ` Arnd Bergmann
2014-03-23 19:49           ` Arnd Bergmann
2014-03-23 19:49           ` Arnd Bergmann
2014-03-29  0:17     ` Grant Likely
2014-03-29  0:17       ` Grant Likely
2014-03-29  0:17       ` Grant Likely
2014-03-29 14:33       ` Rob Herring
2014-03-29 14:33         ` Rob Herring
2014-03-29 14:33         ` Rob Herring
2014-03-29 15:34         ` Grant Likely
2014-03-29 15:34           ` Grant Likely
2014-03-29 15:34           ` Grant Likely

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.