blob: 28154878fcc864ac3ab36d489235590ced920c82 [file] [log] [blame]
Zong Lic39544c2021-09-01 15:01:41 +08001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2021 SiFive, Inc
4 */
5
6#include <common.h>
7#include <cache.h>
8#include <cpu_func.h>
9#include <dm.h>
10
11void enable_caches(void)
12{
13 struct udevice *dev;
14 int ret;
15
16 /* Enable ways of ccache */
17 ret = uclass_get_device_by_driver(UCLASS_CACHE,
18 DM_DRIVER_GET(sifive_ccache),
19 &dev);
20 if (ret) {
21 log_debug("Cannot enable cache ways");
22 } else {
23 ret = cache_enable(dev);
24 if (ret)
25 log_debug("ccache enable failed");
26 }
27}