blob: e977e618bca8039357d752338de3c657b158ba41 [file] [log] [blame]
Nariman Poushinc703f902018-03-07 10:29:57 +00001/*
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
15static css_plat_config_t *css_plat_info;
16
17/* Interconnect */
18const 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 */
25const 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
34const 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 */
40css_plat_config_t sgm775_config = {
41 .inteconn = &sgm_inteconn,
42 .topology = &sgm775_topology
43};
44
45/*******************************************************************************
46 * This function initializes the platform structure.
47 ******************************************************************************/
48void 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 ******************************************************************************/
65css_plat_config_t *get_plat_config(void)
66{
67 assert(css_plat_info != NULL);
68 return css_plat_info;
69}
John Tsichritzisc19949a2018-08-22 12:55:41 +010070
Antonio Nino Diaz9b759862018-09-25 11:38:18 +010071#if TRUSTED_BOARD_BOOT
John Tsichritzisc19949a2018-08-22 12:55:41 +010072int 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