bootm-fdt.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (c) 2013, Google Inc.
  3. *
  4. * Copyright (C) 2011
  5. * Corscience GmbH & Co. KG - Simon Schwarz <schwarz@corscience.de>
  6. * - Added prep subcommand support
  7. * - Reorganized source - modeled after powerpc version
  8. *
  9. * (C) Copyright 2002
  10. * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  11. * Marius Groeger <mgroeger@sysgo.de>
  12. *
  13. * Copyright (C) 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
  14. *
  15. * See file CREDITS for list of people who contributed to this
  16. * project.
  17. *
  18. * This program is free software; you can redistribute it and/or
  19. * modify it under the terms of the GNU General Public License as
  20. * published by the Free Software Foundation; either version 2 of
  21. * the License, or (at your option) any later version.
  22. *
  23. * This program is distributed in the hope that it will be useful,
  24. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. * GNU General Public License for more details.
  27. *
  28. * You should have received a copy of the GNU General Public License
  29. * along with this program; if not, write to the Free Software
  30. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  31. * MA 02111-1307 USA
  32. */
  33. #include <common.h>
  34. #include <fdt_support.h>
  35. DECLARE_GLOBAL_DATA_PTR;
  36. int arch_fixup_memory_node(void *blob)
  37. {
  38. bd_t *bd = gd->bd;
  39. int bank;
  40. u64 start[CONFIG_NR_DRAM_BANKS];
  41. u64 size[CONFIG_NR_DRAM_BANKS];
  42. for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) {
  43. start[bank] = bd->bi_dram[bank].start;
  44. size[bank] = bd->bi_dram[bank].size;
  45. }
  46. return fdt_fixup_memory_banks(blob, start, size, CONFIG_NR_DRAM_BANKS);
  47. }