Nariman Poushin | c703f90 | 2018-03-07 10:29:57 +0000 | [diff] [blame] | 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> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 8 | #include <string.h> |
| 9 | |
Nariman Poushin | c703f90 | 2018-03-07 10:29:57 +0000 | [diff] [blame] | 10 | #include <platform_def.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 11 | |
| 12 | #include <common/debug.h> |
| 13 | |
| 14 | #include <plat_arm.h> |
Nariman Poushin | c703f90 | 2018-03-07 10:29:57 +0000 | [diff] [blame] | 15 | #include <sgm_plat_config.h> |
| 16 | #include <sgm_variant.h> |
Nariman Poushin | c703f90 | 2018-03-07 10:29:57 +0000 | [diff] [blame] | 17 | |
| 18 | static css_plat_config_t *css_plat_info; |
| 19 | |
| 20 | /* Interconnect */ |
| 21 | const 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 */ |
| 28 | const 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 | |
| 37 | const 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 */ |
| 43 | css_plat_config_t sgm775_config = { |
| 44 | .inteconn = &sgm_inteconn, |
| 45 | .topology = &sgm775_topology |
| 46 | }; |
| 47 | |
| 48 | /******************************************************************************* |
| 49 | * This function initializes the platform structure. |
| 50 | ******************************************************************************/ |
| 51 | void 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 | ******************************************************************************/ |
| 68 | css_plat_config_t *get_plat_config(void) |
| 69 | { |
| 70 | assert(css_plat_info != NULL); |
| 71 | return css_plat_info; |
| 72 | } |
John Tsichritzis | c19949a | 2018-08-22 12:55:41 +0100 | [diff] [blame] | 73 | |
Antonio Nino Diaz | 9b75986 | 2018-09-25 11:38:18 +0100 | [diff] [blame] | 74 | #if TRUSTED_BOARD_BOOT |
John Tsichritzis | c19949a | 2018-08-22 12:55:41 +0100 | [diff] [blame] | 75 | int 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 |