blob: 15fdd9930cb4c56446df9668f93848afc4cff244 [file] [log] [blame]
Dave Gerlach21e3c212020-07-15 23:39:58 -05001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Sandbox driver for the SOC uclass
4 *
Nishanth Menona94a4072023-11-01 15:56:03 -05005 * (C) Copyright 2020 - Texas Instruments Incorporated - https://www.ti.com/
Dave Gerlach21e3c212020-07-15 23:39:58 -05006 * Dave Gerlach <d-gerlach@ti.com>
7 */
8
9#include <common.h>
10#include <dm.h>
11#include <soc.h>
12
13int soc_sandbox_get_family(struct udevice *dev, char *buf, int size)
14{
15 snprintf(buf, size, "SANDBOX1xx");
16
17 return 0;
18}
19
20int soc_sandbox_get_machine(struct udevice *dev, char *buf, int size)
21{
22 snprintf(buf, size, "SANDBOX123");
23
24 return 0;
25}
26
27int soc_sandbox_get_revision(struct udevice *dev, char *buf, int size)
28{
29 snprintf(buf, size, "1.0");
30
31 return 0;
32}
33
34static const struct soc_ops soc_sandbox_ops = {
35 .get_family = soc_sandbox_get_family,
36 .get_revision = soc_sandbox_get_revision,
37 .get_machine = soc_sandbox_get_machine,
38};
39
40int soc_sandbox_probe(struct udevice *dev)
41{
42 return 0;
43}
44
45static const struct udevice_id soc_sandbox_ids[] = {
46 { .compatible = "sandbox,soc" },
47 { }
48};
49
50U_BOOT_DRIVER(soc_sandbox) = {
51 .name = "soc_sandbox",
52 .id = UCLASS_SOC,
53 .ops = &soc_sandbox_ops,
54 .of_match = soc_sandbox_ids,
55 .probe = soc_sandbox_probe,
56};