blob: cad90578acbb4cbeeca3a1a366f0e4a6ae5d0c19 [file] [log] [blame]
Mark Allyncd1bb432009-08-06 20:43:59 +01001/*
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 */
Alan Coxb10b4832009-08-07 19:23:26 +010037static int sepDebug;
Mark Allyncd1bb432009-08-06 20:43:59 +010038
Mark Allyncd1bb432009-08-06 20:43:59 +010039/*
40this function loads the ROM code in SEP (needed only in the debug mode on FPGA)
41*/
Alan Coxb10b4832009-08-07 19:23:26 +010042static void sep_load_rom_code(void);
Mark Allyncd1bb432009-08-06 20:43:59 +010043
44/*
Mark Allyncd1bb432009-08-06 20:43:59 +010045This functions copies the cache and resident from their source location into
46destination memory, which is external to Linux VM and is given as physical
47address
48*/
Alan Coxb10b4832009-08-07 19:23:26 +010049static 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);
Mark Allyncd1bb432009-08-06 20:43:59 +010050
51/*
52This functions maps and allocates the shared area on the external
53RAM (device) The input is shared_area_size - the size of the memory
54to allocate. The outputs are kernel_shared_area_addr_ptr - the kerenl
55address of the mapped and allocated shared area, and
56phys_shared_area_addr_ptr - the physical address of the shared area
57*/
Alan Coxb10b4832009-08-07 19:23:26 +010058static 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);
Mark Allyncd1bb432009-08-06 20:43:59 +010059
60/*
61This functions unmaps and deallocates the shared area on the external
62RAM (device) The input is shared_area_size - the size of the memory to
63deallocate,kernel_shared_area_addr_ptr - the kernel address of the
64mapped and allocated shared area,phys_shared_area_addr_ptr - the physical
65address of the shared area
66*/
Alan Coxb10b4832009-08-07 19:23:26 +010067static void sep_unmap_and_free_shared_area(unsigned long shared_area_size, unsigned long kernel_shared_area_addr, unsigned long phys_shared_area_addr);
Mark Allyncd1bb432009-08-06 20:43:59 +010068
69
70/*
71This functions returns the physical address inside shared area according
72to the virtual address. It can be either on the externa RAM device
73(ioremapped), or on the system RAM
74*/
Alan Coxb10b4832009-08-07 19:23:26 +010075static unsigned long sep_shared_area_virt_to_phys(unsigned long virt_address);
Mark Allyncd1bb432009-08-06 20:43:59 +010076
77/*
78This functions returns the vitrual address inside shared area according
79to 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*/
Alan Coxb10b4832009-08-07 19:23:26 +010082static unsigned long sep_shared_area_phys_to_virt(unsigned long phys_address);
Mark Allyncd1bb432009-08-06 20:43:59 +010083
Mark Allyncd1bb432009-08-06 20:43:59 +010084#endif /*__SEP_DRIVER_EXT_API_H__*/