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