public inbox for linux-clk@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Stefan Wahren <stefan.wahren@i2se.com>
Cc: Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Abel Vesa <abelvesa@kernel.org>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Michael Heimpold <mhei@heimpold.de>,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: imx6ul: Recent enet refclock changes breaks custom i.mx6ull board
Date: Tue, 7 Mar 2023 07:06:28 +0100	[thread overview]
Message-ID: <20230307060628.GC11936@pengutronix.de> (raw)
In-Reply-To: <a1646cc8-0830-5add-2957-b9bdbb094b23@i2se.com>

Hi Stefan,

On Mon, Mar 06, 2023 at 04:50:18PM +0100, Stefan Wahren wrote:
> Did you noticed that the error is caused for enet2_ref_sel?
> 
> On our board variants master/slave/slaveXT only ENET1 is used, so ENET2 is
> kept to the defaults (ENET2_TX_CLK_DIR = 0, ENET2_CLK_SEL = 0) and the
> bootloader won't touch those bits.

Ok, i see. It makes sense.

> > With this bits we have following variants:
> > 1. internal clock source with output on ENET1_TX_CLK
> > 2. internal clock source without output on ENET1_TX_CLK. Are there any
> >     use cases need to support this mode?
> After reading the reference manual, this mode refers to ENET1_TX_CLK_DIR =
> 0, ENET1_CLK_SEL = 0. Is my understanding correct?
> > 3. external clock source without output on ENET1_TX_CLK
> > 4. external clock source with output on ENET1_TX_CLK, well ENET1_TX_CLK
> >     is input it can't be out put on this case.
> > 
> > Current kernel supports modes 1 and 3. For mode 2 I do not have a use
> > case and mode 4 make no sense.
> > 
> > In your case, the boot loader configures clocks to mode 2 which is not
> > correct for this HW. It should be mode 1.
> As written above the bootloader doesn't touch this. It's the reset default
> according to the reference manual. So i consider mode 2 as disabled clock,
> which is the right mode for boards without using this particular Ethernet
> interface. For EMC reasons we don't want to enable ENET1 and ENET2 clock
> output unconditionally.
> > Probably, the way to go is do register dummy parents for not supported
> > modes. It would silent the kernel. Other ideas?
> 
> Sorry, i don't have no idea how to properly achieve this.

can you please test this patch:

diff --git a/drivers/clk/imx/clk-imx6ul.c b/drivers/clk/imx/clk-imx6ul.c
index 2836adb817b7..e3696a88b5a3 100644
--- a/drivers/clk/imx/clk-imx6ul.c
+++ b/drivers/clk/imx/clk-imx6ul.c
@@ -95,14 +95,16 @@ static const struct clk_div_table video_div_table[] = {
 	{ }
 };
 
-static const char * enet1_ref_sels[] = { "enet1_ref_125m", "enet1_ref_pad", };
+static const char * enet1_ref_sels[] = { "enet1_ref_125m", "enet1_ref_pad", "dummy", "dummy"};
 static const u32 enet1_ref_sels_table[] = { IMX6UL_GPR1_ENET1_TX_CLK_DIR,
-					    IMX6UL_GPR1_ENET1_CLK_SEL };
+					    IMX6UL_GPR1_ENET1_CLK_SEL, 0,
+					    IMX6UL_GPR1_ENET1_TX_CLK_DIR | IMX6UL_GPR1_ENET1_CLK_SEL };
 static const u32 enet1_ref_sels_table_mask = IMX6UL_GPR1_ENET1_TX_CLK_DIR |
 					     IMX6UL_GPR1_ENET1_CLK_SEL;
-static const char * enet2_ref_sels[] = { "enet2_ref_125m", "enet2_ref_pad", };
+static const char * enet2_ref_sels[] = { "enet2_ref_125m", "enet2_ref_pad", "dummy", "dummy"};
 static const u32 enet2_ref_sels_table[] = { IMX6UL_GPR1_ENET2_TX_CLK_DIR,
-					    IMX6UL_GPR1_ENET2_CLK_SEL };
+					    IMX6UL_GPR1_ENET2_CLK_SEL, 0,
+					    IMX6UL_GPR1_ENET2_TX_CLK_DIR | IMX6UL_GPR1_ENET2_CLK_SEL };
 static const u32 enet2_ref_sels_table_mask = IMX6UL_GPR1_ENET2_TX_CLK_DIR |
 					     IMX6UL_GPR1_ENET2_CLK_SEL;
 
Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2023-03-07 10:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-05 22:16 imx6ul: Recent enet refclock changes breaks custom i.mx6ull board Stefan Wahren
2023-03-06  5:25 ` Oleksij Rempel
2023-03-06  9:13   ` Stefan Wahren
2023-03-06  9:47     ` Oleksij Rempel
2023-03-06 13:33       ` Stefan Wahren
2023-03-06 14:02         ` Oleksij Rempel
2023-03-06 15:50           ` Stefan Wahren
2023-03-07  6:06             ` Oleksij Rempel [this message]
2023-03-08 15:11               ` Stefan Wahren
2023-03-09 16:59                 ` Stefan Wahren

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=20230307060628.GC11936@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=abelvesa@kernel.org \
    --cc=arnd@arndb.de \
    --cc=festevam@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=mhei@heimpold.de \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=stefan.wahren@i2se.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