summaryrefslogtreecommitdiff
path: root/drivers/soc/soc_sandbox.c
blob: 5c82ad84fc217cac56099dfe29bf1e1e97d42b1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// SPDX-License-Identifier: GPL-2.0+
/*
 * Sandbox driver for the SOC uclass
 *
 * (C) Copyright 2020 - Texas Instruments Incorporated - http://www.ti.com/
 * Dave Gerlach <d-gerlach@ti.com>
 */

#include <common.h>
#include <dm.h>
#include <soc.h>

int soc_sandbox_get_family(struct udevice *dev, char *buf, int size)
{
	snprintf(buf, size, "SANDBOX1xx");

	return 0;
}

int soc_sandbox_get_machine(struct udevice *dev, char *buf, int size)
{
	snprintf(buf, size, "SANDBOX123");

	return 0;
}

int soc_sandbox_get_revision(struct udevice *dev, char *buf, int size)
{
	snprintf(buf, size, "1.0");

	return 0;
}

static const struct soc_ops soc_sandbox_ops = {
	.get_family = soc_sandbox_get_family,
	.get_revision = soc_sandbox_get_revision,
	.get_machine = soc_sandbox_get_machine,
};

int soc_sandbox_probe(struct udevice *dev)
{
	return 0;
}

static const struct udevice_id soc_sandbox_ids[] = {
	{ .compatible = "sandbox,soc" },
	{ }
};

U_BOOT_DRIVER(soc_sandbox) = {
	.name           = "soc_sandbox",
	.id             = UCLASS_SOC,
	.ops		= &soc_sandbox_ops,
	.of_match       = soc_sandbox_ids,
	.probe          = soc_sandbox_probe,
};