diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-08-18 11:04:10 +0530 |
---|---|---|
committer | Jeremy Kerr <jeremy.kerr@au.ibm.com> | 2014-08-18 16:36:06 +0800 |
commit | 58cb9983c4d832e1f4f6e1aaec164224d567af41 (patch) | |
tree | 88cb43080c63b3b03469af396955d2de30241a7a /hw/fsp | |
parent | 1aa5c1bde26329f7f261dca1c7d1fa12672aa893 (diff) | |
download | skiboot-58cb9983c4d832e1f4f6e1aaec164224d567af41.zip skiboot-58cb9983c4d832e1f4f6e1aaec164224d567af41.tar.gz skiboot-58cb9983c4d832e1f4f6e1aaec164224d567af41.tar.bz2 |
console/sysparam: Use the system param to switch console selection
The patch provides the in-band support for reading the 'console-select'
system parameter. It also adds the console support to honour the system
param for switching the console type in P8 systems.
Tested-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jeremy Kerr <jeremy.kerr@au.ibm.com>
Diffstat (limited to 'hw/fsp')
-rw-r--r-- | hw/fsp/fsp-console.c | 71 | ||||
-rw-r--r-- | hw/fsp/fsp-sysparam.c | 3 |
2 files changed, 49 insertions, 25 deletions
diff --git a/hw/fsp/fsp-console.c b/hw/fsp/fsp-console.c index 4e5803a..05398f6 100644 --- a/hw/fsp/fsp-console.c +++ b/hw/fsp/fsp-console.c @@ -25,6 +25,7 @@ #include <opal.h> #include <timebase.h> #include <device.h> +#include <fsp-sysparam.h> struct fsp_serbuf_hdr { u16 partition_id; @@ -863,40 +864,62 @@ void fsp_console_add_nodes(void) void fsp_console_select_stdout(void) { - struct dt_node *iplp; - u32 ipl_mode = 0; + bool use_serial = false; if (!fsp_present()) return; - /* - * We hijack the "os-ipl-mode" setting in iplparams to select - * out output console. This is the "i5/OS partition mode boot" - * setting in ASMI converted to an integer: 0=A, 1=B, ... - */ - iplp = dt_find_by_path(dt_root, "ipl-params/ipl-params"); - if (iplp) - ipl_mode = dt_prop_get_u32_def(iplp, "os-ipl-mode", 0); + /* On P8, we have a sysparam ! yay ! */ + if (proc_gen >= proc_gen_p8) { + int rc; + u8 param; + + rc = fsp_get_sys_param(SYS_PARAM_CONSOLE_SELECT, + ¶m, 1, NULL, NULL); + if (rc != 1) + prerror("FSPCON: Failed to get console" + " sysparam rc %d\n", rc); + else { + switch(param) { + case 0: + use_serial = false; + break; + case 1: + use_serial = true; + break; + default: + prerror("FSPCON: Unknown console" + " sysparam %d\n", param); + } + } + } else { + struct dt_node *iplp; + u32 ipl_mode = 0; - /* - * Now, if ipl_mode is 1 or 2, we set the corresponding serial - * port if it exists (ie, is opened) as the default console. - * - * In any other case, we set the default console to serial0 - * which is DVS or IPMI - */ - if (ipl_mode == 1 && fsp_serials[1].open) { + /* + * We hijack the "os-ipl-mode" setting in iplparams to select + * out output console. This is the "i5/OS partition mode boot" + * setting in ASMI converted to an integer: 0=A, 1=B. + */ + iplp = dt_find_by_path(dt_root, "ipl-params/ipl-params"); + if (iplp) { + ipl_mode = dt_prop_get_u32_def(iplp, "os-ipl-mode", 0); + use_serial = ipl_mode > 0; + + /* + * Now, if ipl_mode is > 0, we use serial port A else + * we use IPMI/SOL/DVS + */ + } + } + if (fsp_serials[1].open && use_serial) { dt_add_property_string(dt_chosen, "linux,stdout-path", "/ibm,opal/consoles/serial@1"); - printf("FSPCON: default console 1\n"); - } else if (ipl_mode == 2 && fsp_serials[2].open) { - dt_add_property_string(dt_chosen, "linux,stdout-path", - "/ibm,opal/consoles/serial@2"); - printf("FSPCON: default console 2\n"); + printf("FSPCON: default console set to serial A\n"); } else { dt_add_property_string(dt_chosen, "linux,stdout-path", "/ibm,opal/consoles/serial@0"); - printf("FSPCON: default console 0\n"); + printf("FSPCON: default console set to SOL/DVS\n"); } } diff --git a/hw/fsp/fsp-sysparam.c b/hw/fsp/fsp-sysparam.c index ff3dd8d..dc19149 100644 --- a/hw/fsp/fsp-sysparam.c +++ b/hw/fsp/fsp-sysparam.c @@ -54,7 +54,8 @@ static struct sysparam_attr { {"fw-license-policy", SYS_PARAM_FW_LICENSE, 4, _RW}, {"world-wide-port-num", SYS_PARAM_WWPN, 12, _W}, {"default-boot-device", SYS_PARAM_DEF_BOOT_DEV, 1, _RW}, - {"next-boot-device", SYS_PARAM_NEXT_BOOT_DEV,1, _RW} + {"next-boot-device", SYS_PARAM_NEXT_BOOT_DEV,1, _RW}, + {"console-select", SYS_PARAM_CONSOLE_SELECT,1, _RW} #undef _R #undef _W #undef _RW |