[Skiboot] [PATCH 1/2] console(lpc/fsp-console): Use only stdout-path property on P9 and above
Pridhiviraj Paidipeddi
ppaidipe at linux.vnet.ibm.com
Fri Mar 2 04:03:19 AEDT 2018
dtc tool complaining about below warning as usage of linux,stdout-path
property under /chosen node is deprecated.
dts: Warning
(chosen_node_stdout_path): Use 'stdout-path' instead of 'linux,stdout-path'
So this patch fix this by using stdout-path property on all the systems
and keep linux,stdout-path only on P8 and before. This property refers to
a node which represents the device to be used for boot console output.
Verified boot on both P8 and P9 systems with new and older kernels.
And also verified dtc warnings got fixed in both P8 and P9.
Signed-off-by: Pridhiviraj Paidipeddi <ppaidipe at linux.vnet.ibm.com>
---
core/console.c | 19 ++++++++++++++-----
core/init.c | 5 ++++-
hw/fsp/fsp-console.c | 18 ++++++++++++++++--
hw/lpc-uart.c | 19 ++++++++++++++++---
4 files changed, 50 insertions(+), 11 deletions(-)
diff --git a/core/console.c b/core/console.c
index b9129c9..5e836d5 100644
--- a/core/console.c
+++ b/core/console.c
@@ -427,16 +427,25 @@ static void dummy_console_poll(void *data __unused)
void dummy_console_add_nodes(void)
{
- struct dt_property *p;
+ const char *stdoutp;
add_opal_console_node(0, "raw", memcons.obuf_size);
/* Mambo might have left a crap one, clear it */
- p = __dt_find_property(dt_chosen, "linux,stdout-path");
- if (p)
- dt_del_property(dt_chosen, p);
+ if (proc_gen >= proc_gen_p9)
+ stdoutp = "stdout-path";
+ else
+ stdoutp = "linux,stdout-path";
+
+ dt_check_del_prop(dt_chosen, "stdout-path");
+ dt_check_del_prop(dt_chosen, "linux,stdout-path");
+
+ if (!strcmp(stdoutp, "linux,stdout-path")) {
+ dt_add_property_string(dt_chosen, "linux,stdout-path",
+ "/ibm,opal/consoles/serial at 0");
+ }
- dt_add_property_string(dt_chosen, "linux,stdout-path",
+ dt_add_property_string(dt_chosen, "stdout-path",
"/ibm,opal/consoles/serial at 0");
opal_add_poller(dummy_console_poll, NULL);
diff --git a/core/init.c b/core/init.c
index 1d6ce70..4368b29 100644
--- a/core/init.c
+++ b/core/init.c
@@ -549,7 +549,10 @@ void __noreturn load_and_boot_kernel(bool is_reboot)
cpu_set_ipi_enable(false);
/* Dump the selected console */
- stdoutp = dt_prop_get_def(dt_chosen, "linux,stdout-path", NULL);
+ if (proc_gen >= proc_gen_p9)
+ stdoutp = dt_prop_get_def(dt_chosen, "stdout-path", NULL);
+ else
+ stdoutp = dt_prop_get_def(dt_chosen, "linux,stdout-path", NULL);
prlog(PR_DEBUG, "INIT: stdout-path: %s\n", stdoutp ? stdoutp : "");
diff --git a/hw/fsp/fsp-console.c b/hw/fsp/fsp-console.c
index 8d845d8..be22701 100644
--- a/hw/fsp/fsp-console.c
+++ b/hw/fsp/fsp-console.c
@@ -1025,6 +1025,7 @@ void fsp_console_add_nodes(void)
void fsp_console_select_stdout(void)
{
bool use_serial = false;
+ const char *stdoutp;
if (!fsp_present())
return;
@@ -1072,14 +1073,27 @@ void fsp_console_select_stdout(void)
*/
}
}
+
+ if (proc_gen >= proc_gen_p9)
+ stdoutp = "stdout-path";
+ else
+ stdoutp = "linux,stdout-path";
+
dt_check_del_prop(dt_chosen, "linux,stdout-path");
+ dt_check_del_prop(dt_chosen, "stdout-path");
if (fsp_serials[1].open && use_serial) {
- dt_add_property_string(dt_chosen, "linux,stdout-path",
+ if (!strcmp(stdoutp, "linux,stdout-path"))
+ dt_add_property_string(dt_chosen, "linux,stdout-path",
+ "/ibm,opal/consoles/serial at 1");
+ dt_add_property_string(dt_chosen, "stdout-path",
"/ibm,opal/consoles/serial at 1");
prlog(PR_NOTICE, "FSPCON: default console set to serial A\n");
} else {
- dt_add_property_string(dt_chosen, "linux,stdout-path",
+ if (!strcmp(stdoutp, "linux,stdout-path"))
+ dt_add_property_string(dt_chosen, "linux,stdout-path",
+ "/ibm,opal/consoles/serial at 0");
+ dt_add_property_string(dt_chosen, "stdout-path",
"/ibm,opal/consoles/serial at 0");
prlog(PR_NOTICE, "FSPCON: default console set to SOL/DVS\n");
}
diff --git a/hw/lpc-uart.c b/hw/lpc-uart.c
index 3224de9..378a951 100644
--- a/hw/lpc-uart.c
+++ b/hw/lpc-uart.c
@@ -438,7 +438,13 @@ static void uart_setup_os_passthrough(void)
dt_add_property_strings(uart_node, "status", "ok");
path = dt_get_path(uart_node);
- dt_add_property_string(dt_chosen, "linux,stdout-path", path);
+
+ if (proc_gen >= proc_gen_p9) {
+ dt_add_property_string(dt_chosen, "stdout-path", path);
+ } else {
+ dt_add_property_string(dt_chosen, "stdout-path", path);
+ dt_add_property_string(dt_chosen, "linux,stdout-path", path);
+ }
free(path);
/* Setup LPC client for OS interrupts */
@@ -460,8 +466,15 @@ static void uart_setup_opal_console(void)
/* Add the opal console node */
add_opal_console_node(0, "raw", OUT_BUF_SIZE);
- dt_add_property_string(dt_chosen, "linux,stdout-path",
- "/ibm,opal/consoles/serial at 0");
+ if (proc_gen >= proc_gen_p9) {
+ dt_add_property_string(dt_chosen, "stdout-path",
+ "/ibm,opal/consoles/serial at 0");
+ } else {
+ dt_add_property_string(dt_chosen, "linux,stdout-path",
+ "/ibm,opal/consoles/serial at 0");
+ dt_add_property_string(dt_chosen, "stdout-path",
+ "/ibm,opal/consoles/serial at 0");
+ }
/*
* We mark the UART as reserved since we don't want the
--
2.7.4
More information about the Skiboot
mailing list