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