Path: blob/main/sys/contrib/ncsw/Peripherals/FM/inc/fm_sp_common.h
48525 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_sp_common.h3536@Description FM SP ...37*//***************************************************************************/38#ifndef __FM_SP_COMMON_H39#define __FM_SP_COMMON_H4041#include "std_ext.h"42#include "error_ext.h"43#include "list_ext.h"4445#include "fm_ext.h"46#include "fm_pcd_ext.h"47#include "fsl_fman.h"4849/**************************************************************************//**50@Description defaults51*//***************************************************************************/52#define DEFAULT_FM_SP_bufferPrefixContent_privDataSize 053#define DEFAULT_FM_SP_bufferPrefixContent_passPrsResult FALSE54#define DEFAULT_FM_SP_bufferPrefixContent_passTimeStamp FALSE55#define DEFAULT_FM_SP_bufferPrefixContent_allOtherPCDInfo FALSE56#define DEFAULT_FM_SP_bufferPrefixContent_dataAlign 645758/**************************************************************************//**59@Description structure for defining internal context copying60*//***************************************************************************/61typedef struct62{63uint16_t extBufOffset; /**< Offset in External buffer to which internal64context is copied to (Rx) or taken from (Tx, Op). */65uint8_t intContextOffset; /**< Offset within internal context to copy from66(Rx) or to copy to (Tx, Op). */67uint16_t size; /**< Internal offset size to be copied */68} t_FmSpIntContextDataCopy;6970/**************************************************************************//**71@Description struct for defining external buffer margins72*//***************************************************************************/73typedef struct {74uint16_t startMargins; /**< Number of bytes to be left at the beginning75of the external buffer (must be divisible by 16) */76uint16_t endMargins; /**< number of bytes to be left at the end77of the external buffer(must be divisible by 16) */78} t_FmSpBufMargins;7980typedef struct {81uint32_t dataOffset;82uint32_t prsResultOffset;83uint32_t timeStampOffset;84uint32_t hashResultOffset;85uint32_t pcdInfoOffset;86uint32_t manipOffset;87} t_FmSpBufferOffsets;888990t_Error FmSpBuildBufferStructure(t_FmSpIntContextDataCopy *p_FmPortIntContextDataCopy,91t_FmBufferPrefixContent *p_BufferPrefixContent,92t_FmSpBufMargins *p_FmPortBufMargins,93t_FmSpBufferOffsets *p_FmPortBufferOffsets,94uint8_t *internalBufferOffset);9596t_Error FmSpCheckIntContextParams(t_FmSpIntContextDataCopy *p_FmSpIntContextDataCopy);97t_Error FmSpCheckBufPoolsParams(t_FmExtPools *p_FmExtPools,98t_FmBackupBmPools *p_FmBackupBmPools,99t_FmBufPoolDepletion *p_FmBufPoolDepletion);100t_Error FmSpCheckBufMargins(t_FmSpBufMargins *p_FmSpBufMargins);101void FmSpSetBufPoolsInAscOrderOfBufSizes(t_FmExtPools *p_FmExtPools, uint8_t *orderedArray, uint16_t *sizesArray);102103t_Error FmPcdSpAllocProfiles(t_Handle h_FmPcd,104uint8_t hardwarePortId,105uint16_t numOfStorageProfiles,106uint16_t *base,107uint8_t *log2Num);108t_Error FmPcdSpGetAbsoluteProfileId(t_Handle h_FmPcd,109t_Handle h_FmPort,110uint16_t relativeProfile,111uint16_t *p_AbsoluteId);112void SpInvalidateProfileSw(t_Handle h_FmPcd, uint16_t absoluteProfileId);113void SpValidateProfileSw(t_Handle h_FmPcd, uint16_t absoluteProfileId);114115116#endif /* __FM_SP_COMMON_H */117118119