Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp649508pxu; Sun, 22 Nov 2020 23:39:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJzofCaFqGGa/N0L4nfe8oNZPV1qgCPTZHUlY01cNYBM7vmnly7zmy/36ZwuXMl988RSEoCE X-Received: by 2002:a17:906:1e0c:: with SMTP id g12mr41265296ejj.115.1606117164562; Sun, 22 Nov 2020 23:39:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606117164; cv=none; d=google.com; s=arc-20160816; b=u3owz5gc36dNzpWTCvQ2gzBWd8Rya80x4MBDx9zMc2gqZ7DTIG2DzdM+qUpf5B/gEO Hgj5TsVgE3VqlPYZZ6NWYlFo0BGlMjJi6fDvx7PZp3qJoSSg2UYsFudm8B6JaEiU2smU VrsxheIuvoPsuYQlT3gag+Wz0qpm8sGrvCSYY94681haAEOM0r4GtFQIeVGjnLvMcD6n e5NGUVCQfbZT5zntIlLyc1ht4u+hdiVNs73D/gbAXbN3ZfpIGHHWLXS6ItF5Mk6RO4zR nBI8rpMpWgSSz8UnlZqDdIC8gFoqBUi54tNXntiQW63UIv8pLdFRDHMBcjg5Duno21CJ ZJ7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=sfKjG2GvoDhQiB7EpkscGKZ+97rkBF/pnq0LhdxYBSQ=; b=UylN46Fvlg9m/fS9RDLDVAB/oJdvJScb4/E9jAzxpT016xZYZEL2JmeWOZmYsN4vhd 1bfoO0cL50itaGncFAZfoAQpCs55Hm/R5D7awuocQXj1HDxjLD+ToMSkwQtbD8dbTVTG idCaJCEZypEN5Q6mrDHoYhC3EFlD9mUsfRpxangdKC1LHwkC/CJTg8bS+r7RW5yuPI9l tC3yfC8C4PnrIihX6nir1BcGS/+vm1KwTCEM+T2apm9Hcd3gUzTwcXhac2h63sUhEVwF 2c0chYRZ21Ro+9IJC5FqCfJZNcQZgzYpObvPf6GdN+gSySqbB99tiCuH+LaExp/NHvrg HNfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=Nhi41X2p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a13si6187202ejc.128.2020.11.22.23.39.02; Sun, 22 Nov 2020 23:39:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=Nhi41X2p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727397AbgKWHS3 (ORCPT + 99 others); Mon, 23 Nov 2020 02:18:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726921AbgKWHS2 (ORCPT ); Mon, 23 Nov 2020 02:18:28 -0500 Received: from mail-ot1-x341.google.com (mail-ot1-x341.google.com [IPv6:2607:f8b0:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45845C061A4D for ; Sun, 22 Nov 2020 23:18:28 -0800 (PST) Received: by mail-ot1-x341.google.com with SMTP id f12so3564797oto.10 for ; Sun, 22 Nov 2020 23:18:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sfKjG2GvoDhQiB7EpkscGKZ+97rkBF/pnq0LhdxYBSQ=; b=Nhi41X2pbTeawhTkWHetJJ8SzZ7jdWhXuzFPECnPqfmjT2n5H0aJE/I9Fhz5WpkOTi U1f2uuCWR5MWR2ZUnRWcMSrmka1wwVzu4a6pwiYKsFabNZqQNgXJiJtVdQg6fBKG/ojv wQoiop9+kZRRADXjWOAF/gd5OO+gMdZdnWewS7O9jsEwzxEuyzSYSbmjWGXuCLu3smeQ aS/po47CbgOhCG5PUD2dzUI/mjZVLQVhLYtj9N8+Ga+eh9ixBzz4dcx2Roiqpt4QI0Al kmDFP01bTVN1xbUdqzWFwfsEyaL8LjqdkSyLMg1fWWx/9PneRe4zhP1jMIaBy3BPBPMv 92TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sfKjG2GvoDhQiB7EpkscGKZ+97rkBF/pnq0LhdxYBSQ=; b=CTIRnaRIvAvuxd8NG4IpSbUZu25t7pzqxvksZHzBPDTFOp93qUSF1Adj8gUe3plV91 pL+pJwoVtEbgUMGNvIH3wWzTC8pwUA6yNDmpjYJH3zE4YXF0PMJFF8nLnmAg+ZXMrHCl 5kzMmXgHP+ojJiOoOJ7YDL7/lh7UrpGoy0Q8HIkJWP3/PKb0xGPMmY27huzTMu7oORPO /w5Yak9gLoZsEYp/mF4QeX5aPK0Vj26H8lx2nVHQgBTYWGJABAhHIXBRcZvdmCU68IdU G0C8LPy4MDgFpE/c78iRcXExtO+N4e0P3fpWfcsZBKy/LS8UouBbj7Pw9y37EnXWTFsu mh8g== X-Gm-Message-State: AOAM532BYcmRBs7JQ8vCLElqV50VX5REoDcxZx7DvS8QtGXWEe9NwTgt FvxPtSM3zgMRbz4//0Y1RhE6JFukI1feCEPjQQYTRA== X-Received: by 2002:a9d:6f8f:: with SMTP id h15mr22428460otq.166.1606115907677; Sun, 22 Nov 2020 23:18:27 -0800 (PST) MIME-Version: 1.0 References: <20201111100608.108842-5-zong.li@sifive.com> In-Reply-To: From: Zong Li Date: Mon, 23 Nov 2020 15:18:17 +0800 Message-ID: Subject: Re: [PATCH v4 4/4] clk: sifive: Fix the wrong bit field shift To: Palmer Dabbelt Cc: Paul Walmsley , Stephen Boyd , Andreas Schwab , Pragnesh Patel , Albert Ou , Michael Turquette , Yash Shah , "linux-kernel@vger.kernel.org List" , linux-clk@vger.kernel.org, linux-riscv , Pragnesh Patel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 21, 2020 at 9:29 AM Palmer Dabbelt wrote: > > On Wed, 11 Nov 2020 02:06:08 PST (-0800), zong.li@sifive.com wrote: > > The clk enable bit should be 31 instead of 24. > > > > Signed-off-by: Zong Li > > Reported-by: Pragnesh Patel > > --- > > drivers/clk/sifive/sifive-prci.h | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/clk/sifive/sifive-prci.h b/drivers/clk/sifive/sifive-prci.h > > index 802fc8fb9c09..da7be9103d4d 100644 > > --- a/drivers/clk/sifive/sifive-prci.h > > +++ b/drivers/clk/sifive/sifive-prci.h > > @@ -59,7 +59,7 @@ > > > > /* DDRPLLCFG1 */ > > #define PRCI_DDRPLLCFG1_OFFSET 0x10 > > -#define PRCI_DDRPLLCFG1_CKE_SHIFT 24 > > +#define PRCI_DDRPLLCFG1_CKE_SHIFT 31 > > #define PRCI_DDRPLLCFG1_CKE_MASK (0x1 << PRCI_DDRPLLCFG1_CKE_SHIFT) > > > > /* GEMGXLPLLCFG0 */ > > @@ -81,7 +81,7 @@ > > > > /* GEMGXLPLLCFG1 */ > > #define PRCI_GEMGXLPLLCFG1_OFFSET 0x20 > > -#define RCI_GEMGXLPLLCFG1_CKE_SHIFT 24 > > +#define RCI_GEMGXLPLLCFG1_CKE_SHIFT 31 > > #define PRCI_GEMGXLPLLCFG1_CKE_MASK (0x1 << PRCI_GEMGXLPLLCFG1_CKE_SHIFT) > > > > /* CORECLKSEL */ > > Section 7.3 of v1.0 of the FU540 manual says that bit 24 contains the PLL clock > enable for both of these. I don't know if that's accurate, but if it is then I > believe this would break the FU540. Don't have one to test on, though. Yes, the manual seems to be wrong and should be corrected. It doesn't break the FU540 yet because we don't use these fields in s-mode Linux driver, we set them in m-mode FSBL/U-boot-SPL bootloader during boot time, and the implementation of FSBL and U-boot-SPL both are correct. The following link is the U-boot SPL source: https://github.com/u-boot/u-boot/blob/da09b99ea572cec9a114872e480b798db11f9c6e/drivers/clk/sifive/fu540-prci.c#L128