From patchwork Sun Dec 1 06:26:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Yanovich X-Patchwork-Id: 3261491 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BD162BEEAD for ; Sun, 1 Dec 2013 06:28:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D805320498 for ; Sun, 1 Dec 2013 06:28:04 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D9A5620494 for ; Sun, 1 Dec 2013 06:28:03 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vn0V8-0005UQ-9c; Sun, 01 Dec 2013 06:27:30 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vn0Ux-0002Js-OL; Sun, 01 Dec 2013 06:27:19 +0000 Received: from mail-lb0-x22e.google.com ([2a00:1450:4010:c04::22e]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vn0Uv-0002IE-0W for linux-arm-kernel@lists.infradead.org; Sun, 01 Dec 2013 06:27:17 +0000 Received: by mail-lb0-f174.google.com with SMTP id c11so7739760lbj.19 for ; Sat, 30 Nov 2013 22:26:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SICXcrzA+5LOFwhyvD99sUgVUUcBHBj/HxzhRhKFgIM=; b=HSNznId/suoPltL25rdaM0nGKGbnIFDL5Yyiqfl5Zoy+bAE0zggKESuleD4SKnWFfO ywwwlWU3a57K4XEPvsD8uidJZ3cnKKj7e6GpuSM1+WBCbkR6Sx+hr5bkT1is/K5M7tG5 e2e+wTvmpZY+1z9yIlaTqq62XlFDxhhYR92TUDsvo2zZoFTnBJBVAr58j674CO9D6P1F EVhOm0RxIl0/gayplVt6ZzLfSbxB5h1JxFmEfGkASaika8o46GSuIqBSH48ilpbK0/cs ixY10NOihzxNhnfCbNPT9QBXw6jq6JwqpxaYdOjvAxL6OF6ZaOUzqV9PraZh+C6li9yj DwWA== X-Received: by 10.152.45.8 with SMTP id i8mr41643049lam.12.1385879212310; Sat, 30 Nov 2013 22:26:52 -0800 (PST) Received: from host5.omatika.ru (0893675324.static.corbina.ru. [95.31.1.192]) by mx.google.com with ESMTPSA id e10sm82577921laa.6.2013.11.30.22.26.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Nov 2013 22:26:51 -0800 (PST) From: Sergei Ianovich To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 01/11] resolve PXA<->8250 serial device address conflict Date: Sun, 1 Dec 2013 10:26:14 +0400 Message-Id: <1385879185-22455-2-git-send-email-ynvich@gmail.com> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1385879185-22455-1-git-send-email-ynvich@gmail.com> References: <1385879185-22455-1-git-send-email-ynvich@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131201_012717_235789_E55CAE05 X-CRM114-Status: GOOD ( 12.91 ) X-Spam-Score: -1.9 (-) Cc: Sergei Ianovich , Greg Kroah-Hartman , Jiri Slaby , "open list:SERIAL DRIVERS" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SBL, RP_MATCHES_RCVD, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP PXA serial ports have "standard" UART names (ttyS[0-3]), major device number (4) and first minor device number (64) by default. If the system has extra 8250 serial port hardware in addition to onboard PXA serial ports, default settings produce a device allocation conflict. The patch provides a configuration option which can move onboard ports out of the way of 8250_core by assigning a different (204) major number and corresponding device names (ttySA[0-3]). Signed-off-by: Sergei Ianovich --- drivers/tty/serial/Kconfig | 19 +++++++++++++++++++ drivers/tty/serial/pxa.c | 22 ++++++++++++++++++---- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index a3817ab..328b716 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -419,6 +419,25 @@ config SERIAL_PXA_CONSOLE your boot loader (lilo or loadlin) about how to pass options to the kernel at boot time.) +config SERIAL_PXA_AS_TTYSA + bool "PXA serial ports with SA-1100 name and major number" + depends on SERIAL_PXA + default N + help + PXA serial ports have "standard" UART names (ttyS[0-3]), major + device number (4) and first minor device number (64) by default. + + If the system has extra 8250 serial port hardware in addition + to onboard PXA serial ports, default settings produce a device + allocation conflict. + + Selecting this option will move onboard ports out of the way of + 8250_core by assigning a different (204) major number and + corresponding device names (ttySA[0-3]). + + Say Y here, if you need to support extra 8250 serial port hardware + on a PXA system. + config SERIAL_SA1100 bool "SA1100 serial port support" depends on ARCH_SA1100 diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c index f9f20f3..2b5a8ad 100644 --- a/drivers/tty/serial/pxa.c +++ b/drivers/tty/serial/pxa.c @@ -593,6 +593,20 @@ serial_pxa_type(struct uart_port *port) static struct uart_pxa_port *serial_pxa_ports[4]; static struct uart_driver serial_pxa_reg; +#ifndef CONFIG_SERIAL_PXA_AS_TTYSA + +#define PXA_TTY_NAME "ttyS" +#define PXA_TTY_MAJOR TTY_MAJOR +#define PXA_TTY_MINOR 64 + +#else + +#define PXA_TTY_NAME "ttySA" +#define PXA_TTY_MAJOR 204 +#define PXA_TTY_MINOR 5 + +#endif + #ifdef CONFIG_SERIAL_PXA_CONSOLE #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) @@ -751,7 +765,7 @@ serial_pxa_console_setup(struct console *co, char *options) } static struct console serial_pxa_console = { - .name = "ttyS", + .name = PXA_TTY_NAME, .write = serial_pxa_console_write, .device = uart_console_device, .setup = serial_pxa_console_setup, @@ -792,9 +806,9 @@ static struct uart_ops serial_pxa_pops = { static struct uart_driver serial_pxa_reg = { .owner = THIS_MODULE, .driver_name = "PXA serial", - .dev_name = "ttyS", - .major = TTY_MAJOR, - .minor = 64, + .dev_name = PXA_TTY_NAME, + .major = PXA_TTY_MAJOR, + .minor = PXA_TTY_MINOR, .nr = 4, .cons = PXA_CONSOLE, };