Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,PDS_BAD_THREAD_QP_64,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE636C48BC2 for ; Thu, 24 Jun 2021 03:29:54 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A4F50613B4 for ; Thu, 24 Jun 2021 03:29:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A4F50613B4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=m2i.co.kr Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BEAB2829FB; Thu, 24 Jun 2021 05:29:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=m2i.co.kr Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id CA699829E9; Thu, 24 Jun 2021 04:18:54 +0200 (CEST) Received: from smtp1.hiworks.co.kr (smtp1.hiworks.co.kr [121.254.168.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EAD3B829E2 for ; Thu, 24 Jun 2021 04:18:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=m2i.co.kr Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tykwon@m2i.co.kr Received: (qmail 8105 invoked from network); 24 Jun 2021 11:18:46 +0900 Received: from unknown (HELO hiworks.co.kr) (192.168.10.224) by 0 (qmail 1.03 + ejcp v14) with SMTP; 24 Jun 2021 11:18:46 +0900 Received: (qmail 127814 invoked from network); 24 Jun 2021 11:18:45 +0900 Received: from unknown (HELO DESKTOP3HTLQGF) (tykwon@m2i.co.kr@58.75.176.98) by 0 (qmail 1.03 + ejcp v14) with SMTP; 24 Jun 2021 11:18:45 +0900 X-Authinfo: HIWORKS SMTP authenticated From: =?UTF-8?B?6raM7YOc7JiB?= To: "'Fabio Estevam'" Cc: "'Stefano Babic'" , "'NXP i.MX U-Boot Team'" , "'U-Boot-Denx'" References: <20210624011252.4968-1-tykwon@m2i.co.kr> In-Reply-To: Subject: RE: [PATCH] clock_imx8mq: Added 66 MHz support for QSPI Date: Thu, 24 Jun 2021 11:18:48 +0900 Message-ID: <216501d7689f$4477ce30$cd676a90$@m2i.co.kr> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQI+f6C9d8VW6xid1deA4UdRtU+bnwMpMlVsqjrxl8A= Content-Language: ko X-Mailman-Approved-At: Thu, 24 Jun 2021 05:29:31 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean > Hi Kwon, > > On Wed, Jun 23, 2021 at 10:13 PM Kwon Tae-young = wrote: > > > > At the current clock setting, the maximum clock for QSPI is 25 MHz. > > In my case I use M-RAM which supports up to 100 MHz for QSPI, and = with=20 > > this change the QSPI can be clocked up to 66 MHz. > > > > Signed-off-by: Kwon Tae-young > > --- > > arch/arm/mach-imx/imx8m/clock_imx8mq.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/arch/arm/mach-imx/imx8m/clock_imx8mq.c=20 > > b/arch/arm/mach-imx/imx8m/clock_imx8mq.c > > index 8fecc60ecb..47b4a8f01f 100644 > > --- a/arch/arm/mach-imx/imx8m/clock_imx8mq.c > > +++ b/arch/arm/mach-imx/imx8m/clock_imx8mq.c > > @@ -473,11 +473,11 @@ int set_clk_qspi(void) { > > /* > > * set qspi root > > - * sys pll1 100M > > + * sys pll1 266M > > */ > > clock_enable(CCGR_QSPI, 0); > > clock_set_target_val(QSPI_CLK_ROOT, CLK_ROOT_ON | > > - CLK_ROOT_SOURCE_SEL(7)); > > + CLK_ROOT_SOURCE_SEL(5)); > > It seems there is 'divide-by 4' being set somewhere. > > What if you use CLK_ROOT_SOURCE_SEL(1) instead? > > This selects SYS_PLL1_400MHz as the QSPI parent clock and should give = you the 100MHz QSPI clock that you need. The clocks I tested are as follows. CLK_ROOT_SOURCE_SEL(0): 6.25 Mhz CLK_ROOT_SOURCE_SEL(1): 100 Mhz CLK_ROOT_SOURCE_SEL(2): 100 Mhz CLK_ROOT_SOURCE_SEL(3): 125 Mhz CLK_ROOT_SOURCE_SEL(4): 90.36 Mhz CLK_ROOT_SOURCE_SEL(5): 66.69 Mhz CLK_ROOT_SOURCE_SEL(6): 6.25 Mhz CLK_ROOT_SOURCE_SEL(7): 25 Mhz However, my board only passed the load test up to 66MHz. Should I change it to CLK_ROOT_SOURCE_SEL(1) and submit the patch?