cpu.c 548 B

12345678910111213141516171819202122232425262728
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2017 Andes Technology Corporation
  4. * Rick Chen, Andes Technology Corporation <rick@andestech.com>
  5. */
  6. /* CPU specific code */
  7. #include <common.h>
  8. #include <cpu_func.h>
  9. #include <asm/cache.h>
  10. /*
  11. * cleanup_before_linux() is called just before we call linux
  12. * it prepares the processor for linux
  13. *
  14. * we disable interrupt and caches.
  15. */
  16. int cleanup_before_linux(void)
  17. {
  18. disable_interrupts();
  19. /* turn off I/D-cache */
  20. cache_flush();
  21. icache_disable();
  22. dcache_disable();
  23. return 0;
  24. }