1 /*
2  * Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #include <service_locator.h>
8 #include <service/locator/standalone/services/crypto/crypto_service_context.h>
9 #include <service/locator/standalone/services/internal-trusted-storage/its_service_context.h>
10 #include <service/locator/standalone/services/protected-storage/ps_service_context.h>
11 #include <service/locator/standalone/services/test-runner/test_runner_service_context.h>
12 #include <service/locator/standalone/services/attestation/attestation_service_context.h>
13 #include <service/locator/standalone/services/block-storage/block_storage_service_context.h>
14 #include <service/locator/standalone/services/fwu/fwu_service_context.h>
15 #include <service/locator/standalone/services/smm-variable/smm_variable_service_context.h>
16 #include <service/locator/standalone/services/rpmb/rpmb_service_context.h>
17 #include "standalone_location_strategy.h"
18 #include "standalone_service_registry.h"
19 
service_locator_envinit(void)20 void service_locator_envinit(void)
21 {
22 	static crypto_service_context crypto_context("sn:trustedfirmware.org:crypto:0", TS_RPC_ENCODING_PACKED_C);
23 	standalone_service_registry::instance()->regsiter_service_instance(&crypto_context);
24 
25 	static crypto_service_context crypto_context_protobuf("sn:trustedfirmware.org:crypto-protobuf:0",
26 							      TS_RPC_ENCODING_PROTOBUF);
27 	standalone_service_registry::instance()->regsiter_service_instance(&crypto_context_protobuf);
28 
29 	static its_service_context its_service_context("sn:trustedfirmware.org:internal-trusted-storage:0");
30 	standalone_service_registry::instance()->regsiter_service_instance(&its_service_context);
31 
32 	static ps_service_context ps_service_context("sn:trustedfirmware.org:protected-storage:0");
33 	standalone_service_registry::instance()->regsiter_service_instance(&ps_service_context);
34 
35 	static test_runner_service_context test_runner_context("sn:trustedfirmware.org:test-runner:0");
36 	standalone_service_registry::instance()->regsiter_service_instance(&test_runner_context);
37 
38 	static attestation_service_context attestation_context("sn:trustedfirmware.org:attestation:0");
39 	standalone_service_registry::instance()->regsiter_service_instance(&attestation_context);
40 
41 	static block_storage_service_context block_storage_context("sn:trustedfirmware.org:block-storage:0");
42 	standalone_service_registry::instance()->regsiter_service_instance(&block_storage_context);
43 
44 	static fwu_service_context fwu_context("sn:trustedfirmware.org:fwu:0");
45 	standalone_service_registry::instance()->regsiter_service_instance(&fwu_context);
46 
47 	static smm_variable_service_context smm_variable_context("sn:trustedfirmware.org:smm-variable:0");
48 	standalone_service_registry::instance()->regsiter_service_instance(&smm_variable_context);
49 
50 	static rpmb_service_context rpmb_context("sn:trustedfirmware.org:rpmb:0");
51 	standalone_service_registry::instance()->regsiter_service_instance(&rpmb_context);
52 
53 	service_locator_register_strategy(standalone_location_strategy());
54 }
55