api_platform-arm.c 844 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * (C) Copyright 2007 Semihalf
  3. *
  4. * Written by: Rafal Jaworowski <raj@semihalf.com>
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. *
  8. * This file contains routines that fetch data from ARM-dependent sources
  9. * (bd_info etc.)
  10. */
  11. #include <config.h>
  12. #include <linux/types.h>
  13. #include <api_public.h>
  14. #include <asm/u-boot.h>
  15. #include <asm/global_data.h>
  16. #include "api_private.h"
  17. DECLARE_GLOBAL_DATA_PTR;
  18. /*
  19. * Important notice: handling of individual fields MUST be kept in sync with
  20. * include/asm-arm/u-boot.h and include/asm-arm/global_data.h, so any changes
  21. * need to reflect their current state and layout of structures involved!
  22. */
  23. int platform_sys_info(struct sys_info *si)
  24. {
  25. int i;
  26. for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++)
  27. platform_set_mr(si, gd->bd->bi_dram[i].start,
  28. gd->bd->bi_dram[i].size, MR_ATTR_DRAM);
  29. return 1;
  30. }