All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: "Ondřej Jirman" <megi@xff.cz>
To: u-boot@lists.denx.de
Cc: Ondrej Jirman <megi@xff.cz>, Lukasz Majewski <lukma@denx.de>,
	Sean Anderson <seanga2@gmail.com>,
	Michal Simek <michal.simek@amd.com>,
	Tom Rini <trini@konsulko.com>,
	Igor Prusov <ivprusov@sberdevices.ru>
Subject: [PATCH] clk: zynq: Fix EMIO clock use detection for gem0
Date: Tue, 16 Apr 2024 10:44:54 +0200	[thread overview]
Message-ID: <20240416084456.2821567-1-megi@xff.cz> (raw)

From: Ondrej Jirman <megi@xff.cz>

According to TRM, the bit that differentiates between MIO and EMIO
clocks is bit 6. This resolves failure to set clock when using EMIO
clock for ethernet.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
 drivers/clk/clk_zynq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk_zynq.c b/drivers/clk/clk_zynq.c
index e3cefe2e0c72..78e6886a000c 100644
--- a/drivers/clk/clk_zynq.c
+++ b/drivers/clk/clk_zynq.c
@@ -42,6 +42,8 @@
 #define CLK_CTRL_DIV3X_SHIFT	20
 #define CLK_CTRL_DIV3X_MASK	(ZYNQ_CLK_MAXDIV << CLK_CTRL_DIV3X_SHIFT)
 
+#define CLK_CTRL_GEM_EMIO	(1u << 6)
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifndef CONFIG_SPL_BUILD
@@ -161,7 +163,7 @@ static enum zynq_clk_rclk zynq_clk_get_gem_rclk(enum zynq_clk id)
 	else
 		clk_ctrl = readl(&slcr_base->gem1_rclk_ctrl);
 
-	srcsel = (clk_ctrl & CLK_CTRL_SRCSEL_MASK) >> CLK_CTRL_SRCSEL_SHIFT;
+	srcsel = (clk_ctrl & CLK_CTRL_GEM_EMIO);
 	if (srcsel)
 		return emio_clk;
 	else
-- 
2.44.0


             reply	other threads:[~2024-04-16  8:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16  8:44 Ondřej Jirman [this message]
2024-04-24 14:34 ` [PATCH] clk: zynq: Fix EMIO clock use detection for gem0 Michal Simek
2024-04-25  8:23   ` Ondřej Jirman
2024-04-25  8:44     ` Ondřej Jirman
2024-04-25 10:59     ` Michal Simek
2024-04-25 15:18       ` Ondřej Jirman
2024-04-29  8:59         ` Michal Simek

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=20240416084456.2821567-1-megi@xff.cz \
    --to=megi@xff.cz \
    --cc=ivprusov@sberdevices.ru \
    --cc=lukma@denx.de \
    --cc=michal.simek@amd.com \
    --cc=seanga2@gmail.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.