Dinh Nguyen | d94e18e | 2019-04-23 16:55:03 -0500 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | /* |
| 3 | * Copyright (C) 2019 Intel Corporation <www.intel.com> |
| 4 | */ |
| 5 | |
Dinh Nguyen | d94e18e | 2019-04-23 16:55:03 -0500 | [diff] [blame] | 6 | #include <cache.h> |
| 7 | #include <dm.h> |
| 8 | #include <errno.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 9 | #include <asm/global_data.h> |
Dinh Nguyen | d94e18e | 2019-04-23 16:55:03 -0500 | [diff] [blame] | 10 | |
| 11 | DECLARE_GLOBAL_DATA_PTR; |
| 12 | |
| 13 | static int sandbox_get_info(struct udevice *dev, struct cache_info *info) |
| 14 | { |
| 15 | info->base = 0x11223344; |
| 16 | |
| 17 | return 0; |
| 18 | } |
| 19 | |
Rick Chen | a7af286 | 2019-08-28 18:46:05 +0800 | [diff] [blame] | 20 | static int sandbox_enable(struct udevice *dev) |
| 21 | { |
| 22 | return 0; |
| 23 | } |
| 24 | |
| 25 | static int snadbox_disable(struct udevice *dev) |
| 26 | { |
| 27 | return 0; |
| 28 | } |
| 29 | |
Dinh Nguyen | d94e18e | 2019-04-23 16:55:03 -0500 | [diff] [blame] | 30 | static const struct cache_ops sandbox_cache_ops = { |
| 31 | .get_info = sandbox_get_info, |
Wolfgang Denk | 62fb2b4 | 2021-09-27 17:42:39 +0200 | [diff] [blame] | 32 | .enable = sandbox_enable, |
Rick Chen | a7af286 | 2019-08-28 18:46:05 +0800 | [diff] [blame] | 33 | .disable = snadbox_disable, |
Dinh Nguyen | d94e18e | 2019-04-23 16:55:03 -0500 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | static const struct udevice_id sandbox_cache_ids[] = { |
| 37 | { .compatible = "sandbox,cache" }, |
| 38 | { } |
| 39 | }; |
| 40 | |
| 41 | U_BOOT_DRIVER(cache_sandbox) = { |
| 42 | .name = "cache_sandbox", |
| 43 | .id = UCLASS_CACHE, |
| 44 | .of_match = sandbox_cache_ids, |
| 45 | .ops = &sandbox_cache_ops, |
| 46 | }; |