2 * Copyright 2008-2012 Freescale Semiconductor Inc.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above copyright
9 * notice, this list of conditions and the following disclaimer in the
10 * documentation and/or other materials provided with the distribution.
11 * * Neither the name of Freescale Semiconductor nor the
12 * names of its contributors may be used to endorse or promote products
13 * derived from this software without specific prior written permission.
16 * ALTERNATIVELY, this software may be distributed under the terms of the
17 * GNU General Public License ("GPL") as published by the Free Software
18 * Foundation, either version 2 of that License or (at your option) any
21 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
22 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 /**************************************************************************//**
37 @Description FM MURAM Application Programming Interface.
38 *//***************************************************************************/
39 #ifndef __FM_MURAM_EXT
40 #define __FM_MURAM_EXT
42 #include "error_ext.h"
46 /**************************************************************************//**
48 @Group FM_grp Frame Manager API
50 @Description FM API functions, definitions and enums
53 *//***************************************************************************/
55 /**************************************************************************//**
56 @Group FM_muram_grp FM MURAM
58 @Description FM MURAM API functions, definitions and enums
61 *//***************************************************************************/
63 /**************************************************************************//**
64 @Group FM_muram_init_grp FM MURAM Initialization Unit
66 @Description FM MURAM initialization API functions, definitions and enums
69 *//***************************************************************************/
71 /**************************************************************************//**
72 @Function FM_MURAM_ConfigAndInit
74 @Description Creates partition in the MURAM.
76 The routine returns a handle (descriptor) to the MURAM partition.
77 This descriptor must be passed as first parameter to all other
78 FM-MURAM function calls.
80 No actual initialization or configuration of FM_MURAM hardware is
83 @Param[in] baseAddress - Pointer to base of memory mapped FM-MURAM.
84 @Param[in] size - Size of the FM-MURAM partition.
86 @Return Handle to FM-MURAM object, or NULL for Failure.
87 *//***************************************************************************/
88 t_Handle FM_MURAM_ConfigAndInit(uintptr_t baseAddress, uint32_t size);
90 /**************************************************************************//**
91 @Function FM_MURAM_Free
93 @Description Frees all resources that were assigned to FM-MURAM module.
95 Calling this routine invalidates the descriptor.
97 @Param[in] h_FmMuram - FM-MURAM module descriptor.
99 @Return E_OK on success; Error code otherwise.
100 *//***************************************************************************/
101 t_Error FM_MURAM_Free(t_Handle h_FmMuram);
103 /** @} */ /* end of FM_muram_init_grp group */
106 /**************************************************************************//**
107 @Group FM_muram_ctrl_grp FM MURAM Control Unit
109 @Description FM MURAM control API functions, definitions and enums
112 *//***************************************************************************/
114 /**************************************************************************//**
115 @Function FM_MURAM_AllocMem
117 @Description Allocate some memory from FM-MURAM partition.
119 @Param[in] h_FmMuram - FM-MURAM module descriptor.
120 @Param[in] size - size of the memory to be allocated.
121 @Param[in] align - Alignment of the memory.
123 @Return address of the allocated memory; NULL otherwise.
124 *//***************************************************************************/
125 void * FM_MURAM_AllocMem(t_Handle h_FmMuram, uint32_t size, uint32_t align);
127 /**************************************************************************//**
128 @Function FM_MURAM_AllocMemForce
130 @Description Allocate some specific memory from FM-MURAM partition (according
133 @Param[in] h_FmMuram - FM-MURAM module descriptor.
134 @Param[in] base - the desired base-address to be allocated.
135 @Param[in] size - size of the memory to be allocated.
137 @Return address of the allocated memory; NULL otherwise.
138 *//***************************************************************************/
139 void * FM_MURAM_AllocMemForce(t_Handle h_FmMuram, uint64_t base, uint32_t size);
141 /**************************************************************************//**
142 @Function FM_MURAM_FreeMem
144 @Description Free an allocated memory from FM-MURAM partition.
146 @Param[in] h_FmMuram - FM-MURAM module descriptor.
147 @Param[in] ptr - A pointer to an allocated memory.
149 @Return E_OK on success; Error code otherwise.
150 *//***************************************************************************/
151 t_Error FM_MURAM_FreeMem(t_Handle h_FmMuram, void *ptr);
153 /**************************************************************************//**
154 @Function FM_MURAM_GetFreeMemSize
156 @Description Returns the size (in bytes) of free MURAM memory.
158 @Param[in] h_FmMuram - FM-MURAM module descriptor.
160 @Return Free MURAM memory size in bytes.
161 *//***************************************************************************/
162 uint64_t FM_MURAM_GetFreeMemSize(t_Handle h_FmMuram);
164 /** @} */ /* end of FM_muram_ctrl_grp group */
165 /** @} */ /* end of FM_muram_grp group */
166 /** @} */ /* end of FM_grp group */
170 #endif /* __FM_MURAM_EXT */