| Message ID | 20240707082001.20746-2-michael@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path:
<linux-amarula+bncBCXK73FY3AFRBOM7VG2AMGQE3ODP6UA@amarulasolutions.com>
X-Original-To: linux-amarula@patchwork.amarulasolutions.com
Delivered-To: linux-amarula@patchwork.amarulasolutions.com
Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com
[209.85.208.71])
by ganimede.amarulasolutions.com (Postfix) with ESMTPS id F3BDA3FA22
for <linux-amarula@patchwork.amarulasolutions.com>;
Sun, 7 Jul 2024 10:20:09 +0200 (CEST)
Received: by mail-ed1-f71.google.com with SMTP id
4fb4d7f45d1cf-57851ae6090sf2641771a12.3
for <linux-amarula@patchwork.amarulasolutions.com>;
Sun, 07 Jul 2024 01:20:09 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1720340409; cv=pass;
d=google.com; s=arc-20160816;
b=sgKe1gCXLj4KRrwrhEb9/pXh9yF8LhPa2fOQoG4sxd4+UXw0gBfv0u/NnqpFrzC3nV
zCAT6CMzDXrlUSkD5Leb5T79fYb6+xE8KMe/9roka1kGuyVte8Hz3GtNbwpD8P6RPG06
XONB76Q9y87rOIil3xdDsh/ug4frMAM/o131lZg+6YR+ACANDG0yMEeZlbP0T5vJHBW1
cetDehiA91FQ4t/jxr05kzFU3r0NYjFpQxC4u23SkJC23Lp+EcYi+KmXsP2Db30OBsiw
OsGCgZtNe7aobygbDYVXMRofxgAL8E7E0WI5pP/p8pdFnxzb1COHRgvyaAo3jjhieg2c
DsZQ==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20160816;
h=list-unsubscribe:list-archive:list-help:list-post:list-id
:mailing-list:precedence:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:dkim-signature;
bh=7/5J050ySnLHJQ7KDtfTRML36AUqcRoWHq6EjO2jgUo=;
fh=jp6bbIYtuFpSa+VoyXdXoEXj849Ru2C8OBy1R/YepE0=;
b=vkECnNUdPppN1deqpL8//wKmEmyUuYNaG9Aubi5s0qq+8Qx+LfbDqKnlyXT9XW0hjC
gHQeaSTb/8UEcBKKvsbl0FZAx7SM9GO774YTcWTaSqBELGa7nHOU7+QryO31Wfz1rME7
DZNCDSNzP3l0KO9+MZkz1oyktRCfMjmhbUfLKnAcaCXz61Pbls8mTGoYcQG47TeHjWL1
DN7xY2IjpOpBWmYhmS+DVWU0RKc5HgBNYNMYO5yr8aVsb55bpXHjggnOyDc3lwDhjSSJ
erIq//GNjj9TcESIRtn4CIY+KIYwdmSkTLl5JZfAo8CyN5o1CPglqonwkdO15pNo1xtn
aHKg==;
darn=patchwork.amarulasolutions.com
ARC-Authentication-Results: i=2; mx.google.com;
dkim=pass header.i=@amarulasolutions.com header.s=google
header.b=KMkfUlAG;
spf=pass (google.com: domain of michael@amarulasolutions.com designates
209.85.220.41 as permitted sender)
smtp.mailfrom=michael@amarulasolutions.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com;
dara=pass header.i=@amarulasolutions.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=amarulasolutions.com; s=google; t=1720340409; x=1720945209;
darn=patchwork.amarulasolutions.com;
h=list-unsubscribe:list-archive:list-help:list-post:list-id
:mailing-list:precedence:x-original-authentication-results
:x-original-sender:mime-version:references:in-reply-to:message-id
:date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
bh=7/5J050ySnLHJQ7KDtfTRML36AUqcRoWHq6EjO2jgUo=;
b=g/LrJTaa4JpQn8i8lLj4jI914fjt7EjIWeN4wbYPNBgGXgO84HfUdYS/uEPQo8Ypwh
xKgtQETluKbE60bS2qRNAXmc3OpJ+R2mi2OpzHYG4qzXCUa8leJY6oI7jhoNRPyLO/VR
IVrRumiGpu6ZUI3ff42gQsgazg29J0lg9CQgY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1720340409; x=1720945209;
h=list-unsubscribe:list-archive:list-help:list-post
:x-spam-checked-in-group:list-id:mailing-list:precedence
:x-original-authentication-results:x-original-sender:mime-version
:references:in-reply-to:message-id:date:subject:cc:to:from
:x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=7/5J050ySnLHJQ7KDtfTRML36AUqcRoWHq6EjO2jgUo=;
b=OWe6j0D8kFiTfYMCeDMdeRakUeVaVAjAEJlf0JdI03z7roD2zaZb7KW1b+AjoMnn6J
9Qg+b4Ybjd8XSLdnR4DvwKJF0zjhSdA9q5u+jUApn20haja4WVloA/nuOXiW1ywQv9F/
6d2ZQ33yo4L5+WRyhAnAyEzn9BLKv2gnzo1jX9RY6KSbO4rV2xcA7o+CCEHwebOcGM+i
FtURts0g9YBLdCoHlOUQZtQ+useBCnI30yrb3nu+cO6ehTj9vjLudCU6bis/A5jyYU87
H0PJ30ejuAZvETCESQ8LavgZubjx4V5utgE+5jf47fGEVKXAVhhvZYgG0I2HYjLIPKnT
4zMg==
X-Forwarded-Encrypted: i=2;
AJvYcCXPRNCFyn3cxoncjORiWGuh1qOOAAnWsQ/bAhCxIC/02hHnAjx1bw5+a4/m48t3rpcT4lLP/4skOu5RIPZOQaf2DB8hLzWT/c4UbmF0Sz3USBQ5KdVM7jAbZcbopw==
X-Gm-Message-State: AOJu0YyJLXYvYQEcz2i2HnVuYAvICtP9L33MKwP4k6ZZiFcww806no1e
OCfTW7hxYCdEiffO93gR69vuoCEXAWQo8OXU76GpN8zlqdkgyfpf8tDgMrRtONWKyQ==
X-Google-Smtp-Source:
AGHT+IH1yIR+9FncVcCI71uN0A82jmCXd1mLofj9oYSEnByRBWQ8/kVntasxjsnBse6g26FOoRBjIg==
X-Received: by 2002:a05:6402:278e:b0:58b:fd23:7065 with SMTP id
4fb4d7f45d1cf-58e5aec8d0amr5378286a12.16.1720340409606;
Sun, 07 Jul 2024 01:20:09 -0700 (PDT)
X-BeenThere: linux-amarula@amarulasolutions.com
Received: by 2002:aa7:cd6a:0:b0:58f:749f:1c6c with SMTP id
4fb4d7f45d1cf-58f74ae6031ls764978a12.1.-pod-prod-01-eu;
Sun, 07 Jul 2024 01:20:08 -0700 (PDT)
X-Forwarded-Encrypted: i=2;
AJvYcCVdMsKAsFtPuXzbj/sHmzc/cDFBC3jchmGtzEcuB7gn61j7m8uVW8h98RE45lqdYzTIAxpmvB9O1iPBdR+On5Ga9sxk06xnVfeCN2zm5jKWPPb0
X-Received: by 2002:a17:906:aed5:b0:a6f:6126:18aa with SMTP id
a640c23a62f3a-a77ba728ccbmr493422166b.67.1720340407974;
Sun, 07 Jul 2024 01:20:07 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1720340407; cv=none;
d=google.com; s=arc-20160816;
b=ACYPXZQxgUGvsQq4m62i1q+EeYtZ80xWwxojPD6d9SMGyfVO2YE8S5XY572h4MdN+W
ucaQ/mJl3YjxjYG7G2FLs4279soR+HSF3/Qvm7IrcLmjYvoqV12d4nsY4Zp4ql/eYnMK
InTcSWo178iDF9TZSoDQYl16j4Kx7wmXA/5EL/nPgDom1ek4oU5HzRJPMdFG6bnWRBN4
20dgvZdeAYNKKIm0AHOCsBYYxClxO1/nlV8jG0UeeJv9GzhNteq/JAqCnwkpyxCc+Xkd
PwXWxpbDShGrSOsq2f35BmdinciH80G8mPCeqRjZbasc6E+167Oxxj6cGjoi85QEoXlu
Zszg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20160816;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:dkim-signature;
bh=Yh4v3D3pWHHqrsVDjmkbDuP1IwQL+jZVx5ue+4JboHQ=;
fh=wMmxTFtS729UMPgMOGFFBEUrJ4GxuZrXqEjUscjNPs4=;
b=dlxc/YJH/EfqVXM/s0NlbiDtSPmRYNqGq4GrZCCj4w+F0HORLV+j5ZSiXHaxM5MPW4
Ff3FDj8ENs0We9iIEUgTSDE3Ri0fQE8hH7am/6co70rC6eKRPefAuiU0QKLsRY5s36fT
8Az7Wr3dVUgq8pd6zS8wxjC9MsbiEtCanTUXoPB4Zr+dFRUS9cAvH7eP358yNe04Ozse
P2jf8qXMj376W0qUFMSX2bls1HUquqQQtNTDk5+ai1BDsMY/2VY9HZ1IslZ+RIGJwBR9
uYciPy3oka2K38zzkKVhAvskkZJXI/zH0iCBHN812JhjLboB/M/BX97Q2uEzWzjSTp0a
Gvsw==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@amarulasolutions.com header.s=google
header.b=KMkfUlAG;
spf=pass (google.com: domain of michael@amarulasolutions.com designates
209.85.220.41 as permitted sender)
smtp.mailfrom=michael@amarulasolutions.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com;
dara=pass header.i=@amarulasolutions.com
Received: from mail-sor-f41.google.com (mail-sor-f41.google.com.
[209.85.220.41])
by mx.google.com with SMTPS id
a640c23a62f3a-a77cd4600f9sor109388466b.5.2024.07.07.01.20.07
for <linux-amarula@amarulasolutions.com>
(Google Transport Security);
Sun, 07 Jul 2024 01:20:07 -0700 (PDT)
Received-SPF: pass (google.com: domain of michael@amarulasolutions.com
designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Forwarded-Encrypted: i=1;
AJvYcCXeA+i/NM7iPJTc5r5bFzrVZplWGfcgqHn8aTJR6VoU/Qz/jqcPhz/lR/z0FUaREA+anW3OUhtw9gRbCDmDh/cOmRMzjTxESMEmLuQi6FU82pLD
X-Received: by 2002:a17:906:2e94:b0:a6f:d5b:20c3 with SMTP id
a640c23a62f3a-a77ba72957fmr602899266b.74.1720340407567;
Sun, 07 Jul 2024 01:20:07 -0700 (PDT)
Received: from panicking.. ([109.52.6.228])
by smtp.gmail.com with ESMTPSA id
a640c23a62f3a-a77e4a8092dsm111708666b.58.2024.07.07.01.20.06
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sun, 07 Jul 2024 01:20:07 -0700 (PDT)
From: Michael Trimarchi <michael@amarulasolutions.com>
To: Fabio Estevam <festevam@gmail.com>,
Lukasz Majewski <lukma@denx.de>,
Sean Anderson <seanga2@gmail.com>
Cc: Tom Rini <trini@konsulko.com>,
linux-amarula@amarulasolutions.com,
u-boot@lists.denx.de,
Dario Binacchi <dario.binacchi@amarulasolutions.com>,
Michael Trimarchi <michael@amarulasolutions.com>,
Marek Vasut <marex@denx.de>
Subject: [PATCH 1/4] clk: imx: clk-imx8mn Fix nand and spi clock parent
Date: Sun, 7 Jul 2024 10:19:58 +0200
Message-ID: <20240707082001.20746-2-michael@amarulasolutions.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240707082001.20746-1-michael@amarulasolutions.com>
References: <20240707082001.20746-1-michael@amarulasolutions.com>
MIME-Version: 1.0
X-Original-Sender: michael@amarulasolutions.com
X-Original-Authentication-Results: mx.google.com; dkim=pass
header.i=@amarulasolutions.com header.s=google header.b=KMkfUlAG;
spf=pass (google.com: domain of michael@amarulasolutions.com designates
209.85.220.41 as permitted sender)
smtp.mailfrom=michael@amarulasolutions.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com;
dara=pass header.i=@amarulasolutions.com
Content-Type: text/plain; charset="UTF-8"
Precedence: list
Mailing-list: list linux-amarula@amarulasolutions.com;
contact linux-amarula+owners@amarulasolutions.com
List-ID: <linux-amarula.amarulasolutions.com>
X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com
X-Google-Group-Id: 476853432473
List-Post:
<https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>,
<mailto:linux-amarula@amarulasolutions.com>
List-Help:
<https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>,
<mailto:linux-amarula+help@amarulasolutions.com>
List-Archive:
<https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/>
List-Unsubscribe:
<mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>,
<https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe>
|
| Series |
IMX8 series small clock update
|
|
Commit Message
Michael Trimarchi
July 7, 2024, 8:19 a.m. UTC
The osc_24m is the clock-output-name and not the one that
is used as internal name reference from the strcmp. The clock
that use osc_24m, will not be able to reparent it as they should.
We need anyway register the osc_24m clock fixed factor in the clock
tree.
Fixes: 710c4ffb890 ("clk: imx: clk-imx8mn add gpmi nand clocks")
Fixes: 85b1c11989c ("clk: imx: Add ECSPI to iMX8MN")
Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
---
drivers/clk/imx/clk-imx8mn.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
Comments
Hi Michael, On Sun, Jul 7, 2024 at 5:20 AM Michael Trimarchi <michael@amarulasolutions.com> wrote: > -static const char *imx8mn_ecspi1_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > +static const char *imx8mn_ecspi1_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", The kernel uses osc_24m. Why does U-Boot need to be different? To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
Hi On Wed, Jul 10, 2024 at 3:34 PM Fabio Estevam <festevam@gmail.com> wrote: > > Hi Michael, > > On Sun, Jul 7, 2024 at 5:20 AM Michael Trimarchi > <michael@amarulasolutions.com> wrote: > > > -static const char *imx8mn_ecspi1_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > +static const char *imx8mn_ecspi1_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > The kernel uses osc_24m. Why does U-Boot need to be different? clk dump It's how uboot is registering the clk in dts. My idea now was not to change it to not impact other architectures. I have a lot of changes but I don't want to address regression and fix and test before send more patches MIchael
On Wed, Jul 10, 2024 at 10:39 AM Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote: > clk dump > > It's how uboot is registering the clk in dts. My idea now was not to > change it to not impact other architectures. > I have a lot of changes but I don't want to address regression and fix > and test before send more patches Ok, I see that 'clock-osc-24m' is already used in U-Boot by the other peripherals. Your change looks correct. Ideally, we should use 'osc_24m' in the future to align with the kernel, but that's a different task. To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
HI Fabio On Wed, Jul 10, 2024 at 3:43 PM Fabio Estevam <festevam@gmail.com> wrote: > > On Wed, Jul 10, 2024 at 10:39 AM Michael Nazzareno Trimarchi > <michael@amarulasolutions.com> wrote: > > > clk dump > > > > It's how uboot is registering the clk in dts. My idea now was not to > > change it to not impact other architectures. > > I have a lot of changes but I don't want to address regression and fix > > and test before send more patches > > Ok, I see that 'clock-osc-24m' is already used in U-Boot by the other > peripherals. > > Your change looks correct. > > Ideally, we should use 'osc_24m' in the future to align with the > kernel, but that's a different task. I will rephrase the commit message Michael
On Thu, Jul 11, 2024 at 2:56 AM Michael Nazzareno Trimarchi
<michael@amarulasolutions.com> wrote:
> I will rephrase the commit message
It looks good as is.
Applied all, thanks.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
On Sun, Jul 7, 2024 at 3:45 AM Michael Trimarchi <michael@amarulasolutions.com> wrote: > > The osc_24m is the clock-output-name and not the one that > is used as internal name reference from the strcmp. The clock > that use osc_24m, will not be able to reparent it as they should. > We need anyway register the osc_24m clock fixed factor in the clock > tree. > > Fixes: 710c4ffb890 ("clk: imx: clk-imx8mn add gpmi nand clocks") > Fixes: 85b1c11989c ("clk: imx: Add ECSPI to iMX8MN") > Cc: Marek Vasut <marex@denx.de> > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > --- > drivers/clk/imx/clk-imx8mn.c | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > > diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c > index ed9e16d7c1..bfd1677520 100644 > --- a/drivers/clk/imx/clk-imx8mn.c > +++ b/drivers/clk/imx/clk-imx8mn.c > @@ -57,15 +57,15 @@ static const char *imx8mn_usdhc2_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy > "sys_pll3_out", "sys_pll1_266m", "audio_pll2_out", "sys_pll1_100m", }; > > #if CONFIG_IS_ENABLED(DM_SPI) > -static const char *imx8mn_ecspi1_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > +static const char *imx8mn_ecspi1_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > "sys_pll2_250m", "audio_pll2_out", }; > > -static const char *imx8mn_ecspi2_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > +static const char *imx8mn_ecspi2_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > "sys_pll2_250m", "audio_pll2_out", }; > > -static const char *imx8mn_ecspi3_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > +static const char *imx8mn_ecspi3_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > "sys_pll2_250m", "audio_pll2_out", }; > #endif > @@ -105,7 +105,7 @@ static const char *imx8mn_usdhc3_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy > static const char *imx8mn_qspi_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sys_pll2_333m", "sys_pll2_500m", > "audio_pll2_out", "sys_pll1_266m", "sys_pll3_out", "sys_pll1_100m", }; > > -static const char * const imx8mn_nand_sels[] = {"osc_24m", "sys_pll2_500m", "audio_pll1_out", > +static const char * const imx8mn_nand_sels[] = {"clock-osc-24m", "sys_pll2_500m", "audio_pll1_out", > "sys_pll1_400m", "audio_pll2_out", "sys_pll3_out", > "sys_pll2_250m", "video_pll_out", }; > > @@ -119,7 +119,9 @@ static const char * const imx8mn_usb_phy_sels[] = {"clock-osc-24m", "sys_pll1_10 > > static int imx8mn_clk_probe(struct udevice *dev) > { > + struct clk osc_24m_clk; > void __iomem *base; > + int ret; > > base = (void *)ANATOP_BASE_ADDR; > > @@ -238,6 +240,11 @@ static int imx8mn_clk_probe(struct udevice *dev) > clk_dm(IMX8MN_SYS_PLL2_1000M, > imx_clk_fixed_factor("sys_pll2_1000m", "sys_pll2_out", 1, 1)); > I know it's late, but I didn't get around to testing my Nano board for a while. Sorry for the delayed feedback... > + ret = clk_get_by_name(dev, "osc_24m", &osc_24m_clk); > + if (ret) > + return ret; > + clk_dm(IMX8MN_CLK_24M, dev_get_clk_ptr(osc_24m_clk.dev)); > + These four lines appear to have introduced a regression on the imx8mn-beacon board. In the SPL phase, I get an error message indicating it cannot find the i2c clk, then access to the PMIC fails. If I remove these four lines, the error message disappears, and the PMIC is happy again. I have confirmed that CLK, and SPL_CLK are both defined. I checked the u-boot-spl.dtb and it shows clock-osc-24m with clock-output-names = "osc_24m" I have also tried to mark the 24m clock as with bootph-pre-ram;: &{/clock-osc-24m} { bootph-pre-ram; }; Unfortunately, nothing is helping, and I am not sure what else to try. clk_fixed_rate.o is built into my SPL, so I don't think it's a config issue. I need to the PMIC to increase the voltage since we run the Nano in overdrive mode to run the LPDDR4 at the highest speed. Might anyone have any suggestions? adam > base = dev_read_addr_ptr(dev); > if (!base) > return -EINVAL; > -- > 2.43.0 > To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
Hi Adam On Mon, Nov 4, 2024 at 5:11 PM Adam Ford <aford173@gmail.com> wrote: > > On Sun, Jul 7, 2024 at 3:45 AM Michael Trimarchi > <michael@amarulasolutions.com> wrote: > > > > The osc_24m is the clock-output-name and not the one that > > is used as internal name reference from the strcmp. The clock > > that use osc_24m, will not be able to reparent it as they should. > > We need anyway register the osc_24m clock fixed factor in the clock > > tree. > > > > Fixes: 710c4ffb890 ("clk: imx: clk-imx8mn add gpmi nand clocks") > > Fixes: 85b1c11989c ("clk: imx: Add ECSPI to iMX8MN") > > Cc: Marek Vasut <marex@denx.de> > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > > --- > > drivers/clk/imx/clk-imx8mn.c | 15 +++++++++++---- > > 1 file changed, 11 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c > > index ed9e16d7c1..bfd1677520 100644 > > --- a/drivers/clk/imx/clk-imx8mn.c > > +++ b/drivers/clk/imx/clk-imx8mn.c > > @@ -57,15 +57,15 @@ static const char *imx8mn_usdhc2_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy > > "sys_pll3_out", "sys_pll1_266m", "audio_pll2_out", "sys_pll1_100m", }; > > > > #if CONFIG_IS_ENABLED(DM_SPI) > > -static const char *imx8mn_ecspi1_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > +static const char *imx8mn_ecspi1_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > "sys_pll2_250m", "audio_pll2_out", }; > > > > -static const char *imx8mn_ecspi2_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > +static const char *imx8mn_ecspi2_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > "sys_pll2_250m", "audio_pll2_out", }; > > > > -static const char *imx8mn_ecspi3_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > +static const char *imx8mn_ecspi3_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > "sys_pll2_250m", "audio_pll2_out", }; > > #endif > > @@ -105,7 +105,7 @@ static const char *imx8mn_usdhc3_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy > > static const char *imx8mn_qspi_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sys_pll2_333m", "sys_pll2_500m", > > "audio_pll2_out", "sys_pll1_266m", "sys_pll3_out", "sys_pll1_100m", }; > > > > -static const char * const imx8mn_nand_sels[] = {"osc_24m", "sys_pll2_500m", "audio_pll1_out", > > +static const char * const imx8mn_nand_sels[] = {"clock-osc-24m", "sys_pll2_500m", "audio_pll1_out", > > "sys_pll1_400m", "audio_pll2_out", "sys_pll3_out", > > "sys_pll2_250m", "video_pll_out", }; > > > > @@ -119,7 +119,9 @@ static const char * const imx8mn_usb_phy_sels[] = {"clock-osc-24m", "sys_pll1_10 > > > > static int imx8mn_clk_probe(struct udevice *dev) > > { > > + struct clk osc_24m_clk; > > void __iomem *base; > > + int ret; > > > > base = (void *)ANATOP_BASE_ADDR; > > > > @@ -238,6 +240,11 @@ static int imx8mn_clk_probe(struct udevice *dev) > > clk_dm(IMX8MN_SYS_PLL2_1000M, > > imx_clk_fixed_factor("sys_pll2_1000m", "sys_pll2_out", 1, 1)); > > > > I know it's late, but I didn't get around to testing my Nano board for > a while. Sorry for the delayed feedback... > > > + ret = clk_get_by_name(dev, "osc_24m", &osc_24m_clk); > > + if (ret) > > + return ret; > > + clk_dm(IMX8MN_CLK_24M, dev_get_clk_ptr(osc_24m_clk.dev)); > > + > > These four lines appear to have introduced a regression on the > imx8mn-beacon board. In the SPL phase, I get an error message > indicating it cannot find the i2c clk, then access to the PMIC fails. > If I remove these four lines, the error message disappears, and the > PMIC is happy again. > > I have confirmed that CLK, and SPL_CLK are both defined. I checked > the u-boot-spl.dtb and it shows clock-osc-24m with clock-output-names > = "osc_24m" > > I have also tried to mark the 24m clock as with bootph-pre-ram;: > &{/clock-osc-24m} { > bootph-pre-ram; > }; > > Unfortunately, nothing is helping, and I am not sure what else to try. > clk_fixed_rate.o is built into my SPL, so I don't think it's a config > issue. I need to the PMIC to increase the voltage since we run the > Nano in overdrive mode to run the LPDDR4 at the highest speed. > > Might anyone have any suggestions? > Not yet. I have a similar setup but I don't set pmic, so I think that the symbol is not find in SPL and it just fail clock registration. Is that possible? If (ret) put here a print Michael > adam > > > base = dev_read_addr_ptr(dev); > > if (!base) > > return -EINVAL; > > -- > > 2.43.0 > >
On Mon, Nov 4, 2024 at 10:29 AM Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote: > > Hi Adam > > On Mon, Nov 4, 2024 at 5:11 PM Adam Ford <aford173@gmail.com> wrote: > > > > On Sun, Jul 7, 2024 at 3:45 AM Michael Trimarchi > > <michael@amarulasolutions.com> wrote: > > > > > > The osc_24m is the clock-output-name and not the one that > > > is used as internal name reference from the strcmp. The clock > > > that use osc_24m, will not be able to reparent it as they should. > > > We need anyway register the osc_24m clock fixed factor in the clock > > > tree. > > > > > > Fixes: 710c4ffb890 ("clk: imx: clk-imx8mn add gpmi nand clocks") > > > Fixes: 85b1c11989c ("clk: imx: Add ECSPI to iMX8MN") > > > Cc: Marek Vasut <marex@denx.de> > > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > > > --- > > > drivers/clk/imx/clk-imx8mn.c | 15 +++++++++++---- > > > 1 file changed, 11 insertions(+), 4 deletions(-) > > > > > > diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c > > > index ed9e16d7c1..bfd1677520 100644 > > > --- a/drivers/clk/imx/clk-imx8mn.c > > > +++ b/drivers/clk/imx/clk-imx8mn.c > > > @@ -57,15 +57,15 @@ static const char *imx8mn_usdhc2_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy > > > "sys_pll3_out", "sys_pll1_266m", "audio_pll2_out", "sys_pll1_100m", }; > > > > > > #if CONFIG_IS_ENABLED(DM_SPI) > > > -static const char *imx8mn_ecspi1_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > > +static const char *imx8mn_ecspi1_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > > "sys_pll2_250m", "audio_pll2_out", }; > > > > > > -static const char *imx8mn_ecspi2_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > > +static const char *imx8mn_ecspi2_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > > "sys_pll2_250m", "audio_pll2_out", }; > > > > > > -static const char *imx8mn_ecspi3_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > > +static const char *imx8mn_ecspi3_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > > "sys_pll2_250m", "audio_pll2_out", }; > > > #endif > > > @@ -105,7 +105,7 @@ static const char *imx8mn_usdhc3_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy > > > static const char *imx8mn_qspi_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sys_pll2_333m", "sys_pll2_500m", > > > "audio_pll2_out", "sys_pll1_266m", "sys_pll3_out", "sys_pll1_100m", }; > > > > > > -static const char * const imx8mn_nand_sels[] = {"osc_24m", "sys_pll2_500m", "audio_pll1_out", > > > +static const char * const imx8mn_nand_sels[] = {"clock-osc-24m", "sys_pll2_500m", "audio_pll1_out", > > > "sys_pll1_400m", "audio_pll2_out", "sys_pll3_out", > > > "sys_pll2_250m", "video_pll_out", }; > > > > > > @@ -119,7 +119,9 @@ static const char * const imx8mn_usb_phy_sels[] = {"clock-osc-24m", "sys_pll1_10 > > > > > > static int imx8mn_clk_probe(struct udevice *dev) > > > { > > > + struct clk osc_24m_clk; > > > void __iomem *base; > > > + int ret; > > > > > > base = (void *)ANATOP_BASE_ADDR; > > > > > > @@ -238,6 +240,11 @@ static int imx8mn_clk_probe(struct udevice *dev) > > > clk_dm(IMX8MN_SYS_PLL2_1000M, > > > imx_clk_fixed_factor("sys_pll2_1000m", "sys_pll2_out", 1, 1)); > > > > > > > I know it's late, but I didn't get around to testing my Nano board for > > a while. Sorry for the delayed feedback... > > > > > + ret = clk_get_by_name(dev, "osc_24m", &osc_24m_clk); > > > + if (ret) > > > + return ret; > > > + clk_dm(IMX8MN_CLK_24M, dev_get_clk_ptr(osc_24m_clk.dev)); > > > + > > > > These four lines appear to have introduced a regression on the > > imx8mn-beacon board. In the SPL phase, I get an error message > > indicating it cannot find the i2c clk, then access to the PMIC fails. > > If I remove these four lines, the error message disappears, and the > > PMIC is happy again. > > > > I have confirmed that CLK, and SPL_CLK are both defined. I checked > > the u-boot-spl.dtb and it shows clock-osc-24m with clock-output-names > > = "osc_24m" > > > > I have also tried to mark the 24m clock as with bootph-pre-ram;: > > &{/clock-osc-24m} { > > bootph-pre-ram; > > }; > > > > Unfortunately, nothing is helping, and I am not sure what else to try. > > clk_fixed_rate.o is built into my SPL, so I don't think it's a config > > issue. I need to the PMIC to increase the voltage since we run the > > Nano in overdrive mode to run the LPDDR4 at the highest speed. > > > > Might anyone have any suggestions? > > > > Not yet. I have a similar setup but I don't set pmic, so I think that > the symbol is not find > in SPL and it just fail clock registration. Is that possible? It does appear that the clock registration failed. Since the system does an early return, the I2C clocks among others are also not registered which appears to cause the failure. I changed the registration around a little: ret = clk_get_by_name(dev, "osc_24m", &osc_24m_clk); if (!ret) clk_dm(IMX8MN_CLK_24M, dev_get_clk_ptr(osc_24m_clk.dev)); This method won't return prematurely, so the I2C and other clocks can be registered, and it appears to address the problem. Another alternative might be to move this clock registration until after all the rest of the clocks are done. adam > > If (ret) > > put here a print > > Michael > > adam > > > > > base = dev_read_addr_ptr(dev); > > > if (!base) > > > return -EINVAL; > > > -- > > > 2.43.0 > > > > > > > -- > Michael Nazzareno Trimarchi > Co-Founder & Chief Executive Officer > M. +39 347 913 2170 > michael@amarulasolutions.com > __________________________________ > > Amarula Solutions BV > Joop Geesinkweg 125, 1114 AB, Amsterdam, NL > T. +31 (0)85 111 9172 > info@amarulasolutions.com > www.amarulasolutions.com To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
Hi Adam On Mon, Nov 4, 2024 at 6:01 PM Adam Ford <aford173@gmail.com> wrote: > > On Mon, Nov 4, 2024 at 10:29 AM Michael Nazzareno Trimarchi > <michael@amarulasolutions.com> wrote: > > > > Hi Adam > > > > On Mon, Nov 4, 2024 at 5:11 PM Adam Ford <aford173@gmail.com> wrote: > > > > > > On Sun, Jul 7, 2024 at 3:45 AM Michael Trimarchi > > > <michael@amarulasolutions.com> wrote: > > > > > > > > The osc_24m is the clock-output-name and not the one that > > > > is used as internal name reference from the strcmp. The clock > > > > that use osc_24m, will not be able to reparent it as they should. > > > > We need anyway register the osc_24m clock fixed factor in the clock > > > > tree. > > > > > > > > Fixes: 710c4ffb890 ("clk: imx: clk-imx8mn add gpmi nand clocks") > > > > Fixes: 85b1c11989c ("clk: imx: Add ECSPI to iMX8MN") > > > > Cc: Marek Vasut <marex@denx.de> > > > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > > > > --- > > > > drivers/clk/imx/clk-imx8mn.c | 15 +++++++++++---- > > > > 1 file changed, 11 insertions(+), 4 deletions(-) > > > > > > > > diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c > > > > index ed9e16d7c1..bfd1677520 100644 > > > > --- a/drivers/clk/imx/clk-imx8mn.c > > > > +++ b/drivers/clk/imx/clk-imx8mn.c > > > > @@ -57,15 +57,15 @@ static const char *imx8mn_usdhc2_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy > > > > "sys_pll3_out", "sys_pll1_266m", "audio_pll2_out", "sys_pll1_100m", }; > > > > > > > > #if CONFIG_IS_ENABLED(DM_SPI) > > > > -static const char *imx8mn_ecspi1_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > > > +static const char *imx8mn_ecspi1_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > > > "sys_pll2_250m", "audio_pll2_out", }; > > > > > > > > -static const char *imx8mn_ecspi2_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > > > +static const char *imx8mn_ecspi2_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > > > "sys_pll2_250m", "audio_pll2_out", }; > > > > > > > > -static const char *imx8mn_ecspi3_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > > > +static const char *imx8mn_ecspi3_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > > > "sys_pll2_250m", "audio_pll2_out", }; > > > > #endif > > > > @@ -105,7 +105,7 @@ static const char *imx8mn_usdhc3_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy > > > > static const char *imx8mn_qspi_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sys_pll2_333m", "sys_pll2_500m", > > > > "audio_pll2_out", "sys_pll1_266m", "sys_pll3_out", "sys_pll1_100m", }; > > > > > > > > -static const char * const imx8mn_nand_sels[] = {"osc_24m", "sys_pll2_500m", "audio_pll1_out", > > > > +static const char * const imx8mn_nand_sels[] = {"clock-osc-24m", "sys_pll2_500m", "audio_pll1_out", > > > > "sys_pll1_400m", "audio_pll2_out", "sys_pll3_out", > > > > "sys_pll2_250m", "video_pll_out", }; > > > > > > > > @@ -119,7 +119,9 @@ static const char * const imx8mn_usb_phy_sels[] = {"clock-osc-24m", "sys_pll1_10 > > > > > > > > static int imx8mn_clk_probe(struct udevice *dev) > > > > { > > > > + struct clk osc_24m_clk; > > > > void __iomem *base; > > > > + int ret; > > > > > > > > base = (void *)ANATOP_BASE_ADDR; > > > > > > > > @@ -238,6 +240,11 @@ static int imx8mn_clk_probe(struct udevice *dev) > > > > clk_dm(IMX8MN_SYS_PLL2_1000M, > > > > imx_clk_fixed_factor("sys_pll2_1000m", "sys_pll2_out", 1, 1)); > > > > > > > > > > I know it's late, but I didn't get around to testing my Nano board for > > > a while. Sorry for the delayed feedback... > > > > > > > + ret = clk_get_by_name(dev, "osc_24m", &osc_24m_clk); > > > > + if (ret) > > > > + return ret; > > > > + clk_dm(IMX8MN_CLK_24M, dev_get_clk_ptr(osc_24m_clk.dev)); > > > > + > > > > > > These four lines appear to have introduced a regression on the > > > imx8mn-beacon board. In the SPL phase, I get an error message > > > indicating it cannot find the i2c clk, then access to the PMIC fails. > > > If I remove these four lines, the error message disappears, and the > > > PMIC is happy again. > > > > > > I have confirmed that CLK, and SPL_CLK are both defined. I checked > > > the u-boot-spl.dtb and it shows clock-osc-24m with clock-output-names > > > = "osc_24m" > > > > > > I have also tried to mark the 24m clock as with bootph-pre-ram;: > > > &{/clock-osc-24m} { > > > bootph-pre-ram; > > > }; > > > > > > Unfortunately, nothing is helping, and I am not sure what else to try. > > > clk_fixed_rate.o is built into my SPL, so I don't think it's a config > > > issue. I need to the PMIC to increase the voltage since we run the > > > Nano in overdrive mode to run the LPDDR4 at the highest speed. > > > > > > Might anyone have any suggestions? > > > > > > > Not yet. I have a similar setup but I don't set pmic, so I think that > > the symbol is not find > > in SPL and it just fail clock registration. Is that possible? > > It does appear that the clock registration failed. Since the system > does an early return, the I2C clocks among others are also not > registered which appears to cause the failure. > > I changed the registration around a little: > > ret = clk_get_by_name(dev, "osc_24m", &osc_24m_clk); > if (!ret) > clk_dm(IMX8MN_CLK_24M, dev_get_clk_ptr(osc_24m_clk.dev)); > Seems that is not in the image spl so it can not find it. Are you sure that you can inside the SPL Michael > This method won't return prematurely, so the I2C and other clocks can > be registered, and it appears to address the problem. > Another alternative might be to move this clock registration until > after all the rest of the clocks are done. > > adam > > > > If (ret) > > > > put here a print > > > > Michael > > > adam > > > > > > > base = dev_read_addr_ptr(dev); > > > > if (!base) > > > > return -EINVAL; > > > > -- > > > > 2.43.0 > > > > > > > > > > > > -- > > Michael Nazzareno Trimarchi > > Co-Founder & Chief Executive Officer > > M. +39 347 913 2170 > > michael@amarulasolutions.com > > __________________________________ > > > > Amarula Solutions BV > > Joop Geesinkweg 125, 1114 AB, Amsterdam, NL > > T. +31 (0)85 111 9172 > > info@amarulasolutions.com > > www.amarulasolutions.com
On Mon, Nov 4, 2024 at 11:04 AM Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote: > > Hi Adam > > On Mon, Nov 4, 2024 at 6:01 PM Adam Ford <aford173@gmail.com> wrote: > > > > On Mon, Nov 4, 2024 at 10:29 AM Michael Nazzareno Trimarchi > > <michael@amarulasolutions.com> wrote: > > > > > > Hi Adam > > > > > > On Mon, Nov 4, 2024 at 5:11 PM Adam Ford <aford173@gmail.com> wrote: > > > > > > > > On Sun, Jul 7, 2024 at 3:45 AM Michael Trimarchi > > > > <michael@amarulasolutions.com> wrote: > > > > > > > > > > The osc_24m is the clock-output-name and not the one that > > > > > is used as internal name reference from the strcmp. The clock > > > > > that use osc_24m, will not be able to reparent it as they should. > > > > > We need anyway register the osc_24m clock fixed factor in the clock > > > > > tree. > > > > > > > > > > Fixes: 710c4ffb890 ("clk: imx: clk-imx8mn add gpmi nand clocks") > > > > > Fixes: 85b1c11989c ("clk: imx: Add ECSPI to iMX8MN") > > > > > Cc: Marek Vasut <marex@denx.de> > > > > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > > > > > --- > > > > > drivers/clk/imx/clk-imx8mn.c | 15 +++++++++++---- > > > > > 1 file changed, 11 insertions(+), 4 deletions(-) > > > > > > > > > > diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c > > > > > index ed9e16d7c1..bfd1677520 100644 > > > > > --- a/drivers/clk/imx/clk-imx8mn.c > > > > > +++ b/drivers/clk/imx/clk-imx8mn.c > > > > > @@ -57,15 +57,15 @@ static const char *imx8mn_usdhc2_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy > > > > > "sys_pll3_out", "sys_pll1_266m", "audio_pll2_out", "sys_pll1_100m", }; > > > > > > > > > > #if CONFIG_IS_ENABLED(DM_SPI) > > > > > -static const char *imx8mn_ecspi1_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > +static const char *imx8mn_ecspi1_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > > > > "sys_pll2_250m", "audio_pll2_out", }; > > > > > > > > > > -static const char *imx8mn_ecspi2_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > +static const char *imx8mn_ecspi2_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > > > > "sys_pll2_250m", "audio_pll2_out", }; > > > > > > > > > > -static const char *imx8mn_ecspi3_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > +static const char *imx8mn_ecspi3_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > > > > "sys_pll2_250m", "audio_pll2_out", }; > > > > > #endif > > > > > @@ -105,7 +105,7 @@ static const char *imx8mn_usdhc3_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy > > > > > static const char *imx8mn_qspi_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sys_pll2_333m", "sys_pll2_500m", > > > > > "audio_pll2_out", "sys_pll1_266m", "sys_pll3_out", "sys_pll1_100m", }; > > > > > > > > > > -static const char * const imx8mn_nand_sels[] = {"osc_24m", "sys_pll2_500m", "audio_pll1_out", > > > > > +static const char * const imx8mn_nand_sels[] = {"clock-osc-24m", "sys_pll2_500m", "audio_pll1_out", > > > > > "sys_pll1_400m", "audio_pll2_out", "sys_pll3_out", > > > > > "sys_pll2_250m", "video_pll_out", }; > > > > > > > > > > @@ -119,7 +119,9 @@ static const char * const imx8mn_usb_phy_sels[] = {"clock-osc-24m", "sys_pll1_10 > > > > > > > > > > static int imx8mn_clk_probe(struct udevice *dev) > > > > > { > > > > > + struct clk osc_24m_clk; > > > > > void __iomem *base; > > > > > + int ret; > > > > > > > > > > base = (void *)ANATOP_BASE_ADDR; > > > > > > > > > > @@ -238,6 +240,11 @@ static int imx8mn_clk_probe(struct udevice *dev) > > > > > clk_dm(IMX8MN_SYS_PLL2_1000M, > > > > > imx_clk_fixed_factor("sys_pll2_1000m", "sys_pll2_out", 1, 1)); > > > > > > > > > > > > > I know it's late, but I didn't get around to testing my Nano board for > > > > a while. Sorry for the delayed feedback... > > > > > > > > > + ret = clk_get_by_name(dev, "osc_24m", &osc_24m_clk); > > > > > + if (ret) > > > > > + return ret; > > > > > + clk_dm(IMX8MN_CLK_24M, dev_get_clk_ptr(osc_24m_clk.dev)); > > > > > + > > > > > > > > These four lines appear to have introduced a regression on the > > > > imx8mn-beacon board. In the SPL phase, I get an error message > > > > indicating it cannot find the i2c clk, then access to the PMIC fails. > > > > If I remove these four lines, the error message disappears, and the > > > > PMIC is happy again. > > > > > > > > I have confirmed that CLK, and SPL_CLK are both defined. I checked > > > > the u-boot-spl.dtb and it shows clock-osc-24m with clock-output-names > > > > = "osc_24m" > > > > > > > > I have also tried to mark the 24m clock as with bootph-pre-ram;: > > > > &{/clock-osc-24m} { > > > > bootph-pre-ram; > > > > }; > > > > > > > > Unfortunately, nothing is helping, and I am not sure what else to try. > > > > clk_fixed_rate.o is built into my SPL, so I don't think it's a config > > > > issue. I need to the PMIC to increase the voltage since we run the > > > > Nano in overdrive mode to run the LPDDR4 at the highest speed. > > > > > > > > Might anyone have any suggestions? > > > > > > > > > > Not yet. I have a similar setup but I don't set pmic, so I think that > > > the symbol is not find > > > in SPL and it just fail clock registration. Is that possible? > > > > It does appear that the clock registration failed. Since the system > > does an early return, the I2C clocks among others are also not > > registered which appears to cause the failure. > > > > I changed the registration around a little: > > > > ret = clk_get_by_name(dev, "osc_24m", &osc_24m_clk); > > if (!ret) > > clk_dm(IMX8MN_CLK_24M, dev_get_clk_ptr(osc_24m_clk.dev)); > > > > Seems that is not in the image spl so it can not find it. Are you sure > that you can inside > the SPL I am not sure I understand what you are asking, but the clock node appears in spl/u-boot-spl.dtb: clock-osc-24m { compatible = "fixed-clock"; #clock-cells = <0x00>; clock-frequency = <0x16e3600>; clock-output-names = "osc_24m"; phandle = <0x18>; }; Since the clock-output-names is "osc_24m" I wonder if clk_get_by_name is the right function. Looking at other uses of this function, it looks like it's looking for a 'clock-names' parameter and not clock-output-names. adam > > Michael > > > This method won't return prematurely, so the I2C and other clocks can > > be registered, and it appears to address the problem. > > Another alternative might be to move this clock registration until > > after all the rest of the clocks are done. > > > > adam > > > > > > If (ret) > > > > > > put here a print > > > > > > Michael > > > > adam > > > > > > > > > base = dev_read_addr_ptr(dev); > > > > > if (!base) > > > > > return -EINVAL; > > > > > -- > > > > > 2.43.0 > > > > > > > > > > > > > > > > > -- > > > Michael Nazzareno Trimarchi > > > Co-Founder & Chief Executive Officer > > > M. +39 347 913 2170 > > > michael@amarulasolutions.com > > > __________________________________ > > > > > > Amarula Solutions BV > > > Joop Geesinkweg 125, 1114 AB, Amsterdam, NL > > > T. +31 (0)85 111 9172 > > > info@amarulasolutions.com > > > www.amarulasolutions.com > > > > -- > Michael Nazzareno Trimarchi > Co-Founder & Chief Executive Officer > M. +39 347 913 2170 > michael@amarulasolutions.com > __________________________________ > > Amarula Solutions BV > Joop Geesinkweg 125, 1114 AB, Amsterdam, NL > T. +31 (0)85 111 9172 > info@amarulasolutions.com > www.amarulasolutions.com To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
Hi On Mon, Nov 4, 2024 at 6:17 PM Adam Ford <aford173@gmail.com> wrote: > > On Mon, Nov 4, 2024 at 11:04 AM Michael Nazzareno Trimarchi > <michael@amarulasolutions.com> wrote: > > > > Hi Adam > > > > On Mon, Nov 4, 2024 at 6:01 PM Adam Ford <aford173@gmail.com> wrote: > > > > > > On Mon, Nov 4, 2024 at 10:29 AM Michael Nazzareno Trimarchi > > > <michael@amarulasolutions.com> wrote: > > > > > > > > Hi Adam > > > > > > > > On Mon, Nov 4, 2024 at 5:11 PM Adam Ford <aford173@gmail.com> wrote: > > > > > > > > > > On Sun, Jul 7, 2024 at 3:45 AM Michael Trimarchi > > > > > <michael@amarulasolutions.com> wrote: > > > > > > > > > > > > The osc_24m is the clock-output-name and not the one that > > > > > > is used as internal name reference from the strcmp. The clock > > > > > > that use osc_24m, will not be able to reparent it as they should. > > > > > > We need anyway register the osc_24m clock fixed factor in the clock > > > > > > tree. > > > > > > > > > > > > Fixes: 710c4ffb890 ("clk: imx: clk-imx8mn add gpmi nand clocks") > > > > > > Fixes: 85b1c11989c ("clk: imx: Add ECSPI to iMX8MN") > > > > > > Cc: Marek Vasut <marex@denx.de> > > > > > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > > > > > > --- > > > > > > drivers/clk/imx/clk-imx8mn.c | 15 +++++++++++---- > > > > > > 1 file changed, 11 insertions(+), 4 deletions(-) > > > > > > > > > > > > diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c > > > > > > index ed9e16d7c1..bfd1677520 100644 > > > > > > --- a/drivers/clk/imx/clk-imx8mn.c > > > > > > +++ b/drivers/clk/imx/clk-imx8mn.c > > > > > > @@ -57,15 +57,15 @@ static const char *imx8mn_usdhc2_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy > > > > > > "sys_pll3_out", "sys_pll1_266m", "audio_pll2_out", "sys_pll1_100m", }; > > > > > > > > > > > > #if CONFIG_IS_ENABLED(DM_SPI) > > > > > > -static const char *imx8mn_ecspi1_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > > +static const char *imx8mn_ecspi1_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > > > > > "sys_pll2_250m", "audio_pll2_out", }; > > > > > > > > > > > > -static const char *imx8mn_ecspi2_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > > +static const char *imx8mn_ecspi2_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > > > > > "sys_pll2_250m", "audio_pll2_out", }; > > > > > > > > > > > > -static const char *imx8mn_ecspi3_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > > +static const char *imx8mn_ecspi3_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > > > > > "sys_pll2_250m", "audio_pll2_out", }; > > > > > > #endif > > > > > > @@ -105,7 +105,7 @@ static const char *imx8mn_usdhc3_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy > > > > > > static const char *imx8mn_qspi_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sys_pll2_333m", "sys_pll2_500m", > > > > > > "audio_pll2_out", "sys_pll1_266m", "sys_pll3_out", "sys_pll1_100m", }; > > > > > > > > > > > > -static const char * const imx8mn_nand_sels[] = {"osc_24m", "sys_pll2_500m", "audio_pll1_out", > > > > > > +static const char * const imx8mn_nand_sels[] = {"clock-osc-24m", "sys_pll2_500m", "audio_pll1_out", > > > > > > "sys_pll1_400m", "audio_pll2_out", "sys_pll3_out", > > > > > > "sys_pll2_250m", "video_pll_out", }; > > > > > > > > > > > > @@ -119,7 +119,9 @@ static const char * const imx8mn_usb_phy_sels[] = {"clock-osc-24m", "sys_pll1_10 > > > > > > > > > > > > static int imx8mn_clk_probe(struct udevice *dev) > > > > > > { > > > > > > + struct clk osc_24m_clk; > > > > > > void __iomem *base; > > > > > > + int ret; > > > > > > > > > > > > base = (void *)ANATOP_BASE_ADDR; > > > > > > > > > > > > @@ -238,6 +240,11 @@ static int imx8mn_clk_probe(struct udevice *dev) > > > > > > clk_dm(IMX8MN_SYS_PLL2_1000M, > > > > > > imx_clk_fixed_factor("sys_pll2_1000m", "sys_pll2_out", 1, 1)); > > > > > > > > > > > > > > > > I know it's late, but I didn't get around to testing my Nano board for > > > > > a while. Sorry for the delayed feedback... > > > > > > > > > > > + ret = clk_get_by_name(dev, "osc_24m", &osc_24m_clk); > > > > > > + if (ret) > > > > > > + return ret; > > > > > > + clk_dm(IMX8MN_CLK_24M, dev_get_clk_ptr(osc_24m_clk.dev)); > > > > > > + > > > > > > > > > > These four lines appear to have introduced a regression on the > > > > > imx8mn-beacon board. In the SPL phase, I get an error message > > > > > indicating it cannot find the i2c clk, then access to the PMIC fails. > > > > > If I remove these four lines, the error message disappears, and the > > > > > PMIC is happy again. > > > > > > > > > > I have confirmed that CLK, and SPL_CLK are both defined. I checked > > > > > the u-boot-spl.dtb and it shows clock-osc-24m with clock-output-names > > > > > = "osc_24m" > > > > > > > > > > I have also tried to mark the 24m clock as with bootph-pre-ram;: > > > > > &{/clock-osc-24m} { > > > > > bootph-pre-ram; > > > > > }; > > > > > > > > > > Unfortunately, nothing is helping, and I am not sure what else to try. > > > > > clk_fixed_rate.o is built into my SPL, so I don't think it's a config > > > > > issue. I need to the PMIC to increase the voltage since we run the > > > > > Nano in overdrive mode to run the LPDDR4 at the highest speed. > > > > > > > > > > Might anyone have any suggestions? > > > > > > > > > > > > > Not yet. I have a similar setup but I don't set pmic, so I think that > > > > the symbol is not find > > > > in SPL and it just fail clock registration. Is that possible? > > > > > > It does appear that the clock registration failed. Since the system > > > does an early return, the I2C clocks among others are also not > > > registered which appears to cause the failure. > > > > > > I changed the registration around a little: > > > > > > ret = clk_get_by_name(dev, "osc_24m", &osc_24m_clk); > > > if (!ret) > > > clk_dm(IMX8MN_CLK_24M, dev_get_clk_ptr(osc_24m_clk.dev)); > > > > > > > Seems that is not in the image spl so it can not find it. Are you sure > > that you can inside > > the SPL > > I am not sure I understand what you are asking, but the clock node > appears in spl/u-boot-spl.dtb: > > clock-osc-24m { > compatible = "fixed-clock"; > #clock-cells = <0x00>; > clock-frequency = <0x16e3600>; > clock-output-names = "osc_24m"; > phandle = <0x18>; > }; > > Since the clock-output-names is "osc_24m" I wonder if clk_get_by_name > is the right function. Looking at other uses of this function, it > looks like it's looking for a 'clock-names' parameter and not > clock-output-names. Yes, it's the right answer. That is strange because it works in uboot image. Is the node the same in uboot-dtb? Michael > > adam > > > > Michael > > > > > This method won't return prematurely, so the I2C and other clocks can > > > be registered, and it appears to address the problem. > > > Another alternative might be to move this clock registration until > > > after all the rest of the clocks are done. > > > > > > adam > > > > > > > > If (ret) > > > > > > > > put here a print > > > > > > > > Michael > > > > > adam > > > > > > > > > > > base = dev_read_addr_ptr(dev); > > > > > > if (!base) > > > > > > return -EINVAL; > > > > > > -- > > > > > > 2.43.0 > > > > > > > > > > > > > > > > > > > > > > -- > > > > Michael Nazzareno Trimarchi > > > > Co-Founder & Chief Executive Officer > > > > M. +39 347 913 2170 > > > > michael@amarulasolutions.com > > > > __________________________________ > > > > > > > > Amarula Solutions BV > > > > Joop Geesinkweg 125, 1114 AB, Amsterdam, NL > > > > T. +31 (0)85 111 9172 > > > > info@amarulasolutions.com > > > > www.amarulasolutions.com > > > > > > > > -- > > Michael Nazzareno Trimarchi > > Co-Founder & Chief Executive Officer > > M. +39 347 913 2170 > > michael@amarulasolutions.com > > __________________________________ > > > > Amarula Solutions BV > > Joop Geesinkweg 125, 1114 AB, Amsterdam, NL > > T. +31 (0)85 111 9172 > > info@amarulasolutions.com > > www.amarulasolutions.com
On Mon, Nov 4, 2024 at 11:22 AM Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote: > > Hi > > On Mon, Nov 4, 2024 at 6:17 PM Adam Ford <aford173@gmail.com> wrote: > > > > On Mon, Nov 4, 2024 at 11:04 AM Michael Nazzareno Trimarchi > > <michael@amarulasolutions.com> wrote: > > > > > > Hi Adam > > > > > > On Mon, Nov 4, 2024 at 6:01 PM Adam Ford <aford173@gmail.com> wrote: > > > > > > > > On Mon, Nov 4, 2024 at 10:29 AM Michael Nazzareno Trimarchi > > > > <michael@amarulasolutions.com> wrote: > > > > > > > > > > Hi Adam > > > > > > > > > > On Mon, Nov 4, 2024 at 5:11 PM Adam Ford <aford173@gmail.com> wrote: > > > > > > > > > > > > On Sun, Jul 7, 2024 at 3:45 AM Michael Trimarchi > > > > > > <michael@amarulasolutions.com> wrote: > > > > > > > > > > > > > > The osc_24m is the clock-output-name and not the one that > > > > > > > is used as internal name reference from the strcmp. The clock > > > > > > > that use osc_24m, will not be able to reparent it as they should. > > > > > > > We need anyway register the osc_24m clock fixed factor in the clock > > > > > > > tree. > > > > > > > > > > > > > > Fixes: 710c4ffb890 ("clk: imx: clk-imx8mn add gpmi nand clocks") > > > > > > > Fixes: 85b1c11989c ("clk: imx: Add ECSPI to iMX8MN") > > > > > > > Cc: Marek Vasut <marex@denx.de> > > > > > > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > > > > > > > --- > > > > > > > drivers/clk/imx/clk-imx8mn.c | 15 +++++++++++---- > > > > > > > 1 file changed, 11 insertions(+), 4 deletions(-) > > > > > > > > > > > > > > diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c > > > > > > > index ed9e16d7c1..bfd1677520 100644 > > > > > > > --- a/drivers/clk/imx/clk-imx8mn.c > > > > > > > +++ b/drivers/clk/imx/clk-imx8mn.c > > > > > > > @@ -57,15 +57,15 @@ static const char *imx8mn_usdhc2_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy > > > > > > > "sys_pll3_out", "sys_pll1_266m", "audio_pll2_out", "sys_pll1_100m", }; > > > > > > > > > > > > > > #if CONFIG_IS_ENABLED(DM_SPI) > > > > > > > -static const char *imx8mn_ecspi1_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > > > +static const char *imx8mn_ecspi1_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > > > > > > "sys_pll2_250m", "audio_pll2_out", }; > > > > > > > > > > > > > > -static const char *imx8mn_ecspi2_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > > > +static const char *imx8mn_ecspi2_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > > > > > > "sys_pll2_250m", "audio_pll2_out", }; > > > > > > > > > > > > > > -static const char *imx8mn_ecspi3_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > > > +static const char *imx8mn_ecspi3_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > > > > > > "sys_pll2_250m", "audio_pll2_out", }; > > > > > > > #endif > > > > > > > @@ -105,7 +105,7 @@ static const char *imx8mn_usdhc3_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy > > > > > > > static const char *imx8mn_qspi_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sys_pll2_333m", "sys_pll2_500m", > > > > > > > "audio_pll2_out", "sys_pll1_266m", "sys_pll3_out", "sys_pll1_100m", }; > > > > > > > > > > > > > > -static const char * const imx8mn_nand_sels[] = {"osc_24m", "sys_pll2_500m", "audio_pll1_out", > > > > > > > +static const char * const imx8mn_nand_sels[] = {"clock-osc-24m", "sys_pll2_500m", "audio_pll1_out", > > > > > > > "sys_pll1_400m", "audio_pll2_out", "sys_pll3_out", > > > > > > > "sys_pll2_250m", "video_pll_out", }; > > > > > > > > > > > > > > @@ -119,7 +119,9 @@ static const char * const imx8mn_usb_phy_sels[] = {"clock-osc-24m", "sys_pll1_10 > > > > > > > > > > > > > > static int imx8mn_clk_probe(struct udevice *dev) > > > > > > > { > > > > > > > + struct clk osc_24m_clk; > > > > > > > void __iomem *base; > > > > > > > + int ret; > > > > > > > > > > > > > > base = (void *)ANATOP_BASE_ADDR; > > > > > > > > > > > > > > @@ -238,6 +240,11 @@ static int imx8mn_clk_probe(struct udevice *dev) > > > > > > > clk_dm(IMX8MN_SYS_PLL2_1000M, > > > > > > > imx_clk_fixed_factor("sys_pll2_1000m", "sys_pll2_out", 1, 1)); > > > > > > > > > > > > > > > > > > > I know it's late, but I didn't get around to testing my Nano board for > > > > > > a while. Sorry for the delayed feedback... > > > > > > > > > > > > > + ret = clk_get_by_name(dev, "osc_24m", &osc_24m_clk); > > > > > > > + if (ret) > > > > > > > + return ret; > > > > > > > + clk_dm(IMX8MN_CLK_24M, dev_get_clk_ptr(osc_24m_clk.dev)); > > > > > > > + > > > > > > > > > > > > These four lines appear to have introduced a regression on the > > > > > > imx8mn-beacon board. In the SPL phase, I get an error message > > > > > > indicating it cannot find the i2c clk, then access to the PMIC fails. > > > > > > If I remove these four lines, the error message disappears, and the > > > > > > PMIC is happy again. > > > > > > > > > > > > I have confirmed that CLK, and SPL_CLK are both defined. I checked > > > > > > the u-boot-spl.dtb and it shows clock-osc-24m with clock-output-names > > > > > > = "osc_24m" > > > > > > > > > > > > I have also tried to mark the 24m clock as with bootph-pre-ram;: > > > > > > &{/clock-osc-24m} { > > > > > > bootph-pre-ram; > > > > > > }; > > > > > > > > > > > > Unfortunately, nothing is helping, and I am not sure what else to try. > > > > > > clk_fixed_rate.o is built into my SPL, so I don't think it's a config > > > > > > issue. I need to the PMIC to increase the voltage since we run the > > > > > > Nano in overdrive mode to run the LPDDR4 at the highest speed. > > > > > > > > > > > > Might anyone have any suggestions? > > > > > > > > > > > > > > > > Not yet. I have a similar setup but I don't set pmic, so I think that > > > > > the symbol is not find > > > > > in SPL and it just fail clock registration. Is that possible? > > > > > > > > It does appear that the clock registration failed. Since the system > > > > does an early return, the I2C clocks among others are also not > > > > registered which appears to cause the failure. > > > > > > > > I changed the registration around a little: > > > > > > > > ret = clk_get_by_name(dev, "osc_24m", &osc_24m_clk); > > > > if (!ret) > > > > clk_dm(IMX8MN_CLK_24M, dev_get_clk_ptr(osc_24m_clk.dev)); > > > > > > > > > > Seems that is not in the image spl so it can not find it. Are you sure > > > that you can inside > > > the SPL > > > > I am not sure I understand what you are asking, but the clock node > > appears in spl/u-boot-spl.dtb: > > > > clock-osc-24m { > > compatible = "fixed-clock"; > > #clock-cells = <0x00>; > > clock-frequency = <0x16e3600>; > > clock-output-names = "osc_24m"; > > phandle = <0x18>; > > }; > > > > Since the clock-output-names is "osc_24m" I wonder if clk_get_by_name > > is the right function. Looking at other uses of this function, it > > looks like it's looking for a 'clock-names' parameter and not > > clock-output-names. > > Yes, it's the right answer. That is strange because it works in uboot > image. Is the node the same in uboot-dtb? The U-Boot phase device tree looks like this: clock-osc-24m { compatible = "fixed-clock"; #clock-cells = <0x00>; clock-frequency = <0x16e3600>; clock-output-names = "osc_24m"; bootph-pre-ram; bootph-all; phandle = <0x18>; }; > > Michael > > > > > adam > > > > > > Michael > > > > > > > This method won't return prematurely, so the I2C and other clocks can > > > > be registered, and it appears to address the problem. > > > > Another alternative might be to move this clock registration until > > > > after all the rest of the clocks are done. > > > > > > > > adam > > > > > > > > > > If (ret) > > > > > > > > > > put here a print > > > > > > > > > > Michael > > > > > > adam > > > > > > > > > > > > > base = dev_read_addr_ptr(dev); > > > > > > > if (!base) > > > > > > > return -EINVAL; > > > > > > > -- > > > > > > > 2.43.0 > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > Michael Nazzareno Trimarchi > > > > > Co-Founder & Chief Executive Officer > > > > > M. +39 347 913 2170 > > > > > michael@amarulasolutions.com > > > > > __________________________________ > > > > > > > > > > Amarula Solutions BV > > > > > Joop Geesinkweg 125, 1114 AB, Amsterdam, NL > > > > > T. +31 (0)85 111 9172 > > > > > info@amarulasolutions.com > > > > > www.amarulasolutions.com > > > > > > > > > > > > -- > > > Michael Nazzareno Trimarchi > > > Co-Founder & Chief Executive Officer > > > M. +39 347 913 2170 > > > michael@amarulasolutions.com > > > __________________________________ > > > > > > Amarula Solutions BV > > > Joop Geesinkweg 125, 1114 AB, Amsterdam, NL > > > T. +31 (0)85 111 9172 > > > info@amarulasolutions.com > > > www.amarulasolutions.com > > > > -- > Michael Nazzareno Trimarchi > Co-Founder & Chief Executive Officer > M. +39 347 913 2170 > michael@amarulasolutions.com > __________________________________ > > Amarula Solutions BV > Joop Geesinkweg 125, 1114 AB, Amsterdam, NL > T. +31 (0)85 111 9172 > info@amarulasolutions.com > www.amarulasolutions.com To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
On Mon, Nov 4, 2024 at 11:24 AM Adam Ford <aford173@gmail.com> wrote: > > On Mon, Nov 4, 2024 at 11:22 AM Michael Nazzareno Trimarchi > <michael@amarulasolutions.com> wrote: > > > > Hi > > > > On Mon, Nov 4, 2024 at 6:17 PM Adam Ford <aford173@gmail.com> wrote: > > > > > > On Mon, Nov 4, 2024 at 11:04 AM Michael Nazzareno Trimarchi > > > <michael@amarulasolutions.com> wrote: > > > > > > > > Hi Adam > > > > > > > > On Mon, Nov 4, 2024 at 6:01 PM Adam Ford <aford173@gmail.com> wrote: > > > > > > > > > > On Mon, Nov 4, 2024 at 10:29 AM Michael Nazzareno Trimarchi > > > > > <michael@amarulasolutions.com> wrote: > > > > > > > > > > > > Hi Adam > > > > > > > > > > > > On Mon, Nov 4, 2024 at 5:11 PM Adam Ford <aford173@gmail.com> wrote: > > > > > > > > > > > > > > On Sun, Jul 7, 2024 at 3:45 AM Michael Trimarchi > > > > > > > <michael@amarulasolutions.com> wrote: > > > > > > > > > > > > > > > > The osc_24m is the clock-output-name and not the one that > > > > > > > > is used as internal name reference from the strcmp. The clock > > > > > > > > that use osc_24m, will not be able to reparent it as they should. > > > > > > > > We need anyway register the osc_24m clock fixed factor in the clock > > > > > > > > tree. > > > > > > > > > > > > > > > > Fixes: 710c4ffb890 ("clk: imx: clk-imx8mn add gpmi nand clocks") > > > > > > > > Fixes: 85b1c11989c ("clk: imx: Add ECSPI to iMX8MN") > > > > > > > > Cc: Marek Vasut <marex@denx.de> > > > > > > > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > > > > > > > > --- > > > > > > > > drivers/clk/imx/clk-imx8mn.c | 15 +++++++++++---- > > > > > > > > 1 file changed, 11 insertions(+), 4 deletions(-) > > > > > > > > > > > > > > > > diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c > > > > > > > > index ed9e16d7c1..bfd1677520 100644 > > > > > > > > --- a/drivers/clk/imx/clk-imx8mn.c > > > > > > > > +++ b/drivers/clk/imx/clk-imx8mn.c > > > > > > > > @@ -57,15 +57,15 @@ static const char *imx8mn_usdhc2_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy > > > > > > > > "sys_pll3_out", "sys_pll1_266m", "audio_pll2_out", "sys_pll1_100m", }; > > > > > > > > > > > > > > > > #if CONFIG_IS_ENABLED(DM_SPI) > > > > > > > > -static const char *imx8mn_ecspi1_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > > > > +static const char *imx8mn_ecspi1_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > > > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > > > > > > > "sys_pll2_250m", "audio_pll2_out", }; > > > > > > > > > > > > > > > > -static const char *imx8mn_ecspi2_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > > > > +static const char *imx8mn_ecspi2_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > > > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > > > > > > > "sys_pll2_250m", "audio_pll2_out", }; > > > > > > > > > > > > > > > > -static const char *imx8mn_ecspi3_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > > > > +static const char *imx8mn_ecspi3_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", > > > > > > > > "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", > > > > > > > > "sys_pll2_250m", "audio_pll2_out", }; > > > > > > > > #endif > > > > > > > > @@ -105,7 +105,7 @@ static const char *imx8mn_usdhc3_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy > > > > > > > > static const char *imx8mn_qspi_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sys_pll2_333m", "sys_pll2_500m", > > > > > > > > "audio_pll2_out", "sys_pll1_266m", "sys_pll3_out", "sys_pll1_100m", }; > > > > > > > > > > > > > > > > -static const char * const imx8mn_nand_sels[] = {"osc_24m", "sys_pll2_500m", "audio_pll1_out", > > > > > > > > +static const char * const imx8mn_nand_sels[] = {"clock-osc-24m", "sys_pll2_500m", "audio_pll1_out", > > > > > > > > "sys_pll1_400m", "audio_pll2_out", "sys_pll3_out", > > > > > > > > "sys_pll2_250m", "video_pll_out", }; > > > > > > > > > > > > > > > > @@ -119,7 +119,9 @@ static const char * const imx8mn_usb_phy_sels[] = {"clock-osc-24m", "sys_pll1_10 > > > > > > > > > > > > > > > > static int imx8mn_clk_probe(struct udevice *dev) > > > > > > > > { > > > > > > > > + struct clk osc_24m_clk; > > > > > > > > void __iomem *base; > > > > > > > > + int ret; > > > > > > > > > > > > > > > > base = (void *)ANATOP_BASE_ADDR; > > > > > > > > > > > > > > > > @@ -238,6 +240,11 @@ static int imx8mn_clk_probe(struct udevice *dev) > > > > > > > > clk_dm(IMX8MN_SYS_PLL2_1000M, > > > > > > > > imx_clk_fixed_factor("sys_pll2_1000m", "sys_pll2_out", 1, 1)); > > > > > > > > > > > > > > > > > > > > > > I know it's late, but I didn't get around to testing my Nano board for > > > > > > > a while. Sorry for the delayed feedback... > > > > > > > > > > > > > > > + ret = clk_get_by_name(dev, "osc_24m", &osc_24m_clk); > > > > > > > > + if (ret) > > > > > > > > + return ret; > > > > > > > > + clk_dm(IMX8MN_CLK_24M, dev_get_clk_ptr(osc_24m_clk.dev)); > > > > > > > > + > > > > > > > > > > > > > > These four lines appear to have introduced a regression on the > > > > > > > imx8mn-beacon board. In the SPL phase, I get an error message > > > > > > > indicating it cannot find the i2c clk, then access to the PMIC fails. > > > > > > > If I remove these four lines, the error message disappears, and the > > > > > > > PMIC is happy again. > > > > > > > > > > > > > > I have confirmed that CLK, and SPL_CLK are both defined. I checked > > > > > > > the u-boot-spl.dtb and it shows clock-osc-24m with clock-output-names > > > > > > > = "osc_24m" > > > > > > > > > > > > > > I have also tried to mark the 24m clock as with bootph-pre-ram;: > > > > > > > &{/clock-osc-24m} { > > > > > > > bootph-pre-ram; > > > > > > > }; > > > > > > > > > > > > > > Unfortunately, nothing is helping, and I am not sure what else to try. > > > > > > > clk_fixed_rate.o is built into my SPL, so I don't think it's a config > > > > > > > issue. I need to the PMIC to increase the voltage since we run the > > > > > > > Nano in overdrive mode to run the LPDDR4 at the highest speed. > > > > > > > > > > > > > > Might anyone have any suggestions? > > > > > > > > > > > > > > > > > > > Not yet. I have a similar setup but I don't set pmic, so I think that > > > > > > the symbol is not find > > > > > > in SPL and it just fail clock registration. Is that possible? > > > > > > > > > > It does appear that the clock registration failed. Since the system > > > > > does an early return, the I2C clocks among others are also not > > > > > registered which appears to cause the failure. > > > > > > > > > > I changed the registration around a little: > > > > > > > > > > ret = clk_get_by_name(dev, "osc_24m", &osc_24m_clk); > > > > > if (!ret) > > > > > clk_dm(IMX8MN_CLK_24M, dev_get_clk_ptr(osc_24m_clk.dev)); > > > > > > > > > > > > > Seems that is not in the image spl so it can not find it. Are you sure > > > > that you can inside > > > > the SPL > > > > > > I am not sure I understand what you are asking, but the clock node > > > appears in spl/u-boot-spl.dtb: > > > > > > clock-osc-24m { > > > compatible = "fixed-clock"; > > > #clock-cells = <0x00>; > > > clock-frequency = <0x16e3600>; > > > clock-output-names = "osc_24m"; > > > phandle = <0x18>; > > > }; > > > > > > Since the clock-output-names is "osc_24m" I wonder if clk_get_by_name > > > is the right function. Looking at other uses of this function, it > > > looks like it's looking for a 'clock-names' parameter and not > > > clock-output-names. > > > > Yes, it's the right answer. That is strange because it works in uboot > > image. Is the node the same in uboot-dtb? > > The U-Boot phase device tree looks like this: > > clock-osc-24m { > compatible = "fixed-clock"; > #clock-cells = <0x00>; > clock-frequency = <0x16e3600>; > clock-output-names = "osc_24m"; > bootph-pre-ram; > bootph-all; > phandle = <0x18>; > }; > I did some more investigating, and with the device tree debugging turned on, I get the following: U-Boot SPL 2025.01-rc1-00172-g14c2ad85629c-dirty (Nov 09 2024 - 17:10:26 -0600) clk_set_defaults(i2c1grp) clk_set_default_parents: could not read assigned-clock-parents for 970690 clk_set_defaults(i2c@30a20000) clk_set_default_parents: could not read assigned-clock-parents for 970f30 clk_set_defaults(clock-controller@30380000) clk_set_default_parents: could not read assigned-clock-parents for 970ab8 clk_set_defaults(clock-osc-24m) clk_set_default_parents: could not read assigned-clock-parents for 9700f8 clk_set_defaults(clock-osc-24m) clk_set_default_parents: could not read assigned-clock-parents for 9700f8 clk_get_by_name_nodev(node=92a30c, name=osc_24m, clk=96fca8) clk_get_by_index_tail: Node 'clock-controller@30380000', property 'clocks', failed to request CLK index 1: -22 clk_get_by_index_tail: uclass_get_device_by_of_offset failed: err=-22 Failed to get i2c clk clk_set_defaults(wdoggrp) clk_set_default_parents: could not read assigned-clock-parents for 970858 clk_set_defaults(watchdog@30280000) clk_set_default_parents: could not read assigned-clock-parents for 970500 WDT: Not starting watchdog@30280000 clk_set_defaults(clock-controller@30380000) clk_set_default_parents: could not read assigned-clock-parents for 970ab8 clk_get_by_name_nodev(node=92a30c, name=osc_24m, clk=96fd38) clk_get_by_index_tail: Node 'clock-controller@30380000', property 'clocks', failed to request CLK index 1: -22 Failed to find clock node. Check device tree Trying to boot from BOOTROM Boot Stage: Recovery boot ------- If I modify the code so that it doesn't return early and just skips the clock registration phase like: ret = clk_get_by_name(dev, "osc_24m", &osc_24m_clk); if (!ret) clk_dm(IMX8MN_CLK_24M, dev_get_clk_ptr(osc_24m_clk.dev)); ------ The above work-around appears to work, and the i2c appears to enable the clock-osc-24m clock.: U-Boot SPL 2025.01-rc1-00172-g14c2ad85629c-dirty (Nov 09 2024 - 17:16:06 -0600) clk_set_defaults(i2c1grp) clk_set_default_parents: could not read assigned-clock-parents for 970690 clk_set_defaults(i2c@30a20000) clk_set_default_parents: could not read assigned-clock-parents for 970f30 clk_set_defaults(clock-controller@30380000) clk_set_default_parents: could not read assigned-clock-parents for 970ab8 clk_set_defaults(clock-osc-24m) clk_set_default_parents: could not read assigned-clock-parents for 9700f8 clk_set_defaults(clock-osc-24m) clk_set_default_parents: could not read assigned-clock-parents for 9700f8 clk_get_by_name_nodev(node=92a2fc, name=osc_24m, clk=96fca8) clk_get_by_index_tail: Node 'clock-controller@30380000', property 'clocks', failed to request CLK index 1: -22 clk_set_defaults(clock-controller@30380000) clk_set_default_parents: could not read assigned-clock-parents for 970ab8 clk_of_xlate_default(clk=9712a8) clk_request(dev=970ab8, clk=9712a8) clk_enable(clk=9712a8 name=clock-controller@30380000) clk_enable(clk=975180 name=i2c1) clk_enable(clk=970190 name=clock-osc-24m) I am not sure what the difference is between osc_24m and clock-osc-24m. clk_get_rate(clk=9712a8) clk_get_rate(clk=976980) clk_get_parent_rate(clk=976980) clk_get_parent(clk=976980) clk_get_rate(clk=975180) clk_get_parent_rate(clk=975180) clk_get_parent(clk=975180) clk_get_rate(clk=970190) clk_set_defaults(pmicirqgrp) clk_set_default_parents: could not read assigned-clock-parents for 970728 clk_set_defaults(pmic@4b) clk_set_default_parents: could not read assigned-clock-parents for 970ff8 clk_set_defaults(wdoggrp) clk_set_default_parents: could not read assigned-clock-parents for 970858 clk_set_defaults(watchdog@30280000) clk_set_default_parents: could not read assigned-clock-parents for 970500 WDT: Not starting watchdog@30280000 Trying to boot from BOOTROM I am not really sure why, and / I was hoping someone might have an idea. If not, I might send a patch for this because without it, the imx8mn_beacon board doesn't run at the proper voltage for the LPDDR4 controller. adam > > > > Michael > > > > > > > > adam > > > > > > > > Michael > > > > > > > > > This method won't return prematurely, so the I2C and other clocks can > > > > > be registered, and it appears to address the problem. > > > > > Another alternative might be to move this clock registration until > > > > > after all the rest of the clocks are done. > > > > > > > > > > adam > > > > > > > > > > > > If (ret) > > > > > > > > > > > > put here a print > > > > > > > > > > > > Michael > > > > > > > adam > > > > > > > > > > > > > > > base = dev_read_addr_ptr(dev); > > > > > > > > if (!base) > > > > > > > > return -EINVAL; > > > > > > > > -- > > > > > > > > 2.43.0 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > Michael Nazzareno Trimarchi > > > > > > Co-Founder & Chief Executive Officer > > > > > > M. +39 347 913 2170 > > > > > > michael@amarulasolutions.com > > > > > > __________________________________ > > > > > > > > > > > > Amarula Solutions BV > > > > > > Joop Geesinkweg 125, 1114 AB, Amsterdam, NL > > > > > > T. +31 (0)85 111 9172 > > > > > > info@amarulasolutions.com > > > > > > www.amarulasolutions.com > > > > > > > > > > > > > > > > -- > > > > Michael Nazzareno Trimarchi > > > > Co-Founder & Chief Executive Officer > > > > M. +39 347 913 2170 > > > > michael@amarulasolutions.com > > > > __________________________________ > > > > > > > > Amarula Solutions BV > > > > Joop Geesinkweg 125, 1114 AB, Amsterdam, NL > > > > T. +31 (0)85 111 9172 > > > > info@amarulasolutions.com > > > > www.amarulasolutions.com > > > > > > > > -- > > Michael Nazzareno Trimarchi > > Co-Founder & Chief Executive Officer > > M. +39 347 913 2170 > > michael@amarulasolutions.com > > __________________________________ > > > > Amarula Solutions BV > > Joop Geesinkweg 125, 1114 AB, Amsterdam, NL > > T. +31 (0)85 111 9172 > > info@amarulasolutions.com > > www.amarulasolutions.com To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
Hi Adam, On Sat, Nov 9, 2024 at 8:23 PM Adam Ford <aford173@gmail.com> wrote: > I did some more investigating, and with the device tree debugging > turned on, I get the following: ... > clk_set_defaults(clock-controller@30380000) > clk_set_default_parents: could not read assigned-clock-parents for 970ab8 > clk_get_by_name_nodev(node=92a30c, name=osc_24m, clk=96fd38) > clk_get_by_index_tail: Node 'clock-controller@30380000', property > 'clocks', failed to request CLK index 1: -22 > Failed to find clock node. Check device tree > Trying to boot from BOOTROM > Boot Stage: Recovery boot Could you please test Marek's patch? https://patchwork.ozlabs.org/project/uboot/patch/20241122015858.557561-1-marex@denx.de/ I plan to apply it for 2025.01 to fix this regression. To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
On Fri, Nov 22, 2024 at 6:38 AM Fabio Estevam <festevam@gmail.com> wrote: > > Hi Adam, > > On Sat, Nov 9, 2024 at 8:23 PM Adam Ford <aford173@gmail.com> wrote: > > > I did some more investigating, and with the device tree debugging > > turned on, I get the following: > ... > > clk_set_defaults(clock-controller@30380000) > > clk_set_default_parents: could not read assigned-clock-parents for 970ab8 > > clk_get_by_name_nodev(node=92a30c, name=osc_24m, clk=96fd38) > > clk_get_by_index_tail: Node 'clock-controller@30380000', property > > 'clocks', failed to request CLK index 1: -22 > > Failed to find clock node. Check device tree > > Trying to boot from BOOTROM > > Boot Stage: Recovery boot > > Could you please test Marek's patch? > > https://patchwork.ozlabs.org/project/uboot/patch/20241122015858.557561-1-marex@denx.de/ Sure. Do you want me to test it against a specific branch or the master mainline branch? adam > > I plan to apply it for 2025.01 to fix this regression. To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
On Fri, Nov 22, 2024 at 10:11 AM Adam Ford <aford173@gmail.com> wrote: > Sure. Do you want me to test it against a specific branch or the > master mainline branch? Master branch, please. To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
On Fri, Nov 22, 2024 at 7:17 AM Fabio Estevam <festevam@gmail.com> wrote: > > On Fri, Nov 22, 2024 at 10:11 AM Adam Ford <aford173@gmail.com> wrote: > > > Sure. Do you want me to test it against a specific branch or the > > master mainline branch? > > Master branch, please. I should have a response for you by Monday. adam To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c index ed9e16d7c1..bfd1677520 100644 --- a/drivers/clk/imx/clk-imx8mn.c +++ b/drivers/clk/imx/clk-imx8mn.c @@ -57,15 +57,15 @@ static const char *imx8mn_usdhc2_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy "sys_pll3_out", "sys_pll1_266m", "audio_pll2_out", "sys_pll1_100m", }; #if CONFIG_IS_ENABLED(DM_SPI) -static const char *imx8mn_ecspi1_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", +static const char *imx8mn_ecspi1_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", "sys_pll2_250m", "audio_pll2_out", }; -static const char *imx8mn_ecspi2_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", +static const char *imx8mn_ecspi2_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", "sys_pll2_250m", "audio_pll2_out", }; -static const char *imx8mn_ecspi3_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", +static const char *imx8mn_ecspi3_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", "sys_pll2_250m", "audio_pll2_out", }; #endif @@ -105,7 +105,7 @@ static const char *imx8mn_usdhc3_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy static const char *imx8mn_qspi_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sys_pll2_333m", "sys_pll2_500m", "audio_pll2_out", "sys_pll1_266m", "sys_pll3_out", "sys_pll1_100m", }; -static const char * const imx8mn_nand_sels[] = {"osc_24m", "sys_pll2_500m", "audio_pll1_out", +static const char * const imx8mn_nand_sels[] = {"clock-osc-24m", "sys_pll2_500m", "audio_pll1_out", "sys_pll1_400m", "audio_pll2_out", "sys_pll3_out", "sys_pll2_250m", "video_pll_out", }; @@ -119,7 +119,9 @@ static const char * const imx8mn_usb_phy_sels[] = {"clock-osc-24m", "sys_pll1_10 static int imx8mn_clk_probe(struct udevice *dev) { + struct clk osc_24m_clk; void __iomem *base; + int ret; base = (void *)ANATOP_BASE_ADDR; @@ -238,6 +240,11 @@ static int imx8mn_clk_probe(struct udevice *dev) clk_dm(IMX8MN_SYS_PLL2_1000M, imx_clk_fixed_factor("sys_pll2_1000m", "sys_pll2_out", 1, 1)); + ret = clk_get_by_name(dev, "osc_24m", &osc_24m_clk); + if (ret) + return ret; + clk_dm(IMX8MN_CLK_24M, dev_get_clk_ptr(osc_24m_clk.dev)); + base = dev_read_addr_ptr(dev); if (!base) return -EINVAL;