init_helpers.c 505 B

12345678910111213141516171819202122232425
  1. /*
  2. * Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. DECLARE_GLOBAL_DATA_PTR;
  8. int init_cache_f_r(void)
  9. {
  10. #ifndef CONFIG_SYS_ICACHE_OFF
  11. icache_enable();
  12. /* Make sure no stale entries persist from before we disabled cache */
  13. invalidate_icache_all();
  14. #endif
  15. #ifndef CONFIG_SYS_DCACHE_OFF
  16. dcache_enable();
  17. /* Make sure no stale entries persist from before we disabled cache */
  18. invalidate_dcache_all();
  19. #endif
  20. return 0;
  21. }