Ramon Fried | 26ed32e | 2018-07-02 02:57:59 +0300 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Copyright (c) 2018 Ramon Fried <ramon.fried@gmail.com> |
| 4 | */ |
| 5 | |
Ramon Fried | 26ed32e | 2018-07-02 02:57:59 +0300 | [diff] [blame] | 6 | #include <dm.h> |
| 7 | #include <errno.h> |
| 8 | #include <smem.h> |
| 9 | #include <asm/test.h> |
| 10 | |
| 11 | static int sandbox_smem_alloc(unsigned int host, |
| 12 | unsigned int item, size_t size) |
| 13 | { |
| 14 | return 0; |
| 15 | } |
| 16 | |
| 17 | static void *sandbox_smem_get(unsigned int host, |
| 18 | unsigned int item, size_t *size) |
| 19 | { |
| 20 | return NULL; |
| 21 | } |
| 22 | |
| 23 | static int sandbox_smem_get_free_space(unsigned int host) |
| 24 | { |
| 25 | return 0; |
| 26 | } |
| 27 | |
| 28 | static const struct smem_ops sandbox_smem_ops = { |
| 29 | .alloc = sandbox_smem_alloc, |
| 30 | .get = sandbox_smem_get, |
| 31 | .get_free_space = sandbox_smem_get_free_space, |
| 32 | }; |
| 33 | |
| 34 | static const struct udevice_id sandbox_smem_ids[] = { |
| 35 | { .compatible = "sandbox,smem" }, |
| 36 | { } |
| 37 | }; |
| 38 | |
| 39 | U_BOOT_DRIVER(smem_sandbox) = { |
| 40 | .name = "smem_sandbox", |
| 41 | .id = UCLASS_SMEM, |
| 42 | .of_match = sandbox_smem_ids, |
| 43 | .ops = &sandbox_smem_ops, |
| 44 | }; |