platform_def.h 2.26 KB
Newer Older
Haojian Zhuang's avatar
Haojian Zhuang committed
1
/*
Haojian Zhuang's avatar
Haojian Zhuang committed
2
 * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
Haojian Zhuang's avatar
Haojian Zhuang committed
3
4
5
6
7
8
9
10
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#ifndef __PLATFORM_DEF_H__
#define __PLATFORM_DEF_H__

#include <arch.h>
11
12
13
14
#include <common_def.h>
#include <hikey_def.h>
#include <hikey_layout.h>		/* BL memory region sizes, etc */
#include <tbbr_img_def.h>
Haojian Zhuang's avatar
Haojian Zhuang committed
15

16
17
18
/* Special value used to verify platform parameters from BL2 to BL3-1 */
#define HIKEY_BL31_PLAT_PARAM_VAL	0x0f1e2d3c4b5a6978ULL

Haojian Zhuang's avatar
Haojian Zhuang committed
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * Generic platform constants
 */

/* Size of cacheable stacks */
#define PLATFORM_STACK_SIZE		0x800

#define FIRMWARE_WELCOME_STR		"Booting Trusted Firmware\n"

#define PLATFORM_CACHE_LINE_SIZE	64
#define PLATFORM_CLUSTER_COUNT		2
#define PLATFORM_CORE_COUNT_PER_CLUSTER	4
#define PLATFORM_CORE_COUNT		(PLATFORM_CLUSTER_COUNT *	\
					 PLATFORM_CORE_COUNT_PER_CLUSTER)
33
#define PLAT_MAX_PWR_LVL		(MPIDR_AFFLVL2)
Haojian Zhuang's avatar
Haojian Zhuang committed
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#define PLAT_NUM_PWR_DOMAINS		(PLATFORM_CORE_COUNT + \
					 PLATFORM_CLUSTER_COUNT + 1)

#define PLAT_MAX_RET_STATE		1
#define PLAT_MAX_OFF_STATE		2

#define MAX_IO_DEVICES			3
#define MAX_IO_HANDLES			4
/* eMMC RPMB and eMMC User Data */
#define MAX_IO_BLOCK_DEVICES		2

/* GIC related constants (no GICR in GIC-400) */
#define PLAT_ARM_GICD_BASE		0xF6801000
#define PLAT_ARM_GICC_BASE		0xF6802000
#define PLAT_ARM_GICH_BASE		0xF6804000
#define PLAT_ARM_GICV_BASE		0xF6806000

/*
 * Platform specific page table and MMU setup constants
 */
54
#define ADDR_SPACE_SIZE			(1ULL << 32)
Haojian Zhuang's avatar
Haojian Zhuang committed
55

Roberto Vargas's avatar
Roberto Vargas committed
56
#if defined(IMAGE_BL1) || defined(IMAGE_BL32)
Haojian Zhuang's avatar
Haojian Zhuang committed
57
58
59
#define MAX_XLAT_TABLES			3
#endif

Roberto Vargas's avatar
Roberto Vargas committed
60
#ifdef IMAGE_BL31
61
62
63
#define MAX_XLAT_TABLES			4
#endif

Roberto Vargas's avatar
Roberto Vargas committed
64
#ifdef IMAGE_BL2
65
66
67
#define MAX_XLAT_TABLES			4
#endif

Haojian Zhuang's avatar
Haojian Zhuang committed
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#define MAX_MMAP_REGIONS		16

/*
 * Declarations and constants to access the mailboxes safely. Each mailbox is
 * aligned on the biggest cache line size in the platform. This is known only
 * to the platform as it might have a combination of integrated and external
 * caches. Such alignment ensures that two maiboxes do not sit on the same cache
 * line at any cache level. They could belong to different cpus/clusters &
 * get written while being protected by different locks causing corruption of
 * a valid mailbox address.
 */
#define CACHE_WRITEBACK_SHIFT		6
#define CACHE_WRITEBACK_GRANULE		(1 << CACHE_WRITEBACK_SHIFT)

#endif /* __PLATFORM_DEF_H__ */