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