AlcapDAQ
1
|
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
#include "flash.h"
#include "CFASegment.h"
Go to the source code of this file.
Data Structures | |
struct | UpgradeParams |
Macros | |
#define | REVISION "2.4" |
Typedefs | |
typedef struct UpgradeParams | cvUpgradeParams |
Functions | |
static void | Usage () |
static int | ReadConfigurationROM (cvFlashAccess *Flash, CROM_MAP *crom) |
static int | ReadLicense (cvFlashAccess *Flash, uint8_t licenseData[LICENSE_DATA_SIZE]) |
static int | EraseLicense (cvFlashAccess *Flash) |
static void | PrintCROM2File (FILE *fp, const CROM_MAP *map) |
static int | KeyInfo (cvUpgradeParams *Config, cvFlashAccess *Flash) |
static int | GetFWRel (cvUpgradeParams *Config, cvFlashAccess *Flash) |
static int | License (cvUpgradeParams *Config, cvFlashAccess *Flash) |
int | WriteKey (cvUpgradeParams *Config, cvFlashAccess *Flash) |
int | validateModel (cvUpgradeParams *config, cvFlashAccess *flash, char **fwData, int *fwSize) |
int | cvUpgrade (cvUpgradeParams *Config, cvFlashAccess *Flash) |
int | main (int argc, char *argv[]) |
#define REVISION "2.4" |
Definition at line 75 of file cvupgrade.c.
Referenced by main().
typedef struct UpgradeParams cvUpgradeParams |
int cvUpgrade | ( | cvUpgradeParams * | Config, |
cvFlashAccess * | Flash | ||
) |
Definition at line 466 of file cvupgrade.c.
References UpgradeParams::BaseAddress, UpgradeParams::BdNum, c, CAENCOM_INVALID_FILE_HANDLE, CAENComm_CloseDevice(), CAENComm_OpenDevice(), CAENComm_Success, UpgradeParams::cfa, UpgradeParams::ConfFile, CvUpgrade_CAENCommError, CvUpgrade_FileAccessError, UpgradeParams::FirstPageBck, UpgradeParams::FirstPageStd, FlashAccess::Handle, i, UpgradeParams::image, UpgradeParams::Link, UpgradeParams::Models, UpgradeParams::noverify, FlashAccess::PageSize, printf(), ReadFlashPage(), UpgradeParams::Type, Usage, validateModel(), UpgradeParams::verifyonly, Wait_ms, WriteFlashPage(), and WriteKey().
Referenced by main().
|
static |
Definition at line 187 of file cvupgrade.c.
References AT45_PAGE_SIZE, LICENSE_FLASH_PAGE, and WriteFlashPage().
Referenced by License().
|
static |
Definition at line 267 of file cvupgrade.c.
References UpgradeParams::AMCFwm, UpgradeParams::BaseAddress, UpgradeParams::BdNum, CAENCOM_INVALID_FILE_HANDLE, CAENComm_CloseDevice(), CAENComm_OpenDevice(), CAENComm_Read16(), CAENComm_Read32(), CAENComm_Success, CvUpgrade_FileAccessError, FlashAccess::Handle, i, UpgradeParams::Link, UpgradeParams::Models, printf(), UpgradeParams::ROCFwm, and UpgradeParams::Type.
Referenced by main().
|
static |
Definition at line 215 of file cvupgrade.c.
References AT45_IDREG_LENGTH, UpgradeParams::BaseAddress, UpgradeParams::BdNum, CAENCOM_INVALID_FILE_HANDLE, CAENComm_CloseDevice(), CAENComm_OpenDevice(), CAENComm_Success, CROM_MAP::crom_serial, CvUpgrade_FileAccessError, UpgradeParams::filepath, FlashAccess::Handle, i, UpgradeParams::Link, UpgradeParams::modelName, PrintCROM2File(), printf(), ReadConfigurationROM(), ReadFlashSecurityReg(), sprintf(), and UpgradeParams::Type.
Referenced by main().
|
static |
Definition at line 334 of file cvupgrade.c.
References UpgradeParams::BaseAddress, UpgradeParams::BdNum, CAENCOM_INVALID_FILE_HANDLE, CAENComm_CloseDevice(), CAENComm_OpenDevice(), CAENComm_Success, CvUpgrade_FileAccessError, UpgradeParams::delete, EraseLicense(), FlashAccess::Handle, i, LICENSE_DATA_SIZE, UpgradeParams::Link, printf(), ReadLicense(), and UpgradeParams::Type.
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 623 of file cvupgrade.c.
References UpgradeParams::AMCFwm, UpgradeParams::BaseAddress, UpgradeParams::BdNum, CAENCOM_INVALID_FILE_HANDLE, CAENComm_PCI_OpticalLink, CAENComm_USB, UpgradeParams::cfa, UpgradeParams::ConfFile, cvUpgrade(), CvUpgrade_GenericError, UpgradeParams::delete, UpgradeParams::family, UpgradeParams::filepath, UpgradeParams::FirstPageBck, UpgradeParams::FirstPageStd, FlashAccess::FlashEnable, GetFWRel(), FlashAccess::Handle, UpgradeParams::image, UpgradeParams::key, key, KeyInfo(), License(), UpgradeParams::Link, UpgradeParams::modelName, UpgradeParams::Models, UpgradeParams::noverify, FlashAccess::PageSize, printf(), FlashAccess::RegSize, REVISION, UpgradeParams::ROCFwm, FlashAccess::RW_Flash, FlashAccess::Sel_Flash, sprintf(), UpgradeParams::Type, Usage, UpgradeParams::verifyonly, and WriteKey().
|
static |
Definition at line 198 of file cvupgrade.c.
References CROM_MAP::crom_board_id, CROM_MAP::crom_c_code, CROM_MAP::crom_chksum, CROM_MAP::crom_chksum_len, CROM_MAP::crom_const, CROM_MAP::crom_OUI, CROM_MAP::crom_r_code, CROM_MAP::crom_revision, CROM_MAP::crom_serial, CROM_MAP::crom_VCXO_type, and CROM_MAP::crom_version.
Referenced by KeyInfo().
|
static |
Definition at line 144 of file cvupgrade.c.
References AT45_PAGE_SIZE, CROM_MAP::crom_board_id, CROM_MAP::crom_c_code, CROM_MAP::crom_chksum, CROM_MAP::crom_chksum_len, CROM_MAP::crom_const, CROM_MAP::crom_OUI, CROM_MAP::crom_r_code, CROM_MAP::crom_revision, CROM_MAP::crom_serial, CROM_MAP::crom_VCXO_type, CROM_MAP::crom_version, ReadFlashPage(), and ROM_FLASH_PAGE.
Referenced by KeyInfo().
|
static |
Definition at line 171 of file cvupgrade.c.
References AT45_PAGE_SIZE, LICENSE_FLASH_PAGE, and ReadFlashPage().
Referenced by License().
|
static |
Definition at line 109 of file cvupgrade.c.
References printf().
int validateModel | ( | cvUpgradeParams * | config, |
cvFlashAccess * | flash, | ||
char ** | fwData, | ||
int * | fwSize | ||
) |
Definition at line 413 of file cvupgrade.c.
References CFASegmentType1_t::accessType, CFAModelType1_t::address, CAENComm_Read16(), CAENComm_Read32(), CFA_SEGMENT_TYPE_1, UpgradeParams::ConfFile, deleteSegment(), UpgradeParams::FirstPageBck, UpgradeParams::FirstPageStd, CFASegmentType1_t::flashBckAddress, CFASegmentType1_t::flashCsAddress, CFASegmentType1_t::flashCwAddress, FlashAccess::FlashEnable, CFASegmentType1_t::flashEnLevel, CFASegmentType1_t::flashPageSize, CFASegmentType1_t::flashStdAddress, CFASegmentType1_t::fwData, CFASegmentType1_t::fwSizeBytes, getSegmentType(), FlashAccess::Handle, i, last, CFAModelType1_t::modelId, CFASegmentType1_t::models, UpgradeParams::Models, newSegment(), CFAModelType1_t::numChecks, CFASegmentType1_t::numModels, FlashAccess::PageSize, CFAModelType1_t::registerChecks, FlashAccess::RegSize, FlashAccess::RW_Flash, FlashAccess::Sel_Flash, sprintf(), toType1, value, and CFAModelType1_t::value.
int WriteKey | ( | cvUpgradeParams * | Config, |
cvFlashAccess * | Flash | ||
) |
Definition at line 377 of file cvupgrade.c.
References UpgradeParams::BaseAddress, UpgradeParams::BdNum, CAENCOM_INVALID_FILE_HANDLE, CAENComm_CloseDevice(), CAENComm_OpenDevice(), CAENComm_Success, CvUpgrade_FileAccessError, FlashAccess::Handle, UpgradeParams::key, LICENSE_DATA_SIZE, LICENSE_FLASH_PAGE, UpgradeParams::Link, UpgradeParams::Models, printf(), UpgradeParams::Type, Wait_ms, and WriteFlashPage().
Referenced by cvUpgrade(), and main().