2

I first found this by investigating parameters for earlycon but found that the options for console look almost identical. Both are present below and were taken from this source:

From documentation for console we have:

console=    [KNL] Output console device and options.

    tty<n>  Use the virtual console device <n>.

    ttyS<n>[,options]
    ttyUSB0[,options]
        Use the specified serial port.  The options are of
        the form "bbbbpnf", where "bbbb" is the baud rate,
        "p" is parity ("n", "o", or "e"), "n" is number of
        bits, and "f" is flow control ("r" for RTS or
        omit it).  Default is "9600n8".

        See Documentation/serial-console.txt for more
        information.  See
        Documentation/networking/netconsole.txt for an
        alternative.

    uart[8250],io,<addr>[,options]
    uart[8250],mmio,<addr>[,options]
    uart[8250],mmio16,<addr>[,options]
    uart[8250],mmio32,<addr>[,options]
    uart[8250],0x<addr>[,options]
        Start an early, polled-mode console on the 8250/16550
        UART at the specified I/O port or MMIO address,
        switching to the matching ttyS device later.
        MMIO inter-register address stride is either 8-bit
        (mmio), 16-bit (mmio16), or 32-bit (mmio32).
        If none of [io|mmio|mmio16|mmio32], <addr> is assumed
        to be equivalent to 'mmio'. 'options' are specified in
        the same format described for ttyS above; if unspecified,
        the h/w is not re-initialized.

    hvc<n>  Use the hypervisor console device <n>. This is for
        both Xen and PowerPC hypervisors.

            If the device connected to the port is not a TTY but a braille
            device, prepend "brl," before the device type, for instance
        console=brl,ttyS0
    For now, only VisioBraille is supported.

From documentation for earlycon we have:

earlycon=   [KNL] Output early console device and options.

        When used with no options, the early console is
        determined by the stdout-path property in device
        tree's chosen node.

    cdns,<addr>
        Start an early, polled-mode console on a cadence serial
        port at the specified address. The cadence serial port
        must already be setup and configured. Options are not
        yet supported.

    uart[8250],io,<addr>[,options]
    uart[8250],mmio,<addr>[,options]
    uart[8250],mmio32,<addr>[,options]
    uart[8250],mmio32be,<addr>[,options]
    uart[8250],0x<addr>[,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 or mmio32be).
        If none of [io|mmio|mmio32|mmio32be], <addr> is assumed
        to be equivalent to 'mmio'. 'options' are specified
        in the same format described for "console=ttyS<n>"; if
        unspecified, the h/w is not initialized.

    pl011,<addr>
    pl011,mmio32,<addr>
        Start an early, polled-mode console on a pl011 serial
        port at the specified address. The pl011 serial port
        must already be setup and configured. Options are not
        yet supported.  If 'mmio32' is specified, then only
        the driver will use only 32-bit accessors to read/write
        the device registers.

    meson,<addr>
        Start an early, polled-mode console on a meson serial
        port at the specified address. The serial port must
        already be setup and configured. Options are not yet
        supported.

    msm_serial,<addr>
        Start an early, polled-mode console on an msm serial
        port at the specified address. The serial port
        must already be setup and configured. Options are not
        yet supported.

    msm_serial_dm,<addr>
        Start an early, polled-mode console on an msm serial
        dm port at the specified address. The serial port
        must already be setup and configured. Options are not
        yet supported.

    smh Use ARM semihosting calls for early console.

    s3c2410,<addr>
    s3c2412,<addr>
    s3c2440,<addr>
    s3c6400,<addr>
    s5pv210,<addr>
    exynos4210,<addr>
        Use early console provided by serial driver available
        on Samsung SoCs, requires selecting proper type and
        a correct base address of the selected UART port. The
        serial port must already be setup and configured.
        Options are not yet supported.

    lpuart,<addr>
    lpuart32,<addr>
        Use early console provided by Freescale LP UART driver
        found on Freescale Vybrid and QorIQ LS1021A processors.
        A valid base address must be provided, and the serial
        port must already be setup and configured.

    armada3700_uart,<addr>
        Start an early, polled-mode console on the
        Armada 3700 serial port at the specified
        address. The serial port must already be setup
        and configured. Options are not yet supported.

An example of the usage is:

earlycon=uart8250,0x21c0500

My questions are:

  • Why is there a reference to the 8250/16550 physical hardware? Has this old implementation molded into an interface specification for modern designs? That is, are we still using the drivers for UART that were compatible when these comms devices were external to the SoC?

  • If MMIO is Memory Mapped IO, what is "normal" IO referring to in this context?

  • What is the <addr> parameter? Is this the beginning of the UART configuration registers for the specific SoC you are running this kernel on? Do most UART configuration registers conform to a specific register layout such that a generic UART driver may appropriately configure the hardware?

  • @phk, I edited the OP to include links to the documentation I was reading and references to console for convenience, but it is nearly identical (with fewer configuration options) to earlycon. – sherrellbc Jun 28 '16 at 18:33
2

I'm sure someone is still doing this, but back in the days before stuff like ILO/DRAC/etc. became cheap and ubiquitios the best way to get "out of band" access to the console in case of emergencies or an oops was over the serial port. You would mount a Terminal Server in the rack, then run cables to the serial port of your servers. Some BIOSs supported console redirection to the serial port (for example VA Linux and SuperMicro servers in the 1999+ timeframe).

The 8250/16550 UARTS were some of the most popluar serial port chips at the time, meaning that they would be the best supported under Linux, and all of them used the 8250 kernel driver (there were many more models in that series that all used the same driver).

I suspect that a lot of SoC designs intended to be used by linux built 8250/16550 compatible UARTs into them because it was the easy button--well documented and a well tested driver. Although hopefully they built the later multibyte buffer versions (of course even "slow" processors by todays standards can service a serial interrupt far more often than a 115k serial port can receive it. IIRC the Mac had a serial port used for Local/Apple Talk (Can't remember which was the protocol and which was the hardware) that did 248k. Still, that was back when CPUs did 60Mhz.

This is probably the best answer for the difference between MMIO and Port I/O: https://en.wikipedia.org/wiki/Memory-mapped_I/O I don't understand that level well enough to boil it down.

The above link will probably answer what is for these purposes, but basically it's a memory address.

  • You can still do this with iLO. Login via SSH to the BMC's IP address and type VSP to get a virtual serial port. Works even without an iLO Advanced licence, including after boot. It uses the old-school port-mapped I/O. – GreenReaper Jun 22 '18 at 4:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.