Skip to contentSkip to conversation

This patch series contains updates to PMBus in QEMU along with some PMBus device models for Renesas regulators. I have also added myself to MAINTAINERS as this code is in use daily, where I am responsible for it.

PATCH Superseded Titus Rwantare 3 participants 26 messages Mar 2, 2022 – Mar 8, 2022 Arm/Amlogic Meson SoC support

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover This patch series contains updates to PMBus in QEMU along with some PMBus device models for Renesas regulators. I have also added myself to MAINTAINERS as this code is in use daily, where I am responsible for it.

v2:
- split PMBus commit with updates into individual fixes
- renamed isl_pmbus[.ch] adding _vr for voltage regulators

v3:
- split uint refactor commit and removed commit renaming files
- rename rolled into preceding commits
- update commit description for uint refactoring change

Shengtan Mao (1):
hw/i2c: Added linear mode translation for pmbus devices

Titus Rwantare (8):
hw/i2c: pmbus: add registers
hw/i2c: pmbus: guard against out of range accesses hw/i2c: pmbus: add PEC unsupported warning hw/i2c: pmbus: refactor uint handling hw/i2c: pmbus: update MAINTAINERS hw/sensor: add Intersil ISL69260 device model hw/sensor: add Renesas raa229004 PMBus device hw/sensor: add Renesas raa228000 device

 MAINTAINERS                      |  13 +
 hw/arm/Kconfig                   |   1 +
 hw/i2c/pmbus_device.c            | 106 ++++++-
 hw/sensor/Kconfig                |   5 +
 hw/sensor/isl_pmbus_vr.c         | 279 ++++++++++++++++++
 hw/sensor/meson.build            |   1 +
 include/hw/i2c/pmbus_device.h    |  23 +-
 include/hw/sensor/isl_pmbus_vr.h |  52 ++++
 tests/qtest/isl_pmbus_vr-test.c  | 474 +++++++++++++++++++++++++++++++
 tests/qtest/meson.build          |   1 +
 10 files changed, 944 insertions(+), 11 deletions(-)
 create mode 100644 hw/sensor/isl_pmbus_vr.c
 create mode 100644 include/hw/sensor/isl_pmbus_vr.h
 create mode 100644 tests/qtest/isl_pmbus_vr-test.c
Signature · 1 line
2.35.1.616.g0bdcbb4464-goog
#1 lore raw

PATCH v3 1/9 hw/i2c: pmbus: add registers

- add the VOUT_MIN and STATUS_MFR registers

---
 hw/i2c/pmbus_device.c         | 24 ++++++++++++++++++++++++
 include/hw/i2c/pmbus_device.h |  3 +++
 2 files changed, 27 insertions(+)
hw/i2c/pmbus_device.c +24 -0
index 24f8f522d9..07a45c99f9 100644
@@ -368,6 +368,14 @@ static uint8_t pmbus_receive_byte(SMBusDevice *smd)
         }
         break;
 
+    case PMBUS_VOUT_MIN:        /* R/W word */
+        if (pmdev->pages[index].page_flags & PB_HAS_VOUT_RATING) {
+            pmbus_send16(pmdev, pmdev->pages[index].vout_min);
+        } else {
+            goto passthough;
+        }
+        break;
+
     /* TODO: implement coefficients support */
 
     case PMBUS_POUT_MAX:                  /* R/W word */
@@ -708,6 +716,10 @@ static uint8_t pmbus_receive_byte(SMBusDevice *smd)
         pmbus_send8(pmdev, pmdev->pages[index].status_other);
         break;
 
+    case PMBUS_STATUS_MFR_SPECIFIC:       /* R/W byte */
+        pmbus_send8(pmdev, pmdev->pages[index].status_mfr_specific);
+        break;
+
     case PMBUS_READ_EIN:                  /* Read-Only block 5 bytes */
         if (pmdev->pages[index].page_flags & PB_HAS_EIN) {
             pmbus_send(pmdev, pmdev->pages[index].read_ein, 5);
@@ -1149,6 +1161,14 @@ static int pmbus_write_data(SMBusDevice *smd, uint8_t *buf, uint8_t len)
         }
         break;
 
+    case PMBUS_VOUT_MIN:                  /* R/W word */
+        if (pmdev->pages[index].page_flags & PB_HAS_VOUT_RATING) {
+            pmdev->pages[index].vout_min = pmbus_receive16(pmdev);
+        } else {
+            goto passthrough;
+        }
+        break;
+
     case PMBUS_POUT_MAX:                  /* R/W word */
         if (pmdev->pages[index].page_flags & PB_HAS_VOUT) {
             pmdev->pages[index].pout_max = pmbus_receive16(pmdev);
@@ -1482,6 +1502,10 @@ static int pmbus_write_data(SMBusDevice *smd, uint8_t *buf, uint8_t len)
         pmdev->pages[index].status_other = pmbus_receive8(pmdev);
         break;
 
+    case PMBUS_STATUS_MFR_SPECIFIC:        /* R/W byte */
+        pmdev->pages[index].status_mfr_specific = pmbus_receive8(pmdev);
+        break;
+
     case PMBUS_PAGE_PLUS_READ:            /* Block Read-only */
     case PMBUS_CAPABILITY:                /* Read-Only byte */
     case PMBUS_COEFFICIENTS:              /* Read-only block 5 bytes */
include/hw/i2c/pmbus_device.h +3 -0
index 62bd38c83f..72c0483149 100644
@@ -43,6 +43,7 @@ enum pmbus_registers {
     PMBUS_VOUT_DROOP                = 0x28, /* R/W word */
     PMBUS_VOUT_SCALE_LOOP           = 0x29, /* R/W word */
     PMBUS_VOUT_SCALE_MONITOR        = 0x2A, /* R/W word */
+    PMBUS_VOUT_MIN                  = 0x2B, /* R/W word */
     PMBUS_COEFFICIENTS              = 0x30, /* Read-only block 5 bytes */
     PMBUS_POUT_MAX                  = 0x31, /* R/W word */
     PMBUS_MAX_DUTY                  = 0x32, /* R/W word */
@@ -255,6 +256,7 @@ OBJECT_DECLARE_TYPE(PMBusDevice, PMBusDeviceClass,
 #define PB_HAS_TEMP3               BIT_ULL(42)
 #define PB_HAS_TEMP_RATING         BIT_ULL(43)
 #define PB_HAS_MFR_INFO            BIT_ULL(50)
+#define PB_HAS_STATUS_MFR_SPECIFIC BIT_ULL(51)
 
 struct PMBusDeviceClass {
     SMBusDeviceClass parent_class;
@@ -295,6 +297,7 @@ typedef struct PMBusPage {
     uint16_t vout_droop;               /* R/W word */
     uint16_t vout_scale_loop;          /* R/W word */
     uint16_t vout_scale_monitor;       /* R/W word */
+    uint16_t vout_min;                 /* R/W word */
     uint8_t coefficients[5];           /* Read-only block 5 bytes */
     uint16_t pout_max;                 /* R/W word */
     uint16_t max_duty;                 /* R/W word */
Signature · 1 line
2.35.1.616.g0bdcbb4464-goog
#3 lore raw

PATCH v3 2/9 hw/i2c: pmbus: guard against out of range accesses

In reply to Titus Rwantare
---
 hw/i2c/pmbus_device.c | 41 ++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 40 insertions(+), 1 deletion(-)
hw/i2c/pmbus_device.c +40 -1
index 07a45c99f9..93c746bab3 100644
@@ -243,18 +243,47 @@ void pmbus_check_limits(PMBusDevice *pmdev)
     }
 }
 
+/* assert the status_cml error upon receipt of malformed command */
+static void pmbus_cml_error(PMBusDevice *pmdev)
+{
+    for (int i = 0; i < pmdev->num_pages; i++) {
+        pmdev->pages[i].status_word |= PMBUS_STATUS_CML;
+        pmdev->pages[i].status_cml |= PB_CML_FAULT_INVALID_CMD;
+    }
+}
+
 static uint8_t pmbus_receive_byte(SMBusDevice *smd)
 {
     PMBusDevice *pmdev = PMBUS_DEVICE(smd);
     PMBusDeviceClass *pmdc = PMBUS_DEVICE_GET_CLASS(pmdev);
     uint8_t ret = 0xFF;
-    uint8_t index = pmdev->page;
+    uint8_t index;
 
     if (pmdev->out_buf_len != 0) {
         ret = pmbus_out_buf_pop(pmdev);
         return ret;
     }
 
+    /*
+     * Reading from all pages will return the value from page 0,
+     * this is unspecified behaviour in general.
+     */
+    if (pmdev->page == PB_ALL_PAGES) {
+        index = 0;
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "%s: tried to read from all pages\n",
+                      __func__);
+        pmbus_cml_error(pmdev);
+    } else if (pmdev->page > pmdev->num_pages - 1) {
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "%s: page %d is out of range\n",
+                      __func__, pmdev->page);
+        pmbus_cml_error(pmdev);
+        return -1;
+    } else {
+        index = pmdev->page;
+    }
+
     switch (pmdev->code) {
     case PMBUS_PAGE:
         pmbus_send8(pmdev, pmdev->page);
@@ -1038,6 +1067,7 @@ static int pmbus_write_data(SMBusDevice *smd, uint8_t *buf, uint8_t len)
         pmdev->page = pmbus_receive8(pmdev);
         return 0;
     }
+
     /* loop through all the pages when 0xFF is received */
     if (pmdev->page == PB_ALL_PAGES) {
         for (int i = 0; i < pmdev->num_pages; i++) {
@@ -1048,6 +1078,15 @@ static int pmbus_write_data(SMBusDevice *smd, uint8_t *buf, uint8_t len)
         return 0;
     }
 
+    if (pmdev->page > pmdev->num_pages - 1) {
+        qemu_log_mask(LOG_GUEST_ERROR,
+                        "%s: page %u is out of range\n",
+                        __func__, pmdev->page);
+        pmdev->page = 0; /* undefined behaviour - reset to page 0 */
+        pmbus_cml_error(pmdev);
+        return -1;
+    }
+
     index = pmdev->page;
 
     switch (pmdev->code) {
Signature · 1 line
2.35.1.616.g0bdcbb4464-goog
Reviewed-by on v3 2/9
#4 lore raw

Re: [PATCH v3 2/9] hw/i2c: pmbus: guard against out of range accesses

Quoted 24 lines · Titus Rwantare
---
  hw/i2c/pmbus_device.c | 41 ++++++++++++++++++++++++++++++++++++++++-
  1 file changed, 40 insertions(+), 1 deletion(-)
  static uint8_t pmbus_receive_byte(SMBusDevice *smd)
  {
      PMBusDevice *pmdev = PMBUS_DEVICE(smd);
      PMBusDeviceClass *pmdc = PMBUS_DEVICE_GET_CLASS(pmdev);
      uint8_t ret = 0xFF;
hw/i2c/pmbus_device.c +7 -1
-    uint8_t index = pmdev->page;
+    uint8_t index;
 
      if (pmdev->out_buf_len != 0) {
          ret = pmbus_out_buf_pop(pmdev);
          return ret;
      }
 
+    /*
+     * Reading from all pages will return the value from page 0,
+     * this is unspecified behaviour in general.
+     */
+    if (pmdev->page == PB_ALL_PAGES) {
+        index = 0;

hw/i2c/pmbus_device.c void pmbus_check_limits(PMBusDevice *pmdev) · line 282

Quoted 10 lines
hw/i2c/pmbus_device.c +10 -0
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "%s: tried to read from all pages\n",
+                      __func__);
+        pmbus_cml_error(pmdev);
+    } else if (pmdev->page > pmdev->num_pages - 1) {
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "%s: page %d is out of range\n",
+                      __func__, pmdev->page);
+        pmbus_cml_error(pmdev);
+        return -1;

This file returns a mix of 0xFF/-1 for error. It would be nice to pick one. Adding a definition (PMBUS_ERR_BYTE?) could help.

Preferably with error unified:

#5 lore raw

Re: [PATCH v3 2/9] hw/i2c: pmbus: guard against out of range accesses

Ack. All errors for PMBus should
ideally be reflected in status and status_cml registers instead of carrying meaning in return values. I'll have to separately go through the existing code to make it consistent.

Quoted 42 lines · Philippe Mathieu-Daudé
Quoted 24 lines · Titus Rwantare
---
  hw/i2c/pmbus_device.c | 41 ++++++++++++++++++++++++++++++++++++++++-
  1 file changed, 40 insertions(+), 1 deletion(-)
  static uint8_t pmbus_receive_byte(SMBusDevice *smd)
  {
      PMBusDevice *pmdev = PMBUS_DEVICE(smd);
      PMBusDeviceClass *pmdc = PMBUS_DEVICE_GET_CLASS(pmdev);
      uint8_t ret = 0xFF;
hw/i2c/pmbus_device.c +7 -1
-    uint8_t index = pmdev->page;
+    uint8_t index;
 
      if (pmdev->out_buf_len != 0) {
          ret = pmbus_out_buf_pop(pmdev);
          return ret;
      }
 
+    /*
+     * Reading from all pages will return the value from page 0,
+     * this is unspecified behaviour in general.
+     */
+    if (pmdev->page == PB_ALL_PAGES) {
+        index = 0;

hw/i2c/pmbus_device.c void pmbus_check_limits(PMBusDevice *pmdev) · line 282

Quoted 10 lines
hw/i2c/pmbus_device.c +10 -0
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "%s: tried to read from all pages\n",
+                      __func__);
+        pmbus_cml_error(pmdev);
+    } else if (pmdev->page > pmdev->num_pages - 1) {
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "%s: page %d is out of range\n",
+                      __func__, pmdev->page);
+        pmbus_cml_error(pmdev);
+        return -1;

This file returns a mix of 0xFF/-1 for error. It would be nice to pick one. Adding a definition (PMBUS_ERR_BYTE?) could help.

Preferably with error unified:

#6 lore raw

PATCH v3 3/9 hw/i2c: pmbus: add PEC unsupported warning

In reply to Titus Rwantare
---
 hw/i2c/pmbus_device.c | 5 +++++
 1 file changed, 5 insertions(+)
hw/i2c/pmbus_device.c +5 -0
index 93c746bab3..6eeb0731d7 100644
@@ -307,6 +307,11 @@ static uint8_t pmbus_receive_byte(SMBusDevice *smd)
 
     case PMBUS_CAPABILITY:
         pmbus_send8(pmdev, pmdev->capability);
+        if (pmdev->capability & BIT(7)) {
+            qemu_log_mask(LOG_GUEST_ERROR,
+                          "%s: PEC is enabled but not yet supported.\n",
+                          __func__);
+        }
         break;
 
     case PMBUS_VOUT_MODE:                 /* R/W byte */
Signature · 1 line
2.35.1.616.g0bdcbb4464-goog
#7 lore raw

Re: [PATCH v3 3/9] hw/i2c: pmbus: add PEC unsupported warning

Quoted 10 lines · Titus Rwantare
---
  hw/i2c/pmbus_device.c | 5 +++++
  1 file changed, 5 insertions(+)
hw/i2c/pmbus_device.c +0 -0
index 93c746bab3..6eeb0731d7 100644

hw/i2c/pmbus_device.c static uint8_t pmbus_receive_byte(SMBusDevice *smd) · line 311

Quoted 5 lines
hw/i2c/pmbus_device.c +2 -0
@@ -307,6 +307,11 @@ static uint8_t pmbus_receive_byte(SMBusDevice *smd)
 
      case PMBUS_CAPABILITY:
          pmbus_send8(pmdev, pmdev->capability);
+        if (pmdev->capability & BIT(7)) {
+            qemu_log_mask(LOG_GUEST_ERROR,

That would be LOG_UNIMP?

Quoted 6 lines
hw/i2c/pmbus_device.c +3 -0
+                          "%s: PEC is enabled but not yet supported.\n",
+                          __func__);
+        }
          break;
 
      case PMBUS_VOUT_MODE:                 /* R/W byte */
#8 lore raw

Re: [PATCH v3 3/9] hw/i2c: pmbus: add PEC unsupported warning

Yes, fixed.

Quoted 27 lines · Philippe Mathieu-Daudé
Quoted 10 lines · Titus Rwantare
---
  hw/i2c/pmbus_device.c | 5 +++++
  1 file changed, 5 insertions(+)
hw/i2c/pmbus_device.c +0 -0
index 93c746bab3..6eeb0731d7 100644

hw/i2c/pmbus_device.c static uint8_t pmbus_receive_byte(SMBusDevice *smd) · line 311

Quoted 5 lines
hw/i2c/pmbus_device.c +2 -0
@@ -307,6 +307,11 @@ static uint8_t pmbus_receive_byte(SMBusDevice *smd)
 
      case PMBUS_CAPABILITY:
          pmbus_send8(pmdev, pmdev->capability);
+        if (pmdev->capability & BIT(7)) {
+            qemu_log_mask(LOG_GUEST_ERROR,

That would be LOG_UNIMP?

Quoted 6 lines
hw/i2c/pmbus_device.c +3 -0
+                          "%s: PEC is enabled but not yet supported.\n",
+                          __func__);
+        }
          break;
 
      case PMBUS_VOUT_MODE:                 /* R/W byte */
#9 lore raw

PATCH v3 4/9 hw/i2c: pmbus: refactor uint handling

In reply to Titus Rwantare

This change cleans up the inputs to pmbus_receive uint, the length of received data is contained in PMBusDevice state and doesn't need to be passed around.

---
 hw/i2c/pmbus_device.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
hw/i2c/pmbus_device.c +9 -9
index 6eeb0731d7..3beb02afad 100644
@@ -89,16 +89,16 @@ void pmbus_send_string(PMBusDevice *pmdev, const char *data)
 }
 
 
-static uint64_t pmbus_receive_uint(const uint8_t *buf, uint8_t len)
+static uint64_t pmbus_receive_uint(PMBusDevice *pmdev)
 {
     uint64_t ret = 0;
 
     /* Exclude command code from return value */
-    buf++;
-    len--;
+    pmdev->in_buf++;
+    pmdev->in_buf_len--;
 
-    for (int i = len - 1; i >= 0; i--) {
-        ret = ret << 8 | buf[i];
+    for (int i = pmdev->in_buf_len - 1; i >= 0; i--) {
+        ret = ret << 8 | pmdev->in_buf[i];
     }
     return ret;
 }
@@ -110,7 +110,7 @@ uint8_t pmbus_receive8(PMBusDevice *pmdev)
                       "%s: length mismatch. Expected 1 byte, got %d bytes\n",
                       __func__, pmdev->in_buf_len - 1);
     }
-    return pmbus_receive_uint(pmdev->in_buf, pmdev->in_buf_len);
+    return pmbus_receive_uint(pmdev);
 }
 
 uint16_t pmbus_receive16(PMBusDevice *pmdev)
@@ -120,7 +120,7 @@ uint16_t pmbus_receive16(PMBusDevice *pmdev)
                       "%s: length mismatch. Expected 2 bytes, got %d bytes\n",
                       __func__, pmdev->in_buf_len - 1);
     }
-    return pmbus_receive_uint(pmdev->in_buf, pmdev->in_buf_len);
+    return pmbus_receive_uint(pmdev);
 }
 
 uint32_t pmbus_receive32(PMBusDevice *pmdev)
@@ -130,7 +130,7 @@ uint32_t pmbus_receive32(PMBusDevice *pmdev)
                       "%s: length mismatch. Expected 4 bytes, got %d bytes\n",
                       __func__, pmdev->in_buf_len - 1);
     }
-    return pmbus_receive_uint(pmdev->in_buf, pmdev->in_buf_len);
+    return pmbus_receive_uint(pmdev);
 }
 
 uint64_t pmbus_receive64(PMBusDevice *pmdev)
@@ -140,7 +140,7 @@ uint64_t pmbus_receive64(PMBusDevice *pmdev)
                       "%s: length mismatch. Expected 8 bytes, got %d bytes\n",
                       __func__, pmdev->in_buf_len - 1);
     }
-    return pmbus_receive_uint(pmdev->in_buf, pmdev->in_buf_len);
+    return pmbus_receive_uint(pmdev);
 }
 
 static uint8_t pmbus_out_buf_pop(PMBusDevice *pmdev)
Signature · 1 line
2.35.1.616.g0bdcbb4464-goog
Reviewed-by on v3 4/9
#10 lore raw

Re: [PATCH v3 4/9] hw/i2c: pmbus: refactor uint handling

Quoted 8 lines · Titus Rwantare

This change cleans up the inputs to pmbus_receive uint, the length of received data is contained in PMBusDevice state and doesn't need to be passed around.

---
  hw/i2c/pmbus_device.c | 18 +++++++++---------
  1 file changed, 9 insertions(+), 9 deletions(-)
#11 lore raw

PATCH v3 5/9 hw/i2c: pmbus: update MAINTAINERS

In reply to Titus Rwantare

add self to MAINTAINERS for the PMBus subsystem and related sensors, and set PMBus as maintained.

---
 MAINTAINERS | 10 ++++++++++
 1 file changed, 10 insertions(+)
MAINTAINERS +10 -0
index fa8adc2618..3601984b5d 100644
@@ -3135,6 +3135,16 @@ F: include/hw/i2c/smbus_master.h
 F: include/hw/i2c/smbus_slave.h
 F: include/hw/i2c/smbus_eeprom.h
 
+PMBus
+M: Titus Rwantare <[email protected]>
+S: Maintained
+F: hw/i2c/pmbus_device.c
+F: hw/sensor/adm1272.c
+F: hw/sensor/max34451.c
+F: include/hw/i2c/pmbus_device.h
+F: tests/qtest/adm1272-test.c
+F: tests/qtest/max34451-test.c
+
 Firmware schema specifications
 M: Philippe Mathieu-Daudé <[email protected]>
 R: Daniel P. Berrange <[email protected]>
Signature · 1 line
2.35.1.616.g0bdcbb4464-goog
#13 lore raw

PATCH v3 6/9 hw/i2c: Added linear mode translation for pmbus devices

In reply to Titus Rwantare

From: Shengtan Mao <[email protected]>

---
 hw/i2c/pmbus_device.c         | 18 ++++++++++++++++++
 include/hw/i2c/pmbus_device.h | 20 +++++++++++++++++++-
 2 files changed, 37 insertions(+), 1 deletion(-)
hw/i2c/pmbus_device.c +18 -0
index 3beb02afad..1036c41c49 100644
@@ -28,6 +28,24 @@ uint32_t pmbus_direct_mode2data(PMBusCoefficients c, uint16_t value)
     return x;
 }
 
+uint16_t pmbus_data2linear_mode(uint16_t value, int exp)
+{
+    /* L = D * 2^(-e) */
+    if (exp < 0) {
+        return value << (-exp);
+    }
+    return value >> exp;
+}
+
+uint16_t pmbus_linear_mode2data(uint16_t value, int exp)
+{
+    /* D = L * 2^e */
+    if (exp < 0) {
+        return value >> (-exp);
+    }
+    return value << exp;
+}
+
 void pmbus_send(PMBusDevice *pmdev, const uint8_t *data, uint16_t len)
 {
     if (pmdev->out_buf_len + len > SMBUS_DATA_MAX_LEN) {
include/hw/i2c/pmbus_device.h +19 -1
index 72c0483149..9a274247ab 100644
@@ -446,7 +446,7 @@ typedef struct PMBusCoefficients {
  *
  * Y = (m * x - b) * 10^R
  *
- * @return uint32_t
+ * @return uint16_t
  */
 uint16_t pmbus_data2direct_mode(PMBusCoefficients c, uint32_t value);
 
@@ -459,6 +459,24 @@ uint16_t pmbus_data2direct_mode(PMBusCoefficients c, uint32_t value);
  */
 uint32_t pmbus_direct_mode2data(PMBusCoefficients c, uint16_t value);
 
+/**
+ * Convert sensor values to linear mode format
+ *
+ * L = D * 2^(-e)
+ *
+ * @return uint16
+ */
+uint16_t pmbus_data2linear_mode(uint16_t value, int exp);
+
+/**
+ * Convert linear mode formatted data into sensor reading
+ *
+ * D = L * 2^e
+ *
+ * @return uint16
+ */
+uint16_t pmbus_linear_mode2data(uint16_t value, int exp);
+
 /**
  * @brief Send a block of data over PMBus
  * Assumes that the bytes in the block are already ordered correctly,
Signature · 1 line
2.35.1.616.g0bdcbb4464-goog
Reviewed-by on v3 6/9
#14 lore raw

Re: [PATCH v3 6/9] hw/i2c: Added linear mode translation for pmbus devices

Quoted 8 lines · Titus Rwantare

From: Shengtan Mao <[email protected]>

---
  hw/i2c/pmbus_device.c         | 18 ++++++++++++++++++
  include/hw/i2c/pmbus_device.h | 20 +++++++++++++++++++-
  2 files changed, 37 insertions(+), 1 deletion(-)
#15 lore raw

PATCH v3 7/9 hw/sensor: add Intersil ISL69260 device model

In reply to Titus Rwantare
---
 MAINTAINERS                      |   3 +
 hw/arm/Kconfig                   |   1 +
 hw/sensor/Kconfig                |   5 +
 hw/sensor/isl_pmbus_vr.c         | 211 +++++++++++++++++
 hw/sensor/meson.build            |   1 +
 include/hw/sensor/isl_pmbus_vr.h |  50 ++++
 tests/qtest/isl_pmbus_vr-test.c  | 394 +++++++++++++++++++++++++++++++
 tests/qtest/meson.build          |   1 +
 8 files changed, 666 insertions(+)
 create mode 100644 hw/sensor/isl_pmbus_vr.c
 create mode 100644 include/hw/sensor/isl_pmbus_vr.h
 create mode 100644 tests/qtest/isl_pmbus_vr-test.c
MAINTAINERS +3 -0
index 3601984b5d..364a844045 100644
@@ -3140,10 +3140,13 @@ M: Titus Rwantare <[email protected]>
 S: Maintained
 F: hw/i2c/pmbus_device.c
 F: hw/sensor/adm1272.c
+F: hw/sensor/isl_pmbus_vr.c
 F: hw/sensor/max34451.c
 F: include/hw/i2c/pmbus_device.h
+F: include/hw/sensor/isl_pmbus_vr.h
 F: tests/qtest/adm1272-test.c
 F: tests/qtest/max34451-test.c
+F: tests/qtest/isl_pmbus_vr-test.c
 
 Firmware schema specifications
 M: Philippe Mathieu-Daudé <[email protected]>
hw/arm/Kconfig +1 -0
index 6945330030..97f3b38019 100644
@@ -400,6 +400,7 @@ config NPCM7XX
     select SMBUS
     select AT24C  # EEPROM
     select MAX34451
+    select ISL_PMBUS_VR
     select PL310  # cache controller
     select PMBUS
     select SERIAL
hw/sensor/Kconfig +5 -0
index 215944decc..a834d2f814 100644
@@ -30,3 +30,8 @@ config LSM303DLHC_MAG
     bool
     depends on I2C
     default y if I2C_DEVICES
+
+config ISL_PMBUS_VR
+    bool
+    depends on I2C
+
hw/sensor/isl_pmbus_vr.c new file +211 -0

211 lines not on this page · raw message

hw/sensor/meson.build +1 -0
index d1bba290da..12b6992bc8 100644
@@ -5,3 +5,4 @@ softmmu_ss.add(when: 'CONFIG_EMC141X', if_true: files('emc141x.c'))
 softmmu_ss.add(when: 'CONFIG_ADM1272', if_true: files('adm1272.c'))
 softmmu_ss.add(when: 'CONFIG_MAX34451', if_true: files('max34451.c'))
 softmmu_ss.add(when: 'CONFIG_LSM303DLHC_MAG', if_true: files('lsm303dlhc_mag.c'))
+softmmu_ss.add(when: 'CONFIG_ISL_PMBUS_VR', if_true: files('isl_pmbus_vr.c'))
include/hw/sensor/isl_pmbus_vr.h new file +50 -0

50 lines not on this page · raw message

tests/qtest/isl_pmbus_vr-test.c new file +394 -0

394 lines not on this page · raw message

tests/qtest/meson.build +1 -0
index f33d84d19b..98b5969a38 100644
@@ -244,6 +244,7 @@ qos_test_ss.add(
   'es1370-test.c',
   'ipoctal232-test.c',
   'lsm303dlhc-mag-test.c',
+  'isl_pmbus_vr-test.c',
   'max34451-test.c',
   'megasas-test.c',
   'ne2000-test.c',
Signature · 1 line
2.35.1.616.g0bdcbb4464-goog
Reviewed-by on v3 7/9
#16 lore raw

Re: [PATCH v3 7/9] hw/sensor: add Intersil ISL69260 device model

Quoted 21 lines · Titus Rwantare
---
  MAINTAINERS                      |   3 +
  hw/arm/Kconfig                   |   1 +
  hw/sensor/Kconfig                |   5 +
  hw/sensor/isl_pmbus_vr.c         | 211 +++++++++++++++++
  hw/sensor/meson.build            |   1 +
  include/hw/sensor/isl_pmbus_vr.h |  50 ++++
  tests/qtest/isl_pmbus_vr-test.c  | 394 +++++++++++++++++++++++++++++++
  tests/qtest/meson.build          |   1 +
  8 files changed, 666 insertions(+)

create mode 100644 hw/sensor/isl_pmbus_vr.c create mode 100644 include/hw/sensor/isl_pmbus_vr.h create mode 100644 tests/qtest/isl_pmbus_vr-test.c

hw/sensor/Kconfig +0 -0
index 215944decc..a834d2f814 100644

hw/sensor/Kconfig config LSM303DLHC_MAG · line 36

Quoted 7 lines
hw/sensor/Kconfig +4 -0
@@ -30,3 +30,8 @@ config LSM303DLHC_MAG
      bool
      depends on I2C
      default y if I2C_DEVICES
+
+config ISL_PMBUS_VR
+    bool
+    depends on I2C

There is a PMBUS kconfig selector (which selects SMBUS -> I2C).

Quoted 18 lines
hw/sensor/Kconfig +1 -0
+
hw/sensor/isl_pmbus_vr.c new file +11 -0
new file mode 100644
index 0000000000..b3d24e40ab
@@ -0,0 +1,211 @@
+/*
+ * PMBus device for Renesas Digital Multiphase Voltage Regulators
+ *
+ * Copyright 2021 Google LLC
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "hw/sensor/isl_pmbus_vr.h"
+#include "hw/qdev-properties.h"

hw/sensor/isl_pmbus_vr.c line 21

Quoted 10 lines
hw/sensor/isl_pmbus_vr.c new file +10 -0
+#include "qapi/visitor.h"
+#include "qemu/log.h"
+#include "qemu/module.h"
+
+static uint8_t isl_pmbus_vr_read_byte(PMBusDevice *pmdev)
+{
+    qemu_log_mask(LOG_GUEST_ERROR,
+                  "%s: reading from unsupported register: 0x%02x\n",
+                  __func__, pmdev->code);
+    return 0xFF;

Eventually PMBUS_ERROR_BYTE.

hw/sensor/isl_pmbus_vr.c line 25

Quoted 4 lines
hw/sensor/isl_pmbus_vr.c new file +4 -0
+}
+
+static int isl_pmbus_vr_write_data(PMBusDevice *pmdev, const uint8_t *buf,
+                              uint8_t len)

Mis-aligned.

Quoted 14 lines
hw/sensor/isl_pmbus_vr.c new file +13 -0
+{
+    qemu_log_mask(LOG_GUEST_ERROR,
+                  "%s: write to unsupported register: 0x%02x\n",
+                  __func__, pmdev->code);
+    return 0xFF;
+}
 
+static void raa22xx_init(Object *obj)
+{
+    PMBusDevice *pmdev = PMBUS_DEVICE(obj);
+    uint64_t flags[2];
+
+    flags[0] = PB_HAS_VIN | PB_HAS_VOUT | PB_HAS_VOUT_MODE |
+               PB_HAS_VOUT_RATING | PB_HAS_VOUT_MARGIN | PB_HAS_IIN |

hw/sensor/isl_pmbus_vr.c line 177

Quoted 10 lines
hw/sensor/isl_pmbus_vr.c new file +10 -0
+               PB_HAS_IOUT | PB_HAS_PIN | PB_HAS_POUT | PB_HAS_TEMPERATURE |
+               PB_HAS_TEMP2 | PB_HAS_TEMP3 | PB_HAS_STATUS_MFR_SPECIFIC;
+    flags[1] = PB_HAS_IIN | PB_HAS_PIN | PB_HAS_TEMPERATURE | PB_HAS_TEMP3 |
+               PB_HAS_VOUT | PB_HAS_VOUT_MODE | PB_HAS_VOUT_MARGIN |
+               PB_HAS_VOUT_RATING | PB_HAS_IOUT | PB_HAS_POUT |
+               PB_HAS_STATUS_MFR_SPECIFIC;
+
+    pmbus_page_config(pmdev, 0, flags[0]);
+    pmbus_page_config(pmdev, 1, flags[1]);
+    isl_pmbus_vr_add_props(obj, flags, 2);

Eventually 2 -> ARRAY_SIZE(flags).

Quoted 40 lines

+++ b/include/hw/sensor/isl_pmbus_vr.h

hw/sensor/isl_pmbus_vr.c new file +38 -0
@@ -0,0 +1,50 @@
+/*
+ * 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_ISL69260   "isl69260"
+
+struct ISLState {
+    PMBusDevice parent;
+};
+
+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

hw/sensor/isl_pmbus_vr.c line 48

Quoted 10 lines
hw/sensor/isl_pmbus_vr.c new file +10 -0
+#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

Hmmm we need to expose the DEFAULT definitions for the tests. OK.

Changing Kconfig:

#17 lore raw

PATCH v3 8/9 hw/sensor: add Renesas raa229004 PMBus device

In reply to Titus Rwantare

The Renesas RAA229004 is a PMBus Multiphase Voltage Regulator

---
 hw/sensor/isl_pmbus_vr.c         | 18 ++++++++++++++++++
 include/hw/sensor/isl_pmbus_vr.h |  1 +
 tests/qtest/isl_pmbus_vr-test.c  |  8 ++++++++
 3 files changed, 27 insertions(+)
hw/sensor/isl_pmbus_vr.c +18 -0
index b3d24e40ab..e260faeac3 100644
@@ -195,6 +195,15 @@ static void isl69260_class_init(ObjectClass *klass, void *data)
     isl_pmbus_vr_class_init(klass, data, 2);
 }
 
+static void raa229004_class_init(ObjectClass *klass, void *data)
+{
+    ResettableClass *rc = RESETTABLE_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
+    dc->desc = "Renesas 229004 Digital Multiphase Voltage Regulator";
+    rc->phases.exit = isl_pmbus_vr_exit_reset;
+    isl_pmbus_vr_class_init(klass, data, 2);
+}
+
 static const TypeInfo isl69260_info = {
     .name = TYPE_ISL69260,
     .parent = TYPE_PMBUS_DEVICE,
@@ -203,9 +212,18 @@ static const TypeInfo isl69260_info = {
     .class_init = isl69260_class_init,
 };
 
+static const TypeInfo raa229004_info = {
+    .name = TYPE_RAA229004,
+    .parent = TYPE_PMBUS_DEVICE,
+    .instance_size = sizeof(ISLState),
+    .instance_init = raa22xx_init,
+    .class_init = raa229004_class_init,
+};
+
 static void isl_pmbus_vr_register_types(void)
 {
     type_register_static(&isl69260_info);
+    type_register_static(&raa229004_info);
 }
 
 type_init(isl_pmbus_vr_register_types)
include/hw/sensor/isl_pmbus_vr.h +1 -0
index 4e12e95efb..233916f70a 100644
@@ -13,6 +13,7 @@
 #include "qom/object.h"
 
 #define TYPE_ISL69260   "isl69260"
+#define TYPE_RAA229004  "raa229004"
 
 struct ISLState {
     PMBusDevice parent;
tests/qtest/isl_pmbus_vr-test.c +8 -0
index f77732ae96..a33dfb6135 100644
@@ -384,11 +384,19 @@ static void isl_pmbus_vr_register_nodes(void)
     qos_node_create_driver("isl69260", i2c_device_create);
     qos_node_consumes("isl69260", "i2c-bus", &opts);
 
+    qos_node_create_driver("raa229004", i2c_device_create);
+    qos_node_consumes("raa229004", "i2c-bus", &opts);
+
     qos_add_test("test_defaults", "isl69260", test_defaults, NULL);
     qos_add_test("test_tx_rx", "isl69260", test_tx_rx, NULL);
     qos_add_test("test_rw_regs", "isl69260", test_rw_regs, NULL);
     qos_add_test("test_pages_rw", "isl69260", test_pages_rw, NULL);
     qos_add_test("test_ro_regs", "isl69260", test_ro_regs, NULL);
     qos_add_test("test_ov_faults", "isl69260", test_voltage_faults, NULL);
+
+    qos_add_test("test_tx_rx", "raa229004", test_tx_rx, NULL);
+    qos_add_test("test_rw_regs", "raa229004", test_rw_regs, NULL);
+    qos_add_test("test_pages_rw", "raa229004", test_pages_rw, NULL);
+    qos_add_test("test_ov_faults", "raa229004", test_voltage_faults, NULL);
 }
 libqos_init(isl_pmbus_vr_register_nodes);
Signature · 1 line
2.35.1.616.g0bdcbb4464-goog
Reviewed-by on v3 8/9
#18 lore raw

Re: [PATCH v3 8/9] hw/sensor: add Renesas raa229004 PMBus device

Quoted 9 lines · Titus Rwantare

The Renesas RAA229004 is a PMBus Multiphase Voltage Regulator

---
  hw/sensor/isl_pmbus_vr.c         | 18 ++++++++++++++++++
  include/hw/sensor/isl_pmbus_vr.h |  1 +
  tests/qtest/isl_pmbus_vr-test.c  |  8 ++++++++
  3 files changed, 27 insertions(+)
#19 lore raw

PATCH v3 9/9 hw/sensor: add Renesas raa228000 device

In reply to Titus Rwantare
---
 hw/sensor/isl_pmbus_vr.c         | 50 ++++++++++++++++++++
 include/hw/sensor/isl_pmbus_vr.h |  1 +
 tests/qtest/isl_pmbus_vr-test.c  | 78 ++++++++++++++++++++++++++++++--
 3 files changed, 126 insertions(+), 3 deletions(-)
hw/sensor/isl_pmbus_vr.c +50 -0
index e260faeac3..df7c003ea6 100644
@@ -89,6 +89,24 @@ static void isl_pmbus_vr_exit_reset(Object *obj)
     }
 }
 
+/* The raa228000 uses different direct mode coefficents from most isl devices */
+static void raa228000_exit_reset(Object *obj)
+{
+    isl_pmbus_vr_exit_reset(obj);
+
+    PMBusDevice *pmdev = PMBUS_DEVICE(obj);
+
+    pmdev->pages[0].read_vout = 0;
+    pmdev->pages[0].read_iout = 0;
+    pmdev->pages[0].read_pout = 0;
+    pmdev->pages[0].read_vin = 0;
+    pmdev->pages[0].read_iin = 0;
+    pmdev->pages[0].read_pin = 0;
+    pmdev->pages[0].read_temperature_1 = 0;
+    pmdev->pages[0].read_temperature_2 = 0;
+    pmdev->pages[0].read_temperature_3 = 0;
+}
+
 static void isl_pmbus_vr_add_props(Object *obj, uint64_t *flags, uint8_t pages)
 {
     PMBusDevice *pmdev = PMBUS_DEVICE(obj);
@@ -177,6 +195,20 @@ static void raa22xx_init(Object *obj)
     isl_pmbus_vr_add_props(obj, flags, 2);
 }
 
+static void raa228000_init(Object *obj)
+{
+    PMBusDevice *pmdev = PMBUS_DEVICE(obj);
+    uint64_t flags[1];
+
+    flags[0] = PB_HAS_VIN | PB_HAS_VOUT | PB_HAS_VOUT_MODE |
+               PB_HAS_VOUT_RATING | PB_HAS_VOUT_MARGIN | PB_HAS_IIN |
+               PB_HAS_IOUT | PB_HAS_PIN | PB_HAS_POUT | PB_HAS_TEMPERATURE |
+               PB_HAS_TEMP2 | PB_HAS_TEMP3 | PB_HAS_STATUS_MFR_SPECIFIC;
+
+    pmbus_page_config(pmdev, 0, flags[0]);
+    isl_pmbus_vr_add_props(obj, flags, 1);
+}
+
 static void isl_pmbus_vr_class_init(ObjectClass *klass, void *data,
                                     uint8_t pages)
 {
@@ -195,6 +227,15 @@ static void isl69260_class_init(ObjectClass *klass, void *data)
     isl_pmbus_vr_class_init(klass, data, 2);
 }
 
+static void raa228000_class_init(ObjectClass *klass, void *data)
+{
+    ResettableClass *rc = RESETTABLE_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
+    dc->desc = "Renesas 228000 Digital Multiphase Voltage Regulator";
+    rc->phases.exit = raa228000_exit_reset;
+    isl_pmbus_vr_class_init(klass, data, 1);
+}
+
 static void raa229004_class_init(ObjectClass *klass, void *data)
 {
     ResettableClass *rc = RESETTABLE_CLASS(klass);
@@ -220,9 +261,18 @@ static const TypeInfo raa229004_info = {
     .class_init = raa229004_class_init,
 };
 
+static const TypeInfo raa228000_info = {
+    .name = TYPE_RAA228000,
+    .parent = TYPE_PMBUS_DEVICE,
+    .instance_size = sizeof(ISLState),
+    .instance_init = raa228000_init,
+    .class_init = raa228000_class_init,
+};
+
 static void isl_pmbus_vr_register_types(void)
 {
     type_register_static(&isl69260_info);
+    type_register_static(&raa228000_info);
     type_register_static(&raa229004_info);
 }
 
include/hw/sensor/isl_pmbus_vr.h +1 -0
index 233916f70a..3e47ff7e48 100644
@@ -13,6 +13,7 @@
 #include "qom/object.h"
 
 #define TYPE_ISL69260   "isl69260"
+#define TYPE_RAA228000  "raa228000"
 #define TYPE_RAA229004  "raa229004"
 
 struct ISLState {
tests/qtest/isl_pmbus_vr-test.c +75 -3

99 lines not on this page · raw message

Signature · 1 line
2.35.1.616.g0bdcbb4464-goog
Reviewed-by on v3 9/9
#20 lore raw

Re: [PATCH v3 9/9] hw/sensor: add Renesas raa228000 device

Quoted 13 lines · Titus Rwantare
---
  hw/sensor/isl_pmbus_vr.c         | 50 ++++++++++++++++++++
  include/hw/sensor/isl_pmbus_vr.h |  1 +
  tests/qtest/isl_pmbus_vr-test.c  | 78 ++++++++++++++++++++++++++++++--
  3 files changed, 126 insertions(+), 3 deletions(-)
hw/sensor/isl_pmbus_vr.c +0 -0
index e260faeac3..df7c003ea6 100644

hw/sensor/isl_pmbus_vr.c static void isl_pmbus_vr_exit_reset(Object *obj) · line 97

Quoted 9 lines
hw/sensor/isl_pmbus_vr.c +6 -0
@@ -89,6 +89,24 @@ static void isl_pmbus_vr_exit_reset(Object *obj)
      }
  }
 
+/* The raa228000 uses different direct mode coefficents from most isl devices */
+static void raa228000_exit_reset(Object *obj)
+{
+    isl_pmbus_vr_exit_reset(obj);
+
+    PMBusDevice *pmdev = PMBUS_DEVICE(obj);

Per QEMU CodingStyle, variables are declared first.

Quoted 25 lines
hw/sensor/isl_pmbus_vr.c +10 -3
+    pmdev->pages[0].read_vout = 0;
+    pmdev->pages[0].read_iout = 0;
+    pmdev->pages[0].read_pout = 0;
+    pmdev->pages[0].read_vin = 0;
+    pmdev->pages[0].read_iin = 0;
+    pmdev->pages[0].read_pin = 0;
+    pmdev->pages[0].read_temperature_1 = 0;
+    pmdev->pages[0].read_temperature_2 = 0;
+    pmdev->pages[0].read_temperature_3 = 0;
+}
 
  /* test qmp access */
  static void test_tx_rx(void *obj, void *data, QGuestAllocator *alloc)
  {
@@ -384,9 +448,6 @@ static void isl_pmbus_vr_register_nodes(void)
      qos_node_create_driver("isl69260", i2c_device_create);
      qos_node_consumes("isl69260", "i2c-bus", &opts);
 
-    qos_node_create_driver("raa229004", i2c_device_create);
-    qos_node_consumes("raa229004", "i2c-bus", &opts);
-
      qos_add_test("test_defaults", "isl69260", test_defaults, NULL);
      qos_add_test("test_tx_rx", "isl69260", test_tx_rx, NULL);
      qos_add_test("test_rw_regs", "isl69260", test_rw_regs, NULL);

hw/sensor/isl_pmbus_vr.c static void isl_pmbus_vr_register_nodes(void) · line 460

Quoted 6 lines
hw/sensor/isl_pmbus_vr.c +3 -0
@@ -394,9 +455,20 @@ static void isl_pmbus_vr_register_nodes(void)
      qos_add_test("test_ro_regs", "isl69260", test_ro_regs, NULL);
      qos_add_test("test_ov_faults", "isl69260", test_voltage_faults, NULL);
 
+    qos_node_create_driver("raa229004", i2c_device_create);
+    qos_node_consumes("raa229004", "i2c-bus", &opts);
+

Squash in previous commit?

hw/sensor/isl_pmbus_vr.c static void isl_pmbus_vr_register_nodes(void) · line 464

Quoted 4 lines
hw/sensor/isl_pmbus_vr.c +0 -0
      qos_add_test("test_tx_rx", "raa229004", test_tx_rx, NULL);
      qos_add_test("test_rw_regs", "raa229004", test_rw_regs, NULL);
      qos_add_test("test_pages_rw", "raa229004", test_pages_rw, NULL);
      qos_add_test("test_ov_faults", "raa229004", test_voltage_faults, NULL);

Otherwise,

Acked-by on the v3 series
#21 lore raw
In reply to Titus Rwantare
Quoted 8 lines · Titus Rwantare

v2:
- split PMBus commit with updates into individual fixes
- renamed isl_pmbus[.ch] adding _vr for voltage regulators

v3:
- split uint refactor commit and removed commit renaming files
- rename rolled into preceding commits
- update commit description for uint refactoring change

This all looks good to me:

Do you have a plan for getting this in to qemu? Like through the ARM tree? I could take it into an I2C tree, but there's really not much activity or work there.

-corey

Quoted 32 lines

Shengtan Mao (1):
hw/i2c: Added linear mode translation for pmbus devices

Titus Rwantare (8):
hw/i2c: pmbus: add registers
hw/i2c: pmbus: guard against out of range accesses hw/i2c: pmbus: add PEC unsupported warning hw/i2c: pmbus: refactor uint handling hw/i2c: pmbus: update MAINTAINERS hw/sensor: add Intersil ISL69260 device model hw/sensor: add Renesas raa229004 PMBus device hw/sensor: add Renesas raa228000 device

 MAINTAINERS                      |  13 +
 hw/arm/Kconfig                   |   1 +
 hw/i2c/pmbus_device.c            | 106 ++++++-
 hw/sensor/Kconfig                |   5 +
 hw/sensor/isl_pmbus_vr.c         | 279 ++++++++++++++++++
 hw/sensor/meson.build            |   1 +
 include/hw/i2c/pmbus_device.h    |  23 +-
 include/hw/sensor/isl_pmbus_vr.h |  52 ++++
 tests/qtest/isl_pmbus_vr-test.c  | 474 +++++++++++++++++++++++++++++++
 tests/qtest/meson.build          |   1 +
 10 files changed, 944 insertions(+), 11 deletions(-)
 create mode 100644 hw/sensor/isl_pmbus_vr.c
 create mode 100644 include/hw/sensor/isl_pmbus_vr.h
 create mode 100644 tests/qtest/isl_pmbus_vr-test.c
Signature · 1 line
2.35.1.616.g0bdcbb4464-goog
#22 lore raw
Quoted 13 lines · Corey Minyard
Quoted 8 lines · Titus Rwantare

v2:
- split PMBus commit with updates into individual fixes
- renamed isl_pmbus[.ch] adding _vr for voltage regulators

v3:
- split uint refactor commit and removed commit renaming files
- rename rolled into preceding commits
- update commit description for uint refactoring change

This all looks good to me:

Quoted 7 lines

Do you have a plan for getting this in to qemu? Like through the ARM tree? I could take it into an I2C tree, but there's really not much activity or work there.

-corey

In general PMBus is more specific to i2c than ARM, but I'm not sure of the QEMU implications.

Titus

#23 lore raw
Quoted 16 lines · Titus Rwantare
Quoted 15 lines · Corey Minyard
Quoted 8 lines · Titus Rwantare

v2:
- split PMBus commit with updates into individual fixes
- renamed isl_pmbus[.ch] adding _vr for voltage regulators

v3:
- split uint refactor commit and removed commit renaming files
- rename rolled into preceding commits
- update commit description for uint refactoring change

This all looks good to me:

Quoted 8 lines
Quoted 5 lines

Do you have a plan for getting this in to qemu? Like through the ARM tree? I could take it into an I2C tree, but there's really not much activity or work there.

-corey

In general PMBus is more specific to i2c than ARM, but I'm not sure of the QEMU implications.

Titus, could you address my comments?

Corey, if you are busy, I can take care of this series.

Regards,

Phil.

#24 lore raw
Quoted 21 lines · Philippe Mathieu-Daudé
Quoted 20 lines · Titus Rwantare
Quoted 19 lines · Corey Minyard
Quoted 8 lines · Titus Rwantare

v2:
- split PMBus commit with updates into individual fixes
- renamed isl_pmbus[.ch] adding _vr for voltage regulators

v3:
- split uint refactor commit and removed commit renaming files
- rename rolled into preceding commits
- update commit description for uint refactoring change

This all looks good to me:

Do you have a plan for getting this in to qemu? Like through the ARM tree? I could take it into an I2C tree, but there's really not much activity or work there.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

-corey

In general PMBus is more specific to i2c than ARM, but I'm not sure of the QEMU implications.

Titus, could you address my comments?

Corey, if you are busy, I can take care of this series.

It's not a "too busy" sort of thing, the i2c tree doesn't get much traffic. I can take it, but it's not much different than just pulling it directly.

So it's probably best if you take it.

Thanks,

-corey

Quoted 5 lines

Regards,

Phil.

#25 lore raw
Quoted 29 lines · Corey Minyard
Quoted 28 lines · Philippe Mathieu-Daudé
Quoted 16 lines · Titus Rwantare
Quoted 15 lines · Corey Minyard
Quoted 8 lines · Titus Rwantare

v2:
- split PMBus commit with updates into individual fixes
- renamed isl_pmbus[.ch] adding _vr for voltage regulators

v3:
- split uint refactor commit and removed commit renaming files
- rename rolled into preceding commits
- update commit description for uint refactoring change

This all looks good to me:

Quoted 8 lines
Quoted 5 lines

Do you have a plan for getting this in to qemu? Like through the ARM tree? I could take it into an I2C tree, but there's really not much activity or work there.

-corey

In general PMBus is more specific to i2c than ARM, but I'm not sure of the QEMU implications.

Titus, could you address my comments?

Quoted 7 lines
Quoted 1 line

Corey, if you are busy, I can take care of this series.

It's not a "too busy" sort of thing, the i2c tree doesn't get much traffic. I can take it, but it's not much different than just pulling it directly.

So it's probably best if you take it.

OK. I'll send a pullreq shortly.

Regards,

Phil.