Skip to contentSkip to conversation

Two non-urgent ti-sysc driver fixes

PATCH In review Tony Lindgren 1 participant 4 messages Nov 15, 2018

Subsystems (2)
lore
Share & tools
lore

Tony Lindgren

author maintainer
#0 lore raw

cover Two non-urgent ti-sysc driver fixes

Hi,

Here are two fixes for ti-sysc for issues I've noticed while testing on more SoCs. Looks like these can wait until v4.21 merge window.

Regards,

Tony

Tony Lindgren (2):
bus: ti-sysc: Fix getting optional clocks in clock_roles
bus: ti-sysc: Add mcasp optional clocks flag

 .../devicetree/bindings/bus/ti-sysc.txt       |  1 +
 drivers/bus/ti-sysc.c                         | 20 +++++++++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)
Signature · 1 line
2.19.1
author maintainer
#1 lore raw

PATCH 1/2 bus: ti-sysc: Fix getting optional clocks in clock_roles

We can have holes in clock_roles with interface clock missing for example. Currently getting an optional clock will fail if there are only a functional clock and an optional clock.

Fixes 09dfe5810762 ("bus: ti-sysc: Add handling for clkctrl opt clocks")
---
 drivers/bus/ti-sysc.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/bus/ti-sysc.c +7 -2
@@ -214,8 +214,13 @@ static int sysc_get_clocks(struct sysc *ddata)
 	if (!ddata->clocks)
 		return -ENOMEM;
 
-	for (i = 0; i < ddata->nr_clocks; i++) {
-		error = sysc_get_one_clock(ddata, ddata->clock_roles[i]);
+	for (i = 0; i < SYSC_MAX_CLOCKS; i++) {
+		const char *name = ddata->clock_roles[i];
+
+		if (!name)
+			continue;
+
+		error = sysc_get_one_clock(ddata, name);
 		if (error && error != -ENOENT)
 			return error;
 	}
Signature · 1 line
2.19.1
author maintainer
#2 lore raw

PATCH 2/2 bus: ti-sysc: Add mcasp optional clocks flag

In reply to Tony Lindgren

We have OPT_CLKS_NEEDED in legacy platform data, but it's missing from the ti-sysc driver for device tree based configuration.

In order to pass OPT_CLKS_NEEDED quirk flag we need to update omap4 module data and add a new compatible for dra7 as the module layout is different from sysc_regbits_omap4_mcasp.

Fixes 70a65240efb1 ("bus: ti-sysc: Add register bits for interconnect

target modules")

Cc Mark Rutland <[email protected]>
Cc Rob Herring <[email protected]>
---
 Documentation/devicetree/bindings/bus/ti-sysc.txt |  1 +
 drivers/bus/ti-sysc.c                             | 11 +++++++++++
 2 files changed, 12 insertions(+)
Documentation/devicetree/bindings/bus/ti-sysc.txt +1 -0
@@ -35,6 +35,7 @@ Required standard properties:
 		"ti,sysc-omap3-sham"
 		"ti,sysc-omap-aes"
 		"ti,sysc-mcasp"
+		"ti,sysc-dra7-mcasp"
 		"ti,sysc-usb-host-fs"
 		"ti,sysc-dra7-mcan"
 
drivers/bus/ti-sysc.c +11 -0
@@ -1503,6 +1503,16 @@ static const struct sysc_regbits sysc_regbits_omap4_mcasp = {
 static const struct sysc_capabilities sysc_omap4_mcasp = {
 	.type = TI_SYSC_OMAP4_MCASP,
 	.regbits = &sysc_regbits_omap4_mcasp,
+	.mod_quirks = SYSC_QUIRK_OPT_CLKS_NEEDED,
+};
+
+/*
+ * McASP found on dra7 and later
+ */
+static const struct sysc_capabilities sysc_dra7_mcasp = {
+	.type = TI_SYSC_OMAP4_SIMPLE,
+	.regbits = &sysc_regbits_omap4_simple,
+	.mod_quirks = SYSC_QUIRK_OPT_CLKS_NEEDED,
 };
 
 /*
@@ -1731,6 +1741,7 @@ static const struct of_device_id sysc_match[] = {
 	{ .compatible = "ti,sysc-omap3-sham", .data = &sysc_omap3_sham, },
 	{ .compatible = "ti,sysc-omap-aes", .data = &sysc_omap3_aes, },
 	{ .compatible = "ti,sysc-mcasp", .data = &sysc_omap4_mcasp, },
+	{ .compatible = "ti,sysc-dra7-mcasp", .data = &sysc_dra7_mcasp, },
 	{ .compatible = "ti,sysc-usb-host-fs",
 	  .data = &sysc_omap4_usb_host_fs, },
 	{ .compatible = "ti,sysc-dra7-mcan", .data = &sysc_dra7_mcan, },
Signature · 1 line
2.19.1
author maintainer
#3 lore raw

Re: [PATCH 2/2] bus: ti-sysc: Add mcasp optional clocks flag

Quoted 6 lines · Tony Lindgren

We have OPT_CLKS_NEEDED in legacy platform data, but it's missing from the ti-sysc driver for device tree based configuration.

In order to pass OPT_CLKS_NEEDED quirk flag we need to update omap4 module data and add a new compatible for dra7 as the module layout is different from sysc_regbits_omap4_mcasp.

And below is the related dts change for dra7.

Regards,

Tony

8< -----------------

Quoted 1 line

From tony Mon Sep 17 00:00:00 2001

From: Tony Lindgren <[email protected]>
Date: Wed, 31 Oct 2018 09:02:18 -0700
Subject: [PATCH] ARM: dts: Use dra7 mcasp compatible for mcasp instances

Looks like dra7 needs optional clocks enabled for mcasp unlike am33xx and am437x do.

---
 arch/arm/boot/dts/dra7-l4.dtsi | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm/boot/dts/dra7-l4.dtsi +8 -8
@@ -2718,7 +2718,7 @@
 		};
 
 		target-module at 60000 {			/* 0x48460000, ap 9 0e.0 */
-			compatible = "ti,sysc-omap4-simple", "ti,sysc";
+			compatible = "ti,sysc-dra7-mcasp", "ti,sysc";
 			ti,hwmods = "mcasp1";
 			reg = <0x60000 0x4>,
 			      <0x60004 0x4>;
@@ -2752,7 +2752,7 @@
 		};
 
 		target-module at 64000 {			/* 0x48464000, ap 11 1e.0 */
-			compatible = "ti,sysc-omap4-simple", "ti,sysc";
+			compatible = "ti,sysc-dra7-mcasp", "ti,sysc";
 			ti,hwmods = "mcasp2";
 			reg = <0x64000 0x4>,
 			      <0x64004 0x4>;
@@ -2786,7 +2786,7 @@
 		};
 
 		target-module at 68000 {			/* 0x48468000, ap 13 26.0 */
-			compatible = "ti,sysc-omap4-simple", "ti,sysc";
+			compatible = "ti,sysc-dra7-mcasp", "ti,sysc";
 			ti,hwmods = "mcasp3";
 			reg = <0x68000 0x4>,
 			      <0x68004 0x4>;
@@ -2819,7 +2819,7 @@
 		};
 
 		target-module at 6c000 {			/* 0x4846c000, ap 15 2e.0 */
-			compatible = "ti,sysc-omap4-simple", "ti,sysc";
+			compatible = "ti,sysc-dra7-mcasp", "ti,sysc";
 			ti,hwmods = "mcasp4";
 			reg = <0x6c000 0x4>,
 			      <0x6c004 0x4>;
@@ -2852,7 +2852,7 @@
 		};
 
 		target-module at 70000 {			/* 0x48470000, ap 19 36.0 */
-			compatible = "ti,sysc-omap4-simple", "ti,sysc";
+			compatible = "ti,sysc-dra7-mcasp", "ti,sysc";
 			ti,hwmods = "mcasp5";
 			reg = <0x70000 0x4>,
 			      <0x70004 0x4>;
@@ -2885,7 +2885,7 @@
 		};
 
 		target-module at 74000 {			/* 0x48474000, ap 35 14.0 */
-			compatible = "ti,sysc-omap4-simple", "ti,sysc";
+			compatible = "ti,sysc-dra7-mcasp", "ti,sysc";
 			ti,hwmods = "mcasp6";
 			reg = <0x74000 0x4>,
 			      <0x74004 0x4>;
@@ -2918,7 +2918,7 @@
 		};
 
 		target-module at 78000 {			/* 0x48478000, ap 39 0c.0 */
-			compatible = "ti,sysc-omap4-simple", "ti,sysc";
+			compatible = "ti,sysc-dra7-mcasp", "ti,sysc";
 			ti,hwmods = "mcasp7";
 			reg = <0x78000 0x4>,
 			      <0x78004 0x4>;
@@ -2951,7 +2951,7 @@
 		};
 
 		target-module at 7c000 {			/* 0x4847c000, ap 43 04.0 */
-			compatible = "ti,sysc-omap4-simple", "ti,sysc";
+			compatible = "ti,sysc-dra7-mcasp", "ti,sysc";
 			ti,hwmods = "mcasp8";
 			reg = <0x7c000 0x4>,
 			      <0x7c004 0x4>;
Signature · 1 line
2.19.1