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