Skip to content

Commit

Permalink
apply rings from Centaur HW image
Browse files Browse the repository at this point in the history
  cen_ringId.CH
  cen_ring_id.h
     add entries to hold multiple PLL rings, 8 in total

  cen_initf.C
  cen_pll_initf.C
  cen_pll_initf_errors.xml
    replace invocation of generated initfile HWP with putRing API calls
    (rings to be scanned gleamed from p8 cen assembly source)

    select correct PLL ring image based on NEST,MEM frequency

  cen_bucketX.txt
    define frequency points for each PLL bucket
    1 = 2000 MHz NEST, 1066 MHz MEM
    2 = 2000 MHz NEST, 1333 MHz MEM
    3 = 2000 MHz NEST, 1600 MHz MEM
    4 = 2000 MHz NEST, 1866 MHz MEM
    5 = 2400 MHz NEST, 1066 MHz MEM
    6 = 2400 MHz NEST, 1333 MHz MEM
    7 = 2400 MHz NEST, 1600 MHz MEM
    8 = 2400 MHz NEST, 1866 MHz MEM

  ipl_base.txt
  ipl_risk.txt
    remove frequency attributes from base attribute files

  scan_procedures.mk
    add rules to generate PLL buckets

Change-Id: I8aee5e82337800ea9afe9a9af12d8d34f6e1e01e
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/50475
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Reviewed-by: Richard J. Knight <rjknight@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/50479
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
jjmcgill authored and dcrowell77 committed Dec 20, 2017
1 parent 93c73a3 commit f7fb6d7
Show file tree
Hide file tree
Showing 15 changed files with 247 additions and 227 deletions.
83 changes: 29 additions & 54 deletions src/import/chips/centaur/procedures/hwp/perv/cen_initf.C
Expand Up @@ -44,13 +44,7 @@
#include <cen_gen_scom_addresses.H>
#include <cen_gen_scom_addresses_fixes.H>
#include <centaur_misc_constants.H>

#ifndef __HOSTBOOT_MODULE
#include <centaur_mbs_scan.H>
#include <centaur_mba_scan.H>
#include <centaur_dmi_scan.H>
#include <centaur_thermal_scan.H>
#endif
#include <cen_ring_id.h>

//------------------------------------------------------------------------------
// Function definitions
Expand All @@ -60,55 +54,36 @@ fapi2::ReturnCode
cen_initf(const fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP>& i_target)
{
FAPI_DBG("Start");

#ifndef __HOSTBOOT_MODULE
fapi2::Target<fapi2::TARGET_TYPE_SYSTEM> FAPI_SYSTEM;
fapi2::ReturnCode l_rc;

// apply initfiles
ecmdChipTarget l_ecmd_target;
fapiTargetToEcmdTarget(i_target, l_ecmd_target);
ecmdEnableRingCache(l_ecmd_target);
FAPI_EXEC_HWP(l_rc, centaur_mbs_scan, i_target, FAPI_SYSTEM);

if (l_rc)
{
FAPI_ERR("Error from centaur_mbs_scan");
fapi2::current_err = l_rc;
goto fapi_try_exit;
}

FAPI_EXEC_HWP(l_rc, centaur_mba_scan, i_target);

if (l_rc)
{
FAPI_ERR("Error from centaur_mba_scan");
fapi2::current_err = l_rc;
goto fapi_try_exit;
}

FAPI_EXEC_HWP(l_rc, centaur_dmi_scan, i_target, FAPI_SYSTEM);

if (l_rc)
{
FAPI_ERR("Error from centaur_dmi_scan");
fapi2::current_err = l_rc;
goto fapi_try_exit;
}

FAPI_EXEC_HWP(l_rc, centaur_thermal_scan, i_target, FAPI_SYSTEM);

if (l_rc)
{
FAPI_ERR("Error from centaur_thermal_scan");
fapi2::current_err = l_rc;
goto fapi_try_exit;
}

ecmdDisableRingCache(l_ecmd_target);
FAPI_TRY(fapi2::putRing(i_target, tcn_mbs_func),
"Error from putRing (tcn_mbs_func)");
FAPI_TRY(fapi2::putRing(i_target, tcn_mbs_cmsk),
"Error from putRing (tcn_mbs_cmsk)");
FAPI_TRY(fapi2::putRing(i_target, tcn_mbi_cmsk),
"Error from putRing (tcn_mbi_cmsk)");
FAPI_TRY(fapi2::putRing(i_target, tcn_mbi_func),
"Error from putRing (tcn_mbi_func)");
FAPI_TRY(fapi2::putRing(i_target, tcn_mbi_gptr),
"Error from putRing (tcn_mbi_gptr)");
FAPI_TRY(fapi2::putRing(i_target, tcn_perv_func),
"Error from putRing (tcn_perv_func)");
FAPI_TRY(fapi2::putRing(i_target, tcn_dmi_func),
"Error from putRing (tcn_dmi_func)");
FAPI_TRY(fapi2::putRing(i_target, tcn_refr_func),
"Error from putRing (tcn_refr_func)");
FAPI_TRY(fapi2::putRing(i_target, tcn_refr_abst),
"Error from putRing (tcn_refr_abst)");
FAPI_TRY(fapi2::putRing(i_target, tcm_memn_cmsk),
"Error from putRing (tcm_memn_cmsk)");
FAPI_TRY(fapi2::putRing(i_target, tcm_mems_cmsk),
"Error from putRing (tcm_mems_cmsk)");
FAPI_TRY(fapi2::putRing(i_target, tcm_memn_func),
"Error from putRing (tcm_memn_func)");
FAPI_TRY(fapi2::putRing(i_target, tcm_mems_func),
"Error from putRing (tcm_mems_func)");
FAPI_TRY(fapi2::putRing(i_target, tcm_perv_func),
"Error from putRing (tcm_perv_func)");

fapi_try_exit:
#endif
FAPI_DBG("End");
return fapi2::current_err;
}
123 changes: 75 additions & 48 deletions src/import/chips/centaur/procedures/hwp/perv/cen_pll_initf.C
Expand Up @@ -44,12 +44,7 @@
#include <cen_gen_scom_addresses.H>
#include <cen_gen_scom_addresses_fixes.H>
#include <centaur_misc_constants.H>

#ifndef __HOSTBOOT_MODULE
#include <centaur_cleanup_pll_scan.H>
#include <centaur_nest_pll_scan.H>
#include <centaur_mem_pll_scan.H>
#endif
#include <cen_ringId.H>

//------------------------------------------------------------------------------
// Function definitions
Expand All @@ -59,58 +54,90 @@ fapi2::ReturnCode
cen_pll_initf(const fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP>& i_target)
{
FAPI_DBG("Start");
fapi2::buffer<uint64_t> l_clk_region = 0;

#ifndef __HOSTBOOT_MODULE
fapi2::Target<fapi2::TARGET_TYPE_SYSTEM> FAPI_SYSTEM;
fapi2::ReturnCode l_rc;
// apply initfiles
ecmdChipTarget l_ecmd_target;
fapiTargetToEcmdTarget(i_target, l_ecmd_target);
ecmdEnableRingCache(l_ecmd_target);
FAPI_EXEC_HWP(l_rc, centaur_cleanup_pll_scan, i_target, FAPI_SYSTEM);

if (l_rc)
fapi2::ATTR_CEN_MSS_FREQ_Type l_mem_freq;
fapi2::ATTR_FREQ_MCA_MHZ_Type l_nest_freq;
RingId_t l_tp_pll_bndy_ring_id;

// retreive attributes definining NEST/DMI and MEM PLL frequencies
FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_FREQ_MCA_MHZ,
FAPI_SYSTEM,
l_nest_freq),
"Error from FAPI_ATTR_GET (ATTR_FREQ_MCA_MHZ)");
FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CEN_MSS_FREQ,
i_target,
l_mem_freq),
"Error from FAPI_ATTR_GET (ATTR_CEN_MSS_FREQ)");

if ((l_nest_freq == 2000) && (l_mem_freq == 1066))
{
FAPI_ERR("Error from centaur_cleanup_pll_scan");
fapi2::current_err = l_rc;
goto fapi_try_exit;
l_tp_pll_bndy_ring_id = tp_pll_bndy_bucket_1;
}

FAPI_EXEC_HWP(l_rc, centaur_mem_pll_scan, i_target, FAPI_SYSTEM);

if (l_rc)
else if ((l_nest_freq == 2000) && (l_mem_freq == 1333))
{
FAPI_ERR("Error from centaur_mem_pll_scan");
fapi2::current_err = l_rc;
goto fapi_try_exit;
l_tp_pll_bndy_ring_id = tp_pll_bndy_bucket_2;
}

FAPI_EXEC_HWP(l_rc, centaur_nest_pll_scan, i_target, FAPI_SYSTEM);

if (l_rc)
else if ((l_nest_freq == 2000) && (l_mem_freq == 1600))
{
FAPI_ERR("Error from centaur_nest_pll_scan");
fapi2::current_err = l_rc;
goto fapi_try_exit;
l_tp_pll_bndy_ring_id = tp_pll_bndy_bucket_3;
}
else if ((l_nest_freq == 2000) && (l_mem_freq == 1866))
{
l_tp_pll_bndy_ring_id = tp_pll_bndy_bucket_4;
}
else if ((l_nest_freq == 2400) && (l_mem_freq == 1066))
{
l_tp_pll_bndy_ring_id = tp_pll_bndy_bucket_5;
}
else if ((l_nest_freq == 2400) && (l_mem_freq == 1333))
{
l_tp_pll_bndy_ring_id = tp_pll_bndy_bucket_6;
}
else if ((l_nest_freq == 2400) && (l_mem_freq == 1600))
{
l_tp_pll_bndy_ring_id = tp_pll_bndy_bucket_7;
}
else if ((l_nest_freq == 2400) && (l_mem_freq == 1866))
{
l_tp_pll_bndy_ring_id = tp_pll_bndy_bucket_8;
}
else
{
FAPI_ASSERT(false,
fapi2::CEN_PLL_INITF_UNSUPPORTED_FREQUENCY().
set_TARGET(i_target).
set_NEST_FREQ(l_nest_freq).
set_MEM_FREQ(l_mem_freq),
"Unsupported NEST/MEM frequency combination!");
}

ecmdDisableRingCache(l_ecmd_target);
#endif

// issue setpulse
l_clk_region.setBit<0, 2>(); // CLOCK_CMD = pulse
l_clk_region.setBit<4>(); // CLOCK_REGION_PERV
l_clk_region.setBit<11>(); // CLOCK_REGION_PLL
l_clk_region.setBit<21>(); // SEL_THOLD_NSL
FAPI_TRY(fapi2::putScom(i_target, CEN_CLK_REGION_PCB, l_clk_region),
"Error from putScom (CEN_CLK_REGION_PCB, setpulse)");
// scan init PLL GPTR/FUNC chains
FAPI_TRY(fapi2::putRing(i_target, tp_pll_gptr),
"Error from putRing (tp_pll_gptr)");
FAPI_TRY(fapi2::putRing(i_target, tp_pll_func),
"Error from putRing (tp_pll_func)");

FAPI_TRY(fapi2::delay(0, 10000));
// scan init PLL bndy chain
FAPI_TRY(fapi2::putRing(i_target, l_tp_pll_bndy_ring_id),
"Error from putRing (tp_pll_bndy, 0x%02X)",
l_tp_pll_bndy_ring_id);

l_clk_region.flush<0>();
FAPI_TRY(fapi2::putScom(i_target, CEN_CLK_REGION_PCB, l_clk_region),
"Error from putScom (CEN_CLK_REGION_PCB, clear)");
// issue setpulse
{
fapi2::buffer<uint64_t> l_clk_region = 0;
l_clk_region.setBit<0, 2>(); // CLOCK_CMD = pulse
l_clk_region.setBit<4>(); // CLOCK_REGION_PERV
l_clk_region.setBit<11>(); // CLOCK_REGION_PLL
l_clk_region.setBit<21>(); // SEL_THOLD_NSL
FAPI_TRY(fapi2::putScom(i_target, CEN_CLK_REGION_PCB, l_clk_region),
"Error from putScom (CEN_CLK_REGION_PCB, setpulse)");

FAPI_TRY(fapi2::delay(0, 10000));

l_clk_region.flush<0>();
FAPI_TRY(fapi2::putScom(i_target, CEN_CLK_REGION_PCB, l_clk_region),
"Error from putScom (CEN_CLK_REGION_PCB, clear)");
}

fapi_try_exit:
FAPI_DBG("End");
Expand Down
Expand Up @@ -25,7 +25,6 @@
<hwpErrors>
<!-- ******************************************************************** -->
<hwpError>
<sbeError/>
<rc>RC_CEN_CHIPLET_INIT_HEADER_MISMATCH</rc>
<description>
Procedure: cen_chiplet_init
Expand Down
Expand Up @@ -25,7 +25,6 @@
<hwpErrors>
<!-- ******************************************************************** -->
<hwpError>
<sbeError/>
<rc>RC_CEN_COMMON_ARRAYINIT_POLL_OPCG_DONE_TIMEOUT</rc>
<description>
Routine: cen_arrayinit_module
Expand All @@ -35,7 +34,6 @@
</hwpError>
<!-- ******************************************************************** -->
<hwpError>
<sbeError/>
<rc>RC_CEN_COMMON_SCAN0_POLL_OPCG_DONE_TIMEOUT</rc>
<description>
Routine: cen_scan0_module
Expand All @@ -45,7 +43,6 @@
</hwpError>
<!-- ******************************************************************** -->
<hwpError>
<sbeError/>
<rc>RC_CEN_COMMON_REPAIR_LOADER_TIMEOUT</rc>
<description>
Routine: cen_repair_loader
Expand All @@ -55,7 +52,6 @@
</hwpError>
<!-- ******************************************************************** -->
<hwpError>
<sbeError/>
<rc>RC_CEN_COMMON_ECC_TRAP_REG_ERROR</rc>
<description>
Routine: cen_repair_loader
Expand All @@ -65,7 +61,6 @@
</hwpError>
<!-- ******************************************************************** -->
<hwpError>
<sbeError/>
<rc>RC_CEN_COMMON_MISMATCH_IN_EXPECTED_REPAIR_LOADER_STATUS</rc>
<description>
Routine: cen_repair_loader
Expand All @@ -75,7 +70,6 @@
</hwpError>
<!-- ******************************************************************** -->
<hwpError>
<sbeError/>
<rc>RC_CEN_COMMON_REPAIR_LOADER_BUSY</rc>
<description>
Routine: cen_repair_loader
Expand All @@ -85,7 +79,6 @@
</hwpError>
<!-- ******************************************************************** -->
<hwpError>
<sbeError/>
<rc>RC_CEN_COMMON_STARTCLOCKS_CLK_THOLDS_CHECK_ERR</rc>
<description>
Procedure: cen_comomn_startclocks
Expand Down
Expand Up @@ -25,7 +25,6 @@
<hwpErrors>
<!-- ******************************************************************** -->
<hwpError>
<sbeError/>
<rc>RC_CEN_PLL_INITF_UNSUPPORTED_FREQUENCY</rc>
<description>
Procedure: cen_pll_initf
Expand Down
Expand Up @@ -25,7 +25,6 @@
<hwpErrors>
<!-- ******************************************************************** -->
<hwpError>
<sbeError/>
<rc>RC_CEN_PLL_SETUP_POLL_NEST_PLL_LOCK_TIMEOUT</rc>
<description>
Procedure: cen_pll_setup
Expand All @@ -35,7 +34,6 @@
</hwpError>
<!-- ******************************************************************** -->
<hwpError>
<sbeError/>
<rc>RC_CEN_PLL_SETUP_POLL_MEM_PLL_LOCK_TIMEOUT</rc>
<description>
Procedure: cen_pll_setup
Expand Down
Expand Up @@ -25,7 +25,6 @@
<hwpErrors>
<!-- ******************************************************************** -->
<hwpError>
<sbeError/>
<rc>RC_CEN_TP_CHIPLET_INIT1_VDD_SENSE_ERR</rc>
<description>
Procedure: cen_tp_chiplet_init1
Expand Down
Expand Up @@ -25,7 +25,6 @@
<hwpErrors>
<!-- ******************************************************************** -->
<hwpError>
<sbeError/>
<rc>RC_CEN_TP_CHIPLET_INIT2_ERR_CLK_CNTL</rc>
<description>
Procedure: cen_tp_chiplet_init2
Expand Down
Expand Up @@ -25,7 +25,6 @@
<hwpErrors>
<!-- ******************************************************************** -->
<hwpError>
<sbeError/>
<rc>RC_CEN_TP_CHIPLET_INIT3_ERR_CLK_STATUS</rc>
<description>
Procedure: cen_tp_chiplet_init3
Expand All @@ -35,7 +34,6 @@
</hwpError>
<!-- ******************************************************************** -->
<hwpError>
<sbeError/>
<rc>RC_CEN_TP_CHIPLET_INIT3_NOT_ALL_CLK_RUNNING</rc>
<description>
Procedure: cen_tp_chiplet_init3
Expand Down
10 changes: 8 additions & 2 deletions src/import/chips/centaur/utils/imageProcs/cen_ringId.C
Expand Up @@ -135,8 +135,14 @@ const GenRingIdList RING_ID_LIST_COMMON[] =
{"tp_pib_fuse" , 0x60, 0x01, 0x01, CEN_RING, 0x00031005},
{"tp_pib_gptr" , 0x61, 0x01, 0x01, CEN_RING, 0x00031002},
{"tp_pll_bndy" , 0x62, 0x01, 0x01, CEN_RING, 0x01030088},
{"tp_pib_repr" , 0x63, 0x01, 0x01, CEN_RING, 0x00031006},
{"tp_vitl" , 0x64, 0x01, 0x01, CEN_RING, 0x0003800c},
{"tp_pll_bndy_bucket_1", 0x63, 0x01, 0x01, CEN_RING, 0x01030088},
{"tp_pll_bndy_bucket_2", 0x64, 0x01, 0x01, CEN_RING, 0x01030088},
{"tp_pll_bndy_bucket_3", 0x65, 0x01, 0x01, CEN_RING, 0x01030088},
{"tp_pll_bndy_bucket_4", 0x66, 0x01, 0x01, CEN_RING, 0x01030088},
{"tp_pll_bndy_bucket_5", 0x67, 0x01, 0x01, CEN_RING, 0x01030088},
{"tp_pll_bndy_bucket_6", 0x68, 0x01, 0x01, CEN_RING, 0x01030088},
{"tp_pll_bndy_bucket_7", 0x69, 0x01, 0x01, CEN_RING, 0x01030088},
{"tp_pll_bndy_bucket_8", 0x6a, 0x01, 0x01, CEN_RING, 0x01030088},
};

const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID };
Expand Down

0 comments on commit f7fb6d7

Please sign in to comment.