aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Camus <noamc@ezchip.com>2015-05-24 23:54:28 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-31 17:55:12 -0400
commit6e63be3fee141cc6d122f648b524a66160dbe6aa (patch)
treed3210a5bd98d24de80fff5f44b7a9b071e2682ff
parent0f17e3b478a77e00e873f6ca235644322843c81e (diff)
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 c627f2ceb692e8a9358b64ac2d139314e7bb0d17 Signed-off-by: Noam Camus <noamc@ezchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--Documentation/kernel-parameters.txt9
-rw-r--r--drivers/tty/serial/earlycon.c9
-rw-r--r--drivers/tty/serial/serial_core.c7
3 files changed, 16 insertions, 9 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 61ab1628a057..55bb093a08a3 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.
959 uart[8250],io,<addr>[,options] 959 uart[8250],io,<addr>[,options]
960 uart[8250],mmio,<addr>[,options] 960 uart[8250],mmio,<addr>[,options]
961 uart[8250],mmio32,<addr>[,options] 961 uart[8250],mmio32,<addr>[,options]
962 uart[8250],mmio32be,<addr>[,options]
962 uart[8250],0x<addr>[,options] 963 uart[8250],0x<addr>[,options]
963 Start an early, polled-mode console on the 8250/16550 964 Start an early, polled-mode console on the 8250/16550
964 UART at the specified I/O port or MMIO address. 965 UART at the specified I/O port or MMIO address.
965 MMIO inter-register address stride is either 8-bit 966 MMIO inter-register address stride is either 8-bit
966 (mmio) or 32-bit (mmio32). 967 (mmio) or 32-bit (mmio32 or mmio32be).
967 If none of [io|mmio|mmio32], <addr> is assumed to be 968 If none of [io|mmio|mmio32|mmio32be], <addr> is assumed
968 equivalent to 'mmio'. 'options' are specified in the 969 to be equivalent to 'mmio'. 'options' are specified
969 same format described for "console=ttyS<n>"; if 970 in the same format described for "console=ttyS<n>"; if
970 unspecified, the h/w is not initialized. 971 unspecified, the h/w is not initialized.
971 972
972 pl011,<addr> 973 pl011,<addr>
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index 6dc471e30e79..f09636083426 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)
72 72
73 switch (port->iotype) { 73 switch (port->iotype) {
74 case UPIO_MEM32: 74 case UPIO_MEM32:
75 case UPIO_MEM32BE:
75 port->regshift = 2; /* fall-through */ 76 port->regshift = 2; /* fall-through */
76 case UPIO_MEM: 77 case UPIO_MEM:
77 port->mapbase = addr; 78 port->mapbase = addr;
@@ -90,9 +91,11 @@ static int __init parse_options(struct earlycon_device *device, char *options)
90 strlcpy(device->options, options, length); 91 strlcpy(device->options, options, length);
91 } 92 }
92 93
93 if (port->iotype == UPIO_MEM || port->iotype == UPIO_MEM32) 94 if (port->iotype == UPIO_MEM || port->iotype == UPIO_MEM32 ||
95 port->iotype == UPIO_MEM32BE)
94 pr_info("Early serial console at MMIO%s 0x%llx (options '%s')\n", 96 pr_info("Early serial console at MMIO%s 0x%llx (options '%s')\n",
95 (port->iotype == UPIO_MEM32) ? "32" : "", 97 (port->iotype == UPIO_MEM) ? "" :
98 (port->iotype == UPIO_MEM32) ? "32" : "32be",
96 (unsigned long long)port->mapbase, 99 (unsigned long long)port->mapbase,
97 device->options); 100 device->options);
98 else 101 else
@@ -133,7 +136,7 @@ static int __init register_earlycon(char *buf, const struct earlycon_id *match)
133 * 136 *
134 * Registers the earlycon console matching the earlycon specified 137 * Registers the earlycon console matching the earlycon specified
135 * in the param string @buf. Acceptable param strings are of the form 138 * in the param string @buf. Acceptable param strings are of the form
136 * <name>,io|mmio|mmio32,<addr>,<options> 139 * <name>,io|mmio|mmio32|mmio32be,<addr>,<options>
137 * <name>,0x<addr>,<options> 140 * <name>,0x<addr>,<options>
138 * <name>,<options> 141 * <name>,<options>
139 * <name> 142 * <name>
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index eec067d8eedb..860e59fd6ef4 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -1814,8 +1814,8 @@ uart_get_console(struct uart_port *ports, int nr, struct console *co)
1814 * @options: ptr for <options> field; NULL if not present (out) 1814 * @options: ptr for <options> field; NULL if not present (out)
1815 * 1815 *
1816 * Decodes earlycon kernel command line parameters of the form 1816 * Decodes earlycon kernel command line parameters of the form
1817 * earlycon=<name>,io|mmio|mmio32,<addr>,<options> 1817 * earlycon=<name>,io|mmio|mmio32|mmio32be,<addr>,<options>
1818 * console=<name>,io|mmio|mmio32,<addr>,<options> 1818 * console=<name>,io|mmio|mmio32|mmio32be,<addr>,<options>
1819 * 1819 *
1820 * The optional form 1820 * The optional form
1821 * earlycon=<name>,0x<addr>,<options> 1821 * earlycon=<name>,0x<addr>,<options>
@@ -1833,6 +1833,9 @@ int uart_parse_earlycon(char *p, unsigned char *iotype, unsigned long *addr,
1833 } else if (strncmp(p, "mmio32,", 7) == 0) { 1833 } else if (strncmp(p, "mmio32,", 7) == 0) {
1834 *iotype = UPIO_MEM32; 1834 *iotype = UPIO_MEM32;
1835 p += 7; 1835 p += 7;
1836 } else if (strncmp(p, "mmio32be,", 9) == 0) {
1837 *iotype = UPIO_MEM32BE;
1838 p += 9;
1836 } else if (strncmp(p, "io,", 3) == 0) { 1839 } else if (strncmp(p, "io,", 3) == 0) {
1837 *iotype = UPIO_PORT; 1840 *iotype = UPIO_PORT;
1838 p += 3; 1841 p += 3;