sandbox_cache.c 865 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (C) 2019 Intel Corporation <www.intel.com>
  4. */
  5. #include <common.h>
  6. #include <cache.h>
  7. #include <dm.h>
  8. #include <errno.h>
  9. #include <asm/global_data.h>
  10. DECLARE_GLOBAL_DATA_PTR;
  11. static int sandbox_get_info(struct udevice *dev, struct cache_info *info)
  12. {
  13. info->base = 0x11223344;
  14. return 0;
  15. }
  16. static int sandbox_enable(struct udevice *dev)
  17. {
  18. return 0;
  19. }
  20. static int snadbox_disable(struct udevice *dev)
  21. {
  22. return 0;
  23. }
  24. static const struct cache_ops sandbox_cache_ops = {
  25. .get_info = sandbox_get_info,
  26. .enable = sandbox_enable,
  27. .disable = snadbox_disable,
  28. };
  29. static const struct udevice_id sandbox_cache_ids[] = {
  30. { .compatible = "sandbox,cache" },
  31. { }
  32. };
  33. U_BOOT_DRIVER(cache_sandbox) = {
  34. .name = "cache_sandbox",
  35. .id = UCLASS_CACHE,
  36. .of_match = sandbox_cache_ids,
  37. .ops = &sandbox_cache_ops,
  38. };