mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Burton <paul.burton@imgtec.com>
To: <linux-mips@linux-mips.org>, Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@imgtec.com>,
	Jacek Anaszewski <j.anaszewski@samsung.com>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH 04/20] MIPS: SEAD3: Use generic ns16550a earlycon support
Date: Tue, 9 Aug 2016 13:35:29 +0100	[thread overview]
Message-ID: <20160809123546.10190-5-paul.burton@imgtec.com> (raw)
In-Reply-To: <20160809123546.10190-1-paul.burton@imgtec.com>

Stop selecting SYS_HAS_EARLY_PRINTK & remove the custom support for
early output to the ns16550a UARTs, instead relying upon generic
ns16550a earlycon support. This reduces the amount of platform code
required for SEAD3 without losing any functionality.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
---

 arch/mips/Kconfig                   |  1 -
 arch/mips/configs/sead3_defconfig   |  2 ++
 arch/mips/mti-sead3/Makefile        |  2 --
 arch/mips/mti-sead3/sead3-console.c | 46 -------------------------------------
 arch/mips/mti-sead3/sead3-init.c    |  6 -----
 5 files changed, 2 insertions(+), 55 deletions(-)
 delete mode 100644 arch/mips/mti-sead3/sead3-console.c

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 2638856..45bbddf 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -513,7 +513,6 @@ config MIPS_SEAD3
 	select SYS_HAS_CPU_MIPS32_R2
 	select SYS_HAS_CPU_MIPS32_R6
 	select SYS_HAS_CPU_MIPS64_R1
-	select SYS_HAS_EARLY_PRINTK
 	select SYS_SUPPORTS_32BIT_KERNEL
 	select SYS_SUPPORTS_64BIT_KERNEL
 	select SYS_SUPPORTS_BIG_ENDIAN
diff --git a/arch/mips/configs/sead3_defconfig b/arch/mips/configs/sead3_defconfig
index deb48fb..23cce81 100644
--- a/arch/mips/configs/sead3_defconfig
+++ b/arch/mips/configs/sead3_defconfig
@@ -15,6 +15,8 @@ CONFIG_PROFILING=y
 CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 # CONFIG_BLK_DEV_BSG is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="earlycon"
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
diff --git a/arch/mips/mti-sead3/Makefile b/arch/mips/mti-sead3/Makefile
index aad67aa..a58b6d9 100644
--- a/arch/mips/mti-sead3/Makefile
+++ b/arch/mips/mti-sead3/Makefile
@@ -17,5 +17,3 @@ obj-y += sead3-platform.o
 obj-y += sead3-reset.o
 obj-y += sead3-setup.o
 obj-y += sead3-time.o
-
-obj-$(CONFIG_EARLY_PRINTK)	+= sead3-console.o
diff --git a/arch/mips/mti-sead3/sead3-console.c b/arch/mips/mti-sead3/sead3-console.c
deleted file mode 100644
index 031f47d..0000000
--- a/arch/mips/mti-sead3/sead3-console.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2012 MIPS Technologies, Inc.  All rights reserved.
- */
-#include <linux/init.h>
-#include <linux/console.h>
-#include <linux/serial_reg.h>
-#include <linux/io.h>
-
-#define SEAD_UART1_REGS_BASE	0xbf000800   /* ttyS1 = DB9 port */
-#define SEAD_UART0_REGS_BASE	0xbf000900   /* ttyS0 = USB port   */
-#define PORT(base_addr, offset) ((unsigned int __iomem *)(base_addr+(offset)*4))
-
-static char console_port = 1;
-
-static inline unsigned int serial_in(int offset, unsigned int base_addr)
-{
-	return __raw_readl(PORT(base_addr, offset)) & 0xff;
-}
-
-static inline void serial_out(int offset, int value, unsigned int base_addr)
-{
-	__raw_writel(value, PORT(base_addr, offset));
-}
-
-void __init fw_init_early_console(char port)
-{
-	console_port = port;
-}
-
-int prom_putchar(char c)
-{
-	unsigned int base_addr;
-
-	base_addr = console_port ? SEAD_UART1_REGS_BASE : SEAD_UART0_REGS_BASE;
-
-	while ((serial_in(UART_LSR, base_addr) & UART_LSR_THRE) == 0)
-		;
-
-	serial_out(UART_TX, c, base_addr);
-
-	return 1;
-}
diff --git a/arch/mips/mti-sead3/sead3-init.c b/arch/mips/mti-sead3/sead3-init.c
index e81f5b7..50f3fcb 100644
--- a/arch/mips/mti-sead3/sead3-init.c
+++ b/arch/mips/mti-sead3/sead3-init.c
@@ -93,12 +93,6 @@ void __init prom_init(void)
 	board_ejtag_handler_setup = mips_ejtag_setup;
 
 	fw_init_cmdline();
-#ifdef CONFIG_EARLY_PRINTK
-	if ((strstr(fw_getcmdline(), "console=ttyS0")) != NULL)
-		fw_init_early_console(0);
-	else if ((strstr(fw_getcmdline(), "console=ttyS1")) != NULL)
-		fw_init_early_console(1);
-#endif
 }
 
 void __init prom_free_prom_memory(void)
-- 
2.9.2

  parent reply	other threads:[~2016-08-09 12:37 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-09 12:35 [PATCH 00/20] MIPS: SEAD3 device tree conversion Paul Burton
2016-08-09 12:35 ` [PATCH 01/20] MIPS: SEAD3: Split obj-y entries across lines Paul Burton
2016-08-09 12:35 ` [PATCH 02/20] MIPS: SEAD3: Probe interrupt controllers using DT Paul Burton
2016-08-10  9:41   ` kbuild test robot
2016-08-09 12:35 ` [PATCH 03/20] MIPS: SEAD3: Probe UARTs " Paul Burton
2016-08-10 10:15   ` kbuild test robot
2016-08-10 10:57   ` kbuild test robot
2016-08-09 12:35 ` Paul Burton [this message]
2016-08-09 12:35 ` [PATCH 05/20] MIPS: SEAD3: Probe ethernet controller " Paul Burton
2016-08-09 12:35 ` [PATCH 06/20] usb: host: ehci-sead3: Support probing using device tree Paul Burton
2016-08-09 14:08   ` Jonas Gorski
2016-08-09 12:35 ` [PATCH 07/20] MIPS: SEAD3: Probe EHCI controller using DT Paul Burton
2016-08-09 12:35 ` [PATCH 08/20] usb: host: ehci-sead3: Remove non-DT probe code Paul Burton
2016-08-09 14:21   ` Alan Stern
2016-08-09 12:35 ` [PATCH 09/20] SEAD3: Probe parallel flash via DT Paul Burton
2016-08-09 13:23   ` Sergei Shtylyov
2016-08-09 12:35 ` [PATCH 10/20] MIPS: SEAD3: Use register-bit-led driver via DT for LEDs Paul Burton
2016-08-09 12:35 ` [PATCH 11/20] leds: Remove SEAD3 driver Paul Burton
2016-08-09 12:35 ` [PATCH 12/20] MIPS: SEAD3: Reset via generic syscon-reboot driver & DT Paul Burton
2016-08-09 12:35 ` [PATCH 13/20] MIPS: SEAD3: Use generic restart-poweroff driver Paul Burton
2016-08-09 12:35 ` [PATCH 14/20] MIPS: SEAD3: Parse memsize in DT shim Paul Burton
2016-08-09 12:35 ` [PATCH 15/20] MIPS: SEAD3: Drop use of cobalt fbdev driver Paul Burton
2016-08-09 12:35 ` [PATCH 16/20] fbdev: cobalt_lcdfb: Drop SEAD3 support Paul Burton
2016-08-10 10:17   ` Tomi Valkeinen
2016-08-09 12:35 ` [PATCH 17/20] dt-bindings: img-ascii-lcd: Document a binding for simple ASCII LCDs Paul Burton
2016-08-10 22:16   ` Rob Herring
2016-08-09 12:35 ` [PATCH 18/20] auxdisplay: img-ascii-lcd: driver for simple ASCII LCD displays Paul Burton
2016-08-09 12:35 ` [PATCH 19/20] MIPS: SEAD3: Use img-ascii-lcd driver Paul Burton
2016-08-09 12:35 ` [PATCH 20/20] MIPS: SEAD3: Remove custom read_persistent_clock Paul Burton

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=20160809123546.10190-5-paul.burton@imgtec.com \
    --to=paul.burton@imgtec.com \
    --cc=j.anaszewski@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.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

all inboxes | Powered by JetHome®