1 // 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 #include <errno.h>
10 #include <asm/global_data.h>
11 
12 DECLARE_GLOBAL_DATA_PTR;
13 
sandbox_get_info(struct udevice * dev,struct cache_info * info)14 static int sandbox_get_info(struct udevice *dev, struct cache_info *info)
15 {
16 	info->base = 0x11223344;
17 
18 	return 0;
19 }
20 
sandbox_enable(struct udevice * dev)21 static int sandbox_enable(struct udevice *dev)
22 {
23 	return 0;
24 }
25 
snadbox_disable(struct udevice * dev)26 static int snadbox_disable(struct udevice *dev)
27 {
28 	return 0;
29 }
30 
31 
32 static const struct cache_ops sandbox_cache_ops = {
33 	.get_info	= sandbox_get_info,
34 	.enable 	= sandbox_enable,
35 	.disable	= snadbox_disable,
36 };
37 
38 static const struct udevice_id sandbox_cache_ids[] = {
39 	{ .compatible = "sandbox,cache" },
40 	{ }
41 };
42 
43 U_BOOT_DRIVER(cache_sandbox) = {
44 	.name		= "cache_sandbox",
45 	.id		= UCLASS_CACHE,
46 	.of_match	= sandbox_cache_ids,
47 	.ops		= &sandbox_cache_ops,
48 };
49