aboutsummaryrefslogtreecommitdiff
path: root/hw/lpc-uart.c
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2016-12-21 15:52:25 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-01-04 17:15:34 +1100
commit7edaf63587aace2729f70144d6ff5e9c3a3766c4 (patch)
treef153c4afb01a5743051653978ecc0d33cfb8ce0f /hw/lpc-uart.c
parent8c0ec758fdec8cd5aa60f1f9cf4ca653717991f9 (diff)
downloadskiboot-7edaf63587aace2729f70144d6ff5e9c3a3766c4.zip
skiboot-7edaf63587aace2729f70144d6ff5e9c3a3766c4.tar.gz
skiboot-7edaf63587aace2729f70144d6ff5e9c3a3766c4.tar.bz2
console: add helper to create serial console nodes
The creation of /ibm,skiboot/console/serial@<xyz> nodes is pretty much identical across the various OPAL console drivers. This patch moves it into a helper function as a cleanup. Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/lpc-uart.c')
-rw-r--r--hw/lpc-uart.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/hw/lpc-uart.c b/hw/lpc-uart.c
index 6693265..2383ff5 100644
--- a/hw/lpc-uart.c
+++ b/hw/lpc-uart.c
@@ -420,20 +420,8 @@ void uart_setup_linux_passthrough(void)
void uart_setup_opal_console(void)
{
- struct dt_node *con, *consoles;
-
- /* Create OPAL console node */
- consoles = dt_new(opal_node, "consoles");
- assert(consoles);
- dt_add_property_cells(consoles, "#address-cells", 1);
- dt_add_property_cells(consoles, "#size-cells", 0);
-
- con = dt_new_addr(consoles, "serial", 0);
- assert(con);
- dt_add_property_string(con, "compatible", "ibm,opal-console-raw");
- dt_add_property_cells(con, "#write-buffer-size", INMEM_CON_OUT_LEN);
- dt_add_property_cells(con, "reg", 0);
- dt_add_property_string(con, "device_type", "serial");
+ /* 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@0");