⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 download_configure.c

📁 hifn ipsec固件下载工具
💻 C
📖 第 1 页 / 共 5 页
字号:
"    CDL files contain firmware that is to be downloaded.\n""\n""    -f, --dpu-file  FILENAME\n""        CDL file to download to DPU.  Note that when downloading the\n""        DPU, DPU POST results are always checked.  Also the time of day\n""        will be set by default except when using the --post-monitor flag.\n\n""    -p, --esc-post-file  FILENAME\n""        CDL file with POST (power-on self test) code to download to eSC.\n""        POST results are always checked after downloading eSC POST code.\n\n""    -e, --esc-file  FILENAME\n""        CDL file with code to download to eSC.  The eSC is configured if\n""        it was loaded unless --no-config-file is specified.  To configure\n""        the eSC, both the escunit and configparams file are required.\n\n""    -w, --esc-sdram-wa  FILENAME\n""        CDL file with eSC SDRAM bank-access workaround.  This is for\n""        the 43x0 and 83x0 only.\n\n""\n""  Configuration file options:\n""\n""    -u, --unit-table  FILENAME\n""        FILENAME is a text file with ESC unit table.  See config/escunit\n""        for an example.\n""\n""    -c, --config-file  FILENAME\n""        FILENAME is a text file with system configuration information.  See\n""        config/configparams for an example.\n""\n""  DDL file options:\n""\n""    DDL files may be used to download more configuration commands.  There\n""    can be up to %d DDL files.  They are loaded in the order listed on the\n""    command line, and they are issued after all other configuration for the\n""    DPU and eSC.\n\n""    --dpu-ddl FILENAME\n""        File name with extra configuration information for the DPU.\n\n""    --esc-ddl FILENAME\n""        File name with extra configuration information for the eSC.\n\n""\n""  Options that affect how data is downloaded:\n""\n""    -i, --interface INTERFACE\n""        Interface to use, for example eth1.  Uses PPCI_INTERFACE if that\n""        was set otherwise the default can be found in hftc_pub_base.h.\n\n""    --mii\n""        Download is through an MII port.  Note that loads through an MII\n""        may require '--buffer-size 128' on a 43x0 or 83x0\n""        to work around hardware issues.\n\n""    --mii133\n""        Download through a 133 MHz MII port.  Sets the --mii option.\n""        This is needed only for 43x0 83x0 mii ports.\n""        See also notes for --mii option.\n\n""\n------------------------------------------------------------------------\n""\n""  Less frequently used options:\n\n""    The rest of the options are generally useful only for Hifn testing\n""    testing and development.\n\n""  Addresses and ports used in download:\n""\n""    -d, --destination-ppci-dpu, --destination-ppci  ADDRESS\n""        Destination PPCI address used by the code download portion\n""        of the code to address the DPU.  This address will be used\n""        until the esc/dpu configuration code runs and loads the escunit\n""        table, or a soft boot reset occurs.   The --destination-ppci\n""        form is deprecated.\n""        Default: %d\n\n""    --destination-ppci-esc  ADDRESS\n""        Destination PPCI address used by the code download portion\n""        of the code to address the eSC.  This address will be used\n""        until the esc/dpu configuration code runs and downloads a escunit\n""        table, or a soft boot reset occurs.\n""        Default: %d\n\n""    -s, --source-ppci  ADDRESS\n""        Source PPCI address used by download portion of code.\n""        This must not match the default source address used by\n""        the other parts of this code, or other code that is running.\n""        The other portion of this code uses the value found for the\n""        local address in the unit table file. (see --unit-table)\n""        Default: %d (0x%04x)\n\n""    -m, --destination-mac  MAC_ADDRESS\n""        Destination MAC Address used by download portion of code.\n""        Default: %02x:%02x:%02x:%02x:%02x:%02x\n\n""    --source-mac  MAC_ADDRESS\n""        Source MAC Address used by download portion of code.\n""        Default: %02x:%02x:%02x:%02x:%02x:%02x\n\n""  Other options:\n""\n""    --force-reset\n""        Force a soft boot reset on download of code.\n""        Default is to reset if ROM/DIAG code is not running.\n""\n""    --no-reset\n""        No soft boot reset during download of code if ROM/DIAG code\n""        is not running.\n""\n""    --force-download\n""        Force a download even if ROM/DIAG code not running\n""\n""    --buffer-size NUMBER\n""        Buffer size used for download.  Values = 128->1024; powers of 2\n""        only.  Default = %d.\n\n""\n""    --no-verify\n""        Skip download verification test.  \n""\n""    --no-set-tod\n""        Skip download set time of day after a dpu load.  \n""\n""    --no-run\n""        Don't issue a 'run' command after loading each piece of firmware.\n""\n""    --no-config-file\n""        Skip configuring the eSC/DPU via the configparams file.  Default is \n""        to configure the eSC (and DPU) from the configparams file if eSC \n""        is loaded.  \n""\n""    --no-gmac-enable\n""        Skip enabling the GMACs.  Default is to enable the GMACs.\n""\n""    --bypass-policy\n""        Load a bypass policy.  This option is available only for IKE\n""        customers; otherwise this option does nothing.\n\n""\n""    --long-sdram-test\n""        Run the long SDRAM POST test.  On a 44x0/84x0 this is applicable\n""        only to the DPU firmware.\n\n""\n""    --post-monitor-mode\n""        Run the DPU and/or eSC POST with POST monitor option set.  This\n""        causes the DPU and/or eSC POST firmware to run in POST monitor mode,\n""        rather than normal mode.  ESC runtime firmware and config files\n""        will be ignored when using this flag.\n""        Using this flag sets the --no-set-tod flag.\n\n""\n""    --promiscuous\n""        Use promiscuous mode rather than default of MAC filtering based\n""        on addresses found in the configparams file.\n\n""\n""    --espudp-ports 0xssssdddd\n""        This sets the ESPUDP ports used for inbound packet processing.  It\n""        is a 32-bit value.  The upper 16 bits are the source port number,\n""        and the lower 16 bits are the destination port number.  When this\n""        option is provided, the \"enable ESPUDP\" processing flag will be\n""        set in the PP options flags word (PP option word 0, bit 16) and\n""        the ESPUDP ports PP option (PP option word 8) will be written with\n""        this value.\n\n""\n""Examples:\n""\n""    ./bin/download_configure -f firmware/dpu.cdl --post-monitor-mode\n""        Download DPU only in POST monitor mode.\n""\n""    ./bin/download_configure -p firmware/esc_post.cdl --post-monitor-mode\n""        Download eSC POST only in POST monitor mode.\n""\n""    ./bin/download_configure --root . -e firmware/noike.cdl -u config/esccfg2\n""        Run from SDK root and override default ESC CDL and config file.\n""\n""    ./bin/download_configure --dpu-file fw/dpu.cdl --esc-file fw/esc.cdl \\\n""                         --esc-post-file fw/esc_post.cdl --interface eth1 \\\n""                         --unit-table cfg/escunit \\\n""                         --config-file cfg/configparams\n""        Specify interface and all CDL files explicitly.\n""\n""    ./bin/download_configure --root .\n""        Run from SDK root and use defaults for everything.\n""\n",    NUM_DDLS, param.destPPCIAddrDpu, param.destPPCIAddrEsc,    param.srcPPCIAddr, param.srcPPCIAddr,    param.destMACAddr[0], param.destMACAddr[1], param.destMACAddr[2],    param.destMACAddr[3], param.destMACAddr[4], param.destMACAddr[5],    param.srcMACAddr[0], param.srcMACAddr[1], param.srcMACAddr[2],    param.srcMACAddr[3], param.srcMACAddr[4], param.srcMACAddr[5],    param.codeBufferLen);} /* end printUsage *//*----------------------------------------------------------------------------* * scanMacAddr *----------------------------------------------------------------------------* * @ingroup CD_API_UTIL * * Scans for a MAC address * * @param string_p        RO: Pointer to string to scan for mac address * @param mac_p           WO: Pointer to array of char to store mac address * * @par Externals: *    None. * * @return *    HFTC_STATUS_OK *    mac_p will have scanned mac address if successful. * * @par Errors: *    HFTC_INVALID_OPERATION    parsing problem. * * @par Locks: *    None. * * @par Assumptions: *    MAC addresses are 6 bytes long. *    Assumes string_p is not NULL. * *----------------------------------------------------------------------------*/staticHFTC_Status_t scanMacAddr(char *string_p, HFTC_Buffer_t *mac_p){   int                  numVals;   int                  i;   uint32_t             mac[6];   HFTC_Status_t        status = HFTC_STATUS_OK;   numVals = sscanf(string_p, "%x:%x:%x:%x:%x:%x",                    (int *) &mac[0],                    (int *) &mac[1],                    (int *) &mac[2],                    (int *) &mac[3],                    (int *) &mac[4],                    (int *) &mac[5]);   if (numVals != 6)   {      status = HFTC_INVALID_OPERATION;   }   else   {      /* MAC addresses are 6 bytes long. */      for (i = 0; i < 6; i++)      {         /* Check that the value fits in a byte.  If not then it's an error. */         if (mac[i] <= 255)         {            mac_p[i] = mac[i];         }         else         {            status = HFTC_INVALID_OPERATION;            break;         }      }   }   return status;} /* end scanMacAddr *//*----------------------------------------------------------------------------* * parseCommandLineOptions *----------------------------------------------------------------------------* * @ingroup CD_API_UTIL * @brief Parse the program command line. * * Parses the program command line, and sets the command line variables * according to the program command line.  Prints usage on any problem. * Fills in default values for any values not set by user. * * @param argc        RO: The main argc value * @param argv        RO: The main argv value * @param param_p     WO: Parameters pointer * * @par Externals: *    opterr          RO: Error message from getopt *    optind          RO: Index into argv from getopt_long *    errno           RO: Linux errno * * @return *    HFTC_STATUS_OK    Parsing OK, options are set * * @par Errors: *    HFTC_NOT_INITIALIZED      User requested help *    HFTC_INVALID_OPERATION    Parsing problem * * @par Locks: *    None. * * @par Assumptions: *    Parameter strings to be filled in are at most MAXOPTLEN characters long. * *----------------------------------------------------------------------------*/staticHFTC_Status_t parseCommandLineOptions(int argc, char * const argv[],                                      download_param_t *param_p){   HFTC_Status_t status = HFTC_STATUS_OK;   int            c;   int            option_index = 0;   HFTC_Boolean_t helpPrinted  = HFTC_FALSE;   char          *end_p;   uint32_t      ppciAddr;   /*      These are used as the char values returned by getopts when no short      name exists.   */#define SOURCE_MAC              0x80#define BUFFER_SIZE             0x81#define FORCE_RESET             0x82#define NO_RESET                0x83#define FORCE_DOWNLOAD          0x84#define NO_VERIFY               0x85#define NO_SETTOD               0x86#define NO_RUN                  0x87#define NO_CONFIG_PARAMS           0x88#define NO_GMAC_ENABLE          0x89#define MII_DOWNLOAD            0x8A#define MII133                  0x8B#define BYPASS_POLICY           0x8C#define PROMISCUOUS             0x8D#define LONG_SDRAM_TEST         0x8E#define POST_MONITOR_MODE       0x8F#define DPU_DDL                 0x90#define ESC_DDL                 0x91#define ESPUDP_PORTS            0x92#define DEST_PPCI_ESC           0x93   static struct option long_options[] = {         /*         * char *name         * int has_arg: 0 [no], 1 [reqd], 2 [opt]         * int *flag: NULL [return val],         *     else return 0 and set *flag to val if option is found.         * int val: value to return, or to load into the variable pointed         *     to by flag.         */         {"root",                 1, 0, 'r'},         {"dpu-file",             1, 0, 'f'},         {"esc-sdram-wa",         1, 0, 'w'},         {"esc-post-file",        1, 0, 'p'},         {"esc-file",             1, 0, 'e'},         {"interface",            1, 0, 'i'},         {"unit-table",           1, 0, 'u'},         {"config-file",          1, 0, 'c'},         {"destination-ppci",     1, 0, 'd'},         {"destination-ppci-dpu", 1, 0, 'd'},         {"destination-ppci-esc", 1, 0, DEST_PPCI_ESC},         {"source-ppci",          1, 0, 's'},         {"destination-mac",      1, 0, 'm'},         {"source-mac",           1, 0, SOURCE_MAC},         {"buffer-size",          1, 0, BUFFER_SIZE},         {"force-reset",          0, 0, FORCE_RESET},         {"no-reset",             0, 0, NO_RESET},         {"force-download",       0, 0, FORCE_DOWNLOAD},         {"no-verify",            0, 0, NO_VERIFY},         {"no-set-tod",           0, 0, NO_SETTOD},         {"no-run",               0, 0, NO_RUN},         {"no-config-file",       0, 0, NO_CONFIG_PARAMS},         {"no-gmac-enable",       0, 0, NO_GMAC_ENABLE},         {"mii",                  0, 0, MII_DOWNLOAD},         {"mii133",               0, 0, MII133},         {"bypass-policy",        0, 0, BYPASS_POLICY},         {"promiscuous",          0, 0, PROMISCUOUS},         {"long-sdram-test",      0, 0, LONG_SDRAM_TEST},         {"post-monitor-mode",    0, 0, POST_MONITOR_MODE},         {"dpu-ddl",              1, 0, DPU_DDL},         {"esc-ddl",              1, 0, ESC_DDL},         {"espudp-ports",         1, 0, ESPUDP_PORTS},         {"help",                 0, 0, 'h'},         {0, 0, 0, 0} /* required last element */   };   opterr = 1; /* error messages from getopt */   /*      Setup default values.   */   initParam(param_p);   /*      Look at command line options.   */   while (HFTC_TRUE)   {      option_index = 0;      c = getopt_long(argc, argv, "r:f:w:p:e:i:u:c:d:s:m:h",                      long_options, &option_index);      if (c == -1)      {         break;      }      switch (c)      {      case 'h':         if (helpPrinted == HFTC_FALSE)         {            printUsage();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -