cpu.c 526 B

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