linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Linux.HWI@garmin.com (J.D. Schroeder)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] DRA7: Fix clock data for gmac_gmii_ref_clk_div
Date: Tue, 26 Apr 2016 12:54:27 -0500	[thread overview]
Message-ID: <1461693269-19436-2-git-send-email-Linux.HWI@garmin.com> (raw)
In-Reply-To: <1461693269-19436-1-git-send-email-Linux.HWI@garmin.com>

From: "J.D. Schroeder" <jay.schroeder@garmin.com>

This commit fixes the clock data inside the DRA7xx clocks device tree
structure for the gmac_gmii_ref_clk_div clock. This clock is actually
the GMAC_MAIN_CLK and has nothing to do with the register at address
0x4a0093d0. If CLKSEL_REF bit 24 inside of CM_GMAC_GMAC_CLKCTRL, is
set to 1 in order to use the GMAC_RMII_CLK instead of the
GMAC_RMII_HS_CLK, the kernel generates a clock divider warning:
    WARNING: CPU: 0 PID: 0 at drivers/clk/clk-divider.c:129 clk_divider_recalc_rate+0xa8/0xe0()
    gmac_gmii_ref_clk_div: Zero divisor and CLK_DIVIDER_ALLOW_ZERO not set

By properly configuring the gmac_gmii_ref_clk_div (GMAC_MAIN_CLK) to
have the parent of dpll_gmac_m2_ck always divided by 2 the warning is
resolved and the clock tree is fixed up.

Additionally, a new clock called rmii_50mhz_clk_mux is defined that
does utilize CM_GMAC_GMAC_CLKCTRL[24] CLKSEL_REF to configure the
source clock for the RMII_50MHZ_CLK.

Signed-off-by: J.D. Schroeder <jay.schroeder@garmin.com>
Reviewed-by: Trenton Andres <trenton.andres@garmin.com>
---
 arch/arm/boot/dts/dra7xx-clocks.dtsi | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/dra7xx-clocks.dtsi b/arch/arm/boot/dts/dra7xx-clocks.dtsi
index d0bae06..9d1a583 100644
--- a/arch/arm/boot/dts/dra7xx-clocks.dtsi
+++ b/arch/arm/boot/dts/dra7xx-clocks.dtsi
@@ -1710,13 +1710,20 @@
 		reg = <0x0c00>;
 	};
 
-	gmac_gmii_ref_clk_div: gmac_gmii_ref_clk_div {
+	rmii_50mhz_clk_mux: rmii_50mhz_clk_mux {
 		#clock-cells = <0>;
-		compatible = "ti,divider-clock";
-		clocks = <&dpll_gmac_m2_ck>;
+		compatible = "ti,mux-clock";
+		clocks = <&dpll_gmac_h11x2_ck>, <&rmii_clk_ck>;
 		ti,bit-shift = <24>;
 		reg = <0x13d0>;
-		ti,dividers = <2>;
+	};
+
+	gmac_gmii_ref_clk_div: gmac_gmii_ref_clk_div {
+		#clock-cells = <0>;
+		compatible = "fixed-factor-clock";
+		clocks = <&dpll_gmac_m2_ck>;
+		clock-mult = <1>;
+		clock-div = <2>;
 	};
 
 	gmac_rft_clk_mux: gmac_rft_clk_mux {
-- 
1.9.1

  reply	other threads:[~2016-04-26 17:54 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-26 17:54 [PATCH 0/3] AM57/DRA7 Clock Tree DTSI Fix-ups J.D. Schroeder
2016-04-26 17:54 ` J.D. Schroeder [this message]
2016-04-27 11:21   ` [PATCH 1/3] DRA7: Fix clock data for gmac_gmii_ref_clk_div Tero Kristo
2016-04-27 16:36     ` Tony Lindgren
2016-04-27 17:16       ` Tony Lindgren
2016-05-02 17:12         ` [PATCH v2 0/3] AM57/DRA7 Clock Tree DTSI Fix-ups J.D. Schroeder
2016-05-02 17:12           ` [PATCH v2 1/3] DRA7: Fix clock data for gmac_gmii_ref_clk_div J.D. Schroeder
2016-05-02 17:12           ` [PATCH v2 2/3] ARM: DRA7x: dts: Update the OSC_32K_CLK frequency J.D. Schroeder
2016-05-03  8:16             ` Tero Kristo
2016-05-03 13:31               ` J.D. Schroeder
2016-05-03 16:43                 ` Tony Lindgren
2016-05-03 17:32                   ` Tero Kristo
2016-05-03 17:49                     ` J.D. Schroeder
2016-05-03 18:08                       ` Tony Lindgren
2016-05-03 18:08                       ` Tero Kristo
2016-05-03 23:17                         ` Nishanth Menon
2016-05-04 14:09                     ` Matthijs van Duin
2016-05-02 17:12           ` [PATCH v2 3/3] ARM: dts: dra7: fix clock node definition to avoid build warning J.D. Schroeder
2016-05-03  4:20           ` [PATCH v2 0/3] AM57/DRA7 Clock Tree DTSI Fix-ups Lokesh Vutla
2016-04-26 17:54 ` [PATCH 2/3] ARM: DRA7x: dts: Fix the 32kHz clock calculation J.D. Schroeder
2016-04-27 11:40   ` Tero Kristo
2016-04-27 14:06     ` J.D. Schroeder
2016-04-27 19:47       ` Tero Kristo
2016-04-27 20:13         ` J.D. Schroeder
2016-04-26 17:54 ` [PATCH 3/3] ARM: DRA7x: dts: Update the OSC_32K_CLK frequency J.D. Schroeder
2016-04-27 11:49   ` Tero Kristo
2016-04-27 14:20     ` J.D. Schroeder
2016-04-26 18:13 ` [PATCH 0/3] AM57/DRA7 Clock Tree DTSI Fix-ups Tony Lindgren
2016-04-26 19:18   ` J.D. Schroeder

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=1461693269-19436-2-git-send-email-Linux.HWI@garmin.com \
    --to=linux.hwi@garmin.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).