soc_sandbox.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. #include <common.h>
  9. #include <dm.h>
  10. #include <soc.h>
  11. int soc_sandbox_get_family(struct udevice *dev, char *buf, int size)
  12. {
  13. snprintf(buf, size, "SANDBOX1xx");
  14. return 0;
  15. }
  16. int soc_sandbox_get_machine(struct udevice *dev, char *buf, int size)
  17. {
  18. snprintf(buf, size, "SANDBOX123");
  19. return 0;
  20. }
  21. int soc_sandbox_get_revision(struct udevice *dev, char *buf, int size)
  22. {
  23. snprintf(buf, size, "1.0");
  24. return 0;
  25. }
  26. static const struct soc_ops soc_sandbox_ops = {
  27. .get_family = soc_sandbox_get_family,
  28. .get_revision = soc_sandbox_get_revision,
  29. .get_machine = soc_sandbox_get_machine,
  30. };
  31. int soc_sandbox_probe(struct udevice *dev)
  32. {
  33. return 0;
  34. }
  35. static const struct udevice_id soc_sandbox_ids[] = {
  36. { .compatible = "sandbox,soc" },
  37. { }
  38. };
  39. U_BOOT_DRIVER(soc_sandbox) = {
  40. .name = "soc_sandbox",
  41. .id = UCLASS_SOC,
  42. .ops = &soc_sandbox_ops,
  43. .of_match = soc_sandbox_ids,
  44. .probe = soc_sandbox_probe,
  45. };