devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: linux-omap@vger.kernel.org
Cc: "Benoît Cousson" <bcousson@baylibre.com>,
	devicetree@vger.kernel.org, linux-clk@vger.kernel.org,
	"Graeme Smecher" <gsmecher@threespeedlogic.com>,
	"Grygorii Strashko" <grygorii.strashko@ti.com>,
	"Michael Turquette" <mturquette@baylibre.com>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Tero Kristo" <t-kristo@ti.com>,
	"Brian Hutchinson" <b.hutchman@gmail.com>,
	"Peter Ujfalusi" <peter.ujfalusi@ti.com>
Subject: [PATCH 01/10] clk: ti: Fix dm814x clkctrl for ethernet
Date: Tue, 10 Mar 2020 11:34:55 -0700	[thread overview]
Message-ID: <20200310183504.65358-2-tony@atomide.com> (raw)
In-Reply-To: <20200310183504.65358-1-tony@atomide.com>

We are missing alwon ethernet clock for dm814x and this prevents us
from probing the CPSW with device tree only data. Looks like Ethernet
currently only works if it has been enabled in the bootloader.

Looks like relying on the bootloader clocks is not an issue with the
mainline kernel currently, but it will be an issue when configuring
CPSW Ethernet to probe with device tree data only as we will be managing
the clocks.

Fixes: 26ca2e973844 ("clk: ti: dm814: add clkctrl clock data")
Cc: linux-clk@vger.kernel.org
Cc: Graeme Smecher <gsmecher@threespeedlogic.com>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---

Stephen & Tero, can you guys please ack if this patch looks OK?

---
 arch/arm/boot/dts/dm814x-clocks.dtsi | 14 ++++++++++++++
 drivers/clk/ti/clk-814x.c            |  7 ++++++-
 include/dt-bindings/clock/dm814.h    |  5 +++++
 3 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/dm814x-clocks.dtsi b/arch/arm/boot/dts/dm814x-clocks.dtsi
--- a/arch/arm/boot/dts/dm814x-clocks.dtsi
+++ b/arch/arm/boot/dts/dm814x-clocks.dtsi
@@ -362,4 +362,18 @@ alwon_clkctrl: clk@0 {
 			#clock-cells = <2>;
 		};
 	};
+
+	alwon_ethernet_cm: alwon_ethernet_cm@15d4 {
+		compatible = "ti,omap4-cm";
+		reg = <0x15d4 0x4>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0 0x15d4 0x4>;
+
+		alwon_ethernet_clkctrl: clk@0 {
+			compatible = "ti,clkctrl";
+			reg = <0 0x4>;
+			#clock-cells = <2>;
+		};
+	};
 };
diff --git a/drivers/clk/ti/clk-814x.c b/drivers/clk/ti/clk-814x.c
--- a/drivers/clk/ti/clk-814x.c
+++ b/drivers/clk/ti/clk-814x.c
@@ -25,7 +25,6 @@ static const struct omap_clkctrl_reg_data dm814_alwon_clkctrl_regs[] __initconst
 	{ DM814_WD_TIMER_CLKCTRL, NULL, CLKF_SW_SUP | CLKF_NO_IDLEST, "sysclk18_ck" },
 	{ DM814_MCSPI1_CLKCTRL, NULL, CLKF_SW_SUP, "sysclk10_ck" },
 	{ DM814_GPMC_CLKCTRL, NULL, CLKF_SW_SUP, "sysclk6_ck" },
-	{ DM814_CPGMAC0_CLKCTRL, NULL, CLKF_SW_SUP, "cpsw_125mhz_gclk" },
 	{ DM814_MPU_CLKCTRL, NULL, CLKF_SW_SUP, "mpu_ck" },
 	{ DM814_RTC_CLKCTRL, NULL, CLKF_SW_SUP | CLKF_NO_IDLEST, "sysclk18_ck" },
 	{ DM814_TPCC_CLKCTRL, NULL, CLKF_SW_SUP, "sysclk4_ck" },
@@ -39,9 +38,15 @@ static const struct omap_clkctrl_reg_data dm814_alwon_clkctrl_regs[] __initconst
 	{ 0 },
 };
 
+static const struct
+omap_clkctrl_reg_data dm814_alwon_ethernet_clkctrl_regs[] __initconst = {
+	{ 0, NULL, CLKF_SW_SUP, "cpsw_125mhz_gclk" },
+};
+
 const struct omap_clkctrl_data dm814_clkctrl_data[] __initconst = {
 	{ 0x48180500, dm814_default_clkctrl_regs },
 	{ 0x48181400, dm814_alwon_clkctrl_regs },
+	{ 0x481815d4, dm814_alwon_ethernet_clkctrl_regs },
 	{ 0 },
 };
 
diff --git a/include/dt-bindings/clock/dm814.h b/include/dt-bindings/clock/dm814.h
--- a/include/dt-bindings/clock/dm814.h
+++ b/include/dt-bindings/clock/dm814.h
@@ -34,4 +34,9 @@
 #define DM814_MMC2_CLKCTRL	DM814_CLKCTRL_INDEX(0x220)
 #define DM814_MMC3_CLKCTRL	DM814_CLKCTRL_INDEX(0x224)
 
+/* alwon_ethernet clocks */
+#define DM814_ETHERNET_CLKCTRL_OFFSET	0x1d4
+#define DM814_ETHERNET_CLKCTRL_INDEX(offset)	((offset) - DM814_ETHERNET_CLKCTRL_OFFSET)
+#define DM814_ETHERNET_CPGMAC0_CLKCTRL	DM814_ETHERNET_CLKCTRL_INDEX(0x1d4)
+
 #endif
-- 
2.25.1

  reply	other threads:[~2020-03-10 18:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-10 18:34 [PATCH 00/10] Complete updating CPSW and EDMA to probe with dts Tony Lindgren
2020-03-10 18:34 ` Tony Lindgren [this message]
2020-03-10 18:34 ` [PATCH 02/10] ARM: dts: Configure interconnect target module for dm814x cpsw Tony Lindgren
2020-03-10 18:34 ` [PATCH 03/10] ARM: OMAP2+: Drop legacy platform data " Tony Lindgren
2020-03-10 18:34 ` [PATCH 04/10] ARM: dts: Configure interconnect target module for dm814x tpcc Tony Lindgren
2020-03-10 18:34 ` [PATCH 05/10] ARM: dts: Configure interconnect target module for dm814x tptc0 Tony Lindgren
2020-03-10 18:35 ` [PATCH 06/10] ARM: dts: Configure interconnect target module for dm814x tptc1 Tony Lindgren
2020-03-10 18:35 ` [PATCH 07/10] ARM: dts: Configure interconnect target module for dm814x tptc2 Tony Lindgren
2020-03-10 18:35 ` [PATCH 08/10] ARM: dts: Configure interconnect target module for dm814x tptc3 Tony Lindgren
2020-03-10 18:35 ` [PATCH 09/10] ARM: dts: Configure interconnect target module for ti816x edma Tony Lindgren
2020-03-10 18:35 ` [PATCH 10/10] ARM: OMAP2+: Drop legacy platform data for ti81xx edma Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200310183504.65358-2-tony@atomide.com \
    --to=tony@atomide.com \
    --cc=b.hutchman@gmail.com \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=grygorii.strashko@ti.com \
    --cc=gsmecher@threespeedlogic.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=sboyd@kernel.org \
    --cc=t-kristo@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).