[Skiboot] [RFC 01/12] witherspoon: Check for existing npu node
Oliver O'Halloran
oohall at gmail.com
Tue Aug 1 22:59:56 AEST 2017
Only create the npu at xyz nodes if we haven't created them already. In the
future we will populated the npu at xyz nodes and their child link at x nodes
based on the HDAT.
Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
---
platforms/astbmc/witherspoon.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/platforms/astbmc/witherspoon.c b/platforms/astbmc/witherspoon.c
index c5227398e401..8f7b15ce6a64 100644
--- a/platforms/astbmc/witherspoon.c
+++ b/platforms/astbmc/witherspoon.c
@@ -301,6 +301,9 @@ static void dt_create_npu2(void)
static bool witherspoon_probe(void)
{
+ struct dt_node *n;
+ bool found = false;
+
if (!dt_node_is_compatible(dt_root, "ibm,witherspoon"))
return false;
@@ -310,8 +313,12 @@ static bool witherspoon_probe(void)
/* Setup UART for use by OPAL (Linux hvc) */
uart_set_console_policy(UART_CONSOLE_OPAL);
- /* Add NPU2 bindings */
- dt_create_npu2();
+ /* Add NPU2 bindings if we didn't create them inside the HDAT already */
+ dt_for_each_compatible(dt_root, n, "ibm,power9-npu")
+ found = true;
+
+ if (!found)
+ dt_create_npu2();
slot_table_init(witherspoon_phb_table);
--
2.9.4
More information about the Skiboot
mailing list