Skip to content

Commit 3fb787e

Browse files
bjdooks-sifivepalmer-dabbelt
authored andcommitted
soc: sifive: ccache: reduce printing on init
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 <ben.dooks@sifive.com> Signed-off-by: Zong Li <zong.li@sifive.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20220913061817.22564-5-zong.li@sifive.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 95f196f commit 3fb787e

1 file changed

Lines changed: 11 additions & 14 deletions

File tree

drivers/soc/sifive/sifive_ccache.c

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,17 @@ static void setup_sifive_debug(void)
8181

8282
static void ccache_config_read(void)
8383
{
84-
u32 regval, val;
85-
86-
regval = readl(ccache_base + SIFIVE_CCACHE_CONFIG);
87-
val = regval & 0xFF;
88-
pr_info("CCACHE: No. of Banks in the cache: %d\n", val);
89-
val = (regval & 0xFF00) >> 8;
90-
pr_info("CCACHE: No. of ways per bank: %d\n", val);
91-
val = (regval & 0xFF0000) >> 16;
92-
pr_info("CCACHE: Sets per bank: %llu\n", (uint64_t)1 << val);
93-
val = (regval & 0xFF000000) >> 24;
94-
pr_info("CCACHE: Bytes per cache block: %llu\n", (uint64_t)1 << val);
95-
96-
regval = readl(ccache_base + SIFIVE_CCACHE_WAYENABLE);
97-
pr_info("CCACHE: Index of the largest way enabled: %d\n", regval);
84+
u32 cfg;
85+
86+
cfg = readl(ccache_base + SIFIVE_CCACHE_CONFIG);
87+
88+
pr_info("CCACHE: %u banks, %u ways, sets/bank=%llu, bytes/block=%llu\n",
89+
(cfg & 0xff), (cfg >> 8) & 0xff,
90+
BIT_ULL((cfg >> 16) & 0xff),
91+
BIT_ULL((cfg >> 24) & 0xff));
92+
93+
cfg = readl(ccache_base + SIFIVE_CCACHE_WAYENABLE);
94+
pr_info("CCACHE: Index of the largest way enabled: %u\n", cfg);
9895
}
9996

10097
static const struct of_device_id sifive_ccache_ids[] = {

0 commit comments

Comments
 (0)