api_platform-arm.c 841 B

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