Skip to content

Commit f71fc3b

Browse files
diandersDaniel Thompson
authored andcommitted
Documentation: kgdboc: Document new kgdboc_earlycon parameter
The recent patch ("kgdboc: Add kgdboc_earlycon to support early kgdb using boot consoles") adds a new kernel command line parameter. Document it. Note that the patch adding the feature does some comparing/contrasting of "kgdboc_earlycon" vs. the existing "ekgdboc". See that patch for more details, but briefly "ekgdboc" can be used _instead_ of "kgdboc" and just makes "kgdboc" do its normal initialization early (only works if your tty driver is already ready). The new "kgdboc_earlycon" works in combination with "kgdboc" and is backed by boot consoles. Signed-off-by: Douglas Anderson <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Daniel Thompson <[email protected]> Link: https://lore.kernel.org/r/20200507130644.v4.9.I7d5eb42c6180c831d47aef1af44d0b8be3fac559@changeid Signed-off-by: Daniel Thompson <[email protected]>
1 parent b135013 commit f71fc3b

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,11 @@
11901190
This is designed to be used in conjunction with
11911191
the boot argument: earlyprintk=vga
11921192

1193+
This parameter works in place of the kgdboc parameter
1194+
but can only be used if the backing tty is available
1195+
very early in the boot process. For early debugging
1196+
via a serial port see kgdboc_earlycon instead.
1197+
11931198
edd= [EDD]
11941199
Format: {"off" | "on" | "skip[mbr]"}
11951200

@@ -2105,6 +2110,21 @@
21052110
kms, kbd format: kms,kbd
21062111
kms, kbd and serial format: kms,kbd,<ser_dev>[,baud]
21072112

2113+
kgdboc_earlycon= [KGDB,HW]
2114+
If the boot console provides the ability to read
2115+
characters and can work in polling mode, you can use
2116+
this parameter to tell kgdb to use it as a backend
2117+
until the normal console is registered. Intended to
2118+
be used together with the kgdboc parameter which
2119+
specifies the normal console to transition to.
2120+
2121+
The name of the early console should be specified
2122+
as the value of this parameter. Note that the name of
2123+
the early console might be different than the tty
2124+
name passed to kgdboc. It's OK to leave the value
2125+
blank and the first boot console that implements
2126+
read() will be picked.
2127+
21082128
kgdbwait [KGDB] Stop kernel execution and enter the
21092129
kernel debugger at the earliest opportunity.
21102130

Documentation/dev-tools/kgdb.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,30 @@ don't like this are to hack gdb to send the :kbd:`SysRq-G` for you as well as
274274
on the initial connect, or to use a debugger proxy that allows an
275275
unmodified gdb to do the debugging.
276276

277+
Kernel parameter: ``kgdboc_earlycon``
278+
-------------------------------------
279+
280+
If you specify the kernel parameter ``kgdboc_earlycon`` and your serial
281+
driver registers a boot console that supports polling (doesn't need
282+
interrupts and implements a nonblocking read() function) kgdb will attempt
283+
to work using the boot console until it can transition to the regular
284+
tty driver specified by the ``kgdboc`` parameter.
285+
286+
Normally there is only one boot console (especially that implements the
287+
read() function) so just adding ``kgdboc_earlycon`` on its own is
288+
sufficient to make this work. If you have more than one boot console you
289+
can add the boot console's name to differentiate. Note that names that
290+
are registered through the boot console layer and the tty layer are not
291+
the same for the same port.
292+
293+
For instance, on one board to be explicit you might do::
294+
295+
kgdboc_earlycon=qcom_geni kgdboc=ttyMSM0
296+
297+
If the only boot console on the device was "qcom_geni", you could simplify::
298+
299+
kgdboc_earlycon kgdboc=ttyMSM0
300+
277301
Kernel parameter: ``kgdbwait``
278302
------------------------------
279303

0 commit comments

Comments
 (0)