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 | |
| 6 | #include <common.h> |
| 7 | #include <cache.h> |
| 8 | #include <dm.h> |
| 9 | #include <errno.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 10 | #include <asm/global_data.h> |
Dinh Nguyen | d94e18e | 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 | a7af286 | 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 | d94e18e | 2019-04-23 16:55:03 -0500 | [diff] [blame] | 32 | static const struct cache_ops sandbox_cache_ops = { |
| 33 | .get_info = sandbox_get_info, |
Rick Chen | a7af286 | 2019-08-28 18:46:05 +0800 | [diff] [blame] | 34 | .enable = sandbox_enable, |
| 35 | .disable = snadbox_disable, |
Dinh Nguyen | d94e18e | 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 | }; |