blob: eed36314d15e14b42e3336eb30ca56f30ac7689c [file] [log] [blame]
Nariman Poushinc703f902018-03-07 10:29:57 +00001/*
John Tsichritzisa624f592019-04-16 12:05:29 +01002 * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
Nariman Poushinc703f902018-03-07 10:29:57 +00003 *
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>
John Tsichritzisa624f592019-04-16 12:05:29 +010013#include <plat/common/platform.h>
Antonio Nino Diazbd7b7402019-01-25 14:30:04 +000014#include <plat/arm/common/plat_arm.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000015
Nariman Poushinc703f902018-03-07 10:29:57 +000016#include <sgm_plat_config.h>
17#include <sgm_variant.h>
Nariman Poushinc703f902018-03-07 10:29:57 +000018
19static css_plat_config_t *css_plat_info;
20
21/* Interconnect */
22const 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 */
29const 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
38const 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 */
44css_plat_config_t sgm775_config = {
45 .inteconn = &sgm_inteconn,
46 .topology = &sgm775_topology
47};
48
49/*******************************************************************************
50 * This function initializes the platform structure.
51 ******************************************************************************/
52void 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 ******************************************************************************/
69css_plat_config_t *get_plat_config(void)
70{
71 assert(css_plat_info != NULL);
72 return css_plat_info;
73}
John Tsichritzisc19949a2018-08-22 12:55:41 +010074
Antonio Nino Diaz9b759862018-09-25 11:38:18 +010075#if TRUSTED_BOARD_BOOT
John Tsichritzisc19949a2018-08-22 12:55:41 +010076int plat_get_mbedtls_heap(void **heap_addr, size_t *heap_size)
77{
John Tsichritzisa624f592019-04-16 12:05:29 +010078 return get_mbedtls_heap_helper(heap_addr, heap_size);
John Tsichritzisc19949a2018-08-22 12:55:41 +010079}
80#endif