init_helpers.c 627 B

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