qemu-e2k/include/hw/sensor/isl_pmbus_vr.h
Peter Delevoryas e51ae82571 hw/sensor: Add IC_DEVICE_ID to ISL voltage regulators
This commit adds a passthrough for PMBUS_IC_DEVICE_ID to allow Renesas
voltage regulators to return the integrated circuit device ID if they
would like to.

The behavior is very device specific, so it hasn't been added to the
general PMBUS model. Additionally, if the device ID hasn't been set,
then the voltage regulator will respond with the error byte value.  The
guest error message will change slightly for IC_DEVICE_ID with this
commit.

Signed-off-by: Peter Delevoryas <pdel@fb.com>
Reviewed-by: Titus Rwantare <titusr@google.com>
Message-Id: <20220701000626.77395-3-me@pjd.dev>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2022-07-14 16:24:38 +02:00

58 lines
2.0 KiB
C

/*
* PMBus device for Renesas Digital Multiphase Voltage Regulators
*
* Copyright 2022 Google LLC
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef HW_MISC_ISL_PMBUS_VR_H
#define HW_MISC_ISL_PMBUS_VR_H
#include "hw/i2c/pmbus_device.h"
#include "qom/object.h"
#define TYPE_ISL69259 "isl69259"
#define TYPE_ISL69260 "isl69260"
#define TYPE_RAA228000 "raa228000"
#define TYPE_RAA229004 "raa229004"
#define ISL_MAX_IC_DEVICE_ID_LEN 16
struct ISLState {
PMBusDevice parent;
uint8_t ic_device_id[ISL_MAX_IC_DEVICE_ID_LEN];
uint8_t ic_device_id_len;
};
OBJECT_DECLARE_SIMPLE_TYPE(ISLState, ISL69260)
#define ISL_CAPABILITY_DEFAULT 0x40
#define ISL_OPERATION_DEFAULT 0x80
#define ISL_ON_OFF_CONFIG_DEFAULT 0x16
#define ISL_VOUT_MODE_DEFAULT 0x40
#define ISL_VOUT_COMMAND_DEFAULT 0x0384
#define ISL_VOUT_MAX_DEFAULT 0x08FC
#define ISL_VOUT_MARGIN_HIGH_DEFAULT 0x0640
#define ISL_VOUT_MARGIN_LOW_DEFAULT 0xFA
#define ISL_VOUT_TRANSITION_RATE_DEFAULT 0x64
#define ISL_VOUT_OV_FAULT_LIMIT_DEFAULT 0x076C
#define ISL_OT_FAULT_LIMIT_DEFAULT 0x7D
#define ISL_OT_WARN_LIMIT_DEFAULT 0x07D0
#define ISL_VIN_OV_WARN_LIMIT_DEFAULT 0x36B0
#define ISL_VIN_UV_WARN_LIMIT_DEFAULT 0x1F40
#define ISL_IIN_OC_FAULT_LIMIT_DEFAULT 0x32
#define ISL_TON_DELAY_DEFAULT 0x14
#define ISL_TON_RISE_DEFAULT 0x01F4
#define ISL_TOFF_FALL_DEFAULT 0x01F4
#define ISL_REVISION_DEFAULT 0x33
#define ISL_READ_VOUT_DEFAULT 1000
#define ISL_READ_IOUT_DEFAULT 40
#define ISL_READ_POUT_DEFAULT 4
#define ISL_READ_TEMP_DEFAULT 25
#define ISL_READ_VIN_DEFAULT 1100
#define ISL_READ_IIN_DEFAULT 40
#define ISL_READ_PIN_DEFAULT 4
#endif