Added EMAC loopback support and updated projects to use resource manager
authorHao Zhang <hzhang@ti.com>
Tue, 21 Jun 2011 15:51:32 +0000 (11:51 -0400)
committerHao Zhang <hzhang@ti.com>
Tue, 21 Jun 2011 15:51:32 +0000 (11:51 -0400)
67 files changed:
boot_loader/examples/i2c/nand/evmc6670l/.cproject
boot_loader/examples/i2c/nand/evmc6678l/.cproject
boot_loader/examples/i2c/nand/src/i2c_boot_nand_example.c
boot_loader/examples/i2c/nor/evmc6670l/.cproject
boot_loader/examples/i2c/nor/evmc6678l/.cproject
boot_loader/examples/i2c/nor/src/i2c_boot_nor_example.c
boot_loader/examples/i2c/tftp/evmc6670l/.cproject
boot_loader/examples/i2c/tftp/evmc6678l/.cproject
boot_loader/examples/i2c/tftp/src/i2c_boot_tftp_example.c
boot_loader/examples/srio/srioboot_ddrinit/evmc6678l/.cproject
boot_loader/examples/srio/srioboot_ddrinit/src/srioboot_ddrinit.c
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/src/srioboot_helloworld.c
post/evmc6670l/.cproject
post/evmc6670l/bin/post_i2crom.map.pp
post/evmc6670l/post.cmd
post/evmc6678l/.cproject
post/evmc6678l/bin/post_i2crom.map.pp
post/evmc6678l/post.cmd
post/include/cpdma_api.h [new file with mode: 0644]
post/include/cpdma_loc.h [new file with mode: 0644]
post/include/cpmac_regs.h [new file with mode: 0644]
post/include/cpmacdrv.h [new file with mode: 0644]
post/include/gmacsl_api.h [new file with mode: 0644]
post/include/gmacsl_loc.h [new file with mode: 0644]
post/include/hwpafw_bin.h [new file with mode: 0644]
post/include/hwpafwsw.h [new file with mode: 0644]
post/include/net.h [new file with mode: 0644]
post/include/pa_api.h [new file with mode: 0644]
post/include/pa_loc.h [new file with mode: 0644]
post/include/post.h
post/include/pscapi.h [new file with mode: 0644]
post/include/pscloc.h [new file with mode: 0644]
post/include/qm_api.h [new file with mode: 0644]
post/include/qm_loc.h [new file with mode: 0644]
post/include/target.h [new file with mode: 0644]
post/include/types.h
post/src/c6678.c [new file with mode: 0644]
post/src/cpdma.c [new file with mode: 0644]
post/src/gmacsl.c [new file with mode: 0644]
post/src/pa.c [new file with mode: 0644]
post/src/post.c
post/src/psc.c [new file with mode: 0644]
post/src/qm.c [new file with mode: 0644]
writer/eeprom/docs/README.txt
writer/eeprom/evmc6670l/.cproject
writer/eeprom/evmc6670l/Makefile
writer/eeprom/evmc6678l/.cproject
writer/eeprom/evmc6678l/Makefile
writer/eeprom/include/types.h
writer/eeprom/src/eepromwriter.c
writer/nand/docs/README.txt
writer/nand/evmc6670l/.cproject
writer/nand/evmc6670l/Makefile
writer/nand/evmc6678l/.cproject
writer/nand/evmc6678l/Makefile
writer/nand/include/types.h
writer/nand/src/nandwriter.c
writer/nor/docs/README.txt
writer/nor/evmc6670l/.cproject
writer/nor/evmc6670l/Makefile
writer/nor/evmc6678l/.cproject
writer/nor/evmc6678l/Makefile
writer/nor/include/types.h
writer/nor/src/norwriter.c

index da2ec0b033bf3956c34f3005a42404f149447ede..9cd9638fdce59d34eb00d244927edf17f7c71408 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/>
@@ -39,6 +39,7 @@
                                                                <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_C6670_INSTALL_DIR}/packages/ti/platform&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6670_INSTALL_DIR}/packages&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"/>
@@ -64,7 +65,7 @@
                                                                <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.evm6670" 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"/>
+                                                               <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"/>
                                                        </tool>
                                                </toolChain>
                                        </folderInfo>
@@ -73,7 +74,6 @@
                        <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">
index 7f10c5b7c90eeebe937664faa6bcd57311de81fd..56ea7d11b29b8486ef2792598cd7b8d967a7139f 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/>
@@ -39,6 +39,7 @@
                                                                <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;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6678_INSTALL_DIR}/packages&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"/>
@@ -64,9 +65,7 @@
                                                                <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>
+                                                               <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"/>
                                                        </tool>
                                                </toolChain>
                                        </folderInfo>
@@ -75,7 +74,6 @@
                        <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">
index 6aa0d504e16113ed347a8704f0fbe626f9247f53..b0cd601a2c765a54d3179f5f496d47a4379b104a 100644 (file)
@@ -43,6 +43,7 @@
 #include <stdio.h>
 #include <string.h>
 #include "platform.h"
+#include "ti/csl/csl_semAux.h"
 
 #define BOOT_UART_BAUDRATE         115200
 
@@ -64,6 +65,28 @@ void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes)
     }
 }
 
+void Osal_platformSpiCsEnter(void)
+{
+    /* Get the hardware semaphore.
+     *
+     * Acquire Multi core CPPI synchronization lock
+     */
+    while ((CSL_semAcquireDirect (3)) == 0);
+
+    return;
+}
+
+void Osal_platformSpiCsExit (void)
+{
+    /* Release the hardware semaphore
+     *
+     * Release multi-core lock.
+     */
+    CSL_semReleaseSemaphore (3);
+
+    return;
+}
+
 /******************************************************************************
  * Function:    print_platform_errno
  ******************************************************************************/
index 0a5aee8c3ff6b1ef0aa3d55fb0f7a1700236a6f5..82ceff84dd67cec65a5490ad83f1278f3ed29aa0 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/>
@@ -39,6 +39,7 @@
                                                                <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_C6670_INSTALL_DIR}/packages/ti/platform&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6670_INSTALL_DIR}/packages&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"/>
@@ -64,7 +65,7 @@
                                                                <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.evm6670" 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"/>
+                                                               <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"/>
                                                        </tool>
                                                </toolChain>
                                        </folderInfo>
@@ -73,7 +74,6 @@
                        <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">
index 9d9e256a7aed43c54fefa0a6e76653d4ee96431c..8ddfae4c76b60f03f69bd95479c68390b0a417d4 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/>
@@ -39,6 +39,7 @@
                                                                <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;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6678_INSTALL_DIR}/packages&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"/>
@@ -64,9 +65,7 @@
                                                                <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>
+                                                               <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"/>
                                                        </tool>
                                                </toolChain>
                                        </folderInfo>
@@ -75,7 +74,6 @@
                        <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">
index 7dceef22161d42b8dde0f62910ee353acfb5a6ca..e61ddbf31723239929fd9f0faaab82b5847592da 100644 (file)
@@ -43,6 +43,7 @@
 #include <stdio.h>
 #include <string.h>
 #include "platform.h"
+#include "ti/csl/csl_semAux.h"
 
 #define BOOT_UART_BAUDRATE         115200
 
@@ -64,6 +65,28 @@ void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes)
     }
 }
 
+void Osal_platformSpiCsEnter(void)
+{
+    /* Get the hardware semaphore.
+     *
+     * Acquire Multi core CPPI synchronization lock
+     */
+    while ((CSL_semAcquireDirect (3)) == 0);
+
+    return;
+}
+
+void Osal_platformSpiCsExit (void)
+{
+    /* Release the hardware semaphore
+     *
+     * Release multi-core lock.
+     */
+    CSL_semReleaseSemaphore (3);
+
+    return;
+}
+
 /******************************************************************************
  * Function:    print_platform_errno
  ******************************************************************************/
index 03a9e17b0d0ef7d787ac78a46ec6477fce0bc387..e04b91bdf120cad7358de56d5531ac7623ad687a 100644 (file)
@@ -39,6 +39,7 @@
                                                                <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_C6670_INSTALL_DIR}/packages/ti/platform&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6670_INSTALL_DIR}/packages&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"/>
index 4d71d4ce0ee36efec2697c438ddf9d37b9e3f718..9fdbc22302e80a8ca2c3fd4b34d89394bc4aa2a6 100644 (file)
@@ -39,6 +39,7 @@
                                                                <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;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6678_INSTALL_DIR}/packages&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"/>
@@ -64,9 +65,7 @@
                                                                <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>
+                                                               <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"/>
                                                        </tool>
                                                </toolChain>
                                        </folderInfo>
index 771cf4ff80c4c7e27b00728480acb4c980b8aedc..3c968cd8fbb3130da6da83e4ad15b4c3db6ab70b 100644 (file)
@@ -43,6 +43,7 @@
 #include <stdio.h>
 #include <string.h>
 #include "platform.h"
+#include "ti/csl/csl_semAux.h"
 
 #define BOOT_UART_BAUDRATE         115200
 
@@ -64,6 +65,28 @@ void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes)
     }
 }
 
+void Osal_platformSpiCsEnter(void)
+{
+    /* Get the hardware semaphore.
+     *
+     * Acquire Multi core CPPI synchronization lock
+     */
+    while ((CSL_semAcquireDirect (3)) == 0);
+
+    return;
+}
+
+void Osal_platformSpiCsExit (void)
+{
+    /* Release the hardware semaphore
+     *
+     * Release multi-core lock.
+     */
+    CSL_semReleaseSemaphore (3);
+
+    return;
+}
+
 /******************************************************************************
  * Function:    print_platform_errno
  ******************************************************************************/
index d765b5fd3e3f2ff4f4878e04814785db80ae52b4..f4f5815d78f7b10f8a7abb81c9815f850828906d 100644 (file)
@@ -40,6 +40,7 @@
                                                                <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;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6678_INSTALL_DIR}/packages&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">
@@ -64,9 +65,7 @@
                                                                </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.XDC_PATH.1607740639" name="RTSC package repositories (--xdcpath)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH" valueType="stringList"/>
                                                                <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"/>
index db4c5943b96998882fcaa6c1201ebedf1b9c484f..d30a2285c47a1c23643715152985dbe82da49637 100644 (file)
@@ -43,6 +43,7 @@
 #include <stdio.h>
 #include <string.h>
 #include "platform.h"
+#include "ti/csl/csl_semAux.h"
 
 #define DEVICE_REG32_W(x,y)   *(volatile uint32_t *)(x)=(y)
 #define DEVICE_REG32_R(x)    (*(volatile uint32_t *)(x))
@@ -72,6 +73,27 @@ void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes)
     }
 }
 
+void Osal_platformSpiCsEnter(void)
+{
+    /* Get the hardware semaphore.
+     *
+     * Acquire Multi core CPPI synchronization lock
+     */
+    while ((CSL_semAcquireDirect (3)) == 0);
+
+    return;
+}
+
+void Osal_platformSpiCsExit (void)
+{
+    /* Release the hardware semaphore
+     *
+     * Release multi-core lock.
+     */
+    CSL_semReleaseSemaphore (3);
+
+    return;
+}
 
 void
 start_boot
index 0b14885d716d1f4f6466ab458d2041658d8d5f28..525ef78094304a914f1ed8e3f5c33a26804bffe8 100644 (file)
@@ -39,6 +39,7 @@
                                                                <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;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6678_INSTALL_DIR}/packages&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">
@@ -67,9 +68,7 @@
                                                                <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>
+                                                               <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"/>
                                                        </tool>
                                                </toolChain>
                                        </folderInfo>
index bd72c4696e8df96635c922273c80d00ffb099e1c..03428462f17619731f968c37453864f1249f9fae 100644 (file)
@@ -36,6 +36,7 @@
 #include "platform.h"
 #include "srioDdrInit.h"
 #include "srioBootCode.h"
+#include "ti/csl/csl_semAux.h"
 
 #define DEVICE_REG32_W(x,y)   *(volatile uint32_t *)(x)=(y)
 #define DEVICE_REG32_R(x)    (*(volatile uint32_t *)(x))
@@ -105,6 +106,28 @@ uint32_t byteto32bits(uint8_t *pDspCode)
     return(temp);
 }
 
+void Osal_platformSpiCsEnter(void)
+{
+    /* Get the hardware semaphore.
+     *
+     * Acquire Multi core CPPI synchronization lock
+     */
+    while ((CSL_semAcquireDirect (3)) == 0);
+
+    return;
+}
+
+void Osal_platformSpiCsExit (void)
+{
+    /* Release the hardware semaphore
+     *
+     * Release multi-core lock.
+     */
+    CSL_semReleaseSemaphore (3);
+
+    return;
+}
+
 
 /* Convert to big endian, if the .out to be booted is big endian, this is not required */
 void
index 99c67259f77e74d1bd9283adbe78015b20d1af94..23bcf1f0c2c5c6c24b1d982da62b81064225d72f 100644 (file)
@@ -40,6 +40,7 @@
                                                                <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;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6678_INSTALL_DIR}/packages&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">
@@ -64,9 +65,7 @@
                                                                </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.XDC_PATH.1607740639" name="RTSC package repositories (--xdcpath)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH" valueType="stringList"/>
                                                                <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"/>
index 7c4390f921963d79a597fe9afc7f0d10af49b62f..d757e3dcbdb627f4eec53c8fe062559a4fc18403 100644 (file)
@@ -43,6 +43,7 @@
 #include <stdio.h>
 #include <string.h>
 #include "platform.h"
+#include "ti/csl/csl_semAux.h"
 
 #define DEVICE_REG32_W(x,y)   *(volatile uint32_t *)(x)=(y)
 #define DEVICE_REG32_R(x)    (*(volatile uint32_t *)(x))
@@ -85,6 +86,28 @@ void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes)
     }
 }
 
+void Osal_platformSpiCsEnter(void)
+{
+    /* Get the hardware semaphore.
+     *
+     * Acquire Multi core CPPI synchronization lock
+     */
+    while ((CSL_semAcquireDirect (3)) == 0);
+
+    return;
+}
+
+void Osal_platformSpiCsExit (void)
+{
+    /* Release the hardware semaphore
+     *
+     * Release multi-core lock.
+     */
+    CSL_semReleaseSemaphore (3);
+
+    return;
+}
+
 /******************************************************************************
  * Function:    write_uart
  ******************************************************************************/
index c2703189d9893bf7a53fa8e6e120e2900b17ac9c..7838f2c2160f161e6f887d3cc61806f7a20501dc 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="Release">
                                <externalSettings/>
@@ -39,6 +39,7 @@
                                                                <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_C6670_INSTALL_DIR}/packages/ti/platform&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6670_INSTALL_DIR}/packages/&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROJECT_ROOT}/../include&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"/>
@@ -72,9 +73,7 @@
                                                                <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.evm6670" 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_C6670_INSTALL_DIR}/packages&quot;"/>
-                                                               </option>
+                                                               <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"/>
                                                        </tool>
                                                </toolChain>
                                        </folderInfo>
index 7049ef3866fd7f5272f44ea342f31ee9b8963075..90c81c6d0bd9d6d6e73691a8f92b440e13b665a3 100644 (file)
@@ -18,34 +18,6 @@ section
   exe_file = "post.i2c.ccs"
 }
 
-; The layout statement defines how the resulting I2C image is layed out. The base address
-; of this (given in the dev_addr) statement must be known to the initial IBL program
-; at compile time. The layout block is simple a group of 32 bit i2c addresses, so 
-; the order of the exe_file and pad_file_id statements must be configured so as to
-; match the definition of struct iblI2cMap_t defined in ibl.h.
-layout
-{
-  dev_addr     = 0x420         ; Defined in iblcfg.h
-  dev_addr_ext = 0x50
-  file_align   = 0x80
-
-  exe_file    = ""
-  pad_file_id = 1
-
-
-  exe_file    = ""
-  pad_file_id = 1
-}
-
-; The pad statements simply provide space for the IBL configuration structures. It is valid to
-; have a single configuration structure which is used for both endian values.
-pad
-{
-  pad_file_id  = 1
-  dev_addr     = 0x500
-  dev_addr_ext = 0x50
-  len          = 0x300
-}
 
 
 
index 9431382698ff285afe139828403111337b422b43..9b142c8b67e1c20b3eb2a94c01a4d67c2a96434c 100644 (file)
@@ -45,17 +45,22 @@ MEMORY
     L1PSRAM (RWX)  : org = 0x0E00000, len = 0x7FFF
     L1DSRAM (RWX)  : org = 0x0F00000, len = 0x7FFF 
 
-    L2SRAM (RWX)   : org = 0x0820000, len = 0xe0000
+    L2SRAM (RWX)   : org = 0x0830000, len = 0x50000
     MSMCSRAM (RWX) : org = 0xc000000, len = 0x200000
     DDR3 (RWX)     : org = 0x80000000,len = 0x10000000
+       LINKRAM   :  origin =  0x10820000, length = 0x0200
+       CPPIRAM   :  origin =  0x10820200, length = 0x0200
+       PKTRAM    :  origin =  0x10820400, length = 0x0800
 }
 
+       
 SECTIONS
 {
     .csl_vect   >       L2SRAM
-    .cppi       >       L2SRAM
-    .linkram    >       L2SRAM
-    .mac_buffer >       L2SRAM
+    .cppi       >       CPPIRAM
+    .qmss       >       L2SRAM
+    .linkram    >       LINKRAM
+    .mac_buffer >       PKTRAM
     .version    >       L2SRAM
     platform_lib>       L2SRAM
     .text       >       L2SRAM
index 9d9dde1264ef949e3661ccb8d7ce33980d6732dc..230ca6d55e865455092b49c62b44a91a82a7b12a 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="Release">
                                <externalSettings/>
@@ -39,6 +39,7 @@
                                                                <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;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6678_INSTALL_DIR}/packages/&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROJECT_ROOT}/../include&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.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/post_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/post_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;libc.a&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;ti.platform.evm6678l.lite.lib&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>
@@ -72,9 +72,7 @@
                                                                <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>
+                                                               <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"/>
                                                        </tool>
                                                </toolChain>
                                        </folderInfo>
@@ -83,6 +81,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">
index 7049ef3866fd7f5272f44ea342f31ee9b8963075..90c81c6d0bd9d6d6e73691a8f92b440e13b665a3 100644 (file)
@@ -18,34 +18,6 @@ section
   exe_file = "post.i2c.ccs"
 }
 
-; The layout statement defines how the resulting I2C image is layed out. The base address
-; of this (given in the dev_addr) statement must be known to the initial IBL program
-; at compile time. The layout block is simple a group of 32 bit i2c addresses, so 
-; the order of the exe_file and pad_file_id statements must be configured so as to
-; match the definition of struct iblI2cMap_t defined in ibl.h.
-layout
-{
-  dev_addr     = 0x420         ; Defined in iblcfg.h
-  dev_addr_ext = 0x50
-  file_align   = 0x80
-
-  exe_file    = ""
-  pad_file_id = 1
-
-
-  exe_file    = ""
-  pad_file_id = 1
-}
-
-; The pad statements simply provide space for the IBL configuration structures. It is valid to
-; have a single configuration structure which is used for both endian values.
-pad
-{
-  pad_file_id  = 1
-  dev_addr     = 0x500
-  dev_addr_ext = 0x50
-  len          = 0x300
-}
 
 
 
index 9431382698ff285afe139828403111337b422b43..9b142c8b67e1c20b3eb2a94c01a4d67c2a96434c 100644 (file)
@@ -45,17 +45,22 @@ MEMORY
     L1PSRAM (RWX)  : org = 0x0E00000, len = 0x7FFF
     L1DSRAM (RWX)  : org = 0x0F00000, len = 0x7FFF 
 
-    L2SRAM (RWX)   : org = 0x0820000, len = 0xe0000
+    L2SRAM (RWX)   : org = 0x0830000, len = 0x50000
     MSMCSRAM (RWX) : org = 0xc000000, len = 0x200000
     DDR3 (RWX)     : org = 0x80000000,len = 0x10000000
+       LINKRAM   :  origin =  0x10820000, length = 0x0200
+       CPPIRAM   :  origin =  0x10820200, length = 0x0200
+       PKTRAM    :  origin =  0x10820400, length = 0x0800
 }
 
+       
 SECTIONS
 {
     .csl_vect   >       L2SRAM
-    .cppi       >       L2SRAM
-    .linkram    >       L2SRAM
-    .mac_buffer >       L2SRAM
+    .cppi       >       CPPIRAM
+    .qmss       >       L2SRAM
+    .linkram    >       LINKRAM
+    .mac_buffer >       PKTRAM
     .version    >       L2SRAM
     platform_lib>       L2SRAM
     .text       >       L2SRAM
diff --git a/post/include/cpdma_api.h b/post/include/cpdma_api.h
new file mode 100644 (file)
index 0000000..8575fd6
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef _CPDMA_API_H
+#define _CPDMA_API_H
+/********************************************************************************************************
+ * FILE PURPOSE: Provide the cpdma API
+ ********************************************************************************************************
+ * FILE NAME: cpdma_api.h
+ *
+ * DESCRIPTION: The public API is defined
+ *
+ ********************************************************************************************************/
+
+
+typedef struct cpdmaRxCfg_s  {
+
+    uint32_t  rxBase;             /* Base address of rx registers */
+    uint32_t  nRxChans;           /* The number of rx channels */
+    uint32_t  flowBase;           /* Add address of flow registers */
+    uint32_t  nRxFlows;           /* Number of rx flows */
+    uint32_t  qmNumFreeBuf;       /* Queue manager for descriptors/buffers for received packets */
+    uint32_t  queueFreeBuf;       /* Queue that holds descriptors/buffers for received packets */
+    uint32_t  qmNumRx;            /* Queue manager for received packets */
+    uint32_t  queueRx;            /* Default Rx queue for received packets */
+    uint32_t  tdownPollCount;     /* Number of loop iterations to wait for teardown */
+    
+} cpdmaRxCfg_t; 
+
+
+typedef struct cpdmaTxCfg_s  {
+
+    uint32_t gblCtlBase;          /* Base address of global control registers */
+    uint32_t txBase;              /* Base address of the tx registers */
+    uint32_t nTxChans;            /* The number of tx channels */
+    
+} cpdmaTxCfg_t;
+    
+
+/* Prototypes */
+int16_t hwCpdmaRxDisable (const cpdmaRxCfg_t *cfg);
+int16_t hwCpdmaRxConfig (const cpdmaRxCfg_t *cfg);
+int16_t hwCpdmaTxConfig (const cpdmaTxCfg_t *cfg);
+int16_t hwCpdmaTxDisable (const cpdmaTxCfg_t *cfg);
+
+#endif /* _CPDMA_API_H */
diff --git a/post/include/cpdma_loc.h b/post/include/cpdma_loc.h
new file mode 100644 (file)
index 0000000..49d78cb
--- /dev/null
@@ -0,0 +1,110 @@
+#ifndef _CPDMA_LOC_H
+#define _CPDMA_LOC_H
+/**************************************************************************************************
+ * FILE PURPOSE: Local description of the CPDMA
+ **************************************************************************************************
+ * FILE NAME: cpdma_loc.h
+ *
+ * DESCRIPTION: Defines the layout of the cpdma peripheral
+ *
+ **************************************************************************************************/
+
+/* Emulation control register */
+#define CPDMA_REG_EMU_CTL   0x08
+
+/* CPPI Tx DMA channel control registers */
+#define CPDMA_REG_TCHAN_CFG_REG_A(x)   (0x00 + (x)*0x20)
+#define CPDMA_REG_TCHAN_CFG_REG_B(x)   (0x04 + (x)*0x20)
+
+
+/* CPPI Rx DMA channel control register */
+#define CPDMA_REG_RCHAN_CFG_REG_A(x)    (0x00 + (x)*0x20)
+
+/* CPPI Tx DMA Scheduler Configuration register */
+#define CPDMA_REG_TCHAN_SCHED_CFG(x)    ((x)*0x04)
+
+/* CPPI Rx DMA flow configuration registers */
+#define CPDMA_RX_FLOW_CFG(reg,idx)      ( ((reg)*4) + ((idx)*0x20) )
+#define CPDMA_RX_FLOW_REG_A     0
+#define CPDMA_RX_FLOW_REG_B     1
+#define CPDMA_RX_FLOW_REG_C     2
+#define CPDMA_RX_FLOW_REG_D     3
+#define CPDMA_RX_FLOW_REG_E     4
+#define CPDMA_RX_FLOW_REG_F     5
+#define CPDMA_RX_FLOW_REG_G     6
+#define CPDMA_RX_FLOW_REG_H     7
+
+/* Descriptor type created by flows */
+#define CPDMA_DESC_TYPE_HOST    1
+
+
+/* CPPI Tx DMA channel control register A definitions */
+#define CPDMA_REG_VAL_TCHAN_A_TX_ENABLE ((uint32_t)1 << 31)
+#define CPDMA_REG_VAL_TCHAN_A_TX_TDOWN  (1 << 30)
+
+/* CPPI Tx DMA channel control register B definitions */
+#define CPDMA_REG_VAL_TCHAN_B_TX_FILT_EINFO   (1 << 30)
+#define CPDMA_REG_VAL_TCHAN_B_TX_FILT_PSWORDS (1 << 29)
+#define CPDMA_REG_TCHAN_B_SET_DEFAULT_TDOWN_QMGR(x,v)  (x) = (BOOT_SET_BITFIELD((x), (v), 13, 12)
+#define CPDMA_REG_TCHAN_B_SET_DEFAULT_TDOWN_QNUM(x,v)  (x) = (BOOT_SET_BITFIELD((x), (v), 11,  0)
+
+
+/* CPPI Rx DMA channel control register A definitions */
+#define CPDMA_REG_VAL_RCHAN_A_RX_ENABLE ((uint32_t)1 << 31)
+#define CPDMA_REG_VAL_RCHAN_A_RX_TDOWN  (1 << 30)
+
+/* CPPI Tx DMA Scheduler Confuration value. This sets the priorities of
+ * the channels. If set to all equal, the actual value doesn't matter */
+#define CPDMA_REG_VAL_TCHAN_SCHED_HIGH_PRIORITY         0
+#define CPDMA_REG_VAL_TCHAN_SCHED_MED_HIGH_PRIORITY     1
+#define CPDMA_REG_VAL_TCHAN_SCHED_MED_LOW_PRIORITY      2
+#define CPDMA_REG_VAL_TCHAN_SCHED_LOW_PRIORITY          3
+
+
+/* A very simply flow configuration is supported. No queue allocation by bins is supported */
+
+/* CPPI Rx flow configuration register A */
+#define CPDMA_REG_VAL_MAKE_RX_FLOW_A(einfo,psinfo,rxerr,desc,psloc,sopOff,qmgr,qnum)  \
+        (   ((einfo & 1) << 30)       |   \
+            ((psinfo & 1) << 29)      |   \
+            ((rxerr & 1) << 28)       |   \
+            ((desc & 3) << 26)        |   \
+            ((psloc & 1) << 25)       |   \
+            ((sopOff & 0x1ff) << 16)  |   \
+            ((qmgr & 3) << 12)        |   \
+            ((qnum & 0xfff) << 0)     )
+
+/* CPPI Rx flow configuration register B. No tags are used */
+#define CPDMA_REG_VAL_RX_FLOW_B_DEFAULT     0
+
+
+/* CPPI Rx flow configuration register C. No tag replacement and no size thresholds */
+#define CPDMA_REG_VAL_RX_FLOW_C_DEFAULT     0
+
+/* CPPI Rx flow configuration register D */
+#define CPDMA_REG_VAL_MAKE_RX_FLOW_D(fd0Qm, fd0Qnum, fd1Qm, fd1Qnum)   \
+        (   ((fd0Qm & 3) << 28)         |   \
+            ((fd0Qnum & 0xfff) << 16)   |   \
+            ((fd1Qm & 3) << 12)         |   \
+            ((fd1Qnum & 0xfff) <<  0)   )
+
+/* CPPI Rx flow configuration register E */
+#define CPDMA_REG_VAL_RX_FLOW_E_DEFAULT     0
+
+/* CPPI Rx flow configuration register F */
+#define CPDMA_REG_VAL_RX_FLOW_F_DEFAULT     0
+
+/* CPPI Rx flow configuration register G */
+#define CPDMA_REG_VAL_RX_FLOW_G_DEFAULT     0
+
+/* CPPI Rx flow configuration register H */
+#define CPDMA_REG_VAL_RX_FLOW_H_DEFAULT     0
+
+/* Default Emulation control register value disables loopback */
+#define CPDMA_REG_VAL_EMU_CTL_NO_LOOPBACK   0
+
+
+#endif /* _CPDMA_LOC_H */
+
+
+
diff --git a/post/include/cpmac_regs.h b/post/include/cpmac_regs.h
new file mode 100644 (file)
index 0000000..624d005
--- /dev/null
@@ -0,0 +1,204 @@
+/**
+ *   @file  cpmac_regs.h
+ *
+ *   @brief   
+ *      This file contains the Register Desciptions for EMAC
+ *
+ *  \par
+ *  NOTE:
+ *      (C) Copyright 2008, Texas Instruments, Inc.
+ * 
+ *  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.
+ *
+ *  \par
+*/
+
+#ifndef __CPMAC_REGS_H__
+#define __CPMAC_REGS_H__
+
+/**
+ * @brief 
+ *  The structure describes the CPMAC Register Overlay.
+ *
+ * @details
+ *  This is the CPMAC Register overlay data structure which is used
+ *  by the CPMAC Driver.
+ */
+typedef struct CPMAC_REGS
+{
+    volatile uint32_t TXIDVER;
+    volatile uint32_t TXCONTROL;
+    volatile uint32_t TXTEARDOWN;
+    volatile uint8_t  RSVD0[4];
+    volatile uint32_t RXIDVER;
+    volatile uint32_t RXCONTROL;
+    volatile uint32_t RXTEARDOWN;
+    volatile uint8_t  RSVD1[100];
+    volatile uint32_t TXINTSTATRAW;
+    volatile uint32_t TXINTSTATMASKED;
+    volatile uint32_t TXINTMASKSET;
+    volatile uint32_t TXINTMASKCLEAR;
+    volatile uint32_t MACINVECTOR;
+    volatile uint8_t  RSVD2[12];
+    volatile uint32_t RXINTSTATRAW;
+    volatile uint32_t RXINTSTATMASKED;
+    volatile uint32_t RXINTMASKSET;
+    volatile uint32_t RXINTMASKCLEAR;
+    volatile uint32_t MACINTSTATRAW;
+    volatile uint32_t MACINTSTATMASKED;
+    volatile uint32_t MACINTMASKSET;
+    volatile uint32_t MACINTMASKCLEAR;
+    volatile uint8_t  RSVD3[64];
+    volatile uint32_t RXMBPENABLE;
+    volatile uint32_t RXUNICASTSET;
+    volatile uint32_t RXUNICASTCLEAR;
+    volatile uint32_t RXMAXLEN;
+    volatile uint32_t RXBUFFEROFFSET;
+    volatile uint32_t RXFILTERLOWTHRESH;
+    volatile uint8_t  RSVD4[8];
+    volatile uint32_t RX0FLOWTHRESH;
+    volatile uint32_t RX1FLOWTHRESH;
+    volatile uint32_t RX2FLOWTHRESH;
+    volatile uint32_t RX3FLOWTHRESH;
+    volatile uint32_t RX4FLOWTHRESH;
+    volatile uint32_t RX5FLOWTHRESH;
+    volatile uint32_t RX6FLOWTHRESH;
+    volatile uint32_t RX7FLOWTHRESH;
+    volatile uint32_t RX0FREEBUFFER;
+    volatile uint32_t RX1FREEBUFFER;
+    volatile uint32_t RX2FREEBUFFER;
+    volatile uint32_t RX3FREEBUFFER;
+    volatile uint32_t RX4FREEBUFFER;
+    volatile uint32_t RX5FREEBUFFER;
+    volatile uint32_t RX6FREEBUFFER;
+    volatile uint32_t RX7FREEBUFFER;
+    volatile uint32_t MACCONTROL;
+    volatile uint32_t MACSTATUS;
+    volatile uint32_t EMCONTROL;
+    volatile uint32_t FIFOCONTROL;
+    volatile uint32_t MACCONFIG;
+    volatile uint32_t SOFTRESET;
+    volatile uint8_t  RSVD5[88];
+    volatile uint32_t MACSRCADDRLO;
+    volatile uint32_t MACSRCADDRHI;
+    volatile uint32_t MACHASH1;
+    volatile uint32_t MACHASH2;
+    volatile uint32_t BOFFTEST;
+    volatile uint32_t TPACETEST;
+    volatile uint32_t RXPAUSE;
+    volatile uint32_t TXPAUSE;
+    volatile uint8_t  RSVD6[16];
+    volatile uint32_t RXGOODFRAMES;
+    volatile uint32_t RXBCASTFRAMES;
+    volatile uint32_t RXMCASTFRAMES;
+    volatile uint32_t RXPAUSEFRAMES;
+    volatile uint32_t RXCRCERRORS;
+    volatile uint32_t RXALIGNCODEERRORS;
+    volatile uint32_t RXOVERSIZED;
+    volatile uint32_t RXJABBER;
+    volatile uint32_t RXUNDERSIZED;
+    volatile uint32_t RXFRAGMENTS;
+    volatile uint32_t RXFILTERED;
+    volatile uint32_t RXQOSFILTERED;
+    volatile uint32_t RXOCTETS;
+    volatile uint32_t TXGOODFRAMES;
+    volatile uint32_t TXBCASTFRAMES;
+    volatile uint32_t TXMCASTFRAMES;
+    volatile uint32_t TXPAUSEFRAMES;
+    volatile uint32_t TXDEFERRED;
+    volatile uint32_t TXCOLLISION;
+    volatile uint32_t TXSINGLECOLL;
+    volatile uint32_t TXMULTICOLL;
+    volatile uint32_t TXEXCESSIVECOLL;
+    volatile uint32_t TXLATECOLL;
+    volatile uint32_t TXUNDERRUN;
+    volatile uint32_t TXCARRIERSENSE;
+    volatile uint32_t TXOCTETS;
+    volatile uint32_t FRAME64;
+    volatile uint32_t FRAME65T127;
+    volatile uint32_t FRAME128T255;
+    volatile uint32_t FRAME256T511;
+    volatile uint32_t FRAME512T1023;
+    volatile uint32_t FRAME1024TUP;
+    volatile uint32_t NETOCTETS;
+    volatile uint32_t RXSOFOVERRUNS;
+    volatile uint32_t RXMOFOVERRUNS;
+    volatile uint32_t RXDMAOVERRUNS;
+    volatile uint8_t  RSVD7[624];
+    volatile uint32_t MACADDRLO;
+    volatile uint32_t MACADDRHI;
+    volatile uint32_t MACINDEX;
+    volatile uint8_t  RSVD8[244];
+    volatile uint32_t TX0HDP;
+    volatile uint32_t TX1HDP;
+    volatile uint32_t TX2HDP;
+    volatile uint32_t TX3HDP;
+    volatile uint32_t TX4HDP;
+    volatile uint32_t TX5HDP;
+    volatile uint32_t TX6HDP;
+    volatile uint32_t TX7HDP;
+    volatile uint32_t RX0HDP;
+    volatile uint32_t RX1HDP;
+    volatile uint32_t RX2HDP;
+    volatile uint32_t RX3HDP;
+    volatile uint32_t RX4HDP;
+    volatile uint32_t RX5HDP;
+    volatile uint32_t RX6HDP;
+    volatile uint32_t RX7HDP;
+    volatile uint32_t TX0CP;
+    volatile uint32_t TX1CP;
+    volatile uint32_t TX2CP;
+    volatile uint32_t TX3CP;
+    volatile uint32_t TX4CP;
+    volatile uint32_t TX5CP;
+    volatile uint32_t TX6CP;
+    volatile uint32_t TX7CP;
+    volatile uint32_t RX0CP;
+    volatile uint32_t RX1CP;
+    volatile uint32_t RX2CP;
+    volatile uint32_t RX3CP;
+    volatile uint32_t RX4CP;
+    volatile uint32_t RX5CP;
+    volatile uint32_t RX6CP;
+    volatile uint32_t RX7CP;
+}CPMAC_REGS;
+
+/* MACADDRLO: Bit Mask Definitions. */
+#define CPMAC_MACADDRLO_VALID           (0x00100000u)
+#define CPMAC_MACADDRLO_MATCHFILT       (0x00080000u)
+
+/* MACCONTROL: Bit Mask Definitions. */
+#define CPMAC_MACCONTROL_RXOWNERSHIP    (0x00002000u)
+#define CPMAC_MACCONTROL_RXOFFLENBLOCK  (0x00004000u)
+#define CPMAC_MACCONTROL_MIIEN          (0x00000020u)
+
+/* RXMBP Enable: Bit Mask Definitions.  */
+#define CPMAC_RXMBPENABLE_RXBROADEN     (0x00002000u)
+
+#endif /* __CPMAC_REGS_H__ */
diff --git a/post/include/cpmacdrv.h b/post/include/cpmacdrv.h
new file mode 100644 (file)
index 0000000..432251b
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ *
+ * Copyright (C) 2010 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 cpmacdrv.h
+ *
+ *  @brief
+ *    Describes the common API wrapper for all ethernet devices
+ *
+ */
+#ifndef CPMACDRV_H
+#define CPMACDRV_H
+#include "types.h"
+#include "net.h"
+
+
+int32_t cpmac_drv_start (NET_DRV_DEVICE* ptr_device);
+int32_t cpmac_drv_send (NET_DRV_DEVICE* ptr_device, uint8_t* buffer, int32_t num_bytes);
+int32_t cpmac_drv_receive (NET_DRV_DEVICE* ptr_device, uint8_t* buffer);
+int32_t cpmac_drv_stop (NET_DRV_DEVICE* ptr_device);
+
+
+
+#endif /* CPMACDRV_H */
+
+
+
+
+
+
diff --git a/post/include/gmacsl_api.h b/post/include/gmacsl_api.h
new file mode 100644 (file)
index 0000000..8835163
--- /dev/null
@@ -0,0 +1,64 @@
+#ifndef _GMACSL_API_H
+#define _GMACSL_API_H
+/*******************************************************************************************
+ * FILE PURPOSE: Mac sliver API
+ *******************************************************************************************
+ * FILE NAME: gmacsl_api.h
+ *
+ * DESCRIPTION: Defines the API for control of the CPGMAC sliver
+ *
+ *******************************************************************************************/
+/*******************************************************************************************
+ * Definition: The cpgmac sliver configuration structure
+ *******************************************************************************************/
+typedef struct hwGmacSlCfg_s  {
+
+    uint32_t maxRxLen;    /* Maximum receive packet length. */
+    
+    uint32_t ctl;         /* Control bitfield */
+    
+} hwGmacSlCfg_t;
+
+
+/*******************************************************************************************
+ * Definition: Control bitfields used in the ctl field of hwGmacSlCfg_t
+ *******************************************************************************************/
+#define GMACSL_RX_ENABLE_RCV_CONTROL_FRAMES       (1 << 24)
+#define GMACSL_RX_ENABLE_RCV_SHORT_FRAMES         (1 << 23)
+#define GMACSL_RX_ENABLE_RCV_ERROR_FRAMES         (1 << 22)
+#define GMACSL_RX_ENABLE_EXT_CTL                  (1 << 18)  /* duplex and gig read from input pins */
+#define GMACSL_RX_ENABLE_GIG_FORCE                (1 << 17)
+#define GMACSL_RX_ENABLE_IFCTL_B                  (1 << 16)
+#define GMACSL_RX_ENABLE_IFCTL_A                  (1 << 15)
+#define GMACSL_RX_ENABLE_CMD_IDLE                 (1 << 11)
+#define GMACSL_TX_ENABLE_SHORT_GAP                (1 << 10)
+#define GMACSL_ENABLE_GIG_MODE                    (1 <<  7)
+#define GMACSL_TX_ENABLE_PACE                     (1 <<  6)
+#define GMACSL_ENABLE                             (1 <<  5)
+#define GMACSL_TX_ENABLE_FLOW_CTL                 (1 <<  4)
+#define GMACSL_RX_ENABLE_FLOW_CTL                 (1 <<  3)
+#define GMACSL_ENABLE_LOOPBACK                    (1 <<  1)
+#define GMACSL_ENABLE_FULL_DUPLEX                 (1 <<  0)
+
+
+/********************************************************************************************
+ * DEFINTITION: function return values
+ ********************************************************************************************/
+#define GMACSL_RET_OK                        0
+#define GMACSL_RET_INVALID_PORT             -1
+#define GMACSL_RET_WARN_RESET_INCOMPLETE    -2
+#define GMACSL_RET_WARN_MAXLEN_TOO_BIG      -3
+#define GMACSL_RET_CONFIG_FAIL_RESET_ACTIVE -4
+
+
+int16_t hwGmacSlReset (uint16_t port);
+int16_t hwGmacSlConfig (uint16_t port, hwGmacSlCfg_t *cfg);
+
+
+
+
+
+#endif /* _GMACSL_API_H */
+
+
diff --git a/post/include/gmacsl_loc.h b/post/include/gmacsl_loc.h
new file mode 100644 (file)
index 0000000..9fef685
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef _GMACSL_LOC_H
+#define _GMACSL_LOC_H
+/*****************************************************************************************
+ * FILE PURPOSE: Local definitions for the cpgmac sliver
+ *****************************************************************************************
+ * FILE NAME: gmacsl_loc.h
+ *
+ * DESCRIPTION: Defines the peripheral registers used to configure the cpgmac sliver
+ *
+ ******************************************************************************************/
+
+/* Register offsets */
+#define CPGMACSL_REG_ID         0x00
+#define CPGMACSL_REG_CTL        0x04
+#define CPGMACSL_REG_STATUS     0x08
+#define CPGMACSL_REG_RESET      0x0c
+#define CPGMACSL_REG_MAXLEN     0x10
+#define CPGMACSL_REG_BOFF       0x14
+#define CPGMACSL_REG_RX_PAUSE   0x18
+#define CPGMACSL_REG_TX_PAURSE  0x1c
+#define CPGMACSL_REG_EM_CTL     0x20
+#define CPGMACSL_REG_PRI        0x24
+
+
+/* Soft reset register values */
+#define CPGMAC_REG_RESET_VAL_RESET_MASK      (1 << 0)
+#define CPGMAC_REG_RESET_VAL_RESET           (1 << 0)
+
+/* Maxlen register values */
+#define CPGMAC_REG_MAXLEN_LEN                0x3fff
+
+
+
+
+#endif /* _GMACSL_LOC_H */
+
diff --git a/post/include/hwpafw_bin.h b/post/include/hwpafw_bin.h
new file mode 100644 (file)
index 0000000..c4a1ef9
--- /dev/null
@@ -0,0 +1,65 @@
+
+
+/* This file contains the PDSP instructions in a C array which are to  */
+/* be downloaded from the host CPU to the PDSP instruction memory.     */
+/* This file is generated by the PDSP assembler.                       */
+
+const unsigned int PDSPcode[] =  {
+     0x2eff9196,
+     0x85002096,
+     0x0101f6f6,
+     0x81002496,
+     0xcf04fffe,
+     0x2e808f86,
+     0x240cecc2,
+     0x2411e082,
+     0x68e2ec05,
+     0x59108926,
+     0x24002104,
+     0x2f000384,
+     0x21000200,
+     0x0101f7f7,
+     0x81042497,
+     0x24000c04,
+     0x2f000384,
+     0x2e808f86,
+     0x24000004,
+     0x240020c4,
+     0x2f000384,
+     0x2e808f8e,
+     0x68e6fb04,
+     0x68c7dc03,
+     0x0101f8f8,
+     0x21002400,
+     0x68e6fd04,
+     0x68c7de03,
+     0x0101f9f9,
+     0x21002400,
+     0x0101fafa,
+     0x810c249a,
+     0x24002104,
+     0x2f000384,
+     0x8700e286,
+     0x21000200,
+     0x00f9f8e1,
+     0x81082481,
+     0x24002004,
+     0x24000644,
+     0x24000064,
+     0x109e9ec5,
+     0x2400b024,
+     0x24000005,
+     0x2f000384,
+     0x8700e186,
+     0x21000200,
+     0x24000c04,
+     0x2f000384,
+     0x2e80878e,
+     0x10eeeefb,
+     0x10efeffc,
+     0x10f0f0fd,
+     0x10f1f1fe,
+     0x24002104,
+     0x2f000384,
+     0x21000200 };
+
diff --git a/post/include/hwpafwsw.h b/post/include/hwpafwsw.h
new file mode 100644 (file)
index 0000000..f413bc4
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef _HWPAFWSW_H
+#define _HWPAFWSW_H
+
+#ifdef _GIBERISH___
+ ****************************************************************************************
+ * FILE PURPOSE: Definitions common between PA firmware and GEM software
+ ****************************************************************************************
+ * FILE NAME: hwpafwsw.h
+ *
+ * DESCRIPTION: Contains definitions used by both the PA firmware and GEM software
+ ****************************************************************************************
+#endif
+
+#define PA_MAGIC_ID  0x0CEC11E0
+
+#endif
+
+
+
+
+
+
diff --git a/post/include/net.h b/post/include/net.h
new file mode 100644 (file)
index 0000000..9d9959b
--- /dev/null
@@ -0,0 +1,69 @@
+/**
+ *   @file  net.h
+ *
+ *   @brief   
+ *      The file has data structures and API definitions for the
+ *      NET Boot Module 
+ *
+ *  \par
+ *  NOTE:
+ *      (C) Copyright 2008, Texas Instruments, Inc.
+ * 
+ *  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.
+ *
+ *  \par
+*/
+#ifndef __NET_H__
+#define __NET_H__
+
+/**
+ * @brief 
+ *  The structure describes the Network Device Configuration.
+ *
+ * @details
+ *  This structures stores configuration data which is used populated
+ *  by the Device layer and passed to the network boot module.
+ */
+typedef struct NET_DRV_DEVICE
+{
+    /**
+     * @brief  The physical port number to use
+     */
+    uint32_t  port_num;
+    
+    /**
+     * @brief   This is the MAC Address which is populated by the device
+     * team. All packets sent by the NET module will use this MAC Address.
+     */
+    uint8_t   mac_address[6];
+    
+}NET_DRV_DEVICE;
+
+
+#endif /* __NET_H__ */
diff --git a/post/include/pa_api.h b/post/include/pa_api.h
new file mode 100644 (file)
index 0000000..55e0974
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef _PA_API_H
+#define _PA_API_H
+/*****************************************************************************************************
+ * FILE PURPOSE: Define the Packet Accelerator API 
+ *****************************************************************************************************
+ * FILE NAME: pa_api.h
+ *
+ * DESCRIPTION: The boot loader driver API to the packet accelerator is defined
+ *
+ *****************************************************************************************************/
+typedef struct paConfig_s  {
+
+    uint32_t  mac0ms;     /* 32 most significant bits of the mac address */
+    uint32_t  mac0ls;     /* 32 least significant bits of the mac address, in the 16msbs of this word */
+    uint32_t  mac1ms;     /* 32 most significant bits of the mac address */
+    uint32_t  mac1ls;     /* 32 least significant bits of the mac address, in the 16 msbs of this word */
+    uint32_t  rxQnum;     /* Receive packet queue number */
+    uint8_t   *cmdBuf;    /* Buffer used to create PA command */
+
+} paConfig_t;
+
+/* API */
+int16_t hwPaEnable (const paConfig_t *cfg);
+int16_t hwPaDisable (void);
+
+#include "hwpafwsw.h"
+
+
+
+#endif /* _PA_API_H */
+
diff --git a/post/include/pa_loc.h b/post/include/pa_loc.h
new file mode 100644 (file)
index 0000000..9e19fe3
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef _PA_LOC_H
+#define _PA_LOC_H
+/******************************************************************************************
+ * FILE PURPOSE: Provide local Packet Accelerator definitions
+ ******************************************************************************************
+ * FILE NAME: pa_loc.h
+ *
+ * DESCRIPTION: Defines the packet accelerator sub-system and hardware interface
+ *
+ ******************************************************************************************/
+
+
+#define PA_REG_MAILBOX_SLOT(pdsp, slot)                (0x00 + ((pdsp)*0x10) + ((slot)*0x04))
+#define PA_REG_PDSP_CTL(pdsp)               (0x1000 + ((pdsp)*0x100))
+#define PA_MEM_PDSP_IRAM(pdsp)                         (0x10000 + ((pdsp)*0x8000))
+
+
+/* The pdsp control register */
+#define PA_REG_VAL_PDSP_CTL_ENABLE_PDSP(pcVal)   (((pcVal) << 16) | 0x3)
+#define PA_REG_VAL_PDSP_CTL_DISABLE_PDSP         0
+
+/* Number of mailbox slots for each PDPS */
+#define PA_NUM_MAILBOX_SLOTS                4
+
+
+
+
+#endif /* _PA_LOC_H */
+
index 1f715a47b4e594fc38727c4450c5eacfe9bd84b0..e2cb67bb34129069ee12d853b904dff254b5b47c 100644 (file)
@@ -35,7 +35,7 @@
  * POST version definitions
  ******************************************************************************/
 #define POST_EVM_VERSION_MSG        " POST Version "
-#define POST_VERSION                "01.00.00.02"
+#define POST_VERSION                "01.00.00.03"
 
 /******************************************************************************
  * PLL Controller Reset Type Status register
@@ -62,6 +62,13 @@ typedef enum
     POST_LED_BLINK              /* LED is blinking */
 } POST_LED_STATE;
 
+typedef enum
+{
+    POST_TEST_RESULT_STARTED = 0,   /* POST Test Result Started */
+    POST_TEST_RESULT_PASSED,        /* POST Test Result Passed */
+    POST_TEST_RESULT_FAILED         /* POST Test Result Failed */
+} POST_TEST_RESULT;
+
 typedef enum
 {
     POST_TEST_IN_PROGRESS = 0,      /* POST running in progress */
@@ -76,6 +83,7 @@ typedef enum
     POST_TEST_NAND_INIT,            /* POST NAND initialization */
     POST_TEST_NOR_INIT,             /* POST NOR initialization  */
     POST_TEST_GENERAL,              /* POST test general */
+    POST_TEST_EMAC_LOOPBACK,        /* POST test PA Loopback */
     POST_MAX_TEST_NUM               /* Maximum number of POST LED tests */
 } POST_TEST_ID;
 
@@ -93,7 +101,8 @@ static uint8_t post_led_status[POST_MAX_TEST_NUM][POST_MAX_NUM_LED] =
     {POST_LED_OFF, POST_LED_OFF, POST_LED_BLINK, POST_LED_BLINK},   /* POST PLL initialization failed */
     {POST_LED_BLINK, POST_LED_BLINK, POST_LED_BLINK, POST_LED_OFF}, /* POST NAND initialization failed */
     {POST_LED_OFF, POST_LED_BLINK, POST_LED_BLINK, POST_LED_BLINK}, /* POST NOR initialization failed */
-    {POST_LED_BLINK, POST_LED_BLINK, POST_LED_BLINK, POST_LED_BLINK} /* POST general failure */
+    {POST_LED_BLINK, POST_LED_BLINK, POST_LED_BLINK, POST_LED_BLINK}, /* POST general failure */
+    {POST_LED_ON, POST_LED_BLINK, POST_LED_BLINK, POST_LED_BLINK}   /* POST PA loopback failure */
 };
 
 #define POST_STATUS_MAX_NUM_CHAR            25      /* Maximum char length of the POST status string */
@@ -116,6 +125,7 @@ static char post_status[POST_MAX_TEST_NUM][POST_STATUS_MAX_NUM_CHAR] =
     "NAND initialization",
     "NOR initialization",
     "general ",
+    "EMAC loopback ",
 };
 
 #define POST_LED_BLINK_DELAY    500000  /* 500,000 usec blinking delay */
@@ -158,3 +168,8 @@ static char post_status[POST_MAX_TEST_NUM][POST_STATUS_MAX_NUM_CHAR] =
 #define POST_MAX_SN_SIZE       10          /* Maximum number of the chars of Serial Number for the EVM */
 #define POST_SERIAL_NUM_ADDR   (65536-128) /* Last 128 bytes of EEPROM 0x50 stores the S/N */
 
+extern POST_TEST_RESULT
+post_test_emac_loopback
+(
+    void
+);
diff --git a/post/include/pscapi.h b/post/include/pscapi.h
new file mode 100644 (file)
index 0000000..394613b
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef _PSCAPI_H
+#define _PSCAPI_H
+/**********************************************************************************
+ * FILE PURPOSE: Define the power save controller api
+ **********************************************************************************
+ * FILE NAME: pscapi.h
+ *
+ * DESCRIPTION: Defines the driver interface for the psc controller driver.
+ *
+ * Copyright (C) 2006, Texas Instruments, Inc.
+ * @file pscapi.h
+ *
+ * @brief
+ *  Defines the API used by all power controllers
+ * 
+ *  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 "types.h"
+
+int16_t pscEnableModule (uint32_t modNum);
+int16_t pscDisableModule (uint32_t modNum);
+BOOL pscModuleIsEnabled (uint32_t modNum);
+int16_t pscSetResetIso (uint32_t modNum);
+int16_t pscDisableDomain (uint32_t domainNum);
+void pscDisableModAndDomain (uint32_t modNum, uint32_t domainNum);
+
+
+
+
+
+#endif /* _PSCAPI_H */
diff --git a/post/include/pscloc.h b/post/include/pscloc.h
new file mode 100644 (file)
index 0000000..e755fe9
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ *
+ * Copyright (C) 2010 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.
+ *
+*/
+
+
+
+#ifndef _PSCLOC_H
+#define _PSCLOC_H
+/*************************************************************************************
+ * FILE PURPOSE: Local Power Saver Controller definitions
+ *************************************************************************************
+ * FILE NAME: pscloc.h
+ *
+ * DESCRIPTION: Provides local definitions for the power saver controller
+ *
+ *************************************************************************************/
+/* Register offsets */
+#define PSC_REG_PTCMD           0x120
+#define PSC_REG_PSTAT          0x128
+#define PSC_REG_PDSTAT(x)       (0x200 + (4*(x)))
+#define PSC_REG_PDCTL(x)        (0x300 + (4*(x)))
+#define PSC_REG_MDCFG(x)        (0x600 + (4*(x)))
+#define PSC_REG_MDSTAT(x)       (0x800 + (4*(x)))
+#define PSC_REG_MDCTL(x)        (0xa00 + (4*(x)))
+
+
+/* Macros to access register fields */
+/* PDCTL */
+#define PSC_REG_PDCTL_SET_NEXT(x,y)    BOOT_SET_BITFIELD((x),(y),0,0)
+#define PSC_REG_PDCTL_SET_PDMODE(x,y)  BOOT_SET_BITFIELD((x),(y),15,12)
+
+/* PDSTAT */
+#define PSC_REG_PDSTAT_GET_STATE(x)  BOOT_READ_BITFIELD((x),4,0))
+
+/* MDCFG */
+#define PSC_REG_MDCFG_GET_PD(x)         BOOT_READ_BITFIELD((x),20,16)
+#define PSC_REG_MDCFG_GET_RESET_ISO(x)  BOOT_READ_BITFIELD((x),14,14)
+
+/* MDCTL */
+#define PSC_REG_MDCTL_SET_NEXT(x,y)       BOOT_SET_BITFIELD((x),(y),4,0)
+#define PSC_REG_MDCTL_SET_LRSTZ(x,y)      BOOT_SET_BITFIELD((x),(y),8,8)
+#define PSC_REG_MDCTL_GET_LRSTZ(x)        BOOT_READ_BITFIELD((x),8,8)
+#define PSC_REG_MDCTL_SET_RESET_ISO(x,y)  BOOT_SET_BITFIELD((x),(y),12,12)
+
+
+/* MDSTAT */
+#define PSC_REG_MDSTAT_GET_STATUS(x)   BOOT_READ_BITFIELD((x),5,0)
+#define PSC_REG_MDSTAT_GET_LRSTZ(x)    BOOT_READ_BITFIELD((x),8,8)
+#define PSC_REG_MDSTAT_GET_LRSTDONE(x) BOOT_READ_BITFIELD((x),9,9)
+
+/* PDCTL states */
+#define PSC_REG_VAL_PDCTL_NEXT_ON   1
+#define PSC_REG_VAL_PDCTL_NEXT_OFF  0
+
+#define PSC_REG_VAL_PDCTL_PDMODE_SLEEP  0
+
+/* MDCTL states */
+#define PSC_REG_VAL_MDCTL_NEXT_SWRSTDISABLE     0
+#define PSC_REG_VAL_MDCTL_NEXT_OFF              2
+#define PSC_REG_VAL_MDCTL_NEXT_ON               3  /* Yes, 3 is the on state command */
+
+
+/* MDSTAT states */
+#define PSC_REG_VAL_MDSTAT_STATE_ON                 3
+#define PSC_REG_VAL_MDSTAT_STATE_ENABLE_IN_PROG     0x24
+#define PSC_REG_VAL_MDSTAT_STATE_OFF                2
+#define PSC_REG_VAL_MDSTAT_STATE_DISABLE_IN_PROG1   0x20
+#define PSC_REG_VAL_MDSTAT_STATE_DISABLE_IN_PROG2   0x21
+#define PSC_REG_VAL_MDSTAT_STATE_DISABLE_IN_PROG3   0x22
+
+
+/* Timeout limit on checking PTSTAT. This is the number of times the
+ * wait function will be called before giving up. */
+#define PSC_PTSTAT_TIMEOUT_LIMIT    100
+
+
+
+
+
+#endif /* _PSCLOC_H */
diff --git a/post/include/qm_api.h b/post/include/qm_api.h
new file mode 100644 (file)
index 0000000..06968be
--- /dev/null
@@ -0,0 +1,109 @@
+#ifndef _QM_API_H
+#define _QM_API_H
+/*******************************************************************************************
+ * FILE PURPOSE: Boot loader queue manager API definition
+ *******************************************************************************************
+ * FILE NAME: qm_api.h
+ *
+ * DESCRIPTION: Defines the stripped down QM driver API to the boot loader.
+ *
+ ********************************************************************************************/
+/* return values */
+#define QM_OK                                0
+#define QM_INVALID_LINKRAM_ALIGNMENT        -1
+#define QM_INVALID_MEMREGION_ALIGNMENT      -2
+#define QM_INVALID_LINKRAM_SIZE             -3
+#define QM_INVALID_LINKRAM_RAM_SIZE         -4      /* Not enough link ram for the number of descriptors */
+
+
+/* Memory alignment requirements (bytes) */
+#define QM_LINKRAM_ALIGN        4 
+#define QM_MEMR_ALIGN           16      /* Not specified in the doc */
+
+/* The driver supports only a single descriptor size */
+#define QM_DESC_SIZE_BYTES      64
+
+/* QM setup configuration */
+typedef struct qmConfig_s  {
+
+    uint32_t linkRamBase;
+    uint32_t linkRamSize;
+    
+    uint32_t memRegionBase;
+    uint32_t memRegNumDescriptors;
+    
+    uint32_t destQ;       /* Where the initialized descriptors are placed */
+    
+} qmConfig_t;
+
+typedef struct qmHostDesc_s {
+    /** Descriptor type, packet type, protocol specific region location, packet length */
+    uint32_t          descInfo;
+    /** Source tag, Destination tag */
+    uint32_t          tagInfo;
+    /** EPIB present, PS valid word count, error flags, PS flags, return policy, return push policy, 
+     * packet return QM number, packet return queue number */
+    uint32_t          packetInfo;
+    /** Number of valid data bytes in the buffer */
+    uint32_t          buffLen;
+    /** Byte aligned memory address of the buffer associated with this descriptor */
+    uint32_t          buffPtr;
+    /** 32-bit word aligned memory address of the next buffer descriptor */
+    uint32_t          nextBDPtr;
+    /** Completion tag, original buffer size */
+    uint32_t          origBufferLen;
+    /** Original buffer pointer */
+    uint32_t          origBuffPtr;
+    /** Optional EPIB word0 */
+    uint32_t          timeStamp;
+    /** Optional EPIB word1 */
+    uint32_t          softwareInfo0;
+    /** Optional EPIB word2 */
+    uint32_t          softwareInfo1;
+    /** Optional EPIB word3 */
+    uint32_t          softwareInfo2;
+    /** Optional protocol specific data */
+    uint32_t          psData;
+} qmHostDesc_t;
+
+
+/* Descriptor values */
+/* Descriptor Info: Descriptor type is host with any protocol specific info in the descriptor */
+#define QM_DESC_TYPE_HOST           0
+#define QM_DESC_PSINFO_IN_DESCR     0
+#define QM_DESC_DEFAULT_DESCINFO       (QM_DESC_TYPE_HOST << 30)    |  \
+                                       (QM_DESC_PSINFO_IN_DESCR << 22)
+#define QM_DESC_INFO_GET_PSINFO_LOC(x)  BOOT_READ_BITFIELD((x), 22, 22)
+                                                                        
+#define QM_DESC_DESCINFO_SET_PKT_LEN(x,v)  (x) = BOOT_SET_BITFIELD((x), (v), 21, 0)
+#define QM_DESC_DESCINFO_GET_PKT_LEN(x)    BOOT_READ_BITFIELD((x), 21, 0)
+                                        
+                                        
+/* Packet Info */
+#define QM_DESC_PINFO_EPIB              1
+#define QM_DESC_PINFO_RETURN_OWN        1
+#define QM_DESC_DEFAULT_PINFO           (QM_DESC_PINFO_EPIB << 31)          |   \
+                                        (QM_DESC_PINFO_RETURN_OWN << 15) 
+#define QM_PKT_INFO_GET_EPIB(x)         BOOT_READ_BITFIELD((x), 31, 31)
+#define QM_PKT_INFO_SET_PSINFO_SIZE(x,v)    (x) = BOOT_SET_BITFIELD((x), (v), 29, 24)                                      
+                                        
+                                                                             
+                                        
+#define QM_DESC_PINFO_SET_QM(x,v)       (x) = BOOT_SET_BITFIELD((x), (v), 13, 12)
+#define QM_DESC_PINFO_SET_QUEUE(x,v)    (x) = BOOT_SET_BITFIELD((x), (v), 11,  0)
+                                        
+                                        
+/*  prototypes */
+qmHostDesc_t *hwQmQueuePop (uint32_t qnum);
+void hwQmQueuePush (qmHostDesc_t *hd, uint32_t qnum, uint32_t descSize);
+int16_t hwQmSetup (qmConfig_t *cfg);
+uint32_t  hwQmQueueCount (uint32_t qnum);
+void hwQmTeardown (void);
+int16_t hwQmInitThreshold (uint32_t qnum);
+
+
+
+
+#endif /* _QM_API_H */
+
diff --git a/post/include/qm_loc.h b/post/include/qm_loc.h
new file mode 100644 (file)
index 0000000..aacac84
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef _QM_LOC_H
+#define _QM_LOC_H
+/***************************************************************************************
+ * FILE PURPOSE: Queue Manager local definitions
+ ***************************************************************************************
+ * FILE NAME: qm_loc.h
+ *
+ * DESCRIPTION: Local queue manager definitions
+ *
+ ***************************************************************************************/
+
+/* Memory map */
+/* Relative to the queue manager region */
+#define QM_REG_REVISION         0x00
+#define QM_REG_DIVERSION        0x08
+#define QM_REG_LINKRAM_BASE(x)  (0x0c + 8*(x))
+#define QM_REG_LINKRAM_SIZE(x)  (0x10 + 8*(x))
+
+/* The queue peek registers (includes thresholds) */
+#define QM_REG_STAT_CFG_REGD(x)  (0xc + 16*(x))
+
+/* Relative to the descriptor setup region */
+#define QM_REG_MEMR_BASE_ADDR(x)  (0x00 + 16*(x))
+#define QM_REG_MEMR_START_IDX(x)  (0x04 + 16*(x))
+#define QM_REG_MEMR_DESC_SETUP(x) (0x08 + 16*(x))
+
+/* Queues, register A */
+#define QM_REG_QUEUE_REGA(x)  (0x00 + 16*(x))
+#define QM_QA_ENTRY_COUNT_MSB  18
+#define QM_QA_ENTRY_COUNT_LSB   0
+    
+/* Queues, register D */
+#define QM_REG_QUEUE_REGD(x)  (0x0c + 16*(x))
+
+/* Description region setup */
+#define QM_REG_VAL_DESC_SETUP_SET_DESC_SIZE(x,v)  (x) = BOOT_SET_BITFIELD((x),((v) >> 4)-1, 28, 16)
+
+
+/* Maximum linking RAM size mask */
+#define QM_REG_LINKRAM_SIZE_MAX_MASK  0x7ffff
+
+
+
+#endif /* _QM_LOC_H */
diff --git a/post/include/target.h b/post/include/target.h
new file mode 100644 (file)
index 0000000..7ec9543
--- /dev/null
@@ -0,0 +1,352 @@
+/*
+ *
+ * Copyright (C) 2010 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 PURPOSE: Target specific definitions
+ **************************************************************************
+ * FILE NAME: target.h
+ *
+ * DESCRIPTION: This file defines target specific values used by low level
+ *                             drivers.
+ *
+ * @file target.h
+ *
+ * @brief
+ *  Low level target specific values are defined
+ *
+ ***************************************************************************/
+#ifndef _TARGET_H
+#define _TARGET_H
+#include "types.h"
+
+
+/**
+ *  @brief
+ *   Device EMAC definitions
+ */
+
+
+/**
+ *  @brief
+ *    Device Timer definitions
+ */
+#define TIMER0_BASE             0x02200000u
+
+#define TIMER_INPUT_DIVIDER     6           /* Timer driven from cpu clock / 6 */
+
+
+/**
+ *  @def MAIN_PLL
+ */
+#define MAIN_PLL        0   /**< The index to the main PLL */
+
+/**
+ * @def NET_PLL
+ */
+#define NET_PLL         1   /**< The index to the network PLL */
+
+/**
+ *  @def DDR_PLL
+ */
+#define DDR_PLL         2   /**< The index to the DDR PLL */
+
+
+/**
+ *  @brief
+ *    Device PLL definitions
+ */
+#define DEVICE_PLL_BASE(x)      ((x) == MAIN_PLL ? 0x2310000 : ((x) == NET_PLL ? 0x2620338 : 0x2620330))
+#define DEVICE_MAIN_PLL_CTL_0       0x2620328
+#define DEVICE_MAIN_PLL_CTL_1       0x262032c
+
+
+/**
+ *  @brief
+ *   The c661x devices use a register external to the PLL controller for prediv configuration
+ */
+#define chipPllExternalPrediv(x)    TRUE
+
+/**
+ * @brief
+ *  Device PSC definitions
+ */
+#define DEVICE_PSC_BASE     0x02350000u
+
+/**
+ *  @brief
+ *    The SPI module base and module divider
+ */
+#define DEVICE_SPI_BASE(x)          0x20bf0000u
+#define DEVICE_SPI_MOD_DIVIDER      6
+#define DEVICE_SPI_MAX_DIVIDER      0xff
+
+/**
+ * @brief
+ *  The PSC number for the PA sub-system */
+#define TARGET_PWR_PA       7
+
+/**
+ * @brief
+ *  The PSC number for the SGMII */
+#define TARGET_PWR_ETH(x)   8
+
+/**
+ * @brief
+ *   The PSC numbers for EMIF16 and SPI vary between devices. The devices are run time
+ *   identified by reading the JTAG ID register
+ */
+#define DEVICE_C6616_JTAG_ID_VAL    0x9d02f
+#define DEVICE_C6618_JTAG_ID_VAL    0x9e02f
+#define DEVICE_JTAG_ID_REG          0x2620018
+
+
+/**
+ *  @brief
+ *    The PSC number for NAND depends on the device
+ */
+#define TARGET_PWR_EMIF         deviceEmifPscNum()
+#define TARGET_PWR_EMIF_C6618   3
+
+/*
+ *  @brief
+ *     The PSC number for SPI depends on the device
+ */
+#define TARGET_PWR_SPI      deviceSpiPscNum()
+
+/**
+ *  @brief
+ *      The PSC number for GPIO. GPIO is in the always on domain
+ */
+#define TARGET_PWR_GPIO     -1
+
+/**
+ * @brief
+ *  Flag to indicate timer 0 power up requested. The time is always on in the 6472
+ */
+#define TARGET_PWR_TIMER_0  -1
+
+/**
+ *  @brief
+ *    Device DDR controller definitions
+ */
+#define DEVICE_EMIF4_BASE  0x21000000
+#define targetEmifType()   ibl_EMIF_TYPE_40
+
+/**
+ *  @brief
+ *     Device EMIF 2.5 controller definitions
+ */
+#define DEVICE_EMIF25_BASE  0x20c00000
+
+/**
+ *  @brief
+ *      NAND memory regions
+ */
+#define TARGET_MEM_NAND_CS_2    0x70000000
+#define TARGET_MEM_NAND_CS_3    0x74000000
+#define TARGET_MEM_NAND_CS_4    0x78000000
+#define TARGET_MEM_NAND_CS_5    0x7c000000
+uint32_t deviceNandMemBase (int32_t cs);
+#define TARGET_SHFL(x)  _shfl(x)  /* The shuffle intrinsic */
+
+
+/**
+ * @brief
+ *  The highest module number. The value for nyquist is used
+ */
+#define TARGET_PWR_MAX_MOD  30
+
+
+/**
+ * @brief
+ *   The base address of MDIO
+ */
+#define TARGET_MDIO_BASE    0x2090300
+
+/**
+ * @brief
+ *   The number of external ethernet ports
+ */
+#define TARGET_EMAC_N_PORTS     2
+
+
+
+/**
+ *  @brief
+ *      The base address of the I2C peripheral, and the module divisor of the cpu clock
+ */
+#define DEVICE_I2C_BASE                 0x02530000
+#define DEVICE_I2C_MODULE_DIVISOR       6
+
+/**
+ * @brief
+ *     Prototypes for the PLL functions handled outside the main PLL registers
+ */
+int16_t chipPllSetExternalPrediv(uint16_t pllNum, int32_t predivRegVal);
+int16_t chipPllExternalBwAdj (uint16_t pllNum, uint16_t mult);
+int32_t chipPllExternalMult (uint16_t pllNum, uint16_t mult);
+
+
+/**
+ *  @brief
+ *      Hardware network subsystem support, ethernet switch
+ */
+#define DEVICE_CPSW
+#define DEVICE_CPSW_NUM_PORTS       3                    /* 3 switch ports */
+#define DEVICE_CPSW_BASE            (0x02090800)
+#define targetGetSwitchCtl()        CPSW_CTL_P0_ENABLE   /* Enable port 0 */
+#define targetGetSwitchMaxPktSize() 9000
+
+#define DEVICE_QM
+#define DEVICE_QM_MANAGER_BASE          0x02a68000
+#define DEVICE_QM_DESC_SETUP_BASE       0x02a6a000
+#define DEVICE_QM_MANAGER_QUEUES_BASE   0x02a20000
+#define DEVICE_QM_MANAGER_Q_PROXY_BASE  0x02a40000
+#define DEVICE_QM_QUEUE_STATUS_BASE            0x02a00000
+#define DEVICE_QM_NUM_LINKRAMS          2
+#define DEVICE_QM_NUM_MEMREGIONS        20
+void    *targetGetQmConfig(void);
+void     targetInitQs (void);
+
+#define chipLmbd(x,y) _lmbd(x,y)
+
+
+
+
+#define DEVICE_CPDMA
+
+#define DEVICE_PA_CDMA_GLOBAL_CFG_BASE   0x02004000
+#define DEVICE_PA_CDMA_TX_CHAN_CFG_BASE  0x02004400
+#define DEVICE_PA_CDMA_RX_CHAN_CFG_BASE  0x02004800
+#define DEVICE_PA_CDMA_RX_FLOW_CFG_BASE  0x02005000
+
+#define DEVICE_PA_CDMA_RX_NUM_CHANNELS   24
+#define DEVICE_PA_CDMA_RX_NUM_FLOWS      32
+#define DEVICE_PA_CDMA_TX_NUM_CHANNELS   9
+
+
+#define DEVICE_QM_FREE_Q                910
+#define DEVICE_QM_LNK_BUF_Q             911
+#define DEVICE_QM_RCV_Q                 912
+#define DEVICE_QM_TX_Q                  913
+#define DEVICE_QM_PA_CFG_Q              640
+#define DEVICE_QM_ETH_TX_Q              648
+
+#define DEVICE_RX_CDMA_TIMEOUT_COUNT    1000
+
+
+
+#define DEVICE_PA
+#define DEVICE_PA_BASE                  0x02000000
+#define DEVICE_PA_NUM_PDSPS             6
+#define DEVICE_PA_RUN_CHECK_COUNT       100         /* Number of loops to verify PA firmware is running */
+#define DEVICE_PA_PLL_BASE              0x02620338
+#define chipLower8(x)                   ((x) & 0x00ff)
+
+
+#define TARGET_SGMII_EXTERNAL_SERDES
+#define TARGET_SGMII_TYPE_2             /* Use second sgmii setup sequence */
+#define TARGET_SGMII_BASE_ADDRESSES    { 0x02090100, 0x02090200 }
+#define TARGET_SGMII_SERDES_BASE        0x2620340
+#define TARGET_SGMII_SERDES_STATUS_BASE 0x2620158
+#define TARGET_SGMII_SOFT_RESET         0x04
+#define TARGET_SGMII_CONTROL            0x10
+#define TARGET_SGMII_MR_ADV_ABILITY     0x18
+void targetSgmiiSerdesConfig (int32_t port, void *cfg);
+#define chipKickOpenSerdes(x)           *((uint32_t *)0x2620038) = 0x83e70b13; *((uint32_t *)0x262003c) = 0x95a4f1e0
+#define chipKickClosedSerdes(x)         ;       /* never lock the registers */
+#define TARGET_SERDES_LOCK_DELAY        (1600*1000)
+
+#define DEVICE_EMACSL_BASE(x)           (0x02090900 + (x)*0x040)
+#define DEVICE_N_GMACSL_PORTS           2
+#define DEVICE_EMACSL_RESET_POLL_COUNT  100
+int32_t targetMacSend (void *ptr_device, uint8_t* buffer, int32_t num_bytes);
+int32_t targetMacRcv (void *ptr_device, uint8_t *buffer);
+
+#define DEVICE_SS
+#define DEVICE_PSTREAM_CFG_REG_ADDR                 0x2000604
+#define DEVICE_PSTREAM_CFG_REG_VAL_ROUTE_PDSP0      0
+#define hwConfigStreamingSwitch()                   DEVICE_REG32_W(DEVICE_PSTREAM_CFG_REG_ADDR, DEVICE_PSTREAM_CFG_REG_VAL_ROUTE_PDSP0);
+
+
+/**
+ *  @brief
+ *      Register access macros
+ */
+#define DEVICE_REG32_W(x,y)   *(volatile unsigned int *)(x)=(y)
+#define DEVICE_REG32_R(x)    (*(volatile unsigned int *)(x))
+
+#define BOOTBITMASK(x,y)      (   (   (  ((int32_t)1 << (((int32_t)x)-((int32_t)y)+(int32_t)1) ) - (int32_t)1 )   )   <<  ((int32_t)y)   )
+#define BOOT_READ_BITFIELD(z,x,y)   (((int32_t)z) & BOOTBITMASK(x,y)) >> (y)
+#define BOOT_SET_BITFIELD(z,f,x,y)  (((int32_t)z) & ~BOOTBITMASK(x,y)) | ( (((int32_t)f) << (y)) & BOOTBITMASK(x,y) )
+
+/**
+ *  @brief
+ *      Mpax configuration registers
+ */
+#define DEVICE_REG_XMPAX_L(x) *((volatile unsigned int *)(0x08000000 + (8*(x))))
+#define DEVICE_REG_XMPAX_H(x) *((volatile unsigned int *)(0x08000004 + (8*(x))))
+
+
+/**
+ *  @brief
+ *      ROM boot loader boot modes and table locations
+ */
+#define BOOT_MODE_I2C               40
+#define BOOT_MODE_SPI               50
+
+
+#define ROM_BOOT_PARAMS_ADDR_C6618   0x873680
+#define ROM_BOOT_PARAMS_ADDR_C6616   0x8f3680
+
+/**
+ *  @brief
+ *      No device specific configuration required for NOR boot, so
+ *      the function call is defined to return success.
+ */
+#define deviceConfigureForNor()    0
+
+extern void chipDelay32 (uint32_t del);
+extern void targetPaConfig (uint8_t *macAddr);
+extern void *targetGetCpdmaRxConfig (void);
+extern void *targetGetCpdmaTxConfig (void);
+extern uint32_t deviceLocalAddrToGlobal (uint32_t addr);
+
+#define MAX_SIZE_STREAM_BUFFER  1024
+
+
+#endif /* _TARGET_H */
index dbba3be93a7e21948f7bcffb6771a54df0deced1..d70ac8f1e09cf60e6279b86f174159a83f22ba7a 100644 (file)
 
 #ifndef _TYPES_H
 #define _TYPES_H
+/*******************************************************************************
+ * FILE PURPOSE:  DSP specific C type definitions.
+ *******************************************************************************
+ * FILE NAME: types.h
+ *
+ * DESCRIPTION: Defines general use types for DSP.
+ *
+ *  @file   types.h
+ *
+ *  @brief
+ *      This file provides architecture specific typedefs
+ *
+ ******************************************************************************/
+
 
-typedef uint32_t   Bool;
+#include <stdlib.h>  /* Defines NULL */
+
+typedef short BOOL;
+typedef short bool;
+
+#ifndef FALSE
 #define FALSE 0
+#endif
+
+#ifndef TRUE
 #define TRUE  1
+#endif
+
+/* Types from evm driver */
+typedef volatile unsigned int  VUint32;
+typedef volatile unsigned char VUint8;
+
+/* Types from the ethernet driver */
+typedef unsigned int  IPN;
 
 #endif /* types.h */
diff --git a/post/src/c6678.c b/post/src/c6678.c
new file mode 100644 (file)
index 0000000..b0a7d76
--- /dev/null
@@ -0,0 +1,422 @@
+/*
+ *
+ * Copyright (C) 2010 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 PURPOSE: C6678 Device Specific functions
+ ************************************************************************************
+ * FILE NAME: c6678.c
+ *
+ * DESCRIPTION: Implements the device specific functions for the IBL
+ *
+ * @file c6678.c
+ *
+ * @brief
+ *  This file implements the device specific functions for the IBL
+ *
+ ************************************************************************************/
+#include <string.h>
+#include "platform.h"
+#include "qm_api.h"
+#include "cpdma_api.h"
+#include "pa_api.h"
+#include "net.h"
+#include "target.h"
+
+extern cregister unsigned int DNUM;
+
+/***********************************************************************************
+ * FUNCTION PURPOSE: Provide an approximate delay
+ ***********************************************************************************
+ * DESCRIPTION: A delay in units of CPU cycles is executed
+ ***********************************************************************************/
+void chipDelay32 (uint32_t del)
+{
+    volatile unsigned int i;
+
+    for (i = 0; i < del/8; i++);
+
+}
+
+void *iblMemcpy (void *s1, const void *s2, uint32_t n)
+{
+    return (memcpy (s1, s2, n));
+
+}
+
+/**
+ *  @brief Determine if an address is local
+ *
+ *  @details
+ *    Examines an input address to determine if it is a local address. Using the largest
+ *    L2 size on the 6616.
+ */
+bool address_is_local (uint32_t addr)
+{
+    /* L2 */
+    if ((addr >= 0x00800000) && (addr < 0x00900000))
+        return (TRUE);
+
+    /* L1P */
+    if ((addr >= 0x00e00000) && (addr < 0x00e08000))
+        return (TRUE);
+
+    /* L2D */
+    if ((addr >= 0x00f00000) && (addr < 0x00f08000))
+        return (TRUE);
+
+    return (FALSE);
+
+}
+
+
+/**
+ * @brief  Convert a local l1d, l1p or l2 address to a global address
+ *
+ * @details
+ *  The global address is formed. If the address is not local then
+ *  the input address is returned
+ */
+uint32_t deviceLocalAddrToGlobal (uint32_t addr)
+{
+
+    if (address_is_local (addr))
+        addr = (1 << 28) | (DNUM << 24) | addr;
+
+    return (addr);
+
+}
+
+
+
+/**
+ *  @brief
+ *    The e-fuse mac address is loaded
+ */
+void deviceLoadDefaultEthAddress (uint8_t *maddr)
+{
+    uint32_t macA, macB;
+
+    /* Read the e-fuse mac address */
+    macA = *((uint32_t *)0x2620110);
+    macB = *((uint32_t *)0x2620114);
+
+    maddr[0] = (macB >>  8) & 0xff;
+    maddr[1] = (macB >>  0) & 0xff;
+    maddr[2] = (macA >> 24) & 0xff;
+    maddr[3] = (macA >> 16) & 0xff;
+    maddr[4] = (macA >>  8) & 0xff;
+    maddr[5] = (macA >>  0) & 0xff;
+}
+
+
+/**
+ *  @brief
+ *    Compile time queue manager information
+ */
+#define DEVICE_NUM_RX_CPPIS     1
+#define DEVICE_NUM_TX_CPPIS     1
+#define DEVICE_NUM_CPPIS        (DEVICE_NUM_RX_CPPIS + DEVICE_NUM_TX_CPPIS)
+
+/* The linking RAM */
+#pragma DATA_SECTION(qm_linkram_buf, ".linkram")
+#pragma DATA_ALIGN(qm_linkram_buf, 16)
+uint8_t qm_linkram_buf[DEVICE_NUM_CPPIS * 2 * (sizeof(uint32_t)/sizeof(uint8_t))];
+
+
+/* The CPPI RAM */
+#pragma DATA_SECTION(qm_cppi_buf, ".cppi")
+#pragma DATA_ALIGN(qm_cppi_buf, 16)
+uint8_t qm_cppi_buf[QM_DESC_SIZE_BYTES * DEVICE_NUM_CPPIS];
+
+/* The rx data buffers */
+#pragma DATA_SECTION(qm_buffer, ".mac_buffer")
+#pragma DATA_ALIGN(qm_buffer, 16)
+uint8_t qm_buffer[MAX_SIZE_STREAM_BUFFER * DEVICE_NUM_RX_CPPIS];
+
+const qmConfig_t qmConfig =  {
+    (uint32_t) qm_linkram_buf,
+    sizeof  (qm_cppi_buf),
+    (uint32_t) qm_cppi_buf,
+
+    DEVICE_NUM_CPPIS,
+    DEVICE_QM_FREE_Q
+};
+
+/**
+ *  @brief
+ *      Return the queue manager memory configuration information
+ */
+void *targetGetQmConfig (void)
+{
+    return ((void *)&qmConfig);
+}
+
+/**
+ *  @brief
+ *      Attach a packet buffer to each descriptor and push onto the linked buffer queue
+ */
+void targetInitQs (void)
+{
+    int32_t i;
+    qmHostDesc_t *hd, *hd_old;
+
+    for (i = 0; i < DEVICE_NUM_RX_CPPIS; i++)  {
+
+        hd                = hwQmQueuePop (DEVICE_QM_FREE_Q);
+        hd_old            = hd;
+        hd->buffLen       = sizeof (qm_buffer) / DEVICE_NUM_CPPIS;
+        hd->buffPtr       = (uint32_t) &(qm_buffer[MAX_SIZE_STREAM_BUFFER * i]);
+        hd->nextBDPtr     = 0;
+        hd->origBufferLen = MAX_SIZE_STREAM_BUFFER;
+        hd->origBuffPtr   = hd->buffPtr;
+
+        hwQmQueuePush (hd, DEVICE_QM_LNK_BUF_Q, QM_DESC_SIZE_BYTES);
+
+    }
+
+
+    for (i = 0; i < DEVICE_NUM_TX_CPPIS; i++)  {
+
+        hd                = hwQmQueuePop (DEVICE_QM_FREE_Q);
+        if (hd == hd_old)
+               hd += 0x40;
+        hd->buffLen       = 0;
+        hd->buffPtr       = 0;
+        hd->nextBDPtr     = 0;
+        hd->origBufferLen = 0;
+        hd->origBuffPtr   = 0;
+
+        hwQmQueuePush (hd, DEVICE_QM_TX_Q, QM_DESC_SIZE_BYTES);
+
+    }
+
+
+}
+
+
+
+const cpdmaRxCfg_t cpdmaEthRxCfg =  {
+
+    DEVICE_PA_CDMA_RX_CHAN_CFG_BASE,    /* Base address of PA CPDMA rx config registers */
+    DEVICE_PA_CDMA_RX_NUM_CHANNELS,     /* Number of rx channels */
+
+    DEVICE_PA_CDMA_RX_FLOW_CFG_BASE,    /* Base address of PA CPDMA rx flow registers */
+    DEVICE_PA_CDMA_RX_NUM_FLOWS,        /* Number of rx flows */
+
+    0,                                  /* Queue manager for descriptor / buffer for received packets */
+    DEVICE_QM_LNK_BUF_Q,                /* Queue of descriptors /buffers for received packets */
+
+    0,                                  /* Queue manager for received packets */
+    DEVICE_QM_RCV_Q,                    /* Queue for received packets (overridden by PA)  */
+
+    DEVICE_RX_CDMA_TIMEOUT_COUNT        /* Teardown maximum loop wait */
+};
+
+
+/**
+ *  @brief
+ *      Return the cpdma configuration information
+ */
+void *targetGetCpdmaRxConfig (void)
+{
+    return ((void *)&cpdmaEthRxCfg);
+
+}
+
+
+const cpdmaTxCfg_t cpdmaEthTxCfg = {
+
+    DEVICE_PA_CDMA_GLOBAL_CFG_BASE,     /* Base address of global config registers      */
+    DEVICE_PA_CDMA_TX_CHAN_CFG_BASE,    /* Base address of PA CPDMA tx config registers */
+    DEVICE_PA_CDMA_TX_NUM_CHANNELS      /* Number of tx channels */
+
+};
+
+
+/**
+ *  @brief
+ *      return the tx cpdma configuration information
+ */
+void *targetGetCpdmaTxConfig (void)
+{
+    return ((void *)&cpdmaEthTxCfg);
+
+}
+
+/**
+ *  @brief
+ *     Configure the PA
+ */
+void targetPaConfig (uint8_t *macAddr)
+{
+    paConfig_t     paCfg;
+    qmHostDesc_t  *hd;
+    int16_t         ret;
+
+    /* Filter everything except the desired mac address and the broadcast mac */
+    paCfg.mac0ms = ((uint32_t)macAddr[0] << 24) | ((uint32_t)macAddr[1] << 16) | ((uint32_t)macAddr[2] << 8) | (uint32_t)(macAddr[3]);
+    paCfg.mac0ls = ((uint32_t)macAddr[4] << 24) | ((uint32_t)macAddr[5] << 16);
+
+    paCfg.mac1ms = 0xffffffff;
+    paCfg.mac1ls = 0xffff0000;
+
+    paCfg.rxQnum = DEVICE_QM_RCV_Q;
+
+    /* Form the configuration command in a buffer linked to a descriptor */
+    hd = hwQmQueuePop (DEVICE_QM_LNK_BUF_Q);
+    paCfg.cmdBuf = (uint8_t *)hd->origBuffPtr;
+
+    ret = hwPaEnable (&paCfg);
+    if (ret != 0)  {
+        return;
+    }
+
+
+    /* Send the command to the PA through the QM */
+    hd->softwareInfo0 = PA_MAGIC_ID;
+    hd->buffLen = 16;
+    QM_DESC_DESCINFO_SET_PKT_LEN(hd->descInfo, 16);
+
+    /* Set the return Queue */
+    QM_DESC_PINFO_SET_QM    (hd->packetInfo, 0);
+    QM_DESC_PINFO_SET_QUEUE (hd->packetInfo, DEVICE_QM_LNK_BUF_Q);
+
+    hwQmQueuePush (hd, DEVICE_QM_PA_CFG_Q, QM_DESC_SIZE_BYTES);
+
+
+}
+
+int32_t targetMacSend (void *vptr_device, uint8_t* buffer, int32_t num_bytes)
+{
+    qmHostDesc_t   *hd;
+    int32_t        i;
+
+
+    /* Must always setup the descriptor to have the minimum packet length */
+    if (num_bytes < 64)
+        num_bytes = 64;
+
+
+    for (i = 0, hd = NULL; hd == NULL; i++, chipDelay32 (1000))
+        hd = hwQmQueuePop (DEVICE_QM_TX_Q);
+
+    if (hd == NULL)
+        return (-1);
+
+    QM_DESC_DESCINFO_SET_PKT_LEN(hd->descInfo, num_bytes);
+
+    hd->buffLen       = num_bytes;
+    hd->origBufferLen = num_bytes;
+
+    hd->buffPtr     = deviceLocalAddrToGlobal((uint32_t)buffer);
+    hd->origBuffPtr = deviceLocalAddrToGlobal((uint32_t)buffer);
+
+
+    /* Return the descriptor back to the transmit queue */
+    QM_DESC_PINFO_SET_QM(hd->packetInfo, 0);
+    QM_DESC_PINFO_SET_QUEUE(hd->packetInfo, DEVICE_QM_TX_Q);
+    /* Force the packet to EMAC port 0 if loopback is enabled */
+    hd->packetInfo |= (1<<16);
+
+    hwQmQueuePush (hd, DEVICE_QM_ETH_TX_Q, QM_DESC_SIZE_BYTES);
+
+    return (0);
+
+}
+
+
+int32_t targetMacRcv (void *vptr_device, uint8_t *buffer)
+{
+    int32_t           pktSizeBytes;
+    qmHostDesc_t   *hd;
+
+    hd = hwQmQueuePop (DEVICE_QM_RCV_Q);
+    if (hd == NULL)
+        return (0);
+
+    pktSizeBytes = QM_DESC_DESCINFO_GET_PKT_LEN(hd->descInfo);
+    iblMemcpy ((void *)buffer, (void *)hd->buffPtr, pktSizeBytes);
+
+    hd->buffLen = hd->origBufferLen;
+    hd->buffPtr = hd->origBuffPtr;
+
+    hwQmQueuePush (hd, DEVICE_QM_LNK_BUF_Q, QM_DESC_SIZE_BYTES);
+
+    return (pktSizeBytes);
+
+}
+
+void targetFreeQs (void)
+{
+    qmHostDesc_t   *hd;
+
+    do  {
+
+        hd = hwQmQueuePop (DEVICE_QM_FREE_Q);
+
+    } while (hd != NULL);
+
+    do  {
+
+        hd = hwQmQueuePop (DEVICE_QM_LNK_BUF_Q);
+
+    } while (hd != NULL);
+
+    do  {
+
+        hd = hwQmQueuePop (DEVICE_QM_RCV_Q);
+
+    } while (hd != NULL);
+
+    do  {
+
+        hd = hwQmQueuePop (DEVICE_QM_TX_Q);
+
+    } while (hd != NULL);
+
+}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/post/src/cpdma.c b/post/src/cpdma.c
new file mode 100644 (file)
index 0000000..9f444a8
--- /dev/null
@@ -0,0 +1,191 @@
+/********************************************************************************************
+ * FILE PURPOSE: The cpdma driver
+ ********************************************************************************************
+ * FILE NAME: cpdma.c
+ *
+ * DESCRIPTION: The boot loader cpdma driver
+ *
+ ********************************************************************************************/
+#include "types.h"
+#include "platform.h"
+#include "cpdma_loc.h"
+#include "cpdma_api.h"
+#include "target.h"
+
+/*********************************************************************************************
+ * FUNCTION PURPOSE: Disable all rx channels and clear all the flow registers
+ *********************************************************************************************
+ * DESCRIPTION: The teardown is initiated and polled for completion. The function will
+ *              return an error if the teardown is never complete, but will not stay
+ *              in the function forever.
+ *********************************************************************************************/
+int16_t hwCpdmaRxDisable (const cpdmaRxCfg_t *cfg)
+{
+    uint32_t i;
+    uint32_t v;
+    BOOL   done;
+
+    for (i = 0; i < cfg->nRxChans; i++)  {
+
+        /* If enabled, set the teardown bit */
+        v = DEVICE_REG32_R (cfg->rxBase + CPDMA_REG_RCHAN_CFG_REG_A(i));
+        if ( (v & CPDMA_REG_VAL_RCHAN_A_RX_ENABLE) == CPDMA_REG_VAL_RCHAN_A_RX_ENABLE )  {
+            v = v | CPDMA_REG_VAL_RCHAN_A_RX_TDOWN;
+            DEVICE_REG32_W (cfg->rxBase + CPDMA_REG_RCHAN_CFG_REG_A(i), v);
+        }
+
+    }
+
+    /* Poll for completion */
+    for (i = 0, done = FALSE; ( (i < cfg->tdownPollCount) && (done == FALSE) ); i++)  {
+
+        chipDelay32 (100);
+
+        done = TRUE;
+        v = DEVICE_REG32_R (cfg->rxBase + CPDMA_REG_RCHAN_CFG_REG_A(i));
+        if ( (v & CPDMA_REG_VAL_RCHAN_A_RX_ENABLE) == CPDMA_REG_VAL_RCHAN_A_RX_ENABLE )
+            done = FALSE;
+
+    }
+
+    if (done == FALSE)
+        return (-1);
+
+
+    /* Clear all of the flow registers */
+    for (i = 0; i < cfg->nRxFlows; i++)  {
+        DEVICE_REG32_W (cfg->flowBase + CPDMA_RX_FLOW_CFG(CPDMA_RX_FLOW_REG_A, i), 0);
+        DEVICE_REG32_W (cfg->flowBase + CPDMA_RX_FLOW_CFG(CPDMA_RX_FLOW_REG_B, i), 0);
+        DEVICE_REG32_W (cfg->flowBase + CPDMA_RX_FLOW_CFG(CPDMA_RX_FLOW_REG_C, i), 0);
+        DEVICE_REG32_W (cfg->flowBase + CPDMA_RX_FLOW_CFG(CPDMA_RX_FLOW_REG_D, i), 0);
+        DEVICE_REG32_W (cfg->flowBase + CPDMA_RX_FLOW_CFG(CPDMA_RX_FLOW_REG_E, i), 0);
+        DEVICE_REG32_W (cfg->flowBase + CPDMA_RX_FLOW_CFG(CPDMA_RX_FLOW_REG_F, i), 0);
+        DEVICE_REG32_W (cfg->flowBase + CPDMA_RX_FLOW_CFG(CPDMA_RX_FLOW_REG_G, i), 0);
+        DEVICE_REG32_W (cfg->flowBase + CPDMA_RX_FLOW_CFG(CPDMA_RX_FLOW_REG_H, i), 0);
+
+    }
+
+    return (0);
+
+} /* hwCpdmaRxDisable */
+
+
+
+/*********************************************************************************************
+ * FUNCTION PURPOSE: Configure the cpdma receive direction for boot loader
+ *********************************************************************************************
+ * DESCRIPTION: The receive configuration for boot consists of a single flow configuration
+ *              which is stored as flow configuration 0. All extended info and psinfo
+ *              is stripped.
+ *********************************************************************************************/
+int16_t hwCpdmaRxConfig (const cpdmaRxCfg_t *cfg)
+{
+    uint32_t v;
+    uint32_t i;
+    int16_t ret = 0;
+
+
+    /* Rx dma channels are disabled during flow configurations.
+     * Even if disable fails attempt to configure the receive so the boot can work */
+    if (hwCpdmaRxDisable (cfg) != 0)
+        ret = -1;
+
+    /* Configure the flow
+     * The flow is configured to not pass extended info or psinfo, with descriptor
+     * type host */
+
+    v = CPDMA_REG_VAL_MAKE_RX_FLOW_A(  1,                       /* extended info passed */
+                                       1,                       /* psinfo passed */
+                                       0,                       /* Retry on failure to transmit */
+                                       CPDMA_DESC_TYPE_HOST,    /* Host type descriptor */
+                                       0,                       /* PS located in descriptor */
+                                       0,                       /* SOP offset */
+                                       cfg->qmNumRx,            /* Rx packet destination QM number */
+                                       cfg->queueRx );          /* Rx packet destination queue */
+
+
+    DEVICE_REG32_W (cfg->flowBase + CPDMA_RX_FLOW_CFG(CPDMA_RX_FLOW_REG_A, 0), v);
+
+    DEVICE_REG32_W (cfg->flowBase + CPDMA_RX_FLOW_CFG(CPDMA_RX_FLOW_REG_B, 0), CPDMA_REG_VAL_RX_FLOW_B_DEFAULT);
+    DEVICE_REG32_W (cfg->flowBase + CPDMA_RX_FLOW_CFG(CPDMA_RX_FLOW_REG_C, 0), CPDMA_REG_VAL_RX_FLOW_C_DEFAULT);
+
+    v = CPDMA_REG_VAL_MAKE_RX_FLOW_D (  cfg->qmNumFreeBuf,      /* Rx packet destination QM number, 1st descriptor */
+                                        cfg->queueFreeBuf,      /* Rx packet destination queue, 1st descriptor */
+                                        cfg->qmNumFreeBuf,      /* Rx packet destination QM number, subsequent descriptors */
+                                        cfg->queueFreeBuf );    /* Rx packet destination queue, subsequent descriptors */
+    DEVICE_REG32_W (cfg->flowBase + CPDMA_RX_FLOW_CFG(CPDMA_RX_FLOW_REG_D, 0), v);
+
+
+    /* Register E uses the same setup as D */
+    DEVICE_REG32_W (cfg->flowBase + CPDMA_RX_FLOW_CFG(CPDMA_RX_FLOW_REG_E, 0), v);
+
+
+
+    DEVICE_REG32_W (cfg->flowBase + CPDMA_RX_FLOW_CFG(CPDMA_RX_FLOW_REG_F, 0), CPDMA_REG_VAL_RX_FLOW_F_DEFAULT);
+    DEVICE_REG32_W (cfg->flowBase + CPDMA_RX_FLOW_CFG(CPDMA_RX_FLOW_REG_G, 0), CPDMA_REG_VAL_RX_FLOW_G_DEFAULT);
+    DEVICE_REG32_W (cfg->flowBase + CPDMA_RX_FLOW_CFG(CPDMA_RX_FLOW_REG_H, 0), CPDMA_REG_VAL_RX_FLOW_H_DEFAULT);
+
+
+    /* Enable the rx channels */
+    for (i = 0; i < cfg->nRxChans; i++)
+        DEVICE_REG32_W (cfg->rxBase + CPDMA_REG_RCHAN_CFG_REG_A(i), CPDMA_REG_VAL_RCHAN_A_RX_ENABLE);
+
+
+    return (ret);
+
+} /* hwCpdmaRxConfig */
+
+
+/*************************************************************************************************
+ * FUNCTION PURPOSE: Configure the cpdma transmit direction for boot loader
+ *************************************************************************************************
+ * DESCRIPTION: The transmit channels are enabled
+ *************************************************************************************************/
+int16_t hwCpdmaTxConfig (const cpdmaTxCfg_t *cfg)
+{
+    uint32_t i;
+
+    /* Disable loopback in the tx direction */
+    DEVICE_REG32_W (cfg->gblCtlBase + CPDMA_REG_EMU_CTL, CPDMA_REG_VAL_EMU_CTL_NO_LOOPBACK);
+
+    /* Enable all channels. The current state isn't important */
+    for (i = 0; i < cfg->nTxChans; i++)  {
+        DEVICE_REG32_W (cfg->txBase + CPDMA_REG_TCHAN_CFG_REG_B(i), 0);  /* Priority */
+        DEVICE_REG32_W (cfg->txBase + CPDMA_REG_TCHAN_CFG_REG_A(i), CPDMA_REG_VAL_TCHAN_A_TX_ENABLE);
+    }
+
+    return (0);
+
+} /* hwCpdmaTxConfig */
+
+
+/***************************************************************************************************
+ * FUNCTION PURPOSE: Disable the transmit channels
+ ***************************************************************************************************
+ * DESCRIPTION: The transmit channels are disabled
+ ***************************************************************************************************/
+int16_t hwCpdmaTxDisable (const cpdmaTxCfg_t *cfg)
+{
+    uint32_t i;
+    uint32_t v;
+
+    for (i = 0; i < cfg->nTxChans; i++)  {
+
+        v = DEVICE_REG32_R (cfg->txBase + CPDMA_REG_TCHAN_CFG_REG_A(i));
+
+        if ( (v & CPDMA_REG_VAL_TCHAN_A_TX_ENABLE) == CPDMA_REG_VAL_TCHAN_A_TX_ENABLE)  {
+            v = v | CPDMA_REG_VAL_TCHAN_A_TX_TDOWN;
+            DEVICE_REG32_W (cfg->txBase + CPDMA_REG_TCHAN_CFG_REG_A(i), v);
+        }
+    }
+
+
+    return (0);
+
+} /* hwCpdmaTxDisable */
+
+
+
+
+
+
diff --git a/post/src/gmacsl.c b/post/src/gmacsl.c
new file mode 100644 (file)
index 0000000..662d0e7
--- /dev/null
@@ -0,0 +1,138 @@
+/******************************************************************************************
+ * FILE PURPOSE: Mac sliver driver
+ ******************************************************************************************
+ * FILE NAME: gmacsl.c
+ *
+ * DESCRIPTION: The cpgmac sliver driver
+ ******************************************************************************************/
+#include "types.h"
+#include "platform.h"
+#include "cpmacdrv.h"
+#include "gmacsl_loc.h"
+#include "gmacsl_api.h"
+#include "target.h"
+
+
+/********************************************************************************************
+ * FUNCTION PURPOSE: Reset the the gmac sliver
+ ********************************************************************************************
+ * DESCRIPTION: Soft reset is set and polled until clear, or until a timeout occurs
+ ********************************************************************************************/
+int16_t hwGmacSlReset (uint16_t port)
+{
+    uint32_t i;
+    uint32_t v;
+
+    if (port >= DEVICE_N_GMACSL_PORTS)
+        return (GMACSL_RET_INVALID_PORT);
+
+    /* Set the soft reset bit */
+    DEVICE_REG32_W (DEVICE_EMACSL_BASE(port) + CPGMACSL_REG_RESET, CPGMAC_REG_RESET_VAL_RESET);
+
+    /* Wait for the bit to clear */
+    for (i = 0; i < DEVICE_EMACSL_RESET_POLL_COUNT; i++)  {
+
+        v = DEVICE_REG32_R (DEVICE_EMACSL_BASE(port) + CPGMACSL_REG_RESET);
+        if ( (v & CPGMAC_REG_RESET_VAL_RESET_MASK) != CPGMAC_REG_RESET_VAL_RESET)
+            return (GMACSL_RET_OK);
+
+    }
+
+    /* Timeout on the reset */
+    return (GMACSL_RET_WARN_RESET_INCOMPLETE);
+
+} /* hwGmacSlReset */
+
+
+/*******************************************************************************************
+ * FUNCTION PURPOSE: Configure the gmac sliver
+ *******************************************************************************************
+ * DESCRIPTION: The emac sliver is configured.
+ *******************************************************************************************/
+int16_t hwGmacSlConfig (uint16_t port, hwGmacSlCfg_t *cfg)
+{
+    uint32_t v;
+    uint32_t i;
+    int16_t ret = GMACSL_RET_OK;
+
+
+    if (port >= DEVICE_N_GMACSL_PORTS)
+        return (GMACSL_RET_INVALID_PORT);
+
+    if (cfg->maxRxLen > CPGMAC_REG_MAXLEN_LEN)  {
+        cfg->maxRxLen = CPGMAC_REG_MAXLEN_LEN;
+        ret = GMACSL_RET_WARN_MAXLEN_TOO_BIG;
+    }
+
+    /* Must wait if the device is undergoing reset */
+    for (i = 0; i < DEVICE_EMACSL_RESET_POLL_COUNT; i++)  {
+
+        v = DEVICE_REG32_R (DEVICE_EMACSL_BASE(port) + CPGMACSL_REG_RESET);
+        if ( (v & CPGMAC_REG_RESET_VAL_RESET_MASK) != CPGMAC_REG_RESET_VAL_RESET)
+            break;
+
+    }
+
+    if (i == DEVICE_EMACSL_RESET_POLL_COUNT)
+        return (GMACSL_RET_CONFIG_FAIL_RESET_ACTIVE);
+
+
+
+
+    DEVICE_REG32_W(DEVICE_EMACSL_BASE(port) + CPGMACSL_REG_MAXLEN, cfg->maxRxLen);
+
+    DEVICE_REG32_W(DEVICE_EMACSL_BASE(port) + CPGMACSL_REG_CTL, cfg->ctl);
+
+    return (ret);
+
+} /* hwGmacSlConfig */
+
+
+
+int32_t cpmac_drv_start (NET_DRV_DEVICE* ptr_device)
+{
+    int32_t         i;
+    hwGmacSlCfg_t cfg;
+
+
+    cfg.maxRxLen = MAX_SIZE_STREAM_BUFFER;
+    cfg.ctl      = GMACSL_ENABLE | GMACSL_RX_ENABLE_EXT_CTL;
+
+    if (ptr_device->port_num == (uint32_t)(-2))  {
+
+        for (i = 0; i < TARGET_EMAC_N_PORTS; i++)  {
+            hwGmacSlReset  (i);
+            hwGmacSlConfig (i, &cfg);
+        }
+
+    }  else  {
+
+        hwGmacSlReset (ptr_device->port_num);
+        hwGmacSlConfig (ptr_device->port_num, &cfg);
+
+    }
+
+    return (0);
+
+}
+
+int32_t cpmac_drv_send (NET_DRV_DEVICE* ptr_device, uint8_t* buffer, int num_bytes)
+{
+    return (targetMacSend ((void *)ptr_device, buffer, num_bytes));
+}
+
+
+
+int32_t cpmac_drv_receive (NET_DRV_DEVICE* ptr_device, uint8_t* buffer)
+{
+   return (targetMacRcv ((void *)ptr_device, buffer));
+
+}
+
+
+int32_t cpmac_drv_stop (NET_DRV_DEVICE* ptr_device)
+{
+
+    hwGmacSlReset (ptr_device->port_num);
+    return (0);
+}
diff --git a/post/src/pa.c b/post/src/pa.c
new file mode 100644 (file)
index 0000000..5567853
--- /dev/null
@@ -0,0 +1,125 @@
+/****************************************************************************************************
+ * FILE PURPOSE: The boot loader packet accelerator driver
+ ****************************************************************************************************
+ * FILE NAME: pa.c
+ *
+ * DESCRIPTION: The driver for the packet accelerator during boot
+ *
+ ****************************************************************************************************/
+#include "types.h"
+#include "platform.h"
+#include "pa_loc.h"
+#include "pa_api.h"
+#include "target.h"
+#include "hwpafw_bin.h"
+#include <string.h>
+
+/****************************************************************************************************
+ * FUNCTION PURPOSE: Initialize the PA sub-system
+ ****************************************************************************************************
+ * DESCRIPTION: Only PDSP 0 is used. All other PDSPs are put into reset. PDSP0 is downloaded
+ *              and started, then provided with the mac address configuration.
+ ****************************************************************************************************/
+int16_t hwPaEnable (const paConfig_t *cfg)
+{
+    uint32_t i;
+    uint32_t v;
+    BOOL   done;
+
+    /* Disable all PDSPs */
+    for (i = 0; i < DEVICE_PA_NUM_PDSPS; i++)
+        DEVICE_REG32_W (DEVICE_PA_BASE + PA_REG_PDSP_CTL(i), PA_REG_VAL_PDSP_CTL_DISABLE_PDSP);
+
+    /* Clear the mailbox registers for PDSP 0 */
+    for (i = 0; i < PA_NUM_MAILBOX_SLOTS; i++)
+        DEVICE_REG32_W (DEVICE_PA_BASE + PA_REG_MAILBOX_SLOT(0, i), 0);
+
+
+    /* Give a few cycles for the disable */
+    chipDelay32 (100);
+
+    /* download the firmware */
+    memcpy ((uint32_t *)(DEVICE_PA_BASE + PA_MEM_PDSP_IRAM(0)), PDSPcode, sizeof(PDSPcode));
+
+    /* Reset the PC and enable PDSP0 */
+    DEVICE_REG32_W (DEVICE_PA_BASE + PA_REG_PDSP_CTL(0), PA_REG_VAL_PDSP_CTL_ENABLE_PDSP(0));
+
+
+    /* Copy the two destination mac addresses to the mail box slots.
+     * Mailbox 4 must be written last since this write triggers the firmware to
+     * update the match information */
+    cfg->cmdBuf[0] = BOOT_READ_BITFIELD(cfg->mac0ms, 31, 24);
+    cfg->cmdBuf[1] = BOOT_READ_BITFIELD(cfg->mac0ms, 23, 16);
+    cfg->cmdBuf[2] = BOOT_READ_BITFIELD(cfg->mac0ms, 15,  8);
+    /* Cant use BOOT_READ_BITFIELD for 8 LSBs because it compiles with endian dependency */
+    cfg->cmdBuf[3] = chipLower8 (cfg->mac0ms);
+    cfg->cmdBuf[4] = BOOT_READ_BITFIELD(cfg->mac0ls, 31, 24);
+    cfg->cmdBuf[5] = BOOT_READ_BITFIELD(cfg->mac0ls, 23, 16);
+    cfg->cmdBuf[6] = cfg->cmdBuf[7] = 0;
+
+    cfg->cmdBuf[8]  = BOOT_READ_BITFIELD(cfg->mac1ms, 31, 24);
+    cfg->cmdBuf[9]  = BOOT_READ_BITFIELD(cfg->mac1ms, 23, 16);
+    cfg->cmdBuf[10] = BOOT_READ_BITFIELD(cfg->mac1ms, 15,  8);
+    /* Cant use BOOT_READ_BITFIELD for 8 LSBs because it compiles with endian dependency */
+    cfg->cmdBuf[11] = chipLower8 (cfg->mac1ms);
+    cfg->cmdBuf[12] = BOOT_READ_BITFIELD(cfg->mac1ls, 31, 24);
+    cfg->cmdBuf[13] = BOOT_READ_BITFIELD(cfg->mac1ls, 23, 16);
+
+    cfg->cmdBuf[14] = BOOT_READ_BITFIELD(cfg->rxQnum, 15, 8);
+    cfg->cmdBuf[15] = chipLower8 (cfg->rxQnum);
+
+
+    /* Give some delay then verify that the mailboxes have been cleared */
+    for (i = 0, done = FALSE; ((i < DEVICE_PA_RUN_CHECK_COUNT) && (done == FALSE)); i++)  {
+        chipDelay32 (100);
+        v = DEVICE_REG32_R (DEVICE_PA_BASE + PA_REG_MAILBOX_SLOT(0, 3));
+        if (v == 0)
+            done = TRUE;
+    }
+
+    if (done == FALSE)
+        return (-1);
+
+    return (0);
+
+} /* hwPaEnable */
+
+
+/***********************************************************************************************
+ * FUNCTION PURPOSE: Disable the PA firmware
+ ***********************************************************************************************
+ * DESCRIPTION: All PDSPs are disabled and all mailbox slots cleared
+ ***********************************************************************************************/
+int16_t hwPaDisable (void)
+{
+    uint32_t i, j;
+
+    /* Disable all pdsps, clear all mailboxes */
+    for (i = 0; i < DEVICE_PA_NUM_PDSPS; i++)  {
+
+        DEVICE_REG32_W (DEVICE_PA_BASE + PA_REG_PDSP_CTL(i), PA_REG_VAL_PDSP_CTL_DISABLE_PDSP);
+
+        for (j = 0; j < PA_NUM_MAILBOX_SLOTS; j++)
+            DEVICE_REG32_W (DEVICE_PA_BASE + PA_REG_MAILBOX_SLOT(i, j), 0);
+
+    }
+
+    return (0);
+
+} /* hwPaDisable */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
index ed8c03623544267d6669eda00abfdf930e7b8be7..1c99117675b6900a7887538b17bfad7941500d8f 100644 (file)
  *
  *****************************************************************************/
 
-#include <stdlib.h>
 #include <string.h>
 #include "platform.h"
 #include "types.h"
 #include "post.h"
+#include "net.h"
+#include "cpmacdrv.h"
+#include "target.h"
+#include "qm_api.h"
+#include "cpdma_api.h"
+#include "pscapi.h"
+
+/* CSL EMAC include */
+#include <ti/csl/csl_cpsw.h>
+#include <ti/csl/csl_cpsgmii.h>
+#include <ti/csl/csl_cpsgmiiAux.h>
+#include <ti/csl/cslr_cpsgmii.h>
+#include <ti/csl/csl_mdio.h>
+#include <ti/csl/csl_mdioAux.h>
+
+/* BootCfg module include */
+#include <ti/csl/csl_bootcfg.h>
+#include <ti/csl/csl_bootcfgAux.h>
 
 /* The version string */
 #pragma DATA_SECTION(post_version, ".version")
@@ -127,7 +144,7 @@ void
 post_display_status
 (
     POST_TEST_ID        test_id,
-    Bool                test_passed
+    POST_TEST_RESULT    test_result
 )
 {
     uint32_t    i;
@@ -135,6 +152,7 @@ post_display_status
     char        msg1[40] = "\r\n\r\nPOST ";
     char        msg2[] = " test passed!";
     char        msg3[] = " test failed!";
+    char        msg4[] = " test started!";
 
     msg = strcat(msg1, post_status[test_id]);
     switch (test_id)
@@ -158,7 +176,7 @@ post_display_status
 
     default:
         /* Form the POST status message to write to the UART */
-        if (test_passed)
+        if (test_result == POST_TEST_RESULT_PASSED)
         {
             msg = strcat(msg, msg2);
             if (post_write_uart(msg) != TRUE)
@@ -166,7 +184,7 @@ post_display_status
                 post_display_led_error(POST_TEST_UART);   /* Never return from this function */
             }
         }
-        else
+        else if (test_result == POST_TEST_RESULT_FAILED)
         {
             msg = strcat(msg, msg3);
             if (post_write_uart(msg) != TRUE)
@@ -175,6 +193,14 @@ post_display_status
             }
             post_display_led_error(test_id);  /* Never return from this function */
         }
+        else
+        {
+            msg = strcat(msg, msg4);
+            if (post_write_uart(msg) != TRUE)
+            {
+                post_display_led_error(POST_TEST_UART);   /* Never return from this function */
+            }
+        }
         break;
     }
 }
@@ -182,39 +208,39 @@ post_display_status
 /******************************************************************************
  * Function:    post_test_external_memory
  ******************************************************************************/
-Bool
+POST_TEST_RESULT
 post_test_external_memory
 (
     void
 )
 {
-    Bool    test_passed = TRUE;
+    POST_TEST_RESULT    test_result = POST_TEST_RESULT_PASSED;
 
     if(platform_external_memory_test(0, 0) != Platform_EOK)
     {
-        test_passed = FALSE;
+        test_result = POST_TEST_RESULT_FAILED;
     }
 
-    return test_passed;
+    return test_result;
 }
 
 /******************************************************************************
  * Function:    post_test_eeprom
  ******************************************************************************/
-Bool
+POST_TEST_RESULT
 post_test_eeprom
 (
     void
 )
 {
     uint8_t                 test_buf[POST_EEPROM_TEST_READ_LENGTH];
-    Bool                    test_passed = TRUE;
+    POST_TEST_RESULT        test_result = POST_TEST_RESULT_PASSED;
     PLATFORM_DEVICE_info    *p_device;
 
     p_device = platform_device_open(POST_EEPROM_TEST_DEVICE_ID, 0);
     if (p_device == NULL)
     {
-        return FALSE;
+        return POST_TEST_RESULT_FAILED;
     }
 
     if(platform_device_read(p_device->handle,
@@ -222,31 +248,31 @@ post_test_eeprom
                             test_buf,
                             POST_EEPROM_TEST_READ_LENGTH) != Platform_EOK)
     {
-        test_passed = FALSE;
+        test_result = POST_TEST_RESULT_FAILED;
     }
 
     platform_device_close(p_device->handle);
-    return test_passed;
+    return test_result;
 }
 
 /******************************************************************************
  * Function:    post_test_nand
  ******************************************************************************/
-Bool
+POST_TEST_RESULT
 post_test_nand
 (
     void
 )
 {
     uint8_t                 test_buf[POST_NAND_TEST_READ_LENGTH];
-    Bool                    test_passed = TRUE;
+    POST_TEST_RESULT        test_result = POST_TEST_RESULT_PASSED;
     uint32_t                addr;
     PLATFORM_DEVICE_info    *p_device;
 
     p_device = platform_device_open(POST_NAND_TEST_DEVICE_ID, 0);
     if (p_device == NULL)
     {
-        return FALSE;
+        return POST_TEST_RESULT_FAILED;
     }
 
     addr = (POST_NAND_TEST_READ_BLOCK_NUM * p_device->page_count + POST_NAND_TEST_READ_PAGE_NUM) * p_device->page_size;
@@ -255,30 +281,30 @@ post_test_nand
                             test_buf,
                             POST_NAND_TEST_READ_LENGTH) != Platform_EOK)
     {
-        test_passed = FALSE;
+        test_result = POST_TEST_RESULT_FAILED;
     }
 
     platform_device_close(p_device->handle);
-    return test_passed;
+    return test_result;
 }
 
 /******************************************************************************
  * Function:    post_test_nor
  ******************************************************************************/
-Bool
+POST_TEST_RESULT
 post_test_nor
 (
     void
 )
 {
     uint8_t                 test_buf[POST_NOR_TEST_READ_LENGTH];
-    Bool                    test_passed = TRUE;
+    POST_TEST_RESULT        test_result = POST_TEST_RESULT_PASSED;
     PLATFORM_DEVICE_info    *p_device;
 
     p_device = platform_device_open(POST_NOR_TEST_DEVICE_ID, 0);
     if (p_device == NULL)
     {
-        return FALSE;
+        return POST_TEST_RESULT_FAILED;
     }
 
     if(platform_device_read(p_device->handle,
@@ -286,11 +312,439 @@ post_test_nor
                             test_buf,
                             POST_NOR_TEST_READ_LENGTH) != Platform_EOK)
     {
-        test_passed = FALSE;
+        test_result = POST_TEST_RESULT_FAILED;
     }
 
     platform_device_close(p_device->handle);
-    return test_passed;
+    return test_result;
+}
+
+/** Number of ports in the ethernet subsystem */
+#define         NUM_PORTS                   3u
+
+/** Number of MAC/GMII ports in the ethernet switch */
+#define         NUM_MAC_PORTS               2u
+
+/* Define LoopBack modes */
+#define CPSW_LOOPBACK_NONE           0
+#define CPSW_LOOPBACK_INTERNAL       1
+#define CPSW_LOOPBACK_EXTERNAL       2
+
+#ifdef  SIMULATOR_SUPPORT
+int32_t cpswSimTest = 1;
+int32_t cpswLpbkMode = CPSW_LOOPBACK_EXTERNAL;
+#else
+int32_t cpswSimTest = 0;
+int32_t cpswLpbkMode = CPSW_LOOPBACK_INTERNAL;
+#endif
+int32_t cpswEvm6678 = 0;
+
+/** ============================================================================
+ *   @n@b Init_SGMII
+ *
+ *   @b Description
+ *   @n SGMII peripheral initialization code.
+ *
+ *   @param[in]
+ *   @n macPortNum      MAC port number for which the SGMII port setup must
+ *                      be performed.
+ *
+ *   @return
+ *   @n None
+ * =============================================================================
+ */
+int32_t Init_sgmii (uint32_t macPortNum)
+{
+    CSL_SGMII_ADVABILITY    sgmiiCfg;
+       CSL_SGMII_STATUS        sgmiiStatus;
+
+    if ((macPortNum == 0) && (cpswEvm6678))
+    {
+        /* EVM6678 back end: MAC-to-MAC force link */
+
+        /* Reset the port before configuring it */
+        CSL_SGMII_doSoftReset (macPortNum);
+        while (CSL_SGMII_getSoftResetStatus (macPortNum) != 0);
+
+        /* Hold the port in soft reset and set up
+        * the SGMII control register:
+        *      (1) Enable Master Mode (default)
+        */
+        CSL_SGMII_startRxTxSoftReset (macPortNum);
+        CSL_SGMII_enableMasterMode (macPortNum);
+        if (cpswLpbkMode != CPSW_LOOPBACK_NONE)
+        {
+               CSL_SGMII_enableLoopback (macPortNum);
+        }
+
+           /* Setup the Advertised Ability register for this port:
+        *      (1) Enable Full duplex mode
+        *      (2) Speed = 1000M
+        *      (3) Force the Link
+        */
+        sgmiiCfg.bLinkUp        =   1;
+        sgmiiCfg.linkSpeed      =   CSL_SGMII_1000_MBPS;
+        sgmiiCfg.duplexMode     =   CSL_SGMII_FULL_DUPLEX;
+        CSL_SGMII_setAdvAbility (macPortNum, &sgmiiCfg);
+
+        CSL_SGMII_endRxTxSoftReset (macPortNum);
+
+           /* Wait for SGMII Link */
+           do
+           {
+               CSL_SGMII_getStatus(macPortNum, &sgmiiStatus);
+           } while (sgmiiStatus.bIsLinkUp != 1);
+    }
+    else
+    {
+        /* Reset the port before configuring it */
+        CSL_SGMII_doSoftReset (macPortNum);
+        while (CSL_SGMII_getSoftResetStatus (macPortNum) != 0);
+
+        /* Hold the port in soft reset and set up
+        * the SGMII control register:
+        *      (1) Enable Master Mode (default)
+        *      (2) Enable Auto-negotiation
+        */
+        CSL_SGMII_startRxTxSoftReset (macPortNum);
+        if (cpswLpbkMode == CPSW_LOOPBACK_NONE)
+        {
+            CSL_SGMII_disableMasterMode (macPortNum);
+        }
+        else
+        {
+            CSL_SGMII_enableMasterMode (macPortNum);
+
+            if (cpswLpbkMode == CPSW_LOOPBACK_INTERNAL)
+            {
+                   CSL_SGMII_enableLoopback (macPortNum);
+            }
+        }
+
+           /* Setup the Advertised Ability register for this port:
+        *      (1) Enable Full duplex mode
+        *      (2) Enable Auto Negotiation
+        */
+        sgmiiCfg.linkSpeed      =   CSL_SGMII_1000_MBPS;
+        sgmiiCfg.duplexMode     =   CSL_SGMII_FULL_DUPLEX;
+        CSL_SGMII_setAdvAbility (macPortNum, &sgmiiCfg);
+
+        CSL_SGMII_enableAutoNegotiation (macPortNum);
+        CSL_SGMII_endRxTxSoftReset (macPortNum);
+
+           /* Wait for SGMII Link */
+        if (!cpswSimTest && ((cpswLpbkMode == CPSW_LOOPBACK_EXTERNAL) || (cpswLpbkMode == CPSW_LOOPBACK_NONE)))
+        {
+               do
+               {
+                   CSL_SGMII_getStatus(macPortNum, &sgmiiStatus);
+               } while (sgmiiStatus.bIsLinkUp != 1);
+
+               /* Wait for SGMII Autonegotiation to complete without error */
+               do
+               {
+                   CSL_SGMII_getStatus(macPortNum, &sgmiiStatus);
+                   if (sgmiiStatus.bIsAutoNegError != 0)
+                       return -1;
+               } while (sgmiiStatus.bIsAutoNegComplete != 1);
+        }
+    }
+
+    /* All done with configuration. Return Now. */
+    return 0;
+}
+
+int Init_MAC (uint32_t macPortNum, uint8_t macAddress[6], uint32_t mtu)
+{
+    /* Reset MAC Sliver 0 */
+    CSL_CPGMAC_SL_resetMac (macPortNum);
+    while (CSL_CPGMAC_SL_isMACResetDone (macPortNum) != TRUE);
+
+    /* Setup the MAC Control Register for this port:
+     *      (1) Enable Full duplex
+     *      (2) Enable GMII
+     *      (3) Enable Gigabit
+     *      (4) Enable External Configuration. This enables
+     *          the "Full duplex" and "Gigabit" settings to be
+     *          controlled externally from SGMII
+     *      (5) Don't enable any control/error/short frames
+     */
+    CSL_CPGMAC_SL_enableFullDuplex (macPortNum);
+    CSL_CPGMAC_SL_enableGMII (macPortNum);
+    CSL_CPGMAC_SL_enableGigabit (macPortNum);
+    CSL_CPGMAC_SL_enableExtControl (macPortNum);
+
+    /* Configure the MAC address for this port */
+    CSL_CPSW_3GF_setPortMACAddress (macPortNum, macAddress);
+
+    /* Configure VLAN ID/CFI/Priority.
+     *
+     * For now, we are not using VLANs so just configure them
+     * to all zeros.
+     */
+    CSL_CPSW_3GF_setPortVlanReg (macPortNum, 0, 0, 0);
+
+    /* Configure the Receive Maximum length on this port,
+     * i.e., the maximum size the port can receive without
+     * any errors.
+     *
+     * Set the Rx Max length to the MTU configured for the
+     * interface.
+     */
+    CSL_CPGMAC_SL_setRxMaxLen (macPortNum, mtu);
+
+    /* Done setting up the MAC port */
+    return 0;
+}
+
+void Init_Switch (uint32_t mtu)
+{
+    CSL_CPSW_3GF_PORTSTAT               portStatCfg;
+
+    /* Enable the CPPI port, i.e., port 0 that does all
+     * the data streaming in/out of EMAC.
+     */
+    CSL_CPSW_3GF_enablePort0 ();
+    CSL_CPSW_3GF_disableVlanAware ();
+    CSL_CPSW_3GF_setPort0VlanReg (0, 0, 0);
+    CSL_CPSW_3GF_setPort0RxMaxLen (mtu);
+
+    /* Enable statistics on both the port groups:
+     *
+     * MAC Sliver ports -   Port 1, Port 2
+     * CPPI Port        -   Port 0
+     */
+    portStatCfg.p0AStatEnable   =   1;
+    portStatCfg.p0BStatEnable   =   1;
+    portStatCfg.p1StatEnable    =   1;
+    portStatCfg.p2StatEnable    =   1;
+    CSL_CPSW_3GF_setPortStatsEnableReg (&portStatCfg);
+
+    /* Setup the Address Lookup Engine (ALE) Configuration:
+     *      (1) Enable ALE.
+     *      (2) Clear stale ALE entries.
+     *      (3) Disable VLAN Aware lookups in ALE since
+     *          we are not using VLANs by default.
+     *      (4) No Flow control
+     *      (5) Configure the Unknown VLAN processing
+     *          properties for the switch, i.e., which
+     *          ports to send the packets to.
+     */
+    CSL_CPSW_3GF_enableAle ();
+    CSL_CPSW_3GF_clearAleTable ();
+
+    CSL_CPSW_3GF_disableAleVlanAware ();
+    CSL_CPSW_3GF_disableAleTxRateLimit ();
+    CSL_CPSW_3GF_setAlePrescaleReg (125000000u/1000u);
+    CSL_CPSW_3GF_setAleUnkownVlanReg (7, 3, 3, 7);
+
+    if(cpswLpbkMode != CPSW_LOOPBACK_NONE)
+        CSL_CPSW_3GF_enableAleBypass();
+
+    /* Done with switch configuration */
+    return;
+}
+
+int Switch_update_addr (uint32_t portNum, uint8_t macAddress[6], Uint16 add)
+{
+    uint32_t                              i;
+    CSL_CPSW_3GF_ALE_PORTCONTROL        alePortControlCfg;
+    CSL_CPSW_3GF_ALE_UNICASTADDR_ENTRY  ucastAddrCfg;
+
+
+    /* Configure the address in "Learning"/"Forward" state */
+    alePortControlCfg.portState             =   ALE_PORTSTATE_FORWARD;
+    alePortControlCfg.dropUntaggedEnable    =   0;
+    alePortControlCfg.vidIngressCheckEnable =   0;
+    alePortControlCfg.noLearnModeEnable     =   (cpswLpbkMode != CPSW_LOOPBACK_NONE)?1:0;
+    alePortControlCfg.mcastLimit            =   0;
+    alePortControlCfg.bcastLimit            =   0;
+
+    CSL_CPSW_3GF_setAlePortControlReg (portNum, &alePortControlCfg);
+
+    if (cpswLpbkMode != CPSW_LOOPBACK_NONE)
+    {
+        /* Program the ALE with the MAC address.
+        *
+        * The ALE entries determine the switch port to which any
+        * matching received packet must be forwarded to.
+        */
+        /* Get the next free ALE entry to program */
+        for (i = 0; i < CSL_CPSW_3GF_NUMALE_ENTRIES; i++)
+        {
+            if (CSL_CPSW_3GF_getALEEntryType (i) == ALE_ENTRYTYPE_FREE)
+            {
+                /* Found a free entry */
+                break;
+            }
+        }
+        if (i == CSL_CPSW_3GF_NUMALE_ENTRIES)
+        {
+            /* No free ALE entry found. return error. */
+            return -1;
+        }
+        else
+        {
+            /* Found a free ALE entry to program our MAC address */
+            memcpy (ucastAddrCfg.macAddress, macAddress, 6);    // Set the MAC address
+            ucastAddrCfg.ucastType      =      ALE_UCASTTYPE_UCAST_NOAGE;   // Add a permanent unicast address entryALE_UCASTTYPE_UCAST_NOAGE.
+            ucastAddrCfg.secureEnable   =      FALSE;
+            ucastAddrCfg.blockEnable    =      FALSE;
+            ucastAddrCfg.portNumber     =      portNum;   // Add the ALE entry for this port
+
+            /* Setup the ALE entry for this port's MAC address */
+            CSL_CPSW_3GF_setAleUnicastAddrEntry (i, &ucastAddrCfg);
+        }
+    }
+
+    /* Done with upading address */
+    return 0;
+}
+
+int32_t Init_SGMII_SERDES(void)
+{
+    if (cpswSimTest)
+    {
+
+           /* Unlock the chip configuration registers to allow SGMII SERDES registers to
+           * be written */
+           CSL_BootCfgUnlockKicker();
+
+        CSL_BootCfgSetSGMIIConfigPLL (0x00000041);
+        CSL_BootCfgSetSGMIIRxConfig (0, 0x00700621);
+        CSL_BootCfgSetSGMIITxConfig (0, 0x000108A1);
+        CSL_BootCfgSetSGMIIRxConfig (1, 0x00700621);
+        CSL_BootCfgSetSGMIITxConfig (1, 0x000108A1);
+
+           /* Re-lock the chip configuration registers to prevent unintentional writes */
+           CSL_BootCfgLockKicker();
+
+    }
+
+       /* SGMII SERDES Configuration complete. Return. */
+       return 0;
+}
+
+int32_t Init_Cpsw (void)
+{
+    uint32_t       macPortNum, mtu = 1518;
+    uint8_t        mac_address[6];
+    uint8_t        sw_port0_mac_addr[6] = {0x10, 0x11, 0x12, 0x13, 0x14, 0x15};
+
+       /* Initialize the SERDES modules */
+       Init_SGMII_SERDES();
+
+    platform_get_macaddr(PLATFORM_MAC_TYPE_EFUSE, mac_address);
+
+    /* Initialize the SGMII/Sliver submodules for the
+     * two corresponding MAC ports.
+     */
+    for (macPortNum = 0; macPortNum < NUM_MAC_PORTS; macPortNum++)
+    {
+       if (Init_sgmii (macPortNum))
+                 return -1;
+        mac_address[5] += macPortNum;
+        Init_MAC (macPortNum, mac_address, mtu);
+        mac_address[5] -= macPortNum;
+    }
+
+    /* Setup the Ethernet switch finally. */
+    Init_Switch (mtu);
+
+    Switch_update_addr(0, sw_port0_mac_addr, 0);
+    Switch_update_addr(1, mac_address, 0);
+    mac_address[5] += 1;
+    Switch_update_addr(2, mac_address, 0);
+
+    /* CPSW subsystem setup done. Return success */
+    return 0;
+}
+
+
+/******************************************************************************
+ * Function:    post_test_emac_loopback
+ ******************************************************************************/
+POST_TEST_RESULT
+post_test_emac_loopback
+(
+    void
+)
+{
+    uint8_t   test_buf[POST_EMAC_TEST_PKT_LENGTH+14];
+    uint8_t   sw_port0_mac_addr[6] = {0x10, 0x11, 0x12, 0x13, 0x14, 0x15};
+    uint8_t   mac_address[6];
+    NET_DRV_DEVICE nDevice;
+    uint32_t modNum;
+    int32_t  ret;
+
+    /* Note that if the sgmii power enable is requested the PA must be
+     * powered up first */
+    modNum = 8;
+    if (modNum == TARGET_PWR_ETH(x))  {
+        ret = (int32_t)pscEnableModule (TARGET_PWR_PA);
+        if (ret != 0)
+            return (POST_TEST_RESULT_FAILED);
+    }
+
+    ret = (int32_t)pscEnableModule(modNum);
+    if (ret != 0)
+        return (POST_TEST_RESULT_FAILED);
+
+    Init_Cpsw();
+
+    /* Queue manager configuration */
+    hwQmSetup ((qmConfig_t *)(targetGetQmConfig()));
+    targetInitQs ();
+
+
+    /* Cpdma configuration. */
+    hwCpdmaRxConfig ((cpdmaRxCfg_t *)targetGetCpdmaRxConfig());
+    hwCpdmaTxConfig ((cpdmaTxCfg_t *)targetGetCpdmaTxConfig());
+
+
+    /* Packet accelerator configuration. If PA is not present this statement is defined
+     * to void in target.h */
+    targetPaConfig(sw_port0_mac_addr);
+
+    /* Streaming switch configuration. If not present this statement is defined to void
+     * in target.h.  If present this is usually defined to a series of register writes */
+    hwConfigStreamingSwitch();
+
+    /* Initialize the network device driver */
+    memset (&nDevice, 0, sizeof(nDevice));
+
+    /* Start the networking device */
+    if (cpmac_drv_start(&nDevice) < 0)
+    {
+        return POST_TEST_RESULT_FAILED;
+    }
+
+    /* Get the MAC address from efuse */
+    platform_get_macaddr(PLATFORM_MAC_TYPE_EFUSE, mac_address);
+
+    /* Set the dest MAC address to be broadcast, so that PA firmware will not filter out */
+    memset(test_buf, 0xff, 6);
+    memcpy(&test_buf[6], sw_port0_mac_addr, 6);
+
+    /* set the payload length to 256 bytes */
+    test_buf[12] = 0x01;
+    test_buf[13] = 0x00;
+
+    /* Send the Ethernet packet */
+    if (cpmac_drv_send (&nDevice, test_buf, POST_EMAC_TEST_PKT_LENGTH+14) < 0)
+    {
+        return POST_TEST_RESULT_FAILED;
+    }
+    
+    platform_delay(100);
+    
+    /* Receive the loopback packet */
+    if (ret = cpmac_drv_receive (&nDevice, test_buf) < 0)
+    {
+        return POST_TEST_RESULT_FAILED;
+    }
+
+    return POST_TEST_RESULT_PASSED;
 }
 
 void
@@ -438,7 +892,7 @@ main
     platform_init_flags     init_flags;
     platform_init_config    init_config;
     POST_TEST_ID            test_id = POST_TEST_IN_PROGRESS;
-    Bool                    test_passed = TRUE;
+    POST_TEST_RESULT        test_result;
     uint32_t                reset_type;
     int32_t                 i;
     char                    msg[9];
@@ -450,6 +904,8 @@ main
     memset(&init_config, 0, sizeof(platform_init_config));
     memset(&init_flags, 0x01, sizeof(platform_init_flags));
 
+    init_flags.phy = 0;
+
     /* Initialize the platform */
     if (platform_init(&init_flags, &init_config) != Platform_EOK)
     {
@@ -468,7 +924,7 @@ main
             test_id = POST_TEST_GENERAL;
             break;
         }
-        test_passed = FALSE;
+        test_result = POST_TEST_RESULT_FAILED;
     }
 
     platform_uart_init();
@@ -530,21 +986,29 @@ main
     }
 
     /* Display test in progress UART/LED status or init error */
-    post_display_status(test_id, test_passed);
+    post_display_status(test_id, POST_TEST_RESULT_STARTED);
+
+    post_display_status(POST_TEST_EEPROM, POST_TEST_RESULT_STARTED);
+    test_result = post_test_eeprom();
+    post_display_status(POST_TEST_EEPROM, test_result);
 
-    test_passed = post_test_external_memory();
-    post_display_status(POST_TEST_DDR, test_passed);
+    post_display_status(POST_TEST_NOR, POST_TEST_RESULT_STARTED);
+    test_result = post_test_nor();
+    post_display_status(POST_TEST_NOR, test_result);
 
-    test_passed = post_test_eeprom();
-    post_display_status(POST_TEST_EEPROM, test_passed);
+    post_display_status(POST_TEST_NAND, POST_TEST_RESULT_STARTED);
+    test_result = post_test_nand();
+    post_display_status(POST_TEST_NAND, test_result);
 
-    test_passed = post_test_nor();
-    post_display_status(POST_TEST_NOR, test_passed);
+    post_display_status(POST_TEST_EMAC_LOOPBACK, POST_TEST_RESULT_STARTED);
+    test_result = post_test_emac_loopback();
+    post_display_status(POST_TEST_EMAC_LOOPBACK, test_result);
 
-    test_passed = post_test_nand();
-    post_display_status(POST_TEST_NAND, test_passed);
+    post_display_status(POST_TEST_DDR, POST_TEST_RESULT_STARTED);
+    test_result = post_test_external_memory();
+    post_display_status(POST_TEST_DDR, test_result);
 
-    post_display_status(POST_TEST_COMPLETE, TRUE);
+    post_display_status(POST_TEST_COMPLETE, POST_TEST_RESULT_PASSED);
 
     post_write_serial_no();
 }
diff --git a/post/src/psc.c b/post/src/psc.c
new file mode 100644 (file)
index 0000000..08ff0ec
--- /dev/null
@@ -0,0 +1,334 @@
+/***********************************************************************************
+ * FILE PURPOSE: Driver for the PSC module
+ ***********************************************************************************
+ * FILE NAME: psc.c
+ *
+ * DESCRIPTION: The boot loader PSC driver
+ *
+ * Copyright (C) 2006, Texas Instruments, Inc.
+ * @file psc.c
+ *
+ * @brief
+ *   The PSC 2.0.x driver
+ *
+ *  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 "types.h"
+#include "platform.h"
+#include "pscapi.h"
+#include "pscloc.h"
+#include "target.h"
+
+
+#define DEVICE_REG32_W(x,y)   *(volatile unsigned int *)(x)=(y)
+#define DEVICE_REG32_R(x)    (*(volatile unsigned int *)(x))
+
+/***********************************************************************************
+ * FUNCTION PURPOSE: Wait!
+ ***********************************************************************************
+ * DESCRIPTION: This function doesn't do didly. It loops around for a bit
+ *              to give transitions some time to occur.
+ *              This function always returns 1.
+ ***********************************************************************************/
+int16_t pscDelay (void)
+{
+  volatile uint32_t i;
+  for (i = 0; i < 100; i++);
+
+  return (0);
+
+} /* pscDelay */
+
+
+/***********************************************************************************
+ * FUNCTION PURPOSE: Wait for end of transitional state
+ ***********************************************************************************
+ * DESCRIPTION: Polls pstat for the selected domain and waits for transitions
+ *              to be complete.
+ *
+ *              Since this is boot loader code it is *ASSUMED* that interrupts
+ *              are disabled and no other core is mucking around with the psc
+ *              at the same time.
+ *
+ *              Returns 0 when the domain is free. Returns -1 if a timeout
+ *              occurred waiting for the completion.
+ ***********************************************************************************/
+int16_t pscWait (uint32_t domainNum)
+{
+  uint32_t retry;
+  uint32_t ptstat;
+
+  /* Do nothing if the power domain is in transition. This should never
+   * happen since the boot code is the only software accesses psc.
+   * It's still remotely possible that the hardware state machines initiate transitions.
+   * Don't trap if the domain (or a module in this domain) is
+   * stuck in transition.  */
+  retry = 0;
+
+  do  {
+
+    ptstat = DEVICE_REG32_R (DEVICE_PSC_BASE + PSC_REG_PSTAT);
+    ptstat = ptstat & (1 << domainNum);
+
+  } while ((ptstat != 0) &&  ((retry += pscDelay ()) < PSC_PTSTAT_TIMEOUT_LIMIT));
+
+  if (retry >= PSC_PTSTAT_TIMEOUT_LIMIT)
+    return (-1);
+
+  return (0);
+
+} /* pscWait */
+
+
+/***********************************************************************************
+ * FUNCTION PURPOSE: Return the PSC state
+ ***********************************************************************************
+ * DESCRIPTION: Checks the power state of the module
+ ***********************************************************************************/
+BOOL pscModuleIsEnabled (uint32_t modNum)
+{
+  uint32_t domainNum;
+  uint32_t mdstat;
+
+  /* Get the power domain associated with the module number */
+  domainNum = DEVICE_REG32_R (DEVICE_PSC_BASE + PSC_REG_MDCFG(modNum));
+  domainNum = PSC_REG_MDCFG_GET_PD (domainNum);
+
+  /* Wait for the status of the domain/module to be non-transitional,
+   * but don't trap if stuck in a transitional state. */
+  pscWait (domainNum);
+
+  mdstat = DEVICE_REG32_R (DEVICE_PSC_BASE + PSC_REG_MDSTAT(modNum));
+  mdstat = PSC_REG_MDSTAT_GET_STATUS (mdstat);
+
+  if ((mdstat == PSC_REG_VAL_MDSTAT_STATE_ON) ||
+      (mdstat == PSC_REG_VAL_MDSTAT_STATE_ENABLE_IN_PROG))
+      return (TRUE);
+
+  else
+
+    return (FALSE);
+
+} /* pscModuleIsEnabled */
+
+
+
+
+/***********************************************************************************
+ * FUNCTION PURPOSE: Power up/down a module
+ ***********************************************************************************
+ * DESCRIPTION: Powers up/down the requested module and the associated power domain
+ *              if required. No action is taken it the module is already
+ *              powered up/down.
+ *
+ *              This only controls modules. The domain in which the module
+ *              resides will be left in the power on state. Multiple modules
+ *              can exist in a power domain, so powering down the domain based
+ *              on a single module is not done.
+ *
+ *              Returns 0 on success, -1 if the module can't be powered up, or
+ *              if there is a timeout waiting for the transition.
+ ***********************************************************************************/
+int16_t pscSetState (uint32_t modNum, uint32_t state)
+{
+
+  uint32_t domainNum;
+  uint32_t pdctl;
+  uint32_t mdctl;
+  uint32_t ptcmd;
+  uint32_t resetIso;
+  uint32_t v;
+
+  /* Get the power domain associated with the module number, and reset
+   * isolation functionality */
+  v         = DEVICE_REG32_R (DEVICE_PSC_BASE + PSC_REG_MDCFG(modNum));
+  domainNum = PSC_REG_MDCFG_GET_PD (v);
+  resetIso  = PSC_REG_MDCFG_GET_RESET_ISO(v);
+
+
+  /* Wait for the status of the domain/module to be non-transitional */
+  if (pscWait (domainNum) != 0)
+    return (-1);
+
+
+  /* Perform configuration even if the current status matches the existing state */
+
+
+  /* Set the next state of the power domain to on. It's OK if the domain
+   * is always on. This code will not ever power down a domain, so no change
+   * is made if the new state is power down. */
+  if (state == PSC_REG_VAL_MDCTL_NEXT_ON)  {
+      pdctl = DEVICE_REG32_R (DEVICE_PSC_BASE + PSC_REG_PDCTL(domainNum));
+      pdctl = PSC_REG_PDCTL_SET_NEXT(pdctl, PSC_REG_VAL_PDCTL_NEXT_ON);
+      DEVICE_REG32_W (DEVICE_PSC_BASE + PSC_REG_PDCTL(domainNum), pdctl);
+  }
+
+
+  /* Set the next state for the module to enabled/disabled */
+  mdctl = DEVICE_REG32_R (DEVICE_PSC_BASE + PSC_REG_MDCTL(modNum));
+  mdctl = PSC_REG_MDCTL_SET_NEXT (mdctl, state);
+  mdctl = PSC_REG_MDCTL_SET_RESET_ISO (mdctl, resetIso);
+  DEVICE_REG32_W (DEVICE_PSC_BASE + PSC_REG_MDCTL(modNum), mdctl);
+
+  /* Trigger the enable */
+  ptcmd = DEVICE_REG32_R (DEVICE_PSC_BASE + PSC_REG_PTCMD);
+  ptcmd |= (uint32_t)(1<<domainNum);
+  DEVICE_REG32_W (DEVICE_PSC_BASE + PSC_REG_PTCMD, ptcmd);
+
+
+  /* Wait on the complete */
+  return (pscWait (domainNum));
+
+} /* pscSetState*/
+
+
+/***********************************************************************************
+ * FUNCTION PURPOSE: Power up a module
+ ***********************************************************************************
+ * DESCRIPTION: Powers up the requested module and the associated power domain
+ *              if required. No action is taken it the module is already
+ *              powered up.
+ *
+ *              Returns 0 on success, -1 if the module can't be powered up, or
+ *              if there is a timeout waiting for the transition.
+ ***********************************************************************************/
+int16_t pscEnableModule (uint32_t modNum)
+{
+
+  return (pscSetState (modNum, PSC_REG_VAL_MDCTL_NEXT_ON));
+
+} /* pscEnableModule */
+
+/************************************************************************************
+ * FUNCTION PURPOSE: Power down a module
+ ************************************************************************************
+ * DESCRIPTION: Powers down the requested module.
+ *
+ *              Returns 0 on success, -1 on failure or timeout.
+ ************************************************************************************/
+int16_t pscDisableModule (uint32_t modNum)
+{
+  uint32_t mdctl;
+
+  /* Set the bit to apply reset */
+  mdctl = DEVICE_REG32_R (DEVICE_PSC_BASE + PSC_REG_MDCTL(modNum));
+  mdctl = PSC_REG_MDCTL_SET_LRSTZ(mdctl,0);
+  DEVICE_REG32_W (DEVICE_PSC_BASE + PSC_REG_MDCTL(modNum), mdctl);
+
+  return (pscSetState (modNum, PSC_REG_VAL_MDCTL_NEXT_SWRSTDISABLE));
+
+} /* pscDisableModule */
+
+
+/************************************************************************************
+ * FUNCTION PURPOSE: Set the reset isolation bit in mdctl
+ ************************************************************************************
+ * DESCRIPTION: The reset isolation enable bit is set. The state of the module
+ *              is not changed. Returns 0 if the module config showed that
+ *              reset isolation is supported. Returns 1 otherwise. This is not
+ *              an error, but setting the bit in mdctl has no effect.
+ ************************************************************************************/
+int16_t pscSetResetIso (uint32_t modNum)
+{
+  uint32_t v;
+  uint32_t mdctl;
+
+  /* Set the reset isolation bit */
+  mdctl = DEVICE_REG32_R (DEVICE_PSC_BASE + PSC_REG_MDCTL(modNum));
+  mdctl = PSC_REG_MDCTL_SET_RESET_ISO (mdctl, 1);
+  DEVICE_REG32_W (DEVICE_PSC_BASE + PSC_REG_MDCTL(modNum), mdctl);
+
+  v = DEVICE_REG32_R (DEVICE_PSC_BASE + PSC_REG_MDCFG(modNum));
+  if (PSC_REG_MDCFG_GET_RESET_ISO(v) == 1)
+    return (0);
+
+  return (1);
+
+} /* pscSetResetIso */
+
+/*************************************************************************************
+ * FUNCTION PURPOSE: Disable a power domain
+ *************************************************************************************
+ * DESCRIPTION: The power domain is disabled
+ *************************************************************************************/
+int16_t pscDisableDomain (uint32_t domainNum)
+{
+  uint32_t pdctl;
+  uint32_t ptcmd;
+
+  pdctl = DEVICE_REG32_R (DEVICE_PSC_BASE + PSC_REG_PDCTL(domainNum));
+  pdctl = PSC_REG_PDCTL_SET_NEXT (pdctl, PSC_REG_VAL_PDCTL_NEXT_OFF);
+  pdctl = PSC_REG_PDCTL_SET_PDMODE (pdctl, PSC_REG_VAL_PDCTL_PDMODE_SLEEP);
+  DEVICE_REG32_W (DEVICE_PSC_BASE + PSC_REG_PDCTL(domainNum), pdctl);
+
+  ptcmd = DEVICE_REG32_R (DEVICE_PSC_BASE + PSC_REG_PTCMD);
+  ptcmd |= (uint32_t)(1<<domainNum);
+  DEVICE_REG32_W (DEVICE_PSC_BASE + PSC_REG_PTCMD, ptcmd);
+
+  return (0);
+
+} /* pscDisableDomain */
+
+
+/*************************************************************************************
+ * FUNCTION PURPOSE: Power down a domain
+ *************************************************************************************
+ * DESCRIPTION: The specified power domain is set to the disabled state
+ *************************************************************************************/
+void pscDisableModAndDomain (uint32_t modNum, uint32_t domainNum)
+{
+  uint32_t pdctl;
+  uint32_t ptcmd;
+  uint32_t mdctl;
+
+
+  mdctl = DEVICE_REG32_R (DEVICE_PSC_BASE + PSC_REG_MDCTL(modNum));
+  mdctl = PSC_REG_MDCTL_SET_NEXT(mdctl, PSC_REG_VAL_MDCTL_NEXT_SWRSTDISABLE);
+  mdctl = PSC_REG_MDCTL_SET_LRSTZ(mdctl,0);
+  DEVICE_REG32_W (DEVICE_PSC_BASE + PSC_REG_MDCTL(modNum), mdctl);
+
+
+  pdctl = DEVICE_REG32_R (DEVICE_PSC_BASE + PSC_REG_PDCTL(domainNum));
+  pdctl = PSC_REG_PDCTL_SET_NEXT (pdctl, PSC_REG_VAL_PDCTL_NEXT_OFF);
+  pdctl = PSC_REG_PDCTL_SET_PDMODE (pdctl, PSC_REG_VAL_PDCTL_PDMODE_SLEEP);
+
+  DEVICE_REG32_W (DEVICE_PSC_BASE + PSC_REG_PDCTL(domainNum), pdctl);
+
+  ptcmd = DEVICE_REG32_R (DEVICE_PSC_BASE + PSC_REG_PTCMD);
+  ptcmd |= (uint32_t)(1<<domainNum);
+  DEVICE_REG32_W (DEVICE_PSC_BASE + PSC_REG_PTCMD, ptcmd);
+
+
+  /* Wait on the complete */
+  pscWait (domainNum);
+
+}
+
+
diff --git a/post/src/qm.c b/post/src/qm.c
new file mode 100644 (file)
index 0000000..b2e29f4
--- /dev/null
@@ -0,0 +1,214 @@
+/******************************************************************************************
+ * FILE PURPOSE: Boot queue manager driver
+ ******************************************************************************************
+ * FILE NAME: qm.c
+ *
+ * DESCRIPTION: The boot loader queue manager driver. This driver uses a very simple
+ *                             setup on the queue manager, with a single link ram and a single
+ *                             memory region. The descriptors are configured as host descriptors
+ *                             and have the minimum 32 byte size.
+ *
+ *              For the boot driver queue register C is not written. It is important
+ *              to the boot loader if packets are pushed/popped from the head or
+ *              tail of a queue.
+ *
+ ******************************************************************************************/
+#include "types.h"
+#include "platform.h"
+#include "qm_loc.h"
+#include "qm_api.h"
+#include "target.h"
+#include <string.h>
+
+/*******************************************************************************************
+ * FUNCTION PURPOSE: Pop a descriptor off of a queue
+ *******************************************************************************************
+ * DESCRIPTION: The descriptor is read from queue register D.
+ *******************************************************************************************/
+qmHostDesc_t *hwQmQueuePop (uint32_t qnum)
+{
+    qmHostDesc_t *hd;
+    uint32_t        uhd;
+
+    /* Strip the descriptor size info */
+    uhd = DEVICE_REG32_R (DEVICE_QM_MANAGER_QUEUES_BASE + QM_REG_QUEUE_REGD(qnum));
+    uhd = uhd & ~0xf;
+    hd  = (qmHostDesc_t *)uhd;
+
+    return (hd);
+} /* hwQmQueuePop */
+
+/*******************************************************************************************
+ * FUNCTION PURPOSE: Return the number of descriptors on a queue
+ *******************************************************************************************
+ * DESCRIPTION: The queue count is returned
+ *******************************************************************************************/
+uint32_t  hwQmQueueCount (uint32_t qnum)
+{
+    uint32_t rega;
+
+    rega = DEVICE_REG32_R (DEVICE_QM_QUEUE_STATUS_BASE + QM_REG_QUEUE_REGA(qnum));
+    rega = BOOT_READ_BITFIELD (rega, QM_QA_ENTRY_COUNT_MSB, QM_QA_ENTRY_COUNT_LSB);
+    return (rega);
+
+} /* hwQmQueueCount */
+
+/*******************************************************************************************
+ * FUNCTION PURPOSE: Set a queue threshold
+ *******************************************************************************************
+ * DESCRIPTION: The queue threshold is enabled. Only high threshold is set, with a threshold
+ *                             value of 1.
+ *******************************************************************************************/
+int16_t hwQmInitThreshold (uint32_t qnum)
+{
+       DEVICE_REG32_W (DEVICE_QM_QUEUE_STATUS_BASE + QM_REG_STAT_CFG_REGD(qnum), 0x81);
+
+       return (0);
+
+} /* hwQmInitThreshold */
+
+
+/*******************************************************************************************
+ * FUNCTION PURPOSE: Push a descriptor onto a queue
+ *******************************************************************************************
+ * DESCRIPTION: The descriptor is written to queue register D. No check is made to see
+ *              if the queue number is valid.
+ *******************************************************************************************/
+void hwQmQueuePush (qmHostDesc_t *hd, uint32_t qnum, uint32_t descrSize)
+{
+       uint32_t regd;
+
+       regd = ((uint32_t) hd | ((descrSize >> 4) - 1));
+
+    /* Push the descriptor onto the queue */
+    DEVICE_REG32_W (DEVICE_QM_MANAGER_QUEUES_BASE + QM_REG_QUEUE_REGD(qnum), regd);
+
+} /* hwQmQueuePush */
+
+/*******************************************************************************************
+ * FILE PURPOSE: Setup the queue manager
+ *******************************************************************************************
+ * DESCRIPTION: The queue manager is setup using a single linking ram and memory region,
+ *              with fixed descriptor initialization.
+ *
+ *              Since the linking ram and descriptor regions are configured, it is assumed
+ *              that all queues are currently empty.
+ *
+ ********************************************************************************************/
+int16_t hwQmSetup (qmConfig_t *cfg)
+{
+    uint32_t v;
+    uint32_t w;
+    uint32_t x;
+    uint32_t i;
+    qmHostDesc_t *hd;
+
+    /* Verify that alignment requirements */
+    if ( (cfg->linkRamBase & (QM_LINKRAM_ALIGN-1))  !=  0 )
+        return (QM_INVALID_LINKRAM_ALIGNMENT);
+
+    if ( (cfg->memRegionBase & (QM_MEMR_ALIGN-1))   !=  0 )
+        return (QM_INVALID_MEMREGION_ALIGNMENT);
+
+    /* Verify linkram sizing is in range */
+    if ( (cfg->linkRamSize & ~QM_REG_LINKRAM_SIZE_MAX_MASK)  != 0 )
+        return (QM_INVALID_LINKRAM_SIZE);
+
+    /* Verify there is enough linkram to cover the single memory region */
+    if (cfg->linkRamSize < cfg->memRegNumDescriptors)
+        return (QM_INVALID_LINKRAM_RAM_SIZE);
+
+
+    /* Linking RAM info */
+    DEVICE_REG32_W (DEVICE_QM_MANAGER_BASE + QM_REG_LINKRAM_BASE(0), cfg->linkRamBase);
+    DEVICE_REG32_W (DEVICE_QM_MANAGER_BASE + QM_REG_LINKRAM_SIZE(0), cfg->linkRamSize);
+    DEVICE_REG32_W (DEVICE_QM_MANAGER_BASE + QM_REG_LINKRAM_BASE(1), 0);
+
+    /* Memory region 0 info */
+    DEVICE_REG32_W (DEVICE_QM_DESC_SETUP_BASE + QM_REG_MEMR_BASE_ADDR(0), cfg->memRegionBase);
+    DEVICE_REG32_W (DEVICE_QM_DESC_SETUP_BASE + QM_REG_MEMR_START_IDX(0), 0);
+
+    /* Calculate the 2 fields in the descriptor setup register. Bits 0-3 specifiy
+     * the total memory size rounded up to the next higher power of two, and
+     * is expresses as 2^(n - 5). So for example if you have 20 descriptors
+     * The next higher power of 2 that exceeds this is 32, which is 2^5, so the value 0 (5-5)
+     * is placed in this field */
+    v = (31 - chipLmbd (1, cfg->memRegNumDescriptors));
+    if (v >= 4)
+      v = v - 4;
+    else
+      v = 0;
+
+    /* Add the descriptor size field */
+    QM_REG_VAL_DESC_SETUP_SET_DESC_SIZE(v, QM_DESC_SIZE_BYTES);
+
+    DEVICE_REG32_W (DEVICE_QM_DESC_SETUP_BASE + QM_REG_MEMR_DESC_SETUP(0), v);
+
+
+    /* Now format the descriptors and put them in a queue */
+    for (i = 0, v = cfg->memRegionBase; i < cfg->memRegNumDescriptors; i++, v += QM_DESC_SIZE_BYTES)  {
+
+        hd = (qmHostDesc_t *)v;
+        memset (hd, 0, sizeof(qmHostDesc_t));
+
+        hd->descInfo   = QM_DESC_DEFAULT_DESCINFO;
+        hd->packetInfo = QM_DESC_DEFAULT_PINFO;
+
+        if (QM_DESC_INFO_GET_PSINFO_LOC(hd->descInfo) == QM_DESC_PSINFO_IN_DESCR)  {
+               if (QM_PKT_INFO_GET_EPIB(hd->packetInfo) == QM_DESC_PINFO_EPIB)
+                       w = QM_DESC_SIZE_BYTES - 32 - 16;  /* 32 bytes min descriptor size, 16 bytes extended info */
+               else
+                       w = QM_DESC_SIZE_BYTES - 32;
+        }  else
+               w = 0;
+
+               QM_PKT_INFO_SET_PSINFO_SIZE(hd->packetInfo, (w >> 2));
+
+
+        /* Push the descriptor onto the queue */
+        x = deviceLocalAddrToGlobal (v);
+
+        DEVICE_REG32_W (DEVICE_QM_MANAGER_QUEUES_BASE + QM_REG_QUEUE_REGD(cfg->destQ), x);
+
+    }
+
+    return (QM_OK);
+
+} /* hwQmSetup */
+
+
+/****************************************************************************************
+ * FUNCTION PURPOSE: Disable the QM
+ ****************************************************************************************
+ * DESCRIPTION: The QM is reset by clearing the linking ram and region 0 information
+ ****************************************************************************************/
+void hwQmTeardown (void)
+{
+    uint32_t i;
+
+    /* Linking RAM info */
+    for (i = 0; i < DEVICE_QM_NUM_LINKRAMS; i++)  {
+        DEVICE_REG32_W (DEVICE_QM_MANAGER_BASE + QM_REG_LINKRAM_BASE(i), 0);
+        DEVICE_REG32_W (DEVICE_QM_MANAGER_BASE + QM_REG_LINKRAM_SIZE(i), 0);
+    }
+
+    /* Memory region info */
+    for (i = 0; i < DEVICE_QM_NUM_MEMREGIONS; i++)  {
+        DEVICE_REG32_W (DEVICE_QM_DESC_SETUP_BASE + QM_REG_MEMR_BASE_ADDR(i),  0);
+        DEVICE_REG32_W (DEVICE_QM_DESC_SETUP_BASE + QM_REG_MEMR_START_IDX(i),  0);
+        DEVICE_REG32_W (DEVICE_QM_DESC_SETUP_BASE + QM_REG_MEMR_DESC_SETUP(i), 0);
+    }
+
+} /* hwQmTeardown */
+
+
+
+
+
+
+
+
+
+
+
+
index bdcc488b56016d9c4ddfd55730421bfbf95b7227..7be3cfa1808fe708a190aca539a69896cd1d7084 100644 (file)
@@ -59,9 +59,9 @@ Steps to re-build eepromwriter:
           export PATH=$PATH:/c/Program\ Files/Texas\ Instruments/ccsv5/tools/compiler/c6000/bin/
     3) variable PFORM_LIB_DIR should be set the directory of the Platform Library root, e.g.
        Linux bash shell: 
-          export PFORM_LIB_DIR=pdk_C6670_1_0_0_10-rc1/packages/ti/platform
+          export PFORM_LIB_DIR=pdk_C66xx_1_0_0_10-rc1/packages/ti/platform
        MSYS bash shell: 
-          export PFORM_LIB_DIR='"C:/Program Files/Texas Instruments/pdk_C6670_1_0_0_10-rc1/packages/ti/platform"'
+          export PFORM_LIB_DIR='"C:/Program Files/Texas Instruments/pdk_C66xx_1_0_0_10-rc1/packages/ti/platform"'
 
     The makefile for building the eepromwriter is in the directory "tools/writer/eeprom/evmc66xxl"
     Following are the steps to build eepromwriter, e.g.:
index d12f64c287b6e6b8fb929322a7292d053cd4485e..31dd3502c8a93ca8e7ca0deefafb24056e7adcc2 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/>
@@ -39,6 +39,7 @@
                                                                <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_C6670_INSTALL_DIR}/packages/ti/platform&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6670_INSTALL_DIR}/packages&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROJECT_ROOT}/../include&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"/>
@@ -65,9 +66,7 @@
                                                                <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.evm6670" 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_C6670_INSTALL_DIR}/packages&quot;"/>
-                                                               </option>
+                                                               <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"/>
                                                        </tool>
                                                </toolChain>
                                        </folderInfo>
@@ -76,6 +75,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">
index aca05b42822bc06dff7fef1b23fb76802b93b649..17a9b8880c5f51fd5a4ae5e1eeeb015d71191795 100644 (file)
@@ -55,7 +55,7 @@ SRCDIR = ../src
 SRC_FILES = eepromwriter.c 
 
 VPATH = $(SRCDIR)
-INCL = -I $(CLIB_INC) $(patsubst %,-I%,$(VPATH)) -I $(PFORM_LIB_DIR) -I ../include
+INCL = -I $(CLIB_INC) $(patsubst %,-I%,$(VPATH)) -I $(PFORM_LIB_DIR)/../../ -I $(PFORM_LIB_DIR) -I ../include
 
 OBJS = $(patsubst %.c,$(OBJ_DIR)/%.obj,$(filter %.c, $(SRC_FILES)))
 OBJS += $(patsubst %.s,$(OBJ_DIR)/%.obj,$(filter %.s, $(SRC_FILES)))
index b3df2e790e097a86ca619b8c191fd6837036f766..9bdb3883257843a90350eaa3d59b591614baffed 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/>
@@ -39,6 +39,7 @@
                                                                <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;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6678_INSTALL_DIR}/packages&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROJECT_ROOT}/../include&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"/>
@@ -65,9 +66,7 @@
                                                                <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>
+                                                               <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"/>
                                                        </tool>
                                                </toolChain>
                                        </folderInfo>
@@ -76,6 +75,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">
index aca05b42822bc06dff7fef1b23fb76802b93b649..17a9b8880c5f51fd5a4ae5e1eeeb015d71191795 100644 (file)
@@ -55,7 +55,7 @@ SRCDIR = ../src
 SRC_FILES = eepromwriter.c 
 
 VPATH = $(SRCDIR)
-INCL = -I $(CLIB_INC) $(patsubst %,-I%,$(VPATH)) -I $(PFORM_LIB_DIR) -I ../include
+INCL = -I $(CLIB_INC) $(patsubst %,-I%,$(VPATH)) -I $(PFORM_LIB_DIR)/../../ -I $(PFORM_LIB_DIR) -I ../include
 
 OBJS = $(patsubst %.c,$(OBJ_DIR)/%.obj,$(filter %.c, $(SRC_FILES)))
 OBJS += $(patsubst %.s,$(OBJ_DIR)/%.obj,$(filter %.s, $(SRC_FILES)))
index dbba3be93a7e21948f7bcffb6771a54df0deced1..3fcbcb04a81ca15329ed3da6905e5fb6f6148a18 100644 (file)
@@ -38,7 +38,6 @@
 #ifndef _TYPES_H
 #define _TYPES_H
 
-typedef uint32_t   Bool;
 #define FALSE 0
 #define TRUE  1
 
index 5646a0e1b53d974e0b53f534682e1404083afb97..a1df7a8933d84e35615a86c531c63956948b7c22 100644 (file)
@@ -46,6 +46,7 @@
 #include <string.h>
 #include "platform.h"
 #include "types.h"
+#include "ti/csl/csl_semAux.h"
 
 /* EEPROM writer utility version */
 char version[] = "01.00.00.03";
@@ -99,6 +100,28 @@ void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes)
     }
 }
 
+void Osal_platformSpiCsEnter(void)
+{
+    /* Get the hardware semaphore.
+     *
+     * Acquire Multi core CPPI synchronization lock
+     */
+    while ((CSL_semAcquireDirect (3)) == 0);
+
+    return;
+}
+
+void Osal_platformSpiCsExit (void)
+{
+    /* Release the hardware semaphore
+     *
+     * Release multi-core lock.
+     */
+    CSL_semReleaseSemaphore (3);
+
+    return;
+}
+
 /******************************************************************************
  * Function:    print_platform_errno
  ******************************************************************************/
index 709263e07329dd95f7d29940572fdef2daa54fec..c0bae643f3908ab489a5681ff357ef550bc2ee39 100644 (file)
@@ -57,9 +57,9 @@ Steps to re-build nandwriter:
           export PATH=$PATH:/c/Program\ Files/Texas\ Instruments/ccsv5/tools/compiler/c6000/bin/
     3) variable PFORM_LIB_DIR should be set the directory of the Platform Library root, e.g.
        Linux bash shell: 
-          export PFORM_LIB_DIR=pdk_C6670_1_0_0_10-rc1/packages/ti/platform
+          export PFORM_LIB_DIR=pdk_C66xx_1_0_0_10-rc1/packages/ti/platform
        MSYS bash shell: 
-          export PFORM_LIB_DIR='"C:/Program Files/Texas Instruments/pdk_C667x_1_0_0_10-rc1/packages/ti/platform"'
+          export PFORM_LIB_DIR='"C:/Program Files/Texas Instruments/pdk_C66xx_1_0_0_10-rc1/packages/ti/platform"'
 
     The makefile for building the nandwriter is in the directory "tools/writer/nand/evmc66xxl"
     Following are the steps to build nandwriter, e.g.:
index 82805bed6786308139bbc1f59fadaa54528716b8..fedc64a718224021adf8528a5539670ad2ab4258 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/>
@@ -39,6 +39,7 @@
                                                                <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_C6670_INSTALL_DIR}/packages/ti/platform&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6670_INSTALL_DIR}/packages&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROJECT_ROOT}/../include&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"/>
@@ -65,9 +66,7 @@
                                                                <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.evm6670" 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_C6670_INSTALL_DIR}/packages&quot;"/>
-                                                               </option>
+                                                               <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"/>
                                                        </tool>
                                                </toolChain>
                                        </folderInfo>
index 060788c9e7c08108248aca865846eb3edfdf8278..e58718d01d2072506dba608073322e6826ff7681 100644 (file)
@@ -55,7 +55,7 @@ SRCDIR = ../src
 SRC_FILES = nandwriter.c 
 
 VPATH = $(SRCDIR)
-INCL = -I $(CLIB_INC) $(patsubst %,-I%,$(VPATH)) -I $(PFORM_LIB_DIR) -I ../include
+INCL = -I $(CLIB_INC) $(patsubst %,-I%,$(VPATH)) -I $(PFORM_LIB_DIR)/../../ -I $(PFORM_LIB_DIR) -I ../include
 
 OBJS = $(patsubst %.c,$(OBJ_DIR)/%.obj,$(filter %.c, $(SRC_FILES)))
 OBJS += $(patsubst %.s,$(OBJ_DIR)/%.obj,$(filter %.s, $(SRC_FILES)))
index 8722dc21c1cea0f279928924a2d91cb6f8920099..951446e16c4261f893d3c4e086e3635e42a54e7c 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/>
@@ -39,6 +39,7 @@
                                                                <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;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6678_INSTALL_DIR}/packages&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROJECT_ROOT}/../include&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"/>
@@ -65,9 +66,7 @@
                                                                <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>
+                                                               <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"/>
                                                        </tool>
                                                </toolChain>
                                        </folderInfo>
index 060788c9e7c08108248aca865846eb3edfdf8278..e58718d01d2072506dba608073322e6826ff7681 100644 (file)
@@ -55,7 +55,7 @@ SRCDIR = ../src
 SRC_FILES = nandwriter.c 
 
 VPATH = $(SRCDIR)
-INCL = -I $(CLIB_INC) $(patsubst %,-I%,$(VPATH)) -I $(PFORM_LIB_DIR) -I ../include
+INCL = -I $(CLIB_INC) $(patsubst %,-I%,$(VPATH)) -I $(PFORM_LIB_DIR)/../../ -I $(PFORM_LIB_DIR) -I ../include
 
 OBJS = $(patsubst %.c,$(OBJ_DIR)/%.obj,$(filter %.c, $(SRC_FILES)))
 OBJS += $(patsubst %.s,$(OBJ_DIR)/%.obj,$(filter %.s, $(SRC_FILES)))
index dbba3be93a7e21948f7bcffb6771a54df0deced1..3fcbcb04a81ca15329ed3da6905e5fb6f6148a18 100644 (file)
@@ -38,7 +38,6 @@
 #ifndef _TYPES_H
 #define _TYPES_H
 
-typedef uint32_t   Bool;
 #define FALSE 0
 #define TRUE  1
 
index 21692de8628772b69fc7866542da25c13fa54597..bb7e7380c099738ae984de7a9335a1f46f74843f 100644 (file)
@@ -45,6 +45,7 @@
 #include <string.h>
 #include "platform.h"
 #include "types.h"
+#include "ti/csl/csl_semAux.h"
 
 /* NAND writer utility version */
 char version[] = "01.00.00.03";
@@ -100,6 +101,28 @@ void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes)
     }
 }
 
+void Osal_platformSpiCsEnter(void)
+{
+    /* Get the hardware semaphore.
+     *
+     * Acquire Multi core CPPI synchronization lock
+     */
+    while ((CSL_semAcquireDirect (3)) == 0);
+
+    return;
+}
+
+void Osal_platformSpiCsExit (void)
+{
+    /* Release the hardware semaphore
+     *
+     * Release multi-core lock.
+     */
+    CSL_semReleaseSemaphore (3);
+
+    return;
+}
+
 /******************************************************************************
  * Function:    print_platform_errno
  ******************************************************************************/
index f88787921a33d6594e187c60cf9bb788075d95b9..e2c534a2659c5aa0582fa0bc25a88fb22c85c14a 100644 (file)
@@ -58,9 +58,9 @@ Steps to re-build norwriter:
           export PATH=$PATH:/c/Program\ Files/Texas\ Instruments/ccsv5/tools/compiler/c6000/bin/
     3) variable PFORM_LIB_DIR should be set the directory of the Platform Library root, e.g.
        Linux bash shell: 
-          export PFORM_LIB_DIR=pdk_C6670_1_0_0_10-rc1/packages/ti/platform
+          export PFORM_LIB_DIR=pdk_C66xx_1_0_0_10-rc1/packages/ti/platform
        MSYS bash shell: 
-          export PFORM_LIB_DIR='"C:/Program Files/Texas Instruments/pdk_C667x_1_0_0_10-rc1/packages/ti/platform"'
+          export PFORM_LIB_DIR='"C:/Program Files/Texas Instruments/pdk_C66xx_1_0_0_10-rc1/packages/ti/platform"'
 
     The makefile for building the norwriter is in the directory "tools/writer/nor/evmc66xxl"
     Following are the steps to build norwriter, e.g.:
index 89f87eeed62c71978398a146d4b0b262a38372ab..60c2a771049595d25c5cacc9ba33eff82cea5bdf 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/>
@@ -39,6 +39,7 @@
                                                                <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_C6670_INSTALL_DIR}/packages/ti/platform&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6670_INSTALL_DIR}/packages&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROJECT_ROOT}/../include&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"/>
@@ -65,7 +66,7 @@
                                                                <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.evm6670" 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"/>
+                                                               <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"/>
                                                        </tool>
                                                </toolChain>
                                        </folderInfo>
index d5aedfcb5e31438857392de829845303b19359de..095fd31201734a4992f348381791ac484e97faa7 100644 (file)
@@ -55,7 +55,7 @@ SRCDIR = ../src
 SRC_FILES = norwriter.c 
 
 VPATH = $(SRCDIR)
-INCL = -I $(CLIB_INC) $(patsubst %,-I%,$(VPATH)) -I $(PFORM_LIB_DIR) -I ../include
+INCL = -I $(CLIB_INC) $(patsubst %,-I%,$(VPATH)) -I $(PFORM_LIB_DIR)/../../ -I $(PFORM_LIB_DIR) -I ../include
 
 OBJS = $(patsubst %.c,$(OBJ_DIR)/%.obj,$(filter %.c, $(SRC_FILES)))
 OBJS += $(patsubst %.s,$(OBJ_DIR)/%.obj,$(filter %.s, $(SRC_FILES)))
index 4969bbd81b19d2c9275d70102909c92d9f20ecbe..921842a2282e957b91f5e417555f3cff98350686 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/>
@@ -39,6 +39,7 @@
                                                                <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;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${TI_PDK_C6678_INSTALL_DIR}/packages&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROJECT_ROOT}/../include&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"/>
@@ -65,9 +66,7 @@
                                                                <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>
+                                                               <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"/>
                                                        </tool>
                                                </toolChain>
                                        </folderInfo>
index d5aedfcb5e31438857392de829845303b19359de..095fd31201734a4992f348381791ac484e97faa7 100644 (file)
@@ -55,7 +55,7 @@ SRCDIR = ../src
 SRC_FILES = norwriter.c 
 
 VPATH = $(SRCDIR)
-INCL = -I $(CLIB_INC) $(patsubst %,-I%,$(VPATH)) -I $(PFORM_LIB_DIR) -I ../include
+INCL = -I $(CLIB_INC) $(patsubst %,-I%,$(VPATH)) -I $(PFORM_LIB_DIR)/../../ -I $(PFORM_LIB_DIR) -I ../include
 
 OBJS = $(patsubst %.c,$(OBJ_DIR)/%.obj,$(filter %.c, $(SRC_FILES)))
 OBJS += $(patsubst %.s,$(OBJ_DIR)/%.obj,$(filter %.s, $(SRC_FILES)))
index dbba3be93a7e21948f7bcffb6771a54df0deced1..3fcbcb04a81ca15329ed3da6905e5fb6f6148a18 100644 (file)
@@ -38,7 +38,6 @@
 #ifndef _TYPES_H
 #define _TYPES_H
 
-typedef uint32_t   Bool;
 #define FALSE 0
 #define TRUE  1
 
index c27e2289bf6f461ad577050f9eda1ea87a223b5f..c8847eef1bdb162e8b537a47bd6ded23d79e399d 100644 (file)
@@ -44,7 +44,8 @@
 #include <stdio.h>
 #include <string.h>
 #include "platform.h"
-#include "../include/types.h"
+#include "types.h"
+#include "ti/csl/csl_semAux.h"
 
 /* NOR writer utility version */
 char version[] = "01.00.00.02";
@@ -97,6 +98,28 @@ void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes)
     }
 }
 
+void Osal_platformSpiCsEnter(void)
+{
+    /* Get the hardware semaphore.
+     *
+     * Acquire Multi core CPPI synchronization lock
+     */
+    while ((CSL_semAcquireDirect (3)) == 0);
+
+    return;
+}
+
+void Osal_platformSpiCsExit (void)
+{
+    /* Release the hardware semaphore
+     *
+     * Release multi-core lock.
+     */
+    CSL_semReleaseSemaphore (3);
+
+    return;
+}
+
 /******************************************************************************
  * Function:    print_platform_errno
  ******************************************************************************/