blob: 3b20a10f087d06b80caab67e3b48bd190fdc1c09 [file] [log] [blame]
Dinh Nguyen84b124d2019-04-23 16:55:03 -05001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2019 Intel Corporation <www.intel.com>
4 */
5
6#include <common.h>
7#include <cache.h>
8#include <dm.h>
9
10int cache_get_info(struct udevice *dev, struct cache_info *info)
11{
12 struct cache_ops *ops = cache_get_ops(dev);
13
14 if (!ops->get_info)
15 return -ENOSYS;
16
17 return ops->get_info(dev, info);
18}
19
Rick Chen4d0140e2019-08-28 18:46:04 +080020int cache_enable(struct udevice *dev)
21{
22 struct cache_ops *ops = cache_get_ops(dev);
23
24 if (!ops->enable)
25 return -ENOSYS;
26
27 return ops->enable(dev);
28}
29
30int cache_disable(struct udevice *dev)
31{
32 struct cache_ops *ops = cache_get_ops(dev);
33
34 if (!ops->disable)
35 return -ENOSYS;
36
37 return ops->disable(dev);
38}
39
Dinh Nguyen84b124d2019-04-23 16:55:03 -050040UCLASS_DRIVER(cache) = {
41 .id = UCLASS_CACHE,
42 .name = "cache",
43 .post_bind = dm_scan_fdt_dev,
44};