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