sandbox_ram.c 699 B

12345678910111213141516171819202122232425262728293031323334353637
  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/test.h>
  11. DECLARE_GLOBAL_DATA_PTR;
  12. static int sandbox_get_info(struct udevice *dev, struct ram_info *info)
  13. {
  14. info->base = 0;
  15. info->size = gd->ram_size;
  16. return 0;
  17. }
  18. static const struct ram_ops sandbox_ram_ops = {
  19. .get_info = sandbox_get_info,
  20. };
  21. static const struct udevice_id sandbox_ram_ids[] = {
  22. { .compatible = "sandbox,ram" },
  23. { }
  24. };
  25. U_BOOT_DRIVER(warm_ram_sandbox) = {
  26. .name = "ram_sandbox",
  27. .id = UCLASS_RAM,
  28. .of_match = sandbox_ram_ids,
  29. .ops = &sandbox_ram_ops,
  30. };