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 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 7 | #ifndef DDR_PARAMETER_H |
| 8 | #define DDR_PARAMETER_H |
tony.xie | 54973e7 | 2017-04-24 16:18:10 +0800 | [diff] [blame] | 9 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 10 | #include <string.h> |
| 11 | |
| 12 | #include <platform_def.h> |
| 13 | |
tony.xie | 54973e7 | 2017-04-24 16:18:10 +0800 | [diff] [blame] | 14 | #include <arch_helpers.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 15 | #include <common/debug.h> |
| 16 | #include <drivers/console.h> |
| 17 | #include <drivers/delay_timer.h> |
| 18 | #include <lib/mmio.h> |
| 19 | |
tony.xie | 54973e7 | 2017-04-24 16:18:10 +0800 | [diff] [blame] | 20 | #include <plat_private.h> |
tony.xie | 54973e7 | 2017-04-24 16:18:10 +0800 | [diff] [blame] | 21 | #include <soc.h> |
tony.xie | 54973e7 | 2017-04-24 16:18:10 +0800 | [diff] [blame] | 22 | |
| 23 | #define DDR_REGION_NR_MAX 10 |
| 24 | #define REGION_NR_OFFSET 0 |
| 25 | #define REGION_ADDR_OFFSET 8 |
| 26 | #define REGION_DATA_PER_BYTES 8 |
| 27 | #define RG_SIZE_MB(byte) ((byte) >> 20) |
| 28 | |
| 29 | /* unit: MB */ |
| 30 | struct param_ddr_usage { |
| 31 | uint64_t boundary; |
| 32 | |
| 33 | uint32_t ns_nr; |
| 34 | uint64_t ns_base[DDR_REGION_NR_MAX]; |
| 35 | uint64_t ns_top[DDR_REGION_NR_MAX]; |
| 36 | |
| 37 | uint32_t s_nr; |
XiaoDong Huang | 97d0cba | 2020-02-13 14:11:31 +0800 | [diff] [blame] | 38 | uint64_t s_base[DDR_REGION_NR_MAX + 1]; |
| 39 | uint64_t s_top[DDR_REGION_NR_MAX + 1]; |
tony.xie | 54973e7 | 2017-04-24 16:18:10 +0800 | [diff] [blame] | 40 | }; |
| 41 | |
| 42 | struct param_ddr_usage ddr_region_usage_parse(uint64_t addr, uint64_t max_mb); |
| 43 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 44 | #endif /* DDR_PARAMETER_H */ |