blob: 7397e4407ad473c266f7c207fe21d177ef8571d1 [file] [log] [blame]
Ramon Fried7fd7e2c2018-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
6#include <common.h>
7#include <dm.h>
8#include <errno.h>
9#include <smem.h>
10#include <asm/test.h>
11
12static int sandbox_smem_alloc(unsigned int host,
13 unsigned int item, size_t size)
14{
15 return 0;
16}
17
18static void *sandbox_smem_get(unsigned int host,
19 unsigned int item, size_t *size)
20{
21 return NULL;
22}
23
24static int sandbox_smem_get_free_space(unsigned int host)
25{
26 return 0;
27}
28
29static const struct smem_ops sandbox_smem_ops = {
30 .alloc = sandbox_smem_alloc,
31 .get = sandbox_smem_get,
32 .get_free_space = sandbox_smem_get_free_space,
33};
34
35static const struct udevice_id sandbox_smem_ids[] = {
36 { .compatible = "sandbox,smem" },
37 { }
38};
39
40U_BOOT_DRIVER(smem_sandbox) = {
41 .name = "smem_sandbox",
42 .id = UCLASS_SMEM,
43 .of_match = sandbox_smem_ids,
44 .ops = &sandbox_smem_ops,
45};