xref: /openbmc/qemu/include/hw/sensor/isl_pmbus_vr.h (revision d0f0cd5b)
1 /*
2  * PMBus device for Renesas Digital Multiphase Voltage Regulators
3  *
4  * Copyright 2022 Google LLC
5  *
6  * SPDX-License-Identifier: GPL-2.0-or-later
7  */
8 
9 #ifndef HW_MISC_ISL_PMBUS_VR_H
10 #define HW_MISC_ISL_PMBUS_VR_H
11 
12 #include "hw/i2c/pmbus_device.h"
13 #include "qom/object.h"
14 
15 #define TYPE_ISL69259   "isl69259"
16 #define TYPE_ISL69260   "isl69260"
17 #define TYPE_RAA228000  "raa228000"
18 #define TYPE_RAA229004  "raa229004"
19 #define ISL_MAX_IC_DEVICE_ID_LEN 16
20 
21 struct ISLState {
22     PMBusDevice parent;
23 
24     uint8_t ic_device_id[ISL_MAX_IC_DEVICE_ID_LEN];
25     uint8_t ic_device_id_len;
26 };
27 
28 OBJECT_DECLARE_SIMPLE_TYPE(ISLState, ISL69260)
29 
30 #define ISL_CAPABILITY_DEFAULT                 0x40
31 #define ISL_OPERATION_DEFAULT                  0x80
32 #define ISL_ON_OFF_CONFIG_DEFAULT              0x16
33 #define ISL_VOUT_MODE_DEFAULT                  0x40
34 #define ISL_VOUT_COMMAND_DEFAULT               0x0384
35 #define ISL_VOUT_MAX_DEFAULT                   0x08FC
36 #define ISL_VOUT_MARGIN_HIGH_DEFAULT           0x0640
37 #define ISL_VOUT_MARGIN_LOW_DEFAULT            0xFA
38 #define ISL_VOUT_TRANSITION_RATE_DEFAULT       0x64
39 #define ISL_VOUT_OV_FAULT_LIMIT_DEFAULT        0x076C
40 #define ISL_OT_FAULT_LIMIT_DEFAULT             0x7D
41 #define ISL_OT_WARN_LIMIT_DEFAULT              0x07D0
42 #define ISL_VIN_OV_WARN_LIMIT_DEFAULT          0x36B0
43 #define ISL_VIN_UV_WARN_LIMIT_DEFAULT          0x1F40
44 #define ISL_IIN_OC_FAULT_LIMIT_DEFAULT         0x32
45 #define ISL_TON_DELAY_DEFAULT                  0x14
46 #define ISL_TON_RISE_DEFAULT                   0x01F4
47 #define ISL_TOFF_FALL_DEFAULT                  0x01F4
48 #define ISL_REVISION_DEFAULT                   0x33
49 #define ISL_READ_VOUT_DEFAULT                  1000
50 #define ISL_READ_IOUT_DEFAULT                  40
51 #define ISL_READ_POUT_DEFAULT                  4
52 #define ISL_READ_TEMP_DEFAULT                  25
53 #define ISL_READ_VIN_DEFAULT                   1100
54 #define ISL_READ_IIN_DEFAULT                   40
55 #define ISL_READ_PIN_DEFAULT                   4
56 
57 #endif
58