diff options
author | Martin Peschke <mpeschke@de.ibm.com> | 2016-12-16 17:52:33 +0100 |
---|---|---|
committer | Sachin Gupta <sgupta2m@in.ibm.com> | 2017-01-25 09:15:07 -0500 |
commit | 2371c946def6923c102d67dd1bf79f21b911c656 (patch) | |
tree | a4ef88e567128c9dc32148ea6ad7c6e1ba1dfafc /src/import | |
parent | f5ebf5946f16f4fc0e336bc78661bc4b19f69912 (diff) | |
download | talos-sbe-2371c946def6923c102d67dd1bf79f21b911c656.tar.gz talos-sbe-2371c946def6923c102d67dd1bf79f21b911c656.zip |
TOR space reductions
These changes avoid some waste of valuable memory used to store
TOR and rings contained in TOR. This is mostly needed as a SEEPROM relief.
Contains:
- 12 byte ring header (former 31551 commit)
- less zero padding at the end of compressed ring (former 31524 commit)
- removed an additional ring meta data structure (former 31524 commit)
In addition, it contains these fixes:
- fixed a bunch of scan addresses (former 33969 commit)
- increased size of ring decompression buffer (former 32796 commit)
- zero byte ring padding up to 4 byte boundaries for SBE (former 33969
commit)
- added dbgl control of error trace after call to get_ring_from_sbe_image
- added enumerated ringId to the RS4v3 header
- fixed incorrect scan address masks for even/odd EX RS4 v3 ring handling
in MVPD accessor functions
- fixed incorrect scan address region bits for odd EX rings translated from
RS4 v2 to RS4 v3 in MVPD accessor functions
CMVC-Prereq: 1015124
Change-Id: I8fd00760e6ac2b3760994d1ca819fffbf35188ca
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/33993
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/34014
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/import')
-rw-r--r-- | src/import/chips/p9/utils/imageProcs/p9_ringId.C | 646 | ||||
-rw-r--r-- | src/import/chips/p9/utils/imageProcs/p9_ringId.H | 27 | ||||
-rw-r--r-- | src/import/chips/p9/utils/imageProcs/p9_scan_compression.H | 222 | ||||
-rw-r--r-- | src/import/chips/p9/utils/imageProcs/p9_tor.C | 627 | ||||
-rw-r--r-- | src/import/chips/p9/utils/imageProcs/p9_tor.H | 49 | ||||
-rw-r--r-- | src/import/chips/p9/utils/p9_putRingUtils.C | 234 | ||||
-rw-r--r-- | src/import/chips/p9/utils/p9_putRingUtils.H | 7 | ||||
-rw-r--r-- | src/import/chips/p9/xip/p9_xip_tool.C | 27 | ||||
-rw-r--r-- | src/import/tools/imageProcs/p9_ipl_build.C | 5 |
9 files changed, 936 insertions, 908 deletions
diff --git a/src/import/chips/p9/utils/imageProcs/p9_ringId.C b/src/import/chips/p9/utils/imageProcs/p9_ringId.C index f405f2e6..6e96281b 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_ringId.C +++ b/src/import/chips/p9/utils/imageProcs/p9_ringId.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -30,29 +30,28 @@ namespace PERV { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"perv_fure" , 0x00, 0x01, 0x01, NON_VPD_RING, 0, 0x0800000000009000}, - {"perv_gptr" , 0x01, 0x01, 0x01, NON_VPD_RING, 0, 0x0800000000002000}, - {"perv_time" , 0x02, 0x01, 0x01, NON_VPD_RING, 0, 0x0800000000000100}, - {"occ_fure" , 0x03, 0x01, 0x01, NON_VPD_RING, 0, 0x0100000000009000}, - {"occ_gptr" , 0x04, 0x01, 0x01, NON_VPD_RING, 0, 0x0100000000002000}, - {"occ_time" , 0x05, 0x01, 0x01, NON_VPD_RING, 0, 0x0100000000000100}, - {"perv_ana_func" , 0x06, 0x01, 0x01, NON_VPD_RING, 0, 0x0080000000008000}, - {"perv_ana_gptr" , 0x07, 0x01, 0x01, NON_VPD_RING, 0, 0x0080000000002000}, - {"perv_pll_gptr" , 0x08, 0x01, 0x01, NON_VPD_RING, 0, 0x0002000000002000}, - {"perv_pll_bndy_bucket_1" , 0x09, 0x01, 0x01, NON_VPD_PLL_RING, 5, 0x0002000000000080}, - {"perv_pll_bndy_bucket_2" , 0x0a, 0x01, 0x01, NON_VPD_PLL_RING, 5, 0x0002000000000080}, - {"perv_pll_bndy_bucket_3" , 0x0b, 0x01, 0x01, NON_VPD_PLL_RING, 5, 0x0002000000000080}, - {"perv_pll_bndy_bucket_4" , 0x0c, 0x01, 0x01, NON_VPD_PLL_RING, 5, 0x0002000000000080}, - {"perv_pll_bndy_bucket_5" , 0x0d, 0x01, 0x01, NON_VPD_PLL_RING, 5, 0x0002000000000080}, - {"perv_pll_func" , 0x0e, 0x01, 0x01, NON_VPD_RING, 0, 0x0002000000008000}, - + {"perv_fure" , 0x00, 0x01, 0x01, NON_VPD_RING , 0, 0x0103400F}, + {"perv_gptr" , 0x01, 0x01, 0x01, NON_VPD_RING , 0, 0x01034002}, + {"perv_time" , 0x02, 0x01, 0x01, NON_VPD_RING , 0, 0x01034007}, + {"occ_fure" , 0x03, 0x01, 0x01, NON_VPD_RING , 0, 0x0103080F}, + {"occ_gptr" , 0x04, 0x01, 0x01, NON_VPD_RING , 0, 0x01030802}, + {"occ_time" , 0x05, 0x01, 0x01, NON_VPD_RING , 0, 0x01030807}, + {"perv_ana_func" , 0x06, 0x01, 0x01, NON_VPD_RING , 0, 0x01030400}, + {"perv_ana_gptr" , 0x07, 0x01, 0x01, NON_VPD_RING , 0, 0x01030402}, + {"perv_pll_gptr" , 0x08, 0x01, 0x01, NON_VPD_RING , 0, 0x01030012}, + {"perv_pll_bndy_bucket_1", 0x09, 0x01, 0x01, NON_VPD_PLL_RING, 5, 0x01030018}, + {"perv_pll_bndy_bucket_2", 0x0a, 0x01, 0x01, NON_VPD_PLL_RING, 5, 0x01030018}, + {"perv_pll_bndy_bucket_3", 0x0b, 0x01, 0x01, NON_VPD_PLL_RING, 5, 0x01030018}, + {"perv_pll_bndy_bucket_4", 0x0c, 0x01, 0x01, NON_VPD_PLL_RING, 5, 0x01030018}, + {"perv_pll_bndy_bucket_5", 0x0d, 0x01, 0x01, NON_VPD_PLL_RING, 5, 0x01030018}, + {"perv_pll_func" , 0x0e, 0x01, 0x01, NON_VPD_RING , 0, 0x01030010}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"perv_repr" , 0x0f, 0x01, 0x01, NON_VPD_RING, 0, 0x0800000000000200}, - {"occ_repr" , 0x10, 0x01, 0x01, NON_VPD_RING, 0, 0x0100000000000200}, + {"perv_repr" , 0x0f, 0x01, 0x01, NON_VPD_RING , 0, 0x01034006}, + {"occ_repr" , 0x10, 0x01, 0x01, NON_VPD_RING , 0, 0x01030806}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -60,21 +59,21 @@ namespace N0 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"n0_fure" , 0x00, 0x02, 0x02, NON_VPD_RING, 0, 0x09C0000000009000}, - {"n0_gptr" , 0x01, 0x02, 0x02, NON_VPD_RING, 0, 0x09C0000000002000}, - {"n0_time" , 0x02, 0x02, 0x02, NON_VPD_RING, 0, 0x09C0000000000100}, - {"n0_nx_fure" , 0x03, 0x02, 0x02, NON_VPD_RING, 0, 0x0400000000009000}, - {"n0_nx_gptr" , 0x04, 0x02, 0x02, NON_VPD_RING, 0, 0x0400000000002000}, - {"n0_nx_time" , 0x05, 0x02, 0x02, NON_VPD_RING, 0, 0x0400000000000100}, - {"n0_cxa0_fure" , 0x06, 0x02, 0x02, NON_VPD_RING, 0, 0x0200000000009000}, - {"n0_cxa0_gptr" , 0x07, 0x02, 0x02, NON_VPD_RING, 0, 0x0200000000002000}, - {"n0_cxa0_time" , 0x08, 0x02, 0x02, NON_VPD_RING, 0, 0x0200000000000100}, + {"n0_fure" , 0x00, 0x02, 0x02, NON_VPD_RING , 0, 0x02034E0F}, + {"n0_gptr" , 0x01, 0x02, 0x02, NON_VPD_RING , 0, 0x02034E02}, + {"n0_time" , 0x02, 0x02, 0x02, NON_VPD_RING , 0, 0x02034E07}, + {"n0_nx_fure" , 0x03, 0x02, 0x02, NON_VPD_RING , 0, 0x0203200F}, + {"n0_nx_gptr" , 0x04, 0x02, 0x02, NON_VPD_RING , 0, 0x02032002}, + {"n0_nx_time" , 0x05, 0x02, 0x02, NON_VPD_RING , 0, 0x02032007}, + {"n0_cxa0_fure" , 0x06, 0x02, 0x02, NON_VPD_RING , 0, 0x0203100F}, + {"n0_cxa0_gptr" , 0x07, 0x02, 0x02, NON_VPD_RING , 0, 0x02031002}, + {"n0_cxa0_time" , 0x08, 0x02, 0x02, NON_VPD_RING , 0, 0x02031007}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"n0_repr" , 0x09, 0x02, 0x02, NON_VPD_RING, 0, 0x09C0000000000200}, - {"n0_nx_repr" , 0x0a, 0x02, 0x02, NON_VPD_RING, 0, 0x0400000000000200}, - {"n0_cxa0_repr" , 0x0b, 0x02, 0x02, NON_VPD_RING, 0, 0x0200000000000200}, + {"n0_repr" , 0x09, 0x02, 0x02, NON_VPD_RING , 0, 0x02034E06}, + {"n0_nx_repr" , 0x0a, 0x02, 0x02, NON_VPD_RING , 0, 0x02032006}, + {"n0_cxa0_repr" , 0x0b, 0x02, 0x02, NON_VPD_RING , 0, 0x02031006}, }; const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; }; @@ -84,25 +83,25 @@ namespace N1 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"n1_fure" , 0x00, 0x03, 0x03, NON_VPD_RING, 0, 0x0E00000000009000}, - {"n1_gptr" , 0x01, 0x03, 0x03, NON_VPD_RING, 0, 0x0E00000000002000}, - {"n1_time" , 0x02, 0x03, 0x03, NON_VPD_RING, 0, 0x0E00000000000100}, - {"n1_ioo0_fure" , 0x03, 0x03, 0x03, NON_VPD_RING, 0, 0x0100000000009000}, - {"n1_ioo0_gptr" , 0x04, 0x03, 0x03, NON_VPD_RING, 0, 0x0100000000002000}, - {"n1_ioo0_time" , 0x05, 0x03, 0x03, NON_VPD_RING, 0, 0x0100000000000100}, - {"n1_ioo1_fure" , 0x06, 0x03, 0x03, NON_VPD_RING, 0, 0x0080000000009000}, - {"n1_ioo1_gptr" , 0x07, 0x03, 0x03, NON_VPD_RING, 0, 0x0080000000002000}, - {"n1_ioo1_time" , 0x08, 0x03, 0x03, NON_VPD_RING, 0, 0x0080000000000100}, - {"n1_mcs23_fure" , 0x09, 0x03, 0x03, NON_VPD_RING, 0, 0x0040000000009000}, - {"n1_mcs23_gptr" , 0x0a, 0x03, 0x03, NON_VPD_RING, 0, 0x0040000000002000}, - {"n1_mcs23_time" , 0x0b, 0x03, 0x03, NON_VPD_RING, 0, 0x0040000000000100}, + {"n1_fure" , 0x00, 0x03, 0x03, NON_VPD_RING , 0, 0x0303700F}, + {"n1_gptr" , 0x01, 0x03, 0x03, NON_VPD_RING , 0, 0x03037002}, + {"n1_time" , 0x02, 0x03, 0x03, NON_VPD_RING , 0, 0x03037007}, + {"n1_ioo0_fure" , 0x03, 0x03, 0x03, NON_VPD_RING , 0, 0x0303080F}, + {"n1_ioo0_gptr" , 0x04, 0x03, 0x03, NON_VPD_RING , 0, 0x03030802}, + {"n1_ioo0_time" , 0x05, 0x03, 0x03, NON_VPD_RING , 0, 0x03030807}, + {"n1_ioo1_fure" , 0x06, 0x03, 0x03, NON_VPD_RING , 0, 0x0303040F}, + {"n1_ioo1_gptr" , 0x07, 0x03, 0x03, NON_VPD_RING , 0, 0x03030402}, + {"n1_ioo1_time" , 0x08, 0x03, 0x03, NON_VPD_RING , 0, 0x03030407}, + {"n1_mcs23_fure" , 0x09, 0x03, 0x03, NON_VPD_RING , 0, 0x0303020F}, + {"n1_mcs23_gptr" , 0x0a, 0x03, 0x03, NON_VPD_RING , 0, 0x03030202}, + {"n1_mcs23_time" , 0x0b, 0x03, 0x03, NON_VPD_RING , 0, 0x03030207}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"n1_repr" , 0x0c, 0x03, 0x03, NON_VPD_RING, 0, 0x0E00000000000200}, - {"n1_ioo0_repr" , 0x0d, 0x03, 0x03, NON_VPD_RING, 0, 0x0100000000000200}, - {"n1_ioo1_repr" , 0x0e, 0x03, 0x03, NON_VPD_RING, 0, 0x0080000000000200}, - {"n1_mcs23_repr" , 0x0f, 0x03, 0x03, NON_VPD_RING, 0, 0x0040000000000200}, + {"n1_repr" , 0x0c, 0x03, 0x03, NON_VPD_RING , 0, 0x03037006}, + {"n1_ioo0_repr" , 0x0d, 0x03, 0x03, NON_VPD_RING , 0, 0x03030806}, + {"n1_ioo1_repr" , 0x0e, 0x03, 0x03, NON_VPD_RING , 0, 0x03030406}, + {"n1_mcs23_repr" , 0x0f, 0x03, 0x03, NON_VPD_RING , 0, 0x03030206}, }; const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; }; @@ -112,23 +111,23 @@ namespace N2 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"n2_fure" , 0x00, 0x04, 0x04, NON_VPD_RING, 0, 0x0B80000000009000}, - {"n2_gptr" , 0x01, 0x04, 0x04, NON_VPD_RING, 0, 0x0B80000000002000}, - {"n2_time" , 0x02, 0x04, 0x04, NON_VPD_RING, 0, 0x0B80000000000100}, - {"n2_cxa1_fure" , 0x03, 0x04, 0x04, NON_VPD_RING, 0, 0x0400000000009000}, - {"n2_cxa1_gptr" , 0x04, 0x04, 0x04, NON_VPD_RING, 0, 0x0400000000002000}, - {"n2_cxa1_time" , 0x05, 0x04, 0x04, NON_VPD_RING, 0, 0x0400000000000100}, - {"n2_psi_fure" , 0x06, 0x04, 0x04, NON_VPD_RING, 0, 0x0040000000009000}, - {"n2_psi_gptr" , 0x07, 0x04, 0x04, NON_VPD_RING, 0, 0x0040000000002000}, - {"n2_psi_time" , 0x08, 0x04, 0x04, NON_VPD_RING, 0, 0x0040000000000100}, + {"n2_fure" , 0x00, 0x04, 0x04, NON_VPD_RING , 0, 0x04035C0F}, + {"n2_gptr" , 0x01, 0x04, 0x04, NON_VPD_RING , 0, 0x04035C02}, + {"n2_time" , 0x02, 0x04, 0x04, NON_VPD_RING , 0, 0x04035C07}, + {"n2_cxa1_fure" , 0x03, 0x04, 0x04, NON_VPD_RING , 0, 0x0403200F}, + {"n2_cxa1_gptr" , 0x04, 0x04, 0x04, NON_VPD_RING , 0, 0x04032002}, + {"n2_cxa1_time" , 0x05, 0x04, 0x04, NON_VPD_RING , 0, 0x04032007}, + {"n2_psi_fure" , 0x06, 0x04, 0x04, NON_VPD_RING , 0, 0x0403020F}, + {"n2_psi_gptr" , 0x07, 0x04, 0x04, NON_VPD_RING , 0, 0x04030202}, + {"n2_psi_time" , 0x08, 0x04, 0x04, NON_VPD_RING , 0, 0x04030207}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"n2_repr" , 0x09, 0x04, 0x04, NON_VPD_RING, 0, 0x0B80000000000200}, - {"n2_cxa1_repr" , 0x0a, 0x04, 0x04, NON_VPD_RING, 0, 0x0400000000000200}, - {"n2_psi_repr" , 0x0b, 0x04, 0x04, NON_VPD_RING, 0, 0x0040000000000200}, + {"n2_repr" , 0x09, 0x04, 0x04, NON_VPD_RING , 0, 0x04035C06}, + {"n2_cxa1_repr" , 0x0a, 0x04, 0x04, NON_VPD_RING , 0, 0x04032006}, + {"n2_psi_repr" , 0x0b, 0x04, 0x04, NON_VPD_RING , 0, 0x04030206}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -136,23 +135,23 @@ namespace N3 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"n3_fure" , 0x00, 0x05, 0x05, NON_VPD_RING, 0, 0x0CC0000000009000}, - {"n3_gptr" , 0x01, 0x05, 0x05, NON_VPD_RING, 0, 0x0EC0000000002000}, - {"n3_time" , 0x02, 0x05, 0x05, NON_VPD_RING, 0, 0x0EC0000000000100}, - {"n3_mcs01_fure" , 0x03, 0x05, 0x05, NON_VPD_RING, 0, 0x0020000000009000}, - {"n3_mcs01_gptr" , 0x04, 0x05, 0x05, NON_VPD_RING, 0, 0x0020000000002000}, - {"n3_mcs01_time" , 0x05, 0x05, 0x05, NON_VPD_RING, 0, 0x0020000000000100}, - {"n3_np_fure" , 0x06, 0x05, 0x05, NON_VPD_RING, 0, 0x0100000000009000}, - {"n3_np_gptr" , 0x07, 0x05, 0x05, NON_VPD_RING, 0, 0x0100000000002000}, - {"n3_np_time" , 0x08, 0x05, 0x05, NON_VPD_RING, 0, 0x0100000000000100}, + {"n3_fure" , 0x00, 0x05, 0x05, NON_VPD_RING , 0, 0x0503660F}, + {"n3_gptr" , 0x01, 0x05, 0x05, NON_VPD_RING , 0, 0x05037602}, + {"n3_time" , 0x02, 0x05, 0x05, NON_VPD_RING , 0, 0x05037607}, + {"n3_mcs01_fure" , 0x03, 0x05, 0x05, NON_VPD_RING , 0, 0x0503010F}, + {"n3_mcs01_gptr" , 0x04, 0x05, 0x05, NON_VPD_RING , 0, 0x05030102}, + {"n3_mcs01_time" , 0x05, 0x05, 0x05, NON_VPD_RING , 0, 0x05030107}, + {"n3_np_fure" , 0x06, 0x05, 0x05, NON_VPD_RING , 0, 0x0503080F}, + {"n3_np_gptr" , 0x07, 0x05, 0x05, NON_VPD_RING , 0, 0x05030802}, + {"n3_np_time" , 0x08, 0x05, 0x05, NON_VPD_RING , 0, 0x05030807}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"n3_repr" , 0x09, 0x05, 0x05, NON_VPD_RING, 0, 0x0EC0000000000200}, - {"n3_mcs01_repr" , 0x0a, 0x05, 0x05, NON_VPD_RING, 0, 0x0020000000000200}, - {"n3_np_repr" , 0x0b, 0x05, 0x05, NON_VPD_RING, 0, 0x0100000000000200}, + {"n3_repr" , 0x09, 0x05, 0x05, NON_VPD_RING , 0, 0x05037606}, + {"n3_mcs01_repr" , 0x0a, 0x05, 0x05, NON_VPD_RING , 0, 0x05030106}, + {"n3_np_repr" , 0x0b, 0x05, 0x05, NON_VPD_RING , 0, 0x05030806}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -160,30 +159,30 @@ namespace XB { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"xb_fure" , 0x00, 0x06, 0x06, NON_VPD_RING, 0, 0x0880000000009000}, - {"xb_gptr" , 0x01, 0x06, 0x06, NON_VPD_RING, 0, 0x0880000000002000}, - {"xb_time" , 0x02, 0x06, 0x06, NON_VPD_RING, 0, 0x0880000000000100}, - {"xb_io0_fure" , 0x03, 0x06, 0x06, NON_VPD_RING, 0, 0x0440000000009000}, - {"xb_io0_gptr" , 0x04, 0x06, 0x06, NON_VPD_RING, 0, 0x0440000000002000}, - {"xb_io0_time" , 0x05, 0x06, 0x06, NON_VPD_RING, 0, 0x0440000000000100}, - {"xb_io1_fure" , 0x06, 0x06, 0x06, NON_VPD_RING, 0, 0x0220000000009000}, - {"xb_io1_gptr" , 0x07, 0x06, 0x06, NON_VPD_RING, 0, 0x0220000000002000}, - {"xb_io1_time" , 0x08, 0x06, 0x06, NON_VPD_RING, 0, 0x0220000000000100}, - {"xb_io2_fure" , 0x09, 0x06, 0x06, NON_VPD_RING, 0, 0x0110000000009000}, - {"xb_io2_gptr" , 0x0a, 0x06, 0x06, NON_VPD_RING, 0, 0x0110000000002000}, - {"xb_io2_time" , 0x0b, 0x06, 0x06, NON_VPD_RING, 0, 0x0110000000000100}, - {"xb_pll_gptr" , 0x0c, 0x06, 0x06, NON_VPD_RING, 0, 0x0002000000002000}, - {"xb_pll_bndy" , 0x0d, 0x06, 0x06, NON_VPD_RING, 0, 0x0002000000000080}, - {"xb_pll_func" , 0x0e, 0x06, 0x06, NON_VPD_RING, 0, 0x0002000000008000}, + {"xb_fure" , 0x00, 0x06, 0x06, NON_VPD_RING , 0, 0x0603440F}, + {"xb_gptr" , 0x01, 0x06, 0x06, NON_VPD_RING , 0, 0x06034402}, + {"xb_time" , 0x02, 0x06, 0x06, NON_VPD_RING , 0, 0x06034407}, + {"xb_io0_fure" , 0x03, 0x06, 0x06, NON_VPD_RING , 0, 0x0603220F}, + {"xb_io0_gptr" , 0x04, 0x06, 0x06, NON_VPD_RING , 0, 0x06032202}, + {"xb_io0_time" , 0x05, 0x06, 0x06, NON_VPD_RING , 0, 0x06032207}, + {"xb_io1_fure" , 0x06, 0x06, 0x06, NON_VPD_RING , 0, 0x0603110F}, + {"xb_io1_gptr" , 0x07, 0x06, 0x06, NON_VPD_RING , 0, 0x06031102}, + {"xb_io1_time" , 0x08, 0x06, 0x06, NON_VPD_RING , 0, 0x06031107}, + {"xb_io2_fure" , 0x09, 0x06, 0x06, NON_VPD_RING , 0, 0x0603088F}, + {"xb_io2_gptr" , 0x0a, 0x06, 0x06, NON_VPD_RING , 0, 0x06030882}, + {"xb_io2_time" , 0x0b, 0x06, 0x06, NON_VPD_RING , 0, 0x06030887}, + {"xb_pll_gptr" , 0x0c, 0x06, 0x06, NON_VPD_RING , 0, 0x06030012}, + {"xb_pll_bndy" , 0x0d, 0x06, 0x06, NON_VPD_RING , 0, 0x06030018}, + {"xb_pll_func" , 0x0e, 0x06, 0x06, NON_VPD_RING , 0, 0x06030010}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"xb_repr" , 0x13, 0x06, 0x06, NON_VPD_RING, 0, 0x0880000000000200}, - {"xb_io0_repr" , 0x14, 0x06, 0x06, NON_VPD_RING, 0, 0x0440000000000200}, - {"xb_io1_repr" , 0x15, 0x06, 0x06, NON_VPD_RING, 0, 0x0220000000000200}, - {"xb_io2_repr" , 0x16, 0x06, 0x06, NON_VPD_RING, 0, 0x0110000000000200}, + {"xb_repr" , 0x13, 0x06, 0x06, NON_VPD_RING , 0, 0x06034406}, + {"xb_io0_repr" , 0x14, 0x06, 0x06, NON_VPD_RING , 0, 0x06032206}, + {"xb_io1_repr" , 0x15, 0x06, 0x06, NON_VPD_RING , 0, 0x06031106}, + {"xb_io2_repr" , 0x16, 0x06, 0x06, NON_VPD_RING , 0, 0x06030886}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -191,30 +190,30 @@ namespace MC { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"mc_fure" , 0x00, 0x07, 0x07, NON_VPD_RING, 0, 0x0C00000000009000}, - {"mc_gptr" , 0x01, 0x07, 0x07, NON_VPD_RING, 0, 0x0C00000000002000}, - {"mc_time" , 0x02, 0x07, 0x07, NON_VPD_RING, 0, 0x0C00000000000100}, - {"mc_iom01_fure" , 0x03, 0x07, 0x07, NON_VPD_RING, 0, 0x0200000000009000}, - {"mc_iom01_gptr" , 0x04, 0x07, 0x07, NON_VPD_RING, 0, 0x0200000000002000}, - {"mc_iom01_time" , 0x05, 0x07, 0x07, NON_VPD_RING, 0, 0x0200000000000100}, - {"mc_iom23_fure" , 0x06, 0x07, 0x07, NON_VPD_RING, 0, 0x0100000000009000}, - {"mc_iom23_gptr" , 0x07, 0x07, 0x07, NON_VPD_RING, 0, 0x0100000000002000}, - {"mc_iom23_time" , 0x08, 0x07, 0x07, NON_VPD_RING, 0, 0x0100000000000100}, - {"mc_pll_gptr" , 0x09, 0x07, 0x07, NON_VPD_RING, 0, 0x0002000000002000}, - {"mc_pll_bndy_bucket_1" , 0x0a, 0x07, 0x07, NON_VPD_PLL_RING, 0, 0x0002000000000080}, - {"mc_pll_bndy_bucket_2" , 0x0b, 0x07, 0x07, NON_VPD_PLL_RING, 0, 0x0002000000000080}, - {"mc_pll_bndy_bucket_3" , 0x0c, 0x07, 0x07, NON_VPD_PLL_RING, 0, 0x0002000000000080}, - {"mc_pll_bndy_bucket_4" , 0x0d, 0x07, 0x07, NON_VPD_PLL_RING, 0, 0x0002000000000080}, - {"mc_pll_bndy_bucket_5" , 0x0e, 0x07, 0x07, NON_VPD_PLL_RING, 0, 0x0002000000000080}, - {"mc_pll_func" , 0x0f, 0x07, 0x07, NON_VPD_RING, 0, 0x0002000000008000}, + {"mc_fure" , 0x00, 0x07, 0x07, NON_VPD_RING, 0, 0x0703600F}, + {"mc_gptr" , 0x01, 0x07, 0x07, NON_VPD_RING, 0, 0x07036002}, + {"mc_time" , 0x02, 0x07, 0x07, NON_VPD_RING, 0, 0x07036007}, + {"mc_iom01_fure" , 0x03, 0x07, 0x07, NON_VPD_RING, 0, 0x0703100F}, + {"mc_iom01_gptr" , 0x04, 0x07, 0x07, NON_VPD_RING, 0, 0x07031002}, + {"mc_iom01_time" , 0x05, 0x07, 0x07, NON_VPD_RING, 0, 0x07031007}, + {"mc_iom23_fure" , 0x06, 0x07, 0x07, NON_VPD_RING, 0, 0x0703080F}, + {"mc_iom23_gptr" , 0x07, 0x07, 0x07, NON_VPD_RING, 0, 0x07030802}, + {"mc_iom23_time" , 0x08, 0x07, 0x07, NON_VPD_RING, 0, 0x07030807}, + {"mc_pll_gptr" , 0x09, 0x07, 0x07, NON_VPD_RING, 0, 0x07030012}, + {"mc_pll_bndy_bucket_1", 0x0a, 0x07, 0x07, NON_VPD_PLL_RING, 0, 0x07030018}, + {"mc_pll_bndy_bucket_2", 0x0b, 0x07, 0x07, NON_VPD_PLL_RING, 0, 0x07030018}, + {"mc_pll_bndy_bucket_3", 0x0c, 0x07, 0x07, NON_VPD_PLL_RING, 0, 0x07030018}, + {"mc_pll_bndy_bucket_4", 0x0d, 0x07, 0x07, NON_VPD_PLL_RING, 0, 0x07030018}, + {"mc_pll_bndy_bucket_5", 0x0e, 0x07, 0x07, NON_VPD_PLL_RING, 0, 0x07030018}, + {"mc_pll_func" , 0x0f, 0x07, 0x07, NON_VPD_RING, 0, 0x07030010}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"mc_repr" , 0x10, 0x07, 0x08, NON_VPD_RING, 0, 0x0C00000000000200}, - {"mc_iom01_repr" , 0x11, 0x07, 0x08, NON_VPD_RING, 0, 0x0200000000000200}, - {"mc_iom23_repr" , 0x12, 0x07, 0x08, NON_VPD_RING, 0, 0x0100000000000200}, + {"mc_repr" , 0x10, 0x07, 0x08, NON_VPD_RING , 0, 0x07036006}, + {"mc_iom01_repr" , 0x11, 0x07, 0x08, NON_VPD_RING , 0, 0x07031006}, + {"mc_iom23_repr" , 0x12, 0x07, 0x08, NON_VPD_RING , 0, 0x07030806}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -222,18 +221,18 @@ namespace OB0 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"ob0_fure" , 0x00, 0x09, 0x09, NON_VPD_RING, 0, 0x0E00000000009000}, - {"ob0_gptr" , 0x01, 0x09, 0x09, NON_VPD_RING, 0, 0x0E00000000002000}, - {"ob0_time" , 0x02, 0x09, 0x09, NON_VPD_RING, 0, 0x0E00000000000100}, - {"ob0_pll_gptr" , 0x03, 0x09, 0x09, NON_VPD_RING, 0, 0x0002000000002000}, - {"ob0_pll_bndy" , 0x04, 0x09, 0x09, NON_VPD_RING, 0, 0x0002000000000080}, - {"ob0_pll_func" , 0x05, 0x09, 0x09, NON_VPD_RING, 0, 0x0002000000008000}, + {"ob0_fure" , 0x00, 0x09, 0x09, NON_VPD_RING , 0, 0x0903700F}, + {"ob0_gptr" , 0x01, 0x09, 0x09, NON_VPD_RING , 0, 0x09037002}, + {"ob0_time" , 0x02, 0x09, 0x09, NON_VPD_RING , 0, 0x09037007}, + {"ob0_pll_gptr" , 0x03, 0x09, 0x09, NON_VPD_RING , 0, 0x09030012}, + {"ob0_pll_bndy" , 0x04, 0x09, 0x09, NON_VPD_RING , 0, 0x09030018}, + {"ob0_pll_func" , 0x05, 0x09, 0x09, NON_VPD_RING , 0, 0x09030010}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"ob0_repr" , 0x0a, 0x09, 0x09, NON_VPD_RING, 0, 0x0E00000000000200}, + {"ob0_repr" , 0x0a, 0x09, 0x09, NON_VPD_RING , 0, 0x09037006}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -241,18 +240,18 @@ namespace OB1 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"ob1_fure" , 0x00, 0x0a, 0x0a, NON_VPD_RING, 0, 0x0E00000000009000}, - {"ob1_gptr" , 0x01, 0x0a, 0x0a, NON_VPD_RING, 0, 0x0E00000000002000}, - {"ob1_time" , 0x02, 0x0a, 0x0a, NON_VPD_RING, 0, 0x0E00000000000100}, - {"ob1_pll_gptr" , 0x03, 0x0a, 0x0a, NON_VPD_RING, 0, 0x0002000000002000}, - {"ob1_pll_bndy" , 0x04, 0x0a, 0x0a, NON_VPD_RING, 0, 0x0002000000000080}, - {"ob1_pll_func" , 0x05, 0x0a, 0x0a, NON_VPD_RING, 0, 0x0002000000008000}, + {"ob1_fure" , 0x00, 0x0a, 0x0a, NON_VPD_RING , 0, 0x0A03700F}, + {"ob1_gptr" , 0x01, 0x0a, 0x0a, NON_VPD_RING , 0, 0x0A037002}, + {"ob1_time" , 0x02, 0x0a, 0x0a, NON_VPD_RING , 0, 0x0A037007}, + {"ob1_pll_gptr" , 0x03, 0x0a, 0x0a, NON_VPD_RING , 0, 0x0A030012}, + {"ob1_pll_bndy" , 0x04, 0x0a, 0x0a, NON_VPD_RING , 0, 0x0A030018}, + {"ob1_pll_func" , 0x05, 0x0a, 0x0a, NON_VPD_RING , 0, 0x0A030010}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"ob1_repr" , 0x0a, 0x0a, 0x0a, NON_VPD_RING, 0, 0x0E00000000000200}, + {"ob1_repr" , 0x0a, 0x0a, 0x0a, NON_VPD_RING , 0, 0x0A037006}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -260,18 +259,18 @@ namespace OB2 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"ob2_fure" , 0x00, 0x0b, 0x0b, NON_VPD_RING, 0, 0x0E00000000009000}, - {"ob2_gptr" , 0x01, 0x0b, 0x0b, NON_VPD_RING, 0, 0x0E00000000002000}, - {"ob2_time" , 0x02, 0x0b, 0x0b, NON_VPD_RING, 0, 0x0E00000000000100}, - {"ob2_pll_gptr" , 0x03, 0x0b, 0x0b, NON_VPD_RING, 0, 0x0002000000002000}, - {"ob2_pll_bndy" , 0x04, 0x0b, 0x0b, NON_VPD_RING, 0, 0x0002000000000080}, - {"ob2_pll_func" , 0x05, 0x0b, 0x0b, NON_VPD_RING, 0, 0x0002000000008000}, + {"ob2_fure" , 0x00, 0x0b, 0x0b, NON_VPD_RING , 0, 0x0B03700F}, + {"ob2_gptr" , 0x01, 0x0b, 0x0b, NON_VPD_RING , 0, 0x0B037002}, + {"ob2_time" , 0x02, 0x0b, 0x0b, NON_VPD_RING , 0, 0x0B037007}, + {"ob2_pll_gptr" , 0x03, 0x0b, 0x0b, NON_VPD_RING , 0, 0x0B030012}, + {"ob2_pll_bndy" , 0x04, 0x0b, 0x0b, NON_VPD_RING , 0, 0x0B030018}, + {"ob2_pll_func" , 0x05, 0x0b, 0x0b, NON_VPD_RING , 0, 0x0B030010}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"ob2_repr" , 0x0a, 0x0b, 0x0b, NON_VPD_RING, 0, 0x0E00000000000200}, + {"ob2_repr" , 0x0a, 0x0b, 0x0b, NON_VPD_RING , 0, 0x0B037006}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -279,18 +278,18 @@ namespace OB3 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"ob3_fure" , 0x00, 0x0c, 0x0c, NON_VPD_RING, 0, 0x0E00000000009000}, - {"ob3_gptr" , 0x01, 0x0c, 0x0c, NON_VPD_RING, 0, 0x0E00000000002000}, - {"ob3_time" , 0x02, 0x0c, 0x0c, NON_VPD_RING, 0, 0x0E00000000000100}, - {"ob3_pll_gptr" , 0x03, 0x0c, 0x0c, NON_VPD_RING, 0, 0x0002000000002000}, - {"ob3_pll_bndy" , 0x04, 0x0c, 0x0c, NON_VPD_RING, 0, 0x0002000000000080}, - {"ob3_pll_func" , 0x05, 0x0c, 0x0c, NON_VPD_RING, 0, 0x0002000000008000}, + {"ob3_fure" , 0x00, 0x0c, 0x0c, NON_VPD_RING , 0, 0x0C03700F}, + {"ob3_gptr" , 0x01, 0x0c, 0x0c, NON_VPD_RING , 0, 0x0C037002}, + {"ob3_time" , 0x02, 0x0c, 0x0c, NON_VPD_RING , 0, 0x0C037007}, + {"ob3_pll_gptr" , 0x03, 0x0c, 0x0c, NON_VPD_RING , 0, 0x0C030012}, + {"ob3_pll_bndy" , 0x04, 0x0c, 0x0c, NON_VPD_RING , 0, 0x0C030018}, + {"ob3_pll_func" , 0x05, 0x0c, 0x0c, NON_VPD_RING , 0, 0x0C030010}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"ob3_repr" , 0x0a, 0x0c, 0x0c, NON_VPD_RING, 0, 0x0E00000000000200}, + {"ob3_repr" , 0x0a, 0x0c, 0x0c, NON_VPD_RING , 0, 0x0C037006}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -298,17 +297,17 @@ namespace PCI0 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"pci0_fure" , 0x00, 0x0d, 0x0d, NON_VPD_RING, 0, 0x0E00000000009000}, - {"pci0_gptr" , 0x01, 0x0d, 0x0d, NON_VPD_RING, 0, 0x0E00000000002000}, - {"pci0_time" , 0x02, 0x0d, 0x0d, NON_VPD_RING, 0, 0x0E00000000000100}, - {"pci0_pll_bndy" , 0x03, 0x0d, 0x0d, NON_VPD_RING, 0, 0x0002000000000080}, - {"pci0_pll_gptr" , 0x04, 0x0d, 0x0d, NON_VPD_RING, 0, 0x0002000000002000}, + {"pci0_fure" , 0x00, 0x0d, 0x0d, NON_VPD_RING , 0, 0x0D03700F}, + {"pci0_gptr" , 0x01, 0x0d, 0x0d, NON_VPD_RING , 0, 0x0D037002}, + {"pci0_time" , 0x02, 0x0d, 0x0d, NON_VPD_RING , 0, 0x0D037007}, + {"pci0_pll_bndy" , 0x03, 0x0d, 0x0d, NON_VPD_RING , 0, 0x0D030018}, + {"pci0_pll_gptr" , 0x04, 0x0d, 0x0d, NON_VPD_RING , 0, 0x0D030012}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"pci0_repr" , 0x05, 0x0d, 0x0d, NON_VPD_RING, 0, 0x0E00000000000200}, + {"pci0_repr" , 0x05, 0x0d, 0x0d, NON_VPD_RING , 0, 0x0D037006}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -316,17 +315,17 @@ namespace PCI1 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"pci1_fure" , 0x00, 0x0e, 0x0e, NON_VPD_RING, 0, 0x0F00000000009000}, - {"pci1_gptr" , 0x01, 0x0e, 0x0e, NON_VPD_RING, 0, 0x0F00000000002000}, - {"pci1_time" , 0x02, 0x0e, 0x0e, NON_VPD_RING, 0, 0x0F00000000000100}, - {"pci1_pll_bndy" , 0x03, 0x0e, 0x0e, NON_VPD_RING, 0, 0x0002000000000080}, - {"pci1_pll_gptr" , 0x04, 0x0e, 0x0e, NON_VPD_RING, 0, 0x0002000000002000}, + {"pci1_fure" , 0x00, 0x0e, 0x0e, NON_VPD_RING , 0, 0x0E03780F}, + {"pci1_gptr" , 0x01, 0x0e, 0x0e, NON_VPD_RING , 0, 0x0E037802}, + {"pci1_time" , 0x02, 0x0e, 0x0e, NON_VPD_RING , 0, 0x0E037807}, + {"pci1_pll_bndy" , 0x03, 0x0e, 0x0e, NON_VPD_RING , 0, 0x0E030018}, + {"pci1_pll_gptr" , 0x04, 0x0e, 0x0e, NON_VPD_RING , 0, 0x0E030012}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"pci1_repr" , 0x05, 0x0e, 0x0e, NON_VPD_RING, 0, 0x0F00000000000200}, + {"pci1_repr" , 0x05, 0x0e, 0x0e, NON_VPD_RING , 0, 0x0E037806}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -334,17 +333,17 @@ namespace PCI2 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"pci2_fure" , 0x00, 0x0f, 0x0f, NON_VPD_RING, 0, 0x0F80000000009000}, - {"pci2_gptr" , 0x01, 0x0f, 0x0f, NON_VPD_RING, 0, 0x0F80000000002000}, - {"pci2_time" , 0x02, 0x0f, 0x0f, NON_VPD_RING, 0, 0x0F80000000000100}, - {"pci2_pll_bndy" , 0x03, 0x0f, 0x0f, NON_VPD_RING, 0, 0x0002000000000080}, - {"pci2_pll_gptr" , 0x04, 0x0f, 0x0f, NON_VPD_RING, 0, 0x0002000000002000}, + {"pci2_fure" , 0x00, 0x0f, 0x0f, NON_VPD_RING , 0, 0x0F037C0F}, + {"pci2_gptr" , 0x01, 0x0f, 0x0f, NON_VPD_RING , 0, 0x0F037C02}, + {"pci2_time" , 0x02, 0x0f, 0x0f, NON_VPD_RING , 0, 0x0F037C07}, + {"pci2_pll_bndy" , 0x03, 0x0f, 0x0f, NON_VPD_RING , 0, 0x0F030018}, + {"pci2_pll_gptr" , 0x04, 0x0f, 0x0f, NON_VPD_RING , 0, 0x0F030012}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"pci2_repr" , 0x05, 0x0F, 0x0F, NON_VPD_RING, 0, 0x0F80000000000200}, + {"pci2_repr" , 0x05, 0x0F, 0x0F, NON_VPD_RING , 0, 0x0F037C06}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -352,64 +351,64 @@ namespace EQ { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"eq_fure" , 0x00, 0x10, 0x10, NON_VPD_RING, 0, 0x0C10000000009000}, - {"eq_gptr" , 0x01, 0x10, 0x10, NON_VPD_RING, 0, 0x0C10000000002000}, - {"eq_time" , 0x02, 0x10, 0x10, NON_VPD_RING, 0, 0x0C10000000000100}, - {"eq_mode" , 0x03, 0x10, 0x10, NON_VPD_RING, 0, 0x0C10000000004000}, - {"ex_l3_fure" , 0x04, 0x10, 0x10, NON_VPD_RING, 0, 0x0200000000009000}, - {"ex_l3_gptr" , 0x05, 0x10, 0x10, NON_VPD_RING, 0, 0x0200000000002000}, - {"ex_l3_time" , 0x06, 0x10, 0x10, NON_VPD_RING, 0, 0x0200000000000100}, - {"ex_l2_mode" , 0x07, 0x10, 0x10, NON_VPD_RING, 0, 0x0080000000004000}, - {"ex_l2_fure" , 0x08, 0x10, 0x10, NON_VPD_RING, 0, 0x0080000000009000}, - {"ex_l2_gptr" , 0x09, 0x10, 0x10, NON_VPD_RING, 0, 0x0080000000002000}, - {"ex_l2_time" , 0x0a, 0x10, 0x10, NON_VPD_RING, 0, 0x0080000000000100}, - {"ex_l3_refr_fure" , 0x0b, 0x10, 0x10, NON_VPD_RING, 0, 0x0008000000009000}, - {"ex_l3_refr_gptr" , 0x0c, 0x10, 0x10, NON_VPD_RING, 0, 0x0008000000002000}, - {"eq_ana_func" , 0x0d, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000008000}, - {"eq_ana_gptr" , 0x0e, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000002000}, - {"eq_dpll_func" , 0x0f, 0x10, 0x10, NON_VPD_RING, 0, 0x0002000000008000}, - {"eq_dpll_gptr" , 0x10, 0x10, 0x10, NON_VPD_RING, 0, 0x0002000000002000}, - {"eq_dpll_mode" , 0x11, 0x10, 0x10, NON_VPD_RING, 0, 0x0002000000004000}, - {"eq_ana_bndy_bucket_0" , 0x12, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_1" , 0x13, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_2" , 0x14, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_3" , 0x15, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_4" , 0x16, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_5" , 0x17, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_6" , 0x18, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_7" , 0x19, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_8" , 0x1a, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_9" , 0x1b, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_10" , 0x1c, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_11" , 0x1d, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_12" , 0x1e, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_13" , 0x1f, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_14" , 0x20, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_15" , 0x21, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_16" , 0x22, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_17" , 0x23, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_18" , 0x24, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_19" , 0x25, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_20" , 0x26, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_21" , 0x27, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_22" , 0x28, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_23" , 0x29, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_24" , 0x2a, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_25" , 0x2b, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_l3dcc_bucket_26", 0x2c, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_mode" , 0x2d, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000004000}, - {"ex_l2_fure_1" , 0x2e, 0x10, 0x10, NON_VPD_RING, 0, 0x0080000000009000}, - {"ex_l3_fure_1" , 0x2f, 0x10, 0x10, NON_VPD_RING, 0, 0x0200000000009000}, + {"eq_fure" , 0x00, 0x10, 0x10, NON_VPD_RING, 0, 0x1003608F}, + {"eq_gptr" , 0x01, 0x10, 0x10, NON_VPD_RING, 0, 0x10036082}, + {"eq_time" , 0x02, 0x10, 0x10, NON_VPD_RING, 0, 0x10036087}, + {"eq_mode" , 0x03, 0x10, 0x10, NON_VPD_RING, 0, 0x10036081}, + {"ex_l3_fure" , 0x04, 0x10, 0x10, NON_VPD_RING, 0, 0x1003100F}, + {"ex_l3_gptr" , 0x05, 0x10, 0x10, NON_VPD_RING, 0, 0x10031002}, + {"ex_l3_time" , 0x06, 0x10, 0x10, NON_VPD_RING, 0, 0x10031007}, + {"ex_l2_mode" , 0x07, 0x10, 0x10, NON_VPD_RING, 0, 0x10030401}, + {"ex_l2_fure" , 0x08, 0x10, 0x10, NON_VPD_RING, 0, 0x1003040F}, + {"ex_l2_gptr" , 0x09, 0x10, 0x10, NON_VPD_RING, 0, 0x10030402}, + {"ex_l2_time" , 0x0a, 0x10, 0x10, NON_VPD_RING, 0, 0x10030407}, + {"ex_l3_refr_fure" , 0x0b, 0x10, 0x10, NON_VPD_RING, 0, 0x1003004F}, + {"ex_l3_refr_gptr" , 0x0c, 0x10, 0x10, NON_VPD_RING, 0, 0x10030042}, + {"eq_ana_func" , 0x0d, 0x10, 0x10, NON_VPD_RING, 0, 0x10030100}, + {"eq_ana_gptr" , 0x0e, 0x10, 0x10, NON_VPD_RING, 0, 0x10030102}, + {"eq_dpll_func" , 0x0f, 0x10, 0x10, NON_VPD_RING, 0, 0x10030010}, + {"eq_dpll_gptr" , 0x10, 0x10, 0x10, NON_VPD_RING, 0, 0x10030012}, + {"eq_dpll_mode" , 0x11, 0x10, 0x10, NON_VPD_RING, 0, 0x10030011}, + {"eq_ana_bndy_bucket_0" , 0x12, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_1" , 0x13, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_2" , 0x14, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_3" , 0x15, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_4" , 0x16, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_5" , 0x17, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_6" , 0x18, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_7" , 0x19, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_8" , 0x1a, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_9" , 0x1b, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_10" , 0x1c, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_11" , 0x1d, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_12" , 0x1e, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_13" , 0x1f, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_14" , 0x20, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_15" , 0x21, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_16" , 0x22, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_17" , 0x23, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_18" , 0x24, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_19" , 0x25, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_20" , 0x26, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_21" , 0x27, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_22" , 0x28, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_23" , 0x29, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_24" , 0x2a, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_25" , 0x2b, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_l3dcc_bucket_26", 0x2c, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_mode" , 0x2d, 0x10, 0x10, NON_VPD_RING, 0, 0x10030101}, + {"ex_l2_fure_1" , 0x2e, 0x10, 0x10, NON_VPD_RING, 0, 0x1003040F}, + {"ex_l3_fure_1" , 0x2f, 0x10, 0x10, NON_VPD_RING, 0, 0x1003100F}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"eq_repr" , 0x30, 0x10, 0x1b, NON_VPD_RING, 0, 0x0C10000000000200}, - {"ex_l3_repr" , 0x31, 0x10, 0x1b, NON_VPD_RING, 0, 0x0200000000000200}, - {"ex_l2_repr" , 0x32, 0x10, 0x1b, NON_VPD_RING, 0, 0x0080000000000200}, - {"ex_l3_refr_repr" , 0x33, 0x10, 0x1b, NON_VPD_RING, 0, 0x0008000000000200}, - {"ex_l3_refr_time" , 0x34, 0x10, 0x1b, NON_VPD_RING, 0, 0x0008000000000100}, + {"eq_repr" , 0x30, 0x10, 0x1b, NON_VPD_RING , 0, 0x10036086}, + {"ex_l3_repr" , 0x31, 0x10, 0x1b, NON_VPD_RING , 0, 0x10031006}, + {"ex_l2_repr" , 0x32, 0x10, 0x1b, NON_VPD_RING , 0, 0x10030406}, + {"ex_l3_refr_repr" , 0x33, 0x10, 0x1b, NON_VPD_RING , 0, 0x10030046}, + {"ex_l3_refr_time" , 0x34, 0x10, 0x1b, NON_VPD_RING , 0, 0x10030047}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, CC, RL}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, CC, RL }; }; @@ -417,15 +416,202 @@ namespace EC { const GenRingIdList RING_ID_LIST_COMMON[] = { - { "ec_func" , 0x00, 0x20, 0x20, NON_VPD_RING, 0, 0x0E00000000009000}, - { "ec_gptr" , 0x01, 0x20, 0x20, NON_VPD_RING, 0, 0x0E00000000002000}, - { "ec_time" , 0x02, 0x20, 0x20, NON_VPD_RING, 0, 0x0E00000000000100}, - { "ec_mode" , 0x03, 0x20, 0x20, NON_VPD_RING, 0, 0x0E00000000004000}, + { "ec_func" , 0x00, 0x20, 0x20, NON_VPD_RING , 0, 0x2003700F}, + { "ec_gptr" , 0x01, 0x20, 0x20, NON_VPD_RING , 0, 0x20037002}, + { "ec_time" , 0x02, 0x20, 0x20, NON_VPD_RING , 0, 0x20037007}, + { "ec_mode" , 0x03, 0x20, 0x20, NON_VPD_RING , 0, 0x20037001}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - { "ec_repr" , 0x04, 0x20, 0x37, NON_VPD_RING, 0, 0x0E00000000000200}, -}; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, CC, RL}; -}; - + { "ec_repr" , 0x04, 0x20, 0x37, NON_VPD_RING , 0, 0x20037006}, +}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, CC, RL }; +}; + +CHIPLET_TYPE p9_ringid_get_chiplet(RingID i_ringId) +{ + return RING_PROPERTIES[i_ringId].iv_type; +} + +void p9_ringid_get_chiplet_properties( + CHIPLET_TYPE i_chiplet, + CHIPLET_DATA** o_cpltData, + GenRingIdList** o_ringComm, + GenRingIdList** o_ringInst, + RingVariantOrder** o_varOrder, + uint8_t* o_varNumb) +{ + switch (i_chiplet) + { + case PERV_TYPE : + *o_cpltData = (CHIPLET_DATA*) &PERV::g_pervData; + *o_ringComm = (GenRingIdList*) PERV::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) PERV::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) PERV::RING_VARIANT_ORDER; + *o_varNumb = sizeof(PERV::RingVariants) / sizeof(uint16_t); + break; + + case N0_TYPE : + *o_cpltData = (CHIPLET_DATA*) &N0::g_n0Data; + *o_ringComm = (GenRingIdList*) N0::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) N0::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) N0::RING_VARIANT_ORDER; + *o_varNumb = sizeof(N0::RingVariants) / sizeof(uint16_t); + break; + + case N1_TYPE : + *o_cpltData = (CHIPLET_DATA*) &N1::g_n1Data; + *o_ringComm = (GenRingIdList*) N1::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) N1::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) N1::RING_VARIANT_ORDER; + *o_varNumb = sizeof(N1::RingVariants) / sizeof(uint16_t); + break; + + case N2_TYPE : + *o_cpltData = (CHIPLET_DATA*) &N2::g_n2Data; + *o_ringComm = (GenRingIdList*) N2::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) N2::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) N2::RING_VARIANT_ORDER; + *o_varNumb = sizeof(N2::RingVariants) / sizeof(uint16_t); + break; + + case N3_TYPE : + *o_cpltData = (CHIPLET_DATA*) &N3::g_n3Data; + *o_ringComm = (GenRingIdList*) N3::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) N3::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) N3::RING_VARIANT_ORDER; + *o_varNumb = sizeof(N3::RingVariants) / sizeof(uint16_t); + break; + + case XB_TYPE : + *o_cpltData = (CHIPLET_DATA*) &XB::g_xbData; + *o_ringComm = (GenRingIdList*) XB::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) XB::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) XB::RING_VARIANT_ORDER; + *o_varNumb = sizeof(XB::RingVariants) / sizeof(uint16_t); + break; + + case MC_TYPE : + *o_cpltData = (CHIPLET_DATA*) &MC::g_mcData; + *o_ringComm = (GenRingIdList*) MC::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) MC::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) MC::RING_VARIANT_ORDER; + *o_varNumb = sizeof(MC::RingVariants) / sizeof(uint16_t); + break; + + case OB0_TYPE : + *o_cpltData = (CHIPLET_DATA*) &OB0::g_ob0Data; + *o_ringComm = (GenRingIdList*) OB0::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) OB0::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) OB0::RING_VARIANT_ORDER; + *o_varNumb = sizeof(OB0::RingVariants) / sizeof(uint16_t); + break; + + case OB1_TYPE : + *o_cpltData = (CHIPLET_DATA*) &OB1::g_ob1Data; + *o_ringComm = (GenRingIdList*) OB1::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) OB1::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) OB1::RING_VARIANT_ORDER; + *o_varNumb = sizeof(OB1::RingVariants) / sizeof(uint16_t); + break; + + case OB2_TYPE : + *o_cpltData = (CHIPLET_DATA*) &OB2::g_ob2Data; + *o_ringComm = (GenRingIdList*) OB2::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) OB2::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) OB2::RING_VARIANT_ORDER; + *o_varNumb = sizeof(OB2::RingVariants) / sizeof(uint16_t); + break; + + case OB3_TYPE : + *o_cpltData = (CHIPLET_DATA*) &OB3::g_ob3Data; + *o_ringComm = (GenRingIdList*) OB3::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) OB3::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) OB3::RING_VARIANT_ORDER; + *o_varNumb = sizeof(OB3::RingVariants) / sizeof(uint16_t); + break; + + case PCI0_TYPE : + *o_cpltData = (CHIPLET_DATA*) &PCI0::g_pci0Data; + *o_ringComm = (GenRingIdList*) PCI0::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) PCI0::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) PCI0::RING_VARIANT_ORDER; + *o_varNumb = sizeof(PCI0::RingVariants) / sizeof(uint16_t); + break; + + case PCI1_TYPE : + *o_cpltData = (CHIPLET_DATA*) &PCI1::g_pci1Data; + *o_ringComm = (GenRingIdList*) PCI1::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) PCI1::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) PCI1::RING_VARIANT_ORDER; + *o_varNumb = sizeof(PCI1::RingVariants) / sizeof(uint16_t); + break; + + case PCI2_TYPE : + *o_cpltData = (CHIPLET_DATA*) &PCI2::g_pci2Data; + *o_ringComm = (GenRingIdList*) PCI2::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) PCI2::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) PCI2::RING_VARIANT_ORDER; + *o_varNumb = sizeof(PCI2::RingVariants) / sizeof(uint16_t); + break; + + case EQ_TYPE : + *o_cpltData = (CHIPLET_DATA*) &EQ::g_eqData; + *o_ringComm = (GenRingIdList*) EQ::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) EQ::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) EQ::RING_VARIANT_ORDER; + *o_varNumb = sizeof(EQ::RingVariants) / sizeof(uint16_t); + break; + + case EC_TYPE : + *o_cpltData = (CHIPLET_DATA*) &EC::g_ecData; + *o_ringComm = (GenRingIdList*) EC::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) EC::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) EC::RING_VARIANT_ORDER; + *o_varNumb = sizeof(EC::RingVariants) / sizeof(uint16_t); + break; + + default : + *o_cpltData = NULL; + *o_ringComm = NULL; + *o_ringInst = NULL; + *o_varOrder = NULL; + *o_varNumb = 0; + break; + } +} + +GenRingIdList* p9_ringid_get_ring_properties(RingID i_ringId) +{ + CHIPLET_DATA* l_cpltData; + GenRingIdList* l_ringList[2]; // 0: common, 1: instance + RingVariantOrder* l_varOrder; + uint8_t l_varNumb; + int i, j, n; + + p9_ringid_get_chiplet_properties( + p9_ringid_get_chiplet(i_ringId), + &l_cpltData, &l_ringList[0], &l_ringList[1], &l_varOrder, &l_varNumb); + + if (!l_ringList[0]) + { + return NULL; + } + + for (j = 0; j < 2; j++) // 0: common, 1: instance + { + n = (j ? l_cpltData->iv_num_instance_rings + : l_cpltData->iv_num_common_rings); + + for (i = 0; i < n; i++) + { + if (!strcmp(l_ringList[j][i].ringName, + RING_PROPERTIES[i_ringId].iv_name)) + { + return &(l_ringList[j][i]); + } + } + } + + return NULL; +} diff --git a/src/import/chips/p9/utils/imageProcs/p9_ringId.H b/src/import/chips/p9/utils/imageProcs/p9_ringId.H index 4bda700e..f1cfe749 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_ringId.H +++ b/src/import/chips/p9/utils/imageProcs/p9_ringId.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -27,6 +27,8 @@ #define _P9_RINGID_H_ #include <stdint.h> +#include <stddef.h> + #include <p9_ring_id.h> // General Ring ID list structure @@ -38,7 +40,7 @@ typedef struct uint8_t instanceIdMax; // the max instanceId uint8_t vpdKeyword; uint8_t pllCopy; // 0,1,2,3,4,5 -- No of PLL copies required - uint64_t scanRegionType; + uint32_t scanScomAddress; } GenRingIdList; typedef enum RingVariant // Base variables @@ -1303,4 +1305,25 @@ static const ringProperties_t RING_PROPERTIES[NUM_RING_IDS] = }; #endif +// returns our own chiplet enum value for this ringId +CHIPLET_TYPE +p9_ringid_get_chiplet( + RingID i_ringId); + +// returns data structures defined for chiplet type +// as determined by ringId +void +p9_ringid_get_chiplet_properties( + CHIPLET_TYPE i_chiplet, + CHIPLET_DATA** o_cpltData, + GenRingIdList** o_ringComm, + GenRingIdList** o_ringInst, + RingVariantOrder** o_varOrder, + uint8_t* o_varNumb); + +// returns properties of a ring as determined by ringId +GenRingIdList* +p9_ringid_get_ring_properties( + RingID i_ringId); + #endif diff --git a/src/import/chips/p9/utils/imageProcs/p9_scan_compression.H b/src/import/chips/p9/utils/imageProcs/p9_scan_compression.H index 3a4a7848..dfabe482 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_scan_compression.H +++ b/src/import/chips/p9/utils/imageProcs/p9_scan_compression.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -36,92 +36,49 @@ /// Compressed Scan Chain Data Structure Format /// /// The compressed scan ring data structure must be 8-byte aligned in -/// memory. The container data structure consists of this 24-byte header +/// memory. The container data structure consists of a header /// followed by an arbitrary number of 8 byte doublewords containing the -/// compressed scan data. Images are always stored and processed in -/// big-endian byte order. This container format is common across all +/// compressed scan data. Images are always stored and processed in +/// big-endian byte order. The header format is common across all /// decompression algorithms. /// -/// Bytes - Content -/// -/// 0:3 - A 32-bit "magic number" that identifies and validates the -/// compression algorithm and algorithm version used to compress the data. -/// -/// 4:7 - The 32-bit size of the entire data structure in \e bytes. Thi -/// consists of this 24-byte header plus the compressed scan data. This value -/// is always a multiple of 8. +/// ATTENTION: +/// The RS4v2 CompressedScanData had a 4 byte magic value with 0x34 ("4") +/// within its third byte, which is at the same byte position as iv_version +/// now. Users of CompressedScanData which use the magic value to detect +/// a ring data structure won't be able to distingish old and new +/// CompressedScanData for iv_version being 0x34. In the very unlikely case +/// that we would have that many versions of ComprossedScanData, it is +/// strongly suggested to simply skip 0x34 as version number. /// -/// 8:11 - This 32-bit value is reserved to the compression -/// algorithm. Typically this field is used to record the 'size' of the -/// compressed string in units specific to each algorithm. -/// -/// 12:15 - The length of the original scan chain in \e bits. -/// -/// 16:23 - The 64 bit scan Region and type details +/// Bytes - Content /// +/// 0:1 - A 16-bit "magic number" that identifies and validates the +/// compression algorithm used to compress the data ("RS"). /// -/// 24:27 - The 32 high-order bits of the value written to the Scan Select -/// register to set up the scan. The Scan Select register only defines these -/// bits. (Planned to use scan scom register value) +/// 2 - An 8-bit version number (3 for the time being). /// -/// 28 - The Scan Chain Data Structure version number +/// 3 - An 8-bit type field distinguishing different scan data types +/// (0 for non-CMSK, 1 for CMSK). /// -/// 29 - Flush-optimize : Is this byte is non-zero, the ring state to be -/// modified is the flush state of the ring. +/// 4:5 - The 16-bit size of the uncompressed scan data with +/// this header in \e bytes. This is not the exact length of actual scan data +/// in bits, but the number of bytes used by the RS4 encoding to store those +/// compressed scan bits. /// -/// 30 - The ring ID uniquely identifying the repair ring name. +/// 6:7 - The 16-bit ring ID uniquely identifying the ring. /// -/// 31 - The 7-bit pervasive chiplet Id + Multicast bit of the chiplet to -/// scan. This value is loaded directly into P0. The decompression -/// algorithms provide two entry points - one that uses this value as the -/// chiplet Id, and another that allows the caller to specify the chiplet Id -/// in the call. - +/// 8:11 - scan scom register value typedef struct { - - /// Magic number - See \ref scan_compression_magic - uint32_t iv_magic; - - /// Total size in bytes, including the container header - uint32_t iv_size; - - /// Reserved to the algorithm - uint32_t iv_algorithmReserved; - - /// Length of the original scan chain in bits - uint32_t iv_length; - - /// 64 bit scan select register value - uint64_t iv_scanSelect; - - /// Data structure (header) version - uint8_t iv_headerVersion; - - /// Flush-state optimization - /// - /// Normally, modifying the state of the ring requires XOR-ing the - /// difference state (the compressed state) with the current ring state as - /// it will appear in the Scan Data Register. If the current state of the - /// ring is the scan-0 flush state, then by definition the Scan Data - /// Register is always 0. Therefore we can simply write the difference to - /// the Scan Data Register rather than using a read-XOR-write. - uint8_t iv_flushOptimization; - - /// Ring ID uniquely identifying the repair name. (See the list of ring - /// name vs ring IDs in p8_ring_identification.c). - uint8_t iv_ringId; - - /// 7-bit pervasive chiplet Id + Multicast bit - /// - /// This field is right-justified in an 8-byte aligned doubleword so that - /// the P0 register can be directly updated from the doubelword value in a - /// data register. - uint8_t iv_chipletId; - + uint16_t iv_magic; + uint8_t iv_version; + uint8_t iv_type; + uint16_t iv_size; + uint16_t iv_ringId; + uint32_t iv_scanAddr; } CompressedScanData; - /// Endian-translate a CompressedScanData structure /// /// \param o_data A pointer to a CompressedScanData structure to receive the @@ -141,17 +98,14 @@ compressed_scan_data_translate(CompressedScanData* o_data, /// Compress a scan string using the RS4 compression algorithm /// -/// \param[in,out] io_data This is a pointer to a memory area which must be -/// large enough to hold the worst-case result of compressing \a i_string (see -/// below). Note that the CompressedScanData is always created in big-endian -/// format, however the caller can use compresed_scan_data_translate() to -/// create a copy of the header in host format. -/// -/// \param[in] i_dataSize The size of \a io_data in bytes. +/// \param[in,out] io_rs4 This is a pointer to a memory area which must be +/// large enough to hold the worst-case result of compressing \a i_data_str +/// and \a i_care_str (see below). Note that the CompressedScanData is +/// always created in big-endian format, however the caller can use +/// compresed_scan_data_translate() to create a copy of the header in +/// host format. /// -/// \param[out] o_imageSize The effective size of the entire compressed scan -/// data structure (header + compressed data) created in \a io_data, in bytes. -/// This value will always be a multiple of 8. +/// \param[in] i_size The size of the buffer pointed to by \a io_rs4. /// /// \param[in] i_data_str The string to compress. Scan data to compress is /// left-justified in this input string. @@ -162,61 +116,42 @@ compressed_scan_data_translate(CompressedScanData* o_data, /// \param[in] i_length The length of the input string in \e bits. It is /// assumed the \a i_string contains at least (\a i_length + 7) / 8 bytes. /// -/// \param[in] i_scanSelect The 64-bit value written to the Scan Select -/// register to set up for the scan. +/// \param[in] i_scanAddr The 32-bit scan address. /// /// \param[in] i_ringId The ring ID that uniquely identifies the ring name of -/// a repair ring. (See p8_ring_identification.c for more info.) -/// -/// \param[in] i_chipletId The 7-bit value for the iv_chipletId field of the -/// CompressedScanData. -/// -/// \param[in] i_flushOptimization This input parameter should be set to a -/// non-0 value if it is known that this ring difference will be applied to a -/// scan-0 flush state. This will improve the performance of the -/// decompress-scan routine. If the initial state of the ring is unknown, set -/// this parameter to 0. +/// a repair ring. (See p9_ring_id.h for more info.) /// /// This API is required for integration with PHYP which does not support /// malloc(). Applications in environments supporting malloc() can use /// rs4_compress() instead. /// -/// The worst-case compression for RS4 requires 2 nibbles of control overhead -/// per 15 nibbles of data (17/15), plus a maximum of 2 nibbles of termination. -/// We always require this worst-case amount of memory including the header and +/// We always require the worst-case amount of memory including the header and /// any rounding required to guarantee that the data size is a multiple of 8 /// bytes. The final image size is also rounded up to a multiple of 8 bytes. -/// If the \a i_dataSize is less than this amount (based on \a i_length) the +/// If the \a io_size is less than this amount (based on \a i_length) the /// call will fail. /// /// \returns See \ref scan_compression_codes int -_rs4_compress(CompressedScanData* io_data, - uint32_t i_dataSize, - uint32_t* o_imageSize, +_rs4_compress(CompressedScanData* io_rs4, + const uint32_t i_size, const uint8_t* i_data_str, const uint8_t* i_care_str, const uint32_t i_length, - const uint64_t i_scanSelect, - const uint8_t i_ringId, - const uint8_t i_chipletId, - const uint8_t i_flushOptimization); + const uint32_t i_scanAddr, + const uint16_t i_ringId); /// Compress a scan string using the RS4 compression algorithm /// -/// \param[out] o_data This algorithm uses malloc() to allocate memory for the -/// compresed data, and returns a pointer to this memory in \a o_data. After +/// \param[out] o_rs4 This algorithm uses malloc() to allocate memory for the +/// compressed data, and returns a pointer to this memory in \a o_rs4. After /// the call this memory is owned by the caller who is responsible for /// free()-ing the data area once it is no longer required. Note that the /// CompressedScanData is always created in big-endian format, however the /// caller can use compresed_scan_data_translate() to create a copy of the /// header in host format. /// -/// \param[out] o_size The effective size of the entire compressed scan data -/// structure (header + compressed data) pointed to by \a o_data, in bytes. -/// This value will always be a multiple of 8. -/// /// \param[in] i_data_str The string to compress. Scan data to compress is /// left-justified in this input string. /// @@ -226,33 +161,19 @@ _rs4_compress(CompressedScanData* io_data, /// \param[in] i_length The length of the input string in \e bits. It is /// assumed the \a i_string contains at least (\a i_length + 7) / 8 bytes. /// -/// \param[in] i_scanSelect The 64-bit value written to the Scan Select -/// register to set up for the scan. Only the 32 high-order bits are actually -/// stored. +/// \param[in] i_scanAddr The 32-bit scan address. /// /// \param[in] i_ringId The ring ID that uniquely identifies the ring name of -/// a repair ring. (See p8_ring_identification.c for more info.) -/// -/// \param[in] i_chipletId The 7-bit value for the iv_chipletId field of the -/// CompressedScanData. -/// -/// \param[in] i_flushOptimization This input parameter should be set to a -/// non-0 value if it is known that this ring difference will be applied to a -/// scan-0 flush state. This will improve the performance of the -/// decompress-scan routine. If the initial state of the ring is unknown, set -/// this parameter to 0. +/// a repair ring. (See p9_ring_id.c for more info.) /// /// \returns See \ref scan_compression_codes int -rs4_compress(CompressedScanData** o_data, - uint32_t* o_size, +rs4_compress(CompressedScanData** o_rs4, const uint8_t* i_data_str, const uint8_t* i_care_str, const uint32_t i_length, - const uint64_t i_scanSelect, - const uint8_t i_ringId, - const uint8_t i_chipletId, - const uint8_t i_flushOptimization); + const uint32_t i_scanAddr, + const uint8_t i_ringId); /// Decompress a scan string compressed using the RS4 compression algorithm @@ -267,8 +188,7 @@ rs4_compress(CompressedScanData** o_data, /// the decompressed care mask, which is the size of the original string in /// bits rounded up to the nearest byte. /// -/// \param[in] i_stringSize The size (in bytes) of \a io_data_str and -/// \a io_care_str. +/// \param[in] i_size The size in \e bytes of \a io_data_str and \a io_care_str. /// /// \param[out] o_length The length of the decompressed string in \e bits. /// @@ -283,7 +203,7 @@ rs4_compress(CompressedScanData** o_data, int _rs4_decompress(uint8_t* io_data_str, uint8_t* io_care_str, - uint32_t i_stringSize, + uint32_t i_size, uint32_t* o_length, const CompressedScanData* i_rs4); @@ -302,7 +222,7 @@ _rs4_decompress(uint8_t* io_data_str, /// in \e bits. The caller may assume that \a o_data_str and o_care_str each /// contain at least (\a o_length + 7) / 8 \e bytes. /// -/// \param[in] i_rs4 A pointer to the CompressedScanData header + data to be +/// \param[in] i_rs4 A pointer to the CompressedScanData header and data to be /// decompressed. /// /// \returns See \ref scan_compression_codes @@ -328,25 +248,30 @@ rs4_redundant(const CompressedScanData* i_data, int* o_redundant); #endif // __ASSEMBLER__ -/// The current version of the CompressedScanData structure -/// -/// This constant is required to be a #define to guarantee consistency between -/// the header format and cmopiled code. -#define COMPRESSED_SCAN_DATA_VERSION 2 - -/// The size of the CompressedScanData structure -#define COMPRESSED_SCAN_DATA_SIZE (uint8_t)24 - - /// \defgroup scan_compression_magic Scan Compression Magic Numbers -///// +/// /// @ { /// RS4 Magic -#define RS4_MAGIC (uint32_t)0x52533402 /* "RS4" + Version 0x02 */ +#define RS4_MAGIC 0x5253 /* "RS" */ /// @} +/// \defgroup scan_compression_version_type version and type accessors +/// +/// @{ + +/// The current version of the CompressedScanData structure +/// +/// This constant is required to be a #define to guarantee consistency between +/// the header format and compiled code. +#define RS4_VERSION 3 + +/// Scan data types +#define RS4_SCAN_DATA_TYPE_CMSK 1 +#define RS4_SCAN_DATA_TYPE_NON_CMSK 0 + +/// @} /// \defgroup scan_compression_codes Scan Compression Return Codes /// @@ -388,6 +313,9 @@ rs4_redundant(const CompressedScanData* i_data, int* o_redundant); /// Invalid transition in state machine #define SCAN_COMPRESSION_STATE_ERROR 6 +/// wrong compression version +#define SCAN_COMPRESSION_VERSION_ERROR 7 + /// @} #endif // __P9_SCAN_COMPRESSION_H__ diff --git a/src/import/chips/p9/utils/imageProcs/p9_tor.C b/src/import/chips/p9/utils/imageProcs/p9_tor.C index 17e3d838..3eef621e 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_tor.C +++ b/src/import/chips/p9/utils/imageProcs/p9_tor.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -39,6 +39,7 @@ #include "p9_ringId.H" #include "p9_tor.H" #include "p9_xip_image.h" +#include "p9_scan_compression.H" #include "p9_infrastruct_help.H" namespace P9_TOR @@ -65,50 +66,56 @@ const char* ringVariantName[] = { "BASE", // ////////////////////////////////////////////////////////////////////////////////// static -int get_ring_from_sbe_image ( void* i_ringSection, // Ring section ptr - uint64_t i_magic, // Image Magic Number - RingID i_ringId, // Ring ID - uint16_t i_ddLevel, // DD level - RingType_t& io_RingType, // Common, Instance - RingVariant_t i_RingVariant, // Base,CC, RL, Ovrd, Ovly - uint8_t& io_instanceId, // Instance ID - RingBlockType_t i_RingBlockType, // Single ring, Block - void** io_ringBlockPtr, // Output ring buffer - uint32_t& io_ringBlockSize, // Size of ring data - char* o_ringName, // Name of ring - uint32_t i_dbgl ) // Debug option +int get_ring_from_sbe_image( void* i_ringSection, // Ring section ptr + uint64_t i_magic, // Image Magic Number + RingID i_ringId, // Ring ID + uint16_t i_ddLevelOffset, // DD level offset (wrt i_ringSection) + RingType_t& io_RingType, // Common, Instance + RingVariant_t i_RingVariant, // Base,CC, RL, Ovrd, Ovly + uint8_t& io_instanceId, // Instance ID + RingBlockType_t i_RingBlockType, // Single ring, Block + void** io_ringBlockPtr, // Output ring buffer + uint32_t& io_ringBlockSize, // Size of ring data + char* o_ringName, // Name of ring + uint32_t i_dbgl ) // Debug option { - uint32_t acc_offset = 0; // Accumulating offset to next TOR offset slot - uint32_t ring_offset = 0; - uint16_t chiplet_offset = 0; - uint32_t next_ring_offset = 0; - uint32_t ringSize = 0; - int temp = i_ddLevel >> 2; // converting byte to word counter - uint32_t* deltaRingRS4_4B; - uint32_t sbe_offset = 0; + int rc = TOR_SUCCESS; RingVariantOrder* ring_variant_order = NULL; + uint32_t tor_slot_no = 0; // TOR slot number (within a TOR chiplet section) + uint16_t dd_level_offset; // Local DD level offset, if any (wrt i_ringSection) + uint32_t acc_offset = 0; // Accumulating offset to next TOR offset + uint32_t ppe_offset = 0; // Local offset to where SBE PPE section starts + uint32_t cplt_offset = 0; // Local offset to where SBE chiplet section starts + uint16_t ring_offset = 0; // Local offset to where SBE ring container/block starts + uint32_t ring_size = 0; // Size of whole ring container/block. if (i_magic == P9_XIP_MAGIC_HW) { - sbe_offset = *((uint32_t*)i_ringSection + temp); //DD level offset index - temp = htobe32(sbe_offset); + dd_level_offset = i_ddLevelOffset; + ppe_offset = *(uint32_t*)((uint8_t*)i_ringSection + dd_level_offset); + ppe_offset = htobe32(ppe_offset); } else if (i_magic == P9_XIP_MAGIC_SEEPROM) { - sbe_offset = 0; - i_ddLevel = 0; - temp = htobe32(sbe_offset); + ppe_offset = 0; + dd_level_offset = 0; + ppe_offset = htobe32(ppe_offset); + } + else + { + MY_ERR("Magic number i_magic=0x%016lX is not valid for SBE\n", (uintptr_t)i_magic); + return TOR_INVALID_MAGIC_NUMBER; } // Looper for each SBE chiplet - for(int l = 0; l < SBE_NOOF_CHIPLETS; l++) + for(int iCplt = 0; iCplt < SBE_NOOF_CHIPLETS; iCplt++) { GenRingIdList* ring_id_list_common = NULL; GenRingIdList* ring_id_list_instance = NULL; CHIPLET_DATA l_cpltData; uint8_t l_num_variant = 1; - switch (l) + switch (iCplt) { case PERV_CPLT : l_cpltData = PERV::g_pervData; @@ -206,7 +213,6 @@ int get_ring_from_sbe_image ( void* i_ringSection, // Ring section ring_variant_order = (RingVariantOrder*) PCI0::RING_VARIANT_ORDER; break; - case PCI1_CPLT : l_cpltData = PCI1::g_pci1Data; l_num_variant = (uint8_t)sizeof(PCI1::RingVariants) / sizeof(uint16_t); @@ -240,7 +246,7 @@ int get_ring_from_sbe_image ( void* i_ringSection, // Ring section break; default : - MY_ERR("Chiplet=%d is not valid. \n", l); + MY_ERR("Chiplet=%d is not valid for SBE. \n", iCplt); return TOR_INVALID_CHIPLET; } @@ -253,43 +259,51 @@ int get_ring_from_sbe_image ( void* i_ringSection, // Ring section l_num_variant); } - uint32_t local = 0; + + // + // Sequentially walk the TOR slots within the chiplet's COMMON section + // + tor_slot_no = 0; for (uint8_t i = 0; i < l_cpltData.iv_num_common_rings ; i++) { - for (uint8_t j = 0; j < l_num_variant ; j++) + for (uint8_t iVariant = 0; iVariant < l_num_variant ; iVariant++) { if (i_dbgl > 2) { - MY_INF(" Ring name %s Cplt Common ring id %d Variant id %d", - (ring_id_list_common + i)->ringName, i, j); + MY_INF(" Ring %s Cplt common ring id %d Variant id %d\n", + (ring_id_list_common + i)->ringName, i, iVariant); } if ((strcmp( (ring_id_list_common + i)->ringName, RING_PROPERTIES[i_ringId].iv_name) == 0) - && ( i_RingVariant == ring_variant_order->variant[j] + && ( i_RingVariant == ring_variant_order->variant[iVariant] || (i_RingVariant == OVERRIDE && i_magic == P9_XIP_MAGIC_SEEPROM))) { strcpy(o_ringName, RING_PROPERTIES[i_ringId].iv_name); - uint32_t var = l * sizeof(TorPpeBlock_t) + i_ddLevel + temp; - int temp1 = var / sizeof(uint32_t); - ring_offset = *((uint32_t*)i_ringSection + temp1); - ring_offset = htobe32(ring_offset); - var = ring_offset + i_ddLevel + temp; - temp1 = var / sizeof(uint16_t) + local; - chiplet_offset = *((uint16_t*)i_ringSection + temp1); - chiplet_offset = htobe16(chiplet_offset); + + acc_offset = dd_level_offset + ppe_offset + iCplt * sizeof(TorPpeBlock_t); + cplt_offset = *(uint32_t*)( (uint8_t*)i_ringSection + + acc_offset ); + cplt_offset = htobe32(cplt_offset); + + acc_offset = dd_level_offset + ppe_offset + cplt_offset; + ring_offset = *(uint16_t*)( (uint8_t*)i_ringSection + + acc_offset + + tor_slot_no * sizeof(ring_offset) ); + ring_offset = htobe16(ring_offset); if (i_RingBlockType == GET_SINGLE_RING) { - var = ring_offset + (chiplet_offset - sizeof(TorPpeBlock_t)) + i_ddLevel + temp; - temp1 = var / sizeof(uint32_t); - next_ring_offset = *((uint32_t*)i_ringSection + temp1); - next_ring_offset = htobe32(next_ring_offset); - ringSize = next_ring_offset; + acc_offset = dd_level_offset + + ppe_offset + + cplt_offset + + ring_offset; + ring_size = htobe16( ((CompressedScanData*) + ((uint8_t*)i_ringSection + acc_offset))->iv_size ); io_RingType = COMMON; - if (chiplet_offset) + if (ring_offset) { if (io_ringBlockSize == 0) { @@ -298,11 +312,11 @@ int get_ring_from_sbe_image ( void* i_ringSection, // Ring section MY_INF("\tio_ringBlockSize is zero. Returning required size.\n"); } - io_ringBlockSize = ringSize; + io_ringBlockSize = ring_size; return 0; } - if (io_ringBlockSize < ringSize) + if (io_ringBlockSize < ring_size) { MY_ERR("\tio_ringBlockSize is less than required size.\n"); return TOR_BUFFER_TOO_SMALL; @@ -310,119 +324,124 @@ int get_ring_from_sbe_image ( void* i_ringSection, // Ring section if (i_dbgl > 0) { - MY_INF(" ring container of %s is found in the SBE image container \n", - o_ringName); + MY_INF(" Ring %s found in the SBE section \n", o_ringName); } - memcpy( (uint8_t*)(*io_ringBlockPtr), (uint8_t*)i_ringSection + var, - (size_t)ringSize); + memcpy( (uint8_t*)(*io_ringBlockPtr), (uint8_t*)i_ringSection + acc_offset, + (size_t)ring_size); - io_ringBlockSize = ringSize; + io_ringBlockSize = ring_size; io_instanceId = (ring_id_list_common + i)->instanceIdMin; - - if (i_dbgl > 0) - { - MY_INF(" After get_ring_from_sbe_image Size %d \n", io_ringBlockSize); - } - - if (i_dbgl > 1) - { - MY_INF("Hex details Chiplet offset 0x%08x local offset 0x%08x " \ - "ring offset 0x%08x start adr 0x%08x size 0x%08x size 0x%08x \n", - var, temp, ring_offset, chiplet_offset, next_ring_offset, ringSize); - MY_INF("Chiplet %d ChipletRing TOR offset %d %d %d Size %d %d \t\n", - i, ring_offset, chiplet_offset, next_ring_offset, ringSize, temp); - } - - if (i_dbgl > 2) - { - deltaRingRS4_4B = (uint32_t*)(*io_ringBlockPtr); - - for (uint32_t m = 0; m < ringSize / sizeof(uint32_t); m++) - { - MY_INF("compressed data %d --- %08x \t", m, htobe32(deltaRingRS4_4B[m])); - } - - MY_INF("\n"); - } - - return TOR_RING_FOUND; + rc = TOR_RING_FOUND; } else { if (i_dbgl > 0) { - MY_INF(" ring container of %s is not found in the SBE image container \n", - o_ringName); + MY_INF(" Ring %s not found in the SBE section \n", o_ringName); } - return TOR_RING_NOT_FOUND; + rc = TOR_RING_NOT_FOUND; } + + if (i_dbgl > 0) + { + MY_INF(" Hex details (SBE) for Chiplet #%d: \n" + " DD number section's offset to DD level section = 0x%08x \n" + " DD level section's offset to PpeType = 0x%08x \n" + " PpeType section's offset to chiplet = 0x%08x \n" + " Chiplet section's offset to RS4 header = 0x%08x \n" + " Full offset to RS4 header = 0x%08x \n" + " Ring size = 0x%08x \n", + i, dd_level_offset, ppe_offset, cplt_offset, ring_offset, acc_offset, ring_size); + } + + return rc; + } else if (i_RingBlockType == PUT_SINGLE_RING) { - if (chiplet_offset) + if (ring_offset) { MY_ERR("Ring container is already present in the SBE section \n"); return TOR_RING_AVAILABLE_IN_RINGSECTION; } - acc_offset = var; - io_ringBlockSize = acc_offset + (local * RING_OFFSET_SIZE); + // Special [mis]use of io_ringBlockPtr and io_ringBlockSize: + // Put location of chiplet's common section into ringBlockPtr memcpy( (uint8_t*)(*io_ringBlockPtr), &acc_offset, sizeof(acc_offset)); + // Put location of ring_offset slot into ringBlockSize + io_ringBlockSize = acc_offset + (tor_slot_no * sizeof(ring_offset)); return TOR_RING_FOUND; } + else + { + MY_ERR("Ring block type (i_RingBlockType=%d) is not supported for SBE \n", i_RingBlockType); + return TOR_INVALID_RING_BLOCK_TYPE; + } } - local++; + tor_slot_no++; // Next TOR slot } } - local = 0; - for(uint8_t i = (ring_id_list_instance + 0)->instanceIdMin; - i < (ring_id_list_instance + 0)->instanceIdMax + 1 ; i++) + // + // Sequentially walk the TOR slots within the chiplet's INSTANCE section + // + tor_slot_no = 0; + + for ( uint8_t i = (ring_id_list_instance + 0)->instanceIdMin; + i < (ring_id_list_instance + 0)->instanceIdMax + 1 ; i++ ) { for (uint8_t j = 0; j < l_cpltData.iv_num_instance_rings; j++) { - for(uint8_t k = 0; k < l_num_variant ; k++) + for (uint8_t iVariant = 0; iVariant < l_num_variant ; iVariant++) { if (i_dbgl > 2) { MY_INF(" Ring name %s Cplt instance ring id %d Variant id %d Instance id %d\n", - (ring_id_list_instance + j)->ringName, j, k, i); + (ring_id_list_instance + j)->ringName, j, iVariant, i); } - if (strcmp( (ring_id_list_instance + j)->ringName, - RING_PROPERTIES[i_ringId].iv_name) == 0) + if (strcmp( (ring_id_list_instance + j)->ringName, + RING_PROPERTIES[i_ringId].iv_name) == 0) { if ( io_instanceId >= (ring_id_list_instance + 0)->instanceIdMin - && io_instanceId <= (ring_id_list_instance + 0)->instanceIdMax) + && io_instanceId <= (ring_id_list_instance + 0)->instanceIdMax ) { - if ( i == io_instanceId && i_RingVariant == ring_variant_order->variant[k] ) + if (i == io_instanceId && i_RingVariant == ring_variant_order->variant[iVariant]) { strcpy(o_ringName, RING_PROPERTIES[i_ringId].iv_name); - uint32_t var = l * sizeof(TorPpeBlock_t) + i_ddLevel + temp + CPLT_OFFSET_SIZE; - int temp1 = var / sizeof(uint32_t); - ring_offset = *((uint32_t*)i_ringSection + temp1); - ring_offset = htobe32(ring_offset); - var = ring_offset + i_ddLevel + temp; - temp1 = var / sizeof(uint16_t) + local; - chiplet_offset = *((uint16_t*)i_ringSection + temp1); - chiplet_offset = htobe16(chiplet_offset); + + acc_offset = dd_level_offset + + ppe_offset + + iCplt * sizeof(TorPpeBlock_t) + + sizeof(cplt_offset); // Jump to instance offset + cplt_offset = *(uint32_t*)( (uint8_t*)i_ringSection + + acc_offset ); + cplt_offset = htobe32(cplt_offset); + + acc_offset = cplt_offset + dd_level_offset + ppe_offset; + ring_offset = *(uint16_t*)( (uint8_t*)i_ringSection + + acc_offset + + tor_slot_no * sizeof(ring_offset) ); + ring_offset = htobe16(ring_offset); if (i_RingBlockType == GET_SINGLE_RING) { - var = ring_offset + (chiplet_offset - sizeof(TorPpeBlock_t)) + i_ddLevel + temp; - temp1 = var / sizeof(uint32_t); - next_ring_offset = *((uint32_t*)i_ringSection + temp1); - next_ring_offset = htobe32(next_ring_offset); - ringSize = next_ring_offset; + acc_offset = dd_level_offset + + ppe_offset + + cplt_offset + + ring_offset; + ring_size = htobe16( ((CompressedScanData*) + ((uint8_t*)i_ringSection + + acc_offset))->iv_size ); io_RingType = INSTANCE; - if (chiplet_offset) + if (ring_offset) { if (io_ringBlockSize == 0) { @@ -431,11 +450,11 @@ int get_ring_from_sbe_image ( void* i_ringSection, // Ring section MY_INF("\tio_ringBlockSize is zero. Returning required size.\n"); } - io_ringBlockSize = ringSize; + io_ringBlockSize = ring_size; return 0; } - if (io_ringBlockSize < ringSize) + if (io_ringBlockSize < ring_size) { MY_ERR("\tio_ringBlockSize is less than required size.\n"); return TOR_BUFFER_TOO_SMALL; @@ -447,85 +466,83 @@ int get_ring_from_sbe_image ( void* i_ringSection, // Ring section o_ringName); } - memcpy( (uint8_t*)(*io_ringBlockPtr), (uint8_t*)i_ringSection + var, - (size_t)ringSize); + memcpy( (uint8_t*)(*io_ringBlockPtr), (uint8_t*)i_ringSection + acc_offset, + (size_t)ring_size); - io_ringBlockSize = ringSize; + io_ringBlockSize = ring_size; if (i_dbgl > 0) { MY_INF(" After get_ring_from_sbe_image Size %d \n", io_ringBlockSize); } - if (i_dbgl > 1) - { - MY_INF(" 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x \n", - var, temp, ring_offset, chiplet_offset, next_ring_offset, ringSize); - MY_INF("Chiplet %d ChipletRing TOR offset %d %d %d Size %d %d \t\n", - i, ring_offset, chiplet_offset, next_ring_offset, ringSize, temp); - } - - if (i_dbgl > 2) - { - deltaRingRS4_4B = (uint32_t*)(*io_ringBlockPtr); - - for (uint32_t m = 0; m < ringSize / sizeof(uint32_t); m++) - { - MY_INF("compressed data %d --- %08x \t", - m, htobe32(deltaRingRS4_4B[m])); - } - - MY_INF("\n"); - } - - return TOR_RING_FOUND; + rc = TOR_RING_FOUND; } else { if (i_dbgl > 0) { - MY_INF(" ring container of %s is not found in the SBE image container \n", - o_ringName); + MY_INF(" Ring %s not found in SBE section \n", o_ringName); } - return TOR_RING_NOT_FOUND; + rc = TOR_RING_NOT_FOUND; + } + + if (i_dbgl > 0) + { + MY_INF(" Hex details (SBE) for Chiplet #%d: \n" + " DD number section's offset to DD level section = 0x%08x \n" + " DD level section's offset to PpeType = 0x%08x \n" + " PpeType section's offset to chiplet = 0x%08x \n" + " Chiplet section's offset to RS4 header = 0x%08x \n" + " Full offset to RS4 header = 0x%08x \n" + " Ring size = 0x%08x \n", + i, dd_level_offset, ppe_offset, cplt_offset, ring_offset, acc_offset, ring_size); } + + return rc; } else if (i_RingBlockType == PUT_SINGLE_RING) { - if (chiplet_offset) + if (ring_offset) { MY_ERR("Ring container is already present in the SBE section \n"); return TOR_RING_AVAILABLE_IN_RINGSECTION; } - acc_offset = var; - io_ringBlockSize = acc_offset + (local * RING_OFFSET_SIZE); + // Special [mis]use of io_ringBlockPtr and io_ringBlockSize: + // Put location of chiplet's instance section into ringBlockPtr memcpy( (uint8_t*)(*io_ringBlockPtr), &acc_offset, sizeof(acc_offset)); + // Put location of ring_offset slot into ringBlockSize + io_ringBlockSize = acc_offset + (tor_slot_no * sizeof(ring_offset)); return TOR_RING_FOUND; } + else + { + MY_ERR("Ring block type (i_RingBlockType=%d) is not supported for SBE \n", i_RingBlockType); + return TOR_INVALID_RING_BLOCK_TYPE; + } } - } else { MY_ERR(" SBE ring instance ID %d is invalid, Valid ID is from %d to %d \n", io_instanceId, (ring_id_list_instance + 0)->instanceIdMin, (ring_id_list_instance + 0)->instanceIdMax); + return TOR_INVALID_INSTANCE_ID; } } - local++; + tor_slot_no++; } - } - } - } + MY_ERR("i_ringId=0x%x is an invalid ring ID for SBE", i_ringId); + return TOR_INVALID_RING_ID; } // End of get_ring_from_sbe_image() @@ -541,7 +558,7 @@ static int get_ring_from_sgpe_image ( void* i_ringSection, // Ring section ptr uint64_t i_magic, // Image Magic Number RingID i_ringId, // Ring ID - uint16_t i_ddLevel, // DD level details + uint16_t i_ddLevelOffset, // DD level offset RingType_t& io_RingType, // Common, Instance RingVariant_t i_RingVariant, // Base,CC, RL, Ovrd, Ovly uint8_t& io_instanceId, // Instance ID @@ -554,10 +571,8 @@ int get_ring_from_sgpe_image ( void* i_ringSection, // Ring sectio uint32_t acc_offset = 0; // Accumulating offset to next TOR offset slot uint32_t ring_offset = 0; uint16_t chiplet_offset = 0; - uint32_t next_ring_offset = 0; uint32_t ringSize = 0; - int temp = (i_ddLevel >> 2) + 4; // converting byte to word counter - uint32_t* deltaRingRS4_4B; + int temp = (i_ddLevelOffset >> 2) + 4; // converting byte to word counter uint32_t spge_offset = 0; if (i_magic == P9_XIP_MAGIC_HW) @@ -568,7 +583,7 @@ int get_ring_from_sgpe_image ( void* i_ringSection, // Ring sectio else if (i_magic == P9_XIP_MAGIC_SGPE) { spge_offset = 0; - i_ddLevel = 0; + i_ddLevelOffset = 0; temp = htobe32(spge_offset); } @@ -586,7 +601,7 @@ int get_ring_from_sgpe_image ( void* i_ringSection, // Ring sectio { if (i_dbgl > 2) { - MY_INF(" Ring name %s Cplt Common ring id %d Variant id %d", + MY_INF(" Ring %s Cplt common ring id %d Variant id %d\n", (ring_id_list_common + i)->ringName, i, j); } @@ -594,22 +609,21 @@ int get_ring_from_sgpe_image ( void* i_ringSection, // Ring sectio RING_PROPERTIES[i_ringId].iv_name) == 0) && ( i_RingVariant == j )) { strcpy(o_ringName, RING_PROPERTIES[i_ringId].iv_name); - uint32_t var = 0 + i_ddLevel + temp; + uint32_t var = 0 + i_ddLevelOffset + temp; int temp1 = var / sizeof(uint32_t); ring_offset = *((uint32_t*)i_ringSection + temp1); ring_offset = htobe32(ring_offset); - var = ring_offset + i_ddLevel + temp; + var = ring_offset + i_ddLevelOffset + temp; temp1 = var / sizeof(uint16_t) + local; chiplet_offset = *((uint16_t*)i_ringSection + temp1); chiplet_offset = htobe16(chiplet_offset); if (i_RingBlockType == GET_SINGLE_RING) { - var = ring_offset + (chiplet_offset - sizeof(TorPpeBlock_t)) + i_ddLevel + temp; - temp1 = var / sizeof(uint32_t); - next_ring_offset = *((uint32_t*)i_ringSection + temp1); - next_ring_offset = htobe32(next_ring_offset); - ringSize = next_ring_offset; + var = ring_offset + chiplet_offset + i_ddLevelOffset + temp; + ringSize = htobe16( ((CompressedScanData*) + ((uint8_t*)i_ringSection + + var))->iv_size ); io_RingType = COMMON; if (chiplet_offset) @@ -633,8 +647,7 @@ int get_ring_from_sgpe_image ( void* i_ringSection, // Ring sectio if (i_dbgl > 0) { - MY_INF(" ring container of %s is found in the SGPE image container && ring offset %d \n", - o_ringName, chiplet_offset); + MY_INF(" Ring %s found in the SGPE section \n", o_ringName); } memcpy( (uint8_t*)(*io_ringBlockPtr), (uint8_t*)i_ringSection + var, @@ -645,28 +658,9 @@ int get_ring_from_sgpe_image ( void* i_ringSection, // Ring sectio if (i_dbgl > 0) { - MY_INF(" After get_ring_from_sgpe_image Size %d \n", io_ringBlockSize); - } - - if (i_dbgl > 1) - { - MY_INF("Hex details Chiplet offset 0x%08x local offset 0x%08x " \ - "ring offset 0x%08x start adr 0x%08x size 0x%08x size 0x%08x \n", - var, temp, ring_offset, chiplet_offset, next_ring_offset, ringSize); - MY_INF("Chiplet %d ChipletRing TOR offset %d %d %d Size %d %d \t\n", - i, ring_offset, chiplet_offset, next_ring_offset, ringSize, temp); - } - - if (i_dbgl > 2) - { - deltaRingRS4_4B = (uint32_t*)(*io_ringBlockPtr); - - for (uint32_t m = 0; m < ringSize / sizeof(uint32_t); m++) - { - MY_INF("compressed data %d --- %08x \t", m, htobe32(deltaRingRS4_4B[m])); - } - - MY_INF("\n"); + MY_INF(" Hex details (SGPE): Chiplet #%d offset 0x%08x local offset 0x%08x " \ + "ring offset 0x%08x start adr 0x%08x ringSize=0x%08x \n", + i, var, temp, ring_offset, chiplet_offset, ringSize); } return TOR_RING_FOUND; @@ -675,8 +669,7 @@ int get_ring_from_sgpe_image ( void* i_ringSection, // Ring sectio { if (i_dbgl > 0) { - MY_INF(" ring container of %s is not found in the SGPE image container \n", - o_ringName); + MY_INF(" Ring %s not found in the SGPE section \n", o_ringName); } return TOR_RING_NOT_FOUND; @@ -696,6 +689,11 @@ int get_ring_from_sgpe_image ( void* i_ringSection, // Ring sectio return TOR_RING_FOUND; } + else + { + MY_ERR("Ring block type (i_RingBlockType=%d) is not supported for SGPE \n", i_RingBlockType); + return TOR_INVALID_RING_BLOCK_TYPE; + } } local++; @@ -728,22 +726,21 @@ int get_ring_from_sgpe_image ( void* i_ringSection, // Ring sectio if ( i == io_instanceId && k == i_RingVariant ) { strcpy(o_ringName, RING_PROPERTIES[i_ringId].iv_name); - uint32_t var = CPLT_OFFSET_SIZE + i_ddLevel + temp; + uint32_t var = CPLT_OFFSET_SIZE + i_ddLevelOffset + temp; int temp1 = var / sizeof(uint32_t); ring_offset = *((uint32_t*)i_ringSection + temp1); ring_offset = htobe32(ring_offset); - var = ring_offset + i_ddLevel + temp; + var = ring_offset + i_ddLevelOffset + temp; temp1 = var / sizeof(uint16_t) + local; chiplet_offset = *((uint16_t*)i_ringSection + temp1); chiplet_offset = htobe16(chiplet_offset); if (i_RingBlockType == GET_SINGLE_RING) { - var = ring_offset + (chiplet_offset - sizeof(TorPpeBlock_t)) + i_ddLevel + temp; - temp1 = var / sizeof(uint32_t); - next_ring_offset = *((uint32_t*)i_ringSection + temp1); - next_ring_offset = htobe32(next_ring_offset); - ringSize = next_ring_offset; + var = ring_offset + chiplet_offset + i_ddLevelOffset + temp; + ringSize = htobe16( ((CompressedScanData*) + ((uint8_t*)i_ringSection + + var))->iv_size ); io_RingType = INSTANCE; if (chiplet_offset) @@ -781,24 +778,11 @@ int get_ring_from_sgpe_image ( void* i_ringSection, // Ring sectio MY_INF(" After get_ring_from_sgpe_image Size %d \n", io_ringBlockSize); } - if (i_dbgl > 1) - { - MY_INF(" 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x \n", - var, temp, ring_offset, chiplet_offset, next_ring_offset, ringSize); - MY_INF("Chiplet %d ChipletRing TOR offset %d %d %d Size %d %d \t\n", - i, ring_offset, chiplet_offset, next_ring_offset, ringSize, temp); - } - - if (i_dbgl > 2) + if (i_dbgl > 0) { - deltaRingRS4_4B = (uint32_t*)(*io_ringBlockPtr); - - for (uint32_t m = 0; m < ringSize / sizeof(uint32_t); m++) - { - MY_INF("compressed data %d --- %08x \t", m, htobe32(deltaRingRS4_4B[m])); - } - - MY_INF("\n"); + MY_INF(" Hex details (SGPE): Chiplet #%d offset 0x%08x local offset 0x%08x " \ + "ring offset 0x%08x start adr 0x%08x ringSize=0x%08x \n", + i, var, temp, ring_offset, chiplet_offset, ringSize); } return TOR_RING_FOUND; @@ -828,6 +812,11 @@ int get_ring_from_sgpe_image ( void* i_ringSection, // Ring sectio return TOR_RING_FOUND; } + else + { + MY_ERR("Ring block type (i_RingBlockType=%d) is not supported for SGPE \n", i_RingBlockType); + return TOR_INVALID_RING_BLOCK_TYPE; + } } } else @@ -859,7 +848,7 @@ static int get_ring_from_cme_image ( void* i_ringSection, // Ring section ptr uint64_t i_magic, // Image Magic Number RingID i_ringId, // Ring ID - uint16_t i_ddLevel, // DD level + uint16_t i_ddLevelOffset, // DD level offset RingType_t& io_RingType, // Common, Instance RingVariant_t i_RingVariant, // Base,CC, RL, Ovrd, Ovly uint8_t& io_instanceId, // instance ID @@ -872,10 +861,8 @@ int get_ring_from_cme_image ( void* i_ringSection, // Ring section uint32_t acc_offset = 0; // Accumulating offset to next TOR offset slot uint32_t ring_offset = 0; uint16_t chiplet_offset = 0; - uint32_t next_ring_offset = 0; uint32_t ringSize = 0; - int temp = (i_ddLevel >> 2) + 2; // converting byte to word counter - uint32_t* deltaRingRS4_4B; + int temp = (i_ddLevelOffset >> 2) + 2; // converting byte to word counter uint32_t cme_offset = 0; if (i_magic == P9_XIP_MAGIC_HW) @@ -886,7 +873,7 @@ int get_ring_from_cme_image ( void* i_ringSection, // Ring section else if (i_magic == P9_XIP_MAGIC_CME) { cme_offset = 0; - i_ddLevel = 0; + i_ddLevelOffset = 0; temp = htobe32(cme_offset); } @@ -904,7 +891,7 @@ int get_ring_from_cme_image ( void* i_ringSection, // Ring section { if (i_dbgl > 2) { - MY_INF(" Ring name %s Cplt Common ring id %d Variant id %d", + MY_INF(" Ring %s Cplt common ring id %d Variant id %d\n", (ring_id_list_common + i)->ringName, i, j); } @@ -912,22 +899,21 @@ int get_ring_from_cme_image ( void* i_ringSection, // Ring section RING_PROPERTIES[i_ringId].iv_name) == 0) && ( i_RingVariant == j )) { strcpy(o_ringName, RING_PROPERTIES[i_ringId].iv_name); - uint32_t var = 0 + i_ddLevel + temp; + uint32_t var = 0 + i_ddLevelOffset + temp; int temp1 = var / sizeof(uint32_t); ring_offset = *((uint32_t*)i_ringSection + temp1); ring_offset = htobe32(ring_offset); - var = ring_offset + i_ddLevel + temp; + var = ring_offset + i_ddLevelOffset + temp; temp1 = var / sizeof(uint16_t) + local; chiplet_offset = *((uint16_t*)i_ringSection + temp1); chiplet_offset = htobe16(chiplet_offset); if (i_RingBlockType == GET_SINGLE_RING) { - var = ring_offset + (chiplet_offset - sizeof(TorPpeBlock_t)) + i_ddLevel + temp; - temp1 = var / sizeof(uint32_t); - next_ring_offset = *((uint32_t*)i_ringSection + temp1); - next_ring_offset = htobe32(next_ring_offset); - ringSize = next_ring_offset; + var = ring_offset + chiplet_offset + i_ddLevelOffset + temp; + ringSize = htobe16( ((CompressedScanData*) + ((uint8_t*)i_ringSection + + var))->iv_size ); io_RingType = COMMON; if (chiplet_offset) @@ -951,8 +937,7 @@ int get_ring_from_cme_image ( void* i_ringSection, // Ring section if (i_dbgl > 0) { - MY_INF(" ring container of %s is found in the CME image container \n", - o_ringName); + MY_INF(" Ring %s found in the CME section \n", o_ringName); } memcpy( (uint8_t*)(*io_ringBlockPtr), (uint8_t*)i_ringSection + var, @@ -963,28 +948,9 @@ int get_ring_from_cme_image ( void* i_ringSection, // Ring section if (i_dbgl > 0) { - MY_INF(" After get_ring_from_cme_image Size %d \n", io_ringBlockSize); - } - - if (i_dbgl > 1) - { - MY_INF("Hex details Chiplet offset 0x%08x local offset 0x%08x " \ - "ring offset 0x%08x start adr 0x%08x size 0x%08x size 0x%08x \n", - var, temp, ring_offset, chiplet_offset, next_ring_offset, ringSize); - MY_INF("Chiplet %d ChipletRing TOR offset %d %d %d Size %d %d \t\n", - i, ring_offset, chiplet_offset, next_ring_offset, ringSize, temp); - } - - if (i_dbgl > 2) - { - deltaRingRS4_4B = (uint32_t*)(*io_ringBlockPtr); - - for (uint32_t m = 0; m < ringSize / sizeof(uint32_t); m++) - { - MY_INF("compressed data %d --- %08x \t", m, htobe32(deltaRingRS4_4B[m])); - } - - MY_INF("\n"); + MY_INF(" Hex details (CME): Chiplet #%d offset 0x%08x local offset 0x%08x " \ + "ring offset 0x%08x start adr 0x%08x ringSize=0x%08x \n", + i, var, temp, ring_offset, chiplet_offset, ringSize); } return TOR_RING_FOUND; @@ -993,8 +959,7 @@ int get_ring_from_cme_image ( void* i_ringSection, // Ring section { if (i_dbgl > 0) { - MY_INF(" ring container of %s is not found in the CME image container \n", - o_ringName); + MY_INF(" Ring %s not found in the CME section \n", o_ringName); } return TOR_RING_NOT_FOUND; @@ -1014,6 +979,11 @@ int get_ring_from_cme_image ( void* i_ringSection, // Ring section return TOR_RING_FOUND; } + else + { + MY_ERR("Ring block type (i_RingBlockType=%d) is not supported for CME \n", i_RingBlockType); + return TOR_INVALID_RING_BLOCK_TYPE; + } } local++; @@ -1049,22 +1019,21 @@ int get_ring_from_cme_image ( void* i_ringSection, // Ring section if ( i == io_instanceId && k == i_RingVariant ) { strcpy(o_ringName, RING_PROPERTIES[i_ringId].iv_name); - uint32_t var = z * CPLT_OFFSET_SIZE + i_ddLevel + temp + CPLT_OFFSET_SIZE; + uint32_t var = z * CPLT_OFFSET_SIZE + i_ddLevelOffset + temp + CPLT_OFFSET_SIZE; int temp1 = var / CPLT_OFFSET_SIZE; ring_offset = *((uint32_t*)i_ringSection + temp1); ring_offset = htobe32(ring_offset); - var = ring_offset + i_ddLevel + temp; + var = ring_offset + i_ddLevelOffset + temp; temp1 = var / sizeof(uint16_t) + local; chiplet_offset = *((uint16_t*)i_ringSection + temp1); chiplet_offset = htobe16(chiplet_offset); if (i_RingBlockType == GET_SINGLE_RING) { - var = ring_offset + (chiplet_offset - sizeof(TorPpeBlock_t)) + i_ddLevel + temp; - temp1 = var / sizeof(uint32_t); - next_ring_offset = *((uint32_t*)i_ringSection + temp1); - next_ring_offset = htobe32(next_ring_offset); - ringSize = next_ring_offset; + var = ring_offset + chiplet_offset + i_ddLevelOffset + temp; + ringSize = htobe16( ((CompressedScanData*) + ((uint8_t*)i_ringSection + + var))->iv_size ); io_RingType = INSTANCE; if (chiplet_offset) @@ -1088,10 +1057,9 @@ int get_ring_from_cme_image ( void* i_ringSection, // Ring section if (i_dbgl > 0) { - MY_INF(" ring container of %s is found in the CME image container %d %d \n", - o_ringName, chiplet_offset, ringSize); - MY_INF(" 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x \n", - var, temp, ring_offset, chiplet_offset, next_ring_offset, ringSize); + MY_INF(" Hex details (CME): Chiplet #%d offset 0x%08x local offset 0x%08x " \ + "ring offset 0x%08x start adr 0x%08x ringSize=0x%08x \n", + i, var, temp, ring_offset, chiplet_offset, ringSize); } memcpy( (uint8_t*)(*io_ringBlockPtr), (uint8_t*)i_ringSection + var, @@ -1106,22 +1074,10 @@ int get_ring_from_cme_image ( void* i_ringSection, // Ring section if (i_dbgl > 1) { - MY_INF(" 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x \n", - var, temp, ring_offset, chiplet_offset, next_ring_offset, ringSize); - MY_INF("Chiplet %d ChipletRing TOR offset %d %d %d Size %d %d \t\n", - i, ring_offset, chiplet_offset, next_ring_offset, ringSize, temp); - } - - if (i_dbgl > 2) - { - deltaRingRS4_4B = (uint32_t*)(*io_ringBlockPtr); - - for (uint32_t m = 0; m < ringSize / sizeof(uint32_t); m++) - { - MY_INF("compressed data %d --- %08x \t", m, htobe32(deltaRingRS4_4B[m])); - } - - MY_INF("\n"); + MY_INF(" 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x \n", + var, temp, ring_offset, chiplet_offset, ringSize); + MY_INF("Chiplet %d ChipletRing TOR offset %d %d Size %d %d \t\n", + i, ring_offset, chiplet_offset, ringSize, temp); } return TOR_RING_FOUND; @@ -1151,6 +1107,11 @@ int get_ring_from_cme_image ( void* i_ringSection, // Ring section return TOR_RING_FOUND; } + else + { + MY_ERR("Ring block type (i_RingBlockType=%d) is not supported for CME \n", i_RingBlockType); + return TOR_INVALID_RING_BLOCK_TYPE; + } } } else @@ -1236,7 +1197,7 @@ int tor_access_ring( void* i_ringSection, // Ring section ptr if (i_dbgl > 1) { - MY_INF( "tor_access_ring(): DD level offset: 0x%08x DD level: 0x%x \n", + MY_INF( "tor_access_ring(): Local DD level offset: 0x%08x for DD level: 0x%x \n", ddLevelOffset, ddLevel ); } @@ -1915,41 +1876,11 @@ int tor_access_ring( void* i_ringSection, // Ring section ptr o_ringName, i_dbgl); - if (rc == TOR_RING_NOT_FOUND) - { - if (i_dbgl > 0) - { - MY_INF("\t After SBE single ring call, %s ring container is not found \n", - RING_PROPERTIES[i_ringId].iv_name); - } - - return rc; - } - else if (rc == TOR_INVALID_INSTANCE_ID) - { - if (i_dbgl > 0) - { - MY_INF("\t After SBE single ring call, Instance %d is invalid \n", - io_instanceId ); - } - - return rc; - } - else if (rc == TOR_RING_AVAILABLE_IN_RINGSECTION) - { - if (i_dbgl > 0) - { - MY_INF("\t After SBE single ring call, Ring container is available in the image \n"); - } - - return rc; - } - else if (rc == TOR_INVALID_RING_ID) + if (rc) { if (i_dbgl > 0) { - MY_INF("\t After SBE single ring call, There is no TOR slot for %s %d\n", - RING_PROPERTIES[i_ringId].iv_name, i_ringId); + MY_ERR("get_ring_from_sbe_image failed w/rc=%d\n", rc); } return rc; @@ -2271,7 +2202,8 @@ int tor_get_block_of_rings ( void* i_ringSection, // Ring section // /////////////////////////////////////////////////////////////////////////////////////// int tor_append_ring( void* i_ringSection, // Ring section ptr - uint32_t& io_ringSectionSize, // Max size of ring section buffer + uint32_t& io_ringSectionSize, // In: Exact size of ring section. + // Out: Updated size of ring section. void* i_ringBuffer, // Ring work buffer const uint32_t i_ringBufferSize, // Max size of ring work buffer RingID i_ringId, // Ring ID @@ -2284,12 +2216,12 @@ int tor_append_ring( void* i_ringSection, // Ring section ptr { uint32_t rc = 0; char i_ringName[25]; - uint32_t l_ringTypeBuf = 0; - uint32_t* l_ringTypeStart = &l_ringTypeBuf; + uint32_t l_buf = 0; + uint32_t* l_cpltSection = &l_buf; uint8_t l_instanceId = i_instanceId; RingType_t l_RingType = i_RingType; uint32_t l_ringBlockSize; - uint16_t l_ringOffsetAddr16; + uint16_t l_ringOffset16; uint64_t l_magic; uint32_t l_torOffsetSlot; @@ -2297,17 +2229,17 @@ int tor_append_ring( void* i_ringSection, // Ring section ptr { l_magic = P9_XIP_MAGIC_SEEPROM; } - else if (i_PpeType == CME ) // Assign i_magic variant as CME image + else if (i_PpeType == CME) // Assign i_magic variant as CME image { l_magic = P9_XIP_MAGIC_CME; } - else if (i_PpeType == SGPE ) // Assign i_magic variant as SGPE image + else if (i_PpeType == SGPE) // Assign i_magic variant as SGPE image { l_magic = P9_XIP_MAGIC_SGPE; } else { - MY_ERR("TOR_APPEND_RING(2): i_PpeType=%d is an unsupported PPE type\n", i_PpeType); + MY_ERR("PPE type (i_PpeType=%d) is not supported \n", i_PpeType); return TOR_AMBIGUOUS_API_PARMS; } @@ -2320,42 +2252,51 @@ int tor_append_ring( void* i_ringSection, // Ring section ptr i_RingVariant, l_instanceId, PUT_SINGLE_RING, - (void**)&l_ringTypeStart, // On return, contains absolute offset addr where RingType starts in TOR - l_torOffsetSlot, // On return, contains absolute offset addr where TOR offset slot is located + (void**)&l_cpltSection, // On return, contains offset (wrt ringSection) of + // chiplet section's common or instance section + l_torOffsetSlot, // On return, contains offset (wrt ringSection) of + // TOR offset slot i_ringName, i_dbgl); if (rc) { - MY_ERR("\tTOR_APPEND_RING(3): Failure on tor_access_ring function call ...\n"); + MY_ERR("tor_access_ring() failed w/rc=0x%x \n", rc); return rc; } if (i_dbgl > 1) { - MY_INF(" TOR_APPEND_RING(4): Ring offset address %d \n", - l_torOffsetSlot ); + MY_INF(" TOR offset slot for ring address %d \n", l_torOffsetSlot ); } - // Current ring offset address contains old rs4 image starting address. - // When tor_append_ring gets new RS4 ring data. It is appended at end of the - // .rings section and new ring pointer location is updated at ring offset address - l_ringOffsetAddr16 = (uint16_t)(*l_ringTypeStart); - l_ringOffsetAddr16 = io_ringSectionSize - l_ringOffsetAddr16; - l_ringOffsetAddr16 = htobe16(l_ringOffsetAddr16 + sizeof(RingLayout_t)); - memcpy( (uint8_t*)i_ringSection + l_torOffsetSlot, &l_ringOffsetAddr16, - sizeof(l_ringOffsetAddr16)); - - // Attaching RS4 image at end of the ring section - // reading first 4 byte of rs4_container which carries size of ring container - // memcpy appends rs4_container at end of the .rings section. - l_ringBlockSize = ((RingLayout_t*)i_rs4Container)->sizeOfThis; - l_ringBlockSize = htobe32(l_ringBlockSize); - memcpy( (uint8_t*)i_ringSection + io_ringSectionSize, (uint8_t*)i_rs4Container, - (size_t)l_ringBlockSize); + // Explanation to the following: + // tor_append_ring() appends a ring to the end of ringSection. The offset value to + // that ring is wrt the beginning of the chiplet's TOR section. Below we calculate + // the offset value and put it into the TOR slot. But first, check that the offset + // value can be contained within the 2B of the TOR slot. + if ( (io_ringSectionSize - *l_cpltSection) <= MAX_TOR_RING_OFFSET ) + { + l_ringOffset16 = htobe16(io_ringSectionSize - *l_cpltSection); + memcpy( (uint8_t*)i_ringSection + l_torOffsetSlot, + &l_ringOffset16, sizeof(l_ringOffset16) ); + } + else + { + MY_ERR("Code bug: TOR ring offset (=0x%x) exceeds MAX_TOR_RING_OFFSET (=0x%x)", + io_ringSectionSize - *l_cpltSection, MAX_TOR_RING_OFFSET); + return TOR_OFFSET_TOO_BIG; + } + + // Now append the ring to the end of ringSection. + l_ringBlockSize = htobe16( ((CompressedScanData*)i_rs4Container)->iv_size ); + memcpy( (uint8_t*)i_ringSection + io_ringSectionSize, + (uint8_t*)i_rs4Container, (size_t)l_ringBlockSize); + + // Update the ringSectionSize io_ringSectionSize += l_ringBlockSize; - return TOR_APPEND_RING_DONE; + return TOR_SUCCESS; } diff --git a/src/import/chips/p9/utils/imageProcs/p9_tor.H b/src/import/chips/p9/utils/imageProcs/p9_tor.H index e9e38fb4..1ce024ad 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_tor.H +++ b/src/import/chips/p9/utils/imageProcs/p9_tor.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -28,20 +28,15 @@ #include "p9_ring_id.h" #include "p9_ringId.H" +#define MAX_TOR_RING_OFFSET (256*256-1) // Max value of 2Byte uint + namespace P9_TOR { extern const char* ppeTypeName[]; extern const char* ringVariantName[]; -#define TOR_VERSION 1 - -typedef struct -{ - uint32_t sizeOfThis; - uint16_t sizeOfCmsk; - uint16_t sizeOfMeta; // Exact size of meta data. Arbitrary size. Not null terminated -} RingLayout_t; +#define TOR_VERSION 2 typedef struct { @@ -63,26 +58,28 @@ typedef struct typedef uint16_t TorRingOffset_t; // Ring offset value in TOR offset slot +#define TOR_SUCCESS 0 #define TOR_RING_FOUND 0 #define TOR_RING_BLOCKS_FOUND 0 -#define TOR_APPEND_RING_DONE 0 #define TOR_RING_NOT_FOUND 1 -#define TOR_INVALID_RING_ID 2 -#define TOR_AMBIGUOUS_API_PARMS 3 -#define TOR_SECTION_NOT_FOUND 4 -#define TOR_DD_LEVEL_NOT_FOUND 5 -#define TOR_OP_BUFFER_INVALID 6 -#define TOR_OP_BUFFER_SIZE_EXCEEDED 7 +#define TOR_AMBIGUOUS_API_PARMS 2 +#define TOR_SECTION_NOT_FOUND 3 +#define TOR_DD_LEVEL_NOT_FOUND 4 +#define TOR_OP_BUFFER_INVALID 5 +#define TOR_OP_BUFFER_SIZE_EXCEEDED 6 +#define TOR_INVALID_RING_ID 7 #define TOR_INVALID_INSTANCE_ID 8 #define TOR_INVALID_CHIPLET 9 -#define TOR_IMAGE_DOES_NOT_SUPPORT_CME 10 -#define TOR_IMAGE_DOES_NOT_SUPPORT_SGPE 11 -#define TOR_IMAGE_DOES_NOT_SUPPORT_DD_LEVEL 12 -#define TOR_IMAGE_DOES_NOT_SUPPORT_PPE_LEVEL 13 -#define TOR_RING_AVAILABLE_IN_RINGSECTION 14 // Ring is already present -#define TOR_BUFFER_TOO_SMALL 15 -#define TOR_TOO_MANY_DD_LEVELS 16 - +#define TOR_INVALID_RING_BLOCK_TYPE 10 +#define TOR_INVALID_MAGIC_NUMBER 11 +#define TOR_IMAGE_DOES_NOT_SUPPORT_CME 12 +#define TOR_IMAGE_DOES_NOT_SUPPORT_SGPE 13 +#define TOR_IMAGE_DOES_NOT_SUPPORT_DD_LEVEL 14 +#define TOR_IMAGE_DOES_NOT_SUPPORT_PPE_LEVEL 15 +#define TOR_RING_AVAILABLE_IN_RINGSECTION 16 // Ring is already present +#define TOR_BUFFER_TOO_SMALL 17 +#define TOR_TOO_MANY_DD_LEVELS 18 +#define TOR_OFFSET_TOO_BIG 19 // Different options to extract data using tor_access_ring API typedef enum RingBlockType @@ -387,8 +384,8 @@ int tor_get_block_of_rings ( void* i_ringSection, /// It contains details of p9 Ring which is used for scanning operation. /// TOR API supports SEEPROM image format. /// -/// \param[in/out] io_ringSectionSize A value to indicate actual size of -/// i_ringSection data passed in as input On return, updated size of section. +/// \param[in/out] io_ringSectionSize In: Exact size of i_ringSection. +/// Out: Updated size of i_ringSection. /// Note: Caller manages this buffer and must make sure the RS4 ring fits /// before making this call /// diff --git a/src/import/chips/p9/utils/p9_putRingUtils.C b/src/import/chips/p9/utils/p9_putRingUtils.C index d150f478..14d077cc 100644 --- a/src/import/chips/p9/utils/p9_putRingUtils.C +++ b/src/import/chips/p9/utils/p9_putRingUtils.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -140,25 +140,21 @@ uint64_t stop_decode(const uint8_t* i_rs4Str, return l_numNibblesParsed; } -/// @brief Byte-reverse a 64-bit integer -/// @param[in] i_x 64-bit word that need to be byte reversed -/// @return Byte reversed 64-bit word -uint64_t rs4_revle64(const uint64_t i_x) +/// @brief Byte-reverse a 32-bit integer +/// @param[in] i_x 32-bit word that need to be byte reversed +/// @return Byte reversed 32-bit word +uint32_t rs4_revle32(const uint32_t i_x) { - uint64_t rx; + uint32_t rx; #ifndef _BIG_ENDIAN uint8_t* pix = (uint8_t*)(&i_x); uint8_t* prx = (uint8_t*)(&rx); - prx[0] = pix[7]; - prx[1] = pix[6]; - prx[2] = pix[5]; - prx[3] = pix[4]; - prx[4] = pix[3]; - prx[5] = pix[2]; - prx[6] = pix[1]; - prx[7] = pix[0]; + prx[0] = pix[3]; + prx[1] = pix[2]; + prx[2] = pix[1]; + prx[3] = pix[0]; #else rx = i_x; #endif @@ -196,6 +192,25 @@ void getRingProperties(const RingID i_ringId, } while(0); } + +uint64_t decodeScanRegionData(const uint32_t i_ringAddress) +{ + uint32_t l_scan_region = (i_ringAddress & 0x0000FFF0) << 13; + + uint32_t l_scan_type = 0x00008000 >> (i_ringAddress & 0x0000000F); + + // This is special case if encoded type is 0xF + if ( (i_ringAddress & 0x0000000F) == 0xF) + { + l_scan_type = 0x00008000 | (l_scan_type << 12); + } + + uint64_t l_value = l_scan_region; + l_value = (l_value << 32) | l_scan_type; + + return l_value; +} + /// @brief Function to apply the Ring data using the standard-scan method /// @param[in] i_target Chiplet Target of Scan // @param[in] i_chipletId data from RS4 @@ -1096,6 +1111,9 @@ fapi2::ReturnCode rs4DecompressionSvc( uint64_t l_nibbleIndx = 0; uint64_t l_bitsDecoded = 0; bool l_decompressionDone = false; + uint32_t l_scanAddr = rs4_revle32(l_rs4Header->iv_scanAddr); + uint64_t l_scanRegion = decodeScanRegionData(l_scanAddr); + uint8_t l_chipletId = (l_scanAddr & 0xFF000000UL) >> 24; fapi2::ReturnCode l_rc; struct restoreOpcgRegisters l_opcgData; uint8_t l_mask = 0x08; @@ -1103,16 +1121,6 @@ fapi2::ReturnCode rs4DecompressionSvc( do { - if ( (l_rs4Header == NULL) || (l_rs4Header->iv_length == 0)) - { - l_rc = fapi2::FAPI2_RC_PLAT_RS4_HEADER_DATA_INVALID; - FAPI_ERR("Invalid ring length in RS4 image"); - break; - } - - uint64_t l_scanRegion = rs4_revle64(l_rs4Header->iv_scanSelect); - uint8_t l_chipletId = l_rs4Header->iv_chipletId; - if ((i_ringMode & fapi2::RING_MODE_SET_PULSE_NSL) || (i_ringMode & fapi2::RING_MODE_SET_PULSE_SL) || (i_ringMode & fapi2::RING_MODE_SET_PULSE_ALL)) @@ -1152,15 +1160,6 @@ fapi2::ReturnCode rs4DecompressionSvc( break; } - //if the ring length is not 8bit aligned, then we need to skip the - //padding bits - uint8_t l_padding_bits = 0; - - if (l_rs4Header->iv_length % 4) - { - l_padding_bits = (4 - (l_rs4Header->iv_length % 4)); - } - bool l_skip_64bits = true; // Decompress the RS4 string and scan @@ -1185,16 +1184,6 @@ fapi2::ReturnCode rs4DecompressionSvc( l_bitsDecoded += l_bitRotates; - if(l_bitsDecoded > l_rs4Header->iv_length) - { - FAPI_ERR("Rotate decompression done." - "l_bitsDecoded = %d, length = %d", - l_bitsDecoded, l_rs4Header->iv_length); - l_decompressionDone = true; - l_rc = fapi2::FAPI2_RC_PLAT_RING_DECODE_LENGTH_EXCEEDED; - break; - } - // Do the ROTATE operation if (l_bitRotates != 0) { @@ -1226,16 +1215,6 @@ fapi2::ReturnCode rs4DecompressionSvc( { l_bitsDecoded += (4 * l_scanCount); - if(l_bitsDecoded > l_rs4Header->iv_length) - { - FAPI_ERR("Scan decompression done." - "l_bitsDecoded = %d, length = %d", - l_bitsDecoded, l_rs4Header->iv_length); - l_decompressionDone = true; - l_rc = fapi2::FAPI2_RC_PLAT_RING_DECODE_LENGTH_EXCEEDED; - break; - } - // Parse the non-zero nibbles of the RS4 string and // scan them into the ring l_scomData = rs4_get_verbatim(l_rs4Str, @@ -1365,107 +1344,94 @@ fapi2::ReturnCode rs4DecompressionSvc( if (l_nibble != 0) { - // Parse the non-zero nibbles of the RS4 string and - // scan them into the ring - if((l_bitsDecoded + l_nibble) > l_rs4Header->iv_length) + if (!i_applyOverride) { - FAPI_ERR("Decompression Done." - "l_bitsDecoded = %d, l_nibble= %d, length = %d", - l_bitsDecoded, l_nibble, l_rs4Header->iv_length); - l_rc = fapi2::FAPI2_RC_PLAT_RING_DECODE_LENGTH_EXCEEDED; - break; + l_bitsDecoded += l_nibble; + l_scomData = rs4_get_verbatim(l_rs4Str, + l_nibbleIndx, + 1); // return 1 nibble + + l_rc = standardScan(i_target, + l_chipletId, + SCAN, + l_nibble & 0x3, + l_scomData); } else { - if (!i_applyOverride) + if(0x8 & l_nibble) // We are parsing RS4 for override rings { - l_bitsDecoded += l_nibble; - l_scomData = rs4_get_verbatim(l_rs4Str, - l_nibbleIndx, - 1); // return 1 nibble + uint8_t l_careMask = rs4_get_nibble(l_rs4Str, l_nibbleIndx); + l_nibbleIndx++; + uint8_t l_spyData = rs4_get_nibble(l_rs4Str, l_nibbleIndx); + l_nibbleIndx++; - l_rc = standardScan(i_target, - l_chipletId, - SCAN, - (4 - l_padding_bits) , // scan 4 bits - l_scomData); - } - else - { - if(0x8 & l_nibble) // We are parsing RS4 for override rings + for(uint8_t i = 0; i < 4; i++) { - uint8_t l_careMask = rs4_get_nibble(l_rs4Str, l_nibbleIndx); - l_nibbleIndx++; - uint8_t l_spyData = rs4_get_nibble(l_rs4Str, l_nibbleIndx); - l_nibbleIndx++; + l_bitsDecoded += 1; + l_scomData = 0x0; - for(uint8_t i = 0; i < 4; i++) + if((l_careMask & (l_mask >> i))) { - l_bitsDecoded += 1; - l_scomData = 0x0; - - if((l_careMask & (l_mask >> i))) + if((l_spyData & (l_mask >> i))) { - if((l_spyData & (l_mask >> i))) - { - l_scomData = 0xFFFFFFFFFFFFFFFF; - } - - l_opType = SCAN; - } - else - { - l_opType = ROTATE; + l_scomData = 0xFFFFFFFFFFFFFFFF; } - l_rc = standardScan(i_target, - l_chipletId, - l_opType, - 1, // Insert 1 bit - l_scomData); - - if(l_rc != fapi2::FAPI2_RC_SUCCESS) - { - break; - } - } // end of looper for bit-parsing a non-zero nibble - } - else // We are parsing RS4 for base rings - { - // scan them into the ring - uint8_t l_data = rs4_get_nibble(l_rs4Str, l_nibbleIndx); + l_opType = SCAN; + } + else + { + l_opType = ROTATE; + } - l_nibbleIndx += 1; + l_rc = standardScan(i_target, + l_chipletId, + l_opType, + 1, // Insert 1 bit + l_scomData); - for(uint8_t i = 0; i < l_nibble; i++) + if(l_rc != fapi2::FAPI2_RC_SUCCESS) { - l_scomData = 0x0; - l_bitsDecoded += 1; + break; + } + } // end of looper for bit-parsing a non-zero nibble + } + else // We are parsing RS4 for base rings + { + // scan them into the ring + uint8_t l_data = rs4_get_nibble(l_rs4Str, l_nibbleIndx); - if((l_data & (l_mask >> i))) - { - l_opType = SCAN; - l_scomData = 0xFFFFFFFFFFFFFFFF; + l_nibbleIndx += 1; - } - else - { - l_opType = ROTATE; + for(uint8_t i = 0; i < l_nibble; i++) + { + l_scomData = 0x0; + l_bitsDecoded += 1; - } + if((l_data & (l_mask >> i))) + { + l_opType = SCAN; + l_scomData = 0xFFFFFFFFFFFFFFFF; - l_rc = standardScan(i_target, - l_chipletId, - l_opType, - 1, // Insert 1 bit - l_scomData); + } + else + { + l_opType = ROTATE; - if(l_rc != fapi2::FAPI2_RC_SUCCESS) - { - break; - } - } //end of for - } + } + + l_rc = standardScan(i_target, + l_chipletId, + l_opType, + 1, // Insert 1 bit + l_scomData); + + if(l_rc != fapi2::FAPI2_RC_SUCCESS) + { + break; + } + } //end of for } } } // end of if(l_nibble != 0) diff --git a/src/import/chips/p9/utils/p9_putRingUtils.H b/src/import/chips/p9/utils/p9_putRingUtils.H index 54e2121e..94d211ad 100644 --- a/src/import/chips/p9/utils/p9_putRingUtils.H +++ b/src/import/chips/p9/utils/p9_putRingUtils.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -45,11 +45,6 @@ namespace RS4 // Forward Declarations // -/// @brief Byte-reverse a 64-bit integer -/// @param[in] i_x 64-bit word that need to be byte reversed -/// @return Byte reversed 64-bit word -uint64_t rs4_revle64(const uint64_t i_x); - /// /// @brief Decode an unsigned integer from a 4-bit octal stop code. /// @param[in] i_rs4Str The RS4 scan string diff --git a/src/import/chips/p9/xip/p9_xip_tool.C b/src/import/chips/p9/xip/p9_xip_tool.C index 50200153..27150f55 100644 --- a/src/import/chips/p9/xip/p9_xip_tool.C +++ b/src/import/chips/p9/xip/p9_xip_tool.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -50,6 +50,7 @@ using namespace P9_TOR; #endif + #define LINE_SIZE_MAX 1024 // Max size of a single snprintf dump. #define RING_BUF_SIZE_MAX 1000000 @@ -1752,9 +1753,6 @@ int dissectRingSectionTor( void* i_ringSection, void* ringBlockPtr; uint32_t ringBlockSize; char ringName[32]; - void* hostRs4Container; - uint32_t compressedBits = 0, ringLength = 0; - double compressionPct = 0; uint32_t ringSeqNo = 0; // Ring sequence number // @@ -1865,13 +1863,15 @@ int dissectRingSectionTor( void* i_ringSection, // if (rc == TOR_RING_FOUND) { + uint32_t l_ringSize = htobe16(((CompressedScanData*)ringBlockPtr)->iv_size); // Check ring block size. - if ( htobe32(((RingLayout_t*)ringBlockPtr)->sizeOfThis) != ringBlockSize ) + if ( l_ringSize != ringBlockSize || l_ringSize == 0 ) { fprintf(stderr, "tor_access_ring() was successful and found a ring but " - "sizeOfThis(=0x%08x) != ringBlockSize(=0x%08x) is a bug.\n", - htobe32(((RingLayout_t*)ringBlockPtr)->sizeOfThis), ringBlockSize); + "RS4 header's iv_size(=0x%08x) is either zero or doesn't match " + "size of ring buffer (ringBlockSize=0x%08x).\n", + l_ringSize, ringBlockSize); exit(1); } @@ -1910,12 +1910,6 @@ int dissectRingSectionTor( void* i_ringSection, // Summarize all characteristics of the ring block if "normal" or "long" (default). if ( i_listingModeId == LMID_NORMAL || i_listingModeId == LMID_LONG ) { - // Calculate RS4 compression efficiency. - hostRs4Container = (void*)( (uintptr_t)ringBlockPtr + sizeof(RingLayout_t) ); - compressedBits = htobe32(((CompressedScanData*)hostRs4Container)->iv_algorithmReserved) * 4; - ringLength = htobe32(((CompressedScanData*)hostRs4Container)->iv_length); - compressionPct = (double)compressedBits / (double)ringLength * 100.0; - sizeDisLine = snprintf( lineDis, LINE_SIZE_MAX, "-----------------------------\n" "%i.\n" @@ -1925,13 +1919,10 @@ int dissectRingSectionTor( void* i_ringSection, "ringName = %s\n" "ringVariant = %s\n" "instanceId = 0x%02x\n" - "ringBlockSize = 0x%08x\n" - "RS4 ring size [bits] = %u\n" - "Raw ring size [bits] = %u\n" - "Compression [%%] = %0.2f\n", + "ringBlockSize = 0x%08x\n", ringSeqNo, ddLevel, ppeTypeName[ppeType], ringId, ringName, ringVariantName[ringVariant], instanceId, - ringBlockSize, compressedBits, ringLength, compressionPct ); + ringBlockSize); if (sizeDisLine >= LINE_SIZE_MAX) { diff --git a/src/import/tools/imageProcs/p9_ipl_build.C b/src/import/tools/imageProcs/p9_ipl_build.C index 495d17ce..71babfad 100644 --- a/src/import/tools/imageProcs/p9_ipl_build.C +++ b/src/import/tools/imageProcs/p9_ipl_build.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -310,7 +310,8 @@ int ipl_build( char* i_fnSbeImage, if(rc == IMGBUILD_SUCCESS) { // update our SBE image size to include the new block of rings - sbeImageSize += l_blockSize; + // and make sure it's 8 byte aligned + sbeImageSize += ((l_blockSize + 7) / 8) * 8; // grow our workspace void* tmp = realloc(sbeImage, sbeImageSize); |