serial.rst 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. ==============
  2. Serial Devices
  3. ==============
  4. Serial Device Naming
  5. ====================
  6. As of 2.6.10, serial devices on ia64 are named based on the
  7. order of ACPI and PCI enumeration. The first device in the
  8. ACPI namespace (if any) becomes /dev/ttyS0, the second becomes
  9. /dev/ttyS1, etc., and PCI devices are named sequentially
  10. starting after the ACPI devices.
  11. Prior to 2.6.10, there were confusing exceptions to this:
  12. - Firmware on some machines (mostly from HP) provides an HCDP
  13. table[1] that tells the kernel about devices that can be used
  14. as a serial console. If the user specified "console=ttyS0"
  15. or the EFI ConOut path contained only UART devices, the
  16. kernel registered the device described by the HCDP as
  17. /dev/ttyS0.
  18. - If there was no HCDP, we assumed there were UARTs at the
  19. legacy COM port addresses (I/O ports 0x3f8 and 0x2f8), so
  20. the kernel registered those as /dev/ttyS0 and /dev/ttyS1.
  21. Any additional ACPI or PCI devices were registered sequentially
  22. after /dev/ttyS0 as they were discovered.
  23. With an HCDP, device names changed depending on EFI configuration
  24. and "console=" arguments. Without an HCDP, device names didn't
  25. change, but we registered devices that might not really exist.
  26. For example, an HP rx1600 with a single built-in serial port
  27. (described in the ACPI namespace) plus an MP[2] (a PCI device) has
  28. these ports:
  29. ========== ========== ============ ============ =======
  30. Type MMIO pre-2.6.10 pre-2.6.10 2.6.10+
  31. address
  32. (EFI console (EFI console
  33. on builtin) on MP port)
  34. ========== ========== ============ ============ =======
  35. builtin 0xff5e0000 ttyS0 ttyS1 ttyS0
  36. MP UPS 0xf8031000 ttyS1 ttyS2 ttyS1
  37. MP Console 0xf8030000 ttyS2 ttyS0 ttyS2
  38. MP 2 0xf8030010 ttyS3 ttyS3 ttyS3
  39. MP 3 0xf8030038 ttyS4 ttyS4 ttyS4
  40. ========== ========== ============ ============ =======
  41. Console Selection
  42. =================
  43. EFI knows what your console devices are, but it doesn't tell the
  44. kernel quite enough to actually locate them. The DIG64 HCDP
  45. table[1] does tell the kernel where potential serial console
  46. devices are, but not all firmware supplies it. Also, EFI supports
  47. multiple simultaneous consoles and doesn't tell the kernel which
  48. should be the "primary" one.
  49. So how do you tell Linux which console device to use?
  50. - If your firmware supplies the HCDP, it is simplest to
  51. configure EFI with a single device (either a UART or a VGA
  52. card) as the console. Then you don't need to tell Linux
  53. anything; the kernel will automatically use the EFI console.
  54. (This works only in 2.6.6 or later; prior to that you had
  55. to specify "console=ttyS0" to get a serial console.)
  56. - Without an HCDP, Linux defaults to a VGA console unless you
  57. specify a "console=" argument.
  58. NOTE: Don't assume that a serial console device will be /dev/ttyS0.
  59. It might be ttyS1, ttyS2, etc. Make sure you have the appropriate
  60. entries in /etc/inittab (for getty) and /etc/securetty (to allow
  61. root login).
  62. Early Serial Console
  63. ====================
  64. The kernel can't start using a serial console until it knows where
  65. the device lives. Normally this happens when the driver enumerates
  66. all the serial devices, which can happen a minute or more after the
  67. kernel starts booting.
  68. 2.6.10 and later kernels have an "early uart" driver that works
  69. very early in the boot process. The kernel will automatically use
  70. this if the user supplies an argument like "console=uart,io,0x3f8",
  71. or if the EFI console path contains only a UART device and the
  72. firmware supplies an HCDP.
  73. Troubleshooting Serial Console Problems
  74. =======================================
  75. No kernel output after elilo prints "Uncompressing Linux... done":
  76. - You specified "console=ttyS0" but Linux changed the device
  77. to which ttyS0 refers. Configure exactly one EFI console
  78. device[3] and remove the "console=" option.
  79. - The EFI console path contains both a VGA device and a UART.
  80. EFI and elilo use both, but Linux defaults to VGA. Remove
  81. the VGA device from the EFI console path[3].
  82. - Multiple UARTs selected as EFI console devices. EFI and
  83. elilo use all selected devices, but Linux uses only one.
  84. Make sure only one UART is selected in the EFI console
  85. path[3].
  86. - You're connected to an HP MP port[2] but have a non-MP UART
  87. selected as EFI console device. EFI uses the MP as a
  88. console device even when it isn't explicitly selected.
  89. Either move the console cable to the non-MP UART, or change
  90. the EFI console path[3] to the MP UART.
  91. Long pause (60+ seconds) between "Uncompressing Linux... done" and
  92. start of kernel output:
  93. - No early console because you used "console=ttyS<n>". Remove
  94. the "console=" option if your firmware supplies an HCDP.
  95. - If you don't have an HCDP, the kernel doesn't know where
  96. your console lives until the driver discovers serial
  97. devices. Use "console=uart,io,0x3f8" (or appropriate
  98. address for your machine).
  99. Kernel and init script output works fine, but no "login:" prompt:
  100. - Add getty entry to /etc/inittab for console tty. Look for
  101. the "Adding console on ttyS<n>" message that tells you which
  102. device is the console.
  103. "login:" prompt, but can't login as root:
  104. - Add entry to /etc/securetty for console tty.
  105. No ACPI serial devices found in 2.6.17 or later:
  106. - Turn on CONFIG_PNP and CONFIG_PNPACPI. Prior to 2.6.17, ACPI
  107. serial devices were discovered by 8250_acpi. In 2.6.17,
  108. 8250_acpi was replaced by the combination of 8250_pnp and
  109. CONFIG_PNPACPI.
  110. [1]
  111. http://www.dig64.org/specifications/agreement
  112. The table was originally defined as the "HCDP" for "Headless
  113. Console/Debug Port." The current version is the "PCDP" for
  114. "Primary Console and Debug Port Devices."
  115. [2]
  116. The HP MP (management processor) is a PCI device that provides
  117. several UARTs. One of the UARTs is often used as a console; the
  118. EFI Boot Manager identifies it as "Acpi(HWP0002,700)/Pci(...)/Uart".
  119. The external connection is usually a 25-pin connector, and a
  120. special dongle converts that to three 9-pin connectors, one of
  121. which is labelled "Console."
  122. [3]
  123. EFI console devices are configured using the EFI Boot Manager
  124. "Boot option maintenance" menu. You may have to interrupt the
  125. boot sequence to use this menu, and you will have to reset the
  126. box after changing console configuration.