Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <dianders@chromium.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Link: https://lore.kernel.org/r/20200507130644.v4.9.I7d5eb42c6180c831d47aef1af44d0b8be3fac559@changeid
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>

authored by

Douglas Anderson and committed by
Daniel Thompson
f71fc3bc b1350132

+44
+20
Documentation/admin-guide/kernel-parameters.txt
··· 1190 1190 This is designed to be used in conjunction with 1191 1191 the boot argument: earlyprintk=vga 1192 1192 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 + 1193 1198 edd= [EDD] 1194 1199 Format: {"off" | "on" | "skip[mbr]"} 1195 1200 ··· 2109 2104 Optional Kernel mode setting: 2110 2105 kms, kbd format: kms,kbd 2111 2106 kms, kbd and serial format: kms,kbd,<ser_dev>[,baud] 2107 + 2108 + kgdboc_earlycon= [KGDB,HW] 2109 + If the boot console provides the ability to read 2110 + characters and can work in polling mode, you can use 2111 + this parameter to tell kgdb to use it as a backend 2112 + until the normal console is registered. Intended to 2113 + be used together with the kgdboc parameter which 2114 + specifies the normal console to transition to. 2115 + 2116 + The name of the early console should be specified 2117 + as the value of this parameter. Note that the name of 2118 + the early console might be different than the tty 2119 + name passed to kgdboc. It's OK to leave the value 2120 + blank and the first boot console that implements 2121 + read() will be picked. 2112 2122 2113 2123 kgdbwait [KGDB] Stop kernel execution and enter the 2114 2124 kernel debugger at the earliest opportunity.
+24
Documentation/dev-tools/kgdb.rst
··· 274 274 on the initial connect, or to use a debugger proxy that allows an 275 275 unmodified gdb to do the debugging. 276 276 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 + 277 301 Kernel parameter: ``kgdbwait`` 278 302 ------------------------------ 279 303