Path: blob/main/sys/contrib/ncsw/inc/Peripherals/fm_muram_ext.h
48375 views
/*1* Copyright 2008-2012 Freescale Semiconductor Inc.2*3* Redistribution and use in source and binary forms, with or without4* modification, are permitted provided that the following conditions are met:5* * Redistributions of source code must retain the above copyright6* notice, this list of conditions and the following disclaimer.7* * Redistributions in binary form must reproduce the above copyright8* notice, this list of conditions and the following disclaimer in the9* documentation and/or other materials provided with the distribution.10* * Neither the name of Freescale Semiconductor nor the11* names of its contributors may be used to endorse or promote products12* derived from this software without specific prior written permission.13*14*15* ALTERNATIVELY, this software may be distributed under the terms of the16* GNU General Public License ("GPL") as published by the Free Software17* Foundation, either version 2 of that License or (at your option) any18* later version.19*20* THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY21* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED22* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE23* DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY24* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES25* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;26* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND27* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT28* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS29* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.30*/313233/**************************************************************************//**34@File fm_muram_ext.h3536@Description FM MURAM Application Programming Interface.37*//***************************************************************************/38#ifndef __FM_MURAM_EXT39#define __FM_MURAM_EXT4041#include "error_ext.h"42#include "std_ext.h"434445/**************************************************************************//**4647@Group FM_grp Frame Manager API4849@Description FM API functions, definitions and enums5051@{52*//***************************************************************************/5354/**************************************************************************//**55@Group FM_muram_grp FM MURAM5657@Description FM MURAM API functions, definitions and enums5859@{60*//***************************************************************************/6162/**************************************************************************//**63@Group FM_muram_init_grp FM MURAM Initialization Unit6465@Description FM MURAM initialization API functions, definitions and enums6667@{68*//***************************************************************************/6970/**************************************************************************//**71@Function FM_MURAM_ConfigAndInit7273@Description Creates partition in the MURAM.7475The routine returns a handle (descriptor) to the MURAM partition.76This descriptor must be passed as first parameter to all other77FM-MURAM function calls.7879No actual initialization or configuration of FM_MURAM hardware is80done by this routine.8182@Param[in] baseAddress - Pointer to base of memory mapped FM-MURAM.83@Param[in] size - Size of the FM-MURAM partition.8485@Return Handle to FM-MURAM object, or NULL for Failure.86*//***************************************************************************/87t_Handle FM_MURAM_ConfigAndInit(uintptr_t baseAddress, uint32_t size);8889/**************************************************************************//**90@Function FM_MURAM_Free9192@Description Frees all resources that were assigned to FM-MURAM module.9394Calling this routine invalidates the descriptor.9596@Param[in] h_FmMuram - FM-MURAM module descriptor.9798@Return E_OK on success; Error code otherwise.99*//***************************************************************************/100t_Error FM_MURAM_Free(t_Handle h_FmMuram);101102/** @} */ /* end of FM_muram_init_grp group */103104105/**************************************************************************//**106@Group FM_muram_ctrl_grp FM MURAM Control Unit107108@Description FM MURAM control API functions, definitions and enums109110@{111*//***************************************************************************/112113/**************************************************************************//**114@Function FM_MURAM_AllocMem115116@Description Allocate some memory from FM-MURAM partition.117118@Param[in] h_FmMuram - FM-MURAM module descriptor.119@Param[in] size - size of the memory to be allocated.120@Param[in] align - Alignment of the memory.121122@Return address of the allocated memory; NULL otherwise.123*//***************************************************************************/124void * FM_MURAM_AllocMem(t_Handle h_FmMuram, uint32_t size, uint32_t align);125126/**************************************************************************//**127@Function FM_MURAM_AllocMemForce128129@Description Allocate some specific memory from FM-MURAM partition (according130to base).131132@Param[in] h_FmMuram - FM-MURAM module descriptor.133@Param[in] base - the desired base-address to be allocated.134@Param[in] size - size of the memory to be allocated.135136@Return address of the allocated memory; NULL otherwise.137*//***************************************************************************/138void * FM_MURAM_AllocMemForce(t_Handle h_FmMuram, uint64_t base, uint32_t size);139140/**************************************************************************//**141@Function FM_MURAM_FreeMem142143@Description Free an allocated memory from FM-MURAM partition.144145@Param[in] h_FmMuram - FM-MURAM module descriptor.146@Param[in] ptr - A pointer to an allocated memory.147148@Return E_OK on success; Error code otherwise.149*//***************************************************************************/150t_Error FM_MURAM_FreeMem(t_Handle h_FmMuram, void *ptr);151152/**************************************************************************//**153@Function FM_MURAM_GetFreeMemSize154155@Description Returns the size (in bytes) of free MURAM memory.156157@Param[in] h_FmMuram - FM-MURAM module descriptor.158159@Return Free MURAM memory size in bytes.160*//***************************************************************************/161uint64_t FM_MURAM_GetFreeMemSize(t_Handle h_FmMuram);162163/** @} */ /* end of FM_muram_ctrl_grp group */164/** @} */ /* end of FM_muram_grp group */165/** @} */ /* end of FM_grp group */166167168169#endif /* __FM_MURAM_EXT */170171172