summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Palmer <cnpalmer@us.ibm.com>2019-06-06 09:24:07 -0500
committerMartha Broyles <mbroyles@us.ibm.com>2019-06-13 11:14:36 -0500
commitfb4b3eb861b24883cd30d63eb0ca4738954db44d (patch)
tree591e2ad279c2739c30e6b76c3cc714b8f4a3fd34
parent6ce9a5d0fefe6e2ca50f33cbdf32c7a7301b2e7a (diff)
downloadtalos-occ-fb4b3eb861b24883cd30d63eb0ca4738954db44d.tar.gz
talos-occ-fb4b3eb861b24883cd30d63eb0ca4738954db44d.zip
NPU target addr translation support
Change-Id: Ice27661e58467ff1b9aa0e68b25b129b40e48b9f RTC: 202524 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/78451 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com> Reviewed-by: Martha Broyles <mbroyles@us.ibm.com> Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
-rw-r--r--src/occ_gpe0/firdata/scom_util.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/occ_gpe0/firdata/scom_util.c b/src/occ_gpe0/firdata/scom_util.c
index fd4dfee..2546107 100644
--- a/src/occ_gpe0/firdata/scom_util.c
+++ b/src/occ_gpe0/firdata/scom_util.c
@@ -297,6 +297,48 @@ int32_t translate_addr( SCOM_Trgt_t i_trgt, uint64_t i_addr, uint64_t * o_addr )
set_ring(P9A_MC_OMIC0_PPE_RING_ID + (l_chip_unit_num % 3), o_addr);
}
}
+ else if ( i_trgt.type == TRGT_NPU )
+ {
+ // NPU0 and NPU1 exist on the N3 chiplet, NPU2 exists on the N1 chiplet instead
+ uint8_t l_chiplet_id = ( 2 == l_chip_unit_num ) ? N1_CHIPLET_ID : N3_CHIPLET_ID ;
+ set_chiplet_id( l_chiplet_id, o_addr );
+ uint8_t l_sat_id = get_sat_id( i_addr );
+
+ // Covers the following addresses:
+ // NPU0: 05011000 to 050113FF
+ // NPU1: 05011400 to 050117FF
+ // NPU2: 03011C00 to 03011FFF
+ if ( N3_NPU_0_RING_ID == l_ring )
+ {
+ // NPU0/NPU1
+ if ( N3_CHIPLET_ID == l_chiplet_id )
+ {
+ set_ring( N3_NPU_0_RING_ID + l_chip_unit_num, o_addr );
+ }
+ // NPU2
+ else if ( N1_CHIPLET_ID == l_chiplet_id )
+ {
+ set_ring( P9A_NPU_2_RING_ID, o_addr );
+ }
+ }
+ // Covers the following addresses:
+ // NPU0: 05013C00 to 05013C8F
+ // NPU1: 05013CC0 to 05013D4F
+ // NPU2: 03012000 to 0301208F
+ else if ( P9A_NPU_0_FIR_RING_ID == l_ring )
+ {
+ // NPU0/NPU1
+ if ( N3_CHIPLET_ID == l_chiplet_id )
+ {
+ set_sat_id( l_sat_id + (3 * l_chip_unit_num), o_addr );
+ }
+ // NPU2
+ else if ( N1_CHIPLET_ID == l_chiplet_id )
+ {
+ set_ring( P9A_NPU_2_FIR_RING_ID, o_addr );
+ }
+ }
+ }
else
{
TRAC_ERR( FUNC"unsupported unit type %d", i_trgt.type );
OpenPOWER on IntegriCloud