1 /* 2 * 3 * SPDX-License-Identifier: GPL-2.0 4 * 5 * Copyright (C) 2011-2018 ARM or its affiliates 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; version 2. 10 * This program is distributed in the hope that it will be useful, but 11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 * for more details. 14 * You should have received a copy of the GNU General Public License along 15 * with this program; if not, write to the Free Software Foundation, Inc., 16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 * 18 */ 19 20 #if !defined( __FSM_OPERATIONS_H__ ) 21 #define __FSM_OPERATIONS_H__ 22 23 typedef struct _fsm_init_param_t_ { 24 void *p_fsm_mgr; 25 uintptr_t isp_base; 26 27 } fsm_init_param_t; 28 29 typedef void ( *FUN_PTR_INIT )( void *fsm, fsm_init_param_t *init_param ); 30 typedef void ( *FUN_PTR_DEINIT )( void *fsm ); 31 32 typedef int ( *FUN_PTR_RUN )( void *fsm ); 33 typedef int ( *FUN_PTR_SET_PARAM )( void *p_fsm, uint32_t param_id, void *input, uint32_t input_size ); 34 typedef int ( *FUN_PTR_GET_PARAM )( void *p_fsm, uint32_t param_id, void *input, uint32_t input_size, void *output, uint32_t output_size ); 35 36 typedef int ( *FUN_PTR_PROC_EVENT )( void *fsm, event_id_t event_id ); 37 typedef void ( *FUN_PTR_PROC_INT )( void *fsm, uint8_t irq_event ); 38 39 40 typedef struct _fsm_ops_t_ { 41 42 FUN_PTR_INIT init; 43 FUN_PTR_DEINIT deinit; 44 45 FUN_PTR_RUN run; 46 FUN_PTR_SET_PARAM set_param; 47 FUN_PTR_GET_PARAM get_param; 48 49 FUN_PTR_PROC_EVENT proc_event; 50 FUN_PTR_PROC_INT proc_interrupt; 51 } fsm_ops_t; 52 53 typedef struct _fsm_common_t_ { 54 void *p_fsm; 55 56 void *p_fsm_mgr; 57 uintptr_t isp_base; 58 uint8_t ctx_id; 59 60 fsm_ops_t ops; 61 } fsm_common_t; 62 63 typedef fsm_common_t *( *FUN_PTR_GET_FSM_COMMON )( uint8_t ctx_id ); 64 65 #endif /* __FSM_OPERATIONS_H__ */ 66