e977e618bca8039357d752338de3c657b158ba41
[project/bcm63xx/atf.git] / plat / arm / css / sgm / sgm_plat_config.c
1 /*
2 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7 #include <assert.h>
8 #include <debug.h>
9 #include <plat_arm.h>
10 #include <platform_def.h>
11 #include <sgm_plat_config.h>
12 #include <sgm_variant.h>
13 #include <string.h>
14
15 static css_plat_config_t *css_plat_info;
16
17 /* Interconnect */
18 const css_inteconn_config_t sgm_inteconn = {
19 .ip_type = ARM_CCI,
20 .plat_inteconn_desc = NULL
21 };
22
23 /* Special definition for SGM775 */
24 /* Topology configuration for SGM775 */
25 const unsigned char sgm775_power_domain_tree_desc[] = {
26 /* No of root nodes */
27 ARM_SYSTEM_COUNT,
28 /* No of children for the root node */
29 PLAT_ARM_CLUSTER_COUNT,
30 /* No of children for the first cluster node */
31 PLAT_ARM_CLUSTER_CORE_COUNT,
32 };
33
34 const css_topology_t sgm775_topology = {
35 .power_tree = sgm775_power_domain_tree_desc,
36 .plat_cluster_core_count = PLAT_ARM_CLUSTER_CORE_COUNT
37 };
38
39 /* Configuration structure for SGM775 */
40 css_plat_config_t sgm775_config = {
41 .inteconn = &sgm_inteconn,
42 .topology = &sgm775_topology
43 };
44
45 /*******************************************************************************
46 * This function initializes the platform structure.
47 ******************************************************************************/
48 void plat_config_init(void)
49 {
50 /* Get the platform configurations */
51 switch (GET_PLAT_PART_NUM) {
52 case SGM775_SSC_VER_PART_NUM:
53 css_plat_info = &sgm775_config;
54
55 break;
56 default:
57 ERROR("Not a valid sgm variant!\n");
58 panic();
59 }
60 }
61
62 /*******************************************************************************
63 * This function returns the platform structure pointer.
64 ******************************************************************************/
65 css_plat_config_t *get_plat_config(void)
66 {
67 assert(css_plat_info != NULL);
68 return css_plat_info;
69 }
70
71 #if TRUSTED_BOARD_BOOT
72 int plat_get_mbedtls_heap(void **heap_addr, size_t *heap_size)
73 {
74 assert(heap_addr != NULL);
75 assert(heap_size != NULL);
76
77 return arm_get_mbedtls_heap(heap_addr, heap_size);
78 }
79 #endif