Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6176505rwn; Mon, 12 Sep 2022 23:21:57 -0700 (PDT) X-Google-Smtp-Source: AA6agR6eGuxmNWiLQZl2I3QpXNQFSt1EhWAjGHNoohg4wVWqgyADCPDKMD6jAWd5Njt5dhtcpIEc X-Received: by 2002:a17:907:94c7:b0:730:d5bc:14c with SMTP id dn7-20020a17090794c700b00730d5bc014cmr21310974ejc.68.1663050117153; Mon, 12 Sep 2022 23:21:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663050117; cv=none; d=google.com; s=arc-20160816; b=PkIv+l8eOJvQFffSLl2LYFLzm47qJyUF4Ud9RweVCXb5G97+MbOjAhKfInCqJeApnv Eaggjb8bYzpYLUqo6NspqJttKbApd2XTqP0RuvCRQCKiUZnlAexyFzFBslBHnonIATC3 rtlb8nlXsXeraXxF/zC6F4qVGtKZTq+4V2Fzu5i08maYsPsYWj92TCWIMeArjRREzpT4 mYr3awXUUvu2jzhN7cQaG2fh25g0M9H2yxEc4q5D5pFqz/gNeLJhLmkM5DzWmhigguTT VQUGratEGwDQsq6lQpEXTomO4hfMZPhenDuyCCRSLJXkNMMCE4umjYJwDSRpzkB+3ucP eRUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=6Xe3R/apOfj9yPTgHstXk1duLFBJjDM/Rtwt0f9H5Eo=; b=xp68trG23GKmL6yqCLtsPR68dlw9mujmjVybEFEvC8xWu3SIfL0FeQgFk5SFywAxk+ JYyV2bqkT8fWD/C06lYppUu9nj7lLkRWh8gaooqL7FYxiXqV9eqv15nDne5aXDh5F/Xl aekM4DOzZavAmHoPGUfP/Tu6FM37EQkhAwcQubbLYad9F1nJp8n9IUQaOtnlFRnMI5XS cOeIyCvFSD2L8q1gukjYK6N+1lGvJJZusD0R5ifA80aub8b26hnpVQvwi99256mtqb6w 5tAsYRwIGhBXU1cZX/3vPaHpRD1MnHJgMr7FWAoU+1XTgni7F+isla7S3oxY7PiRheev gQPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=IgoMd+u3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u4-20020a50d504000000b00450d0a3d76dsi8376740edi.197.2022.09.12.23.21.32; Mon, 12 Sep 2022 23:21:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=IgoMd+u3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230303AbiIMGTM (ORCPT + 99 others); Tue, 13 Sep 2022 02:19:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230242AbiIMGSj (ORCPT ); Tue, 13 Sep 2022 02:18:39 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3F9E57546 for ; Mon, 12 Sep 2022 23:18:36 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id j12so10768065pfi.11 for ; Mon, 12 Sep 2022 23:18:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date; bh=6Xe3R/apOfj9yPTgHstXk1duLFBJjDM/Rtwt0f9H5Eo=; b=IgoMd+u3Sm/bJS7kCMLfQkYbB0LDum24SEmPzf81Dli83n/7DWclAijuMnc2ag70Dj C8p4BqoBvQuAuLEz6gUs8vSbA5gGTEafAglSpKreyZuFw2ZX63tqtZ8U/dHkSyygD5fG Yfo0PXzP7PvU5CVP8Ddfrlgksld0VirTSAP30glA91Q7ZhFXwsMMUkR+d+JY/qB5+GQL qIYUs5FVpgRIWY72xdriOzcJKiXQ4/I12hNhcpWveBIPHQRhS/psJkE7lT/37q9dZy0R fmI1kyNum/HPtVCrJwaXU+M8o9K8EWxGWltQfz24RbeL/+YS/FYNF9qYVxz9lESgCbWr yu/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date; bh=6Xe3R/apOfj9yPTgHstXk1duLFBJjDM/Rtwt0f9H5Eo=; b=zOytmO0GEIhU1UKx9Z/17v7iSsUr0M+ammtd4mUZo+WkVAbvxO25t0bFrt7UnaI/Cs yrSEqG9DvXF5qIsdvHwmp5WXHD06v+0CAOCbN8eqcgYxYAQYWd02wTFW2WSKiPM3BIWE jf6siMlLyY2xxCe5EFm94AJO41zAkSH5thc3ABJgrvXEPjpBrrhsdEyyYkMnejPWHbPr p/C4Ue+AOtcJyvQnHi/JeDbZiqOb0WSZe4VcMftrTy7Y4jGYxKt8Wg4Nj3Sjf42EWVq6 g4ei0XM3+8o4CjMyrMEXT0G54bR9awnR7+74F2QS3KTpACtOmchQeNXE5G0zMJAt/vqQ 0Zqg== X-Gm-Message-State: ACgBeo223V+Z1Ygxq3HsWcC/jMZNilJzsFvdNIaiYdmZbQZ5XcdT9+/Z WZONkC5EV4u4sthuvYSztiPj6g== X-Received: by 2002:a05:6a00:2181:b0:51b:560b:dd30 with SMTP id h1-20020a056a00218100b0051b560bdd30mr31748430pfi.44.1663049916137; Mon, 12 Sep 2022 23:18:36 -0700 (PDT) Received: from localhost.localdomain (59-124-168-89.hinet-ip.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id z11-20020a170902cccb00b00173cfaed233sm7296332ple.62.2022.09.12.23.18.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 23:18:35 -0700 (PDT) From: Zong Li To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, palmer@dabbelt.com, paul.walmsley@sifive.com, aou@eecs.berkeley.edu, greentime.hu@sifive.com, conor.dooley@microchip.com, ben.dooks@sifive.com, bp@alien8.de, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Zong Li Subject: [PATCH v5 4/7] soc: sifive: ccache: reduce printing on init Date: Tue, 13 Sep 2022 06:18:14 +0000 Message-Id: <20220913061817.22564-5-zong.li@sifive.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220913061817.22564-1-zong.li@sifive.com> References: <20220913061817.22564-1-zong.li@sifive.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ben Dooks The driver prints out 6 lines on startup, which can easily be redcued to two lines without losing any information. Note, to make the types work better, uint64_t has been replaced with ULL to make the unsigned long long match the format in the print statement. Signed-off-by: Ben Dooks Signed-off-by: Zong Li Reviewed-by: Conor Dooley --- drivers/soc/sifive/sifive_ccache.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/soc/sifive/sifive_ccache.c b/drivers/soc/sifive/sifive_ccache.c index b361b661ea09..17080af7dfa0 100644 --- a/drivers/soc/sifive/sifive_ccache.c +++ b/drivers/soc/sifive/sifive_ccache.c @@ -81,20 +81,17 @@ static void setup_sifive_debug(void) static void ccache_config_read(void) { - u32 regval, val; - - regval = readl(ccache_base + SIFIVE_CCACHE_CONFIG); - val = regval & 0xFF; - pr_info("CCACHE: No. of Banks in the cache: %d\n", val); - val = (regval & 0xFF00) >> 8; - pr_info("CCACHE: No. of ways per bank: %d\n", val); - val = (regval & 0xFF0000) >> 16; - pr_info("CCACHE: Sets per bank: %llu\n", (uint64_t)1 << val); - val = (regval & 0xFF000000) >> 24; - pr_info("CCACHE: Bytes per cache block: %llu\n", (uint64_t)1 << val); - - regval = readl(ccache_base + SIFIVE_CCACHE_WAYENABLE); - pr_info("CCACHE: Index of the largest way enabled: %d\n", regval); + u32 cfg; + + cfg = readl(ccache_base + SIFIVE_CCACHE_CONFIG); + + pr_info("CCACHE: %u banks, %u ways, sets/bank=%llu, bytes/block=%llu\n", + (cfg & 0xff), (cfg >> 8) & 0xff, + BIT_ULL((cfg >> 16) & 0xff), + BIT_ULL((cfg >> 24) & 0xff)); + + cfg = readl(ccache_base + SIFIVE_CCACHE_WAYENABLE); + pr_info("CCACHE: Index of the largest way enabled: %u\n", cfg); } static const struct of_device_id sifive_ccache_ids[] = { -- 2.17.1