blob: 955dfc8a0f844be525c8171455d4780734c445de [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#include <errno.h>
Simon Glass401d1c42020-10-30 21:38:53 -060010#include <asm/global_data.h>
Dinh Nguyen84b124d2019-04-23 16:55:03 -050011
12DECLARE_GLOBAL_DATA_PTR;
13
14static int sandbox_get_info(struct udevice *dev, struct cache_info *info)
15{
16 info->base = 0x11223344;
17
18 return 0;
19}
20
Rick Chenabd858e2019-08-28 18:46:05 +080021static int sandbox_enable(struct udevice *dev)
22{
23 return 0;
24}
25
26static int snadbox_disable(struct udevice *dev)
27{
28 return 0;
29}
30
31
Dinh Nguyen84b124d2019-04-23 16:55:03 -050032static const struct cache_ops sandbox_cache_ops = {
33 .get_info = sandbox_get_info,
Wolfgang Denk0cf207e2021-09-27 17:42:39 +020034 .enable = sandbox_enable,
Rick Chenabd858e2019-08-28 18:46:05 +080035 .disable = snadbox_disable,
Dinh Nguyen84b124d2019-04-23 16:55:03 -050036};
37
38static const struct udevice_id sandbox_cache_ids[] = {
39 { .compatible = "sandbox,cache" },
40 { }
41};
42
43U_BOOT_DRIVER(cache_sandbox) = {
44 .name = "cache_sandbox",
45 .id = UCLASS_CACHE,
46 .of_match = sandbox_cache_ids,
47 .ops = &sandbox_cache_ops,
48};