From abab9520a752ddb6bf0b53cfd25e22ce2b75c8b0 Mon Sep 17 00:00:00 2001 From: Jack Miller Date: Tue, 9 Aug 2016 16:38:08 +1000 Subject: chiptod: Basic P9 support There's hardly any difference between P8 and P9, except the PIB_MASTER addressing being expanded to 5 bits with the PIR. We can now look at the TOD->CAPP sync to use new functionality. Signed-off-by: Jack Miller Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Stewart Smith --- hw/chiptod.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'hw') diff --git a/hw/chiptod.c b/hw/chiptod.c index 58302fe..38a464a 100644 --- a/hw/chiptod.c +++ b/hw/chiptod.c @@ -138,7 +138,8 @@ static enum chiptod_type { chiptod_unknown, chiptod_p7, - chiptod_p8 + chiptod_p8, + chiptod_p9 } chiptod_type; enum chiptod_chip_role { @@ -621,7 +622,10 @@ static bool chiptod_to_tb(void) prerror("XSCOM error reading PIB_MASTER\n"); return false; } - if (chiptod_type == chiptod_p8) { + if (chiptod_type == chiptod_p9) { + tvbits = (this_cpu()->pir >> 2) & 0x1f; + tvbits |= 0x20; + } else if (chiptod_type == chiptod_p8) { tvbits = (this_cpu()->pir >> 3) & 0xf; tvbits |= 0x10; } else { @@ -1597,6 +1601,8 @@ static bool chiptod_probe(void) chiptod_type = chiptod_p7; if (dt_node_is_compatible(np,"ibm,power8-chiptod")) chiptod_type = chiptod_p8; + if (dt_node_is_compatible(np,"ibm,power9-chiptod")) + chiptod_type = chiptod_p9; } if (dt_has_node_property(np, "secondary", NULL)) -- cgit v1.1