内核参数“console”和“earlycon”是指旧硬件吗?

内核参数“console”和“earlycon”是指旧硬件吗?

我首先通过研究 的参数发现这一点,earlycon但发现 的选项console看起来几乎相同。两者均出现在下面并摘自来源:

从文档中console我们有:

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.

从文档中earlycon我们有:

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.

用法的一个例子是:

earlycon=uart8250,0x21c0500

我的问题是:

  • 为什么有一个参考8250/16550物理硬件?这种旧的实现是否已融入现代设计的接口规范中?也就是说,当这些通信设备位于 SoC 外部时,我们是否仍在使用兼容的 UART 驱动程序?

  • 如果 MMIO 是内存映射IO,在这种情况下“正常”IO 指的是什么?

  • 参数是什么<addr>?这是您运行该内核的特定 SoC 的 UART 配置寄存器的开头吗?大多数 UART 配置寄存器是否符合特定的寄存器布局,以便通用 UART 驱动程序可以正确配置硬件?

答案1

我确信有人仍在这样做,但早在 ILO/DRAC/等之前的日子里。由于变得便宜且普遍,在紧急情况或意外情况下“带外”访问控制台的最佳方式是通过串行端口。您可以在机架中安装终端服务器,然后将电缆连接到服务器的串行端口。某些 BIOS 支持控制台重定向到串行端口(例如 1999 年以上时间范围内的 VA Linux 和 SuperMicro 服务器)。

8250/16550 UARTS是当时最流行的串口芯片之一,这意味着它们将在Linux下得到最好的支持,并且它们都使用了8250内核驱动程序(该系列中还有更多型号都使用了8250内核驱动程序)同一个司机)。

我怀疑很多打算供 Linux 使用的 SoC 设计都内置了 8250/16550 兼容的 UART,因为这是一个简单的按钮——有详细的文档记录并且出色地经过测试的驱动程序。尽管希望他们构建了后来的多字节缓冲区版本(当然,按照当今的标准,即使是“慢速”处理器也可以比 115k 串行端口接收它的频率更频繁地处理串行中断)。 IIRC Mac 有一个用于 Local/Apple Talk 的串行端口(不记得哪个是协议,哪个是硬件),速度为 248k。不过,那还是 CPU 主频为 60Mhz 的时候。

这可能是 MMIO 和端口 I/O 之间区别的最佳答案:https://en.wikipedia.org/wiki/Memory-mapped_I/O我对这个水平的理解还不够深入,无法归结为这一点。

上面的链接可能会回答这些目的是什么,但基本上它是一个内存地址。

相关内容