Linux-Hwmon Archive on lore.kernel.org
 help / color / Atom feed
* [RFC PATCH hwmon-next v1 0/5] hwmon: (pmbus) Add support for vid mode calculation per page bases
@ 2020-01-05 10:58 Vadim Pasternak
  2020-01-05 10:58 ` [RFC PATCH hwmon-next v1 1/5] hwmon: (pmbus/core) Add support for vid mode detection " Vadim Pasternak
                   ` (4 more replies)
  0 siblings, 5 replies; 27+ messages in thread
From: Vadim Pasternak @ 2020-01-05 10:58 UTC (permalink / raw)
  To: linux, robh+dt, vijaykhemka; +Cc: linux-hwmon, devicetree, Vadim Pasternak

Currently "pmbus" infrastructure does not build for support reading
"vout" in "vid" mode, for cases when device is configured with the
different modes per page bases.
However some devices could be configured in such way.
The patchset includes:
Patch#1 allows selection mode per pmbus page bases, by extending
	"vrm_version" field to per page array and modify the drivers
	using this field.
Patch#2 introduces support for "vrm" mode "IMVP9".
Patch#3 makes use of "IMVP9" mode for "tps53679" driver.
Patch#4 extends binding documentation for trivial devices.
Patch#5 extends "tps53679" driver with support of the additional
devices:
	Texas Instruments Dual channel DCAP+ multiphase controllers:
	TPS53688, SN1906016.
	Infineon Multi-phase Digital VR Controller Sierra controllers
	XDPE12286C, XDPE12284C, XDPE12283C, XDPE12254C and XDPE12250C.

Vadim Pasternak (5):
  hwmon: (pmbus/core) Add support for vid mode detection per page bases
  hwmon: (pmbus/core) Add support for Intel IMVP9 specification
  hwmon: (pmbus/tps53679) Allow support for Intel IMVP9 specification
  dt-bindings: Add TI and Infineon VR Controllers as trivial devices
  hwmon: (pmbus/tps53679) Extend device list supported by driver

 .../devicetree/bindings/trivial-devices.yaml       | 16 ++++++
 drivers/hwmon/pmbus/Kconfig                        |  5 +-
 drivers/hwmon/pmbus/max20751.c                     |  2 +-
 drivers/hwmon/pmbus/pmbus.c                        |  5 +-
 drivers/hwmon/pmbus/pmbus.h                        |  4 +-
 drivers/hwmon/pmbus/pmbus_core.c                   |  6 ++-
 drivers/hwmon/pmbus/pxe1610.c                      | 44 ++++++++-------
 drivers/hwmon/pmbus/tps53679.c                     | 62 ++++++++++++++--------
 8 files changed, 95 insertions(+), 49 deletions(-)

-- 
2.11.0


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [RFC PATCH hwmon-next v1 1/5] hwmon: (pmbus/core) Add support for vid mode detection per page bases
  2020-01-05 10:58 [RFC PATCH hwmon-next v1 0/5] hwmon: (pmbus) Add support for vid mode calculation per page bases Vadim Pasternak
@ 2020-01-05 10:58 ` " Vadim Pasternak
  2020-01-05 10:58 ` [RFC PATCH hwmon-next v1 2/5] hwmon: (pmbus/core) Add support for Intel IMVP9 specification Vadim Pasternak
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 27+ messages in thread
From: Vadim Pasternak @ 2020-01-05 10:58 UTC (permalink / raw)
  To: linux, robh+dt, vijaykhemka; +Cc: linux-hwmon, devicetree, Vadim Pasternak

Add support for VID protocol detection per page bases, instead of
detecting it based on "PMBU_VOUT" readout from page 0 for all the pages
supported by particular device.
The reason that some devices allows to configure different VID modes
per page within the same device.
Patch modifies the field "vrm_version" within the structure
"pmbus_driver_info" to be per page array.

Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
---
 drivers/hwmon/pmbus/max20751.c   |  2 +-
 drivers/hwmon/pmbus/pmbus.c      |  5 +++--
 drivers/hwmon/pmbus/pmbus.h      |  2 +-
 drivers/hwmon/pmbus/pmbus_core.c |  2 +-
 drivers/hwmon/pmbus/pxe1610.c    | 44 ++++++++++++++++++++++------------------
 drivers/hwmon/pmbus/tps53679.c   | 44 +++++++++++++++++++++-------------------
 6 files changed, 53 insertions(+), 46 deletions(-)

diff --git a/drivers/hwmon/pmbus/max20751.c b/drivers/hwmon/pmbus/max20751.c
index ee5f0cdbde06..da3c38cb9a5c 100644
--- a/drivers/hwmon/pmbus/max20751.c
+++ b/drivers/hwmon/pmbus/max20751.c
@@ -16,7 +16,7 @@ static struct pmbus_driver_info max20751_info = {
 	.pages = 1,
 	.format[PSC_VOLTAGE_IN] = linear,
 	.format[PSC_VOLTAGE_OUT] = vid,
-	.vrm_version = vr12,
+	.vrm_version[0] = vr12,
 	.format[PSC_TEMPERATURE] = linear,
 	.format[PSC_CURRENT_OUT] = linear,
 	.format[PSC_POWER] = linear,
diff --git a/drivers/hwmon/pmbus/pmbus.c b/drivers/hwmon/pmbus/pmbus.c
index c0bc43d01018..9109f305ebbb 100644
--- a/drivers/hwmon/pmbus/pmbus.c
+++ b/drivers/hwmon/pmbus/pmbus.c
@@ -115,7 +115,7 @@ static int pmbus_identify(struct i2c_client *client,
 	}
 
 	if (pmbus_check_byte_register(client, 0, PMBUS_VOUT_MODE)) {
-		int vout_mode;
+		int vout_mode, i;
 
 		vout_mode = pmbus_read_byte_data(client, 0, PMBUS_VOUT_MODE);
 		if (vout_mode >= 0 && vout_mode != 0xff) {
@@ -124,7 +124,8 @@ static int pmbus_identify(struct i2c_client *client,
 				break;
 			case 1:
 				info->format[PSC_VOLTAGE_OUT] = vid;
-				info->vrm_version = vr11;
+				for (i = 0; i < info->pages; i++)
+					info->vrm_version[i] = vr11;
 				break;
 			case 2:
 				info->format[PSC_VOLTAGE_OUT] = direct;
diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h
index d198af3a92b6..2bdebd0ea9c1 100644
--- a/drivers/hwmon/pmbus/pmbus.h
+++ b/drivers/hwmon/pmbus/pmbus.h
@@ -382,7 +382,7 @@ enum vrm_version { vr11 = 0, vr12, vr13 };
 struct pmbus_driver_info {
 	int pages;		/* Total number of pages */
 	enum pmbus_data_format format[PSC_NUM_CLASSES];
-	enum vrm_version vrm_version;
+	enum vrm_version vrm_version[PMBUS_PAGES]; /* vrm version per page */
 	/*
 	 * Support one set of coefficients for each sensor type
 	 * Used for chips providing data in direct mode.
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index 8470097907bc..98226e84b351 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -696,7 +696,7 @@ static long pmbus_reg2data_vid(struct pmbus_data *data,
 	long val = sensor->data;
 	long rv = 0;
 
-	switch (data->info->vrm_version) {
+	switch (data->info->vrm_version[sensor->page]) {
 	case vr11:
 		if (val >= 0x02 && val <= 0xb2)
 			rv = DIV_ROUND_CLOSEST(160000 - (val - 2) * 625, 100);
diff --git a/drivers/hwmon/pmbus/pxe1610.c b/drivers/hwmon/pmbus/pxe1610.c
index ebe3f023f840..517584cff3de 100644
--- a/drivers/hwmon/pmbus/pxe1610.c
+++ b/drivers/hwmon/pmbus/pxe1610.c
@@ -19,26 +19,30 @@
 static int pxe1610_identify(struct i2c_client *client,
 			     struct pmbus_driver_info *info)
 {
-	if (pmbus_check_byte_register(client, 0, PMBUS_VOUT_MODE)) {
-		u8 vout_mode;
-		int ret;
-
-		/* Read the register with VOUT scaling value.*/
-		ret = pmbus_read_byte_data(client, 0, PMBUS_VOUT_MODE);
-		if (ret < 0)
-			return ret;
-
-		vout_mode = ret & GENMASK(4, 0);
-
-		switch (vout_mode) {
-		case 1:
-			info->vrm_version = vr12;
-			break;
-		case 2:
-			info->vrm_version = vr13;
-			break;
-		default:
-			return -ENODEV;
+	int i;
+
+	for (i = 0; i < PXE1610_NUM_PAGES; i++) {
+		if (pmbus_check_byte_register(client, i, PMBUS_VOUT_MODE)) {
+			u8 vout_mode;
+			int ret;
+
+			/* Read the register with VOUT scaling value.*/
+			ret = pmbus_read_byte_data(client, i, PMBUS_VOUT_MODE);
+			if (ret < 0)
+				return ret;
+
+			vout_mode = ret & GENMASK(4, 0);
+
+			switch (vout_mode) {
+			case 1:
+				info->vrm_version[i] = vr12;
+				break;
+			case 2:
+				info->vrm_version[i] = vr13;
+				break;
+			default:
+				return -ENODEV;
+			}
 		}
 	}
 
diff --git a/drivers/hwmon/pmbus/tps53679.c b/drivers/hwmon/pmbus/tps53679.c
index 86bb3aca09ed..163e8c6aaa8e 100644
--- a/drivers/hwmon/pmbus/tps53679.c
+++ b/drivers/hwmon/pmbus/tps53679.c
@@ -24,27 +24,29 @@ static int tps53679_identify(struct i2c_client *client,
 			     struct pmbus_driver_info *info)
 {
 	u8 vout_params;
-	int ret;
-
-	/* Read the register with VOUT scaling value.*/
-	ret = pmbus_read_byte_data(client, 0, PMBUS_VOUT_MODE);
-	if (ret < 0)
-		return ret;
-
-	vout_params = ret & GENMASK(4, 0);
-
-	switch (vout_params) {
-	case TPS53679_PROT_VR13_10MV:
-	case TPS53679_PROT_VR12_5_10MV:
-		info->vrm_version = vr13;
-		break;
-	case TPS53679_PROT_VR13_5MV:
-	case TPS53679_PROT_VR12_5MV:
-	case TPS53679_PROT_IMVP8_5MV:
-		info->vrm_version = vr12;
-		break;
-	default:
-		return -EINVAL;
+	int i, ret;
+
+	for (i = 0; i < TPS53679_PAGE_NUM; i++) {
+		/* Read the register with VOUT scaling value.*/
+		ret = pmbus_read_byte_data(client, i, PMBUS_VOUT_MODE);
+		if (ret < 0)
+			return ret;
+
+		vout_params = ret & GENMASK(4, 0);
+
+		switch (vout_params) {
+		case TPS53679_PROT_VR13_10MV:
+		case TPS53679_PROT_VR12_5_10MV:
+			info->vrm_version[i] = vr13;
+			break;
+		case TPS53679_PROT_VR13_5MV:
+		case TPS53679_PROT_VR12_5MV:
+		case TPS53679_PROT_IMVP8_5MV:
+			info->vrm_version[i] = vr12;
+			break;
+		default:
+			return -EINVAL;
+		}
 	}
 
 	return 0;
-- 
2.11.0


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [RFC PATCH hwmon-next v1 2/5] hwmon: (pmbus/core) Add support for Intel IMVP9 specification
  2020-01-05 10:58 [RFC PATCH hwmon-next v1 0/5] hwmon: (pmbus) Add support for vid mode calculation per page bases Vadim Pasternak
  2020-01-05 10:58 ` [RFC PATCH hwmon-next v1 1/5] hwmon: (pmbus/core) Add support for vid mode detection " Vadim Pasternak
@ 2020-01-05 10:58 ` Vadim Pasternak
  2020-01-05 16:26   ` Guenter Roeck
  2020-01-05 10:58 ` [RFC PATCH hwmon-next v1 3/5] hwmon: (pmbus/tps53679) Allow " Vadim Pasternak
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 27+ messages in thread
From: Vadim Pasternak @ 2020-01-05 10:58 UTC (permalink / raw)
  To: linux, robh+dt, vijaykhemka; +Cc: linux-hwmon, devicetree, Vadim Pasternak

Extend "vrm_version" with support for Intel IMVP9 specification.

Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
---
 drivers/hwmon/pmbus/pmbus.h      | 2 +-
 drivers/hwmon/pmbus/pmbus_core.c | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h
index 2bdebd0ea9c1..c6b2401f1c6c 100644
--- a/drivers/hwmon/pmbus/pmbus.h
+++ b/drivers/hwmon/pmbus/pmbus.h
@@ -377,7 +377,7 @@ enum pmbus_sensor_classes {
 #define PMBUS_PAGE_VIRTUAL	BIT(31)
 
 enum pmbus_data_format { linear = 0, direct, vid };
-enum vrm_version { vr11 = 0, vr12, vr13 };
+enum vrm_version { vr11 = 0, vr12, vr13, imvp9 };
 
 struct pmbus_driver_info {
 	int pages;		/* Total number of pages */
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index 98226e84b351..a9b7b555cf6e 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -709,6 +709,10 @@ static long pmbus_reg2data_vid(struct pmbus_data *data,
 		if (val >= 0x01)
 			rv = 500 + (val - 1) * 10;
 		break;
+	case imvp9:
+		if (val >= 0x01)
+			rv = 200 + (val - 1) * 10;
+		break;
 	}
 	return rv;
 }
-- 
2.11.0


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [RFC PATCH hwmon-next v1 3/5] hwmon: (pmbus/tps53679) Allow support for Intel IMVP9 specification
  2020-01-05 10:58 [RFC PATCH hwmon-next v1 0/5] hwmon: (pmbus) Add support for vid mode calculation per page bases Vadim Pasternak
  2020-01-05 10:58 ` [RFC PATCH hwmon-next v1 1/5] hwmon: (pmbus/core) Add support for vid mode detection " Vadim Pasternak
  2020-01-05 10:58 ` [RFC PATCH hwmon-next v1 2/5] hwmon: (pmbus/core) Add support for Intel IMVP9 specification Vadim Pasternak
@ 2020-01-05 10:58 ` " Vadim Pasternak
  2020-01-05 10:58 ` [RFC PATCH hwmon-next v1 4/5] dt-bindings: Add TI and Infineon VR Controllers as trivial devices Vadim Pasternak
  2020-01-05 10:58 ` [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver Vadim Pasternak
  4 siblings, 0 replies; 27+ messages in thread
From: Vadim Pasternak @ 2020-01-05 10:58 UTC (permalink / raw)
  To: linux, robh+dt, vijaykhemka; +Cc: linux-hwmon, devicetree, Vadim Pasternak

Allow driver to Intel IMVP9 specification.

Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
---
 drivers/hwmon/pmbus/tps53679.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/hwmon/pmbus/tps53679.c b/drivers/hwmon/pmbus/tps53679.c
index 163e8c6aaa8e..7ce2fca4acde 100644
--- a/drivers/hwmon/pmbus/tps53679.c
+++ b/drivers/hwmon/pmbus/tps53679.c
@@ -15,6 +15,7 @@
 
 #define TPS53679_PROT_VR12_5MV		0x01 /* VR12.0 mode, 5-mV DAC */
 #define TPS53679_PROT_VR12_5_10MV	0x02 /* VR12.5 mode, 10-mV DAC */
+#define TPS53679_PROT_IMVP9_10MV	0x03 /* IMVP9 mode, 10-mV DAC */
 #define TPS53679_PROT_VR13_10MV		0x04 /* VR13.0 mode, 10-mV DAC */
 #define TPS53679_PROT_IMVP8_5MV		0x05 /* IMVP8 mode, 5-mV DAC */
 #define TPS53679_PROT_VR13_5MV		0x07 /* VR13.0 mode, 5-mV DAC */
@@ -44,6 +45,9 @@ static int tps53679_identify(struct i2c_client *client,
 		case TPS53679_PROT_IMVP8_5MV:
 			info->vrm_version[i] = vr12;
 			break;
+		case TPS53679_PROT_IMVP9_10MV:
+			info->vrm_version[i] = imvp9;
+			break;
 		default:
 			return -EINVAL;
 		}
-- 
2.11.0


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [RFC PATCH hwmon-next v1 4/5] dt-bindings: Add TI and Infineon VR Controllers as trivial devices
  2020-01-05 10:58 [RFC PATCH hwmon-next v1 0/5] hwmon: (pmbus) Add support for vid mode calculation per page bases Vadim Pasternak
                   ` (2 preceding siblings ...)
  2020-01-05 10:58 ` [RFC PATCH hwmon-next v1 3/5] hwmon: (pmbus/tps53679) Allow " Vadim Pasternak
@ 2020-01-05 10:58 ` Vadim Pasternak
  2020-01-05 10:58 ` [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver Vadim Pasternak
  4 siblings, 0 replies; 27+ messages in thread
From: Vadim Pasternak @ 2020-01-05 10:58 UTC (permalink / raw)
  To: linux, robh+dt, vijaykhemka; +Cc: linux-hwmon, devicetree, Vadim Pasternak

Add Texas Instruments Dual channel DCAP+ multiphase controllers:
TPS53679, TPS53688, SN1906016 and Infineon Multi-phase Digital VR
controllers XDPE12286C, XDPE12284C, XDPE12283C, XDPE12254C, XDPE12250C
as trivial devices.

Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
---
 Documentation/devicetree/bindings/trivial-devices.yaml | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
index 765fd1c170df..dbd71d01ede0 100644
--- a/Documentation/devicetree/bindings/trivial-devices.yaml
+++ b/Documentation/devicetree/bindings/trivial-devices.yaml
@@ -104,6 +104,16 @@ properties:
           - infineon,slb9645tt
             # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor
           - infineon,tlv493d-a1b6
+            # Infineon Multi-phase Digital VR Controller xdpe12283c
+          - infineon,xdpe12283c
+            # Infineon Multi-phase Digital VR Controller xdpe12250c
+          - infineon,xdpe12250c
+            # Infineon Multi-phase Digital VR Controller xdpe12254c
+          - infineon,xdpe12254c
+            # Infineon Multi-phase Digital VR Controller xdpe12284c
+          - infineon,xdpe12284c
+            # Infineon Multi-phase Digital VR Controller xdpe12286c
+          - infineon,xdpe12286c
             # Inspur Power System power supply unit version 1
           - inspur,ipsps1
             # Intersil ISL29028 Ambient Light and Proximity Sensor
@@ -354,6 +364,12 @@ properties:
           - ti,tmp103
             # Digital Temperature Sensor
           - ti,tmp275
+            # TI Dual channel DCAP+ multiphase controller TPS53679
+          - ti,tps53679
+            # TI Dual channel DCAP+ multiphase controller TPS53688
+          - ti,tps53688
+            # TI Dual channel DCAP+ multiphase controller SN1906016
+          - ti,sn1906016
             # Winbond/Nuvoton H/W Monitor
           - winbond,w83793
             # i2c trusted platform module (TPM)
-- 
2.11.0


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver
  2020-01-05 10:58 [RFC PATCH hwmon-next v1 0/5] hwmon: (pmbus) Add support for vid mode calculation per page bases Vadim Pasternak
                   ` (3 preceding siblings ...)
  2020-01-05 10:58 ` [RFC PATCH hwmon-next v1 4/5] dt-bindings: Add TI and Infineon VR Controllers as trivial devices Vadim Pasternak
@ 2020-01-05 10:58 ` Vadim Pasternak
  2020-01-05 16:03   ` Guenter Roeck
  4 siblings, 1 reply; 27+ messages in thread
From: Vadim Pasternak @ 2020-01-05 10:58 UTC (permalink / raw)
  To: linux, robh+dt, vijaykhemka; +Cc: linux-hwmon, devicetree, Vadim Pasternak

Extends driver with support of the additional devices:
Texas Instruments Dual channel DCAP+ multiphase controllers: TPS53688,
SN1906016.
Infineon Multi-phase Digital VR Controller Sierra devices
XDPE12286C, XDPE12284C, XDPE12283C, XDPE12254C and XDPE12250C.

Extend Kconfig with added devices.

Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
---
 drivers/hwmon/pmbus/Kconfig    |  5 +++--
 drivers/hwmon/pmbus/tps53679.c | 14 ++++++++++++++
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
index 59859979571d..9e3d197d5322 100644
--- a/drivers/hwmon/pmbus/Kconfig
+++ b/drivers/hwmon/pmbus/Kconfig
@@ -200,10 +200,11 @@ config SENSORS_TPS40422
 	  be called tps40422.
 
 config SENSORS_TPS53679
-	tristate "TI TPS53679"
+	tristate "TI TPS53679, TPS53688, SN1906016, Infineon XDPE122xxx family"
 	help
 	  If you say yes here you get hardware monitoring support for TI
-	  TPS53679.
+	  TPS53679, PS53688, SN1906016 and Infineon XDPE12286C, XDPE12284C,
+	  XDPE12283C, XDPE12254C, XDPE12250C devices.
 
 	  This driver can also be built as a module. If so, the module will
 	  be called tps53679.
diff --git a/drivers/hwmon/pmbus/tps53679.c b/drivers/hwmon/pmbus/tps53679.c
index 7ce2fca4acde..f38eb116735b 100644
--- a/drivers/hwmon/pmbus/tps53679.c
+++ b/drivers/hwmon/pmbus/tps53679.c
@@ -89,6 +89,13 @@ static int tps53679_probe(struct i2c_client *client,
 
 static const struct i2c_device_id tps53679_id[] = {
 	{"tps53679", 0},
+	{"tps53688", 0},
+	{"sn1906016", 0},
+	{"xdpe12283c", 0},
+	{"xdpe12250c", 0},
+	{"xdpe12254c", 0},
+	{"xdpe12284c", 0},
+	{"xdpe12286c", 0},
 	{}
 };
 
@@ -96,6 +103,13 @@ MODULE_DEVICE_TABLE(i2c, tps53679_id);
 
 static const struct of_device_id __maybe_unused tps53679_of_match[] = {
 	{.compatible = "ti,tps53679"},
+	{.compatible = "ti,tps53688"},
+	{.compatible = "ti,sn1906016"},
+	{.compatible = "infineon,xdpe12283c"},
+	{.compatible = "infineon,xdpe12250c"},
+	{.compatible = "infineon,xdpe12254c"},
+	{.compatible = "infineon,xdpe12284c"},
+	{.compatible = "infineon,xdpe12286c"},
 	{}
 };
 MODULE_DEVICE_TABLE(of, tps53679_of_match);
-- 
2.11.0


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver
  2020-01-05 10:58 ` [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver Vadim Pasternak
@ 2020-01-05 16:03   ` Guenter Roeck
  2020-01-05 16:44     ` Vadim Pasternak
  0 siblings, 1 reply; 27+ messages in thread
From: Guenter Roeck @ 2020-01-05 16:03 UTC (permalink / raw)
  To: Vadim Pasternak, robh+dt, vijaykhemka; +Cc: linux-hwmon, devicetree

On 1/5/20 2:58 AM, Vadim Pasternak wrote:
> Extends driver with support of the additional devices:
> Texas Instruments Dual channel DCAP+ multiphase controllers: TPS53688,
> SN1906016.
> Infineon Multi-phase Digital VR Controller Sierra devices
> XDPE12286C, XDPE12284C, XDPE12283C, XDPE12254C and XDPE12250C.
> 
> Extend Kconfig with added devices.
> 
> Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
> ---
>   drivers/hwmon/pmbus/Kconfig    |  5 +++--
>   drivers/hwmon/pmbus/tps53679.c | 14 ++++++++++++++
>   2 files changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
> index 59859979571d..9e3d197d5322 100644
> --- a/drivers/hwmon/pmbus/Kconfig
> +++ b/drivers/hwmon/pmbus/Kconfig
> @@ -200,10 +200,11 @@ config SENSORS_TPS40422
>   	  be called tps40422.
>   
>   config SENSORS_TPS53679
> -	tristate "TI TPS53679"
> +	tristate "TI TPS53679, TPS53688, SN1906016, Infineon XDPE122xxx family"
>   	help
>   	  If you say yes here you get hardware monitoring support for TI
> -	  TPS53679.
> +	  TPS53679, PS53688, SN1906016 and Infineon XDPE12286C, XDPE12284C,

TPS53688. For the others, for some I can't even determine if they exist
in the first place (eg SN1906016, XPDE12250C) or how they would differ
from other variants (eg XPDE12284C vs. XPDE12284A).
And why would they all use the same bit map in the VOUT_MODE register,
the same number of PMBus pages (phases), and the same attributes in each
page ?

Thanks,
Guenter

> +	  XDPE12283C, XDPE12254C, XDPE12250C devices.
>   
>   	  This driver can also be built as a module. If so, the module will
>   	  be called tps53679.
> diff --git a/drivers/hwmon/pmbus/tps53679.c b/drivers/hwmon/pmbus/tps53679.c
> index 7ce2fca4acde..f38eb116735b 100644
> --- a/drivers/hwmon/pmbus/tps53679.c
> +++ b/drivers/hwmon/pmbus/tps53679.c
> @@ -89,6 +89,13 @@ static int tps53679_probe(struct i2c_client *client,
>   
>   static const struct i2c_device_id tps53679_id[] = {
>   	{"tps53679", 0},
> +	{"tps53688", 0},
> +	{"sn1906016", 0},
> +	{"xdpe12283c", 0},
> +	{"xdpe12250c", 0},
> +	{"xdpe12254c", 0},
> +	{"xdpe12284c", 0},
> +	{"xdpe12286c", 0},

Alphabetic order, please.

>   	{}
>   };
>   
> @@ -96,6 +103,13 @@ MODULE_DEVICE_TABLE(i2c, tps53679_id);
>   
>   static const struct of_device_id __maybe_unused tps53679_of_match[] = {
>   	{.compatible = "ti,tps53679"},
> +	{.compatible = "ti,tps53688"},
> +	{.compatible = "ti,sn1906016"},
> +	{.compatible = "infineon,xdpe12283c"},
> +	{.compatible = "infineon,xdpe12250c"},
> +	{.compatible = "infineon,xdpe12254c"},
> +	{.compatible = "infineon,xdpe12284c"},
> +	{.compatible = "infineon,xdpe12286c"},
>   	{}
>   };
>   MODULE_DEVICE_TABLE(of, tps53679_of_match);
> 


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC PATCH hwmon-next v1 2/5] hwmon: (pmbus/core) Add support for Intel IMVP9 specification
  2020-01-05 10:58 ` [RFC PATCH hwmon-next v1 2/5] hwmon: (pmbus/core) Add support for Intel IMVP9 specification Vadim Pasternak
@ 2020-01-05 16:26   ` Guenter Roeck
  2020-01-05 17:15     ` Vadim Pasternak
  2020-01-06 12:14     ` Vadim Pasternak
  0 siblings, 2 replies; 27+ messages in thread
From: Guenter Roeck @ 2020-01-05 16:26 UTC (permalink / raw)
  To: Vadim Pasternak, robh+dt, vijaykhemka; +Cc: linux-hwmon, devicetree

On 1/5/20 2:58 AM, Vadim Pasternak wrote:
> Extend "vrm_version" with support for Intel IMVP9 specification.
> 
> Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
> ---
>   drivers/hwmon/pmbus/pmbus.h      | 2 +-
>   drivers/hwmon/pmbus/pmbus_core.c | 4 ++++
>   2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h
> index 2bdebd0ea9c1..c6b2401f1c6c 100644
> --- a/drivers/hwmon/pmbus/pmbus.h
> +++ b/drivers/hwmon/pmbus/pmbus.h
> @@ -377,7 +377,7 @@ enum pmbus_sensor_classes {
>   #define PMBUS_PAGE_VIRTUAL	BIT(31)
>   
>   enum pmbus_data_format { linear = 0, direct, vid };
> -enum vrm_version { vr11 = 0, vr12, vr13 };
> +enum vrm_version { vr11 = 0, vr12, vr13, imvp9 };
>   
>   struct pmbus_driver_info {
>   	int pages;		/* Total number of pages */
> diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
> index 98226e84b351..a9b7b555cf6e 100644
> --- a/drivers/hwmon/pmbus/pmbus_core.c
> +++ b/drivers/hwmon/pmbus/pmbus_core.c
> @@ -709,6 +709,10 @@ static long pmbus_reg2data_vid(struct pmbus_data *data,
>   		if (val >= 0x01)
>   			rv = 500 + (val - 1) * 10;
>   		break;
> +	case imvp9:
> +		if (val >= 0x01)
> +			rv = 200 + (val - 1) * 10;
> +		break;

There is also Intel VR14, and there is some indication that it is identical
to imvp9. If that is the case, I would prefer to use existing terminology.
Unfortunately, Intel is a bit close-lipped about both. If you have access
to documentation, can you check ?

Thanks,
Guenter

>   	}
>   	return rv;
>   }
> 


^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver
  2020-01-05 16:03   ` Guenter Roeck
@ 2020-01-05 16:44     ` Vadim Pasternak
  2020-01-05 18:34       ` Guenter Roeck
  0 siblings, 1 reply; 27+ messages in thread
From: Vadim Pasternak @ 2020-01-05 16:44 UTC (permalink / raw)
  To: Guenter Roeck, robh+dt, vijaykhemka; +Cc: linux-hwmon, devicetree



> -----Original Message-----
> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> Sent: Sunday, January 05, 2020 6:04 PM
> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
> vijaykhemka@fb.com
> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend
> device list supported by driver
> 
> On 1/5/20 2:58 AM, Vadim Pasternak wrote:
> > Extends driver with support of the additional devices:
> > Texas Instruments Dual channel DCAP+ multiphase controllers: TPS53688,
> > SN1906016.
> > Infineon Multi-phase Digital VR Controller Sierra devices XDPE12286C,
> > XDPE12284C, XDPE12283C, XDPE12254C and XDPE12250C.
> >
> > Extend Kconfig with added devices.
> >
> > Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
> > ---
> >   drivers/hwmon/pmbus/Kconfig    |  5 +++--
> >   drivers/hwmon/pmbus/tps53679.c | 14 ++++++++++++++
> >   2 files changed, 17 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
> > index 59859979571d..9e3d197d5322 100644
> > --- a/drivers/hwmon/pmbus/Kconfig
> > +++ b/drivers/hwmon/pmbus/Kconfig
> > @@ -200,10 +200,11 @@ config SENSORS_TPS40422
> >   	  be called tps40422.
> >
> >   config SENSORS_TPS53679
> > -	tristate "TI TPS53679"
> > +	tristate "TI TPS53679, TPS53688, SN1906016, Infineon XDPE122xxx
> family"
> >   	help
> >   	  If you say yes here you get hardware monitoring support for TI
> > -	  TPS53679.
> > +	  TPS53679, PS53688, SN1906016 and Infineon XDPE12286C,
> XDPE12284C,
> 
> TPS53688. For the others, for some I can't even determine if they exist in the
> first place (eg SN1906016, XPDE12250C) or how they would differ from other
> variants (eg XPDE12284C vs. XPDE12284A).
> And why would they all use the same bit map in the VOUT_MODE register, the
> same number of PMBus pages (phases), and the same attributes in each page ?

Hi Guenter,

Thank you for reply.

On our new system we have device XPDE12284C equipped.
I tested this device.

Infineon datasheet refers all these device as XDPE122xxC
family and it doesn't specify any differences in register map
between these devices.
Tomorrow we'll have guys from Infineon in our lab and I'll
verify if there is any difference.
If yes, I'll leave only XPDE12284C.

> 
> Thanks,
> Guenter
> 
> > +	  XDPE12283C, XDPE12254C, XDPE12250C devices.
> >
> >   	  This driver can also be built as a module. If so, the module will
> >   	  be called tps53679.
> > diff --git a/drivers/hwmon/pmbus/tps53679.c
> > b/drivers/hwmon/pmbus/tps53679.c index 7ce2fca4acde..f38eb116735b
> > 100644
> > --- a/drivers/hwmon/pmbus/tps53679.c
> > +++ b/drivers/hwmon/pmbus/tps53679.c
> > @@ -89,6 +89,13 @@ static int tps53679_probe(struct i2c_client
> > *client,
> >
> >   static const struct i2c_device_id tps53679_id[] = {
> >   	{"tps53679", 0},
> > +	{"tps53688", 0},
> > +	{"sn1906016", 0},
> > +	{"xdpe12283c", 0},
> > +	{"xdpe12250c", 0},
> > +	{"xdpe12254c", 0},
> > +	{"xdpe12284c", 0},
> > +	{"xdpe12286c", 0},
> 
> Alphabetic order, please.
> 
> >   	{}
> >   };
> >
> > @@ -96,6 +103,13 @@ MODULE_DEVICE_TABLE(i2c, tps53679_id);
> >
> >   static const struct of_device_id __maybe_unused tps53679_of_match[] = {
> >   	{.compatible = "ti,tps53679"},
> > +	{.compatible = "ti,tps53688"},
> > +	{.compatible = "ti,sn1906016"},
> > +	{.compatible = "infineon,xdpe12283c"},
> > +	{.compatible = "infineon,xdpe12250c"},
> > +	{.compatible = "infineon,xdpe12254c"},
> > +	{.compatible = "infineon,xdpe12284c"},
> > +	{.compatible = "infineon,xdpe12286c"},
> >   	{}
> >   };
> >   MODULE_DEVICE_TABLE(of, tps53679_of_match);
> >


^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [RFC PATCH hwmon-next v1 2/5] hwmon: (pmbus/core) Add support for Intel IMVP9 specification
  2020-01-05 16:26   ` Guenter Roeck
@ 2020-01-05 17:15     ` Vadim Pasternak
  2020-01-06 12:14     ` Vadim Pasternak
  1 sibling, 0 replies; 27+ messages in thread
From: Vadim Pasternak @ 2020-01-05 17:15 UTC (permalink / raw)
  To: Guenter Roeck, robh+dt, vijaykhemka; +Cc: linux-hwmon, devicetree



> -----Original Message-----
> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> Sent: Sunday, January 05, 2020 6:26 PM
> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
> vijaykhemka@fb.com
> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> Subject: Re: [RFC PATCH hwmon-next v1 2/5] hwmon: (pmbus/core) Add support
> for Intel IMVP9 specification
> 
> On 1/5/20 2:58 AM, Vadim Pasternak wrote:
> > Extend "vrm_version" with support for Intel IMVP9 specification.
> >
> > Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
> > ---
> >   drivers/hwmon/pmbus/pmbus.h      | 2 +-
> >   drivers/hwmon/pmbus/pmbus_core.c | 4 ++++
> >   2 files changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h
> > index 2bdebd0ea9c1..c6b2401f1c6c 100644
> > --- a/drivers/hwmon/pmbus/pmbus.h
> > +++ b/drivers/hwmon/pmbus/pmbus.h
> > @@ -377,7 +377,7 @@ enum pmbus_sensor_classes {
> >   #define PMBUS_PAGE_VIRTUAL	BIT(31)
> >
> >   enum pmbus_data_format { linear = 0, direct, vid }; -enum
> > vrm_version { vr11 = 0, vr12, vr13 };
> > +enum vrm_version { vr11 = 0, vr12, vr13, imvp9 };
> >
> >   struct pmbus_driver_info {
> >   	int pages;		/* Total number of pages */
> > diff --git a/drivers/hwmon/pmbus/pmbus_core.c
> > b/drivers/hwmon/pmbus/pmbus_core.c
> > index 98226e84b351..a9b7b555cf6e 100644
> > --- a/drivers/hwmon/pmbus/pmbus_core.c
> > +++ b/drivers/hwmon/pmbus/pmbus_core.c
> > @@ -709,6 +709,10 @@ static long pmbus_reg2data_vid(struct pmbus_data
> *data,
> >   		if (val >= 0x01)
> >   			rv = 500 + (val - 1) * 10;
> >   		break;
> > +	case imvp9:
> > +		if (val >= 0x01)
> > +			rv = 200 + (val - 1) * 10;
> > +		break;
> 
> There is also Intel VR14, and there is some indication that it is identical to imvp9.
> If that is the case, I would prefer to use existing terminology.
> Unfortunately, Intel is a bit close-lipped about both. If you have access to
> documentation, can you check ?

Sure, I'll check it with our hw guys.

> 
> Thanks,
> Guenter
> 
> >   	}
> >   	return rv;
> >   }
> >


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver
  2020-01-05 16:44     ` Vadim Pasternak
@ 2020-01-05 18:34       ` Guenter Roeck
  2020-01-06 12:16         ` Vadim Pasternak
  0 siblings, 1 reply; 27+ messages in thread
From: Guenter Roeck @ 2020-01-05 18:34 UTC (permalink / raw)
  To: Vadim Pasternak, robh+dt, vijaykhemka; +Cc: linux-hwmon, devicetree

On 1/5/20 8:44 AM, Vadim Pasternak wrote:
> 
> 
>> -----Original Message-----
>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
>> Sent: Sunday, January 05, 2020 6:04 PM
>> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
>> vijaykhemka@fb.com
>> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend
>> device list supported by driver
>>
>> On 1/5/20 2:58 AM, Vadim Pasternak wrote:
>>> Extends driver with support of the additional devices:
>>> Texas Instruments Dual channel DCAP+ multiphase controllers: TPS53688,
>>> SN1906016.
>>> Infineon Multi-phase Digital VR Controller Sierra devices XDPE12286C,
>>> XDPE12284C, XDPE12283C, XDPE12254C and XDPE12250C.
>>>
>>> Extend Kconfig with added devices.
>>>
>>> Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
>>> ---
>>>    drivers/hwmon/pmbus/Kconfig    |  5 +++--
>>>    drivers/hwmon/pmbus/tps53679.c | 14 ++++++++++++++
>>>    2 files changed, 17 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
>>> index 59859979571d..9e3d197d5322 100644
>>> --- a/drivers/hwmon/pmbus/Kconfig
>>> +++ b/drivers/hwmon/pmbus/Kconfig
>>> @@ -200,10 +200,11 @@ config SENSORS_TPS40422
>>>    	  be called tps40422.
>>>
>>>    config SENSORS_TPS53679
>>> -	tristate "TI TPS53679"
>>> +	tristate "TI TPS53679, TPS53688, SN1906016, Infineon XDPE122xxx
>> family"
>>>    	help
>>>    	  If you say yes here you get hardware monitoring support for TI
>>> -	  TPS53679.
>>> +	  TPS53679, PS53688, SN1906016 and Infineon XDPE12286C,
>> XDPE12284C,
>>
>> TPS53688. For the others, for some I can't even determine if they exist in the
>> first place (eg SN1906016, XPDE12250C) or how they would differ from other
>> variants (eg XPDE12284C vs. XPDE12284A).
>> And why would they all use the same bit map in the VOUT_MODE register, the
>> same number of PMBus pages (phases), and the same attributes in each page ?
> 
> Hi Guenter,
> 
> Thank you for reply.
> 
> On our new system we have device XPDE12284C equipped.
> I tested this device.
>
Sounds good, but did you also make sure that all chips have the same number
of pages (phases), the same set of commands as the TI chip, and support the
same bit settings in VOUT_MODE ? It seems a bit unlikely that TI's register
definitions would make it into an Infineon chip.

Also, what about the SN1906016 ? I don't find that anywhere, except in one
place where it is listed as MCU from TI.

> Infineon datasheet refers all these device as XDPE122xxC
> family and it doesn't specify any differences in register map
> between these devices.

That is a bit vague, especially when it includes devices which return
zero results with Google searches.

"A" vs. "C" may distinguish automotive vs. commercial; the "A" device
is listed under automotive. If the command set is the same, I don't
really want the "c" in the id.

> Tomorrow we'll have guys from Infineon in our lab and I'll
> verify if there is any difference.

Tell them that it isn't really helpful to keep their datasheets
under wrap. Unfortunately, TI started doing the same, which isn't
helpful either.

Thanks,
Guenter

> If yes, I'll leave only XPDE12284C.
> 
>>
>> Thanks,
>> Guenter
>>
>>> +	  XDPE12283C, XDPE12254C, XDPE12250C devices.
>>>
>>>    	  This driver can also be built as a module. If so, the module will
>>>    	  be called tps53679.
>>> diff --git a/drivers/hwmon/pmbus/tps53679.c
>>> b/drivers/hwmon/pmbus/tps53679.c index 7ce2fca4acde..f38eb116735b
>>> 100644
>>> --- a/drivers/hwmon/pmbus/tps53679.c
>>> +++ b/drivers/hwmon/pmbus/tps53679.c
>>> @@ -89,6 +89,13 @@ static int tps53679_probe(struct i2c_client
>>> *client,
>>>
>>>    static const struct i2c_device_id tps53679_id[] = {
>>>    	{"tps53679", 0},
>>> +	{"tps53688", 0},
>>> +	{"sn1906016", 0},
>>> +	{"xdpe12283c", 0},
>>> +	{"xdpe12250c", 0},
>>> +	{"xdpe12254c", 0},
>>> +	{"xdpe12284c", 0},
>>> +	{"xdpe12286c", 0},
>>
>> Alphabetic order, please.
>>
>>>    	{}
>>>    };
>>>
>>> @@ -96,6 +103,13 @@ MODULE_DEVICE_TABLE(i2c, tps53679_id);
>>>
>>>    static const struct of_device_id __maybe_unused tps53679_of_match[] = {
>>>    	{.compatible = "ti,tps53679"},
>>> +	{.compatible = "ti,tps53688"},
>>> +	{.compatible = "ti,sn1906016"},
>>> +	{.compatible = "infineon,xdpe12283c"},
>>> +	{.compatible = "infineon,xdpe12250c"},
>>> +	{.compatible = "infineon,xdpe12254c"},
>>> +	{.compatible = "infineon,xdpe12284c"},
>>> +	{.compatible = "infineon,xdpe12286c"},
>>>    	{}
>>>    };
>>>    MODULE_DEVICE_TABLE(of, tps53679_of_match);
>>>
> 


^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [RFC PATCH hwmon-next v1 2/5] hwmon: (pmbus/core) Add support for Intel IMVP9 specification
  2020-01-05 16:26   ` Guenter Roeck
  2020-01-05 17:15     ` Vadim Pasternak
@ 2020-01-06 12:14     ` Vadim Pasternak
  1 sibling, 0 replies; 27+ messages in thread
From: Vadim Pasternak @ 2020-01-06 12:14 UTC (permalink / raw)
  To: Guenter Roeck, robh+dt, vijaykhemka; +Cc: linux-hwmon, devicetree



> -----Original Message-----
> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> Sent: Sunday, January 05, 2020 6:26 PM
> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
> vijaykhemka@fb.com
> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> Subject: Re: [RFC PATCH hwmon-next v1 2/5] hwmon: (pmbus/core) Add support
> for Intel IMVP9 specification
> 
> On 1/5/20 2:58 AM, Vadim Pasternak wrote:
> > Extend "vrm_version" with support for Intel IMVP9 specification.
> >
> > Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
> > ---
> >   drivers/hwmon/pmbus/pmbus.h      | 2 +-
> >   drivers/hwmon/pmbus/pmbus_core.c | 4 ++++
> >   2 files changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h
> > index 2bdebd0ea9c1..c6b2401f1c6c 100644
> > --- a/drivers/hwmon/pmbus/pmbus.h
> > +++ b/drivers/hwmon/pmbus/pmbus.h
> > @@ -377,7 +377,7 @@ enum pmbus_sensor_classes {
> >   #define PMBUS_PAGE_VIRTUAL	BIT(31)
> >
> >   enum pmbus_data_format { linear = 0, direct, vid }; -enum
> > vrm_version { vr11 = 0, vr12, vr13 };
> > +enum vrm_version { vr11 = 0, vr12, vr13, imvp9 };
> >
> >   struct pmbus_driver_info {
> >   	int pages;		/* Total number of pages */
> > diff --git a/drivers/hwmon/pmbus/pmbus_core.c
> > b/drivers/hwmon/pmbus/pmbus_core.c
> > index 98226e84b351..a9b7b555cf6e 100644
> > --- a/drivers/hwmon/pmbus/pmbus_core.c
> > +++ b/drivers/hwmon/pmbus/pmbus_core.c
> > @@ -709,6 +709,10 @@ static long pmbus_reg2data_vid(struct pmbus_data
> *data,
> >   		if (val >= 0x01)
> >   			rv = 500 + (val - 1) * 10;
> >   		break;
> > +	case imvp9:
> > +		if (val >= 0x01)
> > +			rv = 200 + (val - 1) * 10;
> > +		break;
> 
> There is also Intel VR14, and there is some indication that it is identical to imvp9.
> If that is the case, I would prefer to use existing terminology.
> Unfortunately, Intel is a bit close-lipped about both. If you have access to
> documentation, can you check ?

Hi Guenter,

It's really tricky to find some clear Intel doc on for that.
I checked it with ours and Infineon HW guys.

IMVP9 has a different VID table than VR13HC/VR14.

For v14 we can use the same formula as we are using for vr13.

IMVP9 is different because it has a different voltage range.

The 5mV VID table of VR14 supports a voltage range from
0.25V to 1.52V.
The 10mV VID table of VR14 supports a voltage range from
0.5V t0 3.04V.

The IMVP9 VID table also has a 10mV step, but the voltage range
is from 0.2 to 2.74V.

Thanks,
Vadim.

> 
> Thanks,
> Guenter
> 
> >   	}
> >   	return rv;
> >   }
> >


^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver
  2020-01-05 18:34       ` Guenter Roeck
@ 2020-01-06 12:16         ` Vadim Pasternak
  2020-01-06 14:52           ` Guenter Roeck
  0 siblings, 1 reply; 27+ messages in thread
From: Vadim Pasternak @ 2020-01-06 12:16 UTC (permalink / raw)
  To: Guenter Roeck, robh+dt, vijaykhemka; +Cc: linux-hwmon, devicetree



> -----Original Message-----
> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> Sent: Sunday, January 05, 2020 8:35 PM
> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
> vijaykhemka@fb.com
> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend
> device list supported by driver
> 
> On 1/5/20 8:44 AM, Vadim Pasternak wrote:
> >
> >
> >> -----Original Message-----
> >> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> >> Sent: Sunday, January 05, 2020 6:04 PM
> >> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
> >> vijaykhemka@fb.com
> >> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> >> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679)
> >> Extend device list supported by driver
> >>
> >> On 1/5/20 2:58 AM, Vadim Pasternak wrote:
> >>> Extends driver with support of the additional devices:
> >>> Texas Instruments Dual channel DCAP+ multiphase controllers:
> >>> TPS53688, SN1906016.
> >>> Infineon Multi-phase Digital VR Controller Sierra devices
> >>> XDPE12286C, XDPE12284C, XDPE12283C, XDPE12254C and XDPE12250C.
> >>>
> >>> Extend Kconfig with added devices.
> >>>
> >>> Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
> >>> ---
> >>>    drivers/hwmon/pmbus/Kconfig    |  5 +++--
> >>>    drivers/hwmon/pmbus/tps53679.c | 14 ++++++++++++++
> >>>    2 files changed, 17 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/drivers/hwmon/pmbus/Kconfig
> >>> b/drivers/hwmon/pmbus/Kconfig index 59859979571d..9e3d197d5322
> >>> 100644
> >>> --- a/drivers/hwmon/pmbus/Kconfig
> >>> +++ b/drivers/hwmon/pmbus/Kconfig
> >>> @@ -200,10 +200,11 @@ config SENSORS_TPS40422
> >>>    	  be called tps40422.
> >>>
> >>>    config SENSORS_TPS53679
> >>> -	tristate "TI TPS53679"
> >>> +	tristate "TI TPS53679, TPS53688, SN1906016, Infineon XDPE122xxx
> >> family"
> >>>    	help
> >>>    	  If you say yes here you get hardware monitoring support for TI
> >>> -	  TPS53679.
> >>> +	  TPS53679, PS53688, SN1906016 and Infineon XDPE12286C,
> >> XDPE12284C,
> >>
> >> TPS53688. For the others, for some I can't even determine if they
> >> exist in the first place (eg SN1906016, XPDE12250C) or how they would
> >> differ from other variants (eg XPDE12284C vs. XPDE12284A).
> >> And why would they all use the same bit map in the VOUT_MODE
> >> register, the same number of PMBus pages (phases), and the same attributes
> in each page ?
> >
> > Hi Guenter,
> >
> > Thank you for reply.
> >
> > On our new system we have device XPDE12284C equipped.
> > I tested this device.
> >
> Sounds good, but did you also make sure that all chips have the same number of
> pages (phases), the same set of commands as the TI chip, and support the same
> bit settings in VOUT_MODE ? It seems a bit unlikely that TI's register definitions
> would make it into an Infineon chip.
> 
> Also, what about the SN1906016 ? I don't find that anywhere, except in one
> place where it is listed as MCU from TI.

I'll drop SN1906016.
Datasheet has a title Dual channel DCAP+ multiphase controllers:
TPS53688, SN1906016.
But maybe it's some custom device (anyway I'll try to check it with TI).

> 
> > Infineon datasheet refers all these device as XDPE122xxC family and it
> > doesn't specify any differences in register map between these devices.
> 
> That is a bit vague, especially when it includes devices which return zero results
> with Google searches.
> 
> "A" vs. "C" may distinguish automotive vs. commercial; the "A" device is listed
> under automotive. If the command set is the same, I don't really want the "c" in
> the id.

Got feedback from Infineon guys.
No need 'C' at the end, as you wrote.
All XDPE12250, XDPE12254, XDPE12283, XDPE12284, XDPE12286 are
treated in the same way:
same pages, same VOUT_MODE, VOUT_READ, etcetera.

> 
> > Tomorrow we'll have guys from Infineon in our lab and I'll verify if
> > there is any difference.
> 
> Tell them that it isn't really helpful to keep their datasheets under wrap.
> Unfortunately, TI started doing the same, which isn't helpful either.

Told them about datasheets availability - got :)

> 
> Thanks,
> Guenter
> 
> > If yes, I'll leave only XPDE12284C.
> >
> >>
> >> Thanks,
> >> Guenter
> >>
> >>> +	  XDPE12283C, XDPE12254C, XDPE12250C devices.
> >>>
> >>>    	  This driver can also be built as a module. If so, the module will
> >>>    	  be called tps53679.
> >>> diff --git a/drivers/hwmon/pmbus/tps53679.c
> >>> b/drivers/hwmon/pmbus/tps53679.c index 7ce2fca4acde..f38eb116735b
> >>> 100644
> >>> --- a/drivers/hwmon/pmbus/tps53679.c
> >>> +++ b/drivers/hwmon/pmbus/tps53679.c
> >>> @@ -89,6 +89,13 @@ static int tps53679_probe(struct i2c_client
> >>> *client,
> >>>
> >>>    static const struct i2c_device_id tps53679_id[] = {
> >>>    	{"tps53679", 0},
> >>> +	{"tps53688", 0},
> >>> +	{"sn1906016", 0},
> >>> +	{"xdpe12283c", 0},
> >>> +	{"xdpe12250c", 0},
> >>> +	{"xdpe12254c", 0},
> >>> +	{"xdpe12284c", 0},
> >>> +	{"xdpe12286c", 0},
> >>
> >> Alphabetic order, please.
> >>
> >>>    	{}
> >>>    };
> >>>
> >>> @@ -96,6 +103,13 @@ MODULE_DEVICE_TABLE(i2c, tps53679_id);
> >>>
> >>>    static const struct of_device_id __maybe_unused tps53679_of_match[] =
> {
> >>>    	{.compatible = "ti,tps53679"},
> >>> +	{.compatible = "ti,tps53688"},
> >>> +	{.compatible = "ti,sn1906016"},
> >>> +	{.compatible = "infineon,xdpe12283c"},
> >>> +	{.compatible = "infineon,xdpe12250c"},
> >>> +	{.compatible = "infineon,xdpe12254c"},
> >>> +	{.compatible = "infineon,xdpe12284c"},
> >>> +	{.compatible = "infineon,xdpe12286c"},
> >>>    	{}
> >>>    };
> >>>    MODULE_DEVICE_TABLE(of, tps53679_of_match);
> >>>
> >


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver
  2020-01-06 12:16         ` Vadim Pasternak
@ 2020-01-06 14:52           ` Guenter Roeck
  2020-01-06 16:57             ` Vadim Pasternak
  0 siblings, 1 reply; 27+ messages in thread
From: Guenter Roeck @ 2020-01-06 14:52 UTC (permalink / raw)
  To: Vadim Pasternak, robh+dt, vijaykhemka; +Cc: linux-hwmon, devicetree

On 1/6/20 4:16 AM, Vadim Pasternak wrote:
> 
> 
>> -----Original Message-----
>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
>> Sent: Sunday, January 05, 2020 8:35 PM
>> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
>> vijaykhemka@fb.com
>> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend
>> device list supported by driver
>>
>> On 1/5/20 8:44 AM, Vadim Pasternak wrote:
>>>
>>>
>>>> -----Original Message-----
>>>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
>>>> Sent: Sunday, January 05, 2020 6:04 PM
>>>> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
>>>> vijaykhemka@fb.com
>>>> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
>>>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679)
>>>> Extend device list supported by driver
>>>>
>>>> On 1/5/20 2:58 AM, Vadim Pasternak wrote:
>>>>> Extends driver with support of the additional devices:
>>>>> Texas Instruments Dual channel DCAP+ multiphase controllers:
>>>>> TPS53688, SN1906016.
>>>>> Infineon Multi-phase Digital VR Controller Sierra devices
>>>>> XDPE12286C, XDPE12284C, XDPE12283C, XDPE12254C and XDPE12250C.
>>>>>
>>>>> Extend Kconfig with added devices.
>>>>>
>>>>> Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
>>>>> ---
>>>>>     drivers/hwmon/pmbus/Kconfig    |  5 +++--
>>>>>     drivers/hwmon/pmbus/tps53679.c | 14 ++++++++++++++
>>>>>     2 files changed, 17 insertions(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/drivers/hwmon/pmbus/Kconfig
>>>>> b/drivers/hwmon/pmbus/Kconfig index 59859979571d..9e3d197d5322
>>>>> 100644
>>>>> --- a/drivers/hwmon/pmbus/Kconfig
>>>>> +++ b/drivers/hwmon/pmbus/Kconfig
>>>>> @@ -200,10 +200,11 @@ config SENSORS_TPS40422
>>>>>     	  be called tps40422.
>>>>>
>>>>>     config SENSORS_TPS53679
>>>>> -	tristate "TI TPS53679"
>>>>> +	tristate "TI TPS53679, TPS53688, SN1906016, Infineon XDPE122xxx
>>>> family"
>>>>>     	help
>>>>>     	  If you say yes here you get hardware monitoring support for TI
>>>>> -	  TPS53679.
>>>>> +	  TPS53679, PS53688, SN1906016 and Infineon XDPE12286C,
>>>> XDPE12284C,
>>>>
>>>> TPS53688. For the others, for some I can't even determine if they
>>>> exist in the first place (eg SN1906016, XPDE12250C) or how they would
>>>> differ from other variants (eg XPDE12284C vs. XPDE12284A).
>>>> And why would they all use the same bit map in the VOUT_MODE
>>>> register, the same number of PMBus pages (phases), and the same attributes
>> in each page ?
>>>
>>> Hi Guenter,
>>>
>>> Thank you for reply.
>>>
>>> On our new system we have device XPDE12284C equipped.
>>> I tested this device.
>>>
>> Sounds good, but did you also make sure that all chips have the same number of
>> pages (phases), the same set of commands as the TI chip, and support the same
>> bit settings in VOUT_MODE ? It seems a bit unlikely that TI's register definitions
>> would make it into an Infineon chip.
>>
>> Also, what about the SN1906016 ? I don't find that anywhere, except in one
>> place where it is listed as MCU from TI.
> 
> I'll drop SN1906016.
> Datasheet has a title Dual channel DCAP+ multiphase controllers:
> TPS53688, SN1906016.
> But maybe it's some custom device (anyway I'll try to check it with TI).
> 

Or maybe SN1906016 means something else. Unless we have explicit confirmation
that the chip exists (or will exist) we should not add it to the list.

>>
>>> Infineon datasheet refers all these device as XDPE122xxC family and it
>>> doesn't specify any differences in register map between these devices.
>>
>> That is a bit vague, especially when it includes devices which return zero results
>> with Google searches.
>>
>> "A" vs. "C" may distinguish automotive vs. commercial; the "A" device is listed
>> under automotive. If the command set is the same, I don't really want the "c" in
>> the id.
> 
> Got feedback from Infineon guys.
> No need 'C' at the end, as you wrote.
> All XDPE12250, XDPE12254, XDPE12283, XDPE12284, XDPE12286 are
> treated in the same way:
> same pages, same VOUT_MODE, VOUT_READ, etcetera.
> 

And same as TI, including VOUT_MODE ? Also, did they confirm that the unpublished
chips do or will actually exist ?

Sorry, to be persistent, but give my thanks to Infineon.

>>
>>> Tomorrow we'll have guys from Infineon in our lab and I'll verify if
>>> there is any difference.
>>
>> Tell them that it isn't really helpful to keep their datasheets under wrap.
>> Unfortunately, TI started doing the same, which isn't helpful either.
> 
> Told them about datasheets availability - got :)
> 

Surprise.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver
  2020-01-06 14:52           ` Guenter Roeck
@ 2020-01-06 16:57             ` Vadim Pasternak
  2020-01-06 21:01               ` Guenter Roeck
  0 siblings, 1 reply; 27+ messages in thread
From: Vadim Pasternak @ 2020-01-06 16:57 UTC (permalink / raw)
  To: Guenter Roeck, robh+dt, vijaykhemka; +Cc: linux-hwmon, devicetree



> -----Original Message-----
> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> Sent: Monday, January 06, 2020 4:53 PM
> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
> vijaykhemka@fb.com
> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend
> device list supported by driver
> 
> On 1/6/20 4:16 AM, Vadim Pasternak wrote:
> >
> >
> >> -----Original Message-----
> >> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> >> Sent: Sunday, January 05, 2020 8:35 PM
> >> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
> >> vijaykhemka@fb.com
> >> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> >> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679)
> >> Extend device list supported by driver
> >>
> >> On 1/5/20 8:44 AM, Vadim Pasternak wrote:
> >>>
> >>>
> >>>> -----Original Message-----
> >>>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> >>>> Sent: Sunday, January 05, 2020 6:04 PM
> >>>> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
> >>>> vijaykhemka@fb.com
> >>>> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> >>>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679)
> >>>> Extend device list supported by driver
> >>>>
> >>>> On 1/5/20 2:58 AM, Vadim Pasternak wrote:
> >>>>> Extends driver with support of the additional devices:
> >>>>> Texas Instruments Dual channel DCAP+ multiphase controllers:
> >>>>> TPS53688, SN1906016.
> >>>>> Infineon Multi-phase Digital VR Controller Sierra devices
> >>>>> XDPE12286C, XDPE12284C, XDPE12283C, XDPE12254C and XDPE12250C.
> >>>>>
> >>>>> Extend Kconfig with added devices.
> >>>>>
> >>>>> Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
> >>>>> ---
> >>>>>     drivers/hwmon/pmbus/Kconfig    |  5 +++--
> >>>>>     drivers/hwmon/pmbus/tps53679.c | 14 ++++++++++++++
> >>>>>     2 files changed, 17 insertions(+), 2 deletions(-)
> >>>>>
> >>>>> diff --git a/drivers/hwmon/pmbus/Kconfig
> >>>>> b/drivers/hwmon/pmbus/Kconfig index 59859979571d..9e3d197d5322
> >>>>> 100644
> >>>>> --- a/drivers/hwmon/pmbus/Kconfig
> >>>>> +++ b/drivers/hwmon/pmbus/Kconfig
> >>>>> @@ -200,10 +200,11 @@ config SENSORS_TPS40422
> >>>>>     	  be called tps40422.
> >>>>>
> >>>>>     config SENSORS_TPS53679
> >>>>> -	tristate "TI TPS53679"
> >>>>> +	tristate "TI TPS53679, TPS53688, SN1906016, Infineon XDPE122xxx
> >>>> family"
> >>>>>     	help
> >>>>>     	  If you say yes here you get hardware monitoring support for TI
> >>>>> -	  TPS53679.
> >>>>> +	  TPS53679, PS53688, SN1906016 and Infineon XDPE12286C,
> >>>> XDPE12284C,
> >>>>
> >>>> TPS53688. For the others, for some I can't even determine if they
> >>>> exist in the first place (eg SN1906016, XPDE12250C) or how they
> >>>> would differ from other variants (eg XPDE12284C vs. XPDE12284A).
> >>>> And why would they all use the same bit map in the VOUT_MODE
> >>>> register, the same number of PMBus pages (phases), and the same
> >>>> attributes
> >> in each page ?
> >>>
> >>> Hi Guenter,
> >>>
> >>> Thank you for reply.
> >>>
> >>> On our new system we have device XPDE12284C equipped.
> >>> I tested this device.
> >>>
> >> Sounds good, but did you also make sure that all chips have the same
> >> number of pages (phases), the same set of commands as the TI chip,
> >> and support the same bit settings in VOUT_MODE ? It seems a bit
> >> unlikely that TI's register definitions would make it into an Infineon chip.
> >>
> >> Also, what about the SN1906016 ? I don't find that anywhere, except
> >> in one place where it is listed as MCU from TI.
> >
> > I'll drop SN1906016.
> > Datasheet has a title Dual channel DCAP+ multiphase controllers:
> > TPS53688, SN1906016.
> > But maybe it's some custom device (anyway I'll try to check it with TI).
> >
> 
> Or maybe SN1906016 means something else. Unless we have explicit
> confirmation that the chip exists (or will exist) we should not add it to the list.
> 
> >>
> >>> Infineon datasheet refers all these device as XDPE122xxC family and
> >>> it doesn't specify any differences in register map between these devices.
> >>
> >> That is a bit vague, especially when it includes devices which return
> >> zero results with Google searches.
> >>
> >> "A" vs. "C" may distinguish automotive vs. commercial; the "A" device
> >> is listed under automotive. If the command set is the same, I don't
> >> really want the "c" in the id.
> >
> > Got feedback from Infineon guys.
> > No need 'C' at the end, as you wrote.
> > All XDPE12250, XDPE12254, XDPE12283, XDPE12284, XDPE12286 are treated
> > in the same way:
> > same pages, same VOUT_MODE, VOUT_READ, etcetera.
> >
> 
> And same as TI, including VOUT_MODE ? Also, did they confirm that the
> unpublished chips do or will actually exist ?

Hi Gunther,

According to the input I got from Infineon guys, these device are already
available for the customers, like XPDE12284, which is equipped on new
Mellanox 400Gx32 Ethernet system, on which we are working now.

But I'll re-check if all these devices are available today to be on the safe
Side.

Regarding VOUT modes:
TPS53679 uses modes - 0x01, 0x02, 0x04, 0x05, 0x07
TPS53688 uses modes - 0x04, 0x07
XDPE122xxx uses modes - 0x01, 0x02, 0x03 and additionally 0x10, which is
for 6.25mV VID table (AMD application).

I didn't add support for mode 0x10 in the patch.

The VID table for the AMD application is different from the
Intel VID tables.

A value of 0x0 corresponds to the highest output voltage of 1.55V.
The voltage is reduced in 6.25mV steps down to the value 0xd8,
which corresponds to 0.2V.

The formula for the calculation of the output voltage would be:

	case DON’T_NOW_HOW_TO_CALL_IT:
		if (val >= 0x00 && val <= 0xd8)
              			rv = 1550 – (val *6.25);

I doubled check it.

Do you think it should added as well?

Thanks,
Vadim.

> 
> Sorry, to be persistent, but give my thanks to Infineon.
> 
> >>
> >>> Tomorrow we'll have guys from Infineon in our lab and I'll verify if
> >>> there is any difference.
> >>
> >> Tell them that it isn't really helpful to keep their datasheets under wrap.
> >> Unfortunately, TI started doing the same, which isn't helpful either.
> >
> > Told them about datasheets availability - got :)
> >
> 
> Surprise.
> 
> Thanks,
> Guenter

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver
  2020-01-06 16:57             ` Vadim Pasternak
@ 2020-01-06 21:01               ` Guenter Roeck
  2020-01-06 22:29                 ` Vadim Pasternak
  0 siblings, 1 reply; 27+ messages in thread
From: Guenter Roeck @ 2020-01-06 21:01 UTC (permalink / raw)
  To: Vadim Pasternak; +Cc: robh+dt, vijaykhemka, linux-hwmon, devicetree

On Mon, Jan 06, 2020 at 04:57:32PM +0000, Vadim Pasternak wrote:
> 
> 
> > -----Original Message-----
> > From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> > Sent: Monday, January 06, 2020 4:53 PM
> > To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
> > vijaykhemka@fb.com
> > Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> > Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend
> > device list supported by driver
> > 
> > On 1/6/20 4:16 AM, Vadim Pasternak wrote:
> > >
> > >
> > >> -----Original Message-----
> > >> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> > >> Sent: Sunday, January 05, 2020 8:35 PM
> > >> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
> > >> vijaykhemka@fb.com
> > >> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> > >> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679)
> > >> Extend device list supported by driver
> > >>
> > >> On 1/5/20 8:44 AM, Vadim Pasternak wrote:
> > >>>
> > >>>
> > >>>> -----Original Message-----
> > >>>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> > >>>> Sent: Sunday, January 05, 2020 6:04 PM
> > >>>> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
> > >>>> vijaykhemka@fb.com
> > >>>> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> > >>>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679)
> > >>>> Extend device list supported by driver
> > >>>>
> > >>>> On 1/5/20 2:58 AM, Vadim Pasternak wrote:
> > >>>>> Extends driver with support of the additional devices:
> > >>>>> Texas Instruments Dual channel DCAP+ multiphase controllers:
> > >>>>> TPS53688, SN1906016.
> > >>>>> Infineon Multi-phase Digital VR Controller Sierra devices
> > >>>>> XDPE12286C, XDPE12284C, XDPE12283C, XDPE12254C and XDPE12250C.
> > >>>>>
> > >>>>> Extend Kconfig with added devices.
> > >>>>>
> > >>>>> Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
> > >>>>> ---
> > >>>>>     drivers/hwmon/pmbus/Kconfig    |  5 +++--
> > >>>>>     drivers/hwmon/pmbus/tps53679.c | 14 ++++++++++++++
> > >>>>>     2 files changed, 17 insertions(+), 2 deletions(-)
> > >>>>>
> > >>>>> diff --git a/drivers/hwmon/pmbus/Kconfig
> > >>>>> b/drivers/hwmon/pmbus/Kconfig index 59859979571d..9e3d197d5322
> > >>>>> 100644
> > >>>>> --- a/drivers/hwmon/pmbus/Kconfig
> > >>>>> +++ b/drivers/hwmon/pmbus/Kconfig
> > >>>>> @@ -200,10 +200,11 @@ config SENSORS_TPS40422
> > >>>>>     	  be called tps40422.
> > >>>>>
> > >>>>>     config SENSORS_TPS53679
> > >>>>> -	tristate "TI TPS53679"
> > >>>>> +	tristate "TI TPS53679, TPS53688, SN1906016, Infineon XDPE122xxx
> > >>>> family"
> > >>>>>     	help
> > >>>>>     	  If you say yes here you get hardware monitoring support for TI
> > >>>>> -	  TPS53679.
> > >>>>> +	  TPS53679, PS53688, SN1906016 and Infineon XDPE12286C,
> > >>>> XDPE12284C,
> > >>>>
> > >>>> TPS53688. For the others, for some I can't even determine if they
> > >>>> exist in the first place (eg SN1906016, XPDE12250C) or how they
> > >>>> would differ from other variants (eg XPDE12284C vs. XPDE12284A).
> > >>>> And why would they all use the same bit map in the VOUT_MODE
> > >>>> register, the same number of PMBus pages (phases), and the same
> > >>>> attributes
> > >> in each page ?
> > >>>
> > >>> Hi Guenter,
> > >>>
> > >>> Thank you for reply.
> > >>>
> > >>> On our new system we have device XPDE12284C equipped.
> > >>> I tested this device.
> > >>>
> > >> Sounds good, but did you also make sure that all chips have the same
> > >> number of pages (phases), the same set of commands as the TI chip,
> > >> and support the same bit settings in VOUT_MODE ? It seems a bit
> > >> unlikely that TI's register definitions would make it into an Infineon chip.
> > >>
> > >> Also, what about the SN1906016 ? I don't find that anywhere, except
> > >> in one place where it is listed as MCU from TI.
> > >
> > > I'll drop SN1906016.
> > > Datasheet has a title Dual channel DCAP+ multiphase controllers:
> > > TPS53688, SN1906016.
> > > But maybe it's some custom device (anyway I'll try to check it with TI).
> > >
> > 
> > Or maybe SN1906016 means something else. Unless we have explicit
> > confirmation that the chip exists (or will exist) we should not add it to the list.
> > 
> > >>
> > >>> Infineon datasheet refers all these device as XDPE122xxC family and
> > >>> it doesn't specify any differences in register map between these devices.
> > >>
> > >> That is a bit vague, especially when it includes devices which return
> > >> zero results with Google searches.
> > >>
> > >> "A" vs. "C" may distinguish automotive vs. commercial; the "A" device
> > >> is listed under automotive. If the command set is the same, I don't
> > >> really want the "c" in the id.
> > >
> > > Got feedback from Infineon guys.
> > > No need 'C' at the end, as you wrote.
> > > All XDPE12250, XDPE12254, XDPE12283, XDPE12284, XDPE12286 are treated
> > > in the same way:
> > > same pages, same VOUT_MODE, VOUT_READ, etcetera.
> > >
> > 
> > And same as TI, including VOUT_MODE ? Also, did they confirm that the
> > unpublished chips do or will actually exist ?
> 
> Hi Gunther,
> 
> According to the input I got from Infineon guys, these device are already
> available for the customers, like XPDE12284, which is equipped on new
> Mellanox 400Gx32 Ethernet system, on which we are working now.
> 
> But I'll re-check if all these devices are available today to be on the safe
> Side.
> 
> Regarding VOUT modes:
> TPS53679 uses modes - 0x01, 0x02, 0x04, 0x05, 0x07
> TPS53688 uses modes - 0x04, 0x07
> XDPE122xxx uses modes - 0x01, 0x02, 0x03 and additionally 0x10, which is
> for 6.25mV VID table (AMD application).
> 

The problem is that PMBus does not define VID mode values. If it did, we
could add vrm version detection detection to the pmbus core. 0x01 for
TPS53679 _may_ be the same as 0x01 for XDPE122xxx, or maybe not.
There is no way to be sure without datasheets.

> I didn't add support for mode 0x10 in the patch.
> 
> The VID table for the AMD application is different from the
> Intel VID tables.
> 
> A value of 0x0 corresponds to the highest output voltage of 1.55V.
> The voltage is reduced in 6.25mV steps down to the value 0xd8,
> which corresponds to 0.2V.
> 
> The formula for the calculation of the output voltage would be:
> 
> 	case DON’T_NOW_HOW_TO_CALL_IT:

Doesn't the datasheet have something to say ?

> 		if (val >= 0x00 && val <= 0xd8)
>               			rv = 1550 – (val *6.25);
> 
> I doubled check it.
> 
> Do you think it should added as well?
> 
I am quite neutral on that. I am much more concerned with the assumption
that the mode values have the same meaning for chips from different
vendors. In this case, what do we do if TI starts shipping a chip
in the TPS53xxx series which uses mode 0x10 for something else ?

Overall I'd rather play safe and add a separate driver for the
Infineon chips.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver
  2020-01-06 21:01               ` Guenter Roeck
@ 2020-01-06 22:29                 ` Vadim Pasternak
  2020-01-07  1:28                   ` Guenter Roeck
  0 siblings, 1 reply; 27+ messages in thread
From: Vadim Pasternak @ 2020-01-06 22:29 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: robh+dt, vijaykhemka, linux-hwmon, devicetree



> -----Original Message-----
> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> Sent: Monday, January 06, 2020 11:01 PM
> To: Vadim Pasternak <vadimp@mellanox.com>
> Cc: robh+dt@kernel.org; vijaykhemka@fb.com; linux-hwmon@vger.kernel.org;
> devicetree@vger.kernel.org
> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend
> device list supported by driver
> 
> On Mon, Jan 06, 2020 at 04:57:32PM +0000, Vadim Pasternak wrote:
> >
> >
> > > -----Original Message-----
> > > From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> > > Sent: Monday, January 06, 2020 4:53 PM
> > > To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
> > > vijaykhemka@fb.com
> > > Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> > > Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679)
> > > Extend device list supported by driver
> > >
> > > On 1/6/20 4:16 AM, Vadim Pasternak wrote:
> > > >
> > > >
> > > >> -----Original Message-----
> > > >> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter
> > > >> Roeck
> > > >> Sent: Sunday, January 05, 2020 8:35 PM
> > > >> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
> > > >> vijaykhemka@fb.com
> > > >> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> > > >> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon:
> > > >> (pmbus/tps53679) Extend device list supported by driver
> > > >>
> > > >> On 1/5/20 8:44 AM, Vadim Pasternak wrote:
> > > >>>
> > > >>>
> > > >>>> -----Original Message-----
> > > >>>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter
> > > >>>> Roeck
> > > >>>> Sent: Sunday, January 05, 2020 6:04 PM
> > > >>>> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
> > > >>>> vijaykhemka@fb.com
> > > >>>> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> > > >>>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon:
> > > >>>> (pmbus/tps53679) Extend device list supported by driver
> > > >>>>
> > > >>>> On 1/5/20 2:58 AM, Vadim Pasternak wrote:
> > > >>>>> Extends driver with support of the additional devices:
> > > >>>>> Texas Instruments Dual channel DCAP+ multiphase controllers:
> > > >>>>> TPS53688, SN1906016.
> > > >>>>> Infineon Multi-phase Digital VR Controller Sierra devices
> > > >>>>> XDPE12286C, XDPE12284C, XDPE12283C, XDPE12254C and
> XDPE12250C.
> > > >>>>>
> > > >>>>> Extend Kconfig with added devices.
> > > >>>>>
> > > >>>>> Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
> > > >>>>> ---
> > > >>>>>     drivers/hwmon/pmbus/Kconfig    |  5 +++--
> > > >>>>>     drivers/hwmon/pmbus/tps53679.c | 14 ++++++++++++++
> > > >>>>>     2 files changed, 17 insertions(+), 2 deletions(-)
> > > >>>>>
> > > >>>>> diff --git a/drivers/hwmon/pmbus/Kconfig
> > > >>>>> b/drivers/hwmon/pmbus/Kconfig index
> 59859979571d..9e3d197d5322
> > > >>>>> 100644
> > > >>>>> --- a/drivers/hwmon/pmbus/Kconfig
> > > >>>>> +++ b/drivers/hwmon/pmbus/Kconfig
> > > >>>>> @@ -200,10 +200,11 @@ config SENSORS_TPS40422
> > > >>>>>     	  be called tps40422.
> > > >>>>>
> > > >>>>>     config SENSORS_TPS53679
> > > >>>>> -	tristate "TI TPS53679"
> > > >>>>> +	tristate "TI TPS53679, TPS53688, SN1906016, Infineon
> > > >>>>> +XDPE122xxx
> > > >>>> family"
> > > >>>>>     	help
> > > >>>>>     	  If you say yes here you get hardware monitoring support for TI
> > > >>>>> -	  TPS53679.
> > > >>>>> +	  TPS53679, PS53688, SN1906016 and Infineon XDPE12286C,
> > > >>>> XDPE12284C,
> > > >>>>
> > > >>>> TPS53688. For the others, for some I can't even determine if
> > > >>>> they exist in the first place (eg SN1906016, XPDE12250C) or how
> > > >>>> they would differ from other variants (eg XPDE12284C vs.
> XPDE12284A).
> > > >>>> And why would they all use the same bit map in the VOUT_MODE
> > > >>>> register, the same number of PMBus pages (phases), and the same
> > > >>>> attributes
> > > >> in each page ?
> > > >>>
> > > >>> Hi Guenter,
> > > >>>
> > > >>> Thank you for reply.
> > > >>>
> > > >>> On our new system we have device XPDE12284C equipped.
> > > >>> I tested this device.
> > > >>>
> > > >> Sounds good, but did you also make sure that all chips have the
> > > >> same number of pages (phases), the same set of commands as the TI
> > > >> chip, and support the same bit settings in VOUT_MODE ? It seems a
> > > >> bit unlikely that TI's register definitions would make it into an Infineon
> chip.
> > > >>
> > > >> Also, what about the SN1906016 ? I don't find that anywhere,
> > > >> except in one place where it is listed as MCU from TI.
> > > >
> > > > I'll drop SN1906016.
> > > > Datasheet has a title Dual channel DCAP+ multiphase controllers:
> > > > TPS53688, SN1906016.
> > > > But maybe it's some custom device (anyway I'll try to check it with TI).
> > > >
> > >
> > > Or maybe SN1906016 means something else. Unless we have explicit
> > > confirmation that the chip exists (or will exist) we should not add it to the
> list.
> > >
> > > >>
> > > >>> Infineon datasheet refers all these device as XDPE122xxC family
> > > >>> and it doesn't specify any differences in register map between these
> devices.
> > > >>
> > > >> That is a bit vague, especially when it includes devices which
> > > >> return zero results with Google searches.
> > > >>
> > > >> "A" vs. "C" may distinguish automotive vs. commercial; the "A"
> > > >> device is listed under automotive. If the command set is the
> > > >> same, I don't really want the "c" in the id.
> > > >
> > > > Got feedback from Infineon guys.
> > > > No need 'C' at the end, as you wrote.
> > > > All XDPE12250, XDPE12254, XDPE12283, XDPE12284, XDPE12286 are
> > > > treated in the same way:
> > > > same pages, same VOUT_MODE, VOUT_READ, etcetera.
> > > >
> > >
> > > And same as TI, including VOUT_MODE ? Also, did they confirm that
> > > the unpublished chips do or will actually exist ?
> >
> > Hi Gunther,
> >
> > According to the input I got from Infineon guys, these device are
> > already available for the customers, like XPDE12284, which is equipped
> > on new Mellanox 400Gx32 Ethernet system, on which we are working now.
> >
> > But I'll re-check if all these devices are available today to be on
> > the safe Side.
> >
> > Regarding VOUT modes:
> > TPS53679 uses modes - 0x01, 0x02, 0x04, 0x05, 0x07
> > TPS53688 uses modes - 0x04, 0x07
> > XDPE122xxx uses modes - 0x01, 0x02, 0x03 and additionally 0x10, which
> > is for 6.25mV VID table (AMD application).
> >
> 
> The problem is that PMBus does not define VID mode values. If it did, we could
> add vrm version detection detection to the pmbus core. 0x01 for
> TPS53679 _may_ be the same as 0x01 for XDPE122xxx, or maybe not.
> There is no way to be sure without datasheets.
> 
> > I didn't add support for mode 0x10 in the patch.
> >
> > The VID table for the AMD application is different from the Intel VID
> > tables.
> >
> > A value of 0x0 corresponds to the highest output voltage of 1.55V.
> > The voltage is reduced in 6.25mV steps down to the value 0xd8, which
> > corresponds to 0.2V.
> >
> > The formula for the calculation of the output voltage would be:
> >
> > 	case DON’T_NOW_HOW_TO_CALL_IT:
> 
> Doesn't the datasheet have something to say ?

It just specifies VID table format as
0 = 10mV VID table
1 = 5mv VID table
2 = 6.25mv VID table
3 = 10mV VID table (200mV offset)
calculation as:
Range: 0 = Off, 1 (250mV) to 255 (1520mV); vid_table=0 (10mV)
Range: 0 = Off, 1 (500mV) to 255 (3040mV); vid_table=1 (5mV)
Range: 0 = Off, 1 (200mV) to 255 (2740mV); vid_table=3 (10mV)
Range: 0 = (1550mV) to 247 (6.25mV); 248~255 = Off; vid_table=2 (6.25mV)

And VOUT_MODE[4:0] as:
00001 = 5mV VID table (VR12)
00010 = 10mV VID table (VR12.5 or VR13)
00011 = 10mV VID table (IMVP9)
10000 = 6.25mV VID table (AMD application)
others = illegal setting - PMBus write is acked, but no write occurs

> 
> > 		if (val >= 0x00 && val <= 0xd8)
> >               			rv = 1550 – (val *6.25);
> >
> > I doubled check it.
> >
> > Do you think it should added as well?
> >
> I am quite neutral on that. I am much more concerned with the assumption that
> the mode values have the same meaning for chips from different vendors. In this
> case, what do we do if TI starts shipping a chip in the TPS53xxx series which uses
> mode 0x10 for something else ?
> 
> Overall I'd rather play safe and add a separate driver for the Infineon chips.

I see.

We actually waned to have ability of transparent replacement of TI and Infineon
devices within the same type of system.

Maybe it's possible to have 0x01, 0x02, 0x03, 0x04, 0x05, 0x07 as a basic
set and support for example 0x10 according to specific device id?  


> 
> Thanks,
> Guenter

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver
  2020-01-06 22:29                 ` Vadim Pasternak
@ 2020-01-07  1:28                   ` Guenter Roeck
  2020-01-07  6:06                     ` Vadim Pasternak
  0 siblings, 1 reply; 27+ messages in thread
From: Guenter Roeck @ 2020-01-07  1:28 UTC (permalink / raw)
  To: Vadim Pasternak; +Cc: robh+dt, vijaykhemka, linux-hwmon, devicetree

On 1/6/20 2:29 PM, Vadim Pasternak wrote:
> 
> 
>> -----Original Message-----
>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
>> Sent: Monday, January 06, 2020 11:01 PM
>> To: Vadim Pasternak <vadimp@mellanox.com>
>> Cc: robh+dt@kernel.org; vijaykhemka@fb.com; linux-hwmon@vger.kernel.org;
>> devicetree@vger.kernel.org
>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend
>> device list supported by driver
>>
>> On Mon, Jan 06, 2020 at 04:57:32PM +0000, Vadim Pasternak wrote:
>>>
>>>
>>>> -----Original Message-----
>>>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
>>>> Sent: Monday, January 06, 2020 4:53 PM
>>>> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
>>>> vijaykhemka@fb.com
>>>> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
>>>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679)
>>>> Extend device list supported by driver
>>>>
>>>> On 1/6/20 4:16 AM, Vadim Pasternak wrote:
>>>>>
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter
>>>>>> Roeck
>>>>>> Sent: Sunday, January 05, 2020 8:35 PM
>>>>>> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
>>>>>> vijaykhemka@fb.com
>>>>>> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
>>>>>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon:
>>>>>> (pmbus/tps53679) Extend device list supported by driver
>>>>>>
>>>>>> On 1/5/20 8:44 AM, Vadim Pasternak wrote:
>>>>>>>
>>>>>>>
>>>>>>>> -----Original Message-----
>>>>>>>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter
>>>>>>>> Roeck
>>>>>>>> Sent: Sunday, January 05, 2020 6:04 PM
>>>>>>>> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
>>>>>>>> vijaykhemka@fb.com
>>>>>>>> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
>>>>>>>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon:
>>>>>>>> (pmbus/tps53679) Extend device list supported by driver
>>>>>>>>
>>>>>>>> On 1/5/20 2:58 AM, Vadim Pasternak wrote:
>>>>>>>>> Extends driver with support of the additional devices:
>>>>>>>>> Texas Instruments Dual channel DCAP+ multiphase controllers:
>>>>>>>>> TPS53688, SN1906016.
>>>>>>>>> Infineon Multi-phase Digital VR Controller Sierra devices
>>>>>>>>> XDPE12286C, XDPE12284C, XDPE12283C, XDPE12254C and
>> XDPE12250C.
>>>>>>>>>
>>>>>>>>> Extend Kconfig with added devices.
>>>>>>>>>
>>>>>>>>> Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
>>>>>>>>> ---
>>>>>>>>>      drivers/hwmon/pmbus/Kconfig    |  5 +++--
>>>>>>>>>      drivers/hwmon/pmbus/tps53679.c | 14 ++++++++++++++
>>>>>>>>>      2 files changed, 17 insertions(+), 2 deletions(-)
>>>>>>>>>
>>>>>>>>> diff --git a/drivers/hwmon/pmbus/Kconfig
>>>>>>>>> b/drivers/hwmon/pmbus/Kconfig index
>> 59859979571d..9e3d197d5322
>>>>>>>>> 100644
>>>>>>>>> --- a/drivers/hwmon/pmbus/Kconfig
>>>>>>>>> +++ b/drivers/hwmon/pmbus/Kconfig
>>>>>>>>> @@ -200,10 +200,11 @@ config SENSORS_TPS40422
>>>>>>>>>      	  be called tps40422.
>>>>>>>>>
>>>>>>>>>      config SENSORS_TPS53679
>>>>>>>>> -	tristate "TI TPS53679"
>>>>>>>>> +	tristate "TI TPS53679, TPS53688, SN1906016, Infineon
>>>>>>>>> +XDPE122xxx
>>>>>>>> family"
>>>>>>>>>      	help
>>>>>>>>>      	  If you say yes here you get hardware monitoring support for TI
>>>>>>>>> -	  TPS53679.
>>>>>>>>> +	  TPS53679, PS53688, SN1906016 and Infineon XDPE12286C,
>>>>>>>> XDPE12284C,
>>>>>>>>
>>>>>>>> TPS53688. For the others, for some I can't even determine if
>>>>>>>> they exist in the first place (eg SN1906016, XPDE12250C) or how
>>>>>>>> they would differ from other variants (eg XPDE12284C vs.
>> XPDE12284A).
>>>>>>>> And why would they all use the same bit map in the VOUT_MODE
>>>>>>>> register, the same number of PMBus pages (phases), and the same
>>>>>>>> attributes
>>>>>> in each page ?
>>>>>>>
>>>>>>> Hi Guenter,
>>>>>>>
>>>>>>> Thank you for reply.
>>>>>>>
>>>>>>> On our new system we have device XPDE12284C equipped.
>>>>>>> I tested this device.
>>>>>>>
>>>>>> Sounds good, but did you also make sure that all chips have the
>>>>>> same number of pages (phases), the same set of commands as the TI
>>>>>> chip, and support the same bit settings in VOUT_MODE ? It seems a
>>>>>> bit unlikely that TI's register definitions would make it into an Infineon
>> chip.
>>>>>>
>>>>>> Also, what about the SN1906016 ? I don't find that anywhere,
>>>>>> except in one place where it is listed as MCU from TI.
>>>>>
>>>>> I'll drop SN1906016.
>>>>> Datasheet has a title Dual channel DCAP+ multiphase controllers:
>>>>> TPS53688, SN1906016.
>>>>> But maybe it's some custom device (anyway I'll try to check it with TI).
>>>>>
>>>>
>>>> Or maybe SN1906016 means something else. Unless we have explicit
>>>> confirmation that the chip exists (or will exist) we should not add it to the
>> list.
>>>>
>>>>>>
>>>>>>> Infineon datasheet refers all these device as XDPE122xxC family
>>>>>>> and it doesn't specify any differences in register map between these
>> devices.
>>>>>>
>>>>>> That is a bit vague, especially when it includes devices which
>>>>>> return zero results with Google searches.
>>>>>>
>>>>>> "A" vs. "C" may distinguish automotive vs. commercial; the "A"
>>>>>> device is listed under automotive. If the command set is the
>>>>>> same, I don't really want the "c" in the id.
>>>>>
>>>>> Got feedback from Infineon guys.
>>>>> No need 'C' at the end, as you wrote.
>>>>> All XDPE12250, XDPE12254, XDPE12283, XDPE12284, XDPE12286 are
>>>>> treated in the same way:
>>>>> same pages, same VOUT_MODE, VOUT_READ, etcetera.
>>>>>
>>>>
>>>> And same as TI, including VOUT_MODE ? Also, did they confirm that
>>>> the unpublished chips do or will actually exist ?
>>>
>>> Hi Gunther,
>>>
>>> According to the input I got from Infineon guys, these device are
>>> already available for the customers, like XPDE12284, which is equipped
>>> on new Mellanox 400Gx32 Ethernet system, on which we are working now.
>>>
>>> But I'll re-check if all these devices are available today to be on
>>> the safe Side.
>>>
>>> Regarding VOUT modes:
>>> TPS53679 uses modes - 0x01, 0x02, 0x04, 0x05, 0x07
>>> TPS53688 uses modes - 0x04, 0x07
>>> XDPE122xxx uses modes - 0x01, 0x02, 0x03 and additionally 0x10, which
>>> is for 6.25mV VID table (AMD application).
>>>
>>
>> The problem is that PMBus does not define VID mode values. If it did, we could
>> add vrm version detection detection to the pmbus core. 0x01 for
>> TPS53679 _may_ be the same as 0x01 for XDPE122xxx, or maybe not.
>> There is no way to be sure without datasheets.
>>
>>> I didn't add support for mode 0x10 in the patch.
>>>
>>> The VID table for the AMD application is different from the Intel VID
>>> tables.
>>>
>>> A value of 0x0 corresponds to the highest output voltage of 1.55V.
>>> The voltage is reduced in 6.25mV steps down to the value 0xd8, which
>>> corresponds to 0.2V.
>>>
>>> The formula for the calculation of the output voltage would be:
>>>
>>> 	case DON’T_NOW_HOW_TO_CALL_IT:
>>
>> Doesn't the datasheet have something to say ?
> 
> It just specifies VID table format as
> 0 = 10mV VID table
> 1 = 5mv VID table
> 2 = 6.25mv VID table
> 3 = 10mV VID table (200mV offset)
> calculation as:
> Range: 0 = Off, 1 (250mV) to 255 (1520mV); vid_table=0 (10mV)
> Range: 0 = Off, 1 (500mV) to 255 (3040mV); vid_table=1 (5mV)
> Range: 0 = Off, 1 (200mV) to 255 (2740mV); vid_table=3 (10mV)
> Range: 0 = (1550mV) to 247 (6.25mV); 248~255 = Off; vid_table=2 (6.25mV)
> 
> And VOUT_MODE[4:0] as:
> 00001 = 5mV VID table (VR12)
> 00010 = 10mV VID table (VR12.5 or VR13)
> 00011 = 10mV VID table (IMVP9)
> 10000 = 6.25mV VID table (AMD application)
> others = illegal setting - PMBus write is acked, but no write occurs
> 
>>
>>> 		if (val >= 0x00 && val <= 0xd8)
>>>                			rv = 1550 – (val *6.25);
>>>
>>> I doubled check it.
>>>
>>> Do you think it should added as well?
>>>
>> I am quite neutral on that. I am much more concerned with the assumption that
>> the mode values have the same meaning for chips from different vendors. In this
>> case, what do we do if TI starts shipping a chip in the TPS53xxx series which uses
>> mode 0x10 for something else ?
>>
>> Overall I'd rather play safe and add a separate driver for the Infineon chips.
> 
> I see.
> 
> We actually waned to have ability of transparent replacement of TI and Infineon
> devices within the same type of system.
> 

That should not be a problem as long as you instantiate them differently.
After all, the relevant information _should_ be available in ACPI tables.
Otherwise you'd have to claim that a chip is, say, tps53688, while it is
really an Infineon chip. And that is never a good idea.

> Maybe it's possible to have 0x01, 0x02, 0x03, 0x04, 0x05, 0x07 as a basic
> set and support for example 0x10 according to specific device id?
> 

Unfortunately not, because there is no standard defining those. TI might
at some point decide to sell a new chip where 0x03 means something completely
different. On top of that, I already know that at least some of the TI chips
of this series have more than two pages. Unfortunately, the information I have
is vague (no datasheet again). That is another reason for avoiding pollution
of the tps driver with non-TI chip support.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver
  2020-01-07  1:28                   ` Guenter Roeck
@ 2020-01-07  6:06                     ` Vadim Pasternak
  2020-01-07 12:14                       ` Guenter Roeck
  0 siblings, 1 reply; 27+ messages in thread
From: Vadim Pasternak @ 2020-01-07  6:06 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: robh+dt, vijaykhemka, linux-hwmon, devicetree



> -----Original Message-----
> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> Sent: Tuesday, January 07, 2020 3:29 AM
> To: Vadim Pasternak <vadimp@mellanox.com>
> Cc: robh+dt@kernel.org; vijaykhemka@fb.com; linux-hwmon@vger.kernel.org;
> devicetree@vger.kernel.org
> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend
> device list supported by driver
> 
> On 1/6/20 2:29 PM, Vadim Pasternak wrote:
> >
> >
> >> -----Original Message-----
> >> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> >> Sent: Monday, January 06, 2020 11:01 PM
> >> To: Vadim Pasternak <vadimp@mellanox.com>
> >> Cc: robh+dt@kernel.org; vijaykhemka@fb.com;
> >> linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> >> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679)
> >> Extend device list supported by driver
> >>
> >> On Mon, Jan 06, 2020 at 04:57:32PM +0000, Vadim Pasternak wrote:
> >>>
> >>>
> >>>> -----Original Message-----
> >>>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> >>>> Sent: Monday, January 06, 2020 4:53 PM
> >>>> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
> >>>> vijaykhemka@fb.com
> >>>> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> >>>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679)
> >>>> Extend device list supported by driver
> >>>>
> >>>> On 1/6/20 4:16 AM, Vadim Pasternak wrote:
> >>>>>
> >>>>>
> >>>>>> -----Original Message-----
> >>>>>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter
> >>>>>> Roeck
> >>>>>> Sent: Sunday, January 05, 2020 8:35 PM
> >>>>>> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
> >>>>>> vijaykhemka@fb.com
> >>>>>> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> >>>>>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon:
> >>>>>> (pmbus/tps53679) Extend device list supported by driver
> >>>>>>
> >>>>>> On 1/5/20 8:44 AM, Vadim Pasternak wrote:
> >>>>>>>
> >>>>>>>
> >>>>>>>> -----Original Message-----
> >>>>>>>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter
> >>>>>>>> Roeck
> >>>>>>>> Sent: Sunday, January 05, 2020 6:04 PM
> >>>>>>>> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
> >>>>>>>> vijaykhemka@fb.com
> >>>>>>>> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> >>>>>>>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon:
> >>>>>>>> (pmbus/tps53679) Extend device list supported by driver
> >>>>>>>>
> >>>>>>>> On 1/5/20 2:58 AM, Vadim Pasternak wrote:
> >>>>>>>>> Extends driver with support of the additional devices:
> >>>>>>>>> Texas Instruments Dual channel DCAP+ multiphase controllers:
> >>>>>>>>> TPS53688, SN1906016.
> >>>>>>>>> Infineon Multi-phase Digital VR Controller Sierra devices
> >>>>>>>>> XDPE12286C, XDPE12284C, XDPE12283C, XDPE12254C and
> >> XDPE12250C.
> >>>>>>>>>
> >>>>>>>>> Extend Kconfig with added devices.
> >>>>>>>>>
> >>>>>>>>> Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
> >>>>>>>>> ---
> >>>>>>>>>      drivers/hwmon/pmbus/Kconfig    |  5 +++--
> >>>>>>>>>      drivers/hwmon/pmbus/tps53679.c | 14 ++++++++++++++
> >>>>>>>>>      2 files changed, 17 insertions(+), 2 deletions(-)
> >>>>>>>>>
> >>>>>>>>> diff --git a/drivers/hwmon/pmbus/Kconfig
> >>>>>>>>> b/drivers/hwmon/pmbus/Kconfig index
> >> 59859979571d..9e3d197d5322
> >>>>>>>>> 100644
> >>>>>>>>> --- a/drivers/hwmon/pmbus/Kconfig
> >>>>>>>>> +++ b/drivers/hwmon/pmbus/Kconfig
> >>>>>>>>> @@ -200,10 +200,11 @@ config SENSORS_TPS40422
> >>>>>>>>>      	  be called tps40422.
> >>>>>>>>>
> >>>>>>>>>      config SENSORS_TPS53679
> >>>>>>>>> -	tristate "TI TPS53679"
> >>>>>>>>> +	tristate "TI TPS53679, TPS53688, SN1906016, Infineon
> >>>>>>>>> +XDPE122xxx
> >>>>>>>> family"
> >>>>>>>>>      	help
> >>>>>>>>>      	  If you say yes here you get hardware monitoring support for TI
> >>>>>>>>> -	  TPS53679.
> >>>>>>>>> +	  TPS53679, PS53688, SN1906016 and Infineon XDPE12286C,
> >>>>>>>> XDPE12284C,
> >>>>>>>>
> >>>>>>>> TPS53688. For the others, for some I can't even determine if
> >>>>>>>> they exist in the first place (eg SN1906016, XPDE12250C) or how
> >>>>>>>> they would differ from other variants (eg XPDE12284C vs.
> >> XPDE12284A).
> >>>>>>>> And why would they all use the same bit map in the VOUT_MODE
> >>>>>>>> register, the same number of PMBus pages (phases), and the same
> >>>>>>>> attributes
> >>>>>> in each page ?
> >>>>>>>
> >>>>>>> Hi Guenter,
> >>>>>>>
> >>>>>>> Thank you for reply.
> >>>>>>>
> >>>>>>> On our new system we have device XPDE12284C equipped.
> >>>>>>> I tested this device.
> >>>>>>>
> >>>>>> Sounds good, but did you also make sure that all chips have the
> >>>>>> same number of pages (phases), the same set of commands as the TI
> >>>>>> chip, and support the same bit settings in VOUT_MODE ? It seems a
> >>>>>> bit unlikely that TI's register definitions would make it into an
> >>>>>> Infineon
> >> chip.
> >>>>>>
> >>>>>> Also, what about the SN1906016 ? I don't find that anywhere,
> >>>>>> except in one place where it is listed as MCU from TI.
> >>>>>
> >>>>> I'll drop SN1906016.
> >>>>> Datasheet has a title Dual channel DCAP+ multiphase controllers:
> >>>>> TPS53688, SN1906016.
> >>>>> But maybe it's some custom device (anyway I'll try to check it with TI).
> >>>>>
> >>>>
> >>>> Or maybe SN1906016 means something else. Unless we have explicit
> >>>> confirmation that the chip exists (or will exist) we should not add
> >>>> it to the
> >> list.
> >>>>
> >>>>>>
> >>>>>>> Infineon datasheet refers all these device as XDPE122xxC family
> >>>>>>> and it doesn't specify any differences in register map between
> >>>>>>> these
> >> devices.
> >>>>>>
> >>>>>> That is a bit vague, especially when it includes devices which
> >>>>>> return zero results with Google searches.
> >>>>>>
> >>>>>> "A" vs. "C" may distinguish automotive vs. commercial; the "A"
> >>>>>> device is listed under automotive. If the command set is the
> >>>>>> same, I don't really want the "c" in the id.
> >>>>>
> >>>>> Got feedback from Infineon guys.
> >>>>> No need 'C' at the end, as you wrote.
> >>>>> All XDPE12250, XDPE12254, XDPE12283, XDPE12284, XDPE12286 are
> >>>>> treated in the same way:
> >>>>> same pages, same VOUT_MODE, VOUT_READ, etcetera.
> >>>>>
> >>>>
> >>>> And same as TI, including VOUT_MODE ? Also, did they confirm that
> >>>> the unpublished chips do or will actually exist ?
> >>>
> >>> Hi Gunther,
> >>>
> >>> According to the input I got from Infineon guys, these device are
> >>> already available for the customers, like XPDE12284, which is
> >>> equipped on new Mellanox 400Gx32 Ethernet system, on which we are
> working now.
> >>>
> >>> But I'll re-check if all these devices are available today to be on
> >>> the safe Side.
> >>>
> >>> Regarding VOUT modes:
> >>> TPS53679 uses modes - 0x01, 0x02, 0x04, 0x05, 0x07
> >>> TPS53688 uses modes - 0x04, 0x07
> >>> XDPE122xxx uses modes - 0x01, 0x02, 0x03 and additionally 0x10,
> >>> which is for 6.25mV VID table (AMD application).
> >>>
> >>
> >> The problem is that PMBus does not define VID mode values. If it did,
> >> we could add vrm version detection detection to the pmbus core. 0x01
> >> for
> >> TPS53679 _may_ be the same as 0x01 for XDPE122xxx, or maybe not.
> >> There is no way to be sure without datasheets.
> >>
> >>> I didn't add support for mode 0x10 in the patch.
> >>>
> >>> The VID table for the AMD application is different from the Intel
> >>> VID tables.
> >>>
> >>> A value of 0x0 corresponds to the highest output voltage of 1.55V.
> >>> The voltage is reduced in 6.25mV steps down to the value 0xd8, which
> >>> corresponds to 0.2V.
> >>>
> >>> The formula for the calculation of the output voltage would be:
> >>>
> >>> 	case DON’T_NOW_HOW_TO_CALL_IT:
> >>
> >> Doesn't the datasheet have something to say ?
> >
> > It just specifies VID table format as
> > 0 = 10mV VID table
> > 1 = 5mv VID table
> > 2 = 6.25mv VID table
> > 3 = 10mV VID table (200mV offset)
> > calculation as:
> > Range: 0 = Off, 1 (250mV) to 255 (1520mV); vid_table=0 (10mV)
> > Range: 0 = Off, 1 (500mV) to 255 (3040mV); vid_table=1 (5mV)
> > Range: 0 = Off, 1 (200mV) to 255 (2740mV); vid_table=3 (10mV)
> > Range: 0 = (1550mV) to 247 (6.25mV); 248~255 = Off; vid_table=2
> > (6.25mV)
> >
> > And VOUT_MODE[4:0] as:
> > 00001 = 5mV VID table (VR12)
> > 00010 = 10mV VID table (VR12.5 or VR13)
> > 00011 = 10mV VID table (IMVP9)
> > 10000 = 6.25mV VID table (AMD application) others = illegal setting -
> > PMBus write is acked, but no write occurs
> >
> >>
> >>> 		if (val >= 0x00 && val <= 0xd8)
> >>>                			rv = 1550 – (val *6.25);
> >>>
> >>> I doubled check it.
> >>>
> >>> Do you think it should added as well?
> >>>
> >> I am quite neutral on that. I am much more concerned with the
> >> assumption that the mode values have the same meaning for chips from
> >> different vendors. In this case, what do we do if TI starts shipping
> >> a chip in the TPS53xxx series which uses mode 0x10 for something else ?
> >>
> >> Overall I'd rather play safe and add a separate driver for the Infineon chips.
> >
> > I see.
> >
> > We actually waned to have ability of transparent replacement of TI and
> > Infineon devices within the same type of system.
> >
> 
> That should not be a problem as long as you instantiate them differently.
> After all, the relevant information _should_ be available in ACPI tables.
> Otherwise you'd have to claim that a chip is, say, tps53688, while it is really an
> Infineon chip. And that is never a good idea.
> 
> > Maybe it's possible to have 0x01, 0x02, 0x03, 0x04, 0x05, 0x07 as a
> > basic set and support for example 0x10 according to specific device id?
> >
> 
> Unfortunately not, because there is no standard defining those. TI might at
> some point decide to sell a new chip where 0x03 means something completely
> different. On top of that, I already know that at least some of the TI chips of this
> series have more than two pages. Unfortunately, the information I have is vague
> (no datasheet again). That is another reason for avoiding pollution of the tps
> driver with non-TI chip support.

OK.
So, I think to modify the patch as following:

Add sperate driver  xdpe122xx with support this Infineon family (after final
checking with Infineon, which of the are available).
It will support 0x01, 0x02, 0x03, 0x10.

Add tps53688 to tps53679 driver.

Add two new vrf versions imvp9, amd625mv (I only don't know what is the
best naming for these new modes).

And these new modes will be handled as:
	case imvp9:
		if (val >= 0x01)
			rv = 200 + (val - 1) * 10;
		break;
	case amd625mv:
		if (val >= 0x0 && val <= 0xd8)
			rv = DIV_ROUND_CLOSEST(155000 - val * 625, 100);
		break;

What it be fine?

If yes, I'll make v1 patch version.

Thanks,
Vadim.

> 
> Thanks,
> Guenter

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver
  2020-01-07  6:06                     ` Vadim Pasternak
@ 2020-01-07 12:14                       ` Guenter Roeck
  2020-01-08 14:10                         ` Vadim Pasternak
  0 siblings, 1 reply; 27+ messages in thread
From: Guenter Roeck @ 2020-01-07 12:14 UTC (permalink / raw)
  To: Vadim Pasternak; +Cc: robh+dt, vijaykhemka, linux-hwmon, devicetree

On 1/6/20 10:06 PM, Vadim Pasternak wrote:
> 
> 
>> -----Original Message-----
>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
>> Sent: Tuesday, January 07, 2020 3:29 AM
>> To: Vadim Pasternak <vadimp@mellanox.com>
>> Cc: robh+dt@kernel.org; vijaykhemka@fb.com; linux-hwmon@vger.kernel.org;
>> devicetree@vger.kernel.org
>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend
>> device list supported by driver
>>
>> On 1/6/20 2:29 PM, Vadim Pasternak wrote:
>>>
>>>
>>>> -----Original Message-----
>>>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
>>>> Sent: Monday, January 06, 2020 11:01 PM
>>>> To: Vadim Pasternak <vadimp@mellanox.com>
>>>> Cc: robh+dt@kernel.org; vijaykhemka@fb.com;
>>>> linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
>>>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679)
>>>> Extend device list supported by driver
>>>>
>>>> On Mon, Jan 06, 2020 at 04:57:32PM +0000, Vadim Pasternak wrote:
>>>>>
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
>>>>>> Sent: Monday, January 06, 2020 4:53 PM
>>>>>> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
>>>>>> vijaykhemka@fb.com
>>>>>> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
>>>>>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679)
>>>>>> Extend device list supported by driver
>>>>>>
>>>>>> On 1/6/20 4:16 AM, Vadim Pasternak wrote:
>>>>>>>
>>>>>>>
>>>>>>>> -----Original Message-----
>>>>>>>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter
>>>>>>>> Roeck
>>>>>>>> Sent: Sunday, January 05, 2020 8:35 PM
>>>>>>>> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
>>>>>>>> vijaykhemka@fb.com
>>>>>>>> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
>>>>>>>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon:
>>>>>>>> (pmbus/tps53679) Extend device list supported by driver
>>>>>>>>
>>>>>>>> On 1/5/20 8:44 AM, Vadim Pasternak wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> -----Original Message-----
>>>>>>>>>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter
>>>>>>>>>> Roeck
>>>>>>>>>> Sent: Sunday, January 05, 2020 6:04 PM
>>>>>>>>>> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
>>>>>>>>>> vijaykhemka@fb.com
>>>>>>>>>> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
>>>>>>>>>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon:
>>>>>>>>>> (pmbus/tps53679) Extend device list supported by driver
>>>>>>>>>>
>>>>>>>>>> On 1/5/20 2:58 AM, Vadim Pasternak wrote:
>>>>>>>>>>> Extends driver with support of the additional devices:
>>>>>>>>>>> Texas Instruments Dual channel DCAP+ multiphase controllers:
>>>>>>>>>>> TPS53688, SN1906016.
>>>>>>>>>>> Infineon Multi-phase Digital VR Controller Sierra devices
>>>>>>>>>>> XDPE12286C, XDPE12284C, XDPE12283C, XDPE12254C and
>>>> XDPE12250C.
>>>>>>>>>>>
>>>>>>>>>>> Extend Kconfig with added devices.
>>>>>>>>>>>
>>>>>>>>>>> Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
>>>>>>>>>>> ---
>>>>>>>>>>>       drivers/hwmon/pmbus/Kconfig    |  5 +++--
>>>>>>>>>>>       drivers/hwmon/pmbus/tps53679.c | 14 ++++++++++++++
>>>>>>>>>>>       2 files changed, 17 insertions(+), 2 deletions(-)
>>>>>>>>>>>
>>>>>>>>>>> diff --git a/drivers/hwmon/pmbus/Kconfig
>>>>>>>>>>> b/drivers/hwmon/pmbus/Kconfig index
>>>> 59859979571d..9e3d197d5322
>>>>>>>>>>> 100644
>>>>>>>>>>> --- a/drivers/hwmon/pmbus/Kconfig
>>>>>>>>>>> +++ b/drivers/hwmon/pmbus/Kconfig
>>>>>>>>>>> @@ -200,10 +200,11 @@ config SENSORS_TPS40422
>>>>>>>>>>>       	  be called tps40422.
>>>>>>>>>>>
>>>>>>>>>>>       config SENSORS_TPS53679
>>>>>>>>>>> -	tristate "TI TPS53679"
>>>>>>>>>>> +	tristate "TI TPS53679, TPS53688, SN1906016, Infineon
>>>>>>>>>>> +XDPE122xxx
>>>>>>>>>> family"
>>>>>>>>>>>       	help
>>>>>>>>>>>       	  If you say yes here you get hardware monitoring support for TI
>>>>>>>>>>> -	  TPS53679.
>>>>>>>>>>> +	  TPS53679, PS53688, SN1906016 and Infineon XDPE12286C,
>>>>>>>>>> XDPE12284C,
>>>>>>>>>>
>>>>>>>>>> TPS53688. For the others, for some I can't even determine if
>>>>>>>>>> they exist in the first place (eg SN1906016, XPDE12250C) or how
>>>>>>>>>> they would differ from other variants (eg XPDE12284C vs.
>>>> XPDE12284A).
>>>>>>>>>> And why would they all use the same bit map in the VOUT_MODE
>>>>>>>>>> register, the same number of PMBus pages (phases), and the same
>>>>>>>>>> attributes
>>>>>>>> in each page ?
>>>>>>>>>
>>>>>>>>> Hi Guenter,
>>>>>>>>>
>>>>>>>>> Thank you for reply.
>>>>>>>>>
>>>>>>>>> On our new system we have device XPDE12284C equipped.
>>>>>>>>> I tested this device.
>>>>>>>>>
>>>>>>>> Sounds good, but did you also make sure that all chips have the
>>>>>>>> same number of pages (phases), the same set of commands as the TI
>>>>>>>> chip, and support the same bit settings in VOUT_MODE ? It seems a
>>>>>>>> bit unlikely that TI's register definitions would make it into an
>>>>>>>> Infineon
>>>> chip.
>>>>>>>>
>>>>>>>> Also, what about the SN1906016 ? I don't find that anywhere,
>>>>>>>> except in one place where it is listed as MCU from TI.
>>>>>>>
>>>>>>> I'll drop SN1906016.
>>>>>>> Datasheet has a title Dual channel DCAP+ multiphase controllers:
>>>>>>> TPS53688, SN1906016.
>>>>>>> But maybe it's some custom device (anyway I'll try to check it with TI).
>>>>>>>
>>>>>>
>>>>>> Or maybe SN1906016 means something else. Unless we have explicit
>>>>>> confirmation that the chip exists (or will exist) we should not add
>>>>>> it to the
>>>> list.
>>>>>>
>>>>>>>>
>>>>>>>>> Infineon datasheet refers all these device as XDPE122xxC family
>>>>>>>>> and it doesn't specify any differences in register map between
>>>>>>>>> these
>>>> devices.
>>>>>>>>
>>>>>>>> That is a bit vague, especially when it includes devices which
>>>>>>>> return zero results with Google searches.
>>>>>>>>
>>>>>>>> "A" vs. "C" may distinguish automotive vs. commercial; the "A"
>>>>>>>> device is listed under automotive. If the command set is the
>>>>>>>> same, I don't really want the "c" in the id.
>>>>>>>
>>>>>>> Got feedback from Infineon guys.
>>>>>>> No need 'C' at the end, as you wrote.
>>>>>>> All XDPE12250, XDPE12254, XDPE12283, XDPE12284, XDPE12286 are
>>>>>>> treated in the same way:
>>>>>>> same pages, same VOUT_MODE, VOUT_READ, etcetera.
>>>>>>>
>>>>>>
>>>>>> And same as TI, including VOUT_MODE ? Also, did they confirm that
>>>>>> the unpublished chips do or will actually exist ?
>>>>>
>>>>> Hi Gunther,
>>>>>
>>>>> According to the input I got from Infineon guys, these device are
>>>>> already available for the customers, like XPDE12284, which is
>>>>> equipped on new Mellanox 400Gx32 Ethernet system, on which we are
>> working now.
>>>>>
>>>>> But I'll re-check if all these devices are available today to be on
>>>>> the safe Side.
>>>>>
>>>>> Regarding VOUT modes:
>>>>> TPS53679 uses modes - 0x01, 0x02, 0x04, 0x05, 0x07
>>>>> TPS53688 uses modes - 0x04, 0x07
>>>>> XDPE122xxx uses modes - 0x01, 0x02, 0x03 and additionally 0x10,
>>>>> which is for 6.25mV VID table (AMD application).
>>>>>
>>>>
>>>> The problem is that PMBus does not define VID mode values. If it did,
>>>> we could add vrm version detection detection to the pmbus core. 0x01
>>>> for
>>>> TPS53679 _may_ be the same as 0x01 for XDPE122xxx, or maybe not.
>>>> There is no way to be sure without datasheets.
>>>>
>>>>> I didn't add support for mode 0x10 in the patch.
>>>>>
>>>>> The VID table for the AMD application is different from the Intel
>>>>> VID tables.
>>>>>
>>>>> A value of 0x0 corresponds to the highest output voltage of 1.55V.
>>>>> The voltage is reduced in 6.25mV steps down to the value 0xd8, which
>>>>> corresponds to 0.2V.
>>>>>
>>>>> The formula for the calculation of the output voltage would be:
>>>>>
>>>>> 	case DON’T_NOW_HOW_TO_CALL_IT:
>>>>
>>>> Doesn't the datasheet have something to say ?
>>>
>>> It just specifies VID table format as
>>> 0 = 10mV VID table
>>> 1 = 5mv VID table
>>> 2 = 6.25mv VID table
>>> 3 = 10mV VID table (200mV offset)
>>> calculation as:
>>> Range: 0 = Off, 1 (250mV) to 255 (1520mV); vid_table=0 (10mV)
>>> Range: 0 = Off, 1 (500mV) to 255 (3040mV); vid_table=1 (5mV)
>>> Range: 0 = Off, 1 (200mV) to 255 (2740mV); vid_table=3 (10mV)
>>> Range: 0 = (1550mV) to 247 (6.25mV); 248~255 = Off; vid_table=2
>>> (6.25mV)
>>>
>>> And VOUT_MODE[4:0] as:
>>> 00001 = 5mV VID table (VR12)
>>> 00010 = 10mV VID table (VR12.5 or VR13)
>>> 00011 = 10mV VID table (IMVP9)
>>> 10000 = 6.25mV VID table (AMD application) others = illegal setting -
>>> PMBus write is acked, but no write occurs
>>>
>>>>
>>>>> 		if (val >= 0x00 && val <= 0xd8)
>>>>>                 			rv = 1550 – (val *6.25);
>>>>>
>>>>> I doubled check it.
>>>>>
>>>>> Do you think it should added as well?
>>>>>
>>>> I am quite neutral on that. I am much more concerned with the
>>>> assumption that the mode values have the same meaning for chips from
>>>> different vendors. In this case, what do we do if TI starts shipping
>>>> a chip in the TPS53xxx series which uses mode 0x10 for something else ?
>>>>
>>>> Overall I'd rather play safe and add a separate driver for the Infineon chips.
>>>
>>> I see.
>>>
>>> We actually waned to have ability of transparent replacement of TI and
>>> Infineon devices within the same type of system.
>>>
>>
>> That should not be a problem as long as you instantiate them differently.
>> After all, the relevant information _should_ be available in ACPI tables.
>> Otherwise you'd have to claim that a chip is, say, tps53688, while it is really an
>> Infineon chip. And that is never a good idea.
>>
>>> Maybe it's possible to have 0x01, 0x02, 0x03, 0x04, 0x05, 0x07 as a
>>> basic set and support for example 0x10 according to specific device id?
>>>
>>
>> Unfortunately not, because there is no standard defining those. TI might at
>> some point decide to sell a new chip where 0x03 means something completely
>> different. On top of that, I already know that at least some of the TI chips of this
>> series have more than two pages. Unfortunately, the information I have is vague
>> (no datasheet again). That is another reason for avoiding pollution of the tps
>> driver with non-TI chip support.
> 
> OK.
> So, I think to modify the patch as following:
> 
> Add sperate driver  xdpe122xx with support this Infineon family (after final
> checking with Infineon, which of the are available).
> It will support 0x01, 0x02, 0x03, 0x10.
> 
> Add tps53688 to tps53679 driver.
> 
> Add two new vrf versions imvp9, amd625mv (I only don't know what is the
> best naming for these new modes).
> 
> And these new modes will be handled as:
> 	case imvp9:
> 		if (val >= 0x01)
> 			rv = 200 + (val - 1) * 10;
> 		break;
> 	case amd625mv:
> 		if (val >= 0x0 && val <= 0xd8)
> 			rv = DIV_ROUND_CLOSEST(155000 - val * 625, 100);
> 		break;
> 
> What it be fine?
> 

Yes, sounds good.

Thanks,
Guenter

> If yes, I'll make v1 patch version.
> 
> Thanks,
> Vadim.
> 
>>
>> Thanks,
>> Guenter


^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver
  2020-01-07 12:14                       ` Guenter Roeck
@ 2020-01-08 14:10                         ` Vadim Pasternak
  2020-01-08 16:47                           ` Guenter Roeck
  0 siblings, 1 reply; 27+ messages in thread
From: Vadim Pasternak @ 2020-01-08 14:10 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: robh+dt, vijaykhemka, linux-hwmon, devicetree, Michael Shych



> -----Original Message-----
> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> Sent: Tuesday, January 07, 2020 2:14 PM
> To: Vadim Pasternak <vadimp@mellanox.com>
> Cc: robh+dt@kernel.org; vijaykhemka@fb.com; linux-hwmon@vger.kernel.org;
> devicetree@vger.kernel.org
> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend
> device list supported by driver
> 
> On 1/6/20 10:06 PM, Vadim Pasternak wrote:
> >
> >
> >> -----Original Message-----
> >> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> >> Sent: Tuesday, January 07, 2020 3:29 AM
> >> To: Vadim Pasternak <vadimp@mellanox.com>
> >> Cc: robh+dt@kernel.org; vijaykhemka@fb.com;
> >> linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> >> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679)
> >> Extend device list supported by driver
> >>
> >> On 1/6/20 2:29 PM, Vadim Pasternak wrote:
> >>>
> >>>
> >>>> -----Original Message-----
> >>>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> >>>> Sent: Monday, January 06, 2020 11:01 PM
> >>>> To: Vadim Pasternak <vadimp@mellanox.com>
> >>>> Cc: robh+dt@kernel.org; vijaykhemka@fb.com;
> >>>> linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> >>>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679)
> >>>> Extend device list supported by driver
> >>>>
> >>>> On Mon, Jan 06, 2020 at 04:57:32PM +0000, Vadim Pasternak wrote:
> >>>>>
> >>>>>
> >>>>>> -----Original Message-----
> >>>>>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter
> >>>>>> Roeck
> >>>>>> Sent: Monday, January 06, 2020 4:53 PM
> >>>>>> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
> >>>>>> vijaykhemka@fb.com
> >>>>>> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> >>>>>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon:
> >>>>>> (pmbus/tps53679) Extend device list supported by driver
> >>>>>>
> >>>>>> On 1/6/20 4:16 AM, Vadim Pasternak wrote:
> >>>>>>>
> >>>>>>>
> >>>>>>>> -----Original Message-----
> >>>>>>>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter
> >>>>>>>> Roeck
> >>>>>>>> Sent: Sunday, January 05, 2020 8:35 PM
> >>>>>>>> To: Vadim Pasternak <vadimp@mellanox.com>; robh+dt@kernel.org;
> >>>>>>>> vijaykhemka@fb.com
> >>>>>>>> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> >>>>>>>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon:
> >>>>>>>> (pmbus/tps53679) Extend device list supported by driver
> >>>>>>>>
> >>>>>>>> On 1/5/20 8:44 AM, Vadim Pasternak wrote:
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>> -----Original Message-----
> >>>>>>>>>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter
> >>>>>>>>>> Roeck
> >>>>>>>>>> Sent: Sunday, January 05, 2020 6:04 PM
> >>>>>>>>>> To: Vadim Pasternak <vadimp@mellanox.com>;
> >>>>>>>>>> robh+dt@kernel.org; vijaykhemka@fb.com
> >>>>>>>>>> Cc: linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org
> >>>>>>>>>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon:
> >>>>>>>>>> (pmbus/tps53679) Extend device list supported by driver
> >>>>>>>>>>
> >>>>>>>>>> On 1/5/20 2:58 AM, Vadim Pasternak wrote:
> >>>>>>>>>>> Extends driver with support of the additional devices:
> >>>>>>>>>>> Texas Instruments Dual channel DCAP+ multiphase controllers:
> >>>>>>>>>>> TPS53688, SN1906016.
> >>>>>>>>>>> Infineon Multi-phase Digital VR Controller Sierra devices
> >>>>>>>>>>> XDPE12286C, XDPE12284C, XDPE12283C, XDPE12254C and
> >>>> XDPE12250C.
> >>>>>>>>>>>
> >>>>>>>>>>> Extend Kconfig with added devices.
> >>>>>>>>>>>
> >>>>>>>>>>> Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
> >>>>>>>>>>> ---
> >>>>>>>>>>>       drivers/hwmon/pmbus/Kconfig    |  5 +++--
> >>>>>>>>>>>       drivers/hwmon/pmbus/tps53679.c | 14 ++++++++++++++
> >>>>>>>>>>>       2 files changed, 17 insertions(+), 2 deletions(-)
> >>>>>>>>>>>
> >>>>>>>>>>> diff --git a/drivers/hwmon/pmbus/Kconfig
> >>>>>>>>>>> b/drivers/hwmon/pmbus/Kconfig index
> >>>> 59859979571d..9e3d197d5322
> >>>>>>>>>>> 100644
> >>>>>>>>>>> --- a/drivers/hwmon/pmbus/Kconfig
> >>>>>>>>>>> +++ b/drivers/hwmon/pmbus/Kconfig
> >>>>>>>>>>> @@ -200,10 +200,11 @@ config SENSORS_TPS40422
> >>>>>>>>>>>       	  be called tps40422.
> >>>>>>>>>>>
> >>>>>>>>>>>       config SENSORS_TPS53679
> >>>>>>>>>>> -	tristate "TI TPS53679"
> >>>>>>>>>>> +	tristate "TI TPS53679, TPS53688, SN1906016, Infineon
> >>>>>>>>>>> +XDPE122xxx
> >>>>>>>>>> family"
> >>>>>>>>>>>       	help
> >>>>>>>>>>>       	  If you say yes here you get hardware monitoring
> support for TI
> >>>>>>>>>>> -	  TPS53679.
> >>>>>>>>>>> +	  TPS53679, PS53688, SN1906016 and Infineon XDPE12286C,
> >>>>>>>>>> XDPE12284C,
> >>>>>>>>>>
> >>>>>>>>>> TPS53688. For the others, for some I can't even determine if
> >>>>>>>>>> they exist in the first place (eg SN1906016, XPDE12250C) or
> >>>>>>>>>> how they would differ from other variants (eg XPDE12284C vs.
> >>>> XPDE12284A).
> >>>>>>>>>> And why would they all use the same bit map in the VOUT_MODE
> >>>>>>>>>> register, the same number of PMBus pages (phases), and the
> >>>>>>>>>> same attributes
> >>>>>>>> in each page ?
> >>>>>>>>>
> >>>>>>>>> Hi Guenter,
> >>>>>>>>>
> >>>>>>>>> Thank you for reply.
> >>>>>>>>>
> >>>>>>>>> On our new system we have device XPDE12284C equipped.
> >>>>>>>>> I tested this device.
> >>>>>>>>>
> >>>>>>>> Sounds good, but did you also make sure that all chips have the
> >>>>>>>> same number of pages (phases), the same set of commands as the
> >>>>>>>> TI chip, and support the same bit settings in VOUT_MODE ? It
> >>>>>>>> seems a bit unlikely that TI's register definitions would make
> >>>>>>>> it into an Infineon
> >>>> chip.
> >>>>>>>>
> >>>>>>>> Also, what about the SN1906016 ? I don't find that anywhere,
> >>>>>>>> except in one place where it is listed as MCU from TI.
> >>>>>>>
> >>>>>>> I'll drop SN1906016.
> >>>>>>> Datasheet has a title Dual channel DCAP+ multiphase controllers:
> >>>>>>> TPS53688, SN1906016.
> >>>>>>> But maybe it's some custom device (anyway I'll try to check it with TI).
> >>>>>>>
> >>>>>>
> >>>>>> Or maybe SN1906016 means something else. Unless we have explicit
> >>>>>> confirmation that the chip exists (or will exist) we should not
> >>>>>> add it to the
> >>>> list.
> >>>>>>
> >>>>>>>>
> >>>>>>>>> Infineon datasheet refers all these device as XDPE122xxC
> >>>>>>>>> family and it doesn't specify any differences in register map
> >>>>>>>>> between these
> >>>> devices.
> >>>>>>>>
> >>>>>>>> That is a bit vague, especially when it includes devices which
> >>>>>>>> return zero results with Google searches.
> >>>>>>>>
> >>>>>>>> "A" vs. "C" may distinguish automotive vs. commercial; the "A"
> >>>>>>>> device is listed under automotive. If the command set is the
> >>>>>>>> same, I don't really want the "c" in the id.
> >>>>>>>
> >>>>>>> Got feedback from Infineon guys.
> >>>>>>> No need 'C' at the end, as you wrote.
> >>>>>>> All XDPE12250, XDPE12254, XDPE12283, XDPE12284, XDPE12286 are
> >>>>>>> treated in the same way:
> >>>>>>> same pages, same VOUT_MODE, VOUT_READ, etcetera.
> >>>>>>>
> >>>>>>
> >>>>>> And same as TI, including VOUT_MODE ? Also, did they confirm that
> >>>>>> the unpublished chips do or will actually exist ?
> >>>>>
> >>>>> Hi Gunther,
> >>>>>
> >>>>> According to the input I got from Infineon guys, these device are
> >>>>> already available for the customers, like XPDE12284, which is
> >>>>> equipped on new Mellanox 400Gx32 Ethernet system, on which we are
> >> working now.
> >>>>>
> >>>>> But I'll re-check if all these devices are available today to be
> >>>>> on the safe Side.
> >>>>>
> >>>>> Regarding VOUT modes:
> >>>>> TPS53679 uses modes - 0x01, 0x02, 0x04, 0x05, 0x07
> >>>>> TPS53688 uses modes - 0x04, 0x07
> >>>>> XDPE122xxx uses modes - 0x01, 0x02, 0x03 and additionally 0x10,
> >>>>> which is for 6.25mV VID table (AMD application).
> >>>>>
> >>>>
> >>>> The problem is that PMBus does not define VID mode values. If it
> >>>> did, we could add vrm version detection detection to the pmbus
> >>>> core. 0x01 for
> >>>> TPS53679 _may_ be the same as 0x01 for XDPE122xxx, or maybe not.
> >>>> There is no way to be sure without datasheets.
> >>>>
> >>>>> I didn't add support for mode 0x10 in the patch.
> >>>>>
> >>>>> The VID table for the AMD application is different from the Intel
> >>>>> VID tables.
> >>>>>
> >>>>> A value of 0x0 corresponds to the highest output voltage of 1.55V.
> >>>>> The voltage is reduced in 6.25mV steps down to the value 0xd8,
> >>>>> which corresponds to 0.2V.
> >>>>>
> >>>>> The formula for the calculation of the output voltage would be:
> >>>>>
> >>>>> 	case DON’T_NOW_HOW_TO_CALL_IT:
> >>>>
> >>>> Doesn't the datasheet have something to say ?
> >>>
> >>> It just specifies VID table format as
> >>> 0 = 10mV VID table
> >>> 1 = 5mv VID table
> >>> 2 = 6.25mv VID table
> >>> 3 = 10mV VID table (200mV offset)
> >>> calculation as:
> >>> Range: 0 = Off, 1 (250mV) to 255 (1520mV); vid_table=0 (10mV)
> >>> Range: 0 = Off, 1 (500mV) to 255 (3040mV); vid_table=1 (5mV)
> >>> Range: 0 = Off, 1 (200mV) to 255 (2740mV); vid_table=3 (10mV)
> >>> Range: 0 = (1550mV) to 247 (6.25mV); 248~255 = Off; vid_table=2
> >>> (6.25mV)
> >>>
> >>> And VOUT_MODE[4:0] as:
> >>> 00001 = 5mV VID table (VR12)
> >>> 00010 = 10mV VID table (VR12.5 or VR13)
> >>> 00011 = 10mV VID table (IMVP9)
> >>> 10000 = 6.25mV VID table (AMD application) others = illegal setting
> >>> - PMBus write is acked, but no write occurs
> >>>
> >>>>
> >>>>> 		if (val >= 0x00 && val <= 0xd8)
> >>>>>                 			rv = 1550 – (val *6.25);
> >>>>>
> >>>>> I doubled check it.
> >>>>>
> >>>>> Do you think it should added as well?
> >>>>>
> >>>> I am quite neutral on that. I am much more concerned with the
> >>>> assumption that the mode values have the same meaning for chips
> >>>> from different vendors. In this case, what do we do if TI starts
> >>>> shipping a chip in the TPS53xxx series which uses mode 0x10 for something
> else ?
> >>>>
> >>>> Overall I'd rather play safe and add a separate driver for the Infineon chips.
> >>>
> >>> I see.
> >>>
> >>> We actually waned to have ability of transparent replacement of TI
> >>> and Infineon devices within the same type of system.
> >>>
> >>
> >> That should not be a problem as long as you instantiate them differently.
> >> After all, the relevant information _should_ be available in ACPI tables.
> >> Otherwise you'd have to claim that a chip is, say, tps53688, while it
> >> is really an Infineon chip. And that is never a good idea.

Hi Guenter,

We are looking for possibility to provide some kind of flexible driver to handle
different devices from different vendors, but which have common nature,
like support of two pages for telemetry with same set of functions and same
formats. (Actually driver could be flexible regarding the number of pages).

While the difference only in VID codes mapping.

The motivation for that is to give free hand to HW design to choose which
particular device to use on the same system type.
There are two main reasons for such requirement:
- Quality of device (we already had a serios problems with ucd9224 and
  tps53679, caused system meltdown). In such case the intention is to move
  to fallback devices in the next batches.
- Device availability in stock. Sometimes vendors can't supply in time the
   necessary quantity.

Currently there are the devices from three vendor: TI tps536xx, Infineon
xdpe122 and MPS mp2975.
All have different mapping of VID codes.

It could be also few additional devices, which are supposed to be used as
fallback devices.

We have several very big customers ordering now huge quantity of our
systems, which are very conservative regarding image upgrade.
Means we can provide now support for tps536xx, xdpe122xx and mp2975
but in case new devices are coming soon, we will be able to support it in kernel
for their image after year or even more.

We can provide ACPI pmbus driver, which will read VID mapping from ACPI
DSDT table. This mapping table will contain the names of available modes
and specific vendor code for this mode. Like:
PMBVR11=1
PMBVR12=2
PMBVR13=5
PMBIMVP9=10
And driver will set info->vrm_version[i] according to this mapping.

What do you think about such approach?

Thanks,
Vadim.

> >>
> >>> Maybe it's possible to have 0x01, 0x02, 0x03, 0x04, 0x05, 0x07 as a
> >>> basic set and support for example 0x10 according to specific device id?
> >>>
> >>
> >> Unfortunately not, because there is no standard defining those. TI
> >> might at some point decide to sell a new chip where 0x03 means
> >> something completely different. On top of that, I already know that
> >> at least some of the TI chips of this series have more than two
> >> pages. Unfortunately, the information I have is vague (no datasheet
> >> again). That is another reason for avoiding pollution of the tps driver with
> non-TI chip support.
> >
> > OK.
> > So, I think to modify the patch as following:
> >
> > Add sperate driver  xdpe122xx with support this Infineon family (after
> > final checking with Infineon, which of the are available).
> > It will support 0x01, 0x02, 0x03, 0x10.
> >
> > Add tps53688 to tps53679 driver.
> >
> > Add two new vrf versions imvp9, amd625mv (I only don't know what is
> > the best naming for these new modes).
> >
> > And these new modes will be handled as:
> > 	case imvp9:
> > 		if (val >= 0x01)
> > 			rv = 200 + (val - 1) * 10;
> > 		break;
> > 	case amd625mv:
> > 		if (val >= 0x0 && val <= 0xd8)
> > 			rv = DIV_ROUND_CLOSEST(155000 - val * 625, 100);
> > 		break;
> >
> > What it be fine?
> >
> 
> Yes, sounds good.
> 
> Thanks,
> Guenter
> 
> > If yes, I'll make v1 patch version.
> >
> > Thanks,
> > Vadim.
> >
> >>
> >> Thanks,
> >> Guenter


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver
  2020-01-08 14:10                         ` Vadim Pasternak
@ 2020-01-08 16:47                           ` Guenter Roeck
  2020-01-13 12:25                             ` Vadim Pasternak
  0 siblings, 1 reply; 27+ messages in thread
From: Guenter Roeck @ 2020-01-08 16:47 UTC (permalink / raw)
  To: Vadim Pasternak
  Cc: robh+dt, vijaykhemka, linux-hwmon, devicetree, Michael Shych

On Wed, Jan 08, 2020 at 02:10:50PM +0000, Vadim Pasternak wrote:
> 
> Hi Guenter,
> 
> We are looking for possibility to provide some kind of flexible driver to handle
> different devices from different vendors, but which have common nature,
> like support of two pages for telemetry with same set of functions and same
> formats. (Actually driver could be flexible regarding the number of pages).
> 
> While the difference only in VID codes mapping.
> 
> The motivation for that is to give free hand to HW design to choose which
> particular device to use on the same system type.
> There are two main reasons for such requirement:
> - Quality of device (we already had a serios problems with ucd9224 and
>   tps53679, caused system meltdown). In such case the intention is to move
>   to fallback devices in the next batches.
> - Device availability in stock. Sometimes vendors can't supply in time the
>    necessary quantity.
> 
> Currently there are the devices from three vendor: TI tps536xx, Infineon
> xdpe122 and MPS mp2975.
> All have different mapping of VID codes.
> 
> It could be also few additional devices, which are supposed to be used as
> fallback devices.
> 
> We have several very big customers ordering now huge quantity of our
> systems, which are very conservative regarding image upgrade.
> Means we can provide now support for tps536xx, xdpe122xx and mp2975
> but in case new devices are coming soon, we will be able to support it in kernel
> for their image after year or even more.
> 
> We can provide ACPI pmbus driver, which will read VID mapping from ACPI
> DSDT table. This mapping table will contain the names of available modes
> and specific vendor code for this mode. Like:
> PMBVR11=1
> PMBVR12=2
> PMBVR13=5
> PMBIMVP9=10
> And driver will set info->vrm_version[i] according to this mapping.
> 

The DSDT would have to provide all properties, not just the VID modes.
At the very least that would have to be the number of pages, data formats,
vrm version, and the supported attributes per page. It should be possible
to also add m/b/R information for each of the sensor classes, but I guess
the actual implementation could be postponed until it is needed.

This could all be done through the existing generic driver (pmbus.c);
it would not really require a new driver. ACPI/DSDT could provide firmware
properties, and pmbus.c could read those using device_property API
functions (eg device_property_read_u32(dev, "vrm-mode")). Would that work
for you ?

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver
  2020-01-08 16:47                           ` Guenter Roeck
@ 2020-01-13 12:25                             ` Vadim Pasternak
  2020-01-13 20:56                               ` Guenter Roeck
  0 siblings, 1 reply; 27+ messages in thread
From: Vadim Pasternak @ 2020-01-13 12:25 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: robh+dt, vijaykhemka, linux-hwmon, devicetree, Michael Shych, Ofer Levy



> -----Original Message-----
> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> Sent: Wednesday, January 08, 2020 6:48 PM
> To: Vadim Pasternak <vadimp@mellanox.com>
> Cc: robh+dt@kernel.org; vijaykhemka@fb.com; linux-hwmon@vger.kernel.org;
> devicetree@vger.kernel.org; Michael Shych <michaelsh@mellanox.com>
> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend
> device list supported by driver
> 
> On Wed, Jan 08, 2020 at 02:10:50PM +0000, Vadim Pasternak wrote:
> >
> > Hi Guenter,
> >
> > We are looking for possibility to provide some kind of flexible driver
> > to handle different devices from different vendors, but which have
> > common nature, like support of two pages for telemetry with same set
> > of functions and same formats. (Actually driver could be flexible regarding the
> number of pages).
> >
> > While the difference only in VID codes mapping.
> >
> > The motivation for that is to give free hand to HW design to choose
> > which particular device to use on the same system type.
> > There are two main reasons for such requirement:
> > - Quality of device (we already had a serios problems with ucd9224 and
> >   tps53679, caused system meltdown). In such case the intention is to move
> >   to fallback devices in the next batches.
> > - Device availability in stock. Sometimes vendors can't supply in time the
> >    necessary quantity.
> >
> > Currently there are the devices from three vendor: TI tps536xx,
> > Infineon
> > xdpe122 and MPS mp2975.
> > All have different mapping of VID codes.
> >
> > It could be also few additional devices, which are supposed to be used
> > as fallback devices.
> >
> > We have several very big customers ordering now huge quantity of our
> > systems, which are very conservative regarding image upgrade.
> > Means we can provide now support for tps536xx, xdpe122xx and mp2975
> > but in case new devices are coming soon, we will be able to support it
> > in kernel for their image after year or even more.
> >
> > We can provide ACPI pmbus driver, which will read VID mapping from
> > ACPI DSDT table. This mapping table will contain the names of
> > available modes and specific vendor code for this mode. Like:
> > PMBVR11=1
> > PMBVR12=2
> > PMBVR13=5
> > PMBIMVP9=10
> > And driver will set info->vrm_version[i] according to this mapping.
> >
> 
> The DSDT would have to provide all properties, not just the VID modes.
> At the very least that would have to be the number of pages, data formats, vrm
> version, and the supported attributes per page. It should be possible to also add
> m/b/R information for each of the sensor classes, but I guess the actual
> implementation could be postponed until it is needed.
> 
> This could all be done through the existing generic driver (pmbus.c); it would not
> really require a new driver. ACPI/DSDT could provide firmware properties, and
> pmbus.c could read those using device_property API functions (eg
> device_property_read_u32(dev, "vrm-mode")). Would that work for you ?

Hi Guenter,

We thought that it's possible to provide just modified DSDT with the specific
configuration as an external table, which is loaded during system boot.

It should not be integrated into BIOS image.
We want to avoid releasing of new BIOS or new each time system configuration
is changed.
New BIOS is released only when new CPU type should be supported.
Also BIOS overwriting is not an option, sine we have to support secured BIOS.

It should not be located in initrd.
The new system batch is released with BIOS, SMBIOS and with customer's OS or
with install environment like ONIE.
Means no kernel changes.
Also not all our customers use initrd.
 
So, it seems there is no place, when we can locate modified DSDT and load
it dynamically.
But we should think more about possible methods for doing it.

Today all the static devices are instantiated  from the user space.
It's supposed to work for us while we have to support some pre-defined set of
devices, for which we can detect the specific configuration through DMI tables
(SKU in particular).
But it'll not work for some new coming devices.

We have a possibility to provide VID mapping info through CPLD device.
But in this case we'll have to implement Mellanox specific PMBus driver aware
of CPLD register map.
Not sure if such approach is accepted?

Thanks,
Vadim.

> 
> Thanks,
> Guenter

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver
  2020-01-13 12:25                             ` Vadim Pasternak
@ 2020-01-13 20:56                               ` Guenter Roeck
  2020-01-14  6:54                                 ` Vadim Pasternak
  0 siblings, 1 reply; 27+ messages in thread
From: Guenter Roeck @ 2020-01-13 20:56 UTC (permalink / raw)
  To: Vadim Pasternak
  Cc: robh+dt, vijaykhemka, linux-hwmon, devicetree, Michael Shych, Ofer Levy

Hi Vadim,

On Mon, Jan 13, 2020 at 12:25:44PM +0000, Vadim Pasternak wrote:
> 
> 
> > -----Original Message-----
> > From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> > Sent: Wednesday, January 08, 2020 6:48 PM
> > To: Vadim Pasternak <vadimp@mellanox.com>
> > Cc: robh+dt@kernel.org; vijaykhemka@fb.com; linux-hwmon@vger.kernel.org;
> > devicetree@vger.kernel.org; Michael Shych <michaelsh@mellanox.com>
> > Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend
> > device list supported by driver
> > 
> > On Wed, Jan 08, 2020 at 02:10:50PM +0000, Vadim Pasternak wrote:
> > >
> > > Hi Guenter,
> > >
> > > We are looking for possibility to provide some kind of flexible driver
> > > to handle different devices from different vendors, but which have
> > > common nature, like support of two pages for telemetry with same set
> > > of functions and same formats. (Actually driver could be flexible regarding the
> > number of pages).
> > >
> > > While the difference only in VID codes mapping.
> > >
> > > The motivation for that is to give free hand to HW design to choose
> > > which particular device to use on the same system type.
> > > There are two main reasons for such requirement:
> > > - Quality of device (we already had a serios problems with ucd9224 and
> > >   tps53679, caused system meltdown). In such case the intention is to move
> > >   to fallback devices in the next batches.
> > > - Device availability in stock. Sometimes vendors can't supply in time the
> > >    necessary quantity.
> > >
> > > Currently there are the devices from three vendor: TI tps536xx,
> > > Infineon
> > > xdpe122 and MPS mp2975.
> > > All have different mapping of VID codes.
> > >
> > > It could be also few additional devices, which are supposed to be used
> > > as fallback devices.
> > >
> > > We have several very big customers ordering now huge quantity of our
> > > systems, which are very conservative regarding image upgrade.
> > > Means we can provide now support for tps536xx, xdpe122xx and mp2975
> > > but in case new devices are coming soon, we will be able to support it
> > > in kernel for their image after year or even more.
> > >
> > > We can provide ACPI pmbus driver, which will read VID mapping from
> > > ACPI DSDT table. This mapping table will contain the names of
> > > available modes and specific vendor code for this mode. Like:
> > > PMBVR11=1
> > > PMBVR12=2
> > > PMBVR13=5
> > > PMBIMVP9=10
> > > And driver will set info->vrm_version[i] according to this mapping.
> > >
> > 
> > The DSDT would have to provide all properties, not just the VID modes.
> > At the very least that would have to be the number of pages, data formats, vrm
> > version, and the supported attributes per page. It should be possible to also add
> > m/b/R information for each of the sensor classes, but I guess the actual
> > implementation could be postponed until it is needed.
> > 
> > This could all be done through the existing generic driver (pmbus.c); it would not
> > really require a new driver. ACPI/DSDT could provide firmware properties, and
> > pmbus.c could read those using device_property API functions (eg
> > device_property_read_u32(dev, "vrm-mode")). Would that work for you ?
> 
> Hi Guenter,
> 
> We thought that it's possible to provide just modified DSDT with the specific
> configuration as an external table, which is loaded during system boot.
> 
> It should not be integrated into BIOS image.
> We want to avoid releasing of new BIOS or new each time system configuration
> is changed.
> New BIOS is released only when new CPU type should be supported.
> Also BIOS overwriting is not an option, sine we have to support secured BIOS.
> 
> It should not be located in initrd.
> The new system batch is released with BIOS, SMBIOS and with customer's OS or
> with install environment like ONIE.
> Means no kernel changes.
> Also not all our customers use initrd.
>  
> So, it seems there is no place, when we can locate modified DSDT and load
> it dynamically.
> But we should think more about possible methods for doing it.
> 
> Today all the static devices are instantiated  from the user space.
> It's supposed to work for us while we have to support some pre-defined set of
> devices, for which we can detect the specific configuration through DMI tables
> (SKU in particular).
> But it'll not work for some new coming devices.
> 
> We have a possibility to provide VID mapping info through CPLD device.
> But in this case we'll have to implement Mellanox specific PMBus driver aware
> of CPLD register map.
> Not sure if such approach is accepted?
> 

How about a platform driver which loads the parameters into device
properties from whatever location and instantiates the pmbus driver ?
The PMBus driver would then read the device attributes and instantiate
itself accordingly.

If the other PMBus attributes can be auto-detected, it might actually be
sufficient to have a per-page vrm-mode property and otherwise use the
auto-detect mechanism of pmbus.c.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver
  2020-01-13 20:56                               ` Guenter Roeck
@ 2020-01-14  6:54                                 ` Vadim Pasternak
  2020-01-14 14:19                                   ` Guenter Roeck
  0 siblings, 1 reply; 27+ messages in thread
From: Vadim Pasternak @ 2020-01-14  6:54 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: robh+dt, vijaykhemka, linux-hwmon, devicetree, Michael Shych, Ofer Levy



> -----Original Message-----
> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> Sent: Monday, January 13, 2020 10:56 PM
> To: Vadim Pasternak <vadimp@mellanox.com>
> Cc: robh+dt@kernel.org; vijaykhemka@fb.com; linux-hwmon@vger.kernel.org;
> devicetree@vger.kernel.org; Michael Shych <michaelsh@mellanox.com>; Ofer
> Levy <oferl@mellanox.com>
> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend
> device list supported by driver
> 
> Hi Vadim,
> 
> On Mon, Jan 13, 2020 at 12:25:44PM +0000, Vadim Pasternak wrote:
> >
> >
> > > -----Original Message-----
> > > From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> > > Sent: Wednesday, January 08, 2020 6:48 PM
> > > To: Vadim Pasternak <vadimp@mellanox.com>
> > > Cc: robh+dt@kernel.org; vijaykhemka@fb.com;
> > > linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org; Michael
> > > Shych <michaelsh@mellanox.com>
> > > Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679)
> > > Extend device list supported by driver
> > >
> > > On Wed, Jan 08, 2020 at 02:10:50PM +0000, Vadim Pasternak wrote:
> > > >
> > > > Hi Guenter,
> > > >
> > > > We are looking for possibility to provide some kind of flexible
> > > > driver to handle different devices from different vendors, but
> > > > which have common nature, like support of two pages for telemetry
> > > > with same set of functions and same formats. (Actually driver
> > > > could be flexible regarding the
> > > number of pages).
> > > >
> > > > While the difference only in VID codes mapping.
> > > >
> > > > The motivation for that is to give free hand to HW design to
> > > > choose which particular device to use on the same system type.
> > > > There are two main reasons for such requirement:
> > > > - Quality of device (we already had a serios problems with ucd9224 and
> > > >   tps53679, caused system meltdown). In such case the intention is to move
> > > >   to fallback devices in the next batches.
> > > > - Device availability in stock. Sometimes vendors can't supply in time the
> > > >    necessary quantity.
> > > >
> > > > Currently there are the devices from three vendor: TI tps536xx,
> > > > Infineon
> > > > xdpe122 and MPS mp2975.
> > > > All have different mapping of VID codes.
> > > >
> > > > It could be also few additional devices, which are supposed to be
> > > > used as fallback devices.
> > > >
> > > > We have several very big customers ordering now huge quantity of
> > > > our systems, which are very conservative regarding image upgrade.
> > > > Means we can provide now support for tps536xx, xdpe122xx and
> > > > mp2975 but in case new devices are coming soon, we will be able to
> > > > support it in kernel for their image after year or even more.
> > > >
> > > > We can provide ACPI pmbus driver, which will read VID mapping from
> > > > ACPI DSDT table. This mapping table will contain the names of
> > > > available modes and specific vendor code for this mode. Like:
> > > > PMBVR11=1
> > > > PMBVR12=2
> > > > PMBVR13=5
> > > > PMBIMVP9=10
> > > > And driver will set info->vrm_version[i] according to this mapping.
> > > >
> > >
> > > The DSDT would have to provide all properties, not just the VID modes.
> > > At the very least that would have to be the number of pages, data
> > > formats, vrm version, and the supported attributes per page. It
> > > should be possible to also add m/b/R information for each of the
> > > sensor classes, but I guess the actual implementation could be postponed
> until it is needed.
> > >
> > > This could all be done through the existing generic driver
> > > (pmbus.c); it would not really require a new driver. ACPI/DSDT could
> > > provide firmware properties, and pmbus.c could read those using
> > > device_property API functions (eg device_property_read_u32(dev, "vrm-
> mode")). Would that work for you ?
> >
> > Hi Guenter,
> >
> > We thought that it's possible to provide just modified DSDT with the
> > specific configuration as an external table, which is loaded during system boot.
> >
> > It should not be integrated into BIOS image.
> > We want to avoid releasing of new BIOS or new each time system
> > configuration is changed.
> > New BIOS is released only when new CPU type should be supported.
> > Also BIOS overwriting is not an option, sine we have to support secured BIOS.
> >
> > It should not be located in initrd.
> > The new system batch is released with BIOS, SMBIOS and with customer's
> > OS or with install environment like ONIE.
> > Means no kernel changes.
> > Also not all our customers use initrd.
> >
> > So, it seems there is no place, when we can locate modified DSDT and
> > load it dynamically.
> > But we should think more about possible methods for doing it.
> >
> > Today all the static devices are instantiated  from the user space.
> > It's supposed to work for us while we have to support some pre-defined
> > set of devices, for which we can detect the specific configuration
> > through DMI tables (SKU in particular).
> > But it'll not work for some new coming devices.
> >
> > We have a possibility to provide VID mapping info through CPLD device.
> > But in this case we'll have to implement Mellanox specific PMBus
> > driver aware of CPLD register map.
> > Not sure if such approach is accepted?
> >
> 
> How about a platform driver which loads the parameters into device properties
> from whatever location and instantiates the pmbus driver ?
> The PMBus driver would then read the device attributes and instantiate itself
> accordingly.
> 
> If the other PMBus attributes can be auto-detected, it might actually be
> sufficient to have a per-page vrm-mode property and otherwise use the auto-
> detect mechanism of pmbus.c.

Hi Guenter,

I didn't think about such possibility.
It sounds promising.

So, we can add our platform driver to "drivers/platform/mellanox",
which can:
- fetch "vrm" mapping per each relevant device.
- for each allocate device node, create properties table with vrm mode
 mapping like "vrm-mode-vr11", "vrm-mode-vr12", "vrm-mode-vr13",
 "vrm-mode-imvp9", "vrm-mode-amd625mv", coded accordingly to
 "enum vrm_version".
- attach this node to "i2c_board_info" and instantiate it with
  i2c_new_device() for "pmbus" type. 

And i"pmbus" will get these properties like
device_property_read_8(dev, "vrm-mode-vr11")) etcetera.

Did I get your suggestion correctly?

Thanks,
Vadim.

> 
> Thanks,
> Guenter

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver
  2020-01-14  6:54                                 ` Vadim Pasternak
@ 2020-01-14 14:19                                   ` Guenter Roeck
  2020-01-16 19:54                                     ` Vadim Pasternak
  0 siblings, 1 reply; 27+ messages in thread
From: Guenter Roeck @ 2020-01-14 14:19 UTC (permalink / raw)
  To: Vadim Pasternak
  Cc: robh+dt, vijaykhemka, linux-hwmon, devicetree, Michael Shych, Ofer Levy

On 1/13/20 10:54 PM, Vadim Pasternak wrote:
> 
> 
>> -----Original Message-----
>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
>> Sent: Monday, January 13, 2020 10:56 PM
>> To: Vadim Pasternak <vadimp@mellanox.com>
>> Cc: robh+dt@kernel.org; vijaykhemka@fb.com; linux-hwmon@vger.kernel.org;
>> devicetree@vger.kernel.org; Michael Shych <michaelsh@mellanox.com>; Ofer
>> Levy <oferl@mellanox.com>
>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend
>> device list supported by driver
>>
>> Hi Vadim,
>>
>> On Mon, Jan 13, 2020 at 12:25:44PM +0000, Vadim Pasternak wrote:
>>>
>>>
>>>> -----Original Message-----
>>>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
>>>> Sent: Wednesday, January 08, 2020 6:48 PM
>>>> To: Vadim Pasternak <vadimp@mellanox.com>
>>>> Cc: robh+dt@kernel.org; vijaykhemka@fb.com;
>>>> linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org; Michael
>>>> Shych <michaelsh@mellanox.com>
>>>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679)
>>>> Extend device list supported by driver
>>>>
>>>> On Wed, Jan 08, 2020 at 02:10:50PM +0000, Vadim Pasternak wrote:
>>>>>
>>>>> Hi Guenter,
>>>>>
>>>>> We are looking for possibility to provide some kind of flexible
>>>>> driver to handle different devices from different vendors, but
>>>>> which have common nature, like support of two pages for telemetry
>>>>> with same set of functions and same formats. (Actually driver
>>>>> could be flexible regarding the
>>>> number of pages).
>>>>>
>>>>> While the difference only in VID codes mapping.
>>>>>
>>>>> The motivation for that is to give free hand to HW design to
>>>>> choose which particular device to use on the same system type.
>>>>> There are two main reasons for such requirement:
>>>>> - Quality of device (we already had a serios problems with ucd9224 and
>>>>>    tps53679, caused system meltdown). In such case the intention is to move
>>>>>    to fallback devices in the next batches.
>>>>> - Device availability in stock. Sometimes vendors can't supply in time the
>>>>>     necessary quantity.
>>>>>
>>>>> Currently there are the devices from three vendor: TI tps536xx,
>>>>> Infineon
>>>>> xdpe122 and MPS mp2975.
>>>>> All have different mapping of VID codes.
>>>>>
>>>>> It could be also few additional devices, which are supposed to be
>>>>> used as fallback devices.
>>>>>
>>>>> We have several very big customers ordering now huge quantity of
>>>>> our systems, which are very conservative regarding image upgrade.
>>>>> Means we can provide now support for tps536xx, xdpe122xx and
>>>>> mp2975 but in case new devices are coming soon, we will be able to
>>>>> support it in kernel for their image after year or even more.
>>>>>
>>>>> We can provide ACPI pmbus driver, which will read VID mapping from
>>>>> ACPI DSDT table. This mapping table will contain the names of
>>>>> available modes and specific vendor code for this mode. Like:
>>>>> PMBVR11=1
>>>>> PMBVR12=2
>>>>> PMBVR13=5
>>>>> PMBIMVP9=10
>>>>> And driver will set info->vrm_version[i] according to this mapping.
>>>>>
>>>>
>>>> The DSDT would have to provide all properties, not just the VID modes.
>>>> At the very least that would have to be the number of pages, data
>>>> formats, vrm version, and the supported attributes per page. It
>>>> should be possible to also add m/b/R information for each of the
>>>> sensor classes, but I guess the actual implementation could be postponed
>> until it is needed.
>>>>
>>>> This could all be done through the existing generic driver
>>>> (pmbus.c); it would not really require a new driver. ACPI/DSDT could
>>>> provide firmware properties, and pmbus.c could read those using
>>>> device_property API functions (eg device_property_read_u32(dev, "vrm-
>> mode")). Would that work for you ?
>>>
>>> Hi Guenter,
>>>
>>> We thought that it's possible to provide just modified DSDT with the
>>> specific configuration as an external table, which is loaded during system boot.
>>>
>>> It should not be integrated into BIOS image.
>>> We want to avoid releasing of new BIOS or new each time system
>>> configuration is changed.
>>> New BIOS is released only when new CPU type should be supported.
>>> Also BIOS overwriting is not an option, sine we have to support secured BIOS.
>>>
>>> It should not be located in initrd.
>>> The new system batch is released with BIOS, SMBIOS and with customer's
>>> OS or with install environment like ONIE.
>>> Means no kernel changes.
>>> Also not all our customers use initrd.
>>>
>>> So, it seems there is no place, when we can locate modified DSDT and
>>> load it dynamically.
>>> But we should think more about possible methods for doing it.
>>>
>>> Today all the static devices are instantiated  from the user space.
>>> It's supposed to work for us while we have to support some pre-defined
>>> set of devices, for which we can detect the specific configuration
>>> through DMI tables (SKU in particular).
>>> But it'll not work for some new coming devices.
>>>
>>> We have a possibility to provide VID mapping info through CPLD device.
>>> But in this case we'll have to implement Mellanox specific PMBus
>>> driver aware of CPLD register map.
>>> Not sure if such approach is accepted?
>>>
>>
>> How about a platform driver which loads the parameters into device properties
>> from whatever location and instantiates the pmbus driver ?
>> The PMBus driver would then read the device attributes and instantiate itself
>> accordingly.
>>
>> If the other PMBus attributes can be auto-detected, it might actually be
>> sufficient to have a per-page vrm-mode property and otherwise use the auto-
>> detect mechanism of pmbus.c.
> 
> Hi Guenter,
> 
> I didn't think about such possibility.
> It sounds promising.
> 
> So, we can add our platform driver to "drivers/platform/mellanox",
> which can:
> - fetch "vrm" mapping per each relevant device.
> - for each allocate device node, create properties table with vrm mode
>   mapping like "vrm-mode-vr11", "vrm-mode-vr12", "vrm-mode-vr13",
>   "vrm-mode-imvp9", "vrm-mode-amd625mv", coded accordingly to
>   "enum vrm_version".
> - attach this node to "i2c_board_info" and instantiate it with
>    i2c_new_device() for "pmbus" type.
> 
> And i"pmbus" will get these properties like
> device_property_read_8(dev, "vrm-mode-vr11")) etcetera.
> 
> Did I get your suggestion correctly?
> 

Correct. We'll need a bindings document, though, to make it official.

The binding would look something like "vrm-mode = <number>", where
<number> is well defined (possibly in an include file). There are many
bindings include files which you can use as examples.
We'll need to get DT maintainer approval for the exact binding name;
maybe it has to be "pmbus,vrm-mode" or something like that.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver
  2020-01-14 14:19                                   ` Guenter Roeck
@ 2020-01-16 19:54                                     ` Vadim Pasternak
  0 siblings, 0 replies; 27+ messages in thread
From: Vadim Pasternak @ 2020-01-16 19:54 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: robh+dt, vijaykhemka, linux-hwmon, devicetree, Michael Shych, Ofer Levy



> -----Original Message-----
> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> Sent: Tuesday, January 14, 2020 4:19 PM
> To: Vadim Pasternak <vadimp@mellanox.com>
> Cc: robh+dt@kernel.org; vijaykhemka@fb.com; linux-hwmon@vger.kernel.org;
> devicetree@vger.kernel.org; Michael Shych <michaelsh@mellanox.com>; Ofer
> Levy <oferl@mellanox.com>
> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend
> device list supported by driver
> 
> On 1/13/20 10:54 PM, Vadim Pasternak wrote:
> >
> >
> >> -----Original Message-----
> >> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> >> Sent: Monday, January 13, 2020 10:56 PM
> >> To: Vadim Pasternak <vadimp@mellanox.com>
> >> Cc: robh+dt@kernel.org; vijaykhemka@fb.com;
> >> linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org; Michael
> >> Shych <michaelsh@mellanox.com>; Ofer Levy <oferl@mellanox.com>
> >> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679)
> >> Extend device list supported by driver
> >>
> >> Hi Vadim,
> >>
> >> On Mon, Jan 13, 2020 at 12:25:44PM +0000, Vadim Pasternak wrote:
> >>>
> >>>
> >>>> -----Original Message-----
> >>>> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> >>>> Sent: Wednesday, January 08, 2020 6:48 PM
> >>>> To: Vadim Pasternak <vadimp@mellanox.com>
> >>>> Cc: robh+dt@kernel.org; vijaykhemka@fb.com;
> >>>> linux-hwmon@vger.kernel.org; devicetree@vger.kernel.org; Michael
> >>>> Shych <michaelsh@mellanox.com>
> >>>> Subject: Re: [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679)
> >>>> Extend device list supported by driver
> >>>>
> >>>> On Wed, Jan 08, 2020 at 02:10:50PM +0000, Vadim Pasternak wrote:
> >>>>>
> >>>>> Hi Guenter,
> >>>>>
> >>>>> We are looking for possibility to provide some kind of flexible
> >>>>> driver to handle different devices from different vendors, but
> >>>>> which have common nature, like support of two pages for telemetry
> >>>>> with same set of functions and same formats. (Actually driver
> >>>>> could be flexible regarding the
> >>>> number of pages).
> >>>>>
> >>>>> While the difference only in VID codes mapping.
> >>>>>
> >>>>> The motivation for that is to give free hand to HW design to
> >>>>> choose which particular device to use on the same system type.
> >>>>> There are two main reasons for such requirement:
> >>>>> - Quality of device (we already had a serios problems with ucd9224 and
> >>>>>    tps53679, caused system meltdown). In such case the intention is to
> move
> >>>>>    to fallback devices in the next batches.
> >>>>> - Device availability in stock. Sometimes vendors can't supply in time the
> >>>>>     necessary quantity.
> >>>>>
> >>>>> Currently there are the devices from three vendor: TI tps536xx,
> >>>>> Infineon
> >>>>> xdpe122 and MPS mp2975.
> >>>>> All have different mapping of VID codes.
> >>>>>
> >>>>> It could be also few additional devices, which are supposed to be
> >>>>> used as fallback devices.
> >>>>>
> >>>>> We have several very big customers ordering now huge quantity of
> >>>>> our systems, which are very conservative regarding image upgrade.
> >>>>> Means we can provide now support for tps536xx, xdpe122xx and
> >>>>> mp2975 but in case new devices are coming soon, we will be able to
> >>>>> support it in kernel for their image after year or even more.
> >>>>>
> >>>>> We can provide ACPI pmbus driver, which will read VID mapping from
> >>>>> ACPI DSDT table. This mapping table will contain the names of
> >>>>> available modes and specific vendor code for this mode. Like:
> >>>>> PMBVR11=1
> >>>>> PMBVR12=2
> >>>>> PMBVR13=5
> >>>>> PMBIMVP9=10
> >>>>> And driver will set info->vrm_version[i] according to this mapping.
> >>>>>
> >>>>
> >>>> The DSDT would have to provide all properties, not just the VID modes.
> >>>> At the very least that would have to be the number of pages, data
> >>>> formats, vrm version, and the supported attributes per page. It
> >>>> should be possible to also add m/b/R information for each of the
> >>>> sensor classes, but I guess the actual implementation could be
> >>>> postponed
> >> until it is needed.
> >>>>
> >>>> This could all be done through the existing generic driver
> >>>> (pmbus.c); it would not really require a new driver. ACPI/DSDT
> >>>> could provide firmware properties, and pmbus.c could read those
> >>>> using device_property API functions (eg
> >>>> device_property_read_u32(dev, "vrm-
> >> mode")). Would that work for you ?
> >>>
> >>> Hi Guenter,
> >>>
> >>> We thought that it's possible to provide just modified DSDT with the
> >>> specific configuration as an external table, which is loaded during system
> boot.
> >>>
> >>> It should not be integrated into BIOS image.
> >>> We want to avoid releasing of new BIOS or new each time system
> >>> configuration is changed.
> >>> New BIOS is released only when new CPU type should be supported.
> >>> Also BIOS overwriting is not an option, sine we have to support secured
> BIOS.
> >>>
> >>> It should not be located in initrd.
> >>> The new system batch is released with BIOS, SMBIOS and with
> >>> customer's OS or with install environment like ONIE.
> >>> Means no kernel changes.
> >>> Also not all our customers use initrd.
> >>>
> >>> So, it seems there is no place, when we can locate modified DSDT and
> >>> load it dynamically.
> >>> But we should think more about possible methods for doing it.
> >>>
> >>> Today all the static devices are instantiated  from the user space.
> >>> It's supposed to work for us while we have to support some
> >>> pre-defined set of devices, for which we can detect the specific
> >>> configuration through DMI tables (SKU in particular).
> >>> But it'll not work for some new coming devices.
> >>>
> >>> We have a possibility to provide VID mapping info through CPLD device.
> >>> But in this case we'll have to implement Mellanox specific PMBus
> >>> driver aware of CPLD register map.
> >>> Not sure if such approach is accepted?
> >>>
> >>
> >> How about a platform driver which loads the parameters into device
> >> properties from whatever location and instantiates the pmbus driver ?
> >> The PMBus driver would then read the device attributes and
> >> instantiate itself accordingly.
> >>
> >> If the other PMBus attributes can be auto-detected, it might actually
> >> be sufficient to have a per-page vrm-mode property and otherwise use
> >> the auto- detect mechanism of pmbus.c.
> >
> > Hi Guenter,
> >
> > I didn't think about such possibility.
> > It sounds promising.
> >
> > So, we can add our platform driver to "drivers/platform/mellanox",
> > which can:
> > - fetch "vrm" mapping per each relevant device.
> > - for each allocate device node, create properties table with vrm mode
> >   mapping like "vrm-mode-vr11", "vrm-mode-vr12", "vrm-mode-vr13",
> >   "vrm-mode-imvp9", "vrm-mode-amd625mv", coded accordingly to
> >   "enum vrm_version".
> > - attach this node to "i2c_board_info" and instantiate it with
> >    i2c_new_device() for "pmbus" type.
> >
> > And i"pmbus" will get these properties like
> > device_property_read_8(dev, "vrm-mode-vr11")) etcetera.
> >
> > Did I get your suggestion correctly?
> >
> 
> Correct. We'll need a bindings document, though, to make it official.
> 
> The binding would look something like "vrm-mode = <number>", where
> <number> is well defined (possibly in an include file). There are many bindings
> include files which you can use as examples.
> We'll need to get DT maintainer approval for the exact binding name; maybe it
> has to be "pmbus,vrm-mode" or something like that.

Great.
I suppose we'll try to make it for v5.7.

Thank you very much for all your inputs.
 
Thanks,
Vadim.

> 
> Thanks,
> Guenter

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, back to index

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-05 10:58 [RFC PATCH hwmon-next v1 0/5] hwmon: (pmbus) Add support for vid mode calculation per page bases Vadim Pasternak
2020-01-05 10:58 ` [RFC PATCH hwmon-next v1 1/5] hwmon: (pmbus/core) Add support for vid mode detection " Vadim Pasternak
2020-01-05 10:58 ` [RFC PATCH hwmon-next v1 2/5] hwmon: (pmbus/core) Add support for Intel IMVP9 specification Vadim Pasternak
2020-01-05 16:26   ` Guenter Roeck
2020-01-05 17:15     ` Vadim Pasternak
2020-01-06 12:14     ` Vadim Pasternak
2020-01-05 10:58 ` [RFC PATCH hwmon-next v1 3/5] hwmon: (pmbus/tps53679) Allow " Vadim Pasternak
2020-01-05 10:58 ` [RFC PATCH hwmon-next v1 4/5] dt-bindings: Add TI and Infineon VR Controllers as trivial devices Vadim Pasternak
2020-01-05 10:58 ` [RFC PATCH hwmon-next v1 5/5] hwmon: (pmbus/tps53679) Extend device list supported by driver Vadim Pasternak
2020-01-05 16:03   ` Guenter Roeck
2020-01-05 16:44     ` Vadim Pasternak
2020-01-05 18:34       ` Guenter Roeck
2020-01-06 12:16         ` Vadim Pasternak
2020-01-06 14:52           ` Guenter Roeck
2020-01-06 16:57             ` Vadim Pasternak
2020-01-06 21:01               ` Guenter Roeck
2020-01-06 22:29                 ` Vadim Pasternak
2020-01-07  1:28                   ` Guenter Roeck
2020-01-07  6:06                     ` Vadim Pasternak
2020-01-07 12:14                       ` Guenter Roeck
2020-01-08 14:10                         ` Vadim Pasternak
2020-01-08 16:47                           ` Guenter Roeck
2020-01-13 12:25                             ` Vadim Pasternak
2020-01-13 20:56                               ` Guenter Roeck
2020-01-14  6:54                                 ` Vadim Pasternak
2020-01-14 14:19                                   ` Guenter Roeck
2020-01-16 19:54                                     ` Vadim Pasternak

Linux-Hwmon Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-hwmon/0 linux-hwmon/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-hwmon linux-hwmon/ https://lore.kernel.org/linux-hwmon \
		linux-hwmon@vger.kernel.org
	public-inbox-index linux-hwmon

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-hwmon


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git