tony.xie | 54973e7 | 2017-04-24 16:18:10 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
dp-arm | d91aaae | 2017-05-10 15:16:15 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
tony.xie | 54973e7 | 2017-04-24 16:18:10 +0800 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef __PARAMETER_H__ |
| 8 | #define __PARAMETER_H__ |
| 9 | |
| 10 | #include <arch_helpers.h> |
| 11 | #include <console.h> |
| 12 | #include <debug.h> |
| 13 | #include <delay_timer.h> |
| 14 | #include <mmio.h> |
tony.xie | 54973e7 | 2017-04-24 16:18:10 +0800 | [diff] [blame] | 15 | #include <plat_private.h> |
Isla Mitchell | e363146 | 2017-07-14 10:46:32 +0100 | [diff] [blame] | 16 | #include <platform_def.h> |
tony.xie | 54973e7 | 2017-04-24 16:18:10 +0800 | [diff] [blame] | 17 | #include <soc.h> |
| 18 | #include <string.h> |
| 19 | |
| 20 | #define DDR_REGION_NR_MAX 10 |
| 21 | #define REGION_NR_OFFSET 0 |
| 22 | #define REGION_ADDR_OFFSET 8 |
| 23 | #define REGION_DATA_PER_BYTES 8 |
| 24 | #define RG_SIZE_MB(byte) ((byte) >> 20) |
| 25 | |
| 26 | /* unit: MB */ |
| 27 | struct param_ddr_usage { |
| 28 | uint64_t boundary; |
| 29 | |
| 30 | uint32_t ns_nr; |
| 31 | uint64_t ns_base[DDR_REGION_NR_MAX]; |
| 32 | uint64_t ns_top[DDR_REGION_NR_MAX]; |
| 33 | |
| 34 | uint32_t s_nr; |
| 35 | uint64_t s_base[DDR_REGION_NR_MAX]; |
| 36 | uint64_t s_top[DDR_REGION_NR_MAX]; |
| 37 | }; |
| 38 | |
| 39 | struct param_ddr_usage ddr_region_usage_parse(uint64_t addr, uint64_t max_mb); |
| 40 | |
| 41 | #endif /* __PARAMETER_H__ */ |