Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752105AbbEPNqq (ORCPT ); Sat, 16 May 2015 09:46:46 -0400 Received: from mail-db3on0057.outbound.protection.outlook.com ([157.55.234.57]:55364 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751155AbbEPNqo (ORCPT ); Sat, 16 May 2015 09:46:44 -0400 X-Greylist: delayed 870 seconds by postgrey-1.27 at vger.kernel.org; Sat, 16 May 2015 09:46:43 EDT Authentication-Results: spf=fail (sender IP is 212.179.42.66) smtp.mailfrom=ezchip.com; vger.kernel.org; dkim=none (message not signed) header.d=none; From: Noam Camus To: , , CC: , , , "Noam Camus" Subject: [PATCH 1/1] serial: earlycon: Add support for big-endian MMIO accesses Date: Sat, 16 May 2015 16:31:49 +0300 Message-ID: <1431783109-26679-1-git-send-email-noamc@ezchip.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-11.0.0.1191-7.500.1018-21534.006 X-TM-AS-Result: No--3.144100-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;DB3FFO11FD036;1:E/nOppJtnEzBVDaI6BLjnCIUVENstbClUuPdUA9LtTjsYLbnMtvzZ2IOogJfw8goArddDMsLrUZIN/74dFpHIuJ1NZVqAjFOoIbVUCyM81rlnATi393hLN/baaN8nEPVpg9UJSsCXxPvF2cTQmZs2RI09eFoNxc5FjrhcTUUv6LGcxmugBEvLyIIvMsAuF2vjk/KIR43TTTMQ7WqSiQs+Yw4urjONrkD3Ofv8XuG3YavbpgloLKrgcPzohU0DJUUtOx8Ss2QasF+Y5yvpD4jeg== X-Forefront-Antispam-Report: CIP:212.179.42.66;CTRY:IL;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(339900001)(199003)(189002)(6806004)(105606002)(85426001)(19580395003)(46102003)(92566002)(48376002)(19580405001)(49486002)(87936001)(50466002)(2201001)(33646002)(104016003)(36756003)(107886002)(5001920100001)(5001970100001)(5001770100001)(50226001)(189998001)(86362001)(575784001)(47776003)(77156002)(106466001)(62966003)(77096005)(229853001)(50986999)(4001430100001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM3PR02MB1140;H:ezex10.ezchip.com;FPR:;SPF:Fail;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM3PR02MB1140; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:AM3PR02MB1140;BCL:0;PCL:0;RULEID:;SRVR:AM3PR02MB1140; X-Forefront-PRVS: 057859F9C5 X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2015 13:32:10.2030 (UTC) X-MS-Exchange-CrossTenant-Id: 0fc16e0a-3cd3-4092-8b2f-0a42cff122c3 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0fc16e0a-3cd3-4092-8b2f-0a42cff122c3;Ip=[212.179.42.66];Helo=[ezex10.ezchip.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR02MB1140 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4406 Lines: 108 From: Noam Camus Support command line parameters of the form: earlycon=,io|mmio|mmio32|mmio32be,, This commit seem to be needed even after commit: serial: 8250: Add support for big-endian MMIO accesses c627f2ceb692e8a9358b64ac2d139314e7bb0d17 Signed-off-by: Noam Camus --- Documentation/kernel-parameters.txt | 9 +++++---- drivers/tty/serial/earlycon.c | 9 ++++++--- drivers/tty/serial/serial_core.c | 7 +++++-- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 61ab162..55bb093 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -959,14 +959,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted. uart[8250],io,[,options] uart[8250],mmio,[,options] uart[8250],mmio32,[,options] + uart[8250],mmio32be,[,options] uart[8250],0x[,options] Start an early, polled-mode console on the 8250/16550 UART at the specified I/O port or MMIO address. MMIO inter-register address stride is either 8-bit - (mmio) or 32-bit (mmio32). - If none of [io|mmio|mmio32], is assumed to be - equivalent to 'mmio'. 'options' are specified in the - same format described for "console=ttyS"; if + (mmio) or 32-bit (mmio32 or mmio32be). + If none of [io|mmio|mmio32|mmio32be], is assumed + to be equivalent to 'mmio'. 'options' are specified + in the same format described for "console=ttyS"; if unspecified, the h/w is not initialized. pl011, diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c index 5fdc9f3..a840732 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -72,6 +72,7 @@ static int __init parse_options(struct earlycon_device *device, char *options) switch (port->iotype) { case UPIO_MEM32: + case UPIO_MEM32BE: port->regshift = 2; /* fall-through */ case UPIO_MEM: port->mapbase = addr; @@ -90,9 +91,11 @@ static int __init parse_options(struct earlycon_device *device, char *options) strlcpy(device->options, options, length); } - if (port->iotype == UPIO_MEM || port->iotype == UPIO_MEM32) + if (port->iotype == UPIO_MEM || port->iotype == UPIO_MEM32 || + port->iotype == UPIO_MEM32BE) pr_info("Early serial console at MMIO%s 0x%llx (options '%s')\n", - (port->iotype == UPIO_MEM32) ? "32" : "", + (port->iotype == UPIO_MEM) ? "" : + (port->iotype == UPIO_MEM32) ? "32" : "32be", (unsigned long long)port->mapbase, device->options); else @@ -133,7 +136,7 @@ static int __init register_earlycon(char *buf, const struct earlycon_id *match) * * Registers the earlycon console matching the earlycon specified * in the param string @buf. Acceptable param strings are of the form - * ,io|mmio|mmio32,, + * ,io|mmio|mmio32|mmio32be,, * ,0x, * , * diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 0b7bb12..1124090 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -1816,8 +1816,8 @@ uart_get_console(struct uart_port *ports, int nr, struct console *co) * @options: ptr for field; NULL if not present (out) * * Decodes earlycon kernel command line parameters of the form - * earlycon=,io|mmio|mmio32,, - * console=,io|mmio|mmio32,, + * earlycon=,io|mmio|mmio32|mmio32be,, + * console=,io|mmio|mmio32|mmio32be,, * * The optional form * earlycon=,0x, @@ -1835,6 +1835,9 @@ int uart_parse_earlycon(char *p, unsigned char *iotype, unsigned long *addr, } else if (strncmp(p, "mmio32,", 7) == 0) { *iotype = UPIO_MEM32; p += 7; + } else if (strncmp(p, "mmio32be,", 9) == 0) { + *iotype = UPIO_MEM32BE; + p += 9; } else if (strncmp(p, "io,", 3) == 0) { *iotype = UPIO_PORT; p += 3; -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/