init_helpers.c 628 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * (C) Copyright 2011
  3. * Graeme Russ, <graeme.russ@gmail.com>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <common.h>
  8. #include <linux/errno.h>
  9. #include <asm/mtrr.h>
  10. DECLARE_GLOBAL_DATA_PTR;
  11. /* Get the top of usable RAM */
  12. __weak ulong board_get_usable_ram_top(ulong total_size)
  13. {
  14. return gd->ram_size;
  15. }
  16. int init_cache_f_r(void)
  17. {
  18. #if defined(CONFIG_X86_RESET_VECTOR) & !defined(CONFIG_HAVE_FSP)
  19. int ret;
  20. ret = mtrr_commit(false);
  21. /* If MTRR MSR is not implemented by the processor, just ignore it */
  22. if (ret && ret != -ENOSYS)
  23. return ret;
  24. #endif
  25. /* Initialise the CPU cache(s) */
  26. return init_cache();
  27. }