Files
Linux_Drivers/u-boot-2021.10/arch/riscv/lib/sifive_cache.c
sam.xiang f8fc109960 [uboot] create uboot from github:
repo: https://github.com/u-boot/u-boot
	commit: d80bb749fab53da72c4a0e09b8c2d2aaa3103c91

Change-Id: Ie6434426e1ec15bc08bb1832798e371f3fd5fb29
2023-03-10 20:30:57 +08:00

28 lines
490 B
C

// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2021 SiFive, Inc
*/
#include <common.h>
#include <cache.h>
#include <cpu_func.h>
#include <dm.h>
void enable_caches(void)
{
struct udevice *dev;
int ret;
/* Enable ways of ccache */
ret = uclass_get_device_by_driver(UCLASS_CACHE,
DM_DRIVER_GET(sifive_ccache),
&dev);
if (ret) {
log_debug("Cannot enable cache ways");
} else {
ret = cache_enable(dev);
if (ret)
log_debug("ccache enable failed");
}
}