summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2018-11-20 14:42:47 -0800
committerJoshua M. Clulow <josh@sysmgr.org>2018-11-20 14:42:48 -0800
commitdbad7380d7852483de489e640f3a64b386115d59 (patch)
tree816e6a7640ec490774f43ff25d9319e7384057e3
parent60cbda0dc36aea401b9a65de04800c0a8b48647f (diff)
downloadillumos-gate-dbad7380d7852483de489e640f3a64b386115d59.tar.gz
9930 uts: kmdb should use "diag-device" when set
Reviewed by: John Levon <john.levon@joyent.com> Approved by: Joshua M. Clulow <josh@sysmgr.org>
-rw-r--r--usr/src/man/man1m/eeprom.1m16
-rw-r--r--usr/src/uts/common/io/consconfig_dacf.c104
-rw-r--r--usr/src/uts/common/os/space.c1
-rw-r--r--usr/src/uts/common/sys/consconfig_dacf.h1
-rw-r--r--usr/src/uts/common/sys/consdev.h3
-rw-r--r--usr/src/uts/common/sys/consplat.h1
-rw-r--r--usr/src/uts/i86pc/io/consplat.c23
7 files changed, 100 insertions, 49 deletions
diff --git a/usr/src/man/man1m/eeprom.1m b/usr/src/man/man1m/eeprom.1m
index b24478363c..150366c0b0 100644
--- a/usr/src/man/man1m/eeprom.1m
+++ b/usr/src/man/man1m/eeprom.1m
@@ -3,7 +3,7 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH EEPROM 1M "Feb 21, 2016"
+.TH EEPROM 1M "Oct 27, 2018"
.SH NAME
eeprom \- EEPROM display and load utility
.SH SYNOPSIS
@@ -109,7 +109,6 @@ the console device falls back to the device specified by \fBinput-device\fR and
console defaults to the frame buffer and keyboard.
.RE
-.SS "x86 Only"
.ne 2
.na
\fB\fIos_console\fR\fR
@@ -121,6 +120,19 @@ While \fBconsole\fR controls both boot loader and kernel console, setting
are the same as for \fBconsole\fR.
.RE
+.ne 2
+.na
+\fB\fIdiag-device\fR\fR
+.ad
+.sp .6
+.RS 4n
+The \fBdiag-device\fR is currently implemented to support serial port
+as output for system early boot diagnostic messages and input and output
+for \fBkmdb\fR debugger. For early boot, all the console messages are mirrored
+to \fBdiag-device\fR, until the console drivers are loaded.
+After that, only \fBkmdb\fR will continue to use the \fBdiag-device\fR.
+.RE
+
.SH NVRAM CONFIGURATION PARAMETERS
.LP
Not all OpenBoot systems support all parameters. Defaults vary depending on the
diff --git a/usr/src/uts/common/io/consconfig_dacf.c b/usr/src/uts/common/io/consconfig_dacf.c
index 89fa6c49c4..edeb0f93d2 100644
--- a/usr/src/uts/common/io/consconfig_dacf.c
+++ b/usr/src/uts/common/io/consconfig_dacf.c
@@ -48,9 +48,9 @@
* From the kernel perspective, there are roughly three different possible
* console configurations. Across these three configurations, the following
* elements are constant:
- * wsconsvp = IWSCN_PATH
- * rwsconsvp = WC_PATH
- * consms -> msdev
+ * wsconsvp = IWSCN_PATH
+ * rwsconsvp = WC_PATH
+ * consms -> msdev
*
* The "->" syntax indicates that the streams device on the right is
* linked under the streams device on the left.
@@ -58,30 +58,30 @@
* The following lists how the system is configured for different setups:
*
* stdin is a local keyboard. use stdin and stdout as the console.
- * sp->cons_input_type = CONSOLE_LOCAL
+ * sp->cons_input_type = CONSOLE_LOCAL
* rconsvp = IWSCN_PATH
* wc -> conskbd -> kbddev
*
* stdin is not a keyboard and stdin is the same as stdout.
* assume we running on a tip line and use stdin/stdout as the console.
- * sp->cons_input_type = CONSOLE_TIP
+ * sp->cons_input_type = CONSOLE_TIP
* rconsvp = (stdindev/stdoutdev)
* wc -> conskbd -> kbddev
*
* stdin is not a keyboard device and it's not the same as stdout.
* assume we have a serial keyboard hooked up and use it along with
* stdout as the console.
- * sp->cons_input_type = CONSOLE_SERIAL_KEYBOARD
+ * sp->cons_input_type = CONSOLE_SERIAL_KEYBOARD
* rconsvp = IWSCN_PATH
* wc -> stdindev
* conskbd -> kbddev
*
* CAVEAT:
- * The above is all true except for one possible Intel configuration.
- * If stdin is set to a local keyboard but stdout is set to something
- * other than the local display (a tip port for example) stdout will
- * still go to the local display. This is an artifact of the console
- * implementation on intel.
+ * The above is all true except for one possible Intel configuration.
+ * If stdin is set to a local keyboard but stdout is set to something
+ * other than the local display (a tip port for example) stdout will
+ * still go to the local display. This is an artifact of the console
+ * implementation on intel.
*/
#include <sys/types.h>
@@ -443,6 +443,10 @@ consconfig_print_paths(void)
if (path != NULL)
DPRINTF(DPRINT_L0, "stdout path = %s\n", path);
+ path = plat_diagpath();
+ if (path != NULL)
+ DPRINTF(DPRINT_L0, "diag path = %s\n", path);
+
path = plat_fbpath();
if (path != NULL)
DPRINTF(DPRINT_L0, "fb path = %s\n", path);
@@ -450,12 +454,12 @@ consconfig_print_paths(void)
/*
* consconfig_kbd_abort_enable:
- * Send the CONSSETABORTENABLE ioctl to the lower layers. This ioctl
- * will only be sent to the device if it is the console device.
- * This ioctl tells the device to pay attention to abort sequences.
- * In the case of kbtrans, this would tell the driver to pay attention
- * to the two key abort sequences like STOP-A. In the case of the
- * serial keyboard, it would be an abort sequence like a break.
+ * Send the CONSSETABORTENABLE ioctl to the lower layers. This ioctl
+ * will only be sent to the device if it is the console device.
+ * This ioctl tells the device to pay attention to abort sequences.
+ * In the case of kbtrans, this would tell the driver to pay attention
+ * to the two key abort sequences like STOP-A. In the case of the
+ * serial keyboard, it would be an abort sequence like a break.
*/
static int
consconfig_kbd_abort_enable(ldi_handle_t lh)
@@ -471,11 +475,11 @@ consconfig_kbd_abort_enable(ldi_handle_t lh)
/*
* consconfig_kbd_abort_disable:
- * Send CONSSETABORTENABLE ioctl to lower layers. This ioctl
- * will only be sent to the device if it is the console device.
- * This ioctl tells the physical device to ignore abort sequences,
- * and send the sequences up to virtual keyboard(conskbd) so that
- * STOP and A (or F1 and A) can be combined.
+ * Send CONSSETABORTENABLE ioctl to lower layers. This ioctl
+ * will only be sent to the device if it is the console device.
+ * This ioctl tells the physical device to ignore abort sequences,
+ * and send the sequences up to virtual keyboard(conskbd) so that
+ * STOP and A (or F1 and A) can be combined.
*/
static int
consconfig_kbd_abort_disable(ldi_handle_t lh)
@@ -539,9 +543,9 @@ consconfig_tem_supported(cons_state_t *sp)
/*
* consconfig_get_polledio:
- * Query the console with the CONSPOLLEDIO ioctl.
- * The polled I/O routines are used by debuggers to perform I/O while
- * interrupts and normal kernel services are disabled.
+ * Query the console with the CONSPOLLEDIO ioctl.
+ * The polled I/O routines are used by debuggers to perform I/O while
+ * interrupts and normal kernel services are disabled.
*/
static cons_polledio_t *
consconfig_get_polledio(ldi_handle_t lh)
@@ -584,10 +588,10 @@ consconfig_get_polledio(ldi_handle_t lh)
/*
* consconfig_setup_polledio:
- * This routine does the setup work for polled I/O. First we get
- * the polled_io structure from the lower layers
- * and then we register the polled I/O
- * callbacks with the debugger that will be using them.
+ * This routine does the setup work for polled I/O. First we get
+ * the polled_io structure from the lower layers
+ * and then we register the polled I/O
+ * callbacks with the debugger that will be using them.
*/
static void
consconfig_setup_polledio(cons_state_t *sp, dev_t dev)
@@ -657,9 +661,10 @@ consconfig_state_init(void)
stdoutdev = NODEV;
/*
- * Find keyboard, mouse, stdin and stdout devices, if they
+ * Find keyboard, mouse, stdin, stdout and diag devices, if they
* exist on this platform.
*/
+ sp->cons_diag_path = plat_diagpath();
if (consconfig_usb_kb_path != NULL) {
sp->cons_keyboard_path = consconfig_usb_kb_path;
@@ -993,7 +998,9 @@ consconfig_load_drivers(cons_state_t *sp)
if (sp->cons_keyboard_path != NULL)
kbddev = ddi_pathname_to_dev_t(sp->cons_keyboard_path);
if (sp->cons_mouse_path != NULL)
- mousedev = ddi_pathname_to_dev_t(sp->cons_mouse_path);
+ mousedev = ddi_pathname_to_dev_t(sp->cons_mouse_path);
+ if (sp->cons_diag_path != NULL)
+ diagdev = ddi_pathname_to_dev_t(sp->cons_diag_path);
/*
* On x86, make sure the fb driver is loaded even if we don't use it
@@ -1006,7 +1013,8 @@ consconfig_load_drivers(cons_state_t *sp)
#endif
DPRINTF(DPRINT_L0, "stdindev %lx, stdoutdev %lx, kbddev %lx, "
- "mousedev %lx\n", stdindev, stdoutdev, kbddev, mousedev);
+ "mousedev %lx diagdev %lx\n", stdindev, stdoutdev, kbddev,
+ mousedev, diagdev);
}
#if !defined(__x86)
@@ -1075,8 +1083,8 @@ consconfig_init_framebuffer(cons_state_t *sp)
/*
* consconfig_prepare_dev:
- * Flush the stream, push "pushmod" onto the stream.
- * for keyboard, issue the KIOCTRANSABLE ioctl, and
+ * Flush the stream, push "pushmod" onto the stream.
+ * for keyboard, issue the KIOCTRANSABLE ioctl, and
* possible enable abort.
*/
static void
@@ -1128,13 +1136,13 @@ consconfig_prepare_dev(
/*
* consconfig_relink_conskbd:
- * If new_lh is not NULL it should represent a driver with a
- * keyboard module pushed on top of it. The driver is then linked
- * underneath conskbd. the resulting stream will be
+ * If new_lh is not NULL it should represent a driver with a
+ * keyboard module pushed on top of it. The driver is then linked
+ * underneath conskbd. the resulting stream will be
* wc->conskbd->"new_lh driver".
*
- * If new_lh is NULL, then an unlink operation is done on conskbd
- * that attempts to unlink the stream specified by *muxid.
+ * If new_lh is NULL, then an unlink operation is done on conskbd
+ * that attempts to unlink the stream specified by *muxid.
* the resulting stream will be wc->conskbd.
*/
static int
@@ -1229,13 +1237,13 @@ relink_failed:
/*
* consconfig_relink_consms:
- * If new_lh is not NULL it should represent a driver with a
- * mouse module pushed on top of it. The driver is then linked
- * underneath consms. the resulting stream will be
+ * If new_lh is not NULL it should represent a driver with a
+ * mouse module pushed on top of it. The driver is then linked
+ * underneath consms. the resulting stream will be
* consms->"new_lh driver".
*
- * If new_lh is NULL, then an unlink operation is done on consms
- * that attempts to unlink the stream specified by *muxid.
+ * If new_lh is NULL, then an unlink operation is done on consms
+ * that attempts to unlink the stream specified by *muxid.
*/
static int
consconfig_relink_consms(cons_state_t *sp, ldi_handle_t new_lh, int *muxid)
@@ -1477,7 +1485,10 @@ consconfig_init_input(cons_state_t *sp)
*/
consconfig_setup_polledio(sp, sp->cons_wc_vp->v_rdev);
} else {
- consconfig_setup_polledio(sp, cons_final_dev);
+ if (diagdev != NODEV)
+ consconfig_setup_polledio(sp, diagdev);
+ else
+ consconfig_setup_polledio(sp, cons_final_dev);
}
kadb_uses_kernel();
@@ -1495,6 +1506,7 @@ dynamic_console_config(void)
mousedev = NODEV;
kbddev = NODEV;
fbdev = NODEV;
+ diagdev = NODEV;
fbvp = NULL;
fbdip = NULL;
wsconsvp = NULL;
@@ -1977,7 +1989,7 @@ consconfig_setmodes(dev_t dev, struct termios *termiosp)
/* Found the baud rate, set it */
termiosp->c_cflag |= speedtab[i].code & CBAUD;
- if (speedtab[i].code > 16) /* cfsetospeed! */
+ if (speedtab[i].code > 16) /* cfsetospeed! */
termiosp->c_cflag |= CBAUDEXT;
/* Set bits per character */
diff --git a/usr/src/uts/common/os/space.c b/usr/src/uts/common/os/space.c
index 2b9b703048..3fd8275df0 100644
--- a/usr/src/uts/common/os/space.c
+++ b/usr/src/uts/common/os/space.c
@@ -212,6 +212,7 @@ int ts_dispatch_extended = -1; /* set in ts_getdptbl or set_platform_default */
dev_t kbddev = NODEV;
dev_t mousedev = NODEV;
dev_t stdindev = NODEV;
+dev_t diagdev = NODEV;
struct vnode *wsconsvp;
dev_t fbdev = NODEV;
diff --git a/usr/src/uts/common/sys/consconfig_dacf.h b/usr/src/uts/common/sys/consconfig_dacf.h
index cf8ee1f903..6d2f2e1563 100644
--- a/usr/src/uts/common/sys/consconfig_dacf.h
+++ b/usr/src/uts/common/sys/consconfig_dacf.h
@@ -54,6 +54,7 @@ typedef struct cons_state {
char *cons_mouse_path; /* Mouse path */
char *cons_stdin_path; /* Standard input path */
char *cons_stdout_path; /* Standard output path */
+ char *cons_diag_path; /* Diag device path */
char *cons_fb_path; /* Frame Buffer path */
diff --git a/usr/src/uts/common/sys/consdev.h b/usr/src/uts/common/sys/consdev.h
index 53ec4beeeb..ee145a1693 100644
--- a/usr/src/uts/common/sys/consdev.h
+++ b/usr/src/uts/common/sys/consdev.h
@@ -68,6 +68,7 @@ extern dev_t stdindev; /* default standard input device */
extern dev_t fbdev; /* default framebuffer device */
extern struct vnode *fbvp; /* pointer to vnode for that device */
extern dev_info_t *fbdip; /* pointer to dev_info for fbdev (optional) */
+extern dev_t diagdev; /* default diag device (optional) */
extern int consmode; /* CONS_FW or CONS_KFB */
extern int cons_tem_disable;
@@ -135,7 +136,7 @@ extern struct vnode *rwsconsvp; /* vnode for underlying workstation console */
* Set the type simulated by hardwares
* ioctl(fd, CONSSETKBDTYPE, kbdtype)
* kbdtype:
- * KB_PC or KB_USB
+ * KB_PC or KB_USB
*/
#define CONSSETKBDTYPE (_CONSIOC|4)
diff --git a/usr/src/uts/common/sys/consplat.h b/usr/src/uts/common/sys/consplat.h
index b9fea3f5ce..a9f6fe9633 100644
--- a/usr/src/uts/common/sys/consplat.h
+++ b/usr/src/uts/common/sys/consplat.h
@@ -40,6 +40,7 @@ extern char *plat_fbpath(void);
extern char *plat_mousepath(void);
extern char *plat_stdinpath(void);
extern char *plat_stdoutpath(void);
+extern char *plat_diagpath(void);
extern int plat_stdin_is_keyboard(void);
extern int plat_stdout_is_framebuffer(void);
extern void plat_tem_get_inverses(int *, int *);
diff --git a/usr/src/uts/i86pc/io/consplat.c b/usr/src/uts/i86pc/io/consplat.c
index f71d28f4eb..349a16a80b 100644
--- a/usr/src/uts/i86pc/io/consplat.c
+++ b/usr/src/uts/i86pc/io/consplat.c
@@ -532,6 +532,29 @@ plat_stdoutpath(void)
return (plat_fbpath());
}
+char *
+plat_diagpath(void)
+{
+ dev_info_t *root;
+ char *diag;
+ int tty_num = -1;
+
+ root = ddi_root_node();
+
+ if (ddi_prop_lookup_string(DDI_DEV_T_ANY, root, DDI_PROP_DONTPASS,
+ "diag-device", &diag) == DDI_SUCCESS) {
+ if (strlen(diag) == 4 && strncmp(diag, "tty", 3) == 0 &&
+ diag[3] >= 'a' && diag[3] <= 'd') {
+ tty_num = diag[3] - 'a';
+ }
+ ddi_prop_free(diag);
+ }
+
+ if (tty_num != -1)
+ return (plat_ttypath(tty_num));
+ return (NULL);
+}
+
/*
* If VIS_PIXEL mode will be implemented on x86, these following
* functions should be re-considered. Now these functions are