devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Cernekee <cernekee@gmail.com>
To: gregkh@linuxfoundation.org, jslaby@suse.cz, robh@kernel.org
Cc: grant.likely@linaro.org, f.fainelli@gmail.com, mbizon@freebox.fr,
	jogo@openwrt.org, linux-mips@linux-mips.org,
	linux-serial@vger.kernel.org, devicetree@vger.kernel.org,
	stable@vger.kernel.org
Subject: [PATCH 2/2] tty: serial: bcm63xx: Allow device nodes to be renamed to /dev/ttyBCM*
Date: Sun,  9 Nov 2014 00:55:48 -0800	[thread overview]
Message-ID: <1415523348-4631-2-git-send-email-cernekee@gmail.com> (raw)
In-Reply-To: <1415523348-4631-1-git-send-email-cernekee@gmail.com>

By default, bcm63xx_uart.c uses the standard 8250 device naming and
major/minor numbers.  There are at least two situations where this could
be a problem:

1) Multiplatform kernels that need to support some chips that have 8250
UARTs and other chips that have bcm63xx UARTs.

2) Some older chips like BCM7125 have a mix of both UART types.

Add a new Kconfig option to tell the driver whether to register itself
as ttyS or ttyBCM.  By default it will retain the existing "ttyS"
behavior to avoid surprises.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
---
 drivers/tty/serial/Kconfig        | 11 +++++++++++
 drivers/tty/serial/bcm63xx_uart.c |  8 ++++++++
 2 files changed, 19 insertions(+)

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index fdd851e..c82cfd2 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1302,6 +1302,17 @@ config SERIAL_BCM63XX_CONSOLE
 	  If you have enabled the serial port on the BCM63xx CPU
 	  you can make it the console by answering Y to this option.
 
+config SERIAL_BCM63XX_TTYS
+	bool "Use ttyS[01] device nodes for bcm63xx_uart"
+	depends on SERIAL_BCM63XX
+	default y
+	help
+	  Say Y to name the serial ports /dev/ttyS0, ttyS1, ...
+	  This conflicts with the 8250 driver but may avoid breaking
+	  compatibility with existing init scripts.
+
+	  Say N to name the serial ports /dev/ttyBCM0, ttyBCM1, ...
+
 config SERIAL_GRLIB_GAISLER_APBUART
 	tristate "GRLIB APBUART serial support"
 	depends on OF && SPARC
diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c
index e04e580..9f3dcc8 100644
--- a/drivers/tty/serial/bcm63xx_uart.c
+++ b/drivers/tty/serial/bcm63xx_uart.c
@@ -751,7 +751,11 @@ static int bcm_console_setup(struct console *co, char *options)
 static struct uart_driver bcm_uart_driver;
 
 static struct console bcm63xx_console = {
+#ifdef CONFIG_SERIAL_BCM63XX_TTYS
 	.name		= "ttyS",
+#else
+	.name		= "ttyBCM",
+#endif
 	.write		= bcm_console_write,
 	.device		= uart_console_device,
 	.setup		= bcm_console_setup,
@@ -796,9 +800,13 @@ OF_EARLYCON_DECLARE(bcm63xx_uart, "brcm,bcm6345-uart", bcm_early_console_setup);
 static struct uart_driver bcm_uart_driver = {
 	.owner		= THIS_MODULE,
 	.driver_name	= "bcm63xx_uart",
+#ifdef CONFIG_SERIAL_BCM63XX_TTYS
 	.dev_name	= "ttyS",
 	.major		= TTY_MAJOR,
 	.minor		= 64,
+#else
+	.dev_name	= "ttyBCM",
+#endif
 	.nr		= BCM63XX_NR_UARTS,
 	.cons		= BCM63XX_CONSOLE,
 };
-- 
2.1.1

  reply	other threads:[~2014-11-09  8:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-09  8:55 [PATCH 1/2] of: Fix crash if an earlycon driver is not found Kevin Cernekee
2014-11-09  8:55 ` Kevin Cernekee [this message]
2014-11-10 14:25   ` [PATCH 2/2] tty: serial: bcm63xx: Allow device nodes to be renamed to /dev/ttyBCM* Rob Herring
2014-11-10 15:05     ` Kevin Cernekee
2014-11-10 18:30       ` Greg Kroah-Hartman
2014-11-10 19:10         ` Kevin Cernekee
2014-11-10 19:22       ` Rob Herring
2014-11-10 19:50         ` Kevin Cernekee
2014-11-11 17:35           ` Rob Herring
2014-11-11 19:50             ` Kevin Cernekee
2014-11-10 14:14 ` [PATCH 1/2] of: Fix crash if an earlycon driver is not found Rob Herring
2014-11-10 19:01   ` Sergei Shtylyov
2014-11-12 17:12   ` Grant Likely
2014-11-12 17:11 ` Grant Likely

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=1415523348-4631-2-git-send-email-cernekee@gmail.com \
    --to=cernekee@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jogo@openwrt.org \
    --cc=jslaby@suse.cz \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=mbizon@freebox.fr \
    --cc=robh@kernel.org \
    --cc=stable@vger.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).