blob: 2a43487f1a721b66b2c210b7cc2ce1c288dc4e38 [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>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00008#include <string.h>
9
Nariman Poushinc703f902018-03-07 10:29:57 +000010#include <platform_def.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000011
12#include <common/debug.h>
13
14#include <plat_arm.h>
Nariman Poushinc703f902018-03-07 10:29:57 +000015#include <sgm_plat_config.h>
16#include <sgm_variant.h>
Nariman Poushinc703f902018-03-07 10:29:57 +000017
18static css_plat_config_t *css_plat_info;
19
20/* Interconnect */
21const css_inteconn_config_t sgm_inteconn = {
22 .ip_type = ARM_CCI,
23 .plat_inteconn_desc = NULL
24};
25
26/* Special definition for SGM775 */
27/* Topology configuration for SGM775 */
28const unsigned char sgm775_power_domain_tree_desc[] = {
29 /* No of root nodes */
30 ARM_SYSTEM_COUNT,
31 /* No of children for the root node */
32 PLAT_ARM_CLUSTER_COUNT,
33 /* No of children for the first cluster node */
34 PLAT_ARM_CLUSTER_CORE_COUNT,
35};
36
37const css_topology_t sgm775_topology = {
38 .power_tree = sgm775_power_domain_tree_desc,
39 .plat_cluster_core_count = PLAT_ARM_CLUSTER_CORE_COUNT
40};
41
42/* Configuration structure for SGM775 */
43css_plat_config_t sgm775_config = {
44 .inteconn = &sgm_inteconn,
45 .topology = &sgm775_topology
46};
47
48/*******************************************************************************
49 * This function initializes the platform structure.
50 ******************************************************************************/
51void plat_config_init(void)
52{
53 /* Get the platform configurations */
54 switch (GET_PLAT_PART_NUM) {
55 case SGM775_SSC_VER_PART_NUM:
56 css_plat_info = &sgm775_config;
57
58 break;
59 default:
60 ERROR("Not a valid sgm variant!\n");
61 panic();
62 }
63}
64
65/*******************************************************************************
66 * This function returns the platform structure pointer.
67 ******************************************************************************/
68css_plat_config_t *get_plat_config(void)
69{
70 assert(css_plat_info != NULL);
71 return css_plat_info;
72}
John Tsichritzisc19949a2018-08-22 12:55:41 +010073
Antonio Nino Diaz9b759862018-09-25 11:38:18 +010074#if TRUSTED_BOARD_BOOT
John Tsichritzisc19949a2018-08-22 12:55:41 +010075int plat_get_mbedtls_heap(void **heap_addr, size_t *heap_size)
76{
77 assert(heap_addr != NULL);
78 assert(heap_size != NULL);
79
80 return arm_get_mbedtls_heap(heap_addr, heap_size);
81}
82#endif