src/occ_gpe1/gpe1_dimm_read.c
/*
 * Function Specifications:
 *
 * Name: dimm_write_ts_addr
 *
 * Description:  Write the Temperature Sensor address to I2C
 *
 * Inputs:       cmd is a pointer to IPC msg's cmd and cmd_data struct
 *
 * Outputs:      error: sets rc, address, and ffdc in the cmd_data's
 *                      GpeErrorStruct
 *
 * End Function Specification
 */
Function Specifications:
Name: dimm_write_ts_addr

Write the Temperature Sensor address to I2C

cmd is a pointer to IPC msg's cmd and cmd_data struct

sets rc, address, and ffdc in the cmd_data's
GpeErrorStruct

End Function Specification
Function Specifications : Name : dimm_write_ts_addr Write the Temperature Sensor address to I2C cmd is a pointer to IPC msg ' s cmd and cmd_data struct sets rc address and ffdc in the cmd_data ' s GpeErrorStruct End Function Specification
void dimm_write_ts_addr(ipc_msg_t* cmd, void* arg)
{
    int      rc;
    uint32_t scomAddr;
    uint64_t regValue; 
    ipc_async_cmd_t *async_cmd = (ipc_async_cmd_t*)cmd;
    dimm_sm_args_t *args = (dimm_sm_args_t*)async_cmd->cmd_data;
    scomAddr = I2C_COMMAND_REG | SCOM_ENGINE_OFFSET(args->i2cEngine);
    regValue = 0xC000000100000000 | ((uint64_t)args->i2cAddr << 48);
    rc = putscom_abs(scomAddr, regValue);
    if(rc)
    {
        PK_TRACE("dimm_write_ts_addr: I2C_COMMAND_REG putscom 0x%08X->0x%08X%08X FAILED. rc = 0x%08x",
                 scomAddr, WORD_HIGH(regValue), WORD_LOW(regValue), rc);
        gpe_set_ffdc(&(args->error), scomAddr, GPE_RC_SCOM_PUT_FAILED, rc);
    }
    else
    {
        GPE1_DIMM_DBG("dimm_write_ts_addr: putscom(0x%08X,0x%08X%08X) SUCCESS - COMMAND (write)",
                      scomAddr, WORD_HIGH(regValue), WORD_LOW(regValue));
        scomAddr = I2C_FIFO1_REG_READ | SCOM_ENGINE_OFFSET(args->i2cEngine);
        regValue  = 0x0500000000000000;
        rc = putscom_abs(scomAddr, regValue);
        if(rc)
        {
            PK_TRACE("dimm_write_ts_addr: I2C_FIFO_REG putscom 0x%08X->0x%08X%08X FAILED. rc = 0x%08x",
                     scomAddr, WORD_HIGH(regValue), WORD_LOW(regValue), rc);
            gpe_set_ffdc(&(args->error), scomAddr, GPE_RC_SCOM_PUT_FAILED, rc);
        }
        else
        {
            GPE1_DIMM_DBG("dimm_write_ts_addr: putscom(0x%08X,0x%08X%08X) SUCCESS - FIFO",
                          scomAddr, WORD_HIGH(regValue), WORD_LOW(regValue));
        }
    }
}
void dimm_write_ts_addr ( ipc_msg_t * cmd , void * arg ) { int rc ; uint32_t scomAddr ; uint64_t regValue ; ipc_async_cmd_t * async_cmd = ( ipc_async_cmd_t * ) cmd ; dimm_sm_args_t * args = ( dimm_sm_args_t * ) async_cmd -> cmd_data ; scomAddr = I2C_COMMAND_REG | SCOM_ENGINE_OFFSET ( args -> i2cEngine ) ; regValue = 0xC000000100000000 | ( ( uint64_t ) args -> i2cAddr << 48 ) ; rc = putscom_abs ( scomAddr , regValue ) ; if ( rc ) { PK_TRACE ( " " , scomAddr , WORD_HIGH ( regValue ) , WORD_LOW ( regValue ) , rc ) ; gpe_set_ffdc ( & ( args -> error ) , scomAddr , GPE_RC_SCOM_PUT_FAILED , rc ) ; } else { GPE1_DIMM_DBG ( " " , scomAddr , WORD_HIGH ( regValue ) , WORD_LOW ( regValue ) ) ; scomAddr = I2C_FIFO1_REG_READ | SCOM_ENGINE_OFFSET ( args -> i2cEngine ) ; regValue = 0x0500000000000000 ; rc = putscom_abs ( scomAddr , regValue ) ; if ( rc ) { PK_TRACE ( " " , scomAddr , WORD_HIGH ( regValue ) , WORD_LOW ( regValue ) , rc ) ; gpe_set_ffdc ( & ( args -> error ) , scomAddr , GPE_RC_SCOM_PUT_FAILED , rc ) ; } else { GPE1_DIMM_DBG ( " " , scomAddr , WORD_HIGH ( regValue ) , WORD_LOW ( regValue ) ) ; } } }
Function Specifications:
 Name: dimm_write_ts_addr
Function Specifications : Name : dimm_write_ts_addr
// a pointer to hold the putscom_abs register value // Write I2C command register with a 1 byte write // start+address + slave_address, rw=0=write, length=1, i2c address // Write the Temperature Sensor address to the FIFO register // 0x05 = temperature value