]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/tty/serial/earlycon.c
serial: earlycon: Add support for big-endian MMIO accesses
[mirror_ubuntu-artful-kernel.git] / drivers / tty / serial / earlycon.c
index 5fdc9f3ecd644d9b58a0f9a10f150296b68282d7..f09636083426d5fc2fdb18a65a2a1af49a0093b7 100644 (file)
@@ -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
- *        <name>,io|mmio|mmio32,<addr>,<options>
+ *        <name>,io|mmio|mmio32|mmio32be,<addr>,<options>
  *        <name>,0x<addr>,<options>
  *        <name>,<options>
  *        <name>
@@ -187,13 +190,8 @@ static int __init param_setup_earlycon(char *buf)
                return 0;
 
        err = setup_earlycon(buf);
-       if (err == -ENOENT) {
-               pr_warn("no match for %s\n", buf);
-               err = 0;
-       } else if (err == -EALREADY) {
-               pr_warn("already registered\n");
-               err = 0;
-       }
+       if (err == -ENOENT || err == -EALREADY)
+               return 0;
        return err;
 }
 early_param("earlycon", param_setup_earlycon);