All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC 0/2] serial: samsung: add support for early console
@ 2014-09-22 13:14 ` Marek Szyprowski
  0 siblings, 0 replies; 18+ messages in thread
From: Marek Szyprowski @ 2014-09-22 13:14 UTC (permalink / raw)
  To: linux-samsung-soc, linux-arm-kernel
  Cc: Marek Szyprowski, Alim Akhtar, thomas.ab, Tomasz Figa,
	Kyungmin Park, Rob Herring

Hello,

This patchset adds support for early console defined in device tree. As
an example, DTS files for all Exynos4 based machines are updated with
the correct value for common chosen/sdtout property.

To get it fully functional additional improvements (support for
early_ioremap) are needed in early console code.

Best regards
Marek Szyprowski
Samsung R&D Institute Poland


Patch summary:

Tomasz Figa (2):
  serial: samsung: Add support for of_earlycon
  ARM: dts: exynos4: Add stdout-path properties

 arch/arm/boot/dts/exynos4210-origen.dts         |  1 +
 arch/arm/boot/dts/exynos4210-smdkv310.dts       |  1 +
 arch/arm/boot/dts/exynos4210-trats.dts          |  1 +
 arch/arm/boot/dts/exynos4210-universal_c210.dts |  1 +
 arch/arm/boot/dts/exynos4412-odroid-common.dtsi |  4 +
 arch/arm/boot/dts/exynos4412-origen.dts         |  1 +
 arch/arm/boot/dts/exynos4412-smdk4412.dts       |  1 +
 arch/arm/boot/dts/exynos4412-tiny4412.dts       |  4 +
 arch/arm/boot/dts/exynos4412-trats2.dts         |  1 +
 drivers/tty/serial/Kconfig                      |  1 +
 drivers/tty/serial/samsung.c                    | 97 +++++++++++++++++++++++++
 11 files changed, 113 insertions(+)

-- 
1.9.2

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

* [PATCH/RFC 0/2] serial: samsung: add support for early console
@ 2014-09-22 13:14 ` Marek Szyprowski
  0 siblings, 0 replies; 18+ messages in thread
From: Marek Szyprowski @ 2014-09-22 13:14 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

This patchset adds support for early console defined in device tree. As
an example, DTS files for all Exynos4 based machines are updated with
the correct value for common chosen/sdtout property.

To get it fully functional additional improvements (support for
early_ioremap) are needed in early console code.

Best regards
Marek Szyprowski
Samsung R&D Institute Poland


Patch summary:

Tomasz Figa (2):
  serial: samsung: Add support for of_earlycon
  ARM: dts: exynos4: Add stdout-path properties

 arch/arm/boot/dts/exynos4210-origen.dts         |  1 +
 arch/arm/boot/dts/exynos4210-smdkv310.dts       |  1 +
 arch/arm/boot/dts/exynos4210-trats.dts          |  1 +
 arch/arm/boot/dts/exynos4210-universal_c210.dts |  1 +
 arch/arm/boot/dts/exynos4412-odroid-common.dtsi |  4 +
 arch/arm/boot/dts/exynos4412-origen.dts         |  1 +
 arch/arm/boot/dts/exynos4412-smdk4412.dts       |  1 +
 arch/arm/boot/dts/exynos4412-tiny4412.dts       |  4 +
 arch/arm/boot/dts/exynos4412-trats2.dts         |  1 +
 drivers/tty/serial/Kconfig                      |  1 +
 drivers/tty/serial/samsung.c                    | 97 +++++++++++++++++++++++++
 11 files changed, 113 insertions(+)

-- 
1.9.2

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

* [PATCH/RFC 1/2] serial: samsung: Add support for of_earlycon
  2014-09-22 13:14 ` Marek Szyprowski
@ 2014-09-22 13:14   ` Marek Szyprowski
  -1 siblings, 0 replies; 18+ messages in thread
From: Marek Szyprowski @ 2014-09-22 13:14 UTC (permalink / raw)
  To: linux-samsung-soc, linux-arm-kernel
  Cc: Marek Szyprowski, Alim Akhtar, thomas.ab, Tomasz Figa,
	Kyungmin Park, Rob Herring

From: Tomasz Figa <t.figa@samsung.com>

This patch adds support for early console initialized from device tree
to all variants of Samsung serial driver.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/tty/serial/Kconfig   |  1 +
 drivers/tty/serial/samsung.c | 97 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 98 insertions(+)

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 26cec64dadd7..e87a2dfd9080 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -222,6 +222,7 @@ config SERIAL_SAMSUNG
 	tristate "Samsung SoC serial support"
 	depends on PLAT_SAMSUNG
 	select SERIAL_CORE
+	select SERIAL_EARLYCON
 	help
 	  Support for the on-chip UARTs on the Samsung S3C24XX series CPUs,
 	  providing /dev/ttySAC0, 1 and 2 (note, some machines may not
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index c78f43a481ce..71829ce2410d 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1856,6 +1856,103 @@ static struct platform_driver samsung_serial_driver = {
 
 module_platform_driver(samsung_serial_driver);
 
+/*
+ * Early console.
+ */
+
+struct samsung_early_console_data {
+	u32 txfull_mask;
+};
+
+static void samsung_early_busyuart(struct uart_port *port)
+{
+	while (!(readl(port->membase + S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXFE))
+		;
+}
+
+static void samsung_early_busyuart_fifo(struct uart_port *port)
+{
+	struct samsung_early_console_data *data = port->private_data;
+
+	while (readl(port->membase + S3C2410_UFSTAT) & data->txfull_mask)
+		;
+}
+
+static void samsung_early_putc(struct uart_port *port, int c)
+{
+	if (readl(port->membase + S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE)
+		samsung_early_busyuart_fifo(port);
+	else
+		samsung_early_busyuart(port);
+
+	writeb(c, port->membase + S3C2410_UTXH);
+}
+
+static void samsung_early_write(struct console *con, const char *s, unsigned n)
+{
+	struct earlycon_device *dev = con->data;
+
+	uart_console_write(&dev->port, s, n, samsung_early_putc);
+}
+
+static int __init samsung_early_console_setup(struct earlycon_device *device,
+					      const char *opt)
+{
+	if (!device->port.membase)
+		return -ENODEV;
+
+	device->con->write = samsung_early_write;
+	return 0;
+}
+
+/* S3C2410, S3C2412 */
+static struct samsung_early_console_data s3c2410_early_console_data = {
+	.txfull_mask = S3C2410_UFSTAT_TXFULL,
+};
+
+static int __init s3c2410_early_console_setup(struct earlycon_device *device,
+					      const char *opt)
+{
+	device->port.private_data = &s3c2410_early_console_data;
+	return samsung_early_console_setup(device, opt);
+}
+OF_EARLYCON_DECLARE(s3c2410, "samsung,s3c2410-uart",
+			s3c2410_early_console_setup);
+
+/* S3C2440, S3C64xx */
+static struct samsung_early_console_data s3c2440_early_console_data = {
+	.txfull_mask = S3C2440_UFSTAT_TXFULL,
+};
+
+static int __init s3c2440_early_console_setup(struct earlycon_device *device,
+					      const char *opt)
+{
+	device->port.private_data = &s3c2440_early_console_data;
+	return samsung_early_console_setup(device, opt);
+}
+OF_EARLYCON_DECLARE(s3c2412, "samsung,s3c2412-uart",
+			s3c2440_early_console_setup);
+OF_EARLYCON_DECLARE(s3c2440, "samsung,s3c2440-uart",
+			s3c2440_early_console_setup);
+OF_EARLYCON_DECLARE(s3c6400, "samsung,s3c6400-uart",
+			s3c2440_early_console_setup);
+
+/* S5PV210, EXYNOS */
+static struct samsung_early_console_data s5pv210_early_console_data = {
+	.txfull_mask = S5PV210_UFSTAT_TXFULL,
+};
+
+static int __init s5pv210_early_console_setup(struct earlycon_device *device,
+					      const char *opt)
+{
+	device->port.private_data = &s5pv210_early_console_data;
+	return samsung_early_console_setup(device, opt);
+}
+OF_EARLYCON_DECLARE(s5pv210, "samsung,s5pv210-uart",
+			s5pv210_early_console_setup);
+OF_EARLYCON_DECLARE(exynos4210, "samsung,exynos4210-uart",
+			s5pv210_early_console_setup);
+
 MODULE_ALIAS("platform:samsung-uart");
 MODULE_DESCRIPTION("Samsung SoC Serial port driver");
 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
-- 
1.9.2

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

* [PATCH/RFC 1/2] serial: samsung: Add support for of_earlycon
@ 2014-09-22 13:14   ` Marek Szyprowski
  0 siblings, 0 replies; 18+ messages in thread
From: Marek Szyprowski @ 2014-09-22 13:14 UTC (permalink / raw)
  To: linux-arm-kernel

From: Tomasz Figa <t.figa@samsung.com>

This patch adds support for early console initialized from device tree
to all variants of Samsung serial driver.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/tty/serial/Kconfig   |  1 +
 drivers/tty/serial/samsung.c | 97 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 98 insertions(+)

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 26cec64dadd7..e87a2dfd9080 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -222,6 +222,7 @@ config SERIAL_SAMSUNG
 	tristate "Samsung SoC serial support"
 	depends on PLAT_SAMSUNG
 	select SERIAL_CORE
+	select SERIAL_EARLYCON
 	help
 	  Support for the on-chip UARTs on the Samsung S3C24XX series CPUs,
 	  providing /dev/ttySAC0, 1 and 2 (note, some machines may not
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index c78f43a481ce..71829ce2410d 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1856,6 +1856,103 @@ static struct platform_driver samsung_serial_driver = {
 
 module_platform_driver(samsung_serial_driver);
 
+/*
+ * Early console.
+ */
+
+struct samsung_early_console_data {
+	u32 txfull_mask;
+};
+
+static void samsung_early_busyuart(struct uart_port *port)
+{
+	while (!(readl(port->membase + S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXFE))
+		;
+}
+
+static void samsung_early_busyuart_fifo(struct uart_port *port)
+{
+	struct samsung_early_console_data *data = port->private_data;
+
+	while (readl(port->membase + S3C2410_UFSTAT) & data->txfull_mask)
+		;
+}
+
+static void samsung_early_putc(struct uart_port *port, int c)
+{
+	if (readl(port->membase + S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE)
+		samsung_early_busyuart_fifo(port);
+	else
+		samsung_early_busyuart(port);
+
+	writeb(c, port->membase + S3C2410_UTXH);
+}
+
+static void samsung_early_write(struct console *con, const char *s, unsigned n)
+{
+	struct earlycon_device *dev = con->data;
+
+	uart_console_write(&dev->port, s, n, samsung_early_putc);
+}
+
+static int __init samsung_early_console_setup(struct earlycon_device *device,
+					      const char *opt)
+{
+	if (!device->port.membase)
+		return -ENODEV;
+
+	device->con->write = samsung_early_write;
+	return 0;
+}
+
+/* S3C2410, S3C2412 */
+static struct samsung_early_console_data s3c2410_early_console_data = {
+	.txfull_mask = S3C2410_UFSTAT_TXFULL,
+};
+
+static int __init s3c2410_early_console_setup(struct earlycon_device *device,
+					      const char *opt)
+{
+	device->port.private_data = &s3c2410_early_console_data;
+	return samsung_early_console_setup(device, opt);
+}
+OF_EARLYCON_DECLARE(s3c2410, "samsung,s3c2410-uart",
+			s3c2410_early_console_setup);
+
+/* S3C2440, S3C64xx */
+static struct samsung_early_console_data s3c2440_early_console_data = {
+	.txfull_mask = S3C2440_UFSTAT_TXFULL,
+};
+
+static int __init s3c2440_early_console_setup(struct earlycon_device *device,
+					      const char *opt)
+{
+	device->port.private_data = &s3c2440_early_console_data;
+	return samsung_early_console_setup(device, opt);
+}
+OF_EARLYCON_DECLARE(s3c2412, "samsung,s3c2412-uart",
+			s3c2440_early_console_setup);
+OF_EARLYCON_DECLARE(s3c2440, "samsung,s3c2440-uart",
+			s3c2440_early_console_setup);
+OF_EARLYCON_DECLARE(s3c6400, "samsung,s3c6400-uart",
+			s3c2440_early_console_setup);
+
+/* S5PV210, EXYNOS */
+static struct samsung_early_console_data s5pv210_early_console_data = {
+	.txfull_mask = S5PV210_UFSTAT_TXFULL,
+};
+
+static int __init s5pv210_early_console_setup(struct earlycon_device *device,
+					      const char *opt)
+{
+	device->port.private_data = &s5pv210_early_console_data;
+	return samsung_early_console_setup(device, opt);
+}
+OF_EARLYCON_DECLARE(s5pv210, "samsung,s5pv210-uart",
+			s5pv210_early_console_setup);
+OF_EARLYCON_DECLARE(exynos4210, "samsung,exynos4210-uart",
+			s5pv210_early_console_setup);
+
 MODULE_ALIAS("platform:samsung-uart");
 MODULE_DESCRIPTION("Samsung SoC Serial port driver");
 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
-- 
1.9.2

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

* [PATCH/RFC 2/2] ARM: dts: exynos4: Add stdout-path properties
  2014-09-22 13:14 ` Marek Szyprowski
@ 2014-09-22 13:14   ` Marek Szyprowski
  -1 siblings, 0 replies; 18+ messages in thread
From: Marek Szyprowski @ 2014-09-22 13:14 UTC (permalink / raw)
  To: linux-samsung-soc, linux-arm-kernel
  Cc: Marek Szyprowski, Alim Akhtar, thomas.ab, Tomasz Figa,
	Kyungmin Park, Rob Herring

From: Tomasz Figa <t.figa@samsung.com>

This patch adds stdout-path property to chosen nodes of Exynos4 boards
to enable use of earlycon feature without the need to hardcode port
number in kernel itself.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 arch/arm/boot/dts/exynos4210-origen.dts         | 1 +
 arch/arm/boot/dts/exynos4210-smdkv310.dts       | 1 +
 arch/arm/boot/dts/exynos4210-trats.dts          | 1 +
 arch/arm/boot/dts/exynos4210-universal_c210.dts | 1 +
 arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 4 ++++
 arch/arm/boot/dts/exynos4412-origen.dts         | 1 +
 arch/arm/boot/dts/exynos4412-smdk4412.dts       | 1 +
 arch/arm/boot/dts/exynos4412-tiny4412.dts       | 4 ++++
 arch/arm/boot/dts/exynos4412-trats2.dts         | 1 +
 9 files changed, 15 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4210-origen.dts b/arch/arm/boot/dts/exynos4210-origen.dts
index f767c425d0b5..b81146141402 100644
--- a/arch/arm/boot/dts/exynos4210-origen.dts
+++ b/arch/arm/boot/dts/exynos4210-origen.dts
@@ -31,6 +31,7 @@
 
 	chosen {
 		bootargs ="root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC2,115200 init=/linuxrc";
+		stdout-path = &serial_2;
 	};
 
 	regulators {
diff --git a/arch/arm/boot/dts/exynos4210-smdkv310.dts b/arch/arm/boot/dts/exynos4210-smdkv310.dts
index 676e6e0c8cf3..86216fff1b4f 100644
--- a/arch/arm/boot/dts/exynos4210-smdkv310.dts
+++ b/arch/arm/boot/dts/exynos4210-smdkv310.dts
@@ -27,6 +27,7 @@
 
 	chosen {
 		bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC1,115200 init=/linuxrc";
+		stdout-path = &serial_1;
 	};
 
 	sdhci@12530000 {
diff --git a/arch/arm/boot/dts/exynos4210-trats.dts b/arch/arm/boot/dts/exynos4210-trats.dts
index f516da9e8b3a..b351c7bddf2d 100644
--- a/arch/arm/boot/dts/exynos4210-trats.dts
+++ b/arch/arm/boot/dts/exynos4210-trats.dts
@@ -28,6 +28,7 @@
 
 	chosen {
 		bootargs = "console=ttySAC2,115200N8 root=/dev/mmcblk0p5 rootwait earlyprintk panic=5";
+		stdout-path = &serial_2;
 	};
 
 	regulators {
diff --git a/arch/arm/boot/dts/exynos4210-universal_c210.dts b/arch/arm/boot/dts/exynos4210-universal_c210.dts
index d50eb3aa708e..e65ee3cb36c3 100644
--- a/arch/arm/boot/dts/exynos4210-universal_c210.dts
+++ b/arch/arm/boot/dts/exynos4210-universal_c210.dts
@@ -26,6 +26,7 @@
 
 	chosen {
 		bootargs = "console=ttySAC2,115200N8 root=/dev/mmcblk0p5 rw rootwait earlyprintk panic=5 maxcpus=1";
+		stdout-path = &serial_2;
 	};
 
 	sysram@02020000 {
diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
index adadaf97ac01..0841fd34f9dd 100644
--- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
+++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
@@ -11,6 +11,10 @@
 #include "exynos4412.dtsi"
 
 / {
+	chosen {
+		stdout-path = &serial_1;
+	};
+
 	firmware@0204F000 {
 		compatible = "samsung,secure-firmware";
 		reg = <0x0204F000 0x1000>;
diff --git a/arch/arm/boot/dts/exynos4412-origen.dts b/arch/arm/boot/dts/exynos4412-origen.dts
index e925c9fbfb07..979dc07c929c 100644
--- a/arch/arm/boot/dts/exynos4412-origen.dts
+++ b/arch/arm/boot/dts/exynos4412-origen.dts
@@ -26,6 +26,7 @@
 
 	chosen {
 		bootargs ="console=ttySAC2,115200";
+		stdout-path = &serial_2;
 	};
 
 	firmware@0203F000 {
diff --git a/arch/arm/boot/dts/exynos4412-smdk4412.dts b/arch/arm/boot/dts/exynos4412-smdk4412.dts
index ded0b70f7644..b9256afbcc68 100644
--- a/arch/arm/boot/dts/exynos4412-smdk4412.dts
+++ b/arch/arm/boot/dts/exynos4412-smdk4412.dts
@@ -25,6 +25,7 @@
 
 	chosen {
 		bootargs ="root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC1,115200 init=/linuxrc";
+		stdout-path = &serial_1;
 	};
 
 	g2d@10800000 {
diff --git a/arch/arm/boot/dts/exynos4412-tiny4412.dts b/arch/arm/boot/dts/exynos4412-tiny4412.dts
index ea6929d9c621..d46fd4c2aeaa 100644
--- a/arch/arm/boot/dts/exynos4412-tiny4412.dts
+++ b/arch/arm/boot/dts/exynos4412-tiny4412.dts
@@ -18,6 +18,10 @@
 	model = "FriendlyARM TINY4412 board based on Exynos4412";
 	compatible = "friendlyarm,tiny4412", "samsung,exynos4412", "samsung,exynos4";
 
+	chosen {
+		stdout-path = &serial_0;
+	};
+
 	memory {
 		reg = <0x40000000 0x40000000>;
 	};
diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
index 11967f4561e0..ade31d3174b0 100644
--- a/arch/arm/boot/dts/exynos4412-trats2.dts
+++ b/arch/arm/boot/dts/exynos4412-trats2.dts
@@ -30,6 +30,7 @@
 
 	chosen {
 		bootargs = "console=ttySAC2,115200N8 root=/dev/mmcblk0p5 rootwait earlyprintk panic=5";
+		stdout-path = &serial_2;
 	};
 
 	firmware@0204F000 {
-- 
1.9.2

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

* [PATCH/RFC 2/2] ARM: dts: exynos4: Add stdout-path properties
@ 2014-09-22 13:14   ` Marek Szyprowski
  0 siblings, 0 replies; 18+ messages in thread
From: Marek Szyprowski @ 2014-09-22 13:14 UTC (permalink / raw)
  To: linux-arm-kernel

From: Tomasz Figa <t.figa@samsung.com>

This patch adds stdout-path property to chosen nodes of Exynos4 boards
to enable use of earlycon feature without the need to hardcode port
number in kernel itself.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 arch/arm/boot/dts/exynos4210-origen.dts         | 1 +
 arch/arm/boot/dts/exynos4210-smdkv310.dts       | 1 +
 arch/arm/boot/dts/exynos4210-trats.dts          | 1 +
 arch/arm/boot/dts/exynos4210-universal_c210.dts | 1 +
 arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 4 ++++
 arch/arm/boot/dts/exynos4412-origen.dts         | 1 +
 arch/arm/boot/dts/exynos4412-smdk4412.dts       | 1 +
 arch/arm/boot/dts/exynos4412-tiny4412.dts       | 4 ++++
 arch/arm/boot/dts/exynos4412-trats2.dts         | 1 +
 9 files changed, 15 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4210-origen.dts b/arch/arm/boot/dts/exynos4210-origen.dts
index f767c425d0b5..b81146141402 100644
--- a/arch/arm/boot/dts/exynos4210-origen.dts
+++ b/arch/arm/boot/dts/exynos4210-origen.dts
@@ -31,6 +31,7 @@
 
 	chosen {
 		bootargs ="root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC2,115200 init=/linuxrc";
+		stdout-path = &serial_2;
 	};
 
 	regulators {
diff --git a/arch/arm/boot/dts/exynos4210-smdkv310.dts b/arch/arm/boot/dts/exynos4210-smdkv310.dts
index 676e6e0c8cf3..86216fff1b4f 100644
--- a/arch/arm/boot/dts/exynos4210-smdkv310.dts
+++ b/arch/arm/boot/dts/exynos4210-smdkv310.dts
@@ -27,6 +27,7 @@
 
 	chosen {
 		bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC1,115200 init=/linuxrc";
+		stdout-path = &serial_1;
 	};
 
 	sdhci at 12530000 {
diff --git a/arch/arm/boot/dts/exynos4210-trats.dts b/arch/arm/boot/dts/exynos4210-trats.dts
index f516da9e8b3a..b351c7bddf2d 100644
--- a/arch/arm/boot/dts/exynos4210-trats.dts
+++ b/arch/arm/boot/dts/exynos4210-trats.dts
@@ -28,6 +28,7 @@
 
 	chosen {
 		bootargs = "console=ttySAC2,115200N8 root=/dev/mmcblk0p5 rootwait earlyprintk panic=5";
+		stdout-path = &serial_2;
 	};
 
 	regulators {
diff --git a/arch/arm/boot/dts/exynos4210-universal_c210.dts b/arch/arm/boot/dts/exynos4210-universal_c210.dts
index d50eb3aa708e..e65ee3cb36c3 100644
--- a/arch/arm/boot/dts/exynos4210-universal_c210.dts
+++ b/arch/arm/boot/dts/exynos4210-universal_c210.dts
@@ -26,6 +26,7 @@
 
 	chosen {
 		bootargs = "console=ttySAC2,115200N8 root=/dev/mmcblk0p5 rw rootwait earlyprintk panic=5 maxcpus=1";
+		stdout-path = &serial_2;
 	};
 
 	sysram at 02020000 {
diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
index adadaf97ac01..0841fd34f9dd 100644
--- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
+++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
@@ -11,6 +11,10 @@
 #include "exynos4412.dtsi"
 
 / {
+	chosen {
+		stdout-path = &serial_1;
+	};
+
 	firmware at 0204F000 {
 		compatible = "samsung,secure-firmware";
 		reg = <0x0204F000 0x1000>;
diff --git a/arch/arm/boot/dts/exynos4412-origen.dts b/arch/arm/boot/dts/exynos4412-origen.dts
index e925c9fbfb07..979dc07c929c 100644
--- a/arch/arm/boot/dts/exynos4412-origen.dts
+++ b/arch/arm/boot/dts/exynos4412-origen.dts
@@ -26,6 +26,7 @@
 
 	chosen {
 		bootargs ="console=ttySAC2,115200";
+		stdout-path = &serial_2;
 	};
 
 	firmware at 0203F000 {
diff --git a/arch/arm/boot/dts/exynos4412-smdk4412.dts b/arch/arm/boot/dts/exynos4412-smdk4412.dts
index ded0b70f7644..b9256afbcc68 100644
--- a/arch/arm/boot/dts/exynos4412-smdk4412.dts
+++ b/arch/arm/boot/dts/exynos4412-smdk4412.dts
@@ -25,6 +25,7 @@
 
 	chosen {
 		bootargs ="root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC1,115200 init=/linuxrc";
+		stdout-path = &serial_1;
 	};
 
 	g2d at 10800000 {
diff --git a/arch/arm/boot/dts/exynos4412-tiny4412.dts b/arch/arm/boot/dts/exynos4412-tiny4412.dts
index ea6929d9c621..d46fd4c2aeaa 100644
--- a/arch/arm/boot/dts/exynos4412-tiny4412.dts
+++ b/arch/arm/boot/dts/exynos4412-tiny4412.dts
@@ -18,6 +18,10 @@
 	model = "FriendlyARM TINY4412 board based on Exynos4412";
 	compatible = "friendlyarm,tiny4412", "samsung,exynos4412", "samsung,exynos4";
 
+	chosen {
+		stdout-path = &serial_0;
+	};
+
 	memory {
 		reg = <0x40000000 0x40000000>;
 	};
diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
index 11967f4561e0..ade31d3174b0 100644
--- a/arch/arm/boot/dts/exynos4412-trats2.dts
+++ b/arch/arm/boot/dts/exynos4412-trats2.dts
@@ -30,6 +30,7 @@
 
 	chosen {
 		bootargs = "console=ttySAC2,115200N8 root=/dev/mmcblk0p5 rootwait earlyprintk panic=5";
+		stdout-path = &serial_2;
 	};
 
 	firmware at 0204F000 {
-- 
1.9.2

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

* Re: [PATCH/RFC 0/2] serial: samsung: add support for early console
  2014-09-22 13:14 ` Marek Szyprowski
@ 2014-09-23 12:53   ` Alim Akhtar
  -1 siblings, 0 replies; 18+ messages in thread
From: Alim Akhtar @ 2014-09-23 12:53 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: linux-samsung-soc, linux-arm-kernel, Alim Akhtar,
	Thomas P Abraham, Tomasz Figa, Kyungmin Park, Rob Herring

Hi Marek,

On Mon, Sep 22, 2014 at 6:44 PM, Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
> Hello,
>
> This patchset adds support for early console defined in device tree. As
> an example, DTS files for all Exynos4 based machines are updated with
> the correct value for common chosen/sdtout property.
>
> To get it fully functional additional improvements (support for
> early_ioremap) are needed in early console code.
>
Is these really tested?
So that mean we need to wait till __ioremap__ support available for ARM.
How to take this forward then? Here is a platform (exynos7) which
needs earlycon support for debugging some of the early core things and
ARM64 has ioremap support as well. There is no reason why we should
hold earlycon support for exyons7.
I see two solution here:
1> How about re-spin patch-1 which will just add ealrycon support for
__exynos4210__ serial type only? And rest of the types can be added as
incremental patches, as and when ioremap for ARM available.
Atleast this approch will solve exynos7 problem of not having earlycon support.
And This patch can be tested on exynos7 (I can do that).
2> Take  my patch which is working and tested for exynos7 and can be
easily extended and generalized when ioremap for ARM is available.

My preference would be the the first one.
Let me know your thoughts please.
In case you are ok with 1st approach, can you please re-spin patch1
with needed changes?

> Best regards
> Marek Szyprowski
> Samsung R&D Institute Poland
>
>
> Patch summary:
>
> Tomasz Figa (2):
>   serial: samsung: Add support for of_earlycon
>   ARM: dts: exynos4: Add stdout-path properties
>
>  arch/arm/boot/dts/exynos4210-origen.dts         |  1 +
>  arch/arm/boot/dts/exynos4210-smdkv310.dts       |  1 +
>  arch/arm/boot/dts/exynos4210-trats.dts          |  1 +
>  arch/arm/boot/dts/exynos4210-universal_c210.dts |  1 +
>  arch/arm/boot/dts/exynos4412-odroid-common.dtsi |  4 +
>  arch/arm/boot/dts/exynos4412-origen.dts         |  1 +
>  arch/arm/boot/dts/exynos4412-smdk4412.dts       |  1 +
>  arch/arm/boot/dts/exynos4412-tiny4412.dts       |  4 +
>  arch/arm/boot/dts/exynos4412-trats2.dts         |  1 +
>  drivers/tty/serial/Kconfig                      |  1 +
>  drivers/tty/serial/samsung.c                    | 97 +++++++++++++++++++++++++
>  11 files changed, 113 insertions(+)
>
> --
> 1.9.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Regards,
Alim

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

* [PATCH/RFC 0/2] serial: samsung: add support for early console
@ 2014-09-23 12:53   ` Alim Akhtar
  0 siblings, 0 replies; 18+ messages in thread
From: Alim Akhtar @ 2014-09-23 12:53 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Marek,

On Mon, Sep 22, 2014 at 6:44 PM, Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
> Hello,
>
> This patchset adds support for early console defined in device tree. As
> an example, DTS files for all Exynos4 based machines are updated with
> the correct value for common chosen/sdtout property.
>
> To get it fully functional additional improvements (support for
> early_ioremap) are needed in early console code.
>
Is these really tested?
So that mean we need to wait till __ioremap__ support available for ARM.
How to take this forward then? Here is a platform (exynos7) which
needs earlycon support for debugging some of the early core things and
ARM64 has ioremap support as well. There is no reason why we should
hold earlycon support for exyons7.
I see two solution here:
1> How about re-spin patch-1 which will just add ealrycon support for
__exynos4210__ serial type only? And rest of the types can be added as
incremental patches, as and when ioremap for ARM available.
Atleast this approch will solve exynos7 problem of not having earlycon support.
And This patch can be tested on exynos7 (I can do that).
2> Take  my patch which is working and tested for exynos7 and can be
easily extended and generalized when ioremap for ARM is available.

My preference would be the the first one.
Let me know your thoughts please.
In case you are ok with 1st approach, can you please re-spin patch1
with needed changes?

> Best regards
> Marek Szyprowski
> Samsung R&D Institute Poland
>
>
> Patch summary:
>
> Tomasz Figa (2):
>   serial: samsung: Add support for of_earlycon
>   ARM: dts: exynos4: Add stdout-path properties
>
>  arch/arm/boot/dts/exynos4210-origen.dts         |  1 +
>  arch/arm/boot/dts/exynos4210-smdkv310.dts       |  1 +
>  arch/arm/boot/dts/exynos4210-trats.dts          |  1 +
>  arch/arm/boot/dts/exynos4210-universal_c210.dts |  1 +
>  arch/arm/boot/dts/exynos4412-odroid-common.dtsi |  4 +
>  arch/arm/boot/dts/exynos4412-origen.dts         |  1 +
>  arch/arm/boot/dts/exynos4412-smdk4412.dts       |  1 +
>  arch/arm/boot/dts/exynos4412-tiny4412.dts       |  4 +
>  arch/arm/boot/dts/exynos4412-trats2.dts         |  1 +
>  drivers/tty/serial/Kconfig                      |  1 +
>  drivers/tty/serial/samsung.c                    | 97 +++++++++++++++++++++++++
>  11 files changed, 113 insertions(+)
>
> --
> 1.9.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Regards,
Alim

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

* Re: [PATCH/RFC 0/2] serial: samsung: add support for early console
  2014-09-23 12:53   ` Alim Akhtar
@ 2014-09-23 13:08     ` Marek Szyprowski
  -1 siblings, 0 replies; 18+ messages in thread
From: Marek Szyprowski @ 2014-09-23 13:08 UTC (permalink / raw)
  To: Alim Akhtar
  Cc: linux-samsung-soc, linux-arm-kernel, Alim Akhtar,
	Thomas P Abraham, Tomasz Figa, Kyungmin Park, Rob Herring

Hello,

On 2014-09-23 14:53, Alim Akhtar wrote:
> Hi Marek,
>
> On Mon, Sep 22, 2014 at 6:44 PM, Marek Szyprowski
> <m.szyprowski@samsung.com> wrote:
>> Hello,
>>
>> This patchset adds support for early console defined in device tree. As
>> an example, DTS files for all Exynos4 based machines are updated with
>> the correct value for common chosen/sdtout property.
>>
>> To get it fully functional additional improvements (support for
>> early_ioremap) are needed in early console code.
>>
> Is these really tested?

I've tested it on Exynos4412 based OdroidU3 board. It works fine, although
early console is not initialized as early as it might be. That's the only
drawback, besides that it works fine.

> So that mean we need to wait till __ioremap__ support available for ARM.
> How to take this forward then? Here is a platform (exynos7) which
> needs earlycon support for debugging some of the early core things and
> ARM64 has ioremap support as well. There is no reason why we should
> hold earlycon support for exyons7.

I prefer to simply merge the patch as is. Once early con gets full
functionality, all required samsung code will be already in then.

> I see two solution here:
> 1> How about re-spin patch-1 which will just add ealrycon support for
> __exynos4210__ serial type only? And rest of the types can be added as
> incremental patches, as and when ioremap for ARM available.
> Atleast this approch will solve exynos7 problem of not having earlycon support.
> And This patch can be tested on exynos7 (I can do that).
> 2> Take  my patch which is working and tested for exynos7 and can be
> easily extended and generalized when ioremap for ARM is available.
>
> My preference would be the the first one.
> Let me know your thoughts please.
> In case you are ok with 1st approach, can you please re-spin patch1
> with needed changes?

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

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

* [PATCH/RFC 0/2] serial: samsung: add support for early console
@ 2014-09-23 13:08     ` Marek Szyprowski
  0 siblings, 0 replies; 18+ messages in thread
From: Marek Szyprowski @ 2014-09-23 13:08 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

On 2014-09-23 14:53, Alim Akhtar wrote:
> Hi Marek,
>
> On Mon, Sep 22, 2014 at 6:44 PM, Marek Szyprowski
> <m.szyprowski@samsung.com> wrote:
>> Hello,
>>
>> This patchset adds support for early console defined in device tree. As
>> an example, DTS files for all Exynos4 based machines are updated with
>> the correct value for common chosen/sdtout property.
>>
>> To get it fully functional additional improvements (support for
>> early_ioremap) are needed in early console code.
>>
> Is these really tested?

I've tested it on Exynos4412 based OdroidU3 board. It works fine, although
early console is not initialized as early as it might be. That's the only
drawback, besides that it works fine.

> So that mean we need to wait till __ioremap__ support available for ARM.
> How to take this forward then? Here is a platform (exynos7) which
> needs earlycon support for debugging some of the early core things and
> ARM64 has ioremap support as well. There is no reason why we should
> hold earlycon support for exyons7.

I prefer to simply merge the patch as is. Once early con gets full
functionality, all required samsung code will be already in then.

> I see two solution here:
> 1> How about re-spin patch-1 which will just add ealrycon support for
> __exynos4210__ serial type only? And rest of the types can be added as
> incremental patches, as and when ioremap for ARM available.
> Atleast this approch will solve exynos7 problem of not having earlycon support.
> And This patch can be tested on exynos7 (I can do that).
> 2> Take  my patch which is working and tested for exynos7 and can be
> easily extended and generalized when ioremap for ARM is available.
>
> My preference would be the the first one.
> Let me know your thoughts please.
> In case you are ok with 1st approach, can you please re-spin patch1
> with needed changes?

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

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

* Re: [PATCH/RFC 0/2] serial: samsung: add support for early console
  2014-09-23 13:08     ` Marek Szyprowski
@ 2014-09-23 13:22       ` Alim Akhtar
  -1 siblings, 0 replies; 18+ messages in thread
From: Alim Akhtar @ 2014-09-23 13:22 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: linux-samsung-soc, linux-arm-kernel, Alim Akhtar,
	Thomas P Abraham, Tomasz Figa, Kyungmin Park, Rob Herring

Hi Marek,

On Tue, Sep 23, 2014 at 6:38 PM, Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
> Hello,
>
> On 2014-09-23 14:53, Alim Akhtar wrote:
>>
>> Hi Marek,
>>
>> On Mon, Sep 22, 2014 at 6:44 PM, Marek Szyprowski
>> <m.szyprowski@samsung.com> wrote:
>>>
>>> Hello,
>>>
>>> This patchset adds support for early console defined in device tree. As
>>> an example, DTS files for all Exynos4 based machines are updated with
>>> the correct value for common chosen/sdtout property.
>>>
>>> To get it fully functional additional improvements (support for
>>> early_ioremap) are needed in early console code.
>>>
>> Is these really tested?
>
>
> I've tested it on Exynos4412 based OdroidU3 board. It works fine, although
> early console is not initialized as early as it might be. That's the only
> drawback, besides that it works fine.
>
>> So that mean we need to wait till __ioremap__ support available for ARM.
>> How to take this forward then? Here is a platform (exynos7) which
>> needs earlycon support for debugging some of the early core things and
>> ARM64 has ioremap support as well. There is no reason why we should
>> hold earlycon support for exyons7.
>
>
> I prefer to simply merge the patch as is. Once early con gets full
> functionality, all required samsung code will be already in then.
>
Thats good then, I was thinking you (or someone else, might be) are
going to hold this till __ioremap__ gets added for ARM.
>
>> I see two solution here:
>> 1> How about re-spin patch-1 which will just add ealrycon support for
>> __exynos4210__ serial type only? And rest of the types can be added as
>> incremental patches, as and when ioremap for ARM available.
>> Atleast this approch will solve exynos7 problem of not having earlycon
>> support.
>> And This patch can be tested on exynos7 (I can do that).
>> 2> Take  my patch which is working and tested for exynos7 and can be
>> easily extended and generalized when ioremap for ARM is available.
>>
>> My preference would be the the first one.
>> Let me know your thoughts please.
>> In case you are ok with 1st approach, can you please re-spin patch1
>> with needed changes?
>
>
> Best regards
> --
> Marek Szyprowski, PhD
> Samsung R&D Institute Poland
>



-- 
Regards,
Alim

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

* [PATCH/RFC 0/2] serial: samsung: add support for early console
@ 2014-09-23 13:22       ` Alim Akhtar
  0 siblings, 0 replies; 18+ messages in thread
From: Alim Akhtar @ 2014-09-23 13:22 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Marek,

On Tue, Sep 23, 2014 at 6:38 PM, Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
> Hello,
>
> On 2014-09-23 14:53, Alim Akhtar wrote:
>>
>> Hi Marek,
>>
>> On Mon, Sep 22, 2014 at 6:44 PM, Marek Szyprowski
>> <m.szyprowski@samsung.com> wrote:
>>>
>>> Hello,
>>>
>>> This patchset adds support for early console defined in device tree. As
>>> an example, DTS files for all Exynos4 based machines are updated with
>>> the correct value for common chosen/sdtout property.
>>>
>>> To get it fully functional additional improvements (support for
>>> early_ioremap) are needed in early console code.
>>>
>> Is these really tested?
>
>
> I've tested it on Exynos4412 based OdroidU3 board. It works fine, although
> early console is not initialized as early as it might be. That's the only
> drawback, besides that it works fine.
>
>> So that mean we need to wait till __ioremap__ support available for ARM.
>> How to take this forward then? Here is a platform (exynos7) which
>> needs earlycon support for debugging some of the early core things and
>> ARM64 has ioremap support as well. There is no reason why we should
>> hold earlycon support for exyons7.
>
>
> I prefer to simply merge the patch as is. Once early con gets full
> functionality, all required samsung code will be already in then.
>
Thats good then, I was thinking you (or someone else, might be) are
going to hold this till __ioremap__ gets added for ARM.
>
>> I see two solution here:
>> 1> How about re-spin patch-1 which will just add ealrycon support for
>> __exynos4210__ serial type only? And rest of the types can be added as
>> incremental patches, as and when ioremap for ARM available.
>> Atleast this approch will solve exynos7 problem of not having earlycon
>> support.
>> And This patch can be tested on exynos7 (I can do that).
>> 2> Take  my patch which is working and tested for exynos7 and can be
>> easily extended and generalized when ioremap for ARM is available.
>>
>> My preference would be the the first one.
>> Let me know your thoughts please.
>> In case you are ok with 1st approach, can you please re-spin patch1
>> with needed changes?
>
>
> Best regards
> --
> Marek Szyprowski, PhD
> Samsung R&D Institute Poland
>



-- 
Regards,
Alim

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

* Re: [PATCH/RFC 0/2] serial: samsung: add support for early console
  2014-09-23 12:53   ` Alim Akhtar
@ 2014-09-23 13:25     ` Tomasz Figa
  -1 siblings, 0 replies; 18+ messages in thread
From: Tomasz Figa @ 2014-09-23 13:25 UTC (permalink / raw)
  To: Alim Akhtar, Marek Szyprowski
  Cc: linux-samsung-soc, linux-arm-kernel, Alim Akhtar,
	Thomas P Abraham, Kyungmin Park, Rob Herring

On 23.09.2014 14:53, Alim Akhtar wrote:
> Hi Marek,
> 
> On Mon, Sep 22, 2014 at 6:44 PM, Marek Szyprowski
> <m.szyprowski@samsung.com> wrote:
>> Hello,
>>
>> This patchset adds support for early console defined in device tree. As
>> an example, DTS files for all Exynos4 based machines are updated with
>> the correct value for common chosen/sdtout property.
>>
>> To get it fully functional additional improvements (support for
>> early_ioremap) are needed in early console code.
>>
> Is these really tested?
> So that mean we need to wait till __ioremap__ support available for ARM.

This was originally tested by creating a fixed mapping for all UART
ports on respective platforms in .map_io() callback of machine
descriptor. This might be the way to support this on 32-bit ARM
platforms until early ioremap is available.

However if no mapping is available, the earlycon will simply not
register and won't break anything, so it should be safe to keep.

> How to take this forward then? Here is a platform (exynos7) which
> needs earlycon support for debugging some of the early core things and
> ARM64 has ioremap support as well. There is no reason why we should
> hold earlycon support for exyons7.
> I see two solution here:
> 1> How about re-spin patch-1 which will just add ealrycon support for
> __exynos4210__ serial type only? And rest of the types can be added as
> incremental patches, as and when ioremap for ARM available.
> Atleast this approch will solve exynos7 problem of not having earlycon support.
> And This patch can be tested on exynos7 (I can do that).

I don't really think there is a need to remove support for other
variants. As I mentioned, they can be supported without early_ioremap()
by static IO mapping.

> 2> Take  my patch which is working and tested for exynos7 and can be
> easily extended and generalized when ioremap for ARM is available.
> 
> My preference would be the the first one.
> Let me know your thoughts please.
> In case you are ok with 1st approach, can you please re-spin patch1
> with needed changes?

I'd say this patch could be merged as is. For 32-bit platforms
additional patches might be posted separately to add early static
mapping or just wait until early ioremap becomes availabl.e

Best regards,
Tomasz

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

* [PATCH/RFC 0/2] serial: samsung: add support for early console
@ 2014-09-23 13:25     ` Tomasz Figa
  0 siblings, 0 replies; 18+ messages in thread
From: Tomasz Figa @ 2014-09-23 13:25 UTC (permalink / raw)
  To: linux-arm-kernel

On 23.09.2014 14:53, Alim Akhtar wrote:
> Hi Marek,
> 
> On Mon, Sep 22, 2014 at 6:44 PM, Marek Szyprowski
> <m.szyprowski@samsung.com> wrote:
>> Hello,
>>
>> This patchset adds support for early console defined in device tree. As
>> an example, DTS files for all Exynos4 based machines are updated with
>> the correct value for common chosen/sdtout property.
>>
>> To get it fully functional additional improvements (support for
>> early_ioremap) are needed in early console code.
>>
> Is these really tested?
> So that mean we need to wait till __ioremap__ support available for ARM.

This was originally tested by creating a fixed mapping for all UART
ports on respective platforms in .map_io() callback of machine
descriptor. This might be the way to support this on 32-bit ARM
platforms until early ioremap is available.

However if no mapping is available, the earlycon will simply not
register and won't break anything, so it should be safe to keep.

> How to take this forward then? Here is a platform (exynos7) which
> needs earlycon support for debugging some of the early core things and
> ARM64 has ioremap support as well. There is no reason why we should
> hold earlycon support for exyons7.
> I see two solution here:
> 1> How about re-spin patch-1 which will just add ealrycon support for
> __exynos4210__ serial type only? And rest of the types can be added as
> incremental patches, as and when ioremap for ARM available.
> Atleast this approch will solve exynos7 problem of not having earlycon support.
> And This patch can be tested on exynos7 (I can do that).

I don't really think there is a need to remove support for other
variants. As I mentioned, they can be supported without early_ioremap()
by static IO mapping.

> 2> Take  my patch which is working and tested for exynos7 and can be
> easily extended and generalized when ioremap for ARM is available.
> 
> My preference would be the the first one.
> Let me know your thoughts please.
> In case you are ok with 1st approach, can you please re-spin patch1
> with needed changes?

I'd say this patch could be merged as is. For 32-bit platforms
additional patches might be posted separately to add early static
mapping or just wait until early ioremap becomes availabl.e

Best regards,
Tomasz

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

* Re: [PATCH/RFC 1/2] serial: samsung: Add support for of_earlycon
  2014-09-22 13:14   ` Marek Szyprowski
@ 2014-09-24 22:42     ` Alim Akhtar
  -1 siblings, 0 replies; 18+ messages in thread
From: Alim Akhtar @ 2014-09-24 22:42 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: linux-samsung-soc, linux-arm-kernel, Tomasz Figa, Kyungmin Park,
	Thomas P Abraham, Alim Akhtar

Hi Marek

On Mon, Sep 22, 2014 at 6:44 PM, Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
> From: Tomasz Figa <t.figa@samsung.com>
>
> This patch adds support for early console initialized from device tree
> to all variants of Samsung serial driver.
>
> Signed-off-by: Tomasz Figa <t.figa@samsung.com>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/tty/serial/Kconfig   |  1 +
>  drivers/tty/serial/samsung.c | 97 ++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 98 insertions(+)
>
> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> index 26cec64dadd7..e87a2dfd9080 100644
> --- a/drivers/tty/serial/Kconfig
> +++ b/drivers/tty/serial/Kconfig
> @@ -222,6 +222,7 @@ config SERIAL_SAMSUNG
>         tristate "Samsung SoC serial support"
>         depends on PLAT_SAMSUNG
>         select SERIAL_CORE
> +       select SERIAL_EARLYCON
Ideally this should be selected by SERIAL_SAMSUNG_CONSOLE.
But this is also fine.
>         help
>           Support for the on-chip UARTs on the Samsung S3C24XX series CPUs,
>           providing /dev/ttySAC0, 1 and 2 (note, some machines may not
> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
> index c78f43a481ce..71829ce2410d 100644
> --- a/drivers/tty/serial/samsung.c
> +++ b/drivers/tty/serial/samsung.c
> @@ -1856,6 +1856,103 @@ static struct platform_driver samsung_serial_driver = {
>
>  module_platform_driver(samsung_serial_driver);
>
> +/*
> + * Early console.
> + */
> +
> +struct samsung_early_console_data {
> +       u32 txfull_mask;
> +};
> +
> +static void samsung_early_busyuart(struct uart_port *port)
> +{
> +       while (!(readl(port->membase + S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXFE))
> +               ;
> +}
> +
> +static void samsung_early_busyuart_fifo(struct uart_port *port)
> +{
> +       struct samsung_early_console_data *data = port->private_data;
> +
> +       while (readl(port->membase + S3C2410_UFSTAT) & data->txfull_mask)
> +               ;
> +}
> +
> +static void samsung_early_putc(struct uart_port *port, int c)
> +{
> +       if (readl(port->membase + S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE)
> +               samsung_early_busyuart_fifo(port);
> +       else
> +               samsung_early_busyuart(port);
> +
> +       writeb(c, port->membase + S3C2410_UTXH);
> +}
> +
> +static void samsung_early_write(struct console *con, const char *s, unsigned n)
> +{
> +       struct earlycon_device *dev = con->data;
> +
> +       uart_console_write(&dev->port, s, n, samsung_early_putc);
> +}
> +
> +static int __init samsung_early_console_setup(struct earlycon_device *device,
> +                                             const char *opt)
> +{
> +       if (!device->port.membase)
> +               return -ENODEV;
> +
> +       device->con->write = samsung_early_write;
> +       return 0;
> +}
> +
> +/* S3C2410, S3C2412 */
Probably you should move S3C2412 below along with S3C64xx, see your
OF_EARLYCON_DECLARE below.
> +static struct samsung_early_console_data s3c2410_early_console_data = {
> +       .txfull_mask = S3C2410_UFSTAT_TXFULL,
> +};
> +
> +static int __init s3c2410_early_console_setup(struct earlycon_device *device,
> +                                             const char *opt)
> +{
> +       device->port.private_data = &s3c2410_early_console_data;
> +       return samsung_early_console_setup(device, opt);
> +}
> +OF_EARLYCON_DECLARE(s3c2410, "samsung,s3c2410-uart",
> +                       s3c2410_early_console_setup);
> +
> +/* S3C2440, S3C64xx */
> +static struct samsung_early_console_data s3c2440_early_console_data = {
> +       .txfull_mask = S3C2440_UFSTAT_TXFULL,
> +};
> +
> +static int __init s3c2440_early_console_setup(struct earlycon_device *device,
> +                                             const char *opt)
> +{
> +       device->port.private_data = &s3c2440_early_console_data;
> +       return samsung_early_console_setup(device, opt);
> +}
> +OF_EARLYCON_DECLARE(s3c2412, "samsung,s3c2412-uart",
> +                       s3c2440_early_console_setup);
> +OF_EARLYCON_DECLARE(s3c2440, "samsung,s3c2440-uart",
> +                       s3c2440_early_console_setup);
> +OF_EARLYCON_DECLARE(s3c6400, "samsung,s3c6400-uart",
> +                       s3c2440_early_console_setup);
> +
> +/* S5PV210, EXYNOS */
> +static struct samsung_early_console_data s5pv210_early_console_data = {
> +       .txfull_mask = S5PV210_UFSTAT_TXFULL,
> +};
> +
> +static int __init s5pv210_early_console_setup(struct earlycon_device *device,
> +                                             const char *opt)
> +{
> +       device->port.private_data = &s5pv210_early_console_data;
> +       return samsung_early_console_setup(device, opt);
> +}
> +OF_EARLYCON_DECLARE(s5pv210, "samsung,s5pv210-uart",
> +                       s5pv210_early_console_setup);
> +OF_EARLYCON_DECLARE(exynos4210, "samsung,exynos4210-uart",
> +                       s5pv210_early_console_setup);
Please support command line earlycon support also for all type.
You just need EARLYCON_DECLARE(exynos4210,
s5pv210_early_console_setup); for exynos4210.

> +
>  MODULE_ALIAS("platform:samsung-uart");
>  MODULE_DESCRIPTION("Samsung SoC Serial port driver");
>  MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
> --
> 1.9.2
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



-- 
Regards,
Alim

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

* [PATCH/RFC 1/2] serial: samsung: Add support for of_earlycon
@ 2014-09-24 22:42     ` Alim Akhtar
  0 siblings, 0 replies; 18+ messages in thread
From: Alim Akhtar @ 2014-09-24 22:42 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Marek

On Mon, Sep 22, 2014 at 6:44 PM, Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
> From: Tomasz Figa <t.figa@samsung.com>
>
> This patch adds support for early console initialized from device tree
> to all variants of Samsung serial driver.
>
> Signed-off-by: Tomasz Figa <t.figa@samsung.com>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/tty/serial/Kconfig   |  1 +
>  drivers/tty/serial/samsung.c | 97 ++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 98 insertions(+)
>
> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> index 26cec64dadd7..e87a2dfd9080 100644
> --- a/drivers/tty/serial/Kconfig
> +++ b/drivers/tty/serial/Kconfig
> @@ -222,6 +222,7 @@ config SERIAL_SAMSUNG
>         tristate "Samsung SoC serial support"
>         depends on PLAT_SAMSUNG
>         select SERIAL_CORE
> +       select SERIAL_EARLYCON
Ideally this should be selected by SERIAL_SAMSUNG_CONSOLE.
But this is also fine.
>         help
>           Support for the on-chip UARTs on the Samsung S3C24XX series CPUs,
>           providing /dev/ttySAC0, 1 and 2 (note, some machines may not
> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
> index c78f43a481ce..71829ce2410d 100644
> --- a/drivers/tty/serial/samsung.c
> +++ b/drivers/tty/serial/samsung.c
> @@ -1856,6 +1856,103 @@ static struct platform_driver samsung_serial_driver = {
>
>  module_platform_driver(samsung_serial_driver);
>
> +/*
> + * Early console.
> + */
> +
> +struct samsung_early_console_data {
> +       u32 txfull_mask;
> +};
> +
> +static void samsung_early_busyuart(struct uart_port *port)
> +{
> +       while (!(readl(port->membase + S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXFE))
> +               ;
> +}
> +
> +static void samsung_early_busyuart_fifo(struct uart_port *port)
> +{
> +       struct samsung_early_console_data *data = port->private_data;
> +
> +       while (readl(port->membase + S3C2410_UFSTAT) & data->txfull_mask)
> +               ;
> +}
> +
> +static void samsung_early_putc(struct uart_port *port, int c)
> +{
> +       if (readl(port->membase + S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE)
> +               samsung_early_busyuart_fifo(port);
> +       else
> +               samsung_early_busyuart(port);
> +
> +       writeb(c, port->membase + S3C2410_UTXH);
> +}
> +
> +static void samsung_early_write(struct console *con, const char *s, unsigned n)
> +{
> +       struct earlycon_device *dev = con->data;
> +
> +       uart_console_write(&dev->port, s, n, samsung_early_putc);
> +}
> +
> +static int __init samsung_early_console_setup(struct earlycon_device *device,
> +                                             const char *opt)
> +{
> +       if (!device->port.membase)
> +               return -ENODEV;
> +
> +       device->con->write = samsung_early_write;
> +       return 0;
> +}
> +
> +/* S3C2410, S3C2412 */
Probably you should move S3C2412 below along with S3C64xx, see your
OF_EARLYCON_DECLARE below.
> +static struct samsung_early_console_data s3c2410_early_console_data = {
> +       .txfull_mask = S3C2410_UFSTAT_TXFULL,
> +};
> +
> +static int __init s3c2410_early_console_setup(struct earlycon_device *device,
> +                                             const char *opt)
> +{
> +       device->port.private_data = &s3c2410_early_console_data;
> +       return samsung_early_console_setup(device, opt);
> +}
> +OF_EARLYCON_DECLARE(s3c2410, "samsung,s3c2410-uart",
> +                       s3c2410_early_console_setup);
> +
> +/* S3C2440, S3C64xx */
> +static struct samsung_early_console_data s3c2440_early_console_data = {
> +       .txfull_mask = S3C2440_UFSTAT_TXFULL,
> +};
> +
> +static int __init s3c2440_early_console_setup(struct earlycon_device *device,
> +                                             const char *opt)
> +{
> +       device->port.private_data = &s3c2440_early_console_data;
> +       return samsung_early_console_setup(device, opt);
> +}
> +OF_EARLYCON_DECLARE(s3c2412, "samsung,s3c2412-uart",
> +                       s3c2440_early_console_setup);
> +OF_EARLYCON_DECLARE(s3c2440, "samsung,s3c2440-uart",
> +                       s3c2440_early_console_setup);
> +OF_EARLYCON_DECLARE(s3c6400, "samsung,s3c6400-uart",
> +                       s3c2440_early_console_setup);
> +
> +/* S5PV210, EXYNOS */
> +static struct samsung_early_console_data s5pv210_early_console_data = {
> +       .txfull_mask = S5PV210_UFSTAT_TXFULL,
> +};
> +
> +static int __init s5pv210_early_console_setup(struct earlycon_device *device,
> +                                             const char *opt)
> +{
> +       device->port.private_data = &s5pv210_early_console_data;
> +       return samsung_early_console_setup(device, opt);
> +}
> +OF_EARLYCON_DECLARE(s5pv210, "samsung,s5pv210-uart",
> +                       s5pv210_early_console_setup);
> +OF_EARLYCON_DECLARE(exynos4210, "samsung,exynos4210-uart",
> +                       s5pv210_early_console_setup);
Please support command line earlycon support also for all type.
You just need EARLYCON_DECLARE(exynos4210,
s5pv210_early_console_setup); for exynos4210.

> +
>  MODULE_ALIAS("platform:samsung-uart");
>  MODULE_DESCRIPTION("Samsung SoC Serial port driver");
>  MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
> --
> 1.9.2
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



-- 
Regards,
Alim

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

* Re: [PATCH/RFC 0/2] serial: samsung: add support for early console
  2014-09-22 13:14 ` Marek Szyprowski
@ 2014-09-24 23:07   ` Alim Akhtar
  -1 siblings, 0 replies; 18+ messages in thread
From: Alim Akhtar @ 2014-09-24 23:07 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: linux-samsung-soc, linux-arm-kernel, Alim Akhtar,
	Thomas P Abraham, Tomasz Figa, Kyungmin Park, Rob Herring

Hi Marek,

On Mon, Sep 22, 2014 at 6:44 PM, Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
> Hello,
>
> This patchset adds support for early console defined in device tree. As
> an example, DTS files for all Exynos4 based machines are updated with
> the correct value for common chosen/sdtout property.
>
> To get it fully functional additional improvements (support for
> early_ioremap) are needed in early console code.
>
> Best regards
> Marek Szyprowski
> Samsung R&D Institute Poland
>
>
> Patch summary:
>
> Tomasz Figa (2):
>   serial: samsung: Add support for of_earlycon
Probably you can re-spin this series without RFC tag and fixing a nit.
Please add command line support also and update the Documentation with
command line param.
>   ARM: dts: exynos4: Add stdout-path properties
>
Have tested this on ARM64 based exynos7, both DT and command line way.
Both works.
Compile tested on ARM.
Probably you can rebase on top of
https://www.mail-archive.com/linux-samsung-soc@vger.kernel.org/msg36208.html
maybe.
>  arch/arm/boot/dts/exynos4210-origen.dts         |  1 +
>  arch/arm/boot/dts/exynos4210-smdkv310.dts       |  1 +
>  arch/arm/boot/dts/exynos4210-trats.dts          |  1 +
>  arch/arm/boot/dts/exynos4210-universal_c210.dts |  1 +
>  arch/arm/boot/dts/exynos4412-odroid-common.dtsi |  4 +
>  arch/arm/boot/dts/exynos4412-origen.dts         |  1 +
>  arch/arm/boot/dts/exynos4412-smdk4412.dts       |  1 +
>  arch/arm/boot/dts/exynos4412-tiny4412.dts       |  4 +
>  arch/arm/boot/dts/exynos4412-trats2.dts         |  1 +
>  drivers/tty/serial/Kconfig                      |  1 +
>  drivers/tty/serial/samsung.c                    | 97 +++++++++++++++++++++++++
>  11 files changed, 113 insertions(+)
>
> --
> 1.9.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Regards,
Alim

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

* [PATCH/RFC 0/2] serial: samsung: add support for early console
@ 2014-09-24 23:07   ` Alim Akhtar
  0 siblings, 0 replies; 18+ messages in thread
From: Alim Akhtar @ 2014-09-24 23:07 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Marek,

On Mon, Sep 22, 2014 at 6:44 PM, Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
> Hello,
>
> This patchset adds support for early console defined in device tree. As
> an example, DTS files for all Exynos4 based machines are updated with
> the correct value for common chosen/sdtout property.
>
> To get it fully functional additional improvements (support for
> early_ioremap) are needed in early console code.
>
> Best regards
> Marek Szyprowski
> Samsung R&D Institute Poland
>
>
> Patch summary:
>
> Tomasz Figa (2):
>   serial: samsung: Add support for of_earlycon
Probably you can re-spin this series without RFC tag and fixing a nit.
Please add command line support also and update the Documentation with
command line param.
>   ARM: dts: exynos4: Add stdout-path properties
>
Have tested this on ARM64 based exynos7, both DT and command line way.
Both works.
Compile tested on ARM.
Probably you can rebase on top of
https://www.mail-archive.com/linux-samsung-soc at vger.kernel.org/msg36208.html
maybe.
>  arch/arm/boot/dts/exynos4210-origen.dts         |  1 +
>  arch/arm/boot/dts/exynos4210-smdkv310.dts       |  1 +
>  arch/arm/boot/dts/exynos4210-trats.dts          |  1 +
>  arch/arm/boot/dts/exynos4210-universal_c210.dts |  1 +
>  arch/arm/boot/dts/exynos4412-odroid-common.dtsi |  4 +
>  arch/arm/boot/dts/exynos4412-origen.dts         |  1 +
>  arch/arm/boot/dts/exynos4412-smdk4412.dts       |  1 +
>  arch/arm/boot/dts/exynos4412-tiny4412.dts       |  4 +
>  arch/arm/boot/dts/exynos4412-trats2.dts         |  1 +
>  drivers/tty/serial/Kconfig                      |  1 +
>  drivers/tty/serial/samsung.c                    | 97 +++++++++++++++++++++++++
>  11 files changed, 113 insertions(+)
>
> --
> 1.9.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Regards,
Alim

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

end of thread, other threads:[~2014-09-24 23:07 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-22 13:14 [PATCH/RFC 0/2] serial: samsung: add support for early console Marek Szyprowski
2014-09-22 13:14 ` Marek Szyprowski
2014-09-22 13:14 ` [PATCH/RFC 1/2] serial: samsung: Add support for of_earlycon Marek Szyprowski
2014-09-22 13:14   ` Marek Szyprowski
2014-09-24 22:42   ` Alim Akhtar
2014-09-24 22:42     ` Alim Akhtar
2014-09-22 13:14 ` [PATCH/RFC 2/2] ARM: dts: exynos4: Add stdout-path properties Marek Szyprowski
2014-09-22 13:14   ` Marek Szyprowski
2014-09-23 12:53 ` [PATCH/RFC 0/2] serial: samsung: add support for early console Alim Akhtar
2014-09-23 12:53   ` Alim Akhtar
2014-09-23 13:08   ` Marek Szyprowski
2014-09-23 13:08     ` Marek Szyprowski
2014-09-23 13:22     ` Alim Akhtar
2014-09-23 13:22       ` Alim Akhtar
2014-09-23 13:25   ` Tomasz Figa
2014-09-23 13:25     ` Tomasz Figa
2014-09-24 23:07 ` Alim Akhtar
2014-09-24 23:07   ` Alim Akhtar

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.