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