sandbox_ram.c 728 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (c) 2015 Google, Inc
  4. * Written by Simon Glass <sjg@chromium.org>
  5. */
  6. #include <common.h>
  7. #include <dm.h>
  8. #include <errno.h>
  9. #include <ram.h>
  10. #include <asm/global_data.h>
  11. #include <asm/test.h>
  12. DECLARE_GLOBAL_DATA_PTR;
  13. static int sandbox_get_info(struct udevice *dev, struct ram_info *info)
  14. {
  15. info->base = 0;
  16. info->size = gd->ram_size;
  17. return 0;
  18. }
  19. static const struct ram_ops sandbox_ram_ops = {
  20. .get_info = sandbox_get_info,
  21. };
  22. static const struct udevice_id sandbox_ram_ids[] = {
  23. { .compatible = "sandbox,ram" },
  24. { }
  25. };
  26. U_BOOT_DRIVER(warm_ram_sandbox) = {
  27. .name = "ram_sandbox",
  28. .id = UCLASS_RAM,
  29. .of_match = sandbox_ram_ids,
  30. .ops = &sandbox_ram_ops,
  31. };