Update repo
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
/*--------------------------------------------------------*/
|
||||
/* F021\Constants\Constants.h */
|
||||
/* */
|
||||
/* $Release Date: $ */
|
||||
/* $Copyright:
|
||||
// Copyright (C) 2014-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $ */
|
||||
/* */
|
||||
/* F021 Flash API v1.55 */
|
||||
/*--------------------------------------------------------*/
|
||||
|
||||
/*!
|
||||
\file F021\Constants\Constants.h
|
||||
\brief A set of Constant Values.
|
||||
*/
|
||||
#ifndef F021_CONSTANTS_H_
|
||||
#define F021_CONSTANTS_H_
|
||||
|
||||
#if defined(_CONCERTO)
|
||||
#include "Concerto.h"
|
||||
#elif defined(_F2837xD)
|
||||
#include "F2837xD.h"
|
||||
#elif defined(_F2837xS)
|
||||
#include "F2837xS.h"
|
||||
#elif defined(_F28004x)
|
||||
#include "F28004x.h"
|
||||
#else
|
||||
#include "FMC.h"
|
||||
#endif
|
||||
|
||||
|
||||
#if defined (_F2837xS)
|
||||
/*!
|
||||
\brief Define to map the direct access to the TI OTP memory.
|
||||
*/
|
||||
#define F021_TIOTP1_BASE_ADDRESS ((Fapi_TiOtpBytesType *)(F021_PROGRAM_TIOTP1_OFFSET + F021_TIOTP_SETTINGS_BASE))
|
||||
#define F021_TIOTP2_BASE_ADDRESS ((Fapi_TiOtpBytesType *)(F021_PROGRAM_TIOTP2_OFFSET + F021_TIOTP_SETTINGS_BASE))
|
||||
#define F021_TIOTP_BASE_ADDRESS ((Fapi_TiOtpBytesType *)(F021_PROGRAM_TIOTP_OFFSET + F021_TIOTP_SETTINGS_BASE))
|
||||
|
||||
/*!
|
||||
\brief Define to map the direct access to the FMC registers.
|
||||
*/
|
||||
#define F021_CPU0_W0_BASE_ADDRESS ((Fapi_FmcRegistersType *)F021_CPU0_W0_REGISTER_ADDRESS)
|
||||
#define F021_CPU0_W1_BASE_ADDRESS ((Fapi_FmcRegistersType *)F021_CPU0_W1_REGISTER_ADDRESS)
|
||||
|
||||
#else
|
||||
/*!
|
||||
\brief Define to map the direct access to the TI OTP memory.
|
||||
*/
|
||||
#define F021_TIOTP_BASE_ADDRESS ((Fapi_TiOtpBytesType *)(F021_PROGRAM_TIOTP_OFFSET + F021_TIOTP_SETTINGS_BASE))
|
||||
|
||||
/*!
|
||||
\brief Define to map the direct access to the FMC registers.
|
||||
*/
|
||||
#define F021_CPU0_BASE_ADDRESS ((Fapi_FmcRegistersType *)F021_CPU0_REGISTER_ADDRESS)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* F021_CONSTANTS_H_ */
|
||||
@@ -0,0 +1,163 @@
|
||||
/*--------------------------------------------------------*/
|
||||
/* F021\Constants\F2837xS.h */
|
||||
/* */
|
||||
/* $Release Date: $ */
|
||||
/* $Copyright:
|
||||
// Copyright (C) 2014-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $ */
|
||||
/* */
|
||||
/* F021 Flash API v1.55 */
|
||||
/*--------------------------------------------------------*/
|
||||
|
||||
/*!
|
||||
\file F021\Constants\F2837xS.h
|
||||
\brief A set of Constant Values for the F2837xS Family.
|
||||
*/
|
||||
#ifndef F021_CONSTANTS_F2837xS_H_
|
||||
#define F021_CONSTANTS_F2837xS_H_
|
||||
|
||||
/*!
|
||||
\brief Specifies the bit mask for determining all address bits exclusive of
|
||||
the offest imposed by the memory map register
|
||||
*/
|
||||
#define F021_PROGRAM_ADDRESS_MASK 0x07FFFFFF
|
||||
|
||||
/*!
|
||||
\brief Specifies the Offset to the TI OTP
|
||||
*/
|
||||
|
||||
#define F021_PROGRAM_TIOTP_OFFSET 0x00070000 //TI OTP start on C28x
|
||||
#define F021_PROGRAM_TIOTP1_OFFSET 0x00070000 //TI OTP start on C28x
|
||||
#define F021_PROGRAM_TIOTP2_OFFSET 0x00070800 //TI OTP start on C28x
|
||||
|
||||
/* Final values to be determined */
|
||||
|
||||
/*!
|
||||
\brief PGM_OSU Max Value
|
||||
*/
|
||||
#define F021_PGM_OSU_MAX 0xFF
|
||||
|
||||
/*!
|
||||
\brief PGM_OSU Min Value
|
||||
*/
|
||||
#define F021_PGM_OSU_MIN 0x02
|
||||
|
||||
/*!
|
||||
\brief ERA_OSU Max Value
|
||||
*/
|
||||
#define F021_ERA_OSU_MAX 0xFF
|
||||
|
||||
/*!
|
||||
\brief ERA_OSU Min Value
|
||||
*/
|
||||
#define F021_ERA_OSU_MIN 0x02
|
||||
|
||||
/*!
|
||||
\brief ADD_EXZ Max Value
|
||||
*/
|
||||
#define F021_ADD_EXZ_MAX 0x0F
|
||||
|
||||
/*!
|
||||
\brief ADD_EXZ Min Value
|
||||
*/
|
||||
#define F021_ADD_EXZ_MIN 0x02
|
||||
|
||||
/*!
|
||||
\brief EXE_VALD Max Value
|
||||
*/
|
||||
#define F021_EXE_VALD_MAX 0x0F
|
||||
|
||||
/*!
|
||||
\brief EXE_VALD Min Value
|
||||
*/
|
||||
#define F021_EXE_VALD_MIN 0x02
|
||||
|
||||
/*!
|
||||
\brief PROG_PUL_WIDTH Max Value
|
||||
*/
|
||||
#define F021_PROG_PUL_WIDTH_MAX 0xFFFF
|
||||
|
||||
/*!
|
||||
\brief PROG_PUL_WIDTH Min Value
|
||||
*/
|
||||
#define F021_PROG_PUL_WIDTH_MIN 0x0002
|
||||
|
||||
/*!
|
||||
\brief ERA_PUL_WIDTH Max Value
|
||||
*/
|
||||
#define F021_ERA_PUL_WIDTH_MAX 0xFFFFFFFF
|
||||
|
||||
/*!
|
||||
\brief ERA_PUL_WIDTH Min Value
|
||||
*/
|
||||
#define F021_ERA_PUL_WIDTH_MIN 0x00000002
|
||||
|
||||
/*!
|
||||
* FMC memory map defines
|
||||
*/
|
||||
#if defined (_F2837xS)
|
||||
#define F021_FLASH0_MAP_BEGIN 0x80000
|
||||
#define F021_FLASH0_MAP_END 0xBFFFF
|
||||
#define F021_OTP0_MAP_BEGIN 0x78000//Customer OTP start
|
||||
#define F021_OTP0_MAP_END 0x783FF//Customer OTP End
|
||||
#define F021_OTPECC0_MAP_BEGIN 0x1071000
|
||||
#define F021_OTPECC0_MAP_END 0x107107F
|
||||
#define F021_FLASHECC0_MAP_BEGIN 0x1080000
|
||||
#define F021_FLASHECC0_MAP_END 0x1087FFF
|
||||
|
||||
|
||||
#define F021_FLASH1_MAP_BEGIN 0xC0000
|
||||
#define F021_FLASH1_MAP_END 0xFFFFF
|
||||
#define F021_OTP1_MAP_BEGIN 0x78800//Customer OTP start
|
||||
#define F021_OTP1_MAP_END 0x78BFF//Customer OTP End
|
||||
#define F021_OTPECC1_MAP_BEGIN 0x1071200
|
||||
#define F021_OTPECC1_MAP_END 0x107127F
|
||||
#define F021_FLASHECC1_MAP_BEGIN 0x1088000
|
||||
#define F021_FLASHECC1_MAP_END 0x108FFFF
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\brief Define to map the direct access to the FMC registers.
|
||||
*/
|
||||
|
||||
#define F021_CPU0_W0_REGISTER_ADDRESS 0x0005F800
|
||||
#define F021_CPU0_W1_REGISTER_ADDRESS 0x0005FC00
|
||||
|
||||
/*!
|
||||
* Specific TI OTP Offsets
|
||||
*/
|
||||
|
||||
#define F021_TIOTP_PER_BANK_SIZE 0x800 //Even though TI OTP is 2K, Size is mentioned here as 0x800 (4K) because code uses this to find the offset of TI OTP (1, 2) relative to OTP Base address
|
||||
#define F021_TIOTP_SETTINGS_BASE 0xA8
|
||||
#define F021_TIOTP_BANK_SECTOR_OFFSET 0xAC
|
||||
|
||||
|
||||
#endif /* F021_CONSTANTS_F2837xS_H_ */
|
||||
@@ -0,0 +1,195 @@
|
||||
/*--------------------------------------------------------*/
|
||||
/* F021\F021.h */
|
||||
/* */
|
||||
/* $Release Date: $ */
|
||||
/* $Copyright:
|
||||
// Copyright (C) 2014-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $ */
|
||||
/* */
|
||||
/* F021 Flash API v1.55 */
|
||||
/*--------------------------------------------------------*/
|
||||
|
||||
/*!
|
||||
\file F021\F021.h
|
||||
\brief Main include file for F021 devices.
|
||||
*/
|
||||
#ifndef F021_H_
|
||||
#define F021_H_
|
||||
|
||||
#include "Registers.h"
|
||||
#include "Init.h"
|
||||
//#include "Helpers.h"
|
||||
#include "Constants/Constants.h"
|
||||
|
||||
#if !defined(F021)
|
||||
#define F021
|
||||
#endif
|
||||
|
||||
/* Flash C API functions*/
|
||||
|
||||
/* Flash State Machine commands */
|
||||
extern Fapi_FlashStatusType Fapi_getFsmStatus(void);
|
||||
|
||||
extern Fapi_StatusType Fapi_checkFsmForReady(void);
|
||||
|
||||
extern Fapi_StatusType Fapi_setActiveFlashBank(Fapi_FlashBankType oFlashBank);
|
||||
|
||||
extern Fapi_StatusType Fapi_connectFlashPumpToCpu(Fapi_CpuSelectorType oFlashCpu);
|
||||
|
||||
extern Fapi_StatusType Fapi_enableBanksForOtpWrite(uint8 u8Banks);
|
||||
|
||||
extern Fapi_StatusType Fapi_disableBanksForOtpWrite(void);
|
||||
|
||||
extern Fapi_StatusType Fapi_issueFsmSuspendCommand(void);
|
||||
|
||||
extern Fapi_StatusType Fapi_writeEwaitValue(uint32 u32Ewait);
|
||||
|
||||
extern void Fapi_flushPipeline(void);
|
||||
|
||||
/* Device Family Dependent FSM commands */
|
||||
extern uint32 * Fapi_remapEccAddress(uint32 u32EccAddress);
|
||||
|
||||
extern boolean Fapi_isAddressEcc(uint32 u32Address);
|
||||
|
||||
/* Async Commands */
|
||||
extern Fapi_StatusType Fapi_issueAsyncCommandWithAddress(
|
||||
Fapi_FlashStateCommandsType oCommand,
|
||||
uint32 *pu32StartAddress
|
||||
);
|
||||
|
||||
extern Fapi_StatusType Fapi_issueAsyncCommand(Fapi_FlashStateCommandsType oCommand);
|
||||
|
||||
/* Info Commands */
|
||||
extern Fapi_LibraryInfoType Fapi_getLibraryInfo(void);
|
||||
extern Fapi_DeviceInfoType Fapi_getDeviceInfo(void);
|
||||
extern Fapi_StatusType Fapi_getBankSectors(Fapi_FlashBankType oBank, Fapi_FlashBankSectorsType *poFlashBankSectors );
|
||||
|
||||
/* Init */
|
||||
extern Fapi_InitStruct Fapi_GlobalInit;
|
||||
extern Fapi_StatusType Fapi_initializeAPI(
|
||||
Fapi_FmcRegistersType *poFlashControlRegister,
|
||||
uint32 u32HclkFrequency
|
||||
);
|
||||
|
||||
/* Read commands */
|
||||
extern Fapi_StatusType Fapi_doBlankCheck(
|
||||
uint32 *pu32StartAddress,
|
||||
uint32 u32Length,
|
||||
Fapi_FlashStatusWordType *poFlashStatusWord
|
||||
);
|
||||
|
||||
extern Fapi_StatusType Fapi_doMarginRead(
|
||||
uint32 *pu32StartAddress,
|
||||
uint32 *pu32ReadBuffer,
|
||||
uint32 u32Length,
|
||||
Fapi_FlashReadMarginModeType oReadMode
|
||||
);
|
||||
|
||||
extern Fapi_StatusType Fapi_doVerify(
|
||||
uint32 *pu32StartAddress,
|
||||
uint32 u32Length,
|
||||
uint32 *pu32CheckValueBuffer,
|
||||
Fapi_FlashStatusWordType *poFlashStatusWord
|
||||
);
|
||||
|
||||
extern Fapi_StatusType Fapi_doVerifyBy16bits(
|
||||
uint16 *pu16StartAddress,
|
||||
uint32 u16Length,
|
||||
uint16 *pu16CheckValueBuffer,
|
||||
Fapi_FlashStatusWordType *poFlashStatusWord
|
||||
);
|
||||
|
||||
extern uint32 Fapi_calculatePsa(
|
||||
uint32 *pu32StartAddress,
|
||||
uint32 u32Length,
|
||||
uint32 u32PsaSeed,
|
||||
Fapi_FlashReadMarginModeType oReadMode
|
||||
);
|
||||
|
||||
extern Fapi_StatusType Fapi_doPsaVerify(
|
||||
uint32 *pu32StartAddress,
|
||||
uint32 u32Length,
|
||||
uint32 u32PsaValue,
|
||||
Fapi_FlashStatusWordType *poFlashStatusWord
|
||||
);
|
||||
|
||||
/* Programming Commands */
|
||||
#if defined(_C28X)
|
||||
extern Fapi_StatusType Fapi_issueProgrammingCommand(
|
||||
uint32 *pu32StartAddress,
|
||||
uint16 *pu16DataBuffer,
|
||||
uint16 u16DataBufferSizeInWords,
|
||||
uint16 *pu16EccBuffer,
|
||||
uint16 u16EccBufferSizeInBytes,
|
||||
Fapi_FlashProgrammingCommandsType oMode
|
||||
);
|
||||
|
||||
extern Fapi_StatusType Fapi_issueProgrammingCommandForEccAddresses(
|
||||
uint32 *pu32StartAddress,
|
||||
uint16 *pu16EccBuffer,
|
||||
uint16 u16EccBufferSizeInBytes
|
||||
);
|
||||
#else
|
||||
extern Fapi_StatusType Fapi_issueProgrammingCommand(
|
||||
uint32 *pu32StartAddress,
|
||||
uint8 *pu8DataBuffer,
|
||||
uint8 u8DataBufferSizeInBytes,
|
||||
uint8 *pu8EccBuffer,
|
||||
uint8 u8EccBufferSizeInBytes,
|
||||
Fapi_FlashProgrammingCommandsType oMode
|
||||
);
|
||||
|
||||
extern Fapi_StatusType Fapi_issueProgrammingCommandForEccAddresses(
|
||||
uint32 *pu32StartAddress,
|
||||
uint8 *pu8EccBuffer,
|
||||
uint8 u8EccBufferSizeInBytes
|
||||
);
|
||||
#endif
|
||||
|
||||
/* Utility Commands */
|
||||
extern Fapi_StatusType Fapi_waitDelay(volatile uint32 u32WaitDelay);
|
||||
|
||||
extern uint32 Fapi_calculateFletcherChecksum(
|
||||
uint16 const * pu16Data,
|
||||
uint16 u16Length
|
||||
);
|
||||
|
||||
extern uint8 Fapi_calculateEcc(
|
||||
uint32 u32Address,
|
||||
uint64 u64Data
|
||||
);
|
||||
|
||||
/* User Defined Functions */
|
||||
extern Fapi_StatusType Fapi_serviceWatchdogTimer(void);
|
||||
extern Fapi_StatusType Fapi_setupEepromSectorEnable(void);
|
||||
extern Fapi_StatusType Fapi_setupBankSectorEnable(void);
|
||||
|
||||
#endif /*F021_H_*/
|
||||
@@ -0,0 +1,61 @@
|
||||
/*--------------------------------------------------------*/
|
||||
/* F021\F021_F2837xS_C28x.h */
|
||||
/* */
|
||||
/* $Release Date: $ */
|
||||
/* $Copyright:
|
||||
// Copyright (C) 2014-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $ */
|
||||
/* */
|
||||
/* F021 Flash API v1.55 */
|
||||
/*--------------------------------------------------------*/
|
||||
|
||||
/*!
|
||||
\file F021\F021_F2837xS_C28x.h
|
||||
\brief Setups the defines required for Harmony C28x
|
||||
*/
|
||||
#ifndef F021_F2837xS_C28X_H_
|
||||
#define F021_F2837xS_C28X_H_
|
||||
|
||||
#if !defined(_F2837xS)
|
||||
#define _F2837xS
|
||||
#endif
|
||||
|
||||
#if !defined(_LITTLE_ENDIAN)
|
||||
#define _LITTLE_ENDIAN
|
||||
#endif
|
||||
|
||||
#if !defined(_C28X)
|
||||
#define _C28X
|
||||
#endif
|
||||
|
||||
#include "F021.h"
|
||||
|
||||
#endif /*F021_F2837xS_C28X_H_*/
|
||||
@@ -0,0 +1,62 @@
|
||||
/*--------------------------------------------------------*/
|
||||
/* F021\Init.h */
|
||||
/* */
|
||||
/* $Release Date: $ */
|
||||
/* $Copyright:
|
||||
// Copyright (C) 2014-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $ */
|
||||
/* */
|
||||
/* F021 Flash API v1.55 */
|
||||
/*--------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/*!
|
||||
\file F021\Init.h
|
||||
\brief
|
||||
*/
|
||||
#ifndef FAPI_INIT_H_
|
||||
#define FAPI_INIT_H_
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Fapi_TiOtpBytesType *m_poTiOtpBaseAddress;
|
||||
Fapi_FmcRegistersType *m_poFlashControlRegisters;
|
||||
uint8 m_u8MainBankWidth;
|
||||
uint8 m_u8EeBankWidth;
|
||||
uint8 m_u8MainEccWidth;
|
||||
uint8 m_u8EeEccWidth;
|
||||
uint8 m_u8CurrentRwait;
|
||||
uint8 m_u8CurrentEwait;
|
||||
uint16 m_u16HclkFrequency;
|
||||
} Fapi_InitStruct;
|
||||
|
||||
#endif /* FAPI_FLASH_STATE_MACHINE_H_ */
|
||||
@@ -0,0 +1,67 @@
|
||||
/*--------------------------------------------------------*/
|
||||
/* F021\Registers.h */
|
||||
/* */
|
||||
/* $Release Date: $ */
|
||||
/* $Copyright:
|
||||
// Copyright (C) 2014-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $ */
|
||||
/* */
|
||||
/* F021 Flash API v1.00 */
|
||||
/*--------------------------------------------------------*/
|
||||
|
||||
/*!
|
||||
\file F021\Registers.h
|
||||
\brief A complete mapping of the F021 Flash Registers
|
||||
|
||||
Allows named access to the F021 Flash Registers.
|
||||
*/
|
||||
#ifndef F021_REGISTERS_H_
|
||||
#define F021_REGISTERS_H_
|
||||
|
||||
#include "Types.h"
|
||||
|
||||
#if defined(_F2837xD)
|
||||
#include "Registers_C28x.h"
|
||||
#elif defined(_F2837xS)
|
||||
#include "Registers_C28x.h"
|
||||
#elif defined(_F28004x)
|
||||
#include "Registers_C28x.h"
|
||||
#elif defined(_C28X)
|
||||
#include "Registers_Concerto_C28x.h"
|
||||
#elif defined(_CONCERTO)
|
||||
#include "Registers_Concerto_Cortex.h"
|
||||
#elif defined(_LITTLE_ENDIAN)
|
||||
#include "Registers_FMC_LE.h"
|
||||
#else
|
||||
#include "Registers_FMC_BE.h"
|
||||
#endif
|
||||
|
||||
#endif /*F021_REGISTERS_H_*/
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,630 @@
|
||||
/*--------------------------------------------------------*/
|
||||
/* F02\Types.h */
|
||||
/* */
|
||||
/* $Release Date: $ */
|
||||
/* $Copyright:
|
||||
// Copyright (C) 2014-2024 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// $ */
|
||||
/* */
|
||||
/* F021 Flash API v1.55 */
|
||||
/*--------------------------------------------------------*/
|
||||
|
||||
/*!
|
||||
\file F021\Types.h
|
||||
\brief Types used by the F021 API.
|
||||
|
||||
These are the types used by the F021 API.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef F021_TYPES_H_
|
||||
#define F021_TYPES_H_
|
||||
|
||||
/*****************************************************************************/
|
||||
/* GLOBAL DEFINITIONS */
|
||||
/*****************************************************************************/
|
||||
#if ((defined(__TMS470__) || defined(__TI_ARM__)) && (__TI_COMPILER_VERSION__ < 5002000))
|
||||
#if !defined(__GNUC__)
|
||||
#error “F021 Flash API requires GCC language extensions. Use the –gcc option.”
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (defined(__TMS320C28xx__) && __TI_COMPILER_VERSION__ < 6004000)
|
||||
#if !defined(__GNUC__)
|
||||
#error “F021 Flash API requires GCC language extensions. Use the –gcc option.”
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__ICCARM__) /* IAR EWARM Compiler */
|
||||
#define ATTRIBUTE_PACKED __packed
|
||||
#elif defined(__TMS320C28XX__) /* TI CGT C28xx compilers */
|
||||
#define ATTRIBUTE_PACKED
|
||||
#else /* all other compilers */
|
||||
#define ATTRIBUTE_PACKED __attribute__((packed))
|
||||
#endif
|
||||
|
||||
#define CPU_TYPE_8 8
|
||||
#define CPU_TYPE_16 16
|
||||
#define CPU_TYPE_32 32
|
||||
|
||||
#define MSB_FIRST 0
|
||||
#define LSB_FIRST 1
|
||||
|
||||
#define HIGH_BYTE_FIRST 0
|
||||
#define LOW_BYTE_FIRST 1
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
/* REGISTER WIDTH */
|
||||
/*****************************************************************************/
|
||||
#define CPU_TYPE CPU_TYPE_32
|
||||
|
||||
/*****************************************************************************/
|
||||
/* ENDIANESS */
|
||||
/*****************************************************************************/
|
||||
#define CPU_BIT_ORDER LSB_FIRST
|
||||
|
||||
#if defined(_LITTLE_ENDIAN)
|
||||
#define CPU_BYTE_ORDER LOW_BYTE_FIRST
|
||||
#else
|
||||
#define CPU_BYTE_ORDER HIGH_BYTE_FIRST
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
/* TYPE DEFINITIONS */
|
||||
/*****************************************************************************/
|
||||
#if defined(__TMS320C28XX__)
|
||||
|
||||
typedef unsigned char boolean;
|
||||
|
||||
typedef unsigned int uint8; //This is 16bits in C28x
|
||||
typedef unsigned int uint16;
|
||||
typedef unsigned long int uint32;
|
||||
typedef unsigned long long int uint64;
|
||||
|
||||
typedef unsigned int uint16_least;
|
||||
typedef unsigned long int uint32_least;
|
||||
|
||||
typedef signed int sint16_least;
|
||||
typedef signed long int sint32_least;
|
||||
|
||||
//typedef float float32;
|
||||
//typedef long double float64;
|
||||
|
||||
#else
|
||||
|
||||
typedef unsigned char boolean;
|
||||
|
||||
typedef unsigned char uint8;
|
||||
typedef unsigned short uint16;
|
||||
typedef unsigned int uint32;
|
||||
typedef unsigned long long int uint64;
|
||||
|
||||
typedef signed char sint8;
|
||||
typedef signed short sint16;
|
||||
typedef signed int sint32;
|
||||
typedef signed long long int sint64;
|
||||
|
||||
typedef unsigned int uint8_least;
|
||||
typedef unsigned int uint16_least;
|
||||
typedef unsigned int uint32_least;
|
||||
|
||||
typedef signed int sint8_least;
|
||||
typedef signed int sint16_least;
|
||||
typedef signed int sint32_least;
|
||||
|
||||
typedef float float32;
|
||||
typedef double float64;
|
||||
|
||||
#endif
|
||||
|
||||
//#define false FALSE;
|
||||
//#define true TRUE;
|
||||
|
||||
/*!
|
||||
\brief This is used to indicate which Cpu is being used.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
Fapi_MasterCpu,
|
||||
Fapi_SlaveCpu0
|
||||
} ATTRIBUTE_PACKED Fapi_CpuSelectorType;
|
||||
|
||||
/*!
|
||||
\brief This is used to indicate what type of Cpu is being used.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
ARM7,
|
||||
M3,
|
||||
R4,
|
||||
R4F,
|
||||
C28,
|
||||
Undefined
|
||||
} ATTRIBUTE_PACKED Fapi_CpuType;
|
||||
|
||||
/*!
|
||||
\brief This is used to indicate what type of Family is being used.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
Family_FMC = 0x00,
|
||||
Family_L2FMC = 0x10,
|
||||
Family_Sonata = 0x20,
|
||||
Family_Stellaris = 0x30,
|
||||
Family_Future = 0x40
|
||||
} ATTRIBUTE_PACKED Fapi_FamilyType;
|
||||
|
||||
/*!
|
||||
\brief This is used to indicate what type of Address is being used.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
Fapi_Flash,
|
||||
Fapi_FlashEcc,
|
||||
Fapi_Otp,
|
||||
Fapi_OtpEcc,
|
||||
Fapi_Undefined
|
||||
} ATTRIBUTE_PACKED Fapi_AddressMemoryType;
|
||||
|
||||
/*!
|
||||
\brief This is used to return the information from the engineering row in the TI OTP.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32 u32AsicId;
|
||||
uint8 u8Revision;
|
||||
uint32 u32LotNumber;
|
||||
uint16 u16FlowCheck;
|
||||
uint16 u16WaferNumber;
|
||||
uint16 u16XCoordinate;
|
||||
uint16 u16YCoordinate;
|
||||
} ATTRIBUTE_PACKED Fapi_EngineeringRowType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32 au32StatusWord[4];
|
||||
} ATTRIBUTE_PACKED Fapi_FlashStatusWordType;
|
||||
|
||||
/*!
|
||||
\brief This contains all the possible modes used in the Fapi_IssueAsyncProgrammingCommand().
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
Fapi_AutoEccGeneration, /* This is the default mode for the command and will auto generate the ecc for the provided data buffer */
|
||||
Fapi_DataOnly, /* Command will only process the data buffer */
|
||||
Fapi_EccOnly, /* Command will only process the ecc buffer */
|
||||
Fapi_DataAndEcc /* Command will process data and ecc buffers */
|
||||
} ATTRIBUTE_PACKED Fapi_FlashProgrammingCommandsType;
|
||||
|
||||
/*!
|
||||
\brief This is used to indicate which Flash bank is being used.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
Fapi_FlashBank0,
|
||||
Fapi_FlashBank1,
|
||||
Fapi_FlashBank2,
|
||||
Fapi_FlashBank3,
|
||||
Fapi_FlashBank4,
|
||||
Fapi_FlashBank5,
|
||||
Fapi_FlashBank6,
|
||||
Fapi_FlashBank7
|
||||
} ATTRIBUTE_PACKED Fapi_FlashBankType;
|
||||
|
||||
/*!
|
||||
\brief This is used to indicate what F021 Bank Technology the bank is
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
Fapi_FLEP,
|
||||
Fapi_FLEE,
|
||||
Fapi_FLES,
|
||||
Fapi_FLHV,
|
||||
Fapi_TechTBD
|
||||
} ATTRIBUTE_PACKED Fapi_FlashBankTechType;
|
||||
|
||||
/*!
|
||||
\brief This is used to indicate which Flash sector is being used.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
Fapi_FlashSector0,
|
||||
Fapi_FlashSector1,
|
||||
Fapi_FlashSector2,
|
||||
Fapi_FlashSector3,
|
||||
Fapi_FlashSector4,
|
||||
Fapi_FlashSector5,
|
||||
Fapi_FlashSector6,
|
||||
Fapi_FlashSector7,
|
||||
Fapi_FlashSector8,
|
||||
Fapi_FlashSector9,
|
||||
Fapi_FlashSector10,
|
||||
Fapi_FlashSector11,
|
||||
Fapi_FlashSector12,
|
||||
Fapi_FlashSector13,
|
||||
Fapi_FlashSector14,
|
||||
Fapi_FlashSector15,
|
||||
Fapi_FlashSector16,
|
||||
Fapi_FlashSector17,
|
||||
Fapi_FlashSector18,
|
||||
Fapi_FlashSector19,
|
||||
Fapi_FlashSector20,
|
||||
Fapi_FlashSector21,
|
||||
Fapi_FlashSector22,
|
||||
Fapi_FlashSector23,
|
||||
Fapi_FlashSector24,
|
||||
Fapi_FlashSector25,
|
||||
Fapi_FlashSector26,
|
||||
Fapi_FlashSector27,
|
||||
Fapi_FlashSector28,
|
||||
Fapi_FlashSector29,
|
||||
Fapi_FlashSector30,
|
||||
Fapi_FlashSector31,
|
||||
Fapi_FlashSector32,
|
||||
Fapi_FlashSector33,
|
||||
Fapi_FlashSector34,
|
||||
Fapi_FlashSector35,
|
||||
Fapi_FlashSector36,
|
||||
Fapi_FlashSector37,
|
||||
Fapi_FlashSector38,
|
||||
Fapi_FlashSector39,
|
||||
Fapi_FlashSector40,
|
||||
Fapi_FlashSector41,
|
||||
Fapi_FlashSector42,
|
||||
Fapi_FlashSector43,
|
||||
Fapi_FlashSector44,
|
||||
Fapi_FlashSector45,
|
||||
Fapi_FlashSector46,
|
||||
Fapi_FlashSector47,
|
||||
Fapi_FlashSector48,
|
||||
Fapi_FlashSector49,
|
||||
Fapi_FlashSector50,
|
||||
Fapi_FlashSector51,
|
||||
Fapi_FlashSector52,
|
||||
Fapi_FlashSector53,
|
||||
Fapi_FlashSector54,
|
||||
Fapi_FlashSector55,
|
||||
Fapi_FlashSector56,
|
||||
Fapi_FlashSector57,
|
||||
Fapi_FlashSector58,
|
||||
Fapi_FlashSector59,
|
||||
Fapi_FlashSector60,
|
||||
Fapi_FlashSector61,
|
||||
Fapi_FlashSector62,
|
||||
Fapi_FlashSector63
|
||||
} ATTRIBUTE_PACKED Fapi_FlashSectorType;
|
||||
|
||||
/*!
|
||||
\brief This contains all the possible Flash State Machine commands.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
Fapi_ProgramData = 0x0002,
|
||||
Fapi_EraseSector = 0x0006,
|
||||
Fapi_EraseBank = 0x0008,
|
||||
Fapi_ValidateSector = 0x000E,
|
||||
Fapi_ClearStatus = 0x0010,
|
||||
Fapi_ProgramResume = 0x0014,
|
||||
Fapi_EraseResume = 0x0016,
|
||||
Fapi_ClearMore = 0x0018
|
||||
} ATTRIBUTE_PACKED Fapi_FlashStateCommandsType;
|
||||
|
||||
typedef uint32 Fapi_FlashStatusType;
|
||||
|
||||
/*!
|
||||
\brief This contains all the possible Flash State Machine commands.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
Fapi_NormalRead = 0x0,
|
||||
Fapi_RM0 = 0x1,
|
||||
Fapi_RM1 = 0x2
|
||||
} ATTRIBUTE_PACKED Fapi_FlashReadMarginModeType;
|
||||
|
||||
/*!
|
||||
\brief This is the master type containing all possible returned status codes.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
Fapi_Status_Success=0, /* Function completed successfully */
|
||||
Fapi_Status_FsmBusy, /* FSM is Busy */
|
||||
Fapi_Status_FsmReady, /* FSM is Ready */
|
||||
Fapi_Status_AsyncBusy, /* Async function operation is Busy */
|
||||
Fapi_Status_AsyncComplete, /* Async function operation is Complete */
|
||||
Fapi_Error_Fail=500, /* Generic Function Fail code */
|
||||
Fapi_Error_StateMachineTimeout, /* State machine polling never returned ready and timed out */
|
||||
Fapi_Error_OtpChecksumMismatch, /* Returned if OTP checksum does not match expected value */
|
||||
Fapi_Error_InvalidDelayValue, /* Returned if the Calculated RWAIT value exceeds 15 - Legacy Error */
|
||||
Fapi_Error_InvalidHclkValue, /* Returned if FClk is above max FClk value - FClk is a calculated from HClk and RWAIT/EWAIT */
|
||||
Fapi_Error_InvalidCpu, /* Returned if the specified Cpu does not exist */
|
||||
Fapi_Error_InvalidBank, /* Returned if the specified bank does not exist */
|
||||
Fapi_Error_InvalidAddress, /* Returned if the specified Address does not exist in Flash or OTP */
|
||||
Fapi_Error_InvalidReadMode, /* Returned if the specified read mode does not exist */
|
||||
Fapi_Error_AsyncIncorrectDataBufferLength,
|
||||
Fapi_Error_AsyncIncorrectEccBufferLength,
|
||||
Fapi_Error_AsyncDataEccBufferLengthMismatch,
|
||||
Fapi_Error_FeatureNotAvailable /* FMC feature is not available on this device */
|
||||
} ATTRIBUTE_PACKED Fapi_StatusType;
|
||||
|
||||
#if defined(_LITTLE_ENDIAN)
|
||||
typedef union
|
||||
{
|
||||
volatile struct
|
||||
{
|
||||
#if defined (_C28X)
|
||||
uint16 ChecksumLength:16; /* 0x150 bits 15:0 */
|
||||
uint16 OtpVersion:16; /* 0x150 bits 31:16 */
|
||||
uint32 OtpChecksum; /* 0x154 bits 31:0 */
|
||||
uint16 NumberOfBanks:16; /* 0x158 bits 15:0 */
|
||||
uint16 NumberOfSectors:16; /* 0x158 bits 31:16 */
|
||||
uint16 MemorySize:16; /* 0x15C bits 15:0 */
|
||||
uint16 Package:16; /* 0x15C bits 31:16 */
|
||||
uint16 SiliconRevision:8; /* 0x160 bits 7:0 */
|
||||
uint16 AsicNumber_23_8:8; /* 0x160 bits 31:8 */
|
||||
uint16 AsicNumber_31_24:16; /* 0x160 bits 31:8 */
|
||||
uint32 LotNumber; /* 0x164 bits 31:0 */
|
||||
uint16 WaferNumber:16; /* 0x168 bits 15:0 */
|
||||
uint16 Flowbits:16; /* 0x168 bits 31:16 */
|
||||
uint16 YCoordinate:16; /* 0x16C bits 15:0 */
|
||||
uint16 XCoordinate:16; /* 0x16C bits 31:16 */
|
||||
uint16 EVSU:8; /* 0x170 bits 7:0 */
|
||||
uint16 PVSU:8; /* 0x170 bits 15:8 */
|
||||
uint16 ESU:8; /* 0x170 bits 23:16 */
|
||||
uint16 PSU:8; /* 0x170 bits 31:24 */
|
||||
uint16 CVSU:12; /* 0x174 bits 11:0 */
|
||||
uint16 Add_EXEZSU:4; /* 0x174 bits 15:12 */
|
||||
uint16 PVAcc:8; /* 0x174 bits 23:16 */
|
||||
uint16 RVSU:8; /* 0x174 bits 31:24 */
|
||||
uint16 PVH2:8; /* 0x178 bits 7:0 */
|
||||
uint16 PVH:8; /* 0x178 bits 15:8 */
|
||||
uint16 RH:8; /* 0x178 bits 23:16 */
|
||||
uint16 PH:8; /* 0x178 bits 31:24 */
|
||||
uint16 SmFrequency:12; /* 0x17C bits 11:0 */
|
||||
uint16 VSTAT:4; /* 0x17C bits 15:12 */
|
||||
uint16 Sequence:8; /* 0x17C bits 23:16 */
|
||||
uint16 EH:8; /* 0x17C bits 31:24 */
|
||||
uint16 VHV_EStep:16; /* 0x180 bits 15:0 */
|
||||
uint16 VHV_EStart:16; /* 0x180 bits 31:16 */
|
||||
uint16 MAX_PP:16; /* 0x184 bits 15:0 */
|
||||
uint16 OtpReserved1:16; /* 0x184 bits 31:16 */
|
||||
uint16 PROG_PW:16; /* 0x188 bits 15:0 */
|
||||
uint16 MAX_EP:16; /* 0x188 bits 31:16 */
|
||||
uint32 ERA_PW; /* 0x18C bits 31:0 */
|
||||
uint16 VHV_E:16; /* 0x190 bits 15:0 */
|
||||
uint16 VHV_P:16; /* 0x190 bits 31:16 */
|
||||
uint16 VINH:8; /* 0x194 bits 7:0 */
|
||||
uint16 VCG:8; /* 0x194 bits 15:8 */
|
||||
uint16 VHV_PV:16; /* 0x194 bits 31:16 */
|
||||
uint16 OtpReserved2:8; /* 0x198 bits 7:0 */
|
||||
uint16 VRead:8; /* 0x198 bits 15:8 */
|
||||
uint16 VWL_P:8; /* 0x198 bits 23:16 */
|
||||
uint16 VSL_P:8; /* 0x198 bits 31:24 */
|
||||
uint32 ApiChecksum; /* 0x19C bits 15:0 */
|
||||
uint32 OtpReserved3; /* 0x1A0 bits 31:0 */
|
||||
uint32 OtpReserved4; /* 0x1A4 bits 31:0 */
|
||||
uint32 OtpReserved5; /* 0x1A8 bits 31:0 */
|
||||
uint32 OtpReserved6; /* 0x1AC bits 31:0 */
|
||||
#else
|
||||
uint32 ChecksumLength:16; /* 0x150 bits 15:0 */
|
||||
uint32 OtpVersion:16; /* 0x150 bits 31:16 */
|
||||
uint32 OtpChecksum; /* 0x154 bits 31:0 */
|
||||
uint32 NumberOfBanks:16; /* 0x158 bits 15:0 */
|
||||
uint32 NumberOfSectors:16; /* 0x158 bits 31:16 */
|
||||
uint32 MemorySize:16; /* 0x15C bits 15:0 */
|
||||
uint32 Package:16; /* 0x15C bits 31:16 */
|
||||
uint32 SiliconRevision:8; /* 0x160 bits 7:0 */
|
||||
uint32 AsicNumber:24; /* 0x160 bits 31:8 */
|
||||
uint32 LotNumber; /* 0x164 bits 31:0 */
|
||||
uint32 WaferNumber:16; /* 0x168 bits 15:0 */
|
||||
uint32 Flowbits:16; /* 0x168 bits 31:16 */
|
||||
uint32 YCoordinate:16; /* 0x16C bits 15:0 */
|
||||
uint32 XCoordinate:16; /* 0x16C bits 31:16 */
|
||||
uint32 EVSU:8; /* 0x170 bits 7:0 */
|
||||
uint32 PVSU:8; /* 0x170 bits 15:8 */
|
||||
uint32 ESU:8; /* 0x170 bits 23:16 */
|
||||
uint32 PSU:8; /* 0x170 bits 31:24 */
|
||||
uint32 CVSU:12; /* 0x174 bits 11:0 */
|
||||
uint32 Add_EXEZSU:4; /* 0x174 bits 15:12 */
|
||||
uint32 PVAcc:8; /* 0x174 bits 23:16 */
|
||||
uint32 RVSU:8; /* 0x174 bits 31:24 */
|
||||
uint32 PVH2:8; /* 0x178 bits 7:0 */
|
||||
uint32 PVH:8; /* 0x178 bits 15:8 */
|
||||
uint32 RH:8; /* 0x178 bits 23:16 */
|
||||
uint32 PH:8; /* 0x178 bits 31:24 */
|
||||
uint32 SmFrequency:12; /* 0x17C bits 11:0 */
|
||||
uint32 VSTAT:4; /* 0x17C bits 15:12 */
|
||||
uint32 Sequence:8; /* 0x17C bits 23:16 */
|
||||
uint32 EH:8; /* 0x17C bits 31:24 */
|
||||
uint32 VHV_EStep:16; /* 0x180 bits 15:0 */
|
||||
uint32 VHV_EStart:16; /* 0x180 bits 31:16 */
|
||||
uint32 MAX_PP:16; /* 0x184 bits 15:0 */
|
||||
uint32 OtpReserved1:16; /* 0x184 bits 31:16 */
|
||||
uint32 PROG_PW:16; /* 0x188 bits 15:0 */
|
||||
uint32 MAX_EP:16; /* 0x188 bits 31:16 */
|
||||
uint32 ERA_PW; /* 0x18C bits 31:0 */
|
||||
uint32 VHV_E:16; /* 0x190 bits 15:0 */
|
||||
uint32 VHV_P:16; /* 0x190 bits 31:16 */
|
||||
uint32 VINH:8; /* 0x194 bits 7:0 */
|
||||
uint32 VCG:8; /* 0x194 bits 15:8 */
|
||||
uint32 VHV_PV:16; /* 0x194 bits 31:16 */
|
||||
uint32 OtpReserved2:8; /* 0x198 bits 7:0 */
|
||||
uint32 VRead:8; /* 0x198 bits 15:8 */
|
||||
uint32 VWL_P:8; /* 0x198 bits 23:16 */
|
||||
uint32 VSL_P:8; /* 0x198 bits 31:24 */
|
||||
uint32 ApiChecksum:32; /* 0x19C bits 31:0 */
|
||||
uint32 OtpReserved3:32; /* 0x1A0 bits 31:0 */
|
||||
uint32 OtpReserved4:32; /* 0x1A4 bits 31:0 */
|
||||
uint32 OtpReserved5:32; /* 0x1A8 bits 31:0 */
|
||||
uint32 OtpReserved6:32; /* 0x1AC bits 31:0 */
|
||||
#endif
|
||||
} OTP_VALUE;
|
||||
volatile uint8 au8OtpWord[0x60];
|
||||
volatile uint16 au16OtpWord[0x30];
|
||||
volatile uint32 au32OtpWord[0x18];
|
||||
}Fapi_TiOtpBytesType;
|
||||
#else
|
||||
typedef union
|
||||
{
|
||||
volatile struct
|
||||
{
|
||||
uint32 OtpVersion:16; /* 0x150 bits 31:16 */
|
||||
uint32 ChecksumLength:16; /* 0x150 bits 15:0 */
|
||||
uint32 OtpChecksum; /* 0x154 bits 31:0 */
|
||||
uint32 NumberOfSectors:16; /* 0x158 bits 31:16 */
|
||||
uint32 NumberOfBanks:16; /* 0x158 bits 15:0 */
|
||||
uint32 Package:16; /* 0x15C bits 31:16 */
|
||||
uint32 MemorySize:16; /* 0x15C bits 15:0 */
|
||||
uint32 AsicNumber:24; /* 0x160 bits 31:8 */
|
||||
uint32 SiliconRevision:8; /* 0x160 bits 7:0 */
|
||||
uint32 LotNumber; /* 0x164 bits 31:0 */
|
||||
uint32 Flowbits:16; /* 0x168 bits 31:16 */
|
||||
uint32 WaferNumber:16; /* 0x168 bits 15:0 */
|
||||
uint32 XCoordinate:16; /* 0x16C bits 31:16 */
|
||||
uint32 YCoordinate:16; /* 0x16C bits 15:0 */
|
||||
uint32 PSU:8; /* 0x170 bits 31:24 */
|
||||
uint32 ESU:8; /* 0x170 bits 23:16 */
|
||||
uint32 PVSU:8; /* 0x170 bits 15:8 */
|
||||
uint32 EVSU:8; /* 0x170 bits 7:0 */
|
||||
uint32 RVSU:8; /* 0x174 bits 31:24 */
|
||||
uint32 PVAcc:8; /* 0x174 bits 23:16 */
|
||||
uint32 Add_EXEZSU:4; /* 0x174 bits 15:12 */
|
||||
uint32 CVSU:12; /* 0x174 bits 11:0 */
|
||||
uint32 PH:8; /* 0x178 bits 31:24 */
|
||||
uint32 RH:8; /* 0x178 bits 23:16 */
|
||||
uint32 PVH:8; /* 0x178 bits 15:8 */
|
||||
uint32 PVH2:8; /* 0x178 bits 7:0 */
|
||||
uint32 EH:8; /* 0x17C bits 31:24 */
|
||||
uint32 Sequence:8; /* 0x17C bits 23:16 */
|
||||
uint32 VSTAT:4; /* 0x17C bits 15:12 */
|
||||
uint32 SmFrequency:12; /* 0x17C bits 11:0 */
|
||||
uint32 VHV_EStart:16; /* 0x180 bits 31:16 */
|
||||
uint32 VHV_EStep:16; /* 0x180 bits 15:0 */
|
||||
uint32 OtpReserved1:16; /* 0x184 bits 31:16 */
|
||||
uint32 MAX_PP:16; /* 0x184 bits 15:0 */
|
||||
uint32 MAX_EP:16; /* 0x188 bits 31:16 */
|
||||
uint32 PROG_PW:16; /* 0x188 bits 15:0 */
|
||||
uint32 ERA_PW; /* 0x18C bits 31:0 */
|
||||
uint32 VHV_P:16; /* 0x190 bits 31:16 */
|
||||
uint32 VHV_E:16; /* 0x190 bits 15:0 */
|
||||
uint32 VHV_PV:16; /* 0x194 bits 31:16 */
|
||||
uint32 VCG:8; /* 0x194 bits 15:8 */
|
||||
uint32 VINH:8; /* 0x194 bits 7:0 */
|
||||
uint32 VSL_P:8; /* 0x198 bits 31:24 */
|
||||
uint32 VWL_P:8; /* 0x198 bits 23:16 */
|
||||
uint32 VRead:8; /* 0x198 bits 15:8 */
|
||||
uint32 OtpReserved2:8; /* 0x198 bits 7:0 */
|
||||
uint32 ApiChecksum:32; /* 0x19C bits 31:0 */
|
||||
uint32 OtpReserved3:32; /* 0x1A0 bits 31:0 */
|
||||
uint32 OtpReserved4:32; /* 0x1A4 bits 31:0 */
|
||||
uint32 OtpReserved5:32; /* 0x1A8 bits 31:0 */
|
||||
uint32 OtpReserved6:32; /* 0x1AC bits 31:0 */
|
||||
} OTP_VALUE;
|
||||
volatile uint8 au8OtpWord[0x60];
|
||||
volatile uint16 au16OtpWord[0x30];
|
||||
volatile uint32 au32OtpWord[0x18];
|
||||
}Fapi_TiOtpBytesType;
|
||||
#endif
|
||||
|
||||
typedef struct TI_OTP_TYPE
|
||||
{
|
||||
Fapi_TiOtpBytesType aOtpBank[8];
|
||||
}Fapi_TiOtpType;
|
||||
|
||||
/*!
|
||||
\brief
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
Alpha_Internal, /* For internal TI use only. Not intended to be used by customers */
|
||||
Alpha, /* Early Engineering release. May not be functionally complete */
|
||||
Beta_Internal, /* For internal TI use only. Not intended to be used by customers */
|
||||
Beta, /* Functionally complete, to be used for testing and validation */
|
||||
Production /* Fully validated, functionally complete, ready for production use */
|
||||
} ATTRIBUTE_PACKED Fapi_ApiProductionStatusType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8 u8ApiMajorVersion;
|
||||
uint8 u8ApiMinorVersion;
|
||||
uint8 u8ApiRevision;
|
||||
Fapi_ApiProductionStatusType oApiProductionStatus;
|
||||
uint32 u32ApiBuildNumber;
|
||||
uint8 u8ApiTechnologyType;
|
||||
uint8 u8ApiTechnologyRevision;
|
||||
uint8 u8ApiEndianness;
|
||||
uint32 u32ApiCompilerVersion;
|
||||
} Fapi_LibraryInfoType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
#if defined(_LITTLE_ENDIAN)
|
||||
uint16 u16NumberOfBanks;
|
||||
uint16 u16Reserved;
|
||||
uint16 u16DeviceMemorySize;
|
||||
uint16 u16DevicePackage;
|
||||
uint32 u32AsicId;
|
||||
uint32 u32LotNumber;
|
||||
uint16 u16WaferNumber;
|
||||
uint16 u16FlowCheck;
|
||||
uint16 u16WaferYCoordinate;
|
||||
uint16 u16WaferXCoordinate;
|
||||
#else
|
||||
uint16 u16Reserved;
|
||||
uint16 u16NumberOfBanks;
|
||||
uint16 u16DevicePackage;
|
||||
uint16 u16DeviceMemorySize;
|
||||
uint32 u32AsicId;
|
||||
uint32 u32LotNumber;
|
||||
uint16 u16FlowCheck;
|
||||
uint16 u16WaferNumber;
|
||||
uint16 u16WaferXCoordinate;
|
||||
uint16 u16WaferYCoordinate;
|
||||
#endif
|
||||
} Fapi_DeviceInfoType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Fapi_FlashBankTechType oFlashBankTech;
|
||||
uint32 u32NumberOfSectors;
|
||||
uint32 u32BankStartAddress;
|
||||
uint8 au8SectorSizes[16];
|
||||
} Fapi_FlashBankSectorsType;
|
||||
|
||||
#endif /*F021_TYPES_H_*/
|
||||
Reference in New Issue
Block a user