blob: e40691d15f90e5ab8098f99faafdd17ba75e11fe [file] [log] [blame]
Simon Glass653909f2013-05-08 08:06:03 +00001/*
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 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +020015 * SPDX-License-Identifier: GPL-2.0+
Simon Glass653909f2013-05-08 08:06:03 +000016 */
17
18#include <common.h>
19#include <fdt_support.h>
20
21DECLARE_GLOBAL_DATA_PTR;
22
23int arch_fixup_memory_node(void *blob)
24{
25 bd_t *bd = gd->bd;
26 int bank;
27 u64 start[CONFIG_NR_DRAM_BANKS];
28 u64 size[CONFIG_NR_DRAM_BANKS];
29
30 for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) {
31 start[bank] = bd->bi_dram[bank].start;
32 size[bank] = bd->bi_dram[bank].size;
33 }
34
35 return fdt_fixup_memory_banks(blob, start, size, CONFIG_NR_DRAM_BANKS);
36}