blob: 2e20b83ab8039540550f1ab45f101cad8140a4e5 [file] [log] [blame]
Dinh Nguyend94e18e2019-04-23 16:55:03 -05001// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2019 Intel Corporation <www.intel.com>
4 */
5
Dinh Nguyend94e18e2019-04-23 16:55:03 -05006#include <cache.h>
7#include <dm.h>
8#include <errno.h>
Simon Glass3ba929a2020-10-30 21:38:53 -06009#include <asm/global_data.h>
Dinh Nguyend94e18e2019-04-23 16:55:03 -050010
11DECLARE_GLOBAL_DATA_PTR;
12
13static int sandbox_get_info(struct udevice *dev, struct cache_info *info)
14{
15 info->base = 0x11223344;
16
17 return 0;
18}
19
Rick Chena7af2862019-08-28 18:46:05 +080020static int sandbox_enable(struct udevice *dev)
21{
22 return 0;
23}
24
25static int snadbox_disable(struct udevice *dev)
26{
27 return 0;
28}
29
30
Dinh Nguyend94e18e2019-04-23 16:55:03 -050031static const struct cache_ops sandbox_cache_ops = {
32 .get_info = sandbox_get_info,
Wolfgang Denk62fb2b42021-09-27 17:42:39 +020033 .enable = sandbox_enable,
Rick Chena7af2862019-08-28 18:46:05 +080034 .disable = snadbox_disable,
Dinh Nguyend94e18e2019-04-23 16:55:03 -050035};
36
37static const struct udevice_id sandbox_cache_ids[] = {
38 { .compatible = "sandbox,cache" },
39 { }
40};
41
42U_BOOT_DRIVER(cache_sandbox) = {
43 .name = "cache_sandbox",
44 .id = UCLASS_CACHE,
45 .of_match = sandbox_cache_ids,
46 .ops = &sandbox_cache_ops,
47};