|
| 1 | +/* Copyright (c) 2017-2018 ARM Limited |
| 2 | + * |
| 3 | + * SPDX-License-Identifier: Apache-2.0 |
| 4 | + * |
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | + * you may not use this file except in compliance with the License. |
| 7 | + * You may obtain a copy of the License at |
| 8 | + * |
| 9 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + * |
| 11 | + * Unless required by applicable law or agreed to in writing, software |
| 12 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + * See the License for the specific language governing permissions and |
| 15 | + * limitations under the License. |
| 16 | + */ |
| 17 | + |
| 18 | +/*********************************************************************************************************************** |
| 19 | + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 20 | + * THIS FILE IS AN AUTO-GENERATED FILE - DO NOT MODIFY IT. |
| 21 | + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 22 | + * Template Version 1.0 |
| 23 | + * Generated by tools/spm/generate_partition_code.py Version 1.0 |
| 24 | + **********************************************************************************************************************/ |
| 25 | + |
| 26 | +#include "spm_panic.h" |
| 27 | +#include "spm_internal.h" |
| 28 | +#include "handles_manager.h" |
| 29 | +#include "cmsis.h" |
| 30 | +#include "psa_crypto_srv_partition.h" |
| 31 | +#include "psa_its_partition.h" |
| 32 | + |
| 33 | +extern const uint32_t crypto_srv_external_sids[4]; |
| 34 | + |
| 35 | +spm_partition_t g_partitions[2] = { |
| 36 | + { |
| 37 | + .partition_id = CRYPTO_SRV_ID, |
| 38 | + .thread_id = 0, |
| 39 | + .flags_rot_srv = CRYPTO_SRV_WAIT_ANY_SID_MSK, |
| 40 | + .flags_interrupts = 0, |
| 41 | + .rot_services = NULL, |
| 42 | + .rot_services_count = CRYPTO_SRV_ROT_SRV_COUNT, |
| 43 | + .extern_sids = crypto_srv_external_sids, |
| 44 | + .extern_sids_count = CRYPTO_SRV_EXT_ROT_SRV_COUNT, |
| 45 | + .irq_mapper = NULL, |
| 46 | + }, |
| 47 | + { |
| 48 | + .partition_id = ITS_ID, |
| 49 | + .thread_id = 0, |
| 50 | + .flags_rot_srv = ITS_WAIT_ANY_SID_MSK, |
| 51 | + .flags_interrupts = 0, |
| 52 | + .rot_services = NULL, |
| 53 | + .rot_services_count = ITS_ROT_SRV_COUNT, |
| 54 | + .extern_sids = NULL, |
| 55 | + .extern_sids_count = ITS_EXT_ROT_SRV_COUNT, |
| 56 | + .irq_mapper = NULL, |
| 57 | + }, |
| 58 | +}; |
| 59 | + |
| 60 | +/* Check all the defined memory regions for overlapping. */ |
| 61 | + |
| 62 | +/* A list of all the memory regions. */ |
| 63 | +const mem_region_t *mem_regions = NULL; |
| 64 | + |
| 65 | +const uint32_t mem_region_count = 0; |
| 66 | + |
| 67 | +// forward declaration of partition initializers |
| 68 | +void crypto_srv_init(spm_partition_t *partition); |
| 69 | +void its_init(spm_partition_t *partition); |
| 70 | + |
| 71 | +uint32_t init_partitions(spm_partition_t **partitions) |
| 72 | +{ |
| 73 | + if (NULL == partitions) { |
| 74 | + SPM_PANIC("partitions is NULL!\n"); |
| 75 | + } |
| 76 | + |
| 77 | + crypto_srv_init(&(g_partitions[0])); |
| 78 | + its_init(&(g_partitions[1])); |
| 79 | + |
| 80 | + *partitions = g_partitions; |
| 81 | + return 2; |
| 82 | +} |
| 83 | + |
0 commit comments