kernel - Add support for MosChip PCIe serial com, and console support
commitfb3cf125d14f9ce5c7fbbb8774eb3d5f88f6344c
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 29 May 2018 02:58:03 +0000 (28 19:58 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 29 May 2018 03:08:13 +0000 (28 20:08 -0700)
treedc776969433adf5a5a25b59d98cd4fc88387afb9
parentef022ceaf3a112f56d17a1eb3114a368e4b6b5fa
kernel - Add support for MosChip PCIe serial com, and console support

* Add support for the MosChip PCIe serial com (brand is typically
  'StarTech' 'Natikve PCI Express RS232 serial adapter card with
  16550 UART'.

* Add late console support.  Console operation works the same
  way, set it up in /boot/loader.conf.  Typically:

  sio0.flags=0x00
  sio4.flags=0x30
  sio4.baud=115200
  #set boot_serial="YES" <-- commented out, do not set this

  Note that at the point a late-configured serial port
  wants to become the console, syscons is probably already
  the console, so you have to use flags 0x30 instead of
  0x10 to force it to change the console.

* Note, you do not have to set boot_serial="YES", because it
  won't really help since the adapter isn't accessible to the
  boot loader or to the kernel until the PCIe device probes
  in the middle of the boot sequence.

* The kernel now retests for consoles at the end of its normal
  configuration sequence, which allows the now-available
  sioN devices from PCIe card(s) to become the console.

* Remove syscons sccnterm() code that tried to undo the syscons
  console designation.  This code was never called in the past
  because the system console couldn't actually change once
  selected.  But now it can, and the code completely blows up
  syscons for numerous reasons.  Just leave the console
  designation intact from syscons's point of view (the main
  system will be vectored elsewhere so syscons will simply
  not receive new kernel console reads and writes).

* Add a siocntxwait() call before changing com parameters,
  since we are potentially changing the baud rate here.

* Change how the SIO driver assigns baud rates for the console
  to handle late-console configurations.  Also, allow sio*.baud
  variables in loader.conf to override the default com rate.

* Add entries for com5 and com6 to /etc/remote, and default to
  a more reasonable baud rate of 115200.
etc/remote
sys/dev/misc/syscons/syscons.c
sys/dev/serial/sio/sio.c
sys/kern/tty_cons.c
sys/platform/pc64/x86_64/autoconf.c
sys/platform/vkernel64/x86_64/autoconf.c