1 /* 2 * Copyright (c) 2025, Arm Limited. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #include <services/lfa_svc.h> 8 #include <smccc_helpers.h> 9 10 int lfa_setup(void) 11 { 12 return LFA_SUCCESS; 13 } 14 15 uint64_t lfa_smc_handler(uint32_t smc_fid, u_register_t x1, u_register_t x2, 16 u_register_t x3, u_register_t x4, void *cookie, 17 void *handle, u_register_t flags) 18 { 19 /** 20 * TODO: Acquire serialization lock. 21 */ 22 switch (smc_fid) { 23 case LFA_VERSION: 24 SMC_RET1(handle, LFA_VERSION_VAL); 25 break; 26 27 case LFA_FEATURES: 28 SMC_RET1(handle, is_lfa_fid(x1) ? LFA_SUCCESS : LFA_NOT_SUPPORTED); 29 break; 30 31 case LFA_GET_INFO: 32 break; 33 34 case LFA_GET_INVENTORY: 35 break; 36 37 case LFA_PRIME: 38 break; 39 40 case LFA_ACTIVATE: 41 break; 42 43 case LFA_CANCEL: 44 break; 45 46 default: 47 WARN("Unimplemented LFA Service Call: 0x%x\n", smc_fid); 48 SMC_RET1(handle, SMC_UNK); 49 break; /* unreachable */ 50 51 } 52 53 SMC_RET1(handle, SMC_UNK); 54 55 return 0; 56 } 57