Simon Glass | 6caa195 | 2013-05-08 08:06:03 +0000 | [diff] [blame] | 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 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 15 | * SPDX-License-Identifier: GPL-2.0+ |
Simon Glass | 6caa195 | 2013-05-08 08:06:03 +0000 | [diff] [blame] | 16 | */ |
| 17 | |
| 18 | #include <common.h> |
| 19 | #include <fdt_support.h> |
| 20 | |
| 21 | DECLARE_GLOBAL_DATA_PTR; |
| 22 | |
| 23 | int 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 | } |