📄 download_configure.h
字号:
/*----------------------------------------------------------------------------* Copyright (c) 2005 by Hifn, Inc, Los Gatos, CA, U.S.A. All Rights Reserved. This software is furnished to licensee under a software license agreement and may be used and copied only in accordance with the terms and conditions of such license and with the inclusion of the above Copyright Notice. This software or any other copies thereof may not be provided or otherwise made available to any other person. No title to and ownership of the software is hereby transferred and licensee is subject to all confidentiality provisions set forth in the software license agreement. The information in this software is subject to change without notice. *----------------------------------------------------------------------------*//*----------------------------------------------------------------------------* * $Id: @(#) download_configure.h 1.18@(#) $ *----------------------------------------------------------------------------*//*----------------------------------------------------------------------------* * @file download_configure.h * @brief Contains the constants and type definitions used by download_configure * * Use download_configure --help for information on using the * download_configure example download code. * *----------------------------------------------------------------------------*/#ifndef DOWNLOAD_CONFIGURE_H#define DOWNLOAD_CONFIGURE_H/*------------------------------------* * Header Include Statements *------------------------------------*/#include "hftc_pub_common.h"#include "hftc_pub_types.h"#include "hftc_pub_download.h"#include "hftc_pub_service.h"/*------------------------------------* * External Constants and Types *------------------------------------*//* Max command line argument length in bytes.*/#define MAXOPTLEN 256/* This is the number of timeouts or resends that need to occur in a row on a single frame before the code prints messages. It is used in both the code download portion of the code and when reading status. It is also used for retransmits due to a timeout when using ft-api commands.*/#define NUM_RETRANSMITS 30/* The following macro is used to check for timeouts. The macro has side effects of changing status if the number of retransmits is too low, and of changing retries.*/#define RESEND_TIMEOUTS(status, retries) \ if (((status) == HFTC_TIMEOUT) && (++(retries) < NUM_RETRANSMITS)) \ { \ (status) = HFTC_RESEND; \ }/* This is the number of seconds before a the download_configure code will give up retrying on a single read_status, or a single exchange of a download frame.*/#define RETRANSMIT_RETRY_SECONDS 15/* This is how long we will wait in wait_esc for the eSC to be ready. The value is in seconds.*/#define WAIT_ESC_SECONDS 20/* This is the number of seconds before a the download_configure code will give up retrying on a single read_status when getting POST results and running the long sdram tests. It should be longer than RETRANSMIT_RETRY_SECONDS.*/#define RETRANSMIT_RETRY_SECONDS_LONG_POST 90/* The code buffer size that can be passed in must be a value between HFTC_MIN_CODE_IMAGE_BUF_BYTE_SIZE and HFTC_MAX_CODE_IMAGE_BUF_BYTE_SIZE inclusively. It also must be a power of 2.*/#define CODEBUFLEN HFTC_MAX_CODE_IMAGE_BUF_BYTE_SIZE/* The buffersize must be less than the maximum Ethernet frame size. It also must be greater than the size of the buffer passed into the generate code frame function (and other functions that generate Ethernet frames) plus HFTC_CODE_FRAME_OVERHEAD_BYTE_SIZE.*/#define FRAMELEN CODEBUFLEN + HFTC_CODE_FRAME_OVERHEAD_BYTE_SIZE/* This is a somewhat arbitrary PPCI address. This address is used by the download portion (download-api) of this application. In our case, we are running on a Linux host, and this is generally a PPCI address of 0x0002. By our conventions the host source addresses have the last two bits as '10'. However, we need this to be unique as compared to the address used for the ft-api portion of the code, so responses will be routed appropriately. If this has the same value as the ft-api value, then ft-api can pick up an old download-api response and mistake it for a response to one of the requests it sent. The lower bits cannot be '011' or '111' as the DPU will then forward responses back to the eSC, and then the eSC will send the response out the MII port. This means when the lower bits are '011' or '111' then the address will only work when downloading through the MII port. By having this address be unique, the problem of receiving old responses will not occur. This is used as a default value in the code download portion of this code. It can be overridden by command line options.*/#define SRC_PPCIADDR 0x0112/* This is the default destination PPCI address for the DPU. By default we are loading a DPU, which after a reset has a default address of 0. This is used as a default value in the code download portion of this code. It can be overridden by command line options. The value below should match the hardware PPCI address of the DPU after a soft reset.*/#define DEST_PPCIADDR_DPU 0x0000/* This is the default destination PPCI address for the eSC. If we are loading over the MII, we may (and on Topcat will) be loading the eSC first, and the default eSC address is 0x0001 after a reset. This is used as a default value in the code download portion of this code. It can be overridden by command line options. The value below should match the hardware PPCI address of the eSC after a soft reset.*/#define DEST_PPCIADDR_ESC 0x0001/* These are arbitrary default MAC addresses for the source and destination. Hifn values were used. These values are in network byte order. These values are used as default values in the code download portion of this code. They can be overridden by command line options.*/#define SRC_MACADDR {0x00, 0x80, 0x52, 0x00, 0xFF, 0xFF}#define DEST_MACADDR {0x00, 0x80, 0x52, 0x00, 0x00, 0x00}/* These are the defaults for some of the options with filenames when using the --root directory option. The value specified after the --root option gets prepended to the value below, thus a "--root .." means that the ESCUNIT file will be "../config/escunit" Note that for a topcat load the x400 will be changed to x300.*/#define X400_ESCUNIT "/config/x400_escunit" /* --unit-table */#define X400_CONFIGPARAMS "/config/x400_configparams" /* --config-params */#define X400_DFILE "/firmware/x400_dpu.cdl" /* --dpu-file */#define X400_PFILE "/firmware/x400_esc_post.cdl" /* --esc-post-file */#define X400_EFILE "/firmware/x400_esc.cdl" /* --esc-file */#define X300_ESCUNIT "/config/x300_escunit" /* --unit-table */#define X300_CONFIGPARAMS "/config/x300_configparams" /* --config-params */#define X300_DFILE "/firmware/x300_dpu.cdl" /* --dpu-file */#define X300_PFILE "/firmware/x300_esc_post.cdl" /* --esc-post-file */#define X300_EFILE "/firmware/x300_esc.cdl" /* --esc-file *//* This is the maximum length of the above default values. This value must be less than the MAXOPTLEN value, as it is subtracted out of the MAXOPTLEN value to fit the filename string into the download_param_t structure below.*/#define max5(A,B,C,D,E) \ (HFTC_MAX(HFTC_MAX(HFTC_MAX(HFTC_MAX((A),(B)),(C)),(D)),(E)))#define max10(A,B,C,D,E,F,G,H,I,J) \ (HFTC_MAX(max5((A),(B),(C),(D),(E)),max5((F),(G),(H),(I),(J))))#define MAXDEF max10(sizeof(X400_ESCUNIT), \ sizeof(X400_CONFIGPARAMS), \ sizeof(X400_DFILE), \ sizeof(X400_PFILE), \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -