Created SRIO boot examples DEV.BIOS.MCSDK.02.00.00.SRIO_BOOT
authorHao Zhang <hzhang@ti.com>
Mon, 23 May 2011 15:30:17 +0000 (11:30 -0400)
committerHao Zhang <hzhang@ti.com>
Mon, 23 May 2011 15:30:17 +0000 (11:30 -0400)
17 files changed:
boot_loader/examples/srio/docs/README.pdf [new file with mode: 0644]
boot_loader/examples/srio/srioboot_example/evmc6678l/.ccsproject [new file with mode: 0644]
boot_loader/examples/srio/srioboot_example/evmc6678l/.cproject [new file with mode: 0644]
boot_loader/examples/srio/srioboot_example/evmc6678l/.project [new file with mode: 0644]
boot_loader/examples/srio/srioboot_example/evmc6678l/macros.ini [new file with mode: 0644]
boot_loader/examples/srio/srioboot_example/evmc6678l/srio_boot_example.cmd [new file with mode: 0644]
boot_loader/examples/srio/srioboot_example/src/srioBootExample.c [new file with mode: 0644]
boot_loader/examples/srio/srioboot_helloworld/evmc6678l/.ccsproject [new file with mode: 0644]
boot_loader/examples/srio/srioboot_helloworld/evmc6678l/.cproject [new file with mode: 0644]
boot_loader/examples/srio/srioboot_helloworld/evmc6678l/.project [new file with mode: 0644]
boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/Bttbl2Hfile.exe [new file with mode: 0644]
boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/elf2HBin.bat [new file with mode: 0644]
boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/helloworld_image.rmd [new file with mode: 0644]
boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/hfile2array.exe [new file with mode: 0644]
boot_loader/examples/srio/srioboot_helloworld/evmc6678l/macros.ini [new file with mode: 0644]
boot_loader/examples/srio/srioboot_helloworld/evmc6678l/srioboot_helloworld.cmd [new file with mode: 0644]
boot_loader/examples/srio/srioboot_helloworld/src/srioboot_helloworld.c [new file with mode: 0644]

diff --git a/boot_loader/examples/srio/docs/README.pdf b/boot_loader/examples/srio/docs/README.pdf
new file mode 100644 (file)
index 0000000..194fe2d
Binary files /dev/null and b/boot_loader/examples/srio/docs/README.pdf differ
diff --git a/boot_loader/examples/srio/srioboot_example/evmc6678l/.ccsproject b/boot_loader/examples/srio/srioboot_example/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_example/evmc6678l/.cproject b/boot_loader/examples/srio/srioboot_example/evmc6678l/.cproject
new file mode 100644 (file)
index 0000000..cce0454
--- /dev/null
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+       <storageModule 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="org.eclipse.cdt.core.ELF" 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_example_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.2097842143" 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.854128311">
+                                                       <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.732314103" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
+                                                               <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=com.ti.ccstudio.deviceModel.C6000.CustomC6000Device"/>
+                                                               <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=rts6600_elf.lib"/>
+                                                               <listOptionValue builtIn="false" value="XDC_VERSION=3.20.08.88"/>
+                                                               <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.biosmcsdk.pdk.C6678L:1.0.0.7;"/>
+                                                               <listOptionValue builtIn="false" value="OUTPUT_TYPE=rtscApplication:executable"/>
+                                                       </option>
+                                                       <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1263633169" name="Code Generation tools version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="7.2.0" valueType="string"/>
+                                                       <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.targetPlatformDebug.30003368" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.targetPlatformDebug"/>
+                                                       <builder buildPath="${workspace_loc:/srioboot_example/Debug}" id="com.ti.ccstudio.buildDefinitions.C6000_7.2.exe.builderDebug.1571910857" 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.1787566966" 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.1206666269" 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.INCLUDE_PATH.1353471041" 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.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"/>
+                                                               <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"/>
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.C6000_7.2.compiler.inputType__ASM2_SRCS.2124959934" 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.854128311" 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.572435525" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.OUTPUT_FILE" value="&quot;../bin/srioboot_example_evm6678l.out&quot;" valueType="string"/>
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.MAP_FILE.405326097" 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_example_evm6678l.map&quot;" valueType="string"/>
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.LIBRARY.1992557769" 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;rts6600_elf.lib&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;ti.platform.evm6678l.ae66&quot;"/>
+                                                               </option>
+                                                               <option id="com.ti.ccstudio.buildDefinitions.C6000_7.2.linkerID.SEARCH_PATH.352622214" 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.1242540186" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool">
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR.496009253" 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"/>
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.1742151819" 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.1677251639" 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.1512447741" 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.XDC_PATH.997241669" 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>
+                                                       </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"/>
+               </cconfiguration>
+       </storageModule>
+       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+               <project id="srioboot_example.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_example/evmc6678l/.project b/boot_loader/examples/srio/srioboot_example/evmc6678l/.project
new file mode 100644 (file)
index 0000000..4ea393e
--- /dev/null
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>srioboot_example_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_example/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_example/src</locationURI>
+               </link>
+       </linkedResources>
+</projectDescription>
diff --git a/boot_loader/examples/srio/srioboot_example/evmc6678l/macros.ini b/boot_loader/examples/srio/srioboot_example/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_example/evmc6678l/srio_boot_example.cmd b/boot_loader/examples/srio/srioboot_example/evmc6678l/srio_boot_example.cmd
new file mode 100644 (file)
index 0000000..6e1a8a3
--- /dev/null
@@ -0,0 +1,76 @@
+/******************************************************************************
+ * 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  0x2000
+-stack 0x2000
+
+MEMORY
+{
+       L2 : origin = 0x800000,  length = 0x80000
+
+}
+
+SECTIONS
+{
+    .csl_vect   >       L2
+    .cppi       >       L2
+    .linkram    >       L2
+    .mac_buffer >       L2
+    platform_lib >     L2
+    .text       >       L2
+    GROUP (NEAR_DP)
+    {
+    .neardata
+    .rodata 
+    .bss
+    } load > L2
+    .stack      >       L2
+    .cinit      >       L2
+    .cio        >       L2
+    .const      >       L2
+    .data       >       L2
+    .switch     >       L2
+    .sysmem     >       L2
+    .far        >       L2
+    .testMem    >       L2
+    .fardata    >       L2
+}
+
+
+
+
diff --git a/boot_loader/examples/srio/srioboot_example/src/srioBootExample.c b/boot_loader/examples/srio/srioboot_example/src/srioBootExample.c
new file mode 100644 (file)
index 0000000..a74cd8a
--- /dev/null
@@ -0,0 +1,438 @@
+/******************************************************************************
+ * 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.
+ *
+ *****************************************************************************/
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "platform.h"
+#include "srioBootCode.h"
+
+/* Magic address RBL is polling */
+#define BOOT_MAGIC_ADDR     0x1087fffc
+
+/* Entry address of the boot image */
+#define BOOT_ENTRY_ADDR     0xc000000
+
+/* Maximum number of bytes per transfer */
+#define MAX_TX_SIZE         1024
+
+/* SRIO transfer wait timeout in usec */
+#define WAIT_TIMEOUT        500000
+
+/* SRIO Boot Example Version */
+char version[] = "01.00.00.00";
+
+uint32_t coreNum;
+
+/* These can be changed on the fly during the test */
+volatile uint32_t port      = 0;
+volatile uint32_t rio_id    = 0;
+volatile uint32_t loopback  = 0;
+
+#pragma DATA_ALIGN(bootEntryAddr, 16)
+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
+};
+
+
+/* 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;
+        temp |= *pDspCode++;
+    }
+    return(temp);
+}
+
+
+/* Convert to big endian, if the .out to be booted is big endian, this is not required */
+void 
+Convert2BigEndian
+(
+    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<<8) & 0x00FF0000) |
+            ((temp>>8) & 0x0000FF00) |
+            (temp<<24);
+        
+        *pDspCode= temp;
+    }
+}
+
+
+uint32_t swap (uint32_t v)
+{
+    uint32_t w;
+
+    w = (((v >> 24) & 0xff) <<  0)  |
+        (((v >> 16) & 0xff) <<  8)  |
+        (((v >>  8) & 0xff) << 16)  |
+        (((v >>  0) & 0xff) << 24)  ;
+
+    return (w);
+
+}
+
+/******************************************************************************
+ * Function:    print_platform_errno
+ ******************************************************************************/
+void
+print_platform_errno
+(
+    void
+)
+{
+    printf ("Returned platform error number is %d\n", platform_errno);
+}
+
+
+/*
+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 
+  host_addr:  host's address
+  dsp_addr:   target dsp's global address
+  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;
+    
+    
+    /* LSU 1 Reg 1 - LSB of destination */
+    *((volatile uint32_t *)0x2900d04) = dsp_addr;
+    
+    
+    /* LSU 1 Reg 2 - source address */
+    *((volatile uint32_t *)0x2900d08) = (1 << 28) | (coreNum << 24) | host_addr;
+    
+    
+    /* LSU 1 Reg 3 - Byte count */
+    *((volatile uint32_t *)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);
+    
+    
+    /* 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 
+    *                             nwrite packet type.
+    * Writing this register should initiate the transfer */
+    *((volatile uint32_t *)0x2900d14) = 0x00000054;
+    
+    /* wait for it to complete */
+    count = 0;
+    
+    /* wait for it to complete */
+    do{
+        platform_delay(1);
+        count++;
+        if (count >= WAIT_TIMEOUT)
+        {
+            return (-1);
+        }        busy = *((volatile uint32_t *)0x2900d18);
+        
+    } while ((busy & 0x80000000) != 0x00000000); 
+    
+    return(0);
+}
+
+
+/* Send boot tables to DSP and then door bell interrupt to boot the DSP
+
+pDspCode: points to DSP code;
+DeviceID: device ID.
+
+*/
+int32_t bootDSP(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);
+
+    /* 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 */                    
+            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 */                        
+        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)
+        return(-1);
+    
+    return(0);
+}
+
+
+
+/******************************************************************************
+ * Function:    Send a maintenance packet
+ ******************************************************************************/
+void 
+mainPacket
+(
+    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);
+    
+    /* Program a transfer on port 0 */
+    /* LSU 1 Reg 0 - MSB of destination */
+    *((volatile uint32_t *)0x2900d00) = 0x00000000;
+    
+    
+    /* LSU 1 Reg 1 - LSB of destination */
+    *((volatile uint32_t *)0x2900d04) = addr - 0x290b000;
+    
+    /* LSU 1 Reg 2 - source address */
+    *((volatile uint32_t *)0x2900d08) = (1 << 28) | (coreNum << 24) | (uint32_t)&value;
+    
+    
+    /* LSU 1 Reg 3 - Byte count */
+    *((volatile uint32_t *)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);
+    
+    
+    /* 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 
+    *                             nwrite packet type.
+    * Writing this register should initiate the transfer */
+    /*  *((uint32_t *)0x2900d14) = 0x00000054;  */
+    *((volatile uint32_t *)0x2900d14) = 0x00000081;  /* maint32_tenance write */
+    
+    /* wait for it to complete */
+    count = 0;
+    do{
+        platform_delay(1);
+        count++;
+        if (count >= WAIT_TIMEOUT)
+        {
+            printf("Send a maintenance packet failed\n");
+            return;
+        }        
+        busy = *((volatile uint32_t *)0x2900d18);
+        
+    } while ((busy & 0x80000000) != 0x00000000);     
+
+    return;
+}
+
+/* Return if Port is OK or not */
+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) 
+        {
+            portok++; 
+            if(portok >= 50) 
+            {
+                break; /* port must be solid OK */
+            }
+        } 
+        else 
+        {
+            portok = 0;
+            count++;
+            if (count >= WAIT_TIMEOUT) 
+            {
+                return(-1);
+            }
+        }
+        platform_delay(1);
+    }
+    
+    return(0);
+}
+
+void
+srio_init
+(
+    uint32_t    port_num,
+    uint32_t    loopback
+)
+{
+    /* Enable the Transmit register */
+    *((volatile uint32_t *)0x290b13c) = 0x40000000;
+
+    if (loopback)
+    {
+        /* Enable Lane loop back for all the ports */
+        *((volatile uint32_t *)0x2900018) = 0x000000f0;
+    }
+
+    /* check for the port status */
+    if (SRIOPortStatus(port_num) != 0)
+    {
+        printf("Port %d is not OK!\n", port_num);
+    }
+
+    /* TLM SP0 control, enable promiscuous mode */
+    mainPacket (0x291b380, 0x00309000);
+
+    mainPacket (0x290b15c, 0x00600000);
+}
+
+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 ";
+
+    printf("%s%s\n\n", version_msg, version);
+
+    /* 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");
+        print_platform_errno();
+        return;
+    }
+
+    coreNum = platform_get_coreid();
+
+    /* Init port 0, disable loopback */
+    srio_init(port, loopback);    
+    
+    /* Boot the DSP */
+    if(bootDSP(bootCode, rio_id)==0)
+    {
+        printf("DSP boot successful\n");
+    } 
+    else 
+    {
+        printf("DSP boot failed.\n");
+    }
+    
+    for (;;);
+
+}
+
+
diff --git a/boot_loader/examples/srio/srioboot_helloworld/evmc6678l/.ccsproject b/boot_loader/examples/srio/srioboot_helloworld/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_helloworld/evmc6678l/.cproject b/boot_loader/examples/srio/srioboot_helloworld/evmc6678l/.cproject
new file mode 100644 (file)
index 0000000..78cacba
--- /dev/null
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+       <storageModule 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_helloworld_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_helloworld_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"/>
+                                                               <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_helloworld_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_helloworld_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"/>
+               </cconfiguration>
+       </storageModule>
+       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+               <project id="srioboot_helloworld.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_helloworld/evmc6678l/.project b/boot_loader/examples/srio/srioboot_helloworld/evmc6678l/.project
new file mode 100644 (file)
index 0000000..d14361e
--- /dev/null
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>srioboot_helloworld_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_helloworld_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>
+                       <locationURI>TI_MCSDK_SRIOBOOT_DIR/docs/README.pdf</locationURI>
+               </link>
+               <link>
+                       <name>src</name>
+                       <type>2</type>
+                       <locationURI>TI_MCSDK_SRIOBOOT_DIR/srioboot_helloworld/src</locationURI>
+               </link>
+       </linkedResources>
+</projectDescription>
diff --git a/boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/Bttbl2Hfile.exe b/boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/Bttbl2Hfile.exe
new file mode 100644 (file)
index 0000000..888aa09
Binary files /dev/null and b/boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/Bttbl2Hfile.exe differ
diff --git a/boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/elf2HBin.bat b/boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/elf2HBin.bat
new file mode 100644 (file)
index 0000000..1006fdf
--- /dev/null
@@ -0,0 +1,26 @@
+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 IBL_ROOT_DIR set as : %IBL_ROOT_DIR%
+
+echo Converting .out to HEX ...
+if %ENDIAN% == little (
+%C6000_CG_DIR%\bin\hex6x -order L helloworld_image.rmd srioboot_helloworld_evm%TARGET%l.out
+) else (
+%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
+
+hfile2array srioboot_helloworld.h srioBootCode.h bootCode
+
+mv srioBootCode.h ../../../srioboot_example/src/
+
+
diff --git a/boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/helloworld_image.rmd b/boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/helloworld_image.rmd
new file mode 100644 (file)
index 0000000..d5410cc
--- /dev/null
@@ -0,0 +1,11 @@
+-a
+-boot
+-e _c_int00
+
+ROMS
+{
+       ROM1:  org = 0xc000000, length = 0x20000, memwidth = 32, romwidth = 32
+       files = { srioboot_helloworld.btbl }
+}
+
+
diff --git a/boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/hfile2array.exe b/boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/hfile2array.exe
new file mode 100644 (file)
index 0000000..ad01e50
Binary files /dev/null and b/boot_loader/examples/srio/srioboot_helloworld/evmc6678l/bin/hfile2array.exe differ
diff --git a/boot_loader/examples/srio/srioboot_helloworld/evmc6678l/macros.ini b/boot_loader/examples/srio/srioboot_helloworld/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_helloworld/evmc6678l/srioboot_helloworld.cmd b/boot_loader/examples/srio/srioboot_helloworld/evmc6678l/srioboot_helloworld.cmd
new file mode 100644 (file)
index 0000000..104b0cd
--- /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  0x2000
+-stack 0x2000
+
+/* Memory Map 1 - the default */
+MEMORY
+{
+    MSMCSRAM (RWX) : org = 0xc000000, len = 0x100000
+}
+
+SECTIONS
+{
+    .text:_boot_entry > MSMCSRAM
+    .csl_vect   >       MSMCSRAM
+    .cppi       >       MSMCSRAM
+    .linkram    >       MSMCSRAM
+    .mac_buffer >       MSMCSRAM
+    platform_lib >      MSMCSRAM
+    .text       >       MSMCSRAM
+    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
+}
+
diff --git a/boot_loader/examples/srio/srioboot_helloworld/src/srioboot_helloworld.c b/boot_loader/examples/srio/srioboot_helloworld/src/srioboot_helloworld.c
new file mode 100644 (file)
index 0000000..b752322
--- /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 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 Hello World Example
+ **************************************************************************************
+ * FILE NAME: srioboot_helloworld.c
+ *
+ * DESCRIPTION: A simple hello world example demonstrating SRIO boot.
+ *
+ ***************************************************************************************/
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "platform.h"
+
+#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);
+}
+
+/******************************************************************************
+ * Function:    write_uart
+ ******************************************************************************/
+void
+write_uart
+(
+    char*      msg
+)
+{
+    uint32_t i;
+    uint32_t msg_len = strlen(msg);
+
+    /* Write the message to the UART */
+    for (i = 0; i < msg_len; i++)
+    {
+        platform_uart_write(msg[i]);
+    }
+}
+
+/******************************************************************************
+ * 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);
+
+    /* 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");
+        print_platform_errno();
+        return;
+    }
+    platform_uart_init();
+    platform_uart_set_baudrate(BOOT_UART_BAUDRATE);
+
+    write_uart(version_msg);
+    write_uart(version);
+
+    printf("%s", boot_msg);
+    write_uart(boot_msg);
+
+}