cpu.c 731 B

123456789101112131415161718192021222324252627282930313233343536
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
  4. */
  5. #include <common.h>
  6. #include <dm.h>
  7. #include <irq_func.h>
  8. /*
  9. * cleanup_before_linux() is called just before we call linux
  10. * it prepares the processor for linux
  11. *
  12. * we disable interrupt and caches.
  13. */
  14. int cleanup_before_linux(void)
  15. {
  16. disable_interrupts();
  17. cache_flush();
  18. return 0;
  19. }
  20. /* To enumerate devices on the /soc/ node, create a "simple-bus" driver */
  21. static const struct udevice_id riscv_virtio_soc_ids[] = {
  22. { .compatible = "riscv-virtio-soc" },
  23. { }
  24. };
  25. U_BOOT_DRIVER(riscv_virtio_soc) = {
  26. .name = "riscv_virtio_soc",
  27. .id = UCLASS_SIMPLE_BUS,
  28. .of_match = riscv_virtio_soc_ids,
  29. .flags = DM_FLAG_PRE_RELOC,
  30. };