aboutsummaryrefslogtreecommitdiff
path: root/plat/arm/css/sgm/sgm_plat_config.c
blob: 2a43487f1a721b66b2c210b7cc2ce1c288dc4e38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <assert.h>
#include <string.h>

#include <platform_def.h>

#include <common/debug.h>

#include <plat_arm.h>
#include <sgm_plat_config.h>
#include <sgm_variant.h>

static css_plat_config_t *css_plat_info;

/* Interconnect */
const css_inteconn_config_t sgm_inteconn = {
	.ip_type = ARM_CCI,
	.plat_inteconn_desc = NULL
};

/* Special definition for SGM775 */
/* Topology configuration for SGM775 */
const unsigned char sgm775_power_domain_tree_desc[] = {
	/* No of root nodes */
	ARM_SYSTEM_COUNT,
	/* No of children for the root node */
	PLAT_ARM_CLUSTER_COUNT,
	/* No of children for the first cluster node */
	PLAT_ARM_CLUSTER_CORE_COUNT,
};

const css_topology_t sgm775_topology = {
	.power_tree = sgm775_power_domain_tree_desc,
	.plat_cluster_core_count = PLAT_ARM_CLUSTER_CORE_COUNT
};

/* Configuration structure for SGM775 */
css_plat_config_t sgm775_config = {
	.inteconn = &sgm_inteconn,
	.topology = &sgm775_topology
};

/*******************************************************************************
 * This function initializes the platform structure.
 ******************************************************************************/
void plat_config_init(void)
{
	/* Get the platform configurations */
	switch (GET_PLAT_PART_NUM) {
	case SGM775_SSC_VER_PART_NUM:
		css_plat_info = &sgm775_config;

		break;
	default:
		ERROR("Not a valid sgm variant!\n");
		panic();
	}
}

/*******************************************************************************
 * This function returns the platform structure pointer.
 ******************************************************************************/
css_plat_config_t *get_plat_config(void)
{
	assert(css_plat_info != NULL);
	return css_plat_info;
}

#if TRUSTED_BOARD_BOOT
int plat_get_mbedtls_heap(void **heap_addr, size_t *heap_size)
{
	assert(heap_addr != NULL);
	assert(heap_size != NULL);

	return arm_get_mbedtls_heap(heap_addr, heap_size);
}
#endif