cpu.c 570 B

1234567891011121314151617181920212223242526272829
  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 <irq_func.h>
  10. #include <asm/cache.h>
  11. /*
  12. * cleanup_before_linux() is called just before we call linux
  13. * it prepares the processor for linux
  14. *
  15. * we disable interrupt and caches.
  16. */
  17. int cleanup_before_linux(void)
  18. {
  19. disable_interrupts();
  20. /* turn off I/D-cache */
  21. cache_flush();
  22. icache_disable();
  23. dcache_disable();
  24. return 0;
  25. }