mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-15 19:51:37 +00:00
sifive: make WayEnable can be configured by menuconfig
Signed-off-by:Wei Fu <wefu@redhat.com>
This commit is contained in:
parent
954644d8f5
commit
b3f2cfad94
2 changed files with 16 additions and 0 deletions
12
drivers/cache/Kconfig
vendored
12
drivers/cache/Kconfig
vendored
|
@ -46,4 +46,16 @@ config SIFIVE_CCACHE
|
|||
This driver is for SiFive Composable L2/L3 cache. It enables cache
|
||||
ways of composable cache.
|
||||
|
||||
config SIFIVE_CCACHE_WAYENABLE_OPT
|
||||
bool "SiFive composable cache: customized the largest way enabled."
|
||||
depends on SIFIVE_CCACHE
|
||||
|
||||
config SIFIVE_CCACHE_WAYENABLE_NUM
|
||||
int "SiFive composable cache: the largest way which will be enabled"
|
||||
depends on SIFIVE_CCACHE_WAYENABLE_OPT
|
||||
default 1
|
||||
range 1 256
|
||||
help
|
||||
Range[1, 256]. The index of the largest way which will be enabled.
|
||||
|
||||
endmenu
|
||||
|
|
4
drivers/cache/cache-sifive-ccache.c
vendored
4
drivers/cache/cache-sifive-ccache.c
vendored
|
@ -35,6 +35,10 @@ static int sifive_ccache_enable(struct udevice *dev)
|
|||
config = readl(priv->base + SIFIVE_CCACHE_CONFIG);
|
||||
ways = FIELD_GET(SIFIVE_CCACHE_CONFIG_WAYS, config);
|
||||
|
||||
#if CONFIG_IS_ENABLED(SIFIVE_CCACHE_WAYENABLE_OPT)
|
||||
if (CONFIG_SIFIVE_CCACHE_WAYENABLE_NUM < ways)
|
||||
ways = CONFIG_SIFIVE_CCACHE_WAYENABLE_NUM;
|
||||
#endif
|
||||
writel(ways - 1, priv->base + SIFIVE_CCACHE_WAY_ENABLE);
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue