]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/staging/sep/sep_driver_ext_api.h
Staging: sep: Create a structure to hold all the current crap spewed about as globals
[karo-tx-linux.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 extern int sepDebug;
38
39 /*
40 this function loads the ROM code in SEP (needed only in the debug mode on FPGA)
41 */
42 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 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 int sep_copy_cache_resident_to_area(unsigned long   src_cache_addr,
55                                 unsigned long   cache_size_in_bytes,
56                                 unsigned long   src_resident_addr,
57                                 unsigned long   resident_size_in_bytes,
58                                 unsigned long  *dst_new_cache_addr_ptr,
59                                 unsigned long  *dst_new_resident_addr_ptr);
60
61 /*
62 This functions maps and allocates the shared area on the external
63 RAM (device) The input is shared_area_size - the size of the memory
64 to allocate. The outputs are kernel_shared_area_addr_ptr - the kerenl
65 address of the mapped and allocated shared area, and
66 phys_shared_area_addr_ptr - the physical address of the shared area
67 */
68 int sep_map_and_alloc_shared_area(unsigned long   shared_area_size,
69                                 unsigned long  *kernel_shared_area_addr_ptr,
70                                 unsigned long  *phys_shared_area_addr_ptr);
71
72 /*
73 This functions unmaps and deallocates the shared area on the  external
74 RAM (device) The input is shared_area_size - the size of the memory to
75 deallocate,kernel_shared_area_addr_ptr - the kernel address of the
76 mapped and allocated shared area,phys_shared_area_addr_ptr - the physical
77 address of the shared area
78 */
79 void sep_unmap_and_free_shared_area(unsigned long   shared_area_size,
80                                 unsigned long   kernel_shared_area_addr,
81                                 unsigned long   phys_shared_area_addr);
82
83
84 /*
85 This functions returns the physical address inside shared area according
86 to the virtual address. It can be either on the externa RAM device
87 (ioremapped), or on the system RAM
88 */
89 unsigned long sep_shared_area_virt_to_phys(unsigned long virt_address);
90
91 /*
92 This functions returns the vitrual address inside shared area according
93 to the physical address. It can be either on the externa RAM device
94 (ioremapped), or on the system RAM This implementation is for the external RAM
95 */
96 unsigned long sep_shared_area_phys_to_virt(unsigned long phys_address);
97
98 /*
99 This function registers th driver to the device
100 subsystem (either PCI, USB, etc)
101 */
102 int sep_register_driver_to_device(void);
103
104 #endif /*__SEP_DRIVER_EXT_API_H__*/