Staging: sep: make everything static
[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 locks the area of the resident and cache sep code (if possible)
46 */
47 static void sep_lock_cache_resident_area(void);
48
49 /*
50 This functions copies the cache and resident from their source location into
51 destination memory, which is external to Linux VM and is given as physical
52 address
53 */
54 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);
55
56 /*
57 This functions maps and allocates the shared area on the external
58 RAM (device) The input is shared_area_size - the size of the memory
59 to allocate. The outputs are kernel_shared_area_addr_ptr - the kerenl
60 address of the mapped and allocated shared area, and
61 phys_shared_area_addr_ptr - the physical address of the shared area
62 */
63 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);
64
65 /*
66 This functions unmaps and deallocates the shared area on the  external
67 RAM (device) The input is shared_area_size - the size of the memory to
68 deallocate,kernel_shared_area_addr_ptr - the kernel address of the
69 mapped and allocated shared area,phys_shared_area_addr_ptr - the physical
70 address of the shared area
71 */
72 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);
73
74
75 /*
76 This functions returns the physical address inside shared area according
77 to the virtual address. It can be either on the externa RAM device
78 (ioremapped), or on the system RAM
79 */
80 static unsigned long sep_shared_area_virt_to_phys(unsigned long virt_address);
81
82 /*
83 This functions returns the vitrual address inside shared area according
84 to the physical address. It can be either on the externa RAM device
85 (ioremapped), or on the system RAM This implementation is for the external RAM
86 */
87 static unsigned long sep_shared_area_phys_to_virt(unsigned long phys_address);
88
89 /*
90 This function registers th driver to the device
91 subsystem (either PCI, USB, etc)
92 */
93 static int sep_register_driver_to_device(void);
94
95 #endif /*__SEP_DRIVER_EXT_API_H__*/