Dave Gerlach | 21e3c21 | 2020-07-15 23:39:58 -0500 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Sandbox driver for the SOC uclass |
| 4 | * |
| 5 | * (C) Copyright 2020 - Texas Instruments Incorporated - http://www.ti.com/ |
| 6 | * Dave Gerlach <d-gerlach@ti.com> |
| 7 | */ |
| 8 | |
| 9 | #include <common.h> |
| 10 | #include <dm.h> |
| 11 | #include <soc.h> |
| 12 | |
| 13 | int soc_sandbox_get_family(struct udevice *dev, char *buf, int size) |
| 14 | { |
| 15 | snprintf(buf, size, "SANDBOX1xx"); |
| 16 | |
| 17 | return 0; |
| 18 | } |
| 19 | |
| 20 | int soc_sandbox_get_machine(struct udevice *dev, char *buf, int size) |
| 21 | { |
| 22 | snprintf(buf, size, "SANDBOX123"); |
| 23 | |
| 24 | return 0; |
| 25 | } |
| 26 | |
| 27 | int soc_sandbox_get_revision(struct udevice *dev, char *buf, int size) |
| 28 | { |
| 29 | snprintf(buf, size, "1.0"); |
| 30 | |
| 31 | return 0; |
| 32 | } |
| 33 | |
| 34 | static 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 | |
| 40 | int soc_sandbox_probe(struct udevice *dev) |
| 41 | { |
| 42 | return 0; |
| 43 | } |
| 44 | |
| 45 | static const struct udevice_id soc_sandbox_ids[] = { |
| 46 | { .compatible = "sandbox,soc" }, |
| 47 | { } |
| 48 | }; |
| 49 | |
| 50 | U_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 | }; |