From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 43D22C433F5 for ; Tue, 30 Nov 2021 12:51:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 732FD8307D; Tue, 30 Nov 2021 13:51:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="CTYVWad3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E412883080; Tue, 30 Nov 2021 13:51:46 +0100 (CET) Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 794D783070 for ; Tue, 30 Nov 2021 13:51:42 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x829.google.com with SMTP id q14so19984680qtx.10 for ; Tue, 30 Nov 2021 04:51:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=orl5qDmKkqZmlXJFLUSBRFfeGH5J5CZolpRn2baXCOQ=; b=CTYVWad3svWucVTAkUgcoOTPczVL+FN5gEdImSQkqRe8uSXq+3JGyNTykgAywdghSS hWUhhJVnleQEPeDyLMr0q9MXPh9cGh5jL18XkSD+4zt027Gdfv6sDAQN4bkcdqACp9hf WmxtiezIP24BCcRbJYGJFgE1eQxxbFoBx/OMw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=orl5qDmKkqZmlXJFLUSBRFfeGH5J5CZolpRn2baXCOQ=; b=6zX1ayt/80bzThbEmmJH1bjPCBPqsZdWiCr+QbswZh+pdE2Wr+CcBVHiqdhD2h+0JU 1kiV1uqhP+NNCOyHazL5AjuB80ZnUNflOCu0RD/KSPxISRSSbR1pAktkMaprarM43PLF GQXzuS/NoE7h+ptGFi7aJzqfhilJTL42YcM8fQkeNkMYboWOjXMv4bDiiHggtkfGS9Wq vFjDIHHSXiKF74/8v2S6NiLVbFSQsynZ3lEEhMdPfzxGfsE2SMKTteADwQnNViKCye/Q TnmvuZT/o31TmMEx9ZVqVfeVWBlUJ1I6ZpDxW7i3Z4ClnSwG2o0Vna9wt3hJXhr7RxGd tTUw== X-Gm-Message-State: AOAM533oSEHuFcteyP6Om0mylUhgt8uvTSNOn6KZKu4dW/W2wAaC+CBh pNOOynFyBRdVx2r621BK8cUu8g== X-Google-Smtp-Source: ABdhPJwC1N5QMPJ/rT9P7IYPN/oe7jo6VrMbmDDsiHtlcuqIxIrLOvsIb6A8zvJZ0XijYsrQmMg85g== X-Received: by 2002:a05:622a:1487:: with SMTP id t7mr49766043qtx.326.1638276701179; Tue, 30 Nov 2021 04:51:41 -0800 (PST) Received: from bill-the-cat (2603-6081-7b01-cbda-edec-aa90-ebd5-017a.res6.spectrum.com. [2603:6081:7b01:cbda:edec:aa90:ebd5:17a]) by smtp.gmail.com with ESMTPSA id b11sm10847544qtx.85.2021.11.30.04.51.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 04:51:40 -0800 (PST) Date: Tue, 30 Nov 2021 07:51:38 -0500 From: Tom Rini To: Stefan =?iso-8859-1?Q?M=E4tje?= Cc: "u-boot@lists.denx.de" , "jagan@amarulasolutions.com" Subject: Re: [PATCH 1/1] Fix wrong QSPI clock calculation for AM4372 Message-ID: <20211130125138.GW24579@bill-the-cat> References: <20211130000656.1837826-1-stefan.maetje@esd.eu> <20211130000656.1837826-2-stefan.maetje@esd.eu> <20211130035841.GV24579@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GYYQJgmUJBEYYRv8" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.37 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 --GYYQJgmUJBEYYRv8 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 30, 2021 at 12:14:12PM +0000, Stefan M=E4tje wrote: > Am Montag, den 29.11.2021, 22:58 -0500 schrieb Tom Rini: > > On Tue, Nov 30, 2021 at 01:06:56AM +0100, Stefan M=E4tje wrote: > >=20 > > > On AM4372 the SPI_GCLK input gets its clock from the PRCM module which > > > divides the PER_CLKOUTM2 frequency (192MHz) by a fixed factor of 4. > > > See AM437x Reference Manual in section 27 QSPI >> 27.2 Integration. > > >=20 > > > The QSPI_FCLK therefore needs to take this factor into account and > > > becomes (192000000 / 4). > > >=20 > > > Signed-off-by: Stefan M=E4tje > > > --- > > > drivers/spi/ti_qspi.c | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > >=20 > > > diff --git a/drivers/spi/ti_qspi.c b/drivers/spi/ti_qspi.c > > > index 664b9cad79..bccdeeaf82 100644 > > > --- a/drivers/spi/ti_qspi.c > > > +++ b/drivers/spi/ti_qspi.c > > > @@ -25,7 +25,8 @@ DECLARE_GLOBAL_DATA_PTR; > > > =20 > > > /* ti qpsi register bit masks */ > > > #define QSPI_TIMEOUT 2000000 > > > -#define QSPI_FCLK 192000000 > > > +/* AM4372: QSPI gets SPI_GCLK from PRCM unit as PER_CLKOUTM2 divided= by 4. > > > */ > > > +#define QSPI_FCLK (192000000 / 4) > > > #define QSPI_DRA7XX_FCLK 76800000 > > > #define QSPI_WLEN_MAX_BITS 128 > > > #define QSPI_WLEN_MAX_BYTES (QSPI_WLEN_MAX_BITS >> 3) > >=20 > > How is this treated in the kernel? Thanks. > >=20 > The current driver in mainline Linux @drivers/spi/spi-ti-qspi.c still has > the wrong QSPI_FCLK define, but it seems to be used nowhere any more. >=20 > The driver gets its "fclk" from the device tree. But the device tree > (arch/arm/boot/dts/am4372.dtsi) was broken till this patch on the > mainline kernel: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit= /arch/arm/boot/dts/am4372.dtsi?id=3Df60c41257fa06d496c9653d3f77d34b7426d9274 >=20 > It seems to me that there the first time a valid "fclk" property > was provided to the qspi module. OK, thanks for checking! --=20 Tom --GYYQJgmUJBEYYRv8 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmGmHlQACgkQFHw5/5Y0 tyyCVAv/ZyjHHF2ACYYIreAfN4HKrjQPzeOkeYaPsBKBfIj38IozoPLOA/05HlW/ W+voawNU9DALoHtItOCs4jMXa07MB3s6ZDjASNp/PfahRHjpYeEOeMUthkSMpcFl AEBgHJTJa4YCbI9dC9czoRF9flYvS2DYMB29Fjs/VKghPtnzimsTA164Dpms4pIa LD96ucHK3JcMy1/hyvCSpWxIHWV8BhJUzARkQlOGV1pO7icB2zTYNU4WYgfV39rF 89fUNqGNk6Dh9limebIjw2a2tTmmOsgEjqWvHUBJnrvmYHf9Kn/pOtKMcVKYZZfT OQFfINW04WaPfS02r/sfB+4UoW1qJwih6BKeJXlY0I4IVVAtfb0LvjQ5otD7qcGr tRug3slqPyrchN6ujEGZa2LrDghHXQwL//fheSulateQZ8+eR30zfsWsaISn7W0Z MG99sUNTdktsD1f8yGZhaiVDrWFedzaemUrGiiw0x7GZhzKAmQnSB6zrzOzbLiq4 EHJlKz7S =Jnuq -----END PGP SIGNATURE----- --GYYQJgmUJBEYYRv8--