devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.cz>, Paul Bolle <pebolle@tiscali.nl>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-serial@vger.kernel.org, Francois.Bedard@synopsys.com,
	Vineet Gupta <Vineet.Gupta1@synopsys.com>
Subject: [PATCH 5/9] serial/arc: remove earlyprintk support and switch to earlycon
Date: Thu, 12 Jun 2014 16:01:35 +0530	[thread overview]
Message-ID: <1402569099-9900-6-git-send-email-vgupta@synopsys.com> (raw)
In-Reply-To: <1402569099-9900-1-git-send-email-vgupta@synopsys.com>

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
---
 arch/arc/boot/dts/angel4.dts  |  2 +-
 drivers/tty/serial/arc_uart.c | 87 ++++++-------------------------------------
 2 files changed, 13 insertions(+), 76 deletions(-)

diff --git a/arch/arc/boot/dts/angel4.dts b/arch/arc/boot/dts/angel4.dts
index 5bb2fdaca02f..6b57475967a6 100644
--- a/arch/arc/boot/dts/angel4.dts
+++ b/arch/arc/boot/dts/angel4.dts
@@ -17,7 +17,7 @@
 	interrupt-parent = <&intc>;
 
 	chosen {
-		bootargs = "console=ttyARC0,115200n8 earlyprintk=ttyARC0";
+		bootargs = "earlycon=arc_uart,mmio32,0xc0fc1000,115200n8 console=ttyARC0,115200n8";
 	};
 
 	aliases {
diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c
index 0c8ba5bb97c7..2ffaf099691a 100644
--- a/drivers/tty/serial/arc_uart.c
+++ b/drivers/tty/serial/arc_uart.c
@@ -500,33 +500,23 @@ static int
 arc_uart_init_one(struct platform_device *pdev, int dev_id)
 {
 	struct resource *res, *res2;
-	unsigned long *plat_data;
 	struct arc_uart_port *uart = &arc_uart_ports[dev_id];
 	struct uart_port *port = &uart->port;
 
-	plat_data = dev_get_platdata(&pdev->dev);
-	if (!plat_data)
-		return -ENODEV;
+	struct device_node *np = pdev->dev.of_node;
+	u32 val;
 
-	if (is_early_platform_device(pdev)) {
-		port->uartclk = plat_data[1];
-		uart->baud = plat_data[2];
-	} else {
-		struct device_node *np = pdev->dev.of_node;
-		u32 val;
-
-		if (of_property_read_u32(np, "clock-frequency", &val)) {
-			dev_err(&pdev->dev, "clock-frequency property NOTset\n");
-			return -EINVAL;
-		}
-		port->uartclk = val;
-
-		if (of_property_read_u32(np, "current-speed", &val)) {
-			dev_err(&pdev->dev, "current-speed property NOT set\n");
-			return -EINVAL;
-		}
-		uart->baud = val;
+	if (of_property_read_u32(np, "clock-frequency", &val)) {
+		dev_err(&pdev->dev, "clock-frequency property NOTset\n");
+		return -EINVAL;
 	}
+	port->uartclk = val;
+
+	if (of_property_read_u32(np, "current-speed", &val)) {
+		dev_err(&pdev->dev, "current-speed property NOT set\n");
+		return -EINVAL;
+	}
+	uart->baud = val;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res)
@@ -615,38 +605,6 @@ static struct console arc_console = {
 	.data	= &arc_uart_driver
 };
 
-static __init void early_serial_write(struct console *con, const char *s,
-					unsigned int n)
-{
-	struct uart_port *port = &arc_uart_ports[con->index].port;
-
-	uart_console_write(port, s, n, arc_serial_poll_putchar);
-}
-
-static struct console arc_early_serial_console __initdata = {
-	.name = "early_ARCuart",
-	.write = early_serial_write,
-	.flags = CON_PRINTBUFFER | CON_BOOT,
-	.index = -1
-};
-
-static int __init arc_serial_probe_earlyprintk(struct platform_device *pdev)
-{
-	int dev_id = pdev->id < 0 ? 0 : pdev->id;
-	int rc;
-
-	arc_early_serial_console.index = dev_id;
-
-	rc = arc_uart_init_one(pdev, dev_id);
-	if (rc)
-		panic("early console init failed\n");
-
-	arc_serial_console_setup(&arc_early_serial_console, NULL);
-
-	register_console(&arc_early_serial_console);
-	return 0;
-}
-
 static __init void arc_early_serial_write(struct console *con, const char *s,
 					  unsigned int n)
 {
@@ -721,27 +679,6 @@ static struct platform_driver arc_platform_driver = {
 	 },
 };
 
-#ifdef CONFIG_SERIAL_ARC_CONSOLE
-
-static struct platform_driver early_arc_platform_driver __initdata = {
-	.probe = arc_serial_probe_earlyprintk,
-	.remove = arc_serial_remove,
-	.driver = {
-		.name = DRIVER_NAME,
-		.owner = THIS_MODULE,
-	 },
-};
-/*
- * Register an early platform driver of "earlyprintk" class.
- * ARCH platform code installs the driver and probes the early devices
- * The installation could rely on user specifying earlyprintk=xyx in cmd line
- * or it could be done independently, for all "earlyprintk" class drivers.
- * [see arch/arc/plat-arcfpga/platform.c]
- */
-early_platform_init("earlyprintk", &early_arc_platform_driver);
-
-#endif  /* CONFIG_SERIAL_ARC_CONSOLE */
-
 static int __init arc_serial_init(void)
 {
 	int ret;
-- 
1.8.3.2

  parent reply	other threads:[~2014-06-12 10:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-12 10:31 [PATCH 0/9] Generic earlyconsole for ARC UART Driver Vineet Gupta
2014-06-12 10:31 ` [PATCH 1/9] serial/arc: use uart_console_write() helper Vineet Gupta
2014-06-12 10:31 ` [PATCH 2/9] serial/arc: Refactor by referencing to uart_port where possible Vineet Gupta
     [not found] ` <1402569099-9900-1-git-send-email-vgupta-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
2014-06-12 10:31   ` [PATCH 3/9] serial/arc: Remove the workaround for legacy ISS Vineet Gupta
2014-06-12 10:31   ` [PATCH 4/9] serial/arc: Use generic earlycon infrastructure Vineet Gupta
2014-06-12 10:31   ` [PATCH 9/9] serial/arc: Add DT based earlycon support Vineet Gupta
     [not found]     ` <1402569099-9900-10-git-send-email-vgupta-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
2014-06-13  1:26       ` Rob Herring
2014-06-13 14:10         ` Vineet Gupta
2014-06-12 10:31 ` Vineet Gupta [this message]
2014-06-12 10:31 ` [PATCH 6/9] serial/arc: remove last remanants of platform data Vineet Gupta
2014-06-12 10:31 ` [PATCH 7/9] serial/arc: inline the probe helper Vineet Gupta
2014-06-12 10:31 ` [PATCH 8/9] ARC: [arcfpga] RIP early uart platform device stuff Vineet Gupta

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=1402569099-9900-6-git-send-email-vgupta@synopsys.com \
    --to=vineet.gupta1@synopsys.com \
    --cc=Francois.Bedard@synopsys.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=pebolle@tiscali.nl \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).