Staging: sep: squish some of the wrapper functions
[firefly-linux-kernel-4.4.55.git] / drivers / staging / sep / sep_driver_ext_api.h
1 /*
2  *
3  *  sep_driver_ext_api.h - Security Processor Driver external api definitions
4  *
5  *  Copyright(c) 2009 Intel Corporation. All rights reserved.
6  *  Copyright(c) 2009 Discretix. All rights reserved.
7  *
8  *  This program is free software; you can redistribute it and/or modify it
9  *  under the terms of the GNU General Public License as published by the Free
10  *  Software Foundation; either version 2 of the License, or (at your option)
11  *  any later version.
12  *
13  *  This program is distributed in the hope that it will be useful, but WITHOUT
14  *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15  *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
16  *  more details.
17  *
18  *  You should have received a copy of the GNU General Public License along with
19  *  this program; if not, write to the Free Software Foundation, Inc., 59
20  *  Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21  *
22  *  CONTACTS:
23  *
24  *  Mark Allyn          mark.a.allyn@intel.com
25  *
26  *  CHANGES:
27  *
28  *  2009.06.26  Initial publish
29  *
30  */
31
32 #ifndef __SEP_DRIVER_EXT_API_H__
33 #define __SEP_DRIVER_EXT_API_H__
34
35
36 /* shared variables */
37 static int sepDebug;
38
39 /*
40 this function loads the ROM code in SEP (needed only in the debug mode on FPGA)
41 */
42 static void sep_load_rom_code(void);
43
44 /*
45 This functions copies the cache and resident from their source location into
46 destination memory, which is external to Linux VM and is given as physical
47 address
48 */
49 static int sep_copy_cache_resident_to_area(unsigned long src_cache_addr, unsigned long cache_size_in_bytes, unsigned long src_resident_addr, unsigned long resident_size_in_bytes, unsigned long *dst_new_cache_addr_ptr, unsigned long *dst_new_resident_addr_ptr);
50
51 /*
52 This functions maps and allocates the shared area on the external
53 RAM (device) The input is shared_area_size - the size of the memory
54 to allocate. The outputs are kernel_shared_area_addr_ptr - the kerenl
55 address of the mapped and allocated shared area, and
56 phys_shared_area_addr_ptr - the physical address of the shared area
57 */
58 static int sep_map_and_alloc_shared_area(unsigned long shared_area_size, unsigned long *kernel_shared_area_addr_ptr, unsigned long *phys_shared_area_addr_ptr);
59
60 /*
61 This functions unmaps and deallocates the shared area on the  external
62 RAM (device) The input is shared_area_size - the size of the memory to
63 deallocate,kernel_shared_area_addr_ptr - the kernel address of the
64 mapped and allocated shared area,phys_shared_area_addr_ptr - the physical
65 address of the shared area
66 */
67 static void sep_unmap_and_free_shared_area(unsigned long shared_area_size, unsigned long kernel_shared_area_addr, unsigned long phys_shared_area_addr);
68
69
70 /*
71 This functions returns the physical address inside shared area according
72 to the virtual address. It can be either on the externa RAM device
73 (ioremapped), or on the system RAM
74 */
75 static unsigned long sep_shared_area_virt_to_phys(unsigned long virt_address);
76
77 /*
78 This functions returns the vitrual address inside shared area according
79 to the physical address. It can be either on the externa RAM device
80 (ioremapped), or on the system RAM This implementation is for the external RAM
81 */
82 static unsigned long sep_shared_area_phys_to_virt(unsigned long phys_address);
83
84 #endif /*__SEP_DRIVER_EXT_API_H__*/