Skip to contentSkip to conversation

misc: Add AVS class 0 support for AM6

PATCH Superseded Keerthy 3 participants 39 messages Oct 24, 2019 – Nov 8, 2019

Subsystems (4)
lore
Share & tools
lore

Keerthy

author
#0 lore raw

v3 cover misc: Add AVS class 0 support for AM6

Adaptive Voltage Scaling is a technology used in TI SoCs to optimize the operating voltage based on characterization data written to efuse during production.

Add support for Adaptive Voltage scaling class 0 support for AM6 family of devices. Adaptive voltage scaling class 0 implies that optimized voltage values for a particular OPP of a particular voltage domain are read from Efuse and programmed on the pmic/regulator.

Tested on AM654-EVM for MPU @800 MHz.
Tested on J721e-evm for MPU.

The series is based on top of the branch:

https://github.com/lokeshvutla/u-boot/tree/devel/j721e-full-boot

Changes in v3:

* Extended the support for j721e-evm.
* Moved vtm node under r5-board dts.

Changes in v2:

* Avoided creation of new uclass. AVS driver is now under misc.

Keerthy (11):
clk: clk-ti-sci: Notify AVS driver upon setting clock rate
misc: k3_avs: Add j721e support
power: pmic: tps65941: Add support for tps65941 family of PMICs
power: regulator: tps65941: add regulator support
arm: mach-k3: am6_init: Initialize AVS class 0
arm: mach-k3: j721e_init: Initialize avs class 0
arm: dts: k3-am654-r5-base-board: Add VTM node
arm: dts: k3-j721e-r5-common-proc-board: Add VTM node
arm: dts: k3-j721e-r5-common: Add tps65941 node and dependent
wkup_i2c0 node
arm: dts: k3-j721e-r5-common-proc-board: Hook buck12_reg to vtm supply
configs: j721e_evm_r5_defconfig: Enable AVS Class 0 & dependent
configs

Tero Kristo (7):
misc: k3_avs: add driver for K3 Adaptive Voltage Scaling Class 0
power: regulator: tps6236x: add support for tps6236x regulators
arm: dts: k3-am654-r5-base-board: enable wkup_i2c0 driver for spl
arm: dts: k3-am654-r5-base-board: add supply rail for MPU
arm: dts: k3-am654-r5-base-board: enable wkup_vtm0 node and link in
supplies
configs: am65x_evm_r5_defconfig: Enable TPS62363 regulator support
configs: am65x_evm_r5_defconfig: Enable AVS class 0 support

 arch/arm/dts/k3-am654-r5-base-board.dts       |  27 ++
 arch/arm/dts/k3-j721e-mcu-wakeup.dtsi         |  11 +
 .../arm/dts/k3-j721e-r5-common-proc-board.dts |  44 ++
 arch/arm/mach-k3/am6_init.c                   |   7 +
 arch/arm/mach-k3/j721e_init.c                 |   7 +
 configs/am65x_evm_r5_defconfig                |   2 +
 configs/j721e_evm_r5_defconfig                |   9 +
 drivers/clk/clk-ti-sci.c                      |   5 +
 drivers/misc/Kconfig                          |   9 +
 drivers/misc/Makefile                         |   1 +
 drivers/misc/k3_avs.c                         | 388 +++++++++++++++++
 drivers/power/pmic/Kconfig                    |   7 +
 drivers/power/pmic/Makefile                   |   1 +
 drivers/power/pmic/tps65941.c                 |  83 ++++
 drivers/power/regulator/Kconfig               |  20 +
 drivers/power/regulator/Makefile              |   2 +
 drivers/power/regulator/tps62360_regulator.c  | 123 ++++++
 drivers/power/regulator/tps65941_regulator.c  | 407 ++++++++++++++++++
 include/k3-avs.h                              |  30 ++
 include/power/tps65941.h                      |  26 ++
 20 files changed, 1209 insertions(+)
 create mode 100644 drivers/misc/k3_avs.c
 create mode 100644 drivers/power/pmic/tps65941.c
 create mode 100644 drivers/power/regulator/tps62360_regulator.c
 create mode 100644 drivers/power/regulator/tps65941_regulator.c
 create mode 100644 include/k3-avs.h
 create mode 100644 include/power/tps65941.h
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH v3 1/18 misc: k3_avs: add driver for K3 Adaptive Voltage Scaling Class 0

From: Tero Kristo <[email protected]>

Adaptive Voltage Scaling is a technology used in TI SoCs to optimize the operating voltage based on characterization data written to efuse during production. Add a driver to support this feature for K3 line of SoCs, initially for AM65x.

---

Changes in v3:

* No change

Changes in v2:

* Moved under drivers/misc.

 drivers/misc/Kconfig  |   9 ++
 drivers/misc/Makefile |   1 +
 drivers/misc/k3_avs.c | 366 ++++++++++++++++++++++++++++++++++++++++++
 include/k3-avs.h      |  28 ++++
 4 files changed, 404 insertions(+)
 create mode 100644 drivers/misc/k3_avs.c
 create mode 100644 include/k3-avs.h
drivers/misc/Kconfig +9 -0
index ba50893b43..f6147238a4 100644
@@ -412,4 +412,13 @@ config IHS_FPGA
 	  by the devices. This driver supports both CON and CPU variants of the
 	  devices, depending on the device tree entry.
 
+config K3_AVS0
+	depends on ARCH_K3 && SPL_DM_REGULATOR
+	bool "AVS class 0 support for K3 devices"
+	help
+	  K3 devices have the optimized voltage values for the main voltage
+	  domains stored in efuse within the VTM IP. This driver reads the
+	  optimized voltage from the efuse, so that it can be programmed
+	  to the PMIC on board.
+
 endmenu
drivers/misc/Makefile +1 -0
index 0001d105ba..74d01ef392 100644
@@ -65,3 +65,4 @@ obj-$(CONFIG_TWL4030_LED) += twl4030_led.o
 obj-$(CONFIG_VEXPRESS_CONFIG) += vexpress_config.o
 obj-$(CONFIG_WINBOND_W83627) += winbond_w83627.o
 obj-$(CONFIG_JZ4780_EFUSE) += jz4780_efuse.o
+obj-$(CONFIG_K3_AVS0) += k3_avs.o
drivers/misc/k3_avs.c new file +366 -0

366 lines not on this page · raw message

include/k3-avs.h new file +28 -0
new file mode 100644
index 0000000000..9867481617
@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Texas Instruments' K3 Adaptive Voltage Scaling driver
+ *
+ * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/
+ *      Tero Kristo <[email protected]>
+ *
+ */
+
+#ifndef _K3_AVS0_
+#define _K3_AVS0_
+
+#define AM6_VDD_WKUP		0
+#define AM6_VDD_MCU		1
+#define AM6_VDD_CORE		2
+#define AM6_VDD_MPU0		3
+#define AM6_VDD_MPU1		4
+
+#define NUM_OPPS		4
+
+#define AM6_OPP_NOM		1
+#define AM6_OPP_OD		2
+#define AM6_OPP_TURBO		3
+
+int k3_avs_set_opp(struct udevice *dev, int vdd_id, int opp_id);
+int k3_avs_notify_freq(int dev_id, int clk_id, u32 freq);
+
+#endif
Signature · 1 line
2.17.1
#2 lore raw

PATCH v3 1/18 misc: k3_avs: add driver for K3 Adaptive Voltage Scaling Class 0

Quoted 9 lines · Keerthy

From: Tero Kristo <[email protected]>

Adaptive Voltage Scaling is a technology used in TI SoCs to optimize the operating voltage based on characterization data written to efuse during production. Add a driver to support this feature for K3 line of SoCs, initially for AM65x.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/47239eab/attachment.sig>
author
#3 lore raw

PATCH v3 2/18 clk: clk-ti-sci: Notify AVS driver upon setting clock rate

In reply to Keerthy

Notify AVS driver upon setting clock rate so that voltage is changed accordingly.

---
Changes in v3:

* No change

Changes in v2:

* No change

 drivers/clk/clk-ti-sci.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/clk/clk-ti-sci.c +5 -0
index c25415d410..478349f22f 100644
@@ -13,6 +13,7 @@
 #include <errno.h>
 #include <clk-uclass.h>
 #include <linux/soc/ti/ti_sci_protocol.h>
+#include <k3-avs.h>
 
 /**
  * struct ti_sci_clk_data - clock controller information structure
@@ -101,6 +102,10 @@ static ulong ti_sci_clk_set_rate(struct clk *clk, ulong rate)
 
 	debug("%s(clk=%p, rate=%lu)\n", __func__, clk, rate);
 
+#ifdef CONFIG_K3_AVS0
+	k3_avs_notify_freq(clk->id, clk->data, rate);
+#endif
+
 	/* Ask for exact frequency by using same value for min/target/max */
 	ret = cops->set_freq(sci, clk->id, clk->data, rate, rate, rate);
 	if (ret)
Signature · 1 line
2.17.1
#4 lore raw

PATCH v3 2/18 clk: clk-ti-sci: Notify AVS driver upon setting clock rate

Quoted 4 lines · Keerthy

Notify AVS driver upon setting clock rate so that voltage is changed accordingly.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/eb7906b9/attachment.sig>
author
#5 lore raw

PATCH v3 3/18 power: regulator: tps6236x: add support for tps6236x regulators

In reply to Keerthy

From: Tero Kristo <[email protected]>

TPS6236x is a family of step down DC-DC converters optimized for battery powered portable applications for a small solution size. Add a regulator driver for supporting these devices.

---

Changes in v3:

* No change

Changes in v2:

* No change

 drivers/power/regulator/Kconfig              |  10 ++
 drivers/power/regulator/Makefile             |   1 +
 drivers/power/regulator/tps62360_regulator.c | 123 +++++++++++++++++++
 3 files changed, 134 insertions(+)
 create mode 100644 drivers/power/regulator/tps62360_regulator.c
drivers/power/regulator/Kconfig +10 -0
index 9aa00fad42..56d68ee40e 100644
@@ -273,6 +273,16 @@ config DM_REGULATOR_TPS65910
 	regulator types of the TPS65910 (BUCK, BOOST and LDO). It implements
 	the get/set api for value and enable.
 
+config DM_REGULATOR_TPS62360
+	bool "Enable driver for TPS6236x Power Regulator"
+	depends on DM_REGULATOR
+	help
+	The TPS6236X DC/DC step down converter provides a single output
+	power line peaking at 3A current. This driver supports all four
+	variants of the chip (TPS62360, TPS62361, TPS62362, TPS62363). It
+	implements the get/set api for value only, as the power line is
+	always on.
+
 config DM_REGULATOR_STPMIC1
 	bool "Enable driver for STPMIC1 regulators"
 	depends on DM_REGULATOR && PMIC_STPMIC1
drivers/power/regulator/Makefile +1 -0
index 6a3d4bbee4..9198841b4f 100644
@@ -26,4 +26,5 @@ obj-$(CONFIG_$(SPL_)DM_REGULATOR_LP873X) += lp873x_regulator.o
 obj-$(CONFIG_$(SPL_)DM_REGULATOR_LP87565) += lp87565_regulator.o
 obj-$(CONFIG_$(SPL_)DM_REGULATOR_STM32_VREFBUF) += stm32-vrefbuf.o
 obj-$(CONFIG_DM_REGULATOR_TPS65910) += tps65910_regulator.o
+obj-$(CONFIG_DM_REGULATOR_TPS62360) += tps62360_regulator.o
 obj-$(CONFIG_$(SPL_)DM_REGULATOR_STPMIC1) += stpmic1.o
drivers/power/regulator/tps62360_regulator.c new file +123 -0

123 lines not on this page · raw message

Signature · 1 line
2.17.1
#6 lore raw

PATCH v3 3/18 power: regulator: tps6236x: add support for tps6236x regulators

Quoted 8 lines · Keerthy

From: Tero Kristo <[email protected]>

TPS6236x is a family of step down DC-DC converters optimized for battery powered portable applications for a small solution size. Add a regulator driver for supporting these devices.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/4bef4f6e/attachment.sig>
author
#7 lore raw

PATCH v3 4/18 misc: k3_avs: Add j721e support

In reply to Keerthy

j721e SoCs have different OPP tables. Add support for the same.

Note: DM Still has lot of voltages TBD hence the correct values need to be programmed once they are published.

---
Changes in v3:

* No change

Changes in v2:

* No change

 drivers/misc/k3_avs.c | 22 ++++++++++++++++++++++
 include/k3-avs.h      |  2 ++
 2 files changed, 24 insertions(+)
drivers/misc/k3_avs.c +22 -0
index dd7fc3d585..c19c3c0646 100644
@@ -347,6 +347,27 @@ static struct vd_data am654_vd_data[] = {
 	{ .id = -1 },
 };
 
+static struct vd_data j721e_vd_data[] = {
+	{
+		.id = J721E_VDD_MPU,
+		.opp = AM6_OPP_NOM,
+		.dev_id = 202, /* J721E_DEV_A72SS0_CORE0 */
+		.clk_id = 2, /* ARM clock */
+		.opps = {
+			[AM6_OPP_NOM] = {
+				.volt = 880000, /* TBD in DM */
+				.freq = 2000000000,
+			},
+		},
+	},
+	{ .id = -1 },
+};
+
+static struct vd_config j721e_vd_config = {
+	.efuse_xlate = am6_efuse_xlate,
+	.vds = j721e_vd_data,
+};
+
 static struct vd_config am654_vd_config = {
 	.efuse_xlate = am6_efuse_xlate,
 	.vds = am654_vd_data,
@@ -354,6 +375,7 @@ static struct vd_config am654_vd_config = {
 
 static const struct udevice_id k3_avs_ids[] = {
 	{ .compatible = "ti,am654-avs", .data = (ulong)&am654_vd_config },
+	{ .compatible = "ti,j721e-avs", .data = (ulong)&j721e_vd_config },
 	{}
 };
 
include/k3-avs.h +2 -0
index 9867481617..e3c3cafbb9 100644
@@ -16,6 +16,8 @@
 #define AM6_VDD_MPU0		3
 #define AM6_VDD_MPU1		4
 
+#define J721E_VDD_MPU		2
+
 #define NUM_OPPS		4
 
 #define AM6_OPP_NOM		1
Signature · 1 line
2.17.1
#8 lore raw

PATCH v3 4/18 misc: k3_avs: Add j721e support

Quoted 6 lines · Keerthy

j721e SoCs have different OPP tables. Add support for the same.

Note: DM Still has lot of voltages TBD hence the correct values need to be programmed once they are published.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/a38698fa/attachment.sig>
author
#9 lore raw

PATCH v3 5/18 power: pmic: tps65941: Add support for tps65941 family of PMICs

In reply to Keerthy

Add support to bind the regulators/child nodes with the pmic.

---
Changes in v3:

* No change

Changes in v2:

* No change

 drivers/power/pmic/Kconfig    |  7 +++
 drivers/power/pmic/Makefile   |  1 +
 drivers/power/pmic/tps65941.c | 83 +++++++++++++++++++++++++++++++++++
 include/power/tps65941.h      | 26 +++++++++++
 4 files changed, 117 insertions(+)
 create mode 100644 drivers/power/pmic/tps65941.c
 create mode 100644 include/power/tps65941.h
drivers/power/pmic/Kconfig +7 -0
index 586772fdec..9d3667a867 100644
@@ -267,3 +267,10 @@ config SPL_PMIC_LP87565
 	help
 	The LP87565 is a PMIC containing a bunch of SMPS.
 	This driver binds the pmic children in SPL.
+
+config PMIC_TPS65941
+	bool "Enable driver for Texas Instruments TPS65941 PMIC"
+	depends on DM_PMIC
+	help
+	The TPS65941 is a PMIC containing a bunch of SMPS & LDOs.
+	This driver binds the pmic children.
drivers/power/pmic/Makefile +1 -0
index 888dbb2857..ec64327805 100644
@@ -39,3 +39,4 @@ obj-$(CONFIG_POWER_TPS65218) += pmic_tps65218.o
 obj-$(CONFIG_POWER_TPS65910) += pmic_tps65910.o
 obj-$(CONFIG_POWER_HI6553) += pmic_hi6553.o
 obj-$(CONFIG_POWER_MC34VR500) += pmic_mc34vr500.o
+obj-$(CONFIG_PMIC_TPS65941) += tps65941.o
drivers/power/pmic/tps65941.c new file +83 -0

83 lines not on this page · raw message

include/power/tps65941.h new file +26 -0
new file mode 100644
index 0000000000..2d48b31ae3
@@ -0,0 +1,26 @@
+#define	TPS659411		0x0
+#define TPS659412		0x1
+#define TPS659413		0x2
+#define TPS659414		0x3
+
+/* I2C device address for pmic tps65941 */
+#define TPS65941_I2C_ADDR	(0x12 >> 1)
+#define TPS65941_LDO_NUM		4
+#define TPS65941_BUCK_NUM		5
+
+/* Drivers name */
+#define TPS65941_LDO_DRIVER		"tps65941_ldo"
+#define TPS65941_BUCK_DRIVER		"tps65941_buck"
+
+#define TPS65941_BUCK_VOLT_MASK		0xFF
+#define TPS65941_BUCK_VOLT_MAX_HEX	0xFF
+#define TPS65941_BUCK_VOLT_MAX		3340000
+#define TPS65941_BUCK_MODE_MASK		0x1
+
+#define TPS65941_LDO_VOLT_MASK		0x3E
+#define TPS65941_LDO_VOLT_MAX_HEX	0x3A
+#define TPS65941_LDO_VOLT_MIN_HEX	0x4
+#define TPS65941_LDO_VOLT_MAX		3300000
+#define TPS65941_LDO_MODE_MASK		0x1
+#define TPS65941_LDO_BYPASS_EN		0x80
+#define TP65941_BUCK_CONF_SLEW_MASK	0x7
Signature · 1 line
2.17.1
#10 lore raw

PATCH v3 5/18 power: pmic: tps65941: Add support for tps65941 family of PMICs

Quoted 3 lines · Keerthy

Add support to bind the regulators/child nodes with the pmic.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/c094023a/attachment.sig>
author
#11 lore raw

PATCH v3 6/18 power: regulator: tps65941: add regulator support

In reply to Keerthy

The driver provides regulator set/get voltage enable/disable functions for tps65941 family of PMICs.

---
Changes in v3:

* No change

Changes in v2:

* No change

 drivers/power/regulator/Kconfig              |  10 +
 drivers/power/regulator/Makefile             |   1 +
 drivers/power/regulator/tps65941_regulator.c | 407 +++++++++++++++++++
 3 files changed, 418 insertions(+)
 create mode 100644 drivers/power/regulator/tps65941_regulator.c
drivers/power/regulator/Kconfig +10 -0
index 56d68ee40e..25fc787a29 100644
@@ -323,3 +323,13 @@ config SPL_DM_REGULATOR_LP873X
 	This enables implementation of driver-model regulator uclass
 	features for REGULATOR LP873X and the family of LP873X PMICs.
 	The driver implements get/set api for: value and enable in SPL.
+
+config DM_REGULATOR_TPS65941
+	bool "Enable driver for TPS65941 PMIC regulators"
+        depends on PMIC_TPS65941
+	help
+	This enables implementation of driver-model regulator uclass
+	features for REGULATOR TPS65941 and the family of TPS65941 PMICs.
+	TPS65941 series of PMICs have 5 single phase BUCKs that can also
+	be configured in multi phase modes & 4 LDOs. The driver implements
+	get/set api for value and enable.
drivers/power/regulator/Makefile +1 -0
index 9198841b4f..b611c901ba 100644
@@ -28,3 +28,4 @@ obj-$(CONFIG_$(SPL_)DM_REGULATOR_STM32_VREFBUF) += stm32-vrefbuf.o
 obj-$(CONFIG_DM_REGULATOR_TPS65910) += tps65910_regulator.o
 obj-$(CONFIG_DM_REGULATOR_TPS62360) += tps62360_regulator.o
 obj-$(CONFIG_$(SPL_)DM_REGULATOR_STPMIC1) += stpmic1.o
+obj-$(CONFIG_DM_REGULATOR_TPS65941) += tps65941_regulator.o
drivers/power/regulator/tps65941_regulator.c new file +407 -0

407 lines not on this page · raw message

Signature · 1 line
2.17.1
#12 lore raw

PATCH v3 6/18 power: regulator: tps65941: add regulator support

Quoted 4 lines · Keerthy

The driver provides regulator set/get voltage enable/disable functions for tps65941 family of PMICs.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/80672766/attachment.sig>
author
#13 lore raw

PATCH v3 7/18 arm: mach-k3: am6_init: Initialize AVS class 0

In reply to Keerthy

Initialize AVS class 0 so that mpu voltage rail is programmed to the AVS class 0 compensated value.

---
Changes in v3:

* No change

Changes in v2:

* uclass_get_device_by_driver used in place getting the first uclass Instance.

 arch/arm/mach-k3/am6_init.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/mach-k3/am6_init.c +7 -0
index 0b564f7bd1..99edcd9a24 100644
@@ -116,6 +116,13 @@ void board_init_f(ulong dummy)
 	/* Perform EEPROM-based board detection */
 	do_board_detect();
 
+#if defined(CONFIG_CPU_V7R) && defined(CONFIG_K3_AVS0)
+	ret = uclass_get_device_by_driver(UCLASS_MISC, DM_GET_DRIVER(k3_avs),
+					  &dev);
+	if (ret)
+		printf("AVS init failed: %d\n", ret);
+#endif
+
 #ifdef CONFIG_K3_AM654_DDRSS
 	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
 	if (ret)
Signature · 1 line
2.17.1
#14 lore raw

PATCH v3 7/18 arm: mach-k3: am6_init: Initialize AVS class 0

Quoted 4 lines · Keerthy

Initialize AVS class 0 so that mpu voltage rail is programmed to the AVS class 0 compensated value.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/ed8d5778/attachment.sig>
author
#15 lore raw

PATCH v3 8/18 arm: mach-k3: j721e_init: Initialize avs class 0

In reply to Keerthy

Initialize avs class 0

---
Changes in v3:

* No change

Changes in v2:

* No change

 arch/arm/mach-k3/j721e_init.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/mach-k3/j721e_init.c +7 -0
index 5e3813252b..d0bf86abeb 100644
@@ -118,6 +118,13 @@ void board_init_f(ulong dummy)
 	preloader_console_init();
 #endif
 
+#if defined(CONFIG_CPU_V7R) && defined(CONFIG_K3_AVS0)
+	ret = uclass_get_device_by_driver(UCLASS_MISC, DM_GET_DRIVER(k3_avs),
+					  &dev);
+	if (ret)
+		printf("AVS init failed: %d\n", ret);
+#endif
+
 #if defined(CONFIG_K3_J721E_DDRSS)
 	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
 	if (ret)
Signature · 1 line
2.17.1
#16 lore raw

PATCH v3 8/18 arm: mach-k3: j721e_init: Initialize avs class 0

Quoted 3 lines · Keerthy

Initialize avs class 0

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/f0ff9f1d/attachment.sig>
author
#17 lore raw

PATCH v3 9/18 arm: dts: k3-am654-r5-base-board: Add VTM node

In reply to Keerthy

Add VTM node for voltage and thermal management. For u-boot, this is needed for supporting AVS class 0, as the efuse values for the OPPs are stored under the VTM.

---
Changes in v3:

* Moved from generic wakeup.dtsi to r5 board file.

Changes in v2:

* No change

 arch/arm/dts/k3-am654-r5-base-board.dts | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/dts/k3-am654-r5-base-board.dts +7 -0
index 174d202306..6ab0f4af10 100644
@@ -97,6 +97,13 @@
 		u-boot,dm-spl;
 	};
 
+	wkup_vtm0: wkup_vtm at 42050000 {
+		compatible = "ti,am654-vtm", "ti,am654-avs";
+		reg = <0x42050000 0x25c>;
+		power-domains = <&k3_pds 80>;
+		#thermal-sensor-cells = <1>;
+	};
+
 	clk_200mhz: dummy_clock {
 		compatible = "fixed-clock";
 		#clock-cells = <0>;
Signature · 1 line
2.17.1
#18 lore raw

PATCH v3 9/18 arm: dts: k3-am654-r5-base-board: Add VTM node

Quoted 6 lines · Keerthy

Add VTM node for voltage and thermal management. For u-boot, this is needed for supporting AVS class 0, as the efuse values for the OPPs are stored under the VTM.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/77564446/attachment.sig>
author
#19 lore raw

PATCH v3 10/18 arm: dts: k3-am654-r5-base-board: enable wkup_i2c0 driver for spl

In reply to Keerthy

From: Tero Kristo <[email protected]>

Enable wkup_i2c0 as this is needed for voltage control.

---
Changes in v3:

* No change

Changes in v2:

* No change

 arch/arm/dts/k3-am654-r5-base-board.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm/dts/k3-am654-r5-base-board.dts +1 -0
index 6ab0f4af10..98868afd9c 100644
@@ -218,4 +218,5 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&wkup_i2c0_pins_default>;
 	clock-frequency = <400000>;
+	u-boot,dm-spl;
 };
Signature · 1 line
2.17.1
#20 lore raw

PATCH v3 10/18 arm: dts: k3-am654-r5-base-board: enable wkup_i2c0 driver for spl

Quoted 6 lines · Keerthy

From: Tero Kristo <[email protected]>

Enable wkup_i2c0 as this is needed for voltage control.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/71431b34/attachment.sig>
author
#21 lore raw

PATCH v3 11/18 arm: dts: k3-am654-r5-base-board: add supply rail for MPU

In reply to Keerthy

From: Tero Kristo <[email protected]>

MPU voltage on AM65x-evm is controlled via the TPS62363 chip attached to i2c0 bus. Add device node for this so that it can be controlled via a regulator driver.

---
Changes in v3:

* No change

Changes in v2:

* No change

 arch/arm/dts/k3-am654-r5-base-board.dts | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm/dts/k3-am654-r5-base-board.dts +13 -0
index 98868afd9c..baa3a2c9e7 100644
@@ -219,4 +219,17 @@
 	pinctrl-0 = <&wkup_i2c0_pins_default>;
 	clock-frequency = <400000>;
 	u-boot,dm-spl;
+
+	vdd_mpu: tps62363 at 60 {
+		compatible = "ti,tps62363";
+		reg = <0x60>;
+		regulator-name = "VDD_MPU";
+		regulator-min-microvolt = <500000>;
+		regulator-max-microvolt = <1770000>;
+		regulator-always-on;
+		regulator-boot-on;
+		ti,vsel0-state-high;
+		ti,vsel1-state-high;
+		u-boot,dm-spl;
+	};
 };
Signature · 1 line
2.17.1
#22 lore raw

PATCH v3 11/18 arm: dts: k3-am654-r5-base-board: add supply rail for MPU

Quoted 8 lines · Keerthy

From: Tero Kristo <[email protected]>

MPU voltage on AM65x-evm is controlled via the TPS62363 chip attached to i2c0 bus. Add device node for this so that it can be controlled via a regulator driver.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/26c6ff01/attachment.sig>
author
#23 lore raw

PATCH v3 12/18 arm: dts: k3-am654-r5-base-board: enable wkup_vtm0 node and link in supplies

In reply to Keerthy

From: Tero Kristo <[email protected]>

Link the vdd-supplies for the voltage domains under the VTM node. Also, enable the node under SPL. This will enable the AVS class 0 support on am65x-evm board.

---
Changes in v3:

* No change

Changes in v2:

* No change

 arch/arm/dts/k3-am654-r5-base-board.dts | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/dts/k3-am654-r5-base-board.dts +6 -0
index baa3a2c9e7..5c110ef9dd 100644
@@ -138,6 +138,12 @@
 	power-domains = <&k3_pds 146 TI_SCI_PD_SHARED>;
 };
 
+&wkup_vtm0 {
+	vdd-supply-3 = <&vdd_mpu>;
+	vdd-supply-4 = <&vdd_mpu>;
+	u-boot,dm-spl;
+};
+
 &wkup_pmx0 {
 	u-boot,dm-spl;
 	wkup_uart0_pins_default: wkup_uart0_pins_default {
Signature · 1 line
2.17.1
#24 lore raw

PATCH v3 12/18 arm: dts: k3-am654-r5-base-board: enable wkup_vtm0 node and link in supplies

Quoted 8 lines · Keerthy

From: Tero Kristo <[email protected]>

Link the vdd-supplies for the voltage domains under the VTM node. Also, enable the node under SPL. This will enable the AVS class 0 support on am65x-evm board.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/e6e18bb0/attachment.sig>
author
#25 lore raw

PATCH v3 13/18 arm: dts: k3-j721e-r5-common-proc-board: Add VTM node

In reply to Keerthy

Add VTM node for voltage and thermal management. For u-boot, this is needed for supporting AVS class 0, as the efuse values for the OPPs are stored under the VTM.

---
Changes in v3:

* No change

Changes in v2:

* No change

 arch/arm/dts/k3-j721e-r5-common-proc-board.dts | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/dts/k3-j721e-r5-common-proc-board.dts +7 -0
index 54d7998d27..e569809fcb 100644
@@ -59,6 +59,13 @@
 		mboxes= <&mcu_secproxy 4>, <&mcu_secproxy 5>;
 		mbox-names = "tx", "rx";
 	};
+
+	wkup_vtm0: wkup_vtm at 42040000 {
+		compatible = "ti,am654-vtm", "ti,j721e-avs";
+		reg = <0x0 0x42040000 0x0 0x330>;
+		power-domains = <&k3_pds 154 TI_SCI_PD_EXCLUSIVE>;
+		#thermal-sensor-cells = <1>;
+	};
 };
 
 &dmsc {
Signature · 1 line
2.17.1
#26 lore raw

PATCH v3 13/18 arm: dts: k3-j721e-r5-common-proc-board: Add VTM node

Quoted 5 lines · Keerthy

Add VTM node for voltage and thermal management. For u-boot, this is needed for supporting AVS class 0, as the efuse values for the OPPs are stored under the VTM.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/7eff801b/attachment.sig>
author
#27 lore raw

PATCH v3 14/18 arm: dts: k3-j721e-r5-common: Add tps65941 node and dependent wkup_i2c0 node

In reply to Keerthy

Add tps65941 node and dependent wkup_i2c0 node needed for AVS class 0 support

---
Changes in v3:

* No change

Changes in v2:

* No change

 arch/arm/dts/k3-j721e-mcu-wakeup.dtsi         | 11 +++++++
 .../arm/dts/k3-j721e-r5-common-proc-board.dts | 32 +++++++++++++++++++
 2 files changed, 43 insertions(+)
arch/arm/dts/k3-j721e-mcu-wakeup.dtsi +11 -0
index b958b5b3c1..0ed09e469f 100644
@@ -57,6 +57,17 @@
 		clock-names = "fclk";
 	};
 
+	wkup_i2c0: i2c at 42120000 {
+		compatible = "ti,j721e-i2c", "ti,omap4-i2c";
+		reg = <0x0 0x42120000 0x0 0x100>;
+		interrupts = <GIC_SPI 896 IRQ_TYPE_LEVEL_HIGH>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clock-names = "fck";
+		clocks = <&k3_clks 197 0>;
+		power-domains = <&k3_pds 197 TI_SCI_PD_EXCLUSIVE>;
+	};
+
 	mcu_uart0: serial at 40a00000 {
 		compatible = "ti,j721e-uart", "ti,am654-uart";
 		reg = <0x00 0x40a00000 0x00 0x100>;
arch/arm/dts/k3-j721e-r5-common-proc-board.dts +32 -0
index e569809fcb..165c38da4b 100644
@@ -93,6 +93,13 @@
 			J721E_WKUP_IOPAD(0xe0, PIN_OUTPUT, 0) /* (G29) WKUP_GPIO0_12.MCU_UART0_TXD */
 		>;
 	};
+
+	wkup_i2c0_pins_default: wkup-i2c0-pins-default {
+		pinctrl-single,pins = <
+			J721E_WKUP_IOPAD(0xf8, PIN_INPUT_PULLUP, 0) /* (J25) WKUP_I2C0_SCL */
+			J721E_WKUP_IOPAD(0xfc, PIN_INPUT_PULLUP, 0) /* (H24) WKUP_I2C0_SDA */
+		>;
+	};
 };
 
 &main_pmx0 {
@@ -147,4 +154,29 @@
 	ti,driver-strength-ohm = <50>;
 };
 
+&wkup_i2c0 {
+	u-boot,dm-spl;
+	tps659413a: tps659413a at 48 {
+		reg = <0x48>;
+		compatible = "ti,tps659413";
+		u-boot,dm-spl;
+		pinctrl-names = "default";
+		pinctrl-0 = <&wkup_i2c0_pins_default>;
+		clock-frequency = <400000>;
+
+		regulators: regulators {
+			u-boot,dm-spl;
+			buck12_reg: buck12 {
+				/*VDD_MPU*/
+				regulator-name = "buck12";
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <1250000>;
+				regulator-always-on;
+				regulator-boot-on;
+				u-boot,dm-spl;
+			};
+		};
+	};
+};
+
 #include "k3-j721e-common-proc-board-u-boot.dtsi"
Signature · 1 line
2.17.1
#28 lore raw

PATCH v3 14/18 arm: dts: k3-j721e-r5-common: Add tps65941 node and dependent wkup_i2c0 node

Quoted 3 lines · Keerthy

Add tps65941 node and dependent wkup_i2c0 node needed for AVS class 0 support

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/0c20cd30/attachment.sig>
author
#29 lore raw

PATCH v3 15/18 arm: dts: k3-j721e-r5-common-proc-board: Hook buck12_reg to vtm supply

In reply to Keerthy

Hook buck12_reg to vtm avs supply

---
Changes in v3:

* No change

Changes in v2:

* No change

 arch/arm/dts/k3-j721e-r5-common-proc-board.dts | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/dts/k3-j721e-r5-common-proc-board.dts +5 -0
index 165c38da4b..41af48214f 100644
@@ -179,4 +179,9 @@
 	};
 };
 
+&wkup_vtm0 {
+	vdd-supply-2 = <&buck12_reg>;
+	u-boot,dm-spl;
+};
+
 #include "k3-j721e-common-proc-board-u-boot.dtsi"
Signature · 1 line
2.17.1
#30 lore raw

PATCH v3 15/18 arm: dts: k3-j721e-r5-common-proc-board: Hook buck12_reg to vtm supply

Quoted 3 lines · Keerthy

Hook buck12_reg to vtm avs supply

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/3607eec7/attachment.sig>
author
#31 lore raw

PATCH v3 16/18 configs: am65x_evm_r5_defconfig: Enable TPS62363 regulator support

In reply to Keerthy

From: Tero Kristo <[email protected]>

TPS62363 is used to control the MPU_VDD voltage, so enable the driver for this.

---
Changes in v3:

* No change

Changes in v2:

* No change

 configs/am65x_evm_r5_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/am65x_evm_r5_defconfig +1 -0
index d0619e9b7a..a721b24ba4 100644
@@ -84,6 +84,7 @@ CONFIG_DM_REGULATOR=y
 CONFIG_SPL_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_SPL_DM_REGULATOR_GPIO=y
+CONFIG_DM_REGULATOR_TPS62360=y
 CONFIG_RAM=y
 CONFIG_SPL_RAM=y
 CONFIG_K3_SYSTEM_CONTROLLER=y
Signature · 1 line
2.17.1
#32 lore raw

PATCH v3 16/18 configs: am65x_evm_r5_defconfig: Enable TPS62363 regulator support

Quoted 7 lines · Keerthy

From: Tero Kristo <[email protected]>

TPS62363 is used to control the MPU_VDD voltage, so enable the driver for this.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/13b77792/attachment.sig>
author
#33 lore raw

PATCH v3 17/18 configs: am65x_evm_r5_defconfig: Enable AVS class 0 support

In reply to Keerthy

From: Tero Kristo <[email protected]>

Enable AVS class 0 support for the R5 SPL bootloader.

---
Changes in v3:

* No change

Changes in v2:

* No change

 configs/am65x_evm_r5_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/am65x_evm_r5_defconfig +1 -0
index a721b24ba4..4f122808de 100644
@@ -99,3 +99,4 @@ CONFIG_TIMER=y
 CONFIG_SPL_TIMER=y
 CONFIG_OMAP_TIMER=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
+CONFIG_K3_AVS0=y
Signature · 1 line
2.17.1
#34 lore raw

PATCH v3 17/18 configs: am65x_evm_r5_defconfig: Enable AVS class 0 support

Quoted 6 lines · Keerthy

From: Tero Kristo <[email protected]>

Enable AVS class 0 support for the R5 SPL bootloader.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/66d720d3/attachment.sig>
author
#35 lore raw

PATCH v3 18/18 configs: j721e_evm_r5_defconfig: Enable AVS Class 0 & dependent configs

In reply to Keerthy

Enable AVS Class 0 & dependent config options.

---
Changes in v3:

* No change

Changes in v2:

* No change

 configs/j721e_evm_r5_defconfig | 9 +++++++++
 1 file changed, 9 insertions(+)
configs/j721e_evm_r5_defconfig +9 -0
index b7168eceb4..2b6dbf5a49 100644
@@ -59,10 +59,14 @@ CONFIG_CLK_TI_SCI=y
 CONFIG_TI_SCI_PROTOCOL=y
 CONFIG_DM_GPIO=y
 CONFIG_DA8XX_GPIO=y
+CONFIG_DM_I2C=y
+CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
+CONFIG_SYS_I2C_OMAP24XX=y
 CONFIG_DM_MAILBOX=y
 CONFIG_K3_SEC_PROXY=y
 CONFIG_MISC=y
 CONFIG_FS_LOADER=y
+CONFIG_K3_AVS0=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_AM654=y
@@ -76,6 +80,11 @@ CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_SINGLE=y
 CONFIG_POWER_DOMAIN=y
 CONFIG_TI_SCI_POWER_DOMAIN=y
+CONFIG_DM_PMIC=y
+CONFIG_PMIC_TPS65941=y
+CONFIG_DM_REGULATOR=y
+CONFIG_SPL_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_TPS65941=y
 CONFIG_K3_SYSTEM_CONTROLLER=y
 CONFIG_REMOTEPROC_TI_K3_ARM64=y
 CONFIG_DM_RESET=y
Signature · 1 line
2.17.1
#36 lore raw

PATCH v3 18/18 configs: j721e_evm_r5_defconfig: Enable AVS Class 0 & dependent configs

Quoted 3 lines · Keerthy

Enable AVS Class 0 & dependent config options.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/2896ad82/attachment.sig>
#37 lore raw

v3 cover misc: Add AVS class 0 support for AM6

In reply to Keerthy
Quoted 4 lines · Keerthy

Adaptive Voltage Scaling is a technology used in TI SoCs to optimize the operating voltage based on characterization data written to efuse during production.

Quoted 8 lines

Add support for Adaptive Voltage scaling class 0 support for AM6 family of devices. Adaptive voltage scaling class 0 implies that optimized voltage values for a particular OPP of a particular voltage domain are read from Efuse and programmed on the pmic/regulator.

Tested on AM654-EVM for MPU @800 MHz.
Tested on J721e-evm for MPU.

For the entire series:

Thanks and regards,
Lokesh

Quoted 67 lines

The series is based on top of the branch:

https://github.com/lokeshvutla/u-boot/tree/devel/j721e-full-boot

Changes in v3:

* Extended the support for j721e-evm.
* Moved vtm node under r5-board dts.

Changes in v2:

* Avoided creation of new uclass. AVS driver is now under misc.

Keerthy (11):
clk: clk-ti-sci: Notify AVS driver upon setting clock rate
misc: k3_avs: Add j721e support
power: pmic: tps65941: Add support for tps65941 family of PMICs
power: regulator: tps65941: add regulator support
arm: mach-k3: am6_init: Initialize AVS class 0
arm: mach-k3: j721e_init: Initialize avs class 0
arm: dts: k3-am654-r5-base-board: Add VTM node
arm: dts: k3-j721e-r5-common-proc-board: Add VTM node
arm: dts: k3-j721e-r5-common: Add tps65941 node and dependent
wkup_i2c0 node
arm: dts: k3-j721e-r5-common-proc-board: Hook buck12_reg to vtm supply
configs: j721e_evm_r5_defconfig: Enable AVS Class 0 & dependent
configs

Tero Kristo (7):
misc: k3_avs: add driver for K3 Adaptive Voltage Scaling Class 0
power: regulator: tps6236x: add support for tps6236x regulators
arm: dts: k3-am654-r5-base-board: enable wkup_i2c0 driver for spl
arm: dts: k3-am654-r5-base-board: add supply rail for MPU
arm: dts: k3-am654-r5-base-board: enable wkup_vtm0 node and link in
supplies
configs: am65x_evm_r5_defconfig: Enable TPS62363 regulator support
configs: am65x_evm_r5_defconfig: Enable AVS class 0 support

 arch/arm/dts/k3-am654-r5-base-board.dts       |  27 ++
 arch/arm/dts/k3-j721e-mcu-wakeup.dtsi         |  11 +
 .../arm/dts/k3-j721e-r5-common-proc-board.dts |  44 ++
 arch/arm/mach-k3/am6_init.c                   |   7 +
 arch/arm/mach-k3/j721e_init.c                 |   7 +
 configs/am65x_evm_r5_defconfig                |   2 +
 configs/j721e_evm_r5_defconfig                |   9 +
 drivers/clk/clk-ti-sci.c                      |   5 +
 drivers/misc/Kconfig                          |   9 +
 drivers/misc/Makefile                         |   1 +
 drivers/misc/k3_avs.c                         | 388 +++++++++++++++++
 drivers/power/pmic/Kconfig                    |   7 +
 drivers/power/pmic/Makefile                   |   1 +
 drivers/power/pmic/tps65941.c                 |  83 ++++
 drivers/power/regulator/Kconfig               |  20 +
 drivers/power/regulator/Makefile              |   2 +
 drivers/power/regulator/tps62360_regulator.c  | 123 ++++++
 drivers/power/regulator/tps65941_regulator.c  | 407 ++++++++++++++++++
 include/k3-avs.h                              |  30 ++
 include/power/tps65941.h                      |  26 ++
 20 files changed, 1209 insertions(+)
 create mode 100644 drivers/misc/k3_avs.c
 create mode 100644 drivers/power/pmic/tps65941.c
 create mode 100644 drivers/power/regulator/tps62360_regulator.c
 create mode 100644 drivers/power/regulator/tps65941_regulator.c
 create mode 100644 include/k3-avs.h
 create mode 100644 include/power/tps65941.h
author
#38 lore raw

v3 cover misc: Add AVS class 0 support for AM6

Quoted 16 lines · Lokesh Vutla
Quoted 4 lines · Keerthy

Adaptive Voltage Scaling is a technology used in TI SoCs to optimize the operating voltage based on characterization data written to efuse during production.

Quoted 8 lines

Add support for Adaptive Voltage scaling class 0 support for AM6 family of devices. Adaptive voltage scaling class 0 implies that optimized voltage values for a particular OPP of a particular voltage domain are read from Efuse and programmed on the pmic/regulator.

Tested on AM654-EVM for MPU @800 MHz.
Tested on J721e-evm for MPU.

Quoted 6 lines

For the entire series:

Thanks and regards,
Lokesh

Tom,

If no further comments can this series be pulled in?

- Keerthy

Quoted 68 lines
Quoted 68 lines

The series is based on top of the branch:

https://github.com/lokeshvutla/u-boot/tree/devel/j721e-full-boot

Changes in v3:

* Extended the support for j721e-evm.
* Moved vtm node under r5-board dts.

Changes in v2:

* Avoided creation of new uclass. AVS driver is now under misc.

Keerthy (11):
clk: clk-ti-sci: Notify AVS driver upon setting clock rate
misc: k3_avs: Add j721e support
power: pmic: tps65941: Add support for tps65941 family of PMICs
power: regulator: tps65941: add regulator support
arm: mach-k3: am6_init: Initialize AVS class 0
arm: mach-k3: j721e_init: Initialize avs class 0
arm: dts: k3-am654-r5-base-board: Add VTM node
arm: dts: k3-j721e-r5-common-proc-board: Add VTM node
arm: dts: k3-j721e-r5-common: Add tps65941 node and dependent
wkup_i2c0 node
arm: dts: k3-j721e-r5-common-proc-board: Hook buck12_reg to vtm supply
configs: j721e_evm_r5_defconfig: Enable AVS Class 0 & dependent
configs

Tero Kristo (7):
misc: k3_avs: add driver for K3 Adaptive Voltage Scaling Class 0
power: regulator: tps6236x: add support for tps6236x regulators
arm: dts: k3-am654-r5-base-board: enable wkup_i2c0 driver for spl
arm: dts: k3-am654-r5-base-board: add supply rail for MPU
arm: dts: k3-am654-r5-base-board: enable wkup_vtm0 node and link in
supplies
configs: am65x_evm_r5_defconfig: Enable TPS62363 regulator support
configs: am65x_evm_r5_defconfig: Enable AVS class 0 support

  arch/arm/dts/k3-am654-r5-base-board.dts       |  27 ++
  arch/arm/dts/k3-j721e-mcu-wakeup.dtsi         |  11 +
  .../arm/dts/k3-j721e-r5-common-proc-board.dts |  44 ++
  arch/arm/mach-k3/am6_init.c                   |   7 +
  arch/arm/mach-k3/j721e_init.c                 |   7 +
  configs/am65x_evm_r5_defconfig                |   2 +
  configs/j721e_evm_r5_defconfig                |   9 +
  drivers/clk/clk-ti-sci.c                      |   5 +
  drivers/misc/Kconfig                          |   9 +
  drivers/misc/Makefile                         |   1 +
  drivers/misc/k3_avs.c                         | 388 +++++++++++++++++
  drivers/power/pmic/Kconfig                    |   7 +
  drivers/power/pmic/Makefile                   |   1 +
  drivers/power/pmic/tps65941.c                 |  83 ++++
  drivers/power/regulator/Kconfig               |  20 +
  drivers/power/regulator/Makefile              |   2 +
  drivers/power/regulator/tps62360_regulator.c  | 123 ++++++
  drivers/power/regulator/tps65941_regulator.c  | 407 ++++++++++++++++++
  include/k3-avs.h                              |  30 ++
  include/power/tps65941.h                      |  26 ++
  20 files changed, 1209 insertions(+)

create mode 100644 drivers/misc/k3_avs.c
create mode 100644 drivers/power/pmic/tps65941.c create mode 100644 drivers/power/regulator/tps62360_regulator.c create mode 100644 drivers/power/regulator/tps65941_regulator.c create mode 100644 include/k3-avs.h
create mode 100644 include/power/tps65941.h