@echo off
REM ***************************************************************************
REM TX Series COMMUNICATIONS PROCESSOR BOOT FILE
REM
REM Execute this file to perform the following:
REM - Reset the TX board
REM - Synchronize the on-board flash image with the installed software
REM - Download TDM configuration
REM - Download all TX-based tasks
REM - Configure SS7
REM ***************************************************************************
if "%DIALOGIC_ROOT%"=="" set DIALOGIC_ROOT=\Program Files\Dialogic
if "%TX_ROOT%"=="" set TX_ROOT=%DIALOGIC_ROOT%\tx
REM ***************************************************************************
REM Choose MTP or SIGTRAN for the transport layers
REM
if "%TXTRANSPORT%"=="" set TXTRANSPORT=mtp
REM if "%TXTRANSPORT%"=="" set TXTRANSPORT=sigtran
REM ***************************************************************************
REM Choose redundant or standalone mode
REM
if "%TXMODE%"=="" set TXMODE=standalone
REM if "%TXMODE%"=="" set TXMODE=redundant
REM ***************************************************************************
REM Choose ansi or itu for configuration files
REM
if "%TXCONFIG%"=="" set TXCONFIG=%TX_ROOT%\config\%TXMODE%\ansi
REM if "%TXCONFIG%"=="" set TXCONFIG=%TX_ROOT%\config\%TXMODE%\itu
REM ***************************************************************************
REM Define all other script parameters
REM
if "%TXUTIL%"=="" set TXUTIL=%TX_ROOT%\bin
if "%TXCP%"=="" set TXCP=%TX_ROOT%\cp
REM ***************************************************************************
REM Process arguments - Get the board number
REM
set BRD=1
if not "%1"=="" set BRD=%1
REM ***************************************************************************
REM Clear driver statistics
REM
"%TXUTIL%\txstats" -b %BRD% -z -q
REM ***************************************************************************
REM Get the model number (TX board type)
REM
"%TXUTIL%\cpmodel" -b %BRD%
if %errorlevel% == 4000 goto set4000
if %errorlevel% == 5000 goto set5000
if %errorlevel% == 5020 goto set5000
if %errorlevel% == 5500 goto set5000
echo ERROR! TX board number %BRD% not available.
goto end
REM ***************************************************************************
REM Setup for TX 4000 Family
REM
:set4000
set TASKTYPE=elf
set TXKERNEL=cpk4000.fls
goto resetboard
REM ***************************************************************************
REM Setup for TX 5000 Family
REM
:set5000
set TASKTYPE=elf
set TXKERNEL=cpk5000.elf
REM ***************************************************************************
REM Perform board type-specific boot for TX 5000 Family
REM
:resetboard
REM Reset TX board (and verify TX flash image in sync with installed software)
"%TXUTIL%\txflash" -s "%TXCP%\%TXKERNEL%" -b %BRD%
if %errorlevel% == 1 goto failedreset
REM load TDM or IP configuration
if "%TXTRANSPORT%"=="sigtran" goto loadipcfg
"%TXUTIL%\txconfig" -b %BRD% -f "%TXCONFIG%\txcfg%BRD%.txt"
goto loadcommon
:loadipcfg
"%TXUTIL%\txconfig" -b %BRD% -f "%TXCONFIG%\ipcfg%BRD%.txt"
REM ***************************************************************************
REM Load all TX-based tasks that are common to all board types
REM
:loadcommon
REM To use txdbg,
REM you should uncomment the following line to load the debug task
REM "%TXUTIL%\cplot" -c %BRD% -f "%TXCP%\debug.%TASKTYPE%" -n debug -p 11 -a
REM Load TXMON
REM
REM ****** IMPORTANT NOTE: *******
REM For convenience we are loading TXMON only in redundant mode. This is
REM convenient because MTP will detect the lack of TXMON and will auto-
REM matically enter standalone mode and attempt to bring up links, without
REM application intervention. NOTE HOWEVER, TXMON can be used as a health
REM monitor for a single board application in standalone mode. In this case
REM the MTP will remain in a Starting state until an application (eg. RMG),
REM using the HMI API, specifically sets the mode to Standalone. In other
REM words links will not automatically try to align if TXMON is loaded.
REM
if "%TXMODE%"=="standalone" goto notxmon
"%TXUTIL%\cplot" -c %BRD% -f "%TXCP%\txmon.%TASKTYPE%" -n txmon -p 19 -a
:notxmon
REM Load MTP or SIGTRAN task
REM
if "%TXTRANSPORT%"=="sigtran" goto loadsigtran
"%TXUTIL%\cplot" -c %BRD% -f "%TXCP%\mtp.%TASKTYPE%" -n mtp -p 20 -a -s 40960
goto endload
:loadsigtran
"%TXUTIL%\cplot" -c %BRD% -f "%TXCP%\sigtran.%TASKTYPE%" -n sigtran -p 20 -a -s 40960
:endload
REM Enable the following to use JNTT
REM
REM "%TXUTIL%\cplot" -c %BRD% -f "%TXCP%\jntt.%TASKTYPE%" -n jntt -p 15 -a
REM Enable the following downloads for SS7 layers you do use
REM
REM "%TXUTIL%\cplot" -c %BRD% -f "%TXCP%\sccp.%TASKTYPE%" -n sccp -p 21 -a
REM "%TXUTIL%\cplot" -c %BRD% -f "%TXCP%\isup.%TASKTYPE%" -n isup -p 21 -a -s 40960
REM "%TXUTIL%\cplot" -c %BRD% -f "%TXCP%\tup.%TASKTYPE%" -n tup -p 22 -a -s 40960
REM "%TXUTIL%\cplot" -c %BRD% -f "%TXCP%\tcap.%TASKTYPE%" -n tcap -p 23 -a
REM ISUP only: Enable the download of the ISUP database required for your configuration.
REM
REM "%TXUTIL%\cplot" -c %BRD% -f "%TXCP%\itublue.%TASKTYPE%" -n itublue -p 15 -a
REM "%TXUTIL%\cplot" -c %BRD% -f "%TXCP%\ituwhite.%TASKTYPE%" -n ituwhite -p 15 -a
REM "%TXUTIL%\cplot" -c %BRD% -f "%TXCP%\q767.%TASKTYPE%" -n q767 -p 15 -a
REM "%TXUTIL%\cplot" -c %BRD% -f "%TXCP%\ansi88.%TASKTYPE%" -n ansi88 -p 15 -a
REM "%TXUTIL%\cplot" -c %BRD% -f "%TXCP%\ansi92.%TASKTYPE%" -n ansi92 -p 15 -a
REM "%TXUTIL%\cplot" -c %BRD% -f "%TXCP%\ansi95.%TASKTYPE%" -n ansi95 -p 15 -a
REM "%TXUTIL%\cplot" -c %BRD% -f "%TXCP%\itu97.%TASKTYPE%" -n itu97 -p 15 -a
REM "%TXUTIL%\cplot" -c %BRD% -f "%TXCP%\etsiv2.%TASKTYPE%" -n etsiv2 -p 15 -a
REM "%TXUTIL%\cplot" -c %BRD% -f "%TXCP%\etsiv3.%TASKTYPE%" -n etsiv3 -p 15 -a
REM "%TXUTIL%\cplot" -c %BRD% -f "%TXCP%\ansibicc.%TASKTYPE%" -n ansibicc -p 15 –a
REM "%TXUTIL%\cplot" -c %BRD% -f "%TXCP%\itubicc.%TASKTYPE%" -n itubicc -p 15 -a
REM ***************************************************************************
REM Configure SS7 MTP2, MTP3, SCTP, M3UA, ISUP, TUP, TCAP & SCCP
REM (enable these commands for any SS7 layers you do use)
REM
REM NOTE: MTP level 2 configurability is now available.
REM However, level 2 configuration is not strictly necessary.
REM The defaults will work for most installations.
REM
if "%TXTRANSPORT%"=="sigtran" goto cfgsigtran
"%TXUTIL%\mtp2cfg" -b %BRD% -f "%TXCONFIG%\MTP3cp%BRD%.cfg"
"%TXUTIL%\mtp3cfg" -b %BRD% -f "%TXCONFIG%\MTP3cp%BRD%.cfg"
goto endcfg
:cfgsigtran
"%TXUTIL%\sctpcfg" -b %BRD% -f "%TXCONFIG%\SCTPcp%BRD%.cfg"
"%TXUTIL%\m3uacfg" -b %BRD% -f "%TXCONFIG%\M3UAcp%BRD%.cfg"
:endcfg
if "%TXMODE%"=="standalone" goto stdalncfg
REM
REM Load redundant configuration files - note that both boards in redundant
REM pair use the same configuration file
REM
REM "%TXUTIL%\sccpcfg" -b %BRD% -f "%TXCONFIG%\SCCP.cfg"
REM "%TXUTIL%\isupcfg" -b %BRD% -f "%TXCONFIG%\ISUP.cfg"
REM "%TXUTIL%\tupcfg" -b %BRD% -f "%TXCONFIG%\TUP.cfg"
REM "%TXUTIL%\tcapcfg" -b %BRD% -f "%TXCONFIG%\TCAP.cfg"
goto end
:stdalncfg
REM
REM Load standalone configuration files - note that each board in a standalone
REM configuration gets a configuration file unique to that board
REM
REM "%TXUTIL%\sccpcfg" -b %BRD% -f "%TXCONFIG%\SCCPcp%BRD%.cfg"
REM "%TXUTIL%\isupcfg" -b %BRD% -f "%TXCONFIG%\ISUPcp%BRD%.cfg"
REM "%TXUTIL%\tupcfg" -b %BRD% -f "%TXCONFIG%\TUPcp%BRD%.cfg"
REM "%TXUTIL%\tcapcfg" -b %BRD% -f "%TXCONFIG%\TCAPcp%BRD%.cfg"
goto end
REM ***************************************************************************
REM Report reset error
REM
:failedreset
echo ERROR! Unable to reset TX board number %BRD%.
goto end
REM ***************************************************************************
REM Exit load script
:end
set TXMODE=
set TXUTIL=
set TXCP=
set TXCONFIG=
set BRD=
set TASKTYPE=
set TXKERNEL=
set TXTRANSPORT=