/**
*******************************************************************************
 @file mantis_hw_info.h

 @brief StfCamss HW constants

 These are various magic numbers chosen for the design.
 This file is automatically generated for one specific version of the HW.

 @copyright StarFive Technology Co., Ltd. All Rights Reserved.

 @license Strictly Confidential.
   No part of this software, either material or conceptual may be copied or
   distributed, transmitted, transcribed, stored in a retrieval system or
   translated into any human or computer language in any form by any means,
   electronic, mechanical, manual or other-wise, or disclosed to third
   parties without the express written permission of
   Shanghai StarFive Technology Co., Ltd.

******************************************************************************/
#ifndef MANTIS_HW_INFO_H_
#define MANTIS_HW_INFO_H_

/**
 * @defgroup MANTIS_HW_INFO HW Information
 * @brief Information about design and registers in HW
 * @ingroup CI_API
 * @{
 */
/*-----------------------------------------------------------------------------
 * Following elements are in the MANTIS_HW_INFO documentation module
 *---------------------------------------------------------------------------*/


/**
 * @name version
 * @{
 */

/** @brief core designer */
#define MANTIS_DESIGNER 0u
/** @brief major */
#define MANTIS_VERSION_MAJ 1u
/** @brief minor */
#define MANTIS_VERSION_MIN 0u
/** @brief maintenance */
#define MANTIS_VERSION_MNT 0u

/** @brief StarFive Technology Group ID */
#define MANTIS_GROUP_ID 0x01
/** @brief StfCamss core allocation ID */
#define MANTIS_ALLOCATION_ID 0x1

/**
 * @brief Maximum number of frames expected per active contexts
 *
 * Can be used to define a bigger value than the linked list queue size.
 *
 * @note used only if MMU is enabled
 */
#define CI_MAX_N_BUFF 10

/**
 * @}
 * @name system memory
 * @{
 */

/* remove warning when using sim and driver headers */
#undef SYSMEM_ALIGNMENT
/**
 * @brief [bytes] data structures in system memory must be aligned to an
 * address which is a multiple of this
 */
#define SYSMEM_ALIGNMENT (8)
//#define SYSMEM_ALIGNMENT (64)
//#define SYSMEM_ALIGNMENT (128)
#define SYSMEM_ALIGNMENT_128 (128)

/**
 * @brief Value used in linked list to mean invalid address.
 *
 * Value is -1 (0xffffffff) but the bottom 6 bits are masked therefore
 * it is 0xffffffc0
 */
#define SYSMEM_INVALID_ADDR ((STF_U32)0xffffffc0)

/**
 * @}
 * @name BRN section
 * @brief Defines present SW work around for this HW
 * @{
 */

/** 
 * if cropping occurs at the bottom of the IFF the clocks
 * may be turned off and the end of frame from the imager could
 * be missed
 * work-around is to force the clocks on for the corresponding
 * context clocks and turn them back to auto when finished */
#define BRN48137
/**
 * Recommends SW to flush the cache for every buffer mapping but we do it
 * once all buffers are mapped */
#define BRN48951
/** DPF read map loading in HW has trouble if a
  * single line uses the whole setup buffer to avoid that we
  * add an extra element in the buffer size
  * (we could also verify that no line is matching that case
  * but it is unlikely that a single window will use the
  * whole available buffer) */
#define BRN49116
/** When the imager interface is setup
 * to crop the bottom of the image from the frame then clocks may be
 * turned off to the gasket frame counter register before the frame
 * end has been received */
#define BRN49615
/** data insertion has to be on or off or memory will get corrupted in HW */
#define BRN50357
/** ensures gasket interrupts are disabled because of cross domain crossing */
#define BRN56343
/**
 * if DE point 2 is the only one active and memory is
 * stalled HW can lock up. Work around is to enable statistics
 * output later on.
 * The mask is the stats that do not solve the problem */
#define BRN58117

	
/**
 * @}
 */
/**
 * @}
 */
/*-----------------------------------------------------------------------------
 * End of the MANTIS_HW_INFO documentation module
 *---------------------------------------------------------------------------*/

#endif /* MANTIS_HW_INFO_H_ */
