Zong Li | c39544c | 2021-09-01 15:01:41 +0800 | [diff] [blame] | 1 | // 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 | |
| 11 | void 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 | } |