[uboot] create uboot from github:
repo: https://github.com/u-boot/u-boot commit: d80bb749fab53da72c4a0e09b8c2d2aaa3103c91 Change-Id: Ie6434426e1ec15bc08bb1832798e371f3fd5fb29
This commit is contained in:
27
u-boot-2021.10/arch/riscv/lib/sifive_cache.c
Normal file
27
u-boot-2021.10/arch/riscv/lib/sifive_cache.c
Normal file
@ -0,0 +1,27 @@
|
||||
// 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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user