blob: 25c93a191e840676a068b2294cfb89b54b74485b [file] [log] [blame]
tony.xie54973e72017-04-24 16:18:10 +08001/*
2 * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
3 *
dp-armd91aaae2017-05-10 15:16:15 +01004 * SPDX-License-Identifier: BSD-3-Clause
tony.xie54973e72017-04-24 16:18:10 +08005 */
6
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +00007#ifndef DDR_PARAMETER_H
8#define DDR_PARAMETER_H
tony.xie54973e72017-04-24 16:18:10 +08009
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000010#include <string.h>
11
12#include <platform_def.h>
13
tony.xie54973e72017-04-24 16:18:10 +080014#include <arch_helpers.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000015#include <common/debug.h>
16#include <drivers/console.h>
17#include <drivers/delay_timer.h>
18#include <lib/mmio.h>
19
tony.xie54973e72017-04-24 16:18:10 +080020#include <plat_private.h>
tony.xie54973e72017-04-24 16:18:10 +080021#include <soc.h>
tony.xie54973e72017-04-24 16:18:10 +080022
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 */
30struct 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 Huang97d0cba2020-02-13 14:11:31 +080038 uint64_t s_base[DDR_REGION_NR_MAX + 1];
39 uint64_t s_top[DDR_REGION_NR_MAX + 1];
tony.xie54973e72017-04-24 16:18:10 +080040};
41
42struct param_ddr_usage ddr_region_usage_parse(uint64_t addr, uint64_t max_mb);
43
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000044#endif /* DDR_PARAMETER_H */