Added SRIO boot example, added binary support for writers
authorHao Zhang <hzhang@ti.com>
Fri, 3 Jun 2011 21:00:07 +0000 (17:00 -0400)
committerHao Zhang <hzhang@ti.com>
Fri, 3 Jun 2011 21:00:07 +0000 (17:00 -0400)
36 files changed:
boot_loader/examples/i2c/emac/docs/README.txt
boot_loader/examples/i2c/nand/docs/README.txt
boot_loader/examples/i2c/nor/docs/README.txt
boot_loader/examples/srio/docs/README.pdf
boot_loader/examples/srio/docs/readme.doc [new file with mode: 0644]
boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/.ccsproject [new file with mode: 0644]
boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/.cproject [new file with mode: 0644]
boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/.project [new file with mode: 0644]
boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/bin/srioboot_ddrinit.rmd [new file with mode: 0644]
boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/bin/srioboot_ddrinit_elf2HBin.bat [new file with mode: 0644]
boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/macros.ini [new file with mode: 0644]
boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/srioboot_helloworld.cmd [new file with mode: 0644]
boot_loader/examples/srio/srioboot_ddrinit/src/srioboot_ddrinit.c [new file with mode: 0644]
boot_loader/examples/srio/srioboot_example/evmc6678l/.cproject
boot_loader/examples/srio/srioboot_example/src/srioBootExample.c
boot_loader/examples/srio/srioboot_helloworld/evmc6678l/.cproject
boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/Bttbl2Hfile.exe [deleted file]
boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/helloworld_elf2HBin.bat [moved from boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/elf2HBin.bat with 65% similarity]
boot_loader/examples/srio/srioboot_helloworld/evmc6678l/srioboot_helloworld.cmd
boot_loader/examples/srio/srioboot_helloworld/src/srioboot_helloworld.c
bttbl2hfile/Bttbl2Hfile.c [new file with mode: 0644]
bttbl2hfile/Bttbl2Hfile.exe [new file with mode: 0644]
bttbl2hfile/README.txt [new file with mode: 0644]
hfile2array/README.txt [new file with mode: 0644]
hfile2array/hfile2array.c [new file with mode: 0644]
hfile2array/hfile2array.exe [moved from boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/hfile2array.exe with 100% similarity]
writer/eeprom/evmc6678l/bin/eepromwriter_input.txt
writer/eeprom/src/eepromwriter.c
writer/nand/docs/README.txt
writer/nand/evmc6670l/bin/nand_writer_input.txt
writer/nand/evmc6678l/bin/nand_writer_input.txt
writer/nand/src/nandwriter.c
writer/nor/docs/README.txt
writer/nor/evmc6670l/bin/nor_writer_input.txt
writer/nor/evmc6678l/bin/nor_writer_input.txt
writer/nor/src/norwriter.c

index 0c0f0d0bd830c3fa7d477338ada54e08d6d1c49e..dda194dd4c201cd470126835b0811cb3cfaecce6 100644 (file)
@@ -51,3 +51,4 @@ Steps to boot i2cemacboot from EMAC:
 6. Be sure the EVM and the PC are connected in the same subnet of a local network, after POR, IBL will download the
    boot image from TFTP server and boot from it. 
 
+Please refer to User's Guide (http://processors.wiki.ti.com/index.php/BIOS_MCSDK_2.0_User_Guide) for more details.
index 049095de716b5c42b6a20cbf7ccc072a7ffd909e..6930c195485d909cdd0ea35ec3fadea4ef837a27 100644 (file)
@@ -39,16 +39,13 @@ Steps to program i2cnandboot to NAND:
    b. Re-program the boot configuration table, refer to tools\boot_loader\ibl\doc\README.txt on how to program 
       the boot configuration table to EEPROM. 
     
-3. Copy tools\boot_loader\examples\i2c\nand\evmc66xxl\bin\i2cnandboot_evm66xxl.out to tools\bin2ccs and rename
-   the file to app.out.
+3. Copy tools\boot_loader\examples\i2c\nand\evmc66xxl\bin\i2cnandboot_evm66xxl.out to tools\writer\nand\evmc66xxl\bin, 
+   rename it to app.bin and refer to tools\writer\nand\docs\README.txt on how to program
+   the app.bin to NAND flash.
 
-4. Double click bin2ccs.bat, which will convert app.out to a CCS format data file app.dat.
-
-5. Copy app.dat to tools\writer\nand\evmc66xxl\bin and refer to tools\writer\nand\docs\README.txt on how to program
-   the app.dat to NAND flash.
-
-6. Once the programming is completed successfully, set the boot dip switches to I2C master mode, 
+4. Once the programming is completed successfully, set the boot dip switches to I2C master mode, 
    bus address 81 (0x51) and boot parameter index to be 2.
 
-7. After POR, IBL will boot the hello world image from NAND. 
+5. After POR, IBL will boot the hello world image from NAND. 
 
+Please refer to User's Guide (http://processors.wiki.ti.com/index.php/BIOS_MCSDK_2.0_User_Guide) for more details.
index 17181367691f708ee66ea1af087b9843f2d350f6..dd4d846f55b6b8cfbb7c49bcbd33248dc172cc8c 100644 (file)
@@ -31,15 +31,13 @@ Steps to program i2cnorboot to NOR:
    boot configuration table are not programmed, refer to tools\boot_loader\ibl\doc\README.txt on how to program 
    the IBL and boot configuration table to EEPROM. 
 
-2. Copy tools\boot_loader\examples\i2c\nor\evmc66xxl\bin\i2cnorboot_evm66xxl.out to tools\bin2ccs and rename
-   the file to app.out.
+2. Copy tools\boot_loader\examples\i2c\nor\evmc66xxl\bin\i2cnorboot_evm66xxl.out to tools\writer\nor\evmc66xxl\bin,
+   rename it to app.bin, and refer to tools\writer\nor\docs\README.txt on how to program
+   the app.bin to NOR flash.
 
-3. Double click bin2ccs.bat, which will convert app.out to a CCS format data file app.dat.
-
-4. Copy app.dat to tools\writer\nor\evmc66xxl\bin and refer to tools\writer\nor\docs\README.txt on how to program
-   the app.dat to NOR flash.
-
-5. Once the programming is completed successfully, set the boot dip switches to I2C master mode, 
+3. Once the programming is completed successfully, set the boot dip switches to I2C master mode, 
    bus address 81 (0x51) and boot parameter index to be 0.
 
-6. After POR, IBL will boot the hello world image from NOR. 
+4. After POR, IBL will boot the hello world image from NOR. 
+
+Please refer to User's Guide (http://processors.wiki.ti.com/index.php/BIOS_MCSDK_2.0_User_Guide) for more details.
index 194fe2db13dcd66b89907018f70258a6b8b67dfc..2078e46dd9cf233f275391ee974a0df4d334c6a3 100644 (file)
Binary files a/boot_loader/examples/srio/docs/README.pdf and b/boot_loader/examples/srio/docs/README.pdf differ
diff --git a/boot_loader/examples/srio/docs/readme.doc b/boot_loader/examples/srio/docs/readme.doc
new file mode 100644 (file)
index 0000000..685d682
Binary files /dev/null and b/boot_loader/examples/srio/docs/readme.doc differ
diff --git a/boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/.ccsproject b/boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/.ccsproject
new file mode 100644 (file)
index 0000000..79d3116
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?ccsproject version="1.0"?>
+
+<projectOptions>
+<deviceVariant value="com.ti.ccstudio.deviceModel.C6000.CustomC6000Device"/>
+<deviceEndianness value="little"/>
+<codegenToolVersion value="7.2.0"/>
+<isElfFormat value="true"/>
+<rts value="rts6600_elf.lib"/>
+</projectOptions>
diff --git a/boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/.cproject b/boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/.cproject
new file mode 100644 (file)
index 0000000..d765b5f
--- /dev/null
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+       <storageModule configRelations="2" moduleId="org.eclipse.cdt.core.settings">
+               <cconfiguration id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1869204513">
+                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1869204513" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+                               <externalSettings/>
+                               <extensions>
+                                       <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>
+                                       <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.rtsc.xdctools.parsers.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                               </extensions>
+                       </storageModule>
+                       <storageModule moduleId="org.eclipse.cdt.core.pathentry"/>
+                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+                               <configuration artifactExtension="out" artifactName="../bin/srioboot_ddrinit_evm6678l" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" errorParsers="org.eclipse.rtsc.xdctools.parsers.ErrorParser;com.ti.ccstudio.errorparser.LinkErrorParser;com.ti.ccstudio.errorparser.CoffErrorParser;com.ti.ccstudio.errorparser.AsmErrorParser" id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1869204513" name="Debug" parent="com.ti.ccstudio.buildDefinitions.C6000.Debug">
+                                       <folderInfo id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1869204513." name="/" resourcePath="">
+                                               <toolChain id="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.DebugToolchain.1437783928" name="TI Code Generation Tools" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.linkerDebug.1651564508">
+                                                       <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.944250360" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
+                                                               <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=com.ti.ccstudio.deviceModel.C6000.GenericC66xxDevice"/>
+                                                               <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
+                                                               <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
+                                                               <listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.0.1"/>
+                                                               <listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
+                                                               <listOptionValue builtIn="false" value="XDC_VERSION=3.20.08.88"/>
+                                                               <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.biosmcsdk.pdk.C6678L:1.0.0.9;"/>
+                                                               <listOptionValue builtIn="false" value="OUTPUT_TYPE=rtscApplication:executable"/>
+                                                       </option>
+                                                       <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1861349532" name="Code Generation tools version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="7.2.0" valueType="string"/>
+                                                       <targetPlatform id="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.targetPlatformDebug.391813781" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.targetPlatformDebug"/>
+                                                       <builder buildPath="${workspace_loc:/srioboot_ddrinit_evmc6678l/Debug}" id="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.builderDebug.1522158538" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.builderDebug"/>
+                                                       <tool id="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.compilerDebug.882037436" name="C6000 Compiler" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.compilerDebug">
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.DIAG_WARNING.1643228293" name="Treat diagnostic &lt;id&gt; as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.DIAG_WARNING" valueType="stringList">
+                                                                       <listOptionValue builtIn="false" value="225"/>
+                                                               </option>
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.SILICON_VERSION.1162385299" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.SILICON_VERSION" value="6600" valueType="string"/>
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.INCLUDE_PATH.1360329378" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.INCLUDE_PATH" valueType="includePath">
+                                                                       <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/include&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6678_INSTALL_DIR}/packages/ti/platform&quot;"/>
+                                                               </option>
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.ABI.1539422311" name="Application binary interface (coffabi, eabi) (--abi)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.ABI.eabi" valueType="enumerated"/>
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.DEFINE.1729702344" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.DEFINE" valueType="definedSymbols">
+                                                                       <listOptionValue builtIn="false" value="_EVMC6678L_"/>
+                                                               </option>
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__C_SRCS.1023912707" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__C_SRCS"/>
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__CPP_SRCS.979818748" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__CPP_SRCS"/>
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__ASM_SRCS.416705288" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__ASM_SRCS"/>
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__ASM2_SRCS.616636339" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__ASM2_SRCS"/>
+                                                       </tool>
+                                                       <tool id="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.linkerDebug.1651564508" name="C6000 Linker" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.linkerDebug">
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.OUTPUT_FILE.1931592324" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.OUTPUT_FILE" value="&quot;../bin/srioboot_ddrinit_evm6678l.out&quot;" valueType="string"/>
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.MAP_FILE.612136299" name="Input and output sections listed into &lt;file&gt; (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.MAP_FILE" value="&quot;../bin/srioboot_ddrinit_evm6678l.map&quot;" valueType="string"/>
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.LIBRARY.1501448535" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.LIBRARY" valueType="libs">
+                                                                       <listOptionValue builtIn="false" value="&quot;ti.platform.evm6678l.ae66&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;libc.a&quot;"/>
+                                                               </option>
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.SEARCH_PATH.1252449937" name="Add &lt;dir&gt; to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.SEARCH_PATH" valueType="stringList">
+                                                                       <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/lib&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/include&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6678_INSTALL_DIR}/packages/ti/platform/evmc6678l/platform_lib/lib/debug&quot;"/>
+                                                               </option>
+                                                       </tool>
+                                                       <tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.762712048" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool">
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.1607740639" name="RTSC package repositories (--xdcpath)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH" valueType="stringList">
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6678_INSTALL_DIR}/packages&quot;"/>
+                                                               </option>
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.731138713" name="RTSC target (-t)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET" value="ti.targets.elf.C66" valueType="string"/>
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM.749184621" name="RTSC platform (-p)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM" value="ti.platforms.evm6678" valueType="string"/>
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE.1757534191" name="Build profile (-r)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE" value="debug" valueType="string"/>
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR.389800643" name="Code generation tool directory (-c)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR" value="&quot;${CG_TOOL_ROOT}&quot;" valueType="string"/>
+                                                       </tool>
+                                               </toolChain>
+                                       </folderInfo>
+                               </configuration>
+                       </storageModule>
+                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+                       <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+                       <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+                       <storageModule moduleId="scannerConfiguration"/>
+               </cconfiguration>
+       </storageModule>
+       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+               <project id="srioboot_ddrinit.com.ti.ccstudio.buildDefinitions.C6000.ProjectType.1742876545" name="C6000" projectType="com.ti.ccstudio.buildDefinitions.C6000.ProjectType"/>
+       </storageModule>
+</cproject>
diff --git a/boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/.project b/boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/.project
new file mode 100644 (file)
index 0000000..055a829
--- /dev/null
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>srioboot_ddrinit_evmc6678l</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+                       <arguments>
+                               <dictionary>
+                                       <key>?name?</key>
+                                       <value></value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.append_environment</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+                                       <value>all</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.buildArguments</key>
+                                       <value>-k</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.buildCommand</key>
+                                       <value>${CCS_INSTALL_ROOT}/utils/gmake/gmake</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.buildLocation</key>
+                                       <value>${workspace_loc:/srioboot_ddrinit_evmc6678l/Debug}</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+                                       <value>clean</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.contents</key>
+                                       <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+                                       <value>all</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.stopOnError</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+                                       <value>true</value>
+                               </dictionary>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+                       <triggers>full,incremental,</triggers>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.rtsc.xdctools.buildDefinitions.XDC.xdcNature</nature>
+               <nature>com.ti.ccstudio.managedbuild.core.ccsNature</nature>
+               <nature>org.eclipse.cdt.core.cnature</nature>
+               <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+               <nature>org.eclipse.cdt.core.ccnature</nature>
+               <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+       </natures>
+       <linkedResources>
+               <link>
+                       <name>README.pdf</name>
+                       <type>1</type>
+                       <location>TI_MCSDK_SRIOBOOT_DIR/docs/README.pdf</location>
+               </link>
+               <link>
+                       <name>src</name>
+                       <type>2</type>
+                       <locationURI>TI_MCSDK_SRIOBOOT_DIR/srioboot_ddrinit/src</locationURI>
+               </link>
+       </linkedResources>
+</projectDescription>
diff --git a/boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/bin/srioboot_ddrinit.rmd b/boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/bin/srioboot_ddrinit.rmd
new file mode 100644 (file)
index 0000000..743f964
--- /dev/null
@@ -0,0 +1,11 @@
+-a
+-boot
+-e _c_int00
+
+ROMS
+{
+       ROM1:  org = 0x800000, length = 0x80000, memwidth = 32, romwidth = 32
+       files = { srioboot_ddrinit.btbl }
+}
+
+
diff --git a/boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/bin/srioboot_ddrinit_elf2HBin.bat b/boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/bin/srioboot_ddrinit_elf2HBin.bat
new file mode 100644 (file)
index 0000000..c02a1be
--- /dev/null
@@ -0,0 +1,25 @@
+set C6000_CG_DIR="C:\Program Files\Texas Instruments\ccsv5\tools\compiler\c6000"
+set TARGET=6678
+set ENDIAN=little
+set PATH=%PATH%;%SystemRoot%\system32;%SystemRoot%;
+
+
+@echo off
+
+echo C6000_CG_DIR set as: %C6000_CG_DIR%
+echo TARGET set as: %TARGET%
+
+echo Converting .out to HEX ...
+if %ENDIAN% == little (
+%C6000_CG_DIR%\bin\hex6x -order L srioboot_ddrinit.rmd srioboot_ddrinit_evm%TARGET%l.out
+) else (
+%C6000_CG_DIR%\bin\hex6x -order M srioboot_ddrinit.rmd srioboot_ddrinit_evm%TARGET%l.out
+)
+
+..\..\..\..\..\..\bttbl2hfile\Bttbl2Hfile srioboot_ddrinit.btbl srioboot_ddrinit.h srioboot_ddrinit.bin
+
+..\..\..\..\..\..\hfile2array\hfile2array srioboot_ddrinit.h srioDdrInit.h ddrInitCode
+
+mv srioDdrInit.h ..\..\..\srioboot_example\src\
+
+
diff --git a/boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/macros.ini b/boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/macros.ini
new file mode 100644 (file)
index 0000000..6be232e
--- /dev/null
@@ -0,0 +1 @@
+TI_MCSDK_SRIOBOOT_DIR="../../../../
diff --git a/boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/srioboot_helloworld.cmd b/boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/srioboot_helloworld.cmd
new file mode 100644 (file)
index 0000000..f226d4b
--- /dev/null
@@ -0,0 +1,74 @@
+/******************************************************************************
+ * Copyright (c) 2011 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.
+ * 
+ *****************************************************************************/
+/*
+ *  Linker command file
+ *
+ */
+
+-c
+-heap  0x1000
+-stack 0x1000
+
+/* Memory Map 1 - the default */
+MEMORY
+{
+    L2_LOCAL (RWX) : org = 0x10800000, len = 0x80000
+}
+
+SECTIONS
+{
+    .text:_boot_entry > L2_LOCAL
+    .csl_vect   >       L2_LOCAL
+    .cppi       >       L2_LOCAL
+    .linkram    >       L2_LOCAL
+    .mac_buffer >       L2_LOCAL
+    platform_lib >      L2_LOCAL
+    .text       >       L2_LOCAL
+    GROUP (NEAR_DP)
+    {
+    .neardata
+    .rodata 
+    .bss
+    } load > L2_LOCAL
+    .stack      >       L2_LOCAL
+    .cinit      >       L2_LOCAL
+    .cio        >       L2_LOCAL
+    .const      >       L2_LOCAL
+    .data       >       L2_LOCAL
+    .switch     >       L2_LOCAL
+    .sysmem     >       L2_LOCAL
+    .far        >       L2_LOCAL
+    .testMem    >       L2_LOCAL
+    .fardata    >       L2_LOCAL
+}
+
diff --git a/boot_loader/examples/srio/srioboot_ddrinit/src/srioboot_ddrinit.c b/boot_loader/examples/srio/srioboot_ddrinit/src/srioboot_ddrinit.c
new file mode 100644 (file)
index 0000000..eb36d88
--- /dev/null
@@ -0,0 +1,102 @@
+/******************************************************************************
+ * Copyright (c) 2011 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 emac 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.
+ *
+ *****************************************************************************/
+
+/**************************************************************************************
+ * FILE PURPOSE: SRIO Boot DDR Init Example
+ **************************************************************************************
+ * FILE NAME: srioboot_ddrinit.c
+ *
+ * DESCRIPTION: A simple example to initialize the DDR before booting an image via SRIO.
+ *
+ ***************************************************************************************/
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "platform.h"
+
+#define DEVICE_REG32_W(x,y)   *(volatile uint32_t *)(x)=(y)
+#define DEVICE_REG32_R(x)    (*(volatile uint32_t *)(x))
+
+#ifdef _EVMC6678L_
+#define MAGIC_ADDR     0x87fffc
+#endif
+
+#ifdef _EVMC6670L_
+#define MAGIC_ADDR     0x8ffffc
+#endif
+
+#define BOOT_MAGIC_ADDR(x)  (MAGIC_ADDR + (1<<28) + (x<<24))
+
+void
+start_boot
+(
+    void
+)
+{
+    void                (*exit)();
+    uint32_t            entry_addr;
+
+    while(1)
+    {
+        entry_addr = DEVICE_REG32_R(BOOT_MAGIC_ADDR(0));
+        if (entry_addr != 0)
+        {
+            /* jump to the exit point, which will be the entry point for the full IBL */
+            exit = (void (*)())entry_addr;
+            (*exit)();
+        }
+        platform_delay(1);
+    }
+}
+
+/******************************************************************************
+ * Function:    main
+ ******************************************************************************/
+void main ()
+{
+    platform_init_flags     init_flags;
+    platform_init_config    init_config;
+
+    /* Initialize main Platform lib */
+    memset(&init_config, 0, sizeof(platform_init_config));
+    memset(&init_flags, 1, sizeof(platform_init_flags));
+    if (platform_init(&init_flags, &init_config) != Platform_EOK)
+    {
+        printf ("Platform init failed!\n");
+        return;
+    }
+
+    /* Clear the boot entry address of the boot image and start to boot */
+    DEVICE_REG32_W(BOOT_MAGIC_ADDR(0), 0);
+    start_boot();
+}
index cce04549d69b81264b61e74b4133ac6da8347551..0b14885d716d1f4f6466ab458d2041658d8d5f28 100644 (file)
@@ -2,7 +2,7 @@
 <?fileVersion 4.0.0?>
 
 <cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
-       <storageModule moduleId="org.eclipse.cdt.core.settings">
+       <storageModule configRelations="2" moduleId="org.eclipse.cdt.core.settings">
                <cconfiguration id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1869204513">
                        <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1869204513" moduleId="org.eclipse.cdt.core.settings" name="Debug">
                                <externalSettings/>
@@ -41,6 +41,9 @@
                                                                        <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6678_INSTALL_DIR}/packages/ti/platform&quot;"/>
                                                                </option>
                                                                <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.ABI.1765753112" name="Application binary interface (coffabi, eabi) (--abi)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.ABI.eabi" valueType="enumerated"/>
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.DEFINE.164196737" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.DEFINE" valueType="definedSymbols">
+                                                                       <listOptionValue builtIn="false" value="_EVMC6678L_"/>
+                                                               </option>
                                                                <inputType id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__C_SRCS.397546270" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__C_SRCS"/>
                                                                <inputType id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__CPP_SRCS.1186530295" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__CPP_SRCS"/>
                                                                <inputType id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__ASM_SRCS.46202294" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__ASM_SRCS"/>
index a74cd8a31636e93ac52a82e5cfc4a24f5c81fa5d..4bed23ba3dea392e5e04a50bbfee9d6f1f6410fd 100644 (file)
 #include <stdio.h>
 #include <string.h>
 #include "platform.h"
+#include "srioDdrInit.h"
 #include "srioBootCode.h"
 
-/* Magic address RBL is polling */
-#define BOOT_MAGIC_ADDR     0x1087fffc
+#define DEVICE_REG32_W(x,y)   *(volatile uint32_t *)(x)=(y)
+#define DEVICE_REG32_R(x)    (*(volatile uint32_t *)(x))
+
+#ifdef _EVMC6678L_
+#define MAGIC_ADDR     0x87fffc
+#endif
+
+#ifdef _EVMC6670L_
+#define MAGIC_ADDR     0x87fffc
+#endif
+
+#define BOOT_MAGIC_ADDR(x)  (MAGIC_ADDR + (1<<28) + (x<<24))
 
 /* Entry address of the boot image */
 #define BOOT_ENTRY_ADDR     0xc000000
@@ -49,7 +60,7 @@
 #define WAIT_TIMEOUT        500000
 
 /* SRIO Boot Example Version */
-char version[] = "01.00.00.00";
+char version[] = "01.00.00.01";
 
 uint32_t coreNum;
 
@@ -63,21 +74,14 @@ volatile uint32_t bootEntryAddr = BOOT_ENTRY_ADDR;  /* Base address of MSMC */
 
 
 /* Port error status registers */
-uint32_t volatile *port_err_status_reg[] =  {
-
-    (uint32_t volatile *)0x290b158,
-    (uint32_t volatile *)0x290b178,
-    (uint32_t volatile *)0x290b198,
-    (uint32_t volatile *)0x290b1b8
-};
-
+#define SRIO_PORT_ERR_STATUS_REG(x)    (0x290b158 + x*0x20)
 
 /* Convert bytes to 32 bits */
 uint32_t byteto32bits(uint8_t *pDspCode)
 {
     int32_t i;
     uint32_t temp;
-    
+
     temp = *pDspCode++;
     for(i=0; i<3;i++) {
         temp <<= 8;
@@ -88,24 +92,24 @@ uint32_t byteto32bits(uint8_t *pDspCode)
 
 
 /* Convert to big endian, if the .out to be booted is big endian, this is not required */
-void 
+void
 Convert2BigEndian
 (
-    uint32_t    *pDspCode, 
+    uint32_t    *pDspCode,
     int32_t     size
 )
 {
     uint32_t i;
     uint32_t temp;
-    
+
     for(i=0; i<size; i+=4, pDspCode++) {
         temp = *pDspCode;
-        
-        temp = (temp>>24) | 
+
+        temp = (temp>>24) |
             ((temp<<8) & 0x00FF0000) |
             ((temp>>8) & 0x0000FF00) |
             (temp<<24);
-        
+
         *pDspCode= temp;
     }
 }
@@ -138,57 +142,56 @@ print_platform_errno
 
 
 /*
-Transfer (size_bytes) bytes data from host address (host_addr) to device ID's 
+Transfer (size_bytes) bytes data from host address (host_addr) to device ID's
 (rio_id) global address (dsp_addr). Lane 0 is used for booting.
 
-  rio_id:    destination device id 
+  rio_id:    destination device id
   host_addr:  host's address
   dsp_addr:   target dsp's global address
-  size_bytes: size in bytes 
+  size_bytes: size in bytes
 */
 int SRIOTransfer(int rio_num, int port_num, unsigned int host_addr, unsigned int dsp_addr, int size_bytes)
 {
     unsigned int count,busy;
-    
+
     /* Program a transfer on port 0 */
     /* LSU 1 Reg 0 - MSB of destination */
-    *((volatile uint32_t *)0x2900d00) = 0x00000000;
-    
-    
+    DEVICE_REG32_W(0x2900d00, 0x00000000);
+
+
     /* LSU 1 Reg 1 - LSB of destination */
-    *((volatile uint32_t *)0x2900d04) = dsp_addr;
-    
-    
+    DEVICE_REG32_W(0x2900d04, dsp_addr);
+
+
     /* LSU 1 Reg 2 - source address */
-    *((volatile uint32_t *)0x2900d08) = (1 << 28) | (coreNum << 24) | host_addr;
-    
-    
+    DEVICE_REG32_W(0x2900d08, (1 << 28) | (coreNum << 24) | host_addr);
+
+
     /* LSU 1 Reg 3 - Byte count */
-    *((volatile uint32_t *)0x2900d0c) = size_bytes;
-    
-    
-    /* LSU 1 Reg 4 - 
+    DEVICE_REG32_W(0x2900d0c, size_bytes);
+
+
+    /* LSU 1 Reg 4 -
     * out port ID = 0
     * Priority = 2
     * XAM = 0
     * ID size = 1 (16 bit)
     * Dest ID specified as arg
     * int32_terrupt request = 0 */
-    /* *((uint32_t *)0x2900d10) = 0x21000000 | (rio_id << 8)| (port << 30);  */
-    *((volatile uint32_t *)0x2900d10) = 0x00000000 | (rio_num << 8)| (port_num << 30);
-    
-    
+    DEVICE_REG32_W(0x2900d10, 0x00000000 | (rio_num << 8)| (port_num << 30));
+
+
     /* LSU 1 Reg 5 -
     * doorbell info = 0 for this packet type
     * hop count = 0 for this packet type
-    * Packet type = 0x54 - ftype = 5, ttype = 4 
+    * Packet type = 0x54 - ftype = 5, ttype = 4
     *                             nwrite packet type.
     * Writing this register should initiate the transfer */
-    *((volatile uint32_t *)0x2900d14) = 0x00000054;
-    
+    DEVICE_REG32_W(0x2900d14, 0x00000054);
+
     /* wait for it to complete */
     count = 0;
-    
+
     /* wait for it to complete */
     do{
         platform_delay(1);
@@ -196,70 +199,70 @@ int SRIOTransfer(int rio_num, int port_num, unsigned int host_addr, unsigned int
         if (count >= WAIT_TIMEOUT)
         {
             return (-1);
-        }        busy = *((volatile uint32_t *)0x2900d18);
-        
-    } while ((busy & 0x80000000) != 0x00000000); 
-    
+        }        busy = DEVICE_REG32_R(0x2900d18);
+
+    } while ((busy & 0x80000000) != 0x00000000);
+
     return(0);
 }
 
 
-/* Send boot tables to DSP and then door bell interrupt to boot the DSP
+/* Send boot tables to DSP and then write the magic address to boot the DSP
 
 pDspCode: points to DSP code;
 DeviceID: device ID.
 
 */
-int32_t bootDSP(uint8_t *pDspCode,int32_t DeviceID)
+int32_t pushData2Srio(uint8_t *pDspCode,int32_t DeviceID)
 {
     uint32_t i;
     uint32_t size;
     uint32_t count, remainder;
     uint32_t startaddr;
     volatile uint32_t vx;
-    
-    
+
+
     /* Claim the LSU */
-    vx = *((volatile uint32_t *)0x2900d18);
+    vx = DEVICE_REG32_R(0x2900d18);
 
     /* Get the boot entry address */
     bootEntryAddr = byteto32bits(pDspCode);
     pDspCode +=4;
-    
+
     while(1) {
-        
+
         /* Get the size */
         size =         byteto32bits(pDspCode);
         if(size == 0) break;
         pDspCode += 4;
-        
+
         startaddr = byteto32bits(pDspCode);
         pDspCode+= 4;
-        
+
         count = size/MAX_TX_SIZE;
         remainder = size - count * MAX_TX_SIZE;
-        
+
         for(i=0; i<count; i++) {
-            /* This is not needed if the .out to be booted is big endian already */                    
+            /* This is not needed if the .out to be booted is big endian already */
             Convert2BigEndian((uint32_t *)pDspCode,MAX_TX_SIZE);
-            
+
             /* Transfer boot tables to DSP */
             if(SRIOTransfer(rio_id, port, (uint32_t )pDspCode, (uint32_t )startaddr, MAX_TX_SIZE)!=0) return(-1);
             pDspCode += MAX_TX_SIZE;
             startaddr += MAX_TX_SIZE;
         }
-        
-        /* This is not needed if the .out to be booted is big endian already */                        
+
+        /* This is not needed if the .out to be booted is big endian already */
         Convert2BigEndian((uint32_t *)pDspCode,remainder);
-        
+
         if(SRIOTransfer(rio_id, port,(uint32_t )pDspCode, (uint32_t )startaddr, remainder)!=0) return(-1);
         pDspCode += remainder;
     }
-    
-    /* Write to magic address to start booting */
-    if (SRIOTransfer(rio_id, port,(uint32_t )&bootEntryAddr, BOOT_MAGIC_ADDR, 4)!=0)
+
+    /* Write to Core 0 boot magic address to boot Core 0 */
+    if (SRIOTransfer(rio_id, port,(uint32_t )&bootEntryAddr, BOOT_MAGIC_ADDR(0), 4)!=0)
         return(-1);
-    
+
     return(0);
 }
 
@@ -268,55 +271,55 @@ int32_t bootDSP(uint8_t *pDspCode,int32_t DeviceID)
 /******************************************************************************
  * Function:    Send a maintenance packet
  ******************************************************************************/
-void 
+void
 mainPacket
 (
-    uint32_t    addr, 
+    uint32_t    addr,
     uint32_t    value
 )
 {
     volatile uint32_t vx;
     uint32_t busy, count;
-    
+
     value = swap(value);
-    
+
     /* Claim the LSU */
-    vx = *((volatile uint32_t *)0x2900d18);
-    
+    vx = DEVICE_REG32_R(0x2900d18);
+
     /* Program a transfer on port 0 */
     /* LSU 1 Reg 0 - MSB of destination */
-    *((volatile uint32_t *)0x2900d00) = 0x00000000;
-    
-    
+    DEVICE_REG32_W(0x2900d00, 0x00000000);
+
+
     /* LSU 1 Reg 1 - LSB of destination */
-    *((volatile uint32_t *)0x2900d04) = addr - 0x290b000;
-    
+    DEVICE_REG32_W(0x2900d04, addr - 0x290b000);
+
     /* LSU 1 Reg 2 - source address */
-    *((volatile uint32_t *)0x2900d08) = (1 << 28) | (coreNum << 24) | (uint32_t)&value;
-    
-    
+    DEVICE_REG32_W(0x2900d08, (1 << 28) | (coreNum << 24) | (uint32_t)&value);
+
+
     /* LSU 1 Reg 3 - Byte count */
-    *((volatile uint32_t *)0x2900d0c) = 4;
-    
-    /* LSU 1 Reg 4 - 
+    DEVICE_REG32_W(0x2900d0c, 4);
+
+    /* LSU 1 Reg 4 -
     * out port ID = 0
     * Priority = 2
     * XAM = 0
     * ID size = 1 (16 bit)
     * Dest ID specified as arg
     * int32_terrupt request = 0 */
-    *((volatile uint32_t *)0x2900d10) = 0xffff0000 | (port << 8);
-    
-    
+    DEVICE_REG32_W(0x2900d10, 0xffff0000 | (port << 8));
+
+
     /* LSU 1 Reg 5 -
     * doorbell info = 0 for this packet type
     * hop count = 0 for this packet type
-    * Packet type = 0x54 - ftype = 5, ttype = 4 
+    * Packet type = 0x54 - ftype = 5, ttype = 4
     *                             nwrite packet type.
     * Writing this register should initiate the transfer */
     /*  *((uint32_t *)0x2900d14) = 0x00000054;  */
-    *((volatile uint32_t *)0x2900d14) = 0x00000081;  /* maint32_tenance write */
-    
+    DEVICE_REG32_W(0x2900d14, 0x00000081);  /* maint32_tenance write */
+
     /* wait for it to complete */
     count = 0;
     do{
@@ -326,10 +329,10 @@ mainPacket
         {
             printf("Send a maintenance packet failed\n");
             return;
-        }        
-        busy = *((volatile uint32_t *)0x2900d18);
-        
-    } while ((busy & 0x80000000) != 0x00000000);     
+        }
+        busy = DEVICE_REG32_R(0x2900d18);
+
+    } while ((busy & 0x80000000) != 0x00000000);
 
     return;
 }
@@ -338,34 +341,34 @@ mainPacket
 int32_t SRIOPortStatus(uint32_t port_num)
 {
     uint32_t count,value,portok;
-    
+
     count = 0;
     portok= 0;
 
     while(1)
-    {   
-        value = *port_err_status_reg[port_num];
-        
-        if((value & 0x02) !=0) 
+    {
+        value = DEVICE_REG32_R(SRIO_PORT_ERR_STATUS_REG(port_num));
+
+        if((value & 0x02) !=0)
         {
-            portok++; 
-            if(portok >= 50) 
+            portok++;
+            if(portok >= 50)
             {
                 break; /* port must be solid OK */
             }
-        } 
-        else 
+        }
+        else
         {
             portok = 0;
             count++;
-            if (count >= WAIT_TIMEOUT) 
+            if (count >= WAIT_TIMEOUT)
             {
                 return(-1);
             }
         }
         platform_delay(1);
     }
-    
+
     return(0);
 }
 
@@ -377,12 +380,12 @@ srio_init
 )
 {
     /* Enable the Transmit register */
-    *((volatile uint32_t *)0x290b13c) = 0x40000000;
+    DEVICE_REG32_W(0x290b13c, 0x40000000);
 
     if (loopback)
     {
         /* Enable Lane loop back for all the ports */
-        *((volatile uint32_t *)0x2900018) = 0x000000f0;
+        DEVICE_REG32_W(0x2900018, 0x000000f0);
     }
 
     /* check for the port status */
@@ -399,10 +402,9 @@ srio_init
 
 void main (void)
 {
-    volatile uint32_t       vx;
     platform_init_flags     init_flags;
     platform_init_config    init_config;
-    char                    version_msg[] = "\r\n\r\nSRIO Boot Example Version ";
+    char                    version_msg[] = "\r\n\r\nSRIO Boot Host Example Version ";
 
     printf("%s%s\n\n", version_msg, version);
 
@@ -419,18 +421,30 @@ void main (void)
     coreNum = platform_get_coreid();
 
     /* Init port 0, disable loopback */
-    srio_init(port, loopback);    
-    
-    /* Boot the DSP */
-    if(bootDSP(bootCode, rio_id)==0)
+    srio_init(port, loopback);
+
+    /* Push the DDR init code to remote DSP core 0 and boot core 0 to initialize the DDR */
+    if(pushData2Srio(ddrInitCode, rio_id)==0)
     {
-        printf("DSP boot successful\n");
-    } 
-    else 
+        printf("Transfer DDR init code via SRIO successfully\n");
+
+        platform_delay(1000);
+
+        /* Push the boot image code to remote DSP DDR and boot core 0 to run Hello World */
+        if(pushData2Srio(bootCode, rio_id)==0)
+        {
+            printf("Transfer boot code via SRIO successfully\n");
+        }
+        else
+        {
+            printf("DSP boot failed.\n");
+        }
+    }
+    else
     {
         printf("DSP boot failed.\n");
     }
-    
+
     for (;;);
 
 }
index 78cacba52e33a8e96fc35c37f0351f73058d7bf0..99c67259f77e74d1bd9283adbe78015b20d1af94 100644 (file)
@@ -2,7 +2,7 @@
 <?fileVersion 4.0.0?>
 
 <cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
-       <storageModule moduleId="org.eclipse.cdt.core.settings">
+       <storageModule configRelations="2" moduleId="org.eclipse.cdt.core.settings">
                <cconfiguration id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1869204513">
                        <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1869204513" moduleId="org.eclipse.cdt.core.settings" name="Debug">
                                <externalSettings/>
@@ -42,6 +42,9 @@
                                                                        <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6678_INSTALL_DIR}/packages/ti/platform&quot;"/>
                                                                </option>
                                                                <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.ABI.1539422311" name="Application binary interface (coffabi, eabi) (--abi)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.ABI.eabi" valueType="enumerated"/>
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.DEFINE.172564945" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compilerID.DEFINE" valueType="definedSymbols">
+                                                                       <listOptionValue builtIn="false" value="_EVMC6678L_"/>
+                                                               </option>
                                                                <inputType id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__C_SRCS.1023912707" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__C_SRCS"/>
                                                                <inputType id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__CPP_SRCS.979818748" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__CPP_SRCS"/>
                                                                <inputType id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__ASM_SRCS.416705288" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__ASM_SRCS"/>
@@ -76,6 +79,7 @@
                        <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
                        <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
                        <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+                       <storageModule moduleId="scannerConfiguration"/>
                </cconfiguration>
        </storageModule>
        <storageModule moduleId="cdtBuildSystem" version="4.0.0">
diff --git a/boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/Bttbl2Hfile.exe b/boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/Bttbl2Hfile.exe
deleted file mode 100644 (file)
index 888aa09..0000000
Binary files a/boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/Bttbl2Hfile.exe and /dev/null differ
similarity index 65%
rename from boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/elf2HBin.bat
rename to boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/helloworld_elf2HBin.bat
index 1006fdf4d8aaa3aa5abb957166629a363558f582..4cf45c904e424720728ae9b2ec4e800a23548a3c 100644 (file)
@@ -1,4 +1,5 @@
 set C6000_CG_DIR="C:\Program Files\Texas Instruments\ccsv5\tools\compiler\c6000"
+set TOOL_DIR="..\..\..\..\..\..\"
 set TARGET=6678
 set ENDIAN=little
 set PATH=%PATH%;%SystemRoot%\system32;%SystemRoot%;
@@ -17,10 +18,10 @@ if %ENDIAN% == little (
 %C6000_CG_DIR%\bin\hex6x -order M helloworld_image.rmd srioboot_helloworld_evm%TARGET%l.out
 )
 
-Bttbl2Hfile srioboot_helloworld.btbl srioboot_helloworld.h srioboot_helloworld.bin
+..\..\..\..\..\..\bttbl2hfile\Bttbl2Hfile srioboot_helloworld.btbl srioboot_helloworld.h srioboot_helloworld.bin
 
-hfile2array srioboot_helloworld.h srioBootCode.h bootCode
+..\..\..\..\..\..\hfile2array\hfile2array srioboot_helloworld.h srioBootCode.h bootCode
 
-mv srioBootCode.h ../../../srioboot_example/src/
+mv srioBootCode.h ..\..\..\srioboot_example\src\
 
 
index 104b0cd659af6650037632e6fe952fad57467095..05ca549b2f1934fb28619aea7e7cc3d8dedfe93d 100644 (file)
 /* Memory Map 1 - the default */
 MEMORY
 {
-    MSMCSRAM (RWX) : org = 0xc000000, len = 0x100000
+    DDR (RWX) : org = 0x80000000, len = 0x20000000
 }
 
 SECTIONS
 {
-    .text:_boot_entry > MSMCSRAM
-    .csl_vect   >       MSMCSRAM
-    .cppi       >       MSMCSRAM
-    .linkram    >       MSMCSRAM
-    .mac_buffer >       MSMCSRAM
-    platform_lib >      MSMCSRAM
-    .text       >       MSMCSRAM
+    .text:_boot_entry > DDR
+    .csl_vect   >       DDR
+    .cppi       >       DDR
+    .linkram    >       DDR
+    .mac_buffer >       DDR
+    platform_lib >      DDR
+    .text       >       DDR
     GROUP (NEAR_DP)
     {
     .neardata
     .rodata 
     .bss
-    } load > MSMCSRAM
-    .stack      >       MSMCSRAM
-    .cinit      >       MSMCSRAM
-    .cio        >       MSMCSRAM
-    .const      >       MSMCSRAM
-    .data       >       MSMCSRAM
-    .switch     >       MSMCSRAM
-    .sysmem     >       MSMCSRAM
-    .far        >       MSMCSRAM
-    .testMem    >       MSMCSRAM
-    .fardata    >       MSMCSRAM
+    } load > DDR
+    .stack      >       DDR
+    .cinit      >       DDR
+    .cio        >       DDR
+    .const      >       DDR
+    .data       >       DDR
+    .switch     >       DDR
+    .sysmem     >       DDR
+    .far        >       DDR
+    .testMem    >       DDR
+    .fardata    >       DDR
 }
 
index b752322ba8b83259390c250519c6f73020411afb..ead430cb7632acf6bf8f52942de4307a71de269e 100644 (file)
 #include <string.h>
 #include "platform.h"
 
+#define DEVICE_REG32_W(x,y)   *(volatile uint32_t *)(x)=(y)
+#define DEVICE_REG32_R(x)    (*(volatile uint32_t *)(x))
+
+#define CHIP_LEVEL_REG  0x02620000
+#define KICK0           (CHIP_LEVEL_REG + 0x0038)
+#define KICK1           (CHIP_LEVEL_REG + 0x003C)
+
+/* Magic address RBL is polling */
+#ifdef _EVMC6678L_
+#define MAGIC_ADDR          0x87fffc
+#endif
+
+#ifdef _EVMC6670L_
+#define MAGIC_ADDR          0x8ffffc
+#endif
+
+#define BOOT_MAGIC_ADDR(x)  (MAGIC_ADDR + (1<<28) + (x<<24))
+#define IPCGR(x)            (0x02620240 + x*4)
+
+#define BOOT_MAGIC_NUMBER   0xBABEFACE
+
 #define BOOT_UART_BAUDRATE         115200
 
 /* srioboot_helloworld version */
-char version[] = "01.00.00.00";
-
-/******************************************************************************
- * Function:    print_platform_errno
- ******************************************************************************/
-void
-print_platform_errno
-(
-    void
-)
-{
-    printf ("Returned platform error number is %d\n", platform_errno);
-}
+char version[] = "01.00.00.01";
 
 /******************************************************************************
  * Function:    write_uart
@@ -80,34 +89,69 @@ write_uart
     }
 }
 
+void
+write_boot_magic_number
+(
+    void
+)
+{
+    DEVICE_REG32_W(MAGIC_ADDR, BOOT_MAGIC_NUMBER);
+    while(1);
+}
+
 /******************************************************************************
  * Function:    main
  ******************************************************************************/
 void main ()
 {
-    platform_init_flags     init_flags;
-    platform_init_config    init_config;
-    char                    version_msg[] = "\r\n\r\nSRIO Boot Example Version ";
-    char                    boot_msg[] = "\r\n\r\nBooting Hello World image from SRIO ...";
-
-    printf("%s%s\n\n", version_msg, version);
+    char                    version_msg[] = "\r\n\r\nSRIO Boot Hello World Example Version ";
+    char                    boot_msg[80];
+    platform_info           pform_info;
+    uint32_t                coreNum, core;
 
-    /* Initialize main Platform lib */
-    memset(&init_config, 0, sizeof(platform_init_config));
-    memset(&init_flags, 1, sizeof(platform_init_flags));
-    if (platform_init(&init_flags, &init_config) != Platform_EOK)
+    /* Initialize UART */
+    coreNum = platform_get_coreid();
+    if (coreNum == 0)
     {
-        printf ("Platform init failed!\n");
-        print_platform_errno();
-        return;
-    }
-    platform_uart_init();
-    platform_uart_set_baudrate(BOOT_UART_BAUDRATE);
+        platform_uart_init();
+        platform_uart_set_baudrate(BOOT_UART_BAUDRATE);
+
 
-    write_uart(version_msg);
-    write_uart(version);
+        printf("%s%s\n\n", version_msg, version);
+        write_uart(version_msg);
+        write_uart(version);
 
-    printf("%s", boot_msg);
-    write_uart(boot_msg);
+        write_uart("\r\n\r\nBooting Hello World image on Core 0 from SRIO ...");
+
+        platform_get_info(&pform_info);
+
+        /* Unlock the chip registers */
+        DEVICE_REG32_W(KICK0, 0x83e70b13);
+        DEVICE_REG32_W(KICK1, 0x95a4f1e0);
+
+        /* Writing the entry address to other cores */
+        for (core = 1; core < pform_info.cpu.core_count; core++)
+        {
+            sprintf(boot_msg, "\r\n\r\nBooting Hello World image on Core %d from Core 0 ...", core);
+            write_uart(boot_msg);
+            
+            DEVICE_REG32_W(BOOT_MAGIC_ADDR(core), (uint32_t)write_boot_magic_number);
+
+            /* Delay 1 sec */
+            platform_delay(1);
+        }
+        for (core = 1; core < pform_info.cpu.core_count; core++)
+        {
+            /* IPC interrupt other cores */
+            DEVICE_REG32_W(IPCGR(core), 1);
+            platform_delay(1000);
+        }
+
+    }
+    else
+    {
+        write_boot_magic_number();
+    }
 
+    while(1);
 }
diff --git a/bttbl2hfile/Bttbl2Hfile.c b/bttbl2hfile/Bttbl2Hfile.c
new file mode 100644 (file)
index 0000000..19c4e6b
--- /dev/null
@@ -0,0 +1,133 @@
+/* This short program is written by David Zhou to convert a boot table to a
+   header file so DSP code can be easily included by the host software. The host 
+   will boot DSP ultimately through HPI. SRIO, EMAC, etc.
+   E.g.: 
+
+      hex6x DspCode.rmd ==> DspCode.btbl
+      Bttbl2Hfile DspCode.btbl DspCode.h
+
+   Meanwhile, it can also generate a binary image if desired.
+      Bttbl2Hfile DspCode.btbl DspCode.h DspCode.bin
+ */
+#include <stdio.h>
+#include <string.h>
+
+int asciiByte (unsigned char c)
+{
+  if ((c >= '0') && (c <= '9'))
+    return (1);
+
+  if ((c >= 'A') && (c <= 'F'))
+    return (1);
+
+  if ((c >= 'a') && (c <= 'f'))
+    return (1);
+
+  return (0);
+}
+
+
+int toNum (unsigned char c)
+{
+  if ((c >= '0') && (c <= '9'))
+    return (c - '0');
+
+  else if ((c >= 'A') && (c <= 'F'))
+    return (c - 'A'+10);
+
+ else  return (c - 'a' + 10);
+}
+
+
+int main (int argc, char *argv[])
+{
+  FILE *strin;
+  FILE *strout;
+  FILE *strbin;
+  int i=0;
+  char linein[132];
+  char lineout[200];
+  char *pin, *pout;
+  unsigned int value;
+
+  /* Verify the number of args */
+  if ((argc != 3)  && (argc != 4))  {
+    printf ("usage: %s inputfile output_header_file\n", argv[0]);
+       printf ("Or: \n");
+    printf ("usage: %s inputfile output_header_file output_binary_file\n", argv[0]);
+    return (-1);
+  }
+
+  /* Open all the files */
+  strin = fopen (argv[1], "rb");
+  if (strin == NULL)  {
+    printf ("could not open input file %s\n", argv[1]);
+    return (-1);
+  }
+
+  strout = fopen (argv[2], "wb+");
+  if (strout == NULL)  {
+    printf ("could not open file %s to write\n", argv[2]);
+    return (-1);
+  }
+
+  if(argc == 4){
+       strbin = fopen (argv[3], "wb+");
+       if (strbin == NULL)  {
+               printf ("could not open file %s to write\n", argv[3]);
+               return (-1);
+       }
+  }
+
+  /* Ignore the first two lines */
+  fgets (linein, 132, strin);
+  fgets (linein, 132, strin);
+  
+  while(feof(strin)==0) {
+         fgets (linein, 132, strin);
+         if(!asciiByte(linein[0])) break;  /* if not ASCII, end */
+
+         pin = linein;
+         pout = lineout;
+         strcpy(lineout," ");
+       
+         while(1) {
+                 *pout++ ='0';
+                 *pout++ ='x';
+
+                 if(argc == 4) {
+                         value = (toNum(*pin))<<4 | toNum(*(pin+1));
+                         fputc(value,strbin);
+                 }
+
+                 *pout++ = *pin++;
+                 *pout++ = *pin++;
+                 if(*pin==' ') pin++;
+                 *pout++ = ',';
+                 *pout++ = ' ';
+                 if(*pin == 0x0D) break;
+                 if(*pin == 0x0A) break;
+                 if(*pin == 0x00) break;
+                 if(*pin == EOF) break;
+         }
+
+         /* next line */
+         *pout++=0x0d;
+         *pout++=0x0a;
+         *pout++=0x00;
+
+         /* save it */
+         fprintf(strout, lineout);
+  }
+  
+  fclose(strin);
+  fclose(strout);
+
+  if(argc == 4) { 
+         fclose(strbin);
+  }
+
+  return (0);
+}
+
diff --git a/bttbl2hfile/Bttbl2Hfile.exe b/bttbl2hfile/Bttbl2Hfile.exe
new file mode 100644 (file)
index 0000000..bb604f2
Binary files /dev/null and b/bttbl2hfile/Bttbl2Hfile.exe differ
diff --git a/bttbl2hfile/README.txt b/bttbl2hfile/README.txt
new file mode 100644 (file)
index 0000000..c658648
--- /dev/null
@@ -0,0 +1,9 @@
+Utility to convert boot table format file to header format text and binary files
+
+Usage:
+
+Bttbl2Hfile.exe inputfile output_header_file output_binary_file
+
+Note: the inputfile is a boot table format file generated by CG Tool hex6x.exe
+
+
diff --git a/hfile2array/README.txt b/hfile2array/README.txt
new file mode 100644 (file)
index 0000000..90570a8
--- /dev/null
@@ -0,0 +1,7 @@
+Utility to convert header format file to a header file that contains an array with the boot code data
+
+Usage:
+
+Usage: hfile2array.exe <in_file> <out_file> <array_name>
+
+
diff --git a/hfile2array/hfile2array.c b/hfile2array/hfile2array.c
new file mode 100644 (file)
index 0000000..19e658d
--- /dev/null
@@ -0,0 +1,113 @@
+/******************************************************************************
+ * Copyright (c) 2011 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.
+ *
+ *****************************************************************************/
+
+/***************************************************************************************
+ * FILE NAME: hex2h.c
+ *
+ * DESCRIPTION: A simple utility to convert an ASCII hex file to a header file .
+ *
+ ***************************************************************************************/
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+int main(int argc, char **argv)
+{
+    FILE *out, *in;
+    char line[200] = "uint8_t ";
+
+    if (argc != 4)
+    {
+        printf ("Usage: hfile2array.exe <in_file> <out_file> <array_name>\n");
+        return (-1);
+    }
+    
+    argv++;
+
+    in = fopen((const char *)(*argv++), "rt");
+    
+    if (in == NULL)
+    {
+        printf ("Can not open %s\n", *argv[0]);
+        return (-1);
+    }
+    out = fopen((const char *)(*argv++), "wt");
+    if (out == NULL)
+    {
+        printf ("Can not open %s\n", *argv[1]);
+        return (-1);
+    }
+    strcat (line, (const char *)(*argv++));
+    strcat (line, "[] = {\n");
+    
+    if (fputs(line, out) != 0)
+    {
+        printf ("fputs %s error\n", fputs);
+        goto error;
+    }
+
+    while (1)
+    {
+        if (fgets(line, 200, in) != NULL)
+        {
+            if (fputs(line, out) != 0)
+            {
+                printf ("fputs %s error\n", fputs);
+                goto error;
+            }
+        }
+        else
+        {
+            /* EOF reached */
+            break;
+        }
+    }
+
+    if (fputs("};\n", out) != 0)
+    {
+        printf ("fputs %s error\n", fputs);
+        goto error;
+    }
+
+    fclose(in);
+    fclose(out);
+
+    return 0;
+
+error:
+    fclose(in);
+    fclose(out);
+    
+    return  (-1);
+}
\ No newline at end of file
index 54de648f28da3208bce71a87e867fec719a55e4a..40c14f0fb1c66a36dacba3117adddda7b0395244 100644 (file)
@@ -1,7 +1,7 @@
 file_name  = app.dat
 bus_addr   = 81
 start_addr = 0
-swap_data  = 1
+swap_data  = 0
 
 
 
index ec6cadc5da7a1950a6b9fd8936da28baa7e7a6ef..4668da6548e6f1f3f2b33febdb00a3a4d7df2f73 100644 (file)
@@ -47,7 +47,7 @@
 #include "types.h"
 
 /* EEPROM writer utility version */
-char version[] = "01.00.00.01";
+char version[] = "01.00.00.02";
 
 /* The input file name is hard coded */
 char *input_file = "eepromwriter_input.txt";
@@ -321,30 +321,46 @@ parse_input_file
 }
 
 /******************************************************************************
- * Function:    parse_ccs_file
+ * Function:    find_file_length
  ******************************************************************************/
 static Bool
-parse_ccs_file
+find_file_length
 (
     FILE*               fp
 )
 {
     char        line[MAX_LINE_LENGTH];
     char        *pEnd;
+    char        *ext;
     uint32_t    data_len, write_addr;
 
     memset(line, 0, MAX_LINE_LENGTH);
 
-    fgets(line, MAX_LINE_LENGTH, fp);
+    ext = strrchr(eepromWriterInfo.file_name, '.');
+
 
-    /* Read the write address from the CCS header */
-    strtoul (line,&pEnd,16);
-    strtoul (pEnd,&pEnd,16);
-    write_addr = strtoul (pEnd,&pEnd,16);
-    strtoul (pEnd,&pEnd,16);
+    if (ext && (strcmp(ext, ".dat") == 0))
+    {
+        
+        fgets(line, MAX_LINE_LENGTH, fp);
+        
+        /* Read the write address from the CCS header */
+        strtoul (line,&pEnd,16);
+        strtoul (pEnd,&pEnd,16);
+        write_addr = strtoul (pEnd,&pEnd,16);
+        strtoul (pEnd,&pEnd,16);
+        
+        /* Read the data length */
+        data_len = (strtoul (pEnd,NULL,16)) * 4;
+    }
+    else
+    {
+        /* find the data length by seeking to the end and getting position */
+        fseek(fp, 0, SEEK_END);
+        data_len = ftell(fp);
+        fseek(fp, 0, SEEK_SET);
+    }
 
-    /* Read the data length */
-    data_len = (strtoul (pEnd,NULL,16)) * 4;
     if (data_len > (eepromWriterInfo.deviceTotalBytes - eepromWriterInfo.startAddr))
     {
         printf ("The data file is too big to fit into the device.\n");
@@ -421,7 +437,7 @@ void main ()
     }
 
     /* Parse the CCS format file */
-    ret = parse_ccs_file(fp);
+    ret = find_file_length(fp);
     fclose (fp);
     if (ret == FALSE)
     {
index 1f1a5f25cec99ed2966e97c20c6cc644d65030fe..2ec43204a71ec1cba44619624538955f85a91eec 100644 (file)
@@ -6,10 +6,10 @@ Steps to program the NAND:
 
 1. Be sure to set the boot mode dip switch to no boot/EMIF16 boot mode on the EVM.
 
-2. Copy the CCS format data file to writer\nand\evmc66xxl\bin directory, and rename it to app.dat.
+2. Copy the binary file to writer\nand\evmc66xxl\bin directory, and rename it to app.bin.
 
 3. Change the file_name and start_addr in writer\nand\evmc66xxl\bin\nandwriter_input.txt if necessary. 
-   By default the NAND writer will load app.dat to DSP memory and write the data to NAND device start byte address 16384
+   By default the NAND writer will load app.bin to DSP memory and write the data to NAND device start byte address 16384
    (start address of block 1). The start_addr should always be set to the start byte addess of a block.
    
 4. Open CCSv5 and launch the evmc66xx emulator target configuration and connect to core 0.
@@ -19,12 +19,10 @@ Steps to program the NAND:
 
 6. Open the Memory view (in CCSv5, view->Memory Browser), and view the memory address 0x80000000.
 
-7. Load app.dat to 0x80000000:
+7. Load app.bin to 0x80000000:
      * In CCSv5, right click mouse in memory window, select "load memory".
-     * Browse and select writer\nand\evmc66xxl\bin\app.dat.
-     * Select the option "Use the file header information to set the start address and size of the memory block to be 
-       loaded" and click "next".
-     * Change the Start Address to "0x80000000" if it is not 0x80000000, and click "finish".
+     * Browse and select writer\nand\evmc66xxl\bin\app.bin (raw data format), click "next"
+     * Set the Start Address to "0x80000000", Type-size to 32-bits, leave swap unchecked, click "finish"
 
 8. After the data file is loaded into the memory, run the program (in CCSv5, press F8), it will start to program the 
    NAND.
index df74460739b263a63749eb86eef57af32bec8b38..009e6a154a81cc4f7f1ab334c8757b1d7a11c7f3 100644 (file)
@@ -1,4 +1,4 @@
-file_name  = app.dat
+file_name  = app.bin
 start_addr = 16384
 
 
index df74460739b263a63749eb86eef57af32bec8b38..009e6a154a81cc4f7f1ab334c8757b1d7a11c7f3 100644 (file)
@@ -1,4 +1,4 @@
-file_name  = app.dat
+file_name  = app.bin
 start_addr = 16384
 
 
index 784f35712358f1279c41a1f4f0471b9c5e330a08..3a19512d3f572adebca325b1dcc38034cd22cfe4 100644 (file)
@@ -47,7 +47,7 @@
 #include "types.h"
 
 /* NAND writer utility version */
-char version[] = "01.00.00.01";
+char version[] = "01.00.00.02";
 
 /* The input file name is hard coded */
 char *input_file = "nand_writer_input.txt";
@@ -341,7 +341,7 @@ flash_verify
 /******************************************************************************
  * Function:    parse_input_file  
  ******************************************************************************/
-Bool
+static Bool
 parse_input_file
 (
     FILE*               fp
@@ -389,20 +389,24 @@ parse_input_file
 }
 
 /******************************************************************************
- * Function:    parse_ccs_file
+ * Function:    find_file_length
  ******************************************************************************/
-Bool
-parse_ccs_file
+static Bool
+find_file_length
 (
     FILE*               fp
 )
 {
     char        line[MAX_LINE_LENGTH];
     char        *pEnd;
+    char        *ext;
     uint32_t    data_len, write_addr;
 
     memset(line, 0, MAX_LINE_LENGTH);
 
+    ext = strrchr(nandWriterInfo.file_name, '.');
+    if (ext && (strcmp(ext, ".dat") == 0))
+    {
     fgets(line, MAX_LINE_LENGTH, fp);
 
     /* Read the write address from the CCS header */
@@ -413,6 +417,15 @@ parse_ccs_file
 
     /* Read the data length */
     data_len = (strtoul (pEnd,NULL,16)) * 4;
+    }
+    else
+    {
+        /* find the data length by seeking to the end and getting position */
+        fseek(fp, 0, SEEK_END);
+        data_len = ftell(fp);
+        fseek(fp, 0, SEEK_SET);
+    }
+
     if (data_len > (nandWriterInfo.deviceTotalBytes - nandWriterInfo.startAddr))
     {
         printf ("The data file is too big to fit into the device.\n");
@@ -439,6 +452,7 @@ void main ()
     PLATFORM_DEVICE_info    *p_device;
     Bool                    ret;
     uint32_t                rCount;
+    printf("NAND Writer Utility Version %s\n\n", version);
 
     fp = fopen(input_file, "r");
     if (fp == NULL)
@@ -495,7 +509,7 @@ void main ()
     }
 
     /* Parse the CCS format file */
-    ret = parse_ccs_file(fp);
+    ret = find_file_length(fp);
     fclose (fp);
     if (ret == FALSE)
     {
index 0cfd70f65f97a31d6fb336ce47422ad3e72113eb..c62d59718320399c1cd5c6c2801f4a105a5c7820 100644 (file)
@@ -6,10 +6,10 @@ Steps to program the NOR:
 
 1. Be sure to set the boot mode dip switch to no boot/EMIF16 boot mode on the EVM.
 
-2. Copy the CCS format data file to writer\nor\evmc66xxl\bin directory, and rename it to app.dat.
+2. Copy the binary file to writer\nor\evmc66xxl\bin directory, and rename it to app.bin.
 
 3. Change the file_name and start_addr in writer\nor\evmc66xxl\bin\norwriter_input.txt if necessary. 
-   By default the NOR writer will load app.dat to DSP memory and write the data to NOR device start byte address 0, 
+   By default the NOR writer will load app.bin to DSP memory and write the data to NOR device start byte address 0, 
    the start_addr should always be set to the start byte addess of a sector.
 
 4. Open CCSv5 and launch the evmc66xx emulator target configuration and connect to core 0.
@@ -19,14 +19,13 @@ Steps to program the NOR:
 
 6. Open the Memory view (in CCSv5, view->Memory Browser), and view the memory address 0x80000000.
 
-7. Load app.dat to 0x80000000:
+7. Load app.bin to 0x80000000:
      * In CCSv5, right click mouse in memory window, select "load memory".
-     * Browse and select writer\nor\evmc66xxl\bin\app.dat.
-     * Select the option "Use the file header information to set the start address and size of the memory block to be 
-       loaded" and click "next".
-     * Change the Start Address to "0x80000000" if it is not 0x80000000, and click "finish".
+     * Browse and select writer\nor\evmc66xxl\bin\app.bin (raw data format), click "next"
+     * Set the Start Address to "0x80000000", Type-size to 32-bits, leave swap unchecked, click "finish"
 
-8. After the data file is loaded into the memory, run the program (in CCSv5, press F8), it will start to program the 
+
+8. After the binary file is loaded into the memory, run the program (in CCSv5, press F8), it will start to program the 
    NOR.
 
 9. When programming is completed, the console will print "NOR programming completed successfully", if there
index ced386cd91e75762501348ffa0601bbf18f7dd80..5f52b88c974b89fc371809b1525805c211b63428 100644 (file)
@@ -1,4 +1,4 @@
-file_name  = app.dat
+file_name  = app.bin
 start_addr = 0
 
 
index ced386cd91e75762501348ffa0601bbf18f7dd80..5f52b88c974b89fc371809b1525805c211b63428 100644 (file)
@@ -1,4 +1,4 @@
-file_name  = app.dat
+file_name  = app.bin
 start_addr = 0
 
 
index a3cbe1ec2c0a20c06f809450ef35e3663b589649..ddd8074dded201f55bd157b5cec32c70689cd423 100644 (file)
@@ -47,7 +47,7 @@
 #include "../include/types.h"
 
 /* NOR writer utility version */
-char version[] = "01.00.00.00";
+char version[] = "01.00.00.01";
 
 /* The input file name is hard coded */
 char *input_file = "nor_writer_input.txt";
@@ -257,7 +257,7 @@ flash_verify
 /******************************************************************************
  * Function:    parse_input_file
  ******************************************************************************/
-Bool
+static Bool
 parse_input_file
 (
     FILE*               fp
@@ -305,20 +305,26 @@ parse_input_file
 }
 
 /******************************************************************************
- * Function:    parse_ccs_file
+ * Function:    find_file_length
  ******************************************************************************/
-Bool
-parse_ccs_file
+static Bool
+find_file_length
 (
     FILE*               fp
 )
 {
     char        line[MAX_LINE_LENGTH];
     char        *pEnd;
+    char        *ext;
     uint32_t    data_len, write_addr;
 
     memset(line, 0, MAX_LINE_LENGTH);
 
+    ext = strrchr(norWriterInfo.file_name, '.');
+
+
+    if (ext && (strcmp(ext, ".dat") == 0))
+    {
     fgets(line, MAX_LINE_LENGTH, fp);
 
     /* Read the write address from the CCS header */
@@ -329,6 +335,15 @@ parse_ccs_file
 
     /* Read the data length */
     data_len = (strtoul (pEnd,NULL,16)) * 4;
+    }
+    else
+    {
+        /* find the data length by seeking to the end and getting position */
+        fseek(fp, 0, SEEK_END);
+        data_len = ftell(fp);
+        fseek(fp, 0, SEEK_SET);
+    }
+
     if (data_len > (norWriterInfo.deviceTotalBytes - norWriterInfo.startAddr))
     {
         printf ("The data file is too big to fit into the device.\n");
@@ -355,6 +370,8 @@ void main ()
     PLATFORM_DEVICE_info    *p_device;
     Bool                    ret;
 
+    printf("NOR Writer Utility Version %s\n\n", version);
+
     fp = fopen(input_file, "r");
     if (fp == NULL)
     {
@@ -410,7 +427,7 @@ void main ()
     }
 
     /* Parse the CCS format file */
-    ret = parse_ccs_file(fp);
+    ret = find_file_length(fp);
     fclose (fp);
     if (ret == FALSE)
     {