ddr_parameter.h 923 Bytes
Newer Older
tony.xie's avatar
tony.xie committed
1
2
3
/*
 * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
 *
4
 * SPDX-License-Identifier: BSD-3-Clause
tony.xie's avatar
tony.xie committed
5
6
 */

7
8
#ifndef DDR_PARAMETER_H
#define DDR_PARAMETER_H
tony.xie's avatar
tony.xie committed
9

10
11
12
13
#include <string.h>

#include <platform_def.h>

tony.xie's avatar
tony.xie committed
14
#include <arch_helpers.h>
15
16
17
18
19
#include <common/debug.h>
#include <drivers/console.h>
#include <drivers/delay_timer.h>
#include <lib/mmio.h>

tony.xie's avatar
tony.xie committed
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <plat_private.h>
#include <soc.h>

#define DDR_REGION_NR_MAX		10
#define REGION_NR_OFFSET		0
#define REGION_ADDR_OFFSET		8
#define REGION_DATA_PER_BYTES		8
#define RG_SIZE_MB(byte)		((byte) >> 20)

/* unit: MB */
struct param_ddr_usage {
	uint64_t boundary;

	uint32_t ns_nr;
	uint64_t ns_base[DDR_REGION_NR_MAX];
	uint64_t ns_top[DDR_REGION_NR_MAX];

	uint32_t s_nr;
	uint64_t s_base[DDR_REGION_NR_MAX];
	uint64_t s_top[DDR_REGION_NR_MAX];
};

struct param_ddr_usage ddr_region_usage_parse(uint64_t addr, uint64_t max_mb);

44
#endif /* DDR_PARAMETER_H */