import/chips/p9/procedures/ppe_closed/cme/pstate_cme/p9_cme_pstate.c
// Non-atomic Interppm-write, this function is not made availabe via the header
// as the toplevel-wrapper (atomic) ippm_write should be used instead
Non-atomic Interppm-write, this function is not made availabe via the header
as the toplevel-wrapper (atomic) ippm_write should be used instead
Non - atomic Interppm - write this function is not made availabe via the header as the toplevel - wrapper ( atomic ) ippm_write should be used instead
void nonatomic_ippm_write(uint32_t addr, uint64_t data)
{
    uint64_t val;
    CME_PUTSCOM(CPPM_IPPMWDATA, G_cme_pstate_record.firstGoodCoreMask,
                data);
    cppm_ippmcmd_t cppm_ippmcmd;
    cppm_ippmcmd.value = 0;
    cppm_ippmcmd.fields.qppm_reg = addr & 0x000000ff;
    cppm_ippmcmd.fields.qppm_rnw = 0;
    CME_PUTSCOM(CPPM_IPPMCMD, G_cme_pstate_record.firstGoodCoreMask,
                cppm_ippmcmd.value);
    do
    {
        CME_GETSCOM(CPPM_IPPMSTAT, G_cme_pstate_record.firstGoodCoreMask, val);
    } 
    while(val & BIT64(0));
    if(val & BITS64(1, 2))
    {
        PK_PANIC(CME_PSTATE_IPPM_ACCESS_FAILED);
    }
}
void nonatomic_ippm_write ( uint32_t addr , uint64_t data ) { uint64_t val ; CME_PUTSCOM ( CPPM_IPPMWDATA , G_cme_pstate_record . firstGoodCoreMask , data ) ; cppm_ippmcmd_t cppm_ippmcmd ; cppm_ippmcmd . value = 0 ; cppm_ippmcmd . fields . qppm_reg = addr & 0x000000ff ; cppm_ippmcmd . fields . qppm_rnw = 0 ; CME_PUTSCOM ( CPPM_IPPMCMD , G_cme_pstate_record . firstGoodCoreMask , cppm_ippmcmd . value ) ; do { CME_GETSCOM ( CPPM_IPPMSTAT , G_cme_pstate_record . firstGoodCoreMask , val ) ; } while ( val & BIT64 ( 0 ) ) ; if ( val & BITS64 ( 1 , 2 ) ) { PK_PANIC ( CME_PSTATE_IPPM_ACCESS_FAILED ) ; } }
Non-atomic Interppm-write, this function is not made availabe via the header
as the toplevel-wrapper (atomic) ippm_write should be used instead
Non - atomic Interppm - write this function is not made availabe via the header as the toplevel - wrapper ( atomic ) ippm_write should be used instead
// G_cme_pstate_record.firstGoodCoreMask MUST be set! // Check the QPPM_ONGOING bit // QPPM_STATUS, non-zero indicates an error