sandbox_smem.c 872 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (c) 2018 Ramon Fried <ramon.fried@gmail.com>
  4. */
  5. #include <common.h>
  6. #include <dm.h>
  7. #include <errno.h>
  8. #include <smem.h>
  9. #include <asm/test.h>
  10. static int sandbox_smem_alloc(unsigned int host,
  11. unsigned int item, size_t size)
  12. {
  13. return 0;
  14. }
  15. static void *sandbox_smem_get(unsigned int host,
  16. unsigned int item, size_t *size)
  17. {
  18. return NULL;
  19. }
  20. static int sandbox_smem_get_free_space(unsigned int host)
  21. {
  22. return 0;
  23. }
  24. static const struct smem_ops sandbox_smem_ops = {
  25. .alloc = sandbox_smem_alloc,
  26. .get = sandbox_smem_get,
  27. .get_free_space = sandbox_smem_get_free_space,
  28. };
  29. static const struct udevice_id sandbox_smem_ids[] = {
  30. { .compatible = "sandbox,smem" },
  31. { }
  32. };
  33. U_BOOT_DRIVER(smem_sandbox) = {
  34. .name = "smem_sandbox",
  35. .id = UCLASS_SMEM,
  36. .of_match = sandbox_smem_ids,
  37. .ops = &sandbox_smem_ops,
  38. };