Skip to contentSkip to conversation

ARM: DRA7: Add Kconfig support for selecting OPPs

PATCH New Lokesh Vutla 2 participants 10 messages Nov 23, 2016 – Dec 4, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover ARM: DRA7: Add Kconfig support for selecting OPPs

This series adds support for selecting DSPEVE, IVA, GPU OPPs via Kconfig and fixup DT clock nodes as required.

Changes since v1:
- Added help option for Kconfig entries.

Lokesh Vutla (1):
ARM: OMAP4+: Add support for dynamically selecting OPPs

Suman Anna (2):
ARM: DRA7: Redefine voltage and efuse macros per OPP using Kconfig
ARM: DRA7: Fixup DSPEVE, IVA and GPU clock frequencies based on OPP

 arch/arm/include/asm/arch-omap5/clock.h |  47 ++++++++---
 arch/arm/include/asm/omap_common.h      |  23 +++++-
 arch/arm/mach-omap2/clocks-common.c     | 116 ++++++++++++++++-----------
 arch/arm/mach-omap2/omap4/hw_data.c     |  24 +++---
 arch/arm/mach-omap2/omap5/Kconfig       |  93 ++++++++++++++++++++++
 arch/arm/mach-omap2/omap5/fdt.c         | 136 ++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/omap5/hw_data.c     |  12 +--
 board/ti/am57xx/board.c                 |  92 ++++++++++++++++-----
 board/ti/dra7xx/evm.c                   |  91 ++++++++++++++++-----
 9 files changed, 517 insertions(+), 117 deletions(-)
Signature · 1 line
2.10.1
#1 lore raw

PATCH v2 1/3 ARM: OMAP4+: Add support for dynamically selecting OPPs

It can be expected that different paper spins of a SoC can have different definitions for OPP and can have their own constraints on the boot up OPP for each voltage rail. In order to have this flexibility, add support for dynamically selecting the OPP voltage based on the board to handle any such exceptions.

---
 arch/arm/include/asm/omap_common.h  |  23 ++++++-
 arch/arm/mach-omap2/clocks-common.c | 116 ++++++++++++++++++++++--------------
 arch/arm/mach-omap2/omap4/hw_data.c |  24 ++++----
 arch/arm/mach-omap2/omap5/hw_data.c |  12 ++--
 board/ti/am57xx/board.c             |  92 +++++++++++++++++++++-------
 board/ti/dra7xx/evm.c               |  91 +++++++++++++++++++++-------
 6 files changed, 254 insertions(+), 104 deletions(-)
arch/arm/include/asm/omap_common.h +21 -2
index 605c549..00bd9fc 100644
@@ -539,18 +539,26 @@ struct pmic_data {
 	int (*pmic_write)(u8 sa, u8 reg_addr, u8 reg_data);
 };
 
+enum {
+	OPP_LOW,
+	OPP_NOM,
+	OPP_OD,
+	OPP_HIGH,
+	NUM_OPPS,
+};
+
 /**
  * struct volts_efuse_data - efuse definition for voltage
  * @reg:	register address for efuse
  * @reg_bits:	Number of bits in a register address, mandatory.
  */
 struct volts_efuse_data {
-	u32 reg;
+	u32 reg[NUM_OPPS];
 	u8 reg_bits;
 };
 
 struct volts {
-	u32 value;
+	u32 value[NUM_OPPS];
 	u32 addr;
 	struct volts_efuse_data efuse;
 	struct pmic_data *pmic;
@@ -558,6 +566,16 @@ struct volts {
 	u32 abb_tx_done_mask;
 };
 
+enum {
+	VOLT_MPU,
+	VOLT_CORE,
+	VOLT_MM,
+	VOLT_GPU,
+	VOLT_EVE,
+	VOLT_IVA,
+	NUM_VOLT_RAILS,
+};
+
 struct vcores_data {
 	struct volts mpu;
 	struct volts core;
@@ -612,6 +630,7 @@ void enable_usb_clocks(int index);
 void disable_usb_clocks(int index);
 
 void scale_vcores(struct vcores_data const *);
+int get_voltrail_opp(int rail_offset);
 u32 get_offset_code(u32 volt_offset, struct pmic_data *pmic);
 void do_scale_vcore(u32 vcore_reg, u32 volt_mv, struct pmic_data *pmic);
 void abb_setup(u32 fuse, u32 ldovbb, u32 setup, u32 control,
arch/arm/mach-omap2/clocks-common.c +72 -44

199 lines not on this page · raw message

arch/arm/mach-omap2/omap4/hw_data.c +12 -12
index 02c06c1..6a4b8b9 100644
@@ -261,43 +261,43 @@ struct pmic_data tps62361 = {
 };
 
 struct vcores_data omap4430_volts_es1 = {
-	.mpu.value = 1325,
+	.mpu.value[OPP_NOM] = 1325,
 	.mpu.addr = SMPS_REG_ADDR_VCORE1,
 	.mpu.pmic = &twl6030_4430es1,
 
-	.core.value = 1200,
+	.core.value[OPP_NOM] = 1200,
 	.core.addr = SMPS_REG_ADDR_VCORE3,
 	.core.pmic = &twl6030_4430es1,
 
-	.mm.value = 1200,
+	.mm.value[OPP_NOM] = 1200,
 	.mm.addr = SMPS_REG_ADDR_VCORE2,
 	.mm.pmic = &twl6030_4430es1,
 };
 
 struct vcores_data omap4430_volts = {
-	.mpu.value = 1325,
+	.mpu.value[OPP_NOM] = 1325,
 	.mpu.addr = SMPS_REG_ADDR_VCORE1,
 	.mpu.pmic = &twl6030,
 
-	.core.value = 1200,
+	.core.value[OPP_NOM] = 1200,
 	.core.addr = SMPS_REG_ADDR_VCORE3,
 	.core.pmic = &twl6030,
 
-	.mm.value = 1200,
+	.mm.value[OPP_NOM] = 1200,
 	.mm.addr = SMPS_REG_ADDR_VCORE2,
 	.mm.pmic = &twl6030,
 };
 
 struct vcores_data omap4460_volts = {
-	.mpu.value = 1203,
+	.mpu.value[OPP_NOM] = 1203,
 	.mpu.addr = TPS62361_REG_ADDR_SET1,
 	.mpu.pmic = &tps62361,
 
-	.core.value = 1200,
+	.core.value[OPP_NOM] = 1200,
 	.core.addr = SMPS_REG_ADDR_VCORE1,
 	.core.pmic = &twl6030,
 
-	.mm.value = 1200,
+	.mm.value[OPP_NOM] = 1200,
 	.mm.addr = SMPS_REG_ADDR_VCORE2,
 	.mm.pmic = &twl6030,
 };
@@ -307,15 +307,15 @@ struct vcores_data omap4460_volts = {
  * voltage selection code. Aligned with OMAP4470 ES1.0 OCA V.0.7.
  */
 struct vcores_data omap4470_volts = {
-	.mpu.value = 1202,
+	.mpu.value[OPP_NOM] = 1202,
 	.mpu.addr = SMPS_REG_ADDR_SMPS1,
 	.mpu.pmic = &twl6030,
 
-	.core.value = 1126,
+	.core.value[OPP_NOM] = 1126,
 	.core.addr = SMPS_REG_ADDR_SMPS2,
 	.core.pmic = &twl6030,
 
-	.mm.value = 1139,
+	.mm.value[OPP_NOM] = 1139,
 	.mm.addr = SMPS_REG_ADDR_SMPS5,
 	.mm.pmic = &twl6030,
 };
arch/arm/mach-omap2/omap5/hw_data.c +6 -6
index fc99135..0674480 100644
@@ -337,30 +337,30 @@ struct pmic_data tps659038 = {
 };
 
 struct vcores_data omap5430_volts = {
-	.mpu.value = VDD_MPU,
+	.mpu.value[OPP_NOM] = VDD_MPU,
 	.mpu.addr = SMPS_REG_ADDR_12_MPU,
 	.mpu.pmic = &palmas,
 
-	.core.value = VDD_CORE,
+	.core.value[OPP_NOM] = VDD_CORE,
 	.core.addr = SMPS_REG_ADDR_8_CORE,
 	.core.pmic = &palmas,
 
-	.mm.value = VDD_MM,
+	.mm.value[OPP_NOM] = VDD_MM,
 	.mm.addr = SMPS_REG_ADDR_45_IVA,
 	.mm.pmic = &palmas,
 };
 
 struct vcores_data omap5430_volts_es2 = {
-	.mpu.value = VDD_MPU_ES2,
+	.mpu.value[OPP_NOM] = VDD_MPU_ES2,
 	.mpu.addr = SMPS_REG_ADDR_12_MPU,
 	.mpu.pmic = &palmas,
 	.mpu.abb_tx_done_mask = OMAP_ABB_MPU_TXDONE_MASK,
 
-	.core.value = VDD_CORE_ES2,
+	.core.value[OPP_NOM] = VDD_CORE_ES2,
 	.core.addr = SMPS_REG_ADDR_8_CORE,
 	.core.pmic = &palmas,
 
-	.mm.value = VDD_MM_ES2,
+	.mm.value[OPP_NOM] = VDD_MM_ES2,
 	.mm.addr = SMPS_REG_ADDR_45_IVA,
 	.mm.pmic = &palmas,
 	.mm.abb_tx_done_mask = OMAP_ABB_MM_TXDONE_MASK,
board/ti/am57xx/board.c +72 -20

148 lines not on this page · raw message

board/ti/dra7xx/evm.c +71 -20

149 lines not on this page · raw message

Signature · 1 line
2.10.1
#2 lore raw

PATCH v2 1/3 ARM: OMAP4+: Add support for dynamically selecting OPPs

Quoted 7 lines · Lokesh Vutla

It can be expected that different paper spins of a SoC can have different definitions for OPP and can have their own constraints on the boot up OPP for each voltage rail. In order to have this flexibility, add support for dynamically selecting the OPP voltage based on the board to handle any such exceptions.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161123/1c17eaeb/attachment.sig>
#3 lore raw

PATCH v2 1/3 ARM: OMAP4+: Add support for dynamically selecting OPPs

In reply to Lokesh Vutla
Quoted 8 lines · Lokesh Vutla

It can be expected that different paper spins of a SoC can have different definitions for OPP and can have their own constraints on the boot up OPP for each voltage rail. In order to have this flexibility, add support for dynamically selecting the OPP voltage based on the board to handle any such exceptions.

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: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161204/a88c8dd0/attachment.sig>
#4 lore raw

PATCH v2 2/3 ARM: DRA7: Redefine voltage and efuse macros per OPP using Kconfig

In reply to Lokesh Vutla

From: Suman Anna <[email protected]>

Redefine the macros used to define the voltage values and the efuse register offsets based on OPP for all the voltage domains. This is done using Kconfig macros that can be set in a defconfig or selected during a config step. This allows a voltage domain to be configured/set to a corresponding voltage value depending on the OPP selection choice.

The Kconfig choices have been added for MPU, DSPEVE, IVA and GPU voltage domains, with the MPU domain restricted to OPP_NOM. The OPP_OD and OPP_HIGH options will be added when the support for configuring the MPU clock frequency is added. The clock configuration for other voltage domains is out of scope in u-boot code.

The CORE voltage domain does not have separate voltage values and efuse register offset at different OPPs, while the MPU voltage domain only has different efuse register offsets for different OPPs, but uses the same voltage value. Any different choices of OPPs for voltage domains on common ganged-rails is automatically taken care to select the corresponding highest OPP voltage value.

---
 arch/arm/include/asm/arch-omap5/clock.h | 47 ++++++++++++-----
 arch/arm/mach-omap2/omap5/Kconfig       | 93 +++++++++++++++++++++++++++++++++
 2 files changed, 127 insertions(+), 13 deletions(-)
arch/arm/include/asm/arch-omap5/clock.h +34 -13
index 551c927..e8b286b 100644
@@ -286,19 +286,40 @@
 /* STD_FUSE_OPP_VMIN_MPU_4 */
 #define STD_FUSE_OPP_VMIN_MPU_HIGH	(DRA752_EFUSE_BASE + 0x1B28)
 
-/* Common voltage and Efuse register macros */
-/* DRA74x/DRA75x/DRA72x */
-#define VDD_MPU_DRA7			VDD_MPU_DRA7_NOM
-#define VDD_CORE_DRA7			VDD_CORE_DRA7_NOM
-#define VDD_EVE_DRA7			VDD_EVE_DRA7_NOM
-#define VDD_GPU_DRA7			VDD_GPU_DRA7_NOM
-#define VDD_IVA_DRA7			VDD_IVA_DRA7_NOM
-
-#define STD_FUSE_OPP_VMIN_MPU		STD_FUSE_OPP_VMIN_MPU_NOM
-#define STD_FUSE_OPP_VMIN_CORE		STD_FUSE_OPP_VMIN_CORE_NOM
-#define STD_FUSE_OPP_VMIN_DSPEVE	STD_FUSE_OPP_VMIN_DSPEVE_NOM
-#define STD_FUSE_OPP_VMIN_GPU		STD_FUSE_OPP_VMIN_GPU_NOM
-#define STD_FUSE_OPP_VMIN_IVA		STD_FUSE_OPP_VMIN_IVA_NOM
+#if defined(CONFIG_DRA7_MPU_OPP_HIGH)
+#define DRA7_MPU_OPP	OPP_HIGH
+#elif defined(CONFIG_DRA7_MPU_OPP_OD)
+#define DRA7_MPU_OPP	OPP_OD
+#else /* OPP_NOM default */
+#define DRA7_MPU_OPP	OPP_NOM
+#endif
+
+/* OPP_NOM only available option for CORE */
+#define DRA7_CORE_OPP	OPP_NOM
+
+#if defined(CONFIG_DRA7_DSPEVE_OPP_HIGH)
+#define DRA7_DSPEVE_OPP	OPP_HIGH
+#elif defined(CONFIG_DRA7_DSPEVE_OPP_OD)
+#define DRA7_DSPEVE_OPP	OPP_OD
+#else /* OPP_NOM default */
+#define DRA7_DSPEVE_OPP	OPP_NOM
+#endif
+
+#if defined(CONFIG_DRA7_IVA_OPP_HIGH)
+#define DRA7_IVA_OPP	OPP_HIGH
+#elif defined(CONFIG_DRA7_IVA_OPP_OD)
+#define DRA7_IVA_OPP	OPP_OD
+#else /* OPP_NOM default */
+#define DRA7_IVA_OPP	OPP_NOM
+#endif
+
+#if defined(CONFIG_DRA7_GPU_OPP_HIGH)
+#define DRA7_GPU_OPP	OPP_HIGH
+#elif defined(CONFIG_DRA7_GPU_OPP_OD)
+#define DRA7_GPU_OPP	OPP_OD
+#else /* OPP_NOM default */
+#define DRA7_GPU_OPP	OPP_NOM
+#endif
 
 /* Standard offset is 0.5v expressed in uv */
 #define PALMAS_SMPS_BASE_VOLT_UV 500000
arch/arm/mach-omap2/omap5/Kconfig +93 -0

99 lines not on this page · raw message

Signature · 1 line
2.10.1
#5 lore raw

PATCH v2 2/3 ARM: DRA7: Redefine voltage and efuse macros per OPP using Kconfig

Quoted 24 lines · Lokesh Vutla

From: Suman Anna <[email protected]>

Redefine the macros used to define the voltage values and the efuse register offsets based on OPP for all the voltage domains. This is done using Kconfig macros that can be set in a defconfig or selected during a config step. This allows a voltage domain to be configured/set to a corresponding voltage value depending on the OPP selection choice.

The Kconfig choices have been added for MPU, DSPEVE, IVA and GPU voltage domains, with the MPU domain restricted to OPP_NOM. The OPP_OD and OPP_HIGH options will be added when the support for configuring the MPU clock frequency is added. The clock configuration for other voltage domains is out of scope in u-boot code.

The CORE voltage domain does not have separate voltage values and efuse register offset at different OPPs, while the MPU voltage domain only has different efuse register offsets for different OPPs, but uses the same voltage value. Any different choices of OPPs for voltage domains on common ganged-rails is automatically taken care to select the corresponding highest OPP voltage value.

Quoted 2 lines
Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161123/48169420/attachment.sig>
#6 lore raw

PATCH v2 2/3 ARM: DRA7: Redefine voltage and efuse macros per OPP using Kconfig

In reply to Lokesh Vutla
Quoted 24 lines · Lokesh Vutla

From: Suman Anna <[email protected]>

Redefine the macros used to define the voltage values and the efuse register offsets based on OPP for all the voltage domains. This is done using Kconfig macros that can be set in a defconfig or selected during a config step. This allows a voltage domain to be configured/set to a corresponding voltage value depending on the OPP selection choice.

The Kconfig choices have been added for MPU, DSPEVE, IVA and GPU voltage domains, with the MPU domain restricted to OPP_NOM. The OPP_OD and OPP_HIGH options will be added when the support for configuring the MPU clock frequency is added. The clock configuration for other voltage domains is out of scope in u-boot code.

The CORE voltage domain does not have separate voltage values and efuse register offset at different OPPs, while the MPU voltage domain only has different efuse register offsets for different OPPs, but uses the same voltage value. Any different choices of OPPs for voltage domains on common ganged-rails is automatically taken care to select the corresponding highest OPP voltage value.

Quoted 3 lines

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: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161204/c6b7213c/attachment.sig>
#7 lore raw

PATCH v2 3/3 ARM: DRA7: Fixup DSPEVE, IVA and GPU clock frequencies based on OPP

In reply to Lokesh Vutla

From: Suman Anna <[email protected]>

This patch adds support to update the device-tree blob to adjust the DSP and IVA DPLL clocks pertinent to the selected OPP choice, with the default being OPP_NOM. The voltage settings are done in u-boot, but the actual clock configuration itself is done in kernel because of the following reasons:
1. SoC definition constraints us to NOT to do dynamic voltage scaling ever after the initial avs0 setting in bootloader
- so the voltage must be set in bootloader.
2. The voltage level must be set even if the IP blocks like GPU/DSP are unused.
3. The IVA, GPU and DSP DPLLs are not essential for u-boot functionality, and similar DPLL clock configuration code has been cleaned up in v2014.10 u-boot release. See commit, 02c41535b6a4 ("ARM: OMAP4/5:
Remove dead code against CONFIG_SYS_CLOCKS_ENABLE_ALL").

The non-essential DPLLs are configured within the kernel during the clock init step when parsing the device tree and creating the clock devices. This approach meets both the u-boot and kernel needs.

---
 arch/arm/mach-omap2/omap5/fdt.c | 136 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 136 insertions(+)
arch/arm/mach-omap2/omap5/fdt.c +136 -0
index da8d59b..1cc516c 100644
@@ -233,6 +233,141 @@ static void ft_hs_fixups(void *fdt, bd_t *bd)
 }
 #endif /* #ifdef CONFIG_TI_SECURE_DEVICE */
 
+#if defined(CONFIG_TARGET_DRA7XX_EVM) || defined(CONFIG_TARGET_AM57XX_EVM)
+#define OPP_DSP_CLK_NUM	3
+#define OPP_IVA_CLK_NUM	2
+#define OPP_GPU_CLK_NUM	2
+
+const char *dra7_opp_dsp_clk_names[OPP_DSP_CLK_NUM] = {
+	"dpll_dsp_ck",
+	"dpll_dsp_m2_ck",
+	"dpll_dsp_m3x2_ck",
+};
+
+const char *dra7_opp_iva_clk_names[OPP_IVA_CLK_NUM] = {
+	"dpll_iva_ck",
+	"dpll_iva_m2_ck",
+};
+
+const char *dra7_opp_gpu_clk_names[OPP_GPU_CLK_NUM] = {
+	"dpll_gpu_ck",
+	"dpll_gpu_m2_ck",
+};
+
+/* DSPEVE voltage domain */
+u32 dra7_opp_dsp_clk_rates[NUM_OPPS][OPP_DSP_CLK_NUM] = {
+	{}, /*OPP_LOW */
+	{600000000, 600000000, 400000000}, /* OPP_NOM */
+	{700000000, 700000000, 466666667}, /* OPP_OD */
+	{750000000, 750000000, 500000000}, /* OPP_HIGH */
+};
+
+/* IVA voltage domain */
+u32 dra7_opp_iva_clk_rates[NUM_OPPS][OPP_IVA_CLK_NUM] = {
+	{}, /* OPP_LOW */
+	{1165000000, 388333334}, /* OPP_NOM */
+	{860000000, 430000000}, /* OPP_OD */
+	{1064000000, 532000000}, /* OPP_HIGH */
+};
+
+/* GPU voltage domain */
+u32 dra7_opp_gpu_clk_rates[NUM_OPPS][OPP_GPU_CLK_NUM] = {
+	{}, /* OPP_LOW */
+	{1277000000, 425666667}, /* OPP_NOM */
+	{1000000000, 500000000}, /* OPP_OD */
+	{1064000000, 532000000}, /* OPP_HIGH */
+};
+
+static int ft_fixup_clocks(void *fdt, const char **names, u32 *rates, int num)
+{
+	int offs, node_offs, ret, i;
+	uint32_t phandle;
+
+	offs = fdt_path_offset(fdt, "/ocp/l4 at 4a000000/cm_core_aon at 5000/clocks");
+	if (offs < 0) {
+		debug("Could not find cm_core_aon clocks node path offset : %s\n",
+		      fdt_strerror(offs));
+		return offs;
+	}
+
+	for (i = 0; i < num; i++) {
+		node_offs = fdt_subnode_offset(fdt, offs, names[i]);
+		if (node_offs < 0) {
+			debug("Could not find clock sub-node %s: %s\n",
+			      names[i], fdt_strerror(node_offs));
+			return offs;
+		}
+
+		phandle = fdt_get_phandle(fdt, node_offs);
+		if (!phandle) {
+			debug("Could not find phandle for clock %s\n",
+			      names[i]);
+			return -1;
+		}
+
+		ret = fdt_setprop_u32(fdt, node_offs, "assigned-clocks",
+				      phandle);
+		if (ret < 0) {
+			debug("Could not add assigned-clocks property to clock node %s: %s\n",
+			      names[i], fdt_strerror(ret));
+			return ret;
+		}
+
+		ret = fdt_setprop_u32(fdt, node_offs, "assigned-clock-rates",
+				      rates[i]);
+		if (ret < 0) {
+			debug("Could not add assigned-clock-rates property to clock node %s: %s\n",
+			      names[i], fdt_strerror(ret));
+			return ret;
+		}
+	}
+
+	return 0;
+}
+
+static void ft_opp_clock_fixups(void *fdt, bd_t *bd)
+{
+	const char **clk_names;
+	u32 *clk_rates;
+	int ret;
+
+	if (!is_dra72x() && !is_dra7xx())
+		return;
+
+	/* fixup DSP clocks */
+	clk_names = dra7_opp_dsp_clk_names;
+	clk_rates = dra7_opp_dsp_clk_rates[get_voltrail_opp(VOLT_EVE)];
+	ret = ft_fixup_clocks(fdt, clk_names, clk_rates, OPP_DSP_CLK_NUM);
+	if (ret) {
+		printf("ft_fixup_clocks failed for DSP voltage domain: %s\n",
+		       fdt_strerror(ret));
+		return;
+	}
+
+	/* fixup IVA clocks */
+	clk_names = dra7_opp_iva_clk_names;
+	clk_rates = dra7_opp_iva_clk_rates[get_voltrail_opp(VOLT_IVA)];
+	ret = ft_fixup_clocks(fdt, clk_names, clk_rates, OPP_IVA_CLK_NUM);
+	if (ret) {
+		printf("ft_fixup_clocks failed for IVA voltage domain: %s\n",
+		       fdt_strerror(ret));
+		return;
+	}
+
+	/* fixup GPU clocks */
+	clk_names = dra7_opp_gpu_clk_names;
+	clk_rates = dra7_opp_gpu_clk_rates[get_voltrail_opp(VOLT_GPU)];
+	ret = ft_fixup_clocks(fdt, clk_names, clk_rates, OPP_GPU_CLK_NUM);
+	if (ret) {
+		printf("ft_fixup_clocks failed for GPU voltage domain: %s\n",
+		       fdt_strerror(ret));
+		return;
+	}
+}
+#else
+static void ft_opp_clock_fixups(void *fdt, bd_t *bd) { }
+#endif /* CONFIG_TARGET_DRA7XX_EVM || CONFIG_TARGET_AM57XX_EVM */
+
 /*
  * Place for general cpu/SoC FDT fixups. Board specific
  * fixups should remain in the board files which is where
@@ -241,4 +376,5 @@ static void ft_hs_fixups(void *fdt, bd_t *bd)
 void ft_cpu_setup(void *fdt, bd_t *bd)
 {
 	ft_hs_fixups(fdt, bd);
+	ft_opp_clock_fixups(fdt, bd);
 }
Signature · 1 line
2.10.1
#8 lore raw

PATCH v2 3/3 ARM: DRA7: Fixup DSPEVE, IVA and GPU clock frequencies based on OPP

Quoted 17 lines · Lokesh Vutla

From: Suman Anna <[email protected]>

This patch adds support to update the device-tree blob to adjust the DSP and IVA DPLL clocks pertinent to the selected OPP choice, with the default being OPP_NOM. The voltage settings are done in u-boot, but the actual clock configuration itself is done in kernel because of the following reasons:
1. SoC definition constraints us to NOT to do dynamic voltage scaling ever after the initial avs0 setting in bootloader
- so the voltage must be set in bootloader.
2. The voltage level must be set even if the IP blocks like GPU/DSP are unused.
3. The IVA, GPU and DSP DPLLs are not essential for u-boot functionality, and similar DPLL clock configuration code has been cleaned up in v2014.10 u-boot release. See commit, 02c41535b6a4 ("ARM: OMAP4/5:
Remove dead code against CONFIG_SYS_CLOCKS_ENABLE_ALL").

Quoted 8 lines

The non-essential DPLLs are configured within the kernel during the clock init step when parsing the device tree and creating the clock devices. This approach meets both the u-boot and kernel needs.

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

PATCH v2 3/3 ARM: DRA7: Fixup DSPEVE, IVA and GPU clock frequencies based on OPP

In reply to Lokesh Vutla
Quoted 22 lines · Lokesh Vutla

From: Suman Anna <[email protected]>

This patch adds support to update the device-tree blob to adjust the DSP and IVA DPLL clocks pertinent to the selected OPP choice, with the default being OPP_NOM. The voltage settings are done in u-boot, but the actual clock configuration itself is done in kernel because of the following reasons:
1. SoC definition constraints us to NOT to do dynamic voltage scaling ever after the initial avs0 setting in bootloader
- so the voltage must be set in bootloader.
2. The voltage level must be set even if the IP blocks like GPU/DSP are unused.
3. The IVA, GPU and DSP DPLLs are not essential for u-boot functionality, and similar DPLL clock configuration code has been cleaned up in v2014.10 u-boot release. See commit, 02c41535b6a4 ("ARM: OMAP4/5:
Remove dead code against CONFIG_SYS_CLOCKS_ENABLE_ALL").

The non-essential DPLLs are configured within the kernel during the clock init step when parsing the device tree and creating the clock devices. This approach meets both the u-boot and kernel needs.

Quoted 4 lines

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: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161204/5d171b3f/attachment.sig>