forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-02-19 1c055e55a242a33e574e48be530e06770a210dcd
kernel/Documentation/dev-tools/kgdb.rst
....@@ -274,6 +274,30 @@
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
....@@ -292,7 +316,7 @@
292316 Kernel parameter: ``kgdbcon``
293317 -----------------------------
294318
295
-The ``kgdbcon`` feature allows you to see :c:func:`printk` messages inside gdb
319
+The ``kgdbcon`` feature allows you to see printk() messages inside gdb
296320 while gdb is connected to the kernel. Kdb does not make use of the kgdbcon
297321 feature.
298322
....@@ -408,7 +432,7 @@
408432 ``ps`` Displays only the active processes
409433 ``ps A`` Shows all the processes
410434 ``summary`` Shows kernel version info and memory usage
411
- ``bt`` Get a backtrace of the current process using :c:func:`dump_stack`
435
+ ``bt`` Get a backtrace of the current process using dump_stack()
412436 ``dmesg`` View the kernel syslog buffer
413437 ``go`` Continue the system
414438 =========== =================================================================
....@@ -700,9 +724,9 @@
700724 The arch-specific portion implements:
701725
702726 - contains an arch-specific trap catcher which invokes
703
- :c:func:`kgdb_handle_exception` to start kgdb about doing its work
727
+ kgdb_handle_exception() to start kgdb about doing its work
704728
705
- - translation to and from gdb specific packet format to :c:type:`pt_regs`
729
+ - translation to and from gdb specific packet format to struct pt_regs
706730
707731 - Registration and unregistration of architecture specific trap
708732 hooks
....@@ -745,7 +769,7 @@
745769 config. Later run ``modprobe kdb_hello`` and the next time you
746770 enter the kdb shell, you can run the ``hello`` command.
747771
748
- - The implementation for :c:func:`kdb_printf` which emits messages directly
772
+ - The implementation for kdb_printf() which emits messages directly
749773 to I/O drivers, bypassing the kernel log.
750774
751775 - SW / HW breakpoint management for the kdb shell
....@@ -822,7 +846,7 @@
822846 the UART driver.
823847
824848 When using kgdboc with a UART, the UART driver must implement two
825
-callbacks in the :c:type:`struct uart_ops <uart_ops>`.
849
+callbacks in the struct uart_ops.
826850 Example from ``drivers/8250.c``::
827851
828852
....@@ -848,10 +872,10 @@
848872 attached keyboard. The keyboard infrastructure is only compiled into the
849873 kernel when ``CONFIG_KDB_KEYBOARD=y`` is set in the kernel configuration.
850874
851
-The core polled keyboard driver driver for PS/2 type keyboards is in
875
+The core polled keyboard driver for PS/2 type keyboards is in
852876 ``drivers/char/kdb_keyboard.c``. This driver is hooked into the debug core
853877 when kgdboc populates the callback in the array called
854
-:c:type:`kdb_poll_funcs[]`. The :c:func:`kdb_get_kbd_char` is the top-level
878
+:c:expr:`kdb_poll_funcs[]`. The kdb_get_kbd_char() is the top-level
855879 function which polls hardware for single character input.
856880
857881 kgdboc and kms
....@@ -863,10 +887,10 @@
863887 kernel mode setting support.
864888
865889 Every time the kernel debugger is entered it calls
866
-:c:func:`kgdboc_pre_exp_handler` which in turn calls :c:func:`con_debug_enter`
890
+kgdboc_pre_exp_handler() which in turn calls con_debug_enter()
867891 in the virtual console layer. On resuming kernel execution, the kernel
868
-debugger calls :c:func:`kgdboc_post_exp_handler` which in turn calls
869
-:c:func:`con_debug_leave`.
892
+debugger calls kgdboc_post_exp_handler() which in turn calls
893
+con_debug_leave().
870894
871895 Any video driver that wants to be compatible with the kernel debugger
872896 and the atomic kms callbacks must implement the ``mode_set_base_atomic``,