Commit 6e63be3f authored by Noam Camus's avatar Noam Camus Committed by Greg Kroah-Hartman

serial: earlycon: Add support for big-endian MMIO accesses

Support command line parameters of the form:
earlycon=<name>,io|mmio|mmio32|mmio32be,<addr>,<options>

This commit seem to be needed even after commit:
serial: 8250: Add support for big-endian MMIO accesses
c627f2ceSigned-off-by: default avatarNoam Camus <noamc@ezchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0f17e3b4
...@@ -959,14 +959,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted. ...@@ -959,14 +959,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
uart[8250],io,<addr>[,options] uart[8250],io,<addr>[,options]
uart[8250],mmio,<addr>[,options] uart[8250],mmio,<addr>[,options]
uart[8250],mmio32,<addr>[,options] uart[8250],mmio32,<addr>[,options]
uart[8250],mmio32be,<addr>[,options]
uart[8250],0x<addr>[,options] uart[8250],0x<addr>[,options]
Start an early, polled-mode console on the 8250/16550 Start an early, polled-mode console on the 8250/16550
UART at the specified I/O port or MMIO address. UART at the specified I/O port or MMIO address.
MMIO inter-register address stride is either 8-bit MMIO inter-register address stride is either 8-bit
(mmio) or 32-bit (mmio32). (mmio) or 32-bit (mmio32 or mmio32be).
If none of [io|mmio|mmio32], <addr> is assumed to be If none of [io|mmio|mmio32|mmio32be], <addr> is assumed
equivalent to 'mmio'. 'options' are specified in the to be equivalent to 'mmio'. 'options' are specified
same format described for "console=ttyS<n>"; if in the same format described for "console=ttyS<n>"; if
unspecified, the h/w is not initialized. unspecified, the h/w is not initialized.
pl011,<addr> pl011,<addr>
......
...@@ -72,6 +72,7 @@ static int __init parse_options(struct earlycon_device *device, char *options) ...@@ -72,6 +72,7 @@ static int __init parse_options(struct earlycon_device *device, char *options)
switch (port->iotype) { switch (port->iotype) {
case UPIO_MEM32: case UPIO_MEM32:
case UPIO_MEM32BE:
port->regshift = 2; /* fall-through */ port->regshift = 2; /* fall-through */
case UPIO_MEM: case UPIO_MEM:
port->mapbase = addr; port->mapbase = addr;
...@@ -90,9 +91,11 @@ static int __init parse_options(struct earlycon_device *device, char *options) ...@@ -90,9 +91,11 @@ static int __init parse_options(struct earlycon_device *device, char *options)
strlcpy(device->options, options, length); 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", 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, (unsigned long long)port->mapbase,
device->options); device->options);
else else
...@@ -133,7 +136,7 @@ static int __init register_earlycon(char *buf, const struct earlycon_id *match) ...@@ -133,7 +136,7 @@ static int __init register_earlycon(char *buf, const struct earlycon_id *match)
* *
* Registers the earlycon console matching the earlycon specified * Registers the earlycon console matching the earlycon specified
* in the param string @buf. Acceptable param strings are of the form * in the param string @buf. Acceptable param strings are of the form
* <name>,io|mmio|mmio32,<addr>,<options> * <name>,io|mmio|mmio32|mmio32be,<addr>,<options>
* <name>,0x<addr>,<options> * <name>,0x<addr>,<options>
* <name>,<options> * <name>,<options>
* <name> * <name>
......
...@@ -1814,8 +1814,8 @@ uart_get_console(struct uart_port *ports, int nr, struct console *co) ...@@ -1814,8 +1814,8 @@ uart_get_console(struct uart_port *ports, int nr, struct console *co)
* @options: ptr for <options> field; NULL if not present (out) * @options: ptr for <options> field; NULL if not present (out)
* *
* Decodes earlycon kernel command line parameters of the form * Decodes earlycon kernel command line parameters of the form
* earlycon=<name>,io|mmio|mmio32,<addr>,<options> * earlycon=<name>,io|mmio|mmio32|mmio32be,<addr>,<options>
* console=<name>,io|mmio|mmio32,<addr>,<options> * console=<name>,io|mmio|mmio32|mmio32be,<addr>,<options>
* *
* The optional form * The optional form
* earlycon=<name>,0x<addr>,<options> * earlycon=<name>,0x<addr>,<options>
...@@ -1833,6 +1833,9 @@ int uart_parse_earlycon(char *p, unsigned char *iotype, unsigned long *addr, ...@@ -1833,6 +1833,9 @@ int uart_parse_earlycon(char *p, unsigned char *iotype, unsigned long *addr,
} else if (strncmp(p, "mmio32,", 7) == 0) { } else if (strncmp(p, "mmio32,", 7) == 0) {
*iotype = UPIO_MEM32; *iotype = UPIO_MEM32;
p += 7; p += 7;
} else if (strncmp(p, "mmio32be,", 9) == 0) {
*iotype = UPIO_MEM32BE;
p += 9;
} else if (strncmp(p, "io,", 3) == 0) { } else if (strncmp(p, "io,", 3) == 0) {
*iotype = UPIO_PORT; *iotype = UPIO_PORT;
p += 3; p += 3;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment