Dinh Nguyen | 84b124d | 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 | |
| 6 | #include <common.h> |
| 7 | #include <cache.h> |
| 8 | #include <dm.h> |
| 9 | #include <errno.h> |
Simon Glass | 401d1c4 | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 10 | #include <asm/global_data.h> |
Dinh Nguyen | 84b124d | 2019-04-23 16:55:03 -0500 | [diff] [blame] | 11 | |
| 12 | DECLARE_GLOBAL_DATA_PTR; |
| 13 | |
| 14 | static int sandbox_get_info(struct udevice *dev, struct cache_info *info) |
| 15 | { |
| 16 | info->base = 0x11223344; |
| 17 | |
| 18 | return 0; |
| 19 | } |
| 20 | |
Rick Chen | abd858e | 2019-08-28 18:46:05 +0800 | [diff] [blame] | 21 | static int sandbox_enable(struct udevice *dev) |
| 22 | { |
| 23 | return 0; |
| 24 | } |
| 25 | |
| 26 | static int snadbox_disable(struct udevice *dev) |
| 27 | { |
| 28 | return 0; |
| 29 | } |
| 30 | |
| 31 | |
Dinh Nguyen | 84b124d | 2019-04-23 16:55:03 -0500 | [diff] [blame] | 32 | static const struct cache_ops sandbox_cache_ops = { |
| 33 | .get_info = sandbox_get_info, |
Wolfgang Denk | 0cf207e | 2021-09-27 17:42:39 +0200 | [diff] [blame] | 34 | .enable = sandbox_enable, |
Rick Chen | abd858e | 2019-08-28 18:46:05 +0800 | [diff] [blame] | 35 | .disable = snadbox_disable, |
Dinh Nguyen | 84b124d | 2019-04-23 16:55:03 -0500 | [diff] [blame] | 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 | }; |