sandbox_cache.c 836 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. DECLARE_GLOBAL_DATA_PTR;
  10. static int sandbox_get_info(struct udevice *dev, struct cache_info *info)
  11. {
  12. info->base = 0x11223344;
  13. return 0;
  14. }
  15. static int sandbox_enable(struct udevice *dev)
  16. {
  17. return 0;
  18. }
  19. static int snadbox_disable(struct udevice *dev)
  20. {
  21. return 0;
  22. }
  23. static const struct cache_ops sandbox_cache_ops = {
  24. .get_info = sandbox_get_info,
  25. .enable = sandbox_enable,
  26. .disable = snadbox_disable,
  27. };
  28. static const struct udevice_id sandbox_cache_ids[] = {
  29. { .compatible = "sandbox,cache" },
  30. { }
  31. };
  32. U_BOOT_DRIVER(cache_sandbox) = {
  33. .name = "cache_sandbox",
  34. .id = UCLASS_CACHE,
  35. .of_match = sandbox_cache_ids,
  36. .ops = &sandbox_cache_ops,
  37. };