summaryrefslogtreecommitdiffstats
path: root/post
diff options
context:
space:
mode:
authorHao Zhang2013-02-07 13:16:41 -0600
committerHao Zhang2013-02-07 13:16:41 -0600
commit399d4686e11a9fbdf75e8c22f78aa8ffcc9496c4 (patch)
treed8af35622c2f73df0c1c5afc37129a6cb0f905a2 /post
parent0287581d7b08245c9312fde79d4055a3f2008e1e (diff)
downloadmcsdk-tools-399d4686e11a9fbdf75e8c22f78aa8ffcc9496c4.tar.gz
mcsdk-tools-399d4686e11a9fbdf75e8c22f78aa8ffcc9496c4.tar.xz
mcsdk-tools-399d4686e11a9fbdf75e8c22f78aa8ffcc9496c4.zip
MCSDK 3.0: add DDR test and emac loopback test support for evmk2h
Diffstat (limited to 'post')
-rwxr-xr-xpost/docs/README.txt4
-rwxr-xr-xpost/evmk2h/.ccsproject11
-rwxr-xr-xpost/evmk2h/.cproject101
-rwxr-xr-xpost/evmk2h/.project107
-rwxr-xr-xpost/evmk2h/bin/post.rmd11
-rwxr-xr-xpost/evmk2h/bin/post_i2crom.map.pp25
-rwxr-xr-xpost/evmk2h/bin/post_image.rmd10
-rwxr-xr-xpost/evmk2h/bin/post_romparse.bat44
-rwxr-xr-xpost/evmk2h/bin/post_romparse.sh43
-rwxr-xr-xpost/evmk2h/macros.ini1
-rwxr-xr-xpost/evmk2h/post.cmd83
-rwxr-xr-x[-rw-r--r--]post/include/cpdma_loc.h1
-rwxr-xr-xpost/include/post.h6
-rwxr-xr-x[-rw-r--r--]post/include/target.h13
-rwxr-xr-x[-rw-r--r--]post/src/cpdma.c5
-rwxr-xr-xpost/src/post.c60
16 files changed, 498 insertions, 27 deletions
diff --git a/post/docs/README.txt b/post/docs/README.txt
index a53bb09..77a392f 100755
--- a/post/docs/README.txt
+++ b/post/docs/README.txt
@@ -51,11 +51,11 @@ Steps to program POST to EEPROM:
51 boot the POST directly from the EEPROM after POR. The boot status and test result can be monitored using the Hyper 51 boot the POST directly from the EEPROM after POR. The boot status and test result can be monitored using the Hyper
52 Terminal as mentioned in "Steps to run POST in CCSv5". 52 Terminal as mentioned in "Steps to run POST in CCSv5".
53 53
54Please refer to C6678L/C6670L/C6657L/TCI6634K2K EVM boot mode dip switch settings: 54Please refer to C6678L/C6670L/C6657L/TCI6636K2H EVM boot mode dip switch settings:
55http://processors.wiki.ti.com/index.php/TMDXEVM6678L_EVM_Hardware_Setup#Boot_Mode_Dip_Switch_Settings 55http://processors.wiki.ti.com/index.php/TMDXEVM6678L_EVM_Hardware_Setup#Boot_Mode_Dip_Switch_Settings
56http://processors.wiki.ti.com/index.php/TMDXEVM6670L_EVM_Hardware_Setup#Boot_Mode_Dip_Switch_Settings 56http://processors.wiki.ti.com/index.php/TMDXEVM6670L_EVM_Hardware_Setup#Boot_Mode_Dip_Switch_Settings
57http://processors.wiki.ti.com/index.php/TMDSEVM6657L_EVM_Hardware_Setup#Boot_Mode_Dip_Switch_Settings 57http://processors.wiki.ti.com/index.php/TMDSEVM6657L_EVM_Hardware_Setup#Boot_Mode_Dip_Switch_Settings
58http://processors.wiki.ti.com/index.php/TMDSEVMK2K_EVM_Hardware_Setup#Boot_Mode_Dip_Switch_Settings (TBD) 58http://processors.wiki.ti.com/index.php/TCI6636K2H_EVM_Hardware_Setup#Boot_Mode_Dip_Switch_Settings (TBD)
59 59
60and User's Guide for more details: 60and User's Guide for more details:
61http://processors.wiki.ti.com/index.php/BIOS_MCSDK_x.0_User_Guide \ No newline at end of file 61http://processors.wiki.ti.com/index.php/BIOS_MCSDK_x.0_User_Guide \ No newline at end of file
diff --git a/post/evmk2h/.ccsproject b/post/evmk2h/.ccsproject
new file mode 100755
index 0000000..e82706d
--- /dev/null
+++ b/post/evmk2h/.ccsproject
@@ -0,0 +1,11 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<?ccsproject version="1.0"?>
3
4<projectOptions>
5<deviceVariant value="com.ti.ccstudio.deviceModel.C6000.CustomC6000Device"/>
6<deviceEndianness value="little"/>
7<codegenToolVersion value="7.2.4"/>
8<isElfFormat value="true"/>
9<rts value="rts6600_elf.lib"/>
10<deviceFamily value="C6000"/>
11</projectOptions>
diff --git a/post/evmk2h/.cproject b/post/evmk2h/.cproject
new file mode 100755
index 0000000..2809d20
--- /dev/null
+++ b/post/evmk2h/.cproject
@@ -0,0 +1,101 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<?fileVersion 4.0.0?>
3
4<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
5 <storageModule configRelations="2" moduleId="org.eclipse.cdt.core.settings">
6 <cconfiguration id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1869204513">
7 <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1869204513" moduleId="org.eclipse.cdt.core.settings" name="Release">
8 <macros>
9 <stringMacro name="TI_MCSDK_POST_DIR" type="VALUE_PATH_DIR" value="${PROJECT_ROOT}/../.."/>
10 </macros>
11 <externalSettings/>
12 <extensions>
13 <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>
14 <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
15 <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
16 <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
17 </extensions>
18 </storageModule>
19 <storageModule moduleId="org.eclipse.cdt.core.pathentry"/>
20 <storageModule moduleId="cdtBuildSystem" version="4.0.0">
21 <configuration artifactExtension="out" artifactName="../bin/post_evmk2h" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" errorParsers="com.ti.ccstudio.errorparser.LinkErrorParser;com.ti.ccstudio.errorparser.CoffErrorParser;com.ti.ccstudio.errorparser.AsmErrorParser" id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1869204513" name="Release" parent="com.ti.ccstudio.buildDefinitions.C6000.Debug">
22 <folderInfo id="com.ti.ccstudio.buildDefinitions.C6000.Debug.1869204513." name="/" resourcePath="">
23 <toolChain id="com.ti.ccstudio.buildDefinitions.C6000_7.3.exe.DebugToolchain.2001978243" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.C6000_7.3.exe.linkerDebug.673602521">
24 <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.275808649" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
25 <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=com.ti.ccstudio.deviceModel.C6000.CustomC6000Device"/>
26 <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
27 <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
28 <listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.1.0.01"/>
29 <listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=post.cmd"/>
30 <listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
31 <listOptionValue builtIn="false" value="RTSC_PRODUCTS=ti.pdk:1.0.0.05;com.ti.rtsc.NDK:2.21.1.38;com.ti.rtsc.SYSBIOS:6.33.6.50;"/>
32 <listOptionValue builtIn="false" value="OUTPUT_TYPE=rtscApplication:executable"/>
33 </option>
34 <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.510961119" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="7.3.4" valueType="string"/>
35 <targetPlatform id="com.ti.ccstudio.buildDefinitions.C6000_7.3.library.targetPlatformDebug.608323310" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.library.targetPlatformDebug"/>
36 <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.C6000_7.3.library.builderDebug.1393087542" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.library.builderDebug"/>
37 <tool id="com.ti.ccstudio.buildDefinitions.C6000_7.3.library.compilerDebug.1240614699" name="C6000 Compiler" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.library.compilerDebug">
38 <option id="com.ti.ccstudio.buildDefinitions.C6000_7.3.compilerID.SILICON_VERSION.584293016" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.compilerID.SILICON_VERSION" value="6600" valueType="string"/>
39 <option id="com.ti.ccstudio.buildDefinitions.C6000_7.3.compilerID.DEBUGGING_MODEL.1615818557" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.C6000_7.3.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
40 <option id="com.ti.ccstudio.buildDefinitions.C6000_7.3.compilerID.INCLUDE_PATH.188957506" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.compilerID.INCLUDE_PATH" valueType="includePath">
41 <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/include&quot;"/>
42 <listOptionValue builtIn="false" value="&quot;${TI_PDK_INSTALL_DIR}/packages/ti/platform&quot;"/>
43 <listOptionValue builtIn="false" value="&quot;${TI_PDK_INSTALL_DIR}/packages/&quot;"/>
44 <listOptionValue builtIn="false" value="&quot;${PROJECT_ROOT}/../include&quot;"/>
45 </option>
46 <option id="com.ti.ccstudio.buildDefinitions.C6000_7.3.compilerID.DISPLAY_ERROR_NUMBER.239059691" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
47 <option id="com.ti.ccstudio.buildDefinitions.C6000_7.3.compilerID.DIAG_WARNING.987226579" name="Treat diagnostic &lt;id&gt; as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.compilerID.DIAG_WARNING" valueType="stringList">
48 <listOptionValue builtIn="false" value="225"/>
49 </option>
50 <option id="com.ti.ccstudio.buildDefinitions.C6000_7.3.compilerID.ABI.1312414060" name="Application binary interface (coffabi, eabi) (--abi)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.C6000_7.3.compilerID.ABI.eabi" valueType="enumerated"/>
51 <option id="com.ti.ccstudio.buildDefinitions.C6000_7.3.compilerID.DEFINE.1454674257" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.compilerID.DEFINE" valueType="definedSymbols">
52 <listOptionValue builtIn="false" value="DEVICE_K2H"/>
53 </option>
54 <inputType id="com.ti.ccstudio.buildDefinitions.C6000_7.3.compiler.inputType__C_SRCS.722894367" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.compiler.inputType__C_SRCS"/>
55 <inputType id="com.ti.ccstudio.buildDefinitions.C6000_7.3.compiler.inputType__CPP_SRCS.694247057" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.compiler.inputType__CPP_SRCS"/>
56 <inputType id="com.ti.ccstudio.buildDefinitions.C6000_7.3.compiler.inputType__ASM_SRCS.2019840691" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.compiler.inputType__ASM_SRCS"/>
57 <inputType id="com.ti.ccstudio.buildDefinitions.C6000_7.3.compiler.inputType__ASM2_SRCS.1580376815" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.compiler.inputType__ASM2_SRCS"/>
58 </tool>
59 <tool id="com.ti.ccstudio.buildDefinitions.C6000_7.3.library.librarianDebug.1562059286" name="C6000 Archiver" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.library.librarianDebug">
60 <option id="com.ti.ccstudio.buildDefinitions.C6000_7.3.archiverID.OUTPUT_FILE.263705444" name="Output file" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.archiverID.OUTPUT_FILE" value="&quot;../bin/post_evmk2h.out&quot;" valueType="string"/>
61 </tool>
62 <tool id="com.ti.ccstudio.buildDefinitions.C6000_7.3.exe.linkerDebug.673602521" name="C6000 Linker" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.exe.linkerDebug">
63 <option id="com.ti.ccstudio.buildDefinitions.C6000_7.3.linkerID.OUTPUT_FILE.1242198386" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.linkerID.OUTPUT_FILE" value="&quot;../bin/post_evmk2h.out&quot;" valueType="string"/>
64 <option id="com.ti.ccstudio.buildDefinitions.C6000_7.3.linkerID.MAP_FILE.370881078" name="Input and output sections listed into &lt;file&gt; (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.linkerID.MAP_FILE" value="&quot;../bin/post_evmk2h.map&quot;" valueType="string"/>
65 <option id="com.ti.ccstudio.buildDefinitions.C6000_7.3.linkerID.LIBRARY.412718443" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.linkerID.LIBRARY" valueType="libs">
66 <listOptionValue builtIn="false" value="&quot;ti.platform.evmk2h.lite.lib&quot;"/>
67 <listOptionValue builtIn="false" value="&quot;libc.a&quot;"/>
68 </option>
69 <option id="com.ti.ccstudio.buildDefinitions.C6000_7.3.linkerID.SEARCH_PATH.1859137181" name="Add &lt;dir&gt; to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.C6000_7.3.linkerID.SEARCH_PATH" valueType="stringList">
70 <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/lib&quot;"/>
71 <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/include&quot;"/>
72 <listOptionValue builtIn="false" value="&quot;${TI_PDK_INSTALL_DIR}/packages/ti/platform/evmk2h/platform_lib/lib/debug&quot;"/>
73 </option>
74 </tool>
75 </toolChain>
76 </folderInfo>
77 <sourceEntries>
78 <entry excluding="src/evmc665x_sgmii.c|src/evmc665x_emac.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
79 </sourceEntries>
80 </configuration>
81 </storageModule>
82 <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
83 <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
84 <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
85 </cconfiguration>
86 </storageModule>
87 <storageModule moduleId="cdtBuildSystem" version="4.0.0">
88 <project id="post.com.ti.ccstudio.buildDefinitions.C6000.ProjectType.1742876545" name="C6000" projectType="com.ti.ccstudio.buildDefinitions.C6000.ProjectType"/>
89 </storageModule>
90 <storageModule moduleId="org.eclipse.cdt.core.language.mapping">
91 <project-mappings>
92 <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.asmSource" language="com.ti.ccstudio.core.TIASMLanguage"/>
93 <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cHeader" language="com.ti.ccstudio.core.TIGCCLanguage"/>
94 <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cSource" language="com.ti.ccstudio.core.TIGCCLanguage"/>
95 <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxHeader" language="com.ti.ccstudio.core.TIGPPLanguage"/>
96 <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxSource" language="com.ti.ccstudio.core.TIGPPLanguage"/>
97 </project-mappings>
98 </storageModule>
99 <storageModule moduleId="refreshScope"/>
100 <storageModule moduleId="scannerConfiguration"/>
101</cproject>
diff --git a/post/evmk2h/.project b/post/evmk2h/.project
new file mode 100755
index 0000000..9a86eae
--- /dev/null
+++ b/post/evmk2h/.project
@@ -0,0 +1,107 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<projectDescription>
3 <name>post_evmk2h</name>
4 <comment></comment>
5 <projects>
6 </projects>
7 <buildSpec>
8 <buildCommand>
9 <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
10 <arguments>
11 <dictionary>
12 <key>?name?</key>
13 <value></value>
14 </dictionary>
15 <dictionary>
16 <key>org.eclipse.cdt.make.core.append_environment</key>
17 <value>true</value>
18 </dictionary>
19 <dictionary>
20 <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
21 <value>all</value>
22 </dictionary>
23 <dictionary>
24 <key>org.eclipse.cdt.make.core.buildArguments</key>
25 <value>-k</value>
26 </dictionary>
27 <dictionary>
28 <key>org.eclipse.cdt.make.core.buildCommand</key>
29 <value>${CCS_UTILS_DIR}/bin/gmake</value>
30 </dictionary>
31 <dictionary>
32 <key>org.eclipse.cdt.make.core.buildLocation</key>
33 <value>${BuildDirectory}</value>
34 </dictionary>
35 <dictionary>
36 <key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
37 <value>clean</value>
38 </dictionary>
39 <dictionary>
40 <key>org.eclipse.cdt.make.core.contents</key>
41 <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
42 </dictionary>
43 <dictionary>
44 <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
45 <value>true</value>
46 </dictionary>
47 <dictionary>
48 <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
49 <value>true</value>
50 </dictionary>
51 <dictionary>
52 <key>org.eclipse.cdt.make.core.enableFullBuild</key>
53 <value>true</value>
54 </dictionary>
55 <dictionary>
56 <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
57 <value>all</value>
58 </dictionary>
59 <dictionary>
60 <key>org.eclipse.cdt.make.core.stopOnError</key>
61 <value>false</value>
62 </dictionary>
63 <dictionary>
64 <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
65 <value>true</value>
66 </dictionary>
67 </arguments>
68 </buildCommand>
69 <buildCommand>
70 <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
71 <triggers>full,incremental,</triggers>
72 <arguments>
73 </arguments>
74 </buildCommand>
75 </buildSpec>
76 <natures>
77 <nature>com.ti.ccstudio.managedbuild.core.ccsNature</nature>
78 <nature>com.ti.ccstudio.core.ccsNature</nature>
79 <nature>org.eclipse.cdt.core.cnature</nature>
80 <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
81 <nature>org.eclipse.cdt.core.ccnature</nature>
82 <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
83 </natures>
84 <linkedResources>
85 <link>
86 <name>README.txt</name>
87 <type>1</type>
88 <locationURI>TI_MCSDK_POST_DIR/post/docs/README.txt</locationURI>
89 </link>
90 <link>
91 <name>include</name>
92 <type>2</type>
93 <locationURI>TI_MCSDK_POST_DIR/post/include</locationURI>
94 </link>
95 <link>
96 <name>src</name>
97 <type>2</type>
98 <locationURI>TI_MCSDK_POST_DIR/post/src</locationURI>
99 </link>
100 </linkedResources>
101 <variableList>
102 <variable>
103 <name>TI_MCSDK_POST_DIR</name>
104 <value>$%7BPARENT-2-PROJECT_LOC%7D</value>
105 </variable>
106 </variableList>
107</projectDescription>
diff --git a/post/evmk2h/bin/post.rmd b/post/evmk2h/bin/post.rmd
new file mode 100755
index 0000000..cb5d02d
--- /dev/null
+++ b/post/evmk2h/bin/post.rmd
@@ -0,0 +1,11 @@
1-a
2-boot
3-e _c_int00
4
5ROMS
6{
7 ROM1: org = 0x0400, length = 0x10000, memwidth = 32, romwidth = 32
8 files = { post2.b }
9}
10
11
diff --git a/post/evmk2h/bin/post_i2crom.map.pp b/post/evmk2h/bin/post_i2crom.map.pp
new file mode 100755
index 0000000..90c81c6
--- /dev/null
+++ b/post/evmk2h/bin/post_i2crom.map.pp
@@ -0,0 +1,25 @@
1section
2{
3 param_index = 0
4 boot_mode = 40
5 sw_pll_prediv = 1
6 sw_pll_mult = 16
7 sw_pll_postdiv = 2
8 options = 1
9
10 core_freq_mhz = 625
11 i2c_clk_freq_khz = 200
12
13 dev_addr_ext = 0x50
14
15 multi_i2c_id = 0
16 my_i2c_id = 1
17 address_delay = 0
18 exe_file = "post.i2c.ccs"
19}
20
21
22
23
24
25
diff --git a/post/evmk2h/bin/post_image.rmd b/post/evmk2h/bin/post_image.rmd
new file mode 100755
index 0000000..c174d6c
--- /dev/null
+++ b/post/evmk2h/bin/post_image.rmd
@@ -0,0 +1,10 @@
1-a
2-e _c_int00
3
4ROMS
5{
6 ROM1: org = 0x820000, length = 0x10000, memwidth = 32, romwidth = 32
7 files = { post.b }
8}
9
10
diff --git a/post/evmk2h/bin/post_romparse.bat b/post/evmk2h/bin/post_romparse.bat
new file mode 100755
index 0000000..171e01c
--- /dev/null
+++ b/post/evmk2h/bin/post_romparse.bat
@@ -0,0 +1,44 @@
1set C6000_CG_DIR="C:\ti\ccsv5\tools\compiler\c6000_7.3.4"
2set TARGET=k2h
3set ENDIAN=little
4set IBL_ROOT_DIR="..\..\..\boot_loader\ibl"
5set PATH=%PATH%;%SystemRoot%\system32;%SystemRoot%;
6
7
8@echo off
9
10echo C6000_CG_DIR set as: %C6000_CG_DIR%
11echo TARGET set as: %TARGET%
12echo IBL_ROOT_DIR set as : %IBL_ROOT_DIR%
13
14echo Converting .out to HEX ...
15if %ENDIAN% == little (
16%C6000_CG_DIR%\bin\hex6x -order L post_image.rmd post_evm%TARGET%.out
17) else (
18%C6000_CG_DIR%\bin\hex6x -order M post_image.rmd post_evm%TARGET%.out
19)
20
21%IBL_ROOT_DIR%\src\util\btoccs\b2ccs post.b post.ccs
22
23if %ENDIAN% == little (
24%C6000_CG_DIR%\bin\hex6x -order L post.rmd post_evm%TARGET%.out
25) else (
26%C6000_CG_DIR%\bin\hex6x -order M post.rmd post_evm%TARGET%.out
27)
28
29if %ENDIAN% == little (
30%IBL_ROOT_DIR%\src\util\bconvert\bconvert64x -le post2.b post.b
31) else (
32%IBL_ROOT_DIR%\src\util\bconvert\bconvert64x -be post2.b post.b
33)
34
35%IBL_ROOT_DIR%\src\util\btoccs\b2i2c post.b post.i2c.b
36
37%IBL_ROOT_DIR%\src\util\btoccs\b2ccs post.i2c.b post.i2c.ccs
38
39echo Generating I2C ROM data ...
40%IBL_ROOT_DIR%\src\util\romparse\romparse -rom_base 0x50 post_i2crom.map.pp
41
42%IBL_ROOT_DIR%\src\util\btoccs\ccs2bin -swap i2crom.ccs post_i2crom.bin
43
44rm -f *.ccs *.b
diff --git a/post/evmk2h/bin/post_romparse.sh b/post/evmk2h/bin/post_romparse.sh
new file mode 100755
index 0000000..53cc50b
--- /dev/null
+++ b/post/evmk2h/bin/post_romparse.sh
@@ -0,0 +1,43 @@
1export CGT_INSTALL_DIR=~/ti/ccsv5/tools/compiler/c6000_7.3.4
2export TARGET=k2h
3export ENDIAN=little
4export IBL_ROOT_DIR="../../../boot_loader/ibl"
5
6echo CGT_INSTALL_DIR set as: ${CGT_INSTALL_DIR}
7echo TARGET set as: ${TARGET}
8echo IBL_ROOT_DIR set as : ${IBL_ROOT_DIR}
9
10echo Converting .out to HEX ...
11if [ ${ENDIAN} == little ]
12then
13${CGT_INSTALL_DIR}/bin/hex6x -order L post_image.rmd post_evm${TARGET}.out
14else
15${CGT_INSTALL_DIR}/bin/hex6x -order M post_image.rmd post_evm${TARGET}.out
16fi
17
18${IBL_ROOT_DIR}/src/util/btoccs/b2ccs post.b post.ccs
19
20if [ ${ENDIAN} == little ]
21then
22${CGT_INSTALL_DIR}/bin/hex6x -order L post.rmd post_evm${TARGET}.out
23else
24${CGT_INSTALL_DIR}/bin/hex6x -order M post.rmd post_evm${TARGET}.out
25fi
26
27if [ ${ENDIAN} == little ]
28then
29${IBL_ROOT_DIR}/src/util/bconvert/bconvert64x -le post2.b post.b
30else
31${IBL_ROOT_DIR}/src/util/bconvert/bconvert64x -be post2.b post.b
32fi
33
34${IBL_ROOT_DIR}/src/util/btoccs/b2i2c post.b post.i2c.b
35
36${IBL_ROOT_DIR}/src/util/btoccs/b2ccs post.i2c.b post.i2c.ccs
37
38echo Generating I2C ROM data ...
39${IBL_ROOT_DIR}/src/util/romparse/romparse -rom_base 0x50 post_i2crom.map.pp
40
41${IBL_ROOT_DIR}/src/util/btoccs/ccs2bin -swap i2crom.ccs post_i2crom.bin
42
43rm -f *.ccs *.b
diff --git a/post/evmk2h/macros.ini b/post/evmk2h/macros.ini
new file mode 100755
index 0000000..7c28ad8
--- /dev/null
+++ b/post/evmk2h/macros.ini
@@ -0,0 +1 @@
TI_MCSDK_POST_DIR="../../../../
diff --git a/post/evmk2h/post.cmd b/post/evmk2h/post.cmd
new file mode 100755
index 0000000..9b142c8
--- /dev/null
+++ b/post/evmk2h/post.cmd
@@ -0,0 +1,83 @@
1/******************************************************************************
2 * Copyright (c) 2011 Texas Instruments Incorporated - http://www.ti.com
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 *
11 * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the
14 * distribution.
15 *
16 * Neither the name of Texas Instruments Incorporated nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 *****************************************************************************/
33/*
34 * Linker command file
35 *
36 */
37
38-c
39-heap 0x4000
40-stack 0x4000
41
42/* Memory Map 1 - the default */
43MEMORY
44{
45 L1PSRAM (RWX) : org = 0x0E00000, len = 0x7FFF
46 L1DSRAM (RWX) : org = 0x0F00000, len = 0x7FFF
47
48 L2SRAM (RWX) : org = 0x0830000, len = 0x50000
49 MSMCSRAM (RWX) : org = 0xc000000, len = 0x200000
50 DDR3 (RWX) : org = 0x80000000,len = 0x10000000
51 LINKRAM : origin = 0x10820000, length = 0x0200
52 CPPIRAM : origin = 0x10820200, length = 0x0200
53 PKTRAM : origin = 0x10820400, length = 0x0800
54}
55
56
57SECTIONS
58{
59 .csl_vect > L2SRAM
60 .cppi > CPPIRAM
61 .qmss > L2SRAM
62 .linkram > LINKRAM
63 .mac_buffer > PKTRAM
64 .version > L2SRAM
65 platform_lib> L2SRAM
66 .text > L2SRAM
67 GROUP (NEAR_DP)
68 {
69 .neardata
70 .rodata
71 .bss
72 } load > L2SRAM
73 .stack > L2SRAM
74 .cinit > L2SRAM
75 .cio > L2SRAM
76 .const > L2SRAM
77 .data > L2SRAM
78 .switch > L2SRAM
79 .sysmem > L2SRAM
80 .far > L2SRAM
81 .testMem > L2SRAM
82 .fardata > L2SRAM
83}
diff --git a/post/include/cpdma_loc.h b/post/include/cpdma_loc.h
index 49d78cb..80b7b12 100644..100755
--- a/post/include/cpdma_loc.h
+++ b/post/include/cpdma_loc.h
@@ -11,6 +11,7 @@
11 11
12/* Emulation control register */ 12/* Emulation control register */
13#define CPDMA_REG_EMU_CTL 0x08 13#define CPDMA_REG_EMU_CTL 0x08
14#define CPDMA_REG_QM_BASE_ADDR(x) (0x10 + (x)*0x4)
14 15
15/* CPPI Tx DMA channel control registers */ 16/* CPPI Tx DMA channel control registers */
16#define CPDMA_REG_TCHAN_CFG_REG_A(x) (0x00 + (x)*0x20) 17#define CPDMA_REG_TCHAN_CFG_REG_A(x) (0x00 + (x)*0x20)
diff --git a/post/include/post.h b/post/include/post.h
index 0bbbecb..a24773a 100755
--- a/post/include/post.h
+++ b/post/include/post.h
@@ -35,7 +35,7 @@
35 * POST version definitions 35 * POST version definitions
36 ******************************************************************************/ 36 ******************************************************************************/
37#define POST_EVM_VERSION_MSG " POST Version " 37#define POST_EVM_VERSION_MSG " POST Version "
38#define POST_VERSION "01.00.00.07" 38#define POST_VERSION "01.00.00.08"
39 39
40/****************************************************************************** 40/******************************************************************************
41 * PLL Controller Reset Type Status register 41 * PLL Controller Reset Type Status register
@@ -88,7 +88,7 @@ typedef enum
88} POST_TEST_ID; 88} POST_TEST_ID;
89 89
90#define POST_MAX_NUM_LED 4 /* Total number of LEDs on the EVM */ 90#define POST_MAX_NUM_LED 4 /* Total number of LEDs on the EVM */
91#if (defined(DEVICE_K2K)) 91#if (defined(DEVICE_K2K) || defined(DEVICE_K2H))
92static uint8_t post_led_status[POST_MAX_TEST_NUM][POST_MAX_NUM_LED] = 92static uint8_t post_led_status[POST_MAX_TEST_NUM][POST_MAX_NUM_LED] =
93{ 93{
94 /* LED0: red LED0: green LED1: blue LED2: blue */ 94 /* LED0: red LED0: green LED1: blue LED2: blue */
@@ -159,7 +159,7 @@ static char post_status[POST_MAX_TEST_NUM][POST_STATUS_MAX_NUM_CHAR] =
159/****************************************************************************** 159/******************************************************************************
160 * NAND test definitions 160 * NAND test definitions
161 ******************************************************************************/ 161 ******************************************************************************/
162#if (defined(EVMC6657L) || defined(DEVICE_K2K)) 162#if (defined(EVMC6657L) || defined(DEVICE_K2K) || defined(DEVICE_K2H))
163 #define POST_NAND_TEST_DEVICE_ID PLATFORM_DEVID_MT29F1G08ABCHC /* NAND device ID */ 163 #define POST_NAND_TEST_DEVICE_ID PLATFORM_DEVID_MT29F1G08ABCHC /* NAND device ID */
164 #define POST_NAND_TEST_READ_BLOCK_NUM 0 /* NAND read block number */ 164 #define POST_NAND_TEST_READ_BLOCK_NUM 0 /* NAND read block number */
165 #define POST_NAND_TEST_READ_PAGE_NUM 0 /* NAND read page number */ 165 #define POST_NAND_TEST_READ_PAGE_NUM 0 /* NAND read page number */
diff --git a/post/include/target.h b/post/include/target.h
index 7ec9543..5723a46 100644..100755
--- a/post/include/target.h
+++ b/post/include/target.h
@@ -232,11 +232,24 @@ int32_t chipPllExternalMult (uint16_t pllNum, uint16_t mult);
232#define targetGetSwitchMaxPktSize() 9000 232#define targetGetSwitchMaxPktSize() 9000
233 233
234#define DEVICE_QM 234#define DEVICE_QM
235#if (defined(DEVICE_K2K) || defined(DEVICE_K2H))
236#define DEVICE_QM_MANAGER_BASE 0x02A02000
237#define DEVICE_QM_DESC_SETUP_BASE 0x02A03000
238#define DEVICE_QM_MANAGER_QUEUES_BASE 0x02A80000
239#define DEVICE_QM_MANAGER_Q_PROXY_BASE 0x02AC0000
240#define DEVICE_QM_QUEUE_STATUS_BASE 0x02A40000
241
242/* QM base address register */
243#define DEVICE_QM1_QUEUE_MANAGEMENT_REGS(x) (0x23A00000 + 0x80000 + 0x10000*(x))
244#define DEVICE_QM2_QUEUE_MANAGEMENT_REGS(x) (0x23A00000 + 0xA0000 + 0x10000*(x))
245#else
235#define DEVICE_QM_MANAGER_BASE 0x02a68000 246#define DEVICE_QM_MANAGER_BASE 0x02a68000
236#define DEVICE_QM_DESC_SETUP_BASE 0x02a6a000 247#define DEVICE_QM_DESC_SETUP_BASE 0x02a6a000
237#define DEVICE_QM_MANAGER_QUEUES_BASE 0x02a20000 248#define DEVICE_QM_MANAGER_QUEUES_BASE 0x02a20000
238#define DEVICE_QM_MANAGER_Q_PROXY_BASE 0x02a40000 249#define DEVICE_QM_MANAGER_Q_PROXY_BASE 0x02a40000
239#define DEVICE_QM_QUEUE_STATUS_BASE 0x02a00000 250#define DEVICE_QM_QUEUE_STATUS_BASE 0x02a00000
251#endif
252
240#define DEVICE_QM_NUM_LINKRAMS 2 253#define DEVICE_QM_NUM_LINKRAMS 2
241#define DEVICE_QM_NUM_MEMREGIONS 20 254#define DEVICE_QM_NUM_MEMREGIONS 20
242void *targetGetQmConfig(void); 255void *targetGetQmConfig(void);
diff --git a/post/src/cpdma.c b/post/src/cpdma.c
index 9f444a8..c5c2067 100644..100755
--- a/post/src/cpdma.c
+++ b/post/src/cpdma.c
@@ -148,6 +148,11 @@ int16_t hwCpdmaTxConfig (const cpdmaTxCfg_t *cfg)
148 /* Disable loopback in the tx direction */ 148 /* Disable loopback in the tx direction */
149 DEVICE_REG32_W (cfg->gblCtlBase + CPDMA_REG_EMU_CTL, CPDMA_REG_VAL_EMU_CTL_NO_LOOPBACK); 149 DEVICE_REG32_W (cfg->gblCtlBase + CPDMA_REG_EMU_CTL, CPDMA_REG_VAL_EMU_CTL_NO_LOOPBACK);
150 150
151#if (defined(DEVICE_K2K) || defined(DEVICE_K2H))
152 /* Set QM base address, only for K2x devices */
153 DEVICE_REG32_W (cfg->gblCtlBase + CPDMA_REG_QM_BASE_ADDR(0), DEVICE_QM1_QUEUE_MANAGEMENT_REGS(0));
154#endif
155
151 /* Enable all channels. The current state isn't important */ 156 /* Enable all channels. The current state isn't important */
152 for (i = 0; i < cfg->nTxChans; i++) { 157 for (i = 0; i < cfg->nTxChans; i++) {
153 DEVICE_REG32_W (cfg->txBase + CPDMA_REG_TCHAN_CFG_REG_B(i), 0); /* Priority */ 158 DEVICE_REG32_W (cfg->txBase + CPDMA_REG_TCHAN_CFG_REG_B(i), 0); /* Priority */
diff --git a/post/src/post.c b/post/src/post.c
index fed4b59..0f3c362 100755
--- a/post/src/post.c
+++ b/post/src/post.c
@@ -71,7 +71,7 @@
71#pragma DATA_ALIGN(post_version, 16) 71#pragma DATA_ALIGN(post_version, 16)
72char post_version[] = POST_VERSION; 72char post_version[] = POST_VERSION;
73 73
74#if (defined(DEVICE_K2K)) 74#if (defined(DEVICE_K2K) || defined(DEVICE_K2H))
75/* 75/*
76 * Holds the base address of ports. 76 * Holds the base address of ports.
77 */ 77 */
@@ -240,11 +240,24 @@ post_test_external_memory
240{ 240{
241 POST_TEST_RESULT test_result = POST_TEST_RESULT_PASSED; 241 POST_TEST_RESULT test_result = POST_TEST_RESULT_PASSED;
242 242
243 if(platform_external_memory_test(0, 0) != Platform_EOK) 243#if (defined(DEVICE_K2K) || defined(DEVICE_K2H))
244 /* DDR3A test */
245 if(platform_external_memory_test(0x80000000, 0x88000000) != Platform_EOK)
244 { 246 {
245 test_result = POST_TEST_RESULT_FAILED; 247 test_result = POST_TEST_RESULT_FAILED;
246 } 248 }
247 249
250 /* DDR3B test */
251 if(platform_external_memory_test(0x60000000, 0x68000000) != Platform_EOK)
252 {
253 test_result = POST_TEST_RESULT_FAILED;
254 }
255#else
256 if(platform_external_memory_test(0, 0) != Platform_EOK)
257 {
258 test_result = POST_TEST_RESULT_FAILED;
259 }
260#endif
248 return test_result; 261 return test_result;
249} 262}
250 263
@@ -474,7 +487,7 @@ int32_t Init_sgmii (uint32_t macPortNum)
474 CSL_SGMII_endRxTxSoftReset (macPortNum); 487 CSL_SGMII_endRxTxSoftReset (macPortNum);
475 488
476 /* Wait for SGMII Link */ 489 /* Wait for SGMII Link */
477 if (!cpswSimTest && ((cpswLpbkMode == CPSW_LOOPBACK_EXTERNAL) || (cpswLpbkMode == CPSW_LOOPBACK_NONE))) 490 if (!cpswSimTest)
478 { 491 {
479 do 492 do
480 { 493 {
@@ -516,7 +529,7 @@ int Init_MAC (uint32_t macPortNum, uint8_t macAddress[6], uint32_t mtu)
516 CSL_CPGMAC_SL_enableExtControl (macPortNum); 529 CSL_CPGMAC_SL_enableExtControl (macPortNum);
517 530
518 /* Configure the MAC address for this port */ 531 /* Configure the MAC address for this port */
519#if (defined(DEVICE_K2K)) 532#if (defined(DEVICE_K2K) || defined(DEVICE_K2H))
520 CSL_CPSW_nGF_setPortMACAddress (macPortNum, macAddress); 533 CSL_CPSW_nGF_setPortMACAddress (macPortNum, macAddress);
521#else 534#else
522 CSL_CPSW_3GF_setPortMACAddress (macPortNum, macAddress); 535 CSL_CPSW_3GF_setPortMACAddress (macPortNum, macAddress);
@@ -527,7 +540,7 @@ int Init_MAC (uint32_t macPortNum, uint8_t macAddress[6], uint32_t mtu)
527 * For now, we are not using VLANs so just configure them 540 * For now, we are not using VLANs so just configure them
528 * to all zeros. 541 * to all zeros.
529 */ 542 */
530#if (defined(DEVICE_K2K)) 543#if (defined(DEVICE_K2K) || defined(DEVICE_K2H))
531 CSL_CPSW_nGF_setPortVlanReg (macPortNum, 0, 0, 0); 544 CSL_CPSW_nGF_setPortVlanReg (macPortNum, 0, 0, 0);
532#else 545#else
533 CSL_CPSW_3GF_setPortVlanReg (macPortNum, 0, 0, 0); 546 CSL_CPSW_3GF_setPortVlanReg (macPortNum, 0, 0, 0);
@@ -548,7 +561,7 @@ int Init_MAC (uint32_t macPortNum, uint8_t macAddress[6], uint32_t mtu)
548 561
549void Init_Switch (uint32_t mtu) 562void Init_Switch (uint32_t mtu)
550{ 563{
551#if (defined(DEVICE_K2K)) 564#if (defined(DEVICE_K2K) || defined(DEVICE_K2H))
552 CSL_CPSW_5GF_PORTSTAT portStatCfg; 565 CSL_CPSW_5GF_PORTSTAT portStatCfg;
553#else 566#else
554 CSL_CPSW_3GF_PORTSTAT portStatCfg; 567 CSL_CPSW_3GF_PORTSTAT portStatCfg;
@@ -557,7 +570,7 @@ void Init_Switch (uint32_t mtu)
557 /* Enable the CPPI port, i.e., port 0 that does all 570 /* Enable the CPPI port, i.e., port 0 that does all
558 * the data streaming in/out of EMAC. 571 * the data streaming in/out of EMAC.
559 */ 572 */
560#if (defined(DEVICE_K2K)) 573#if (defined(DEVICE_K2K) || defined(DEVICE_K2H))
561 CSL_CPSW_nGF_enablePort0 (); 574 CSL_CPSW_nGF_enablePort0 ();
562 CSL_CPSW_nGF_disableVlanAware (); 575 CSL_CPSW_nGF_disableVlanAware ();
563 CSL_CPSW_nGF_setPort0VlanReg (0, 0, 0); 576 CSL_CPSW_nGF_setPort0VlanReg (0, 0, 0);
@@ -578,7 +591,7 @@ void Init_Switch (uint32_t mtu)
578 portStatCfg.p0BStatEnable = 1; 591 portStatCfg.p0BStatEnable = 1;
579 portStatCfg.p1StatEnable = 1; 592 portStatCfg.p1StatEnable = 1;
580 portStatCfg.p2StatEnable = 1; 593 portStatCfg.p2StatEnable = 1;
581#if (defined(DEVICE_K2K)) 594#if (defined(DEVICE_K2K) || defined(DEVICE_K2H))
582 CSL_CPSW_nGF_setPortStatsEnableReg (&portStatCfg); 595 CSL_CPSW_nGF_setPortStatsEnableReg (&portStatCfg);
583#else 596#else
584 CSL_CPSW_3GF_setPortStatsEnableReg (&portStatCfg); 597 CSL_CPSW_3GF_setPortStatsEnableReg (&portStatCfg);
@@ -594,7 +607,7 @@ void Init_Switch (uint32_t mtu)
594 * properties for the switch, i.e., which 607 * properties for the switch, i.e., which
595 * ports to send the packets to. 608 * ports to send the packets to.
596 */ 609 */
597#if (defined(DEVICE_K2K)) 610#if (defined(DEVICE_K2K) || defined(DEVICE_K2H))
598 CSL_CPSW_nGF_enableAle (); 611 CSL_CPSW_nGF_enableAle ();
599 CSL_CPSW_nGF_clearAleTable (); 612 CSL_CPSW_nGF_clearAleTable ();
600 613
@@ -613,7 +626,7 @@ void Init_Switch (uint32_t mtu)
613#endif 626#endif
614 627
615 if(cpswLpbkMode != CPSW_LOOPBACK_NONE) 628 if(cpswLpbkMode != CPSW_LOOPBACK_NONE)
616#if (defined(DEVICE_K2K)) 629#if (defined(DEVICE_K2K) || defined(DEVICE_K2H))
617 CSL_CPSW_nGF_enableAleBypass(); 630 CSL_CPSW_nGF_enableAleBypass();
618#else 631#else
619 CSL_CPSW_3GF_enableAleBypass(); 632 CSL_CPSW_3GF_enableAleBypass();
@@ -626,7 +639,7 @@ void Init_Switch (uint32_t mtu)
626int Switch_update_addr (uint32_t portNum, uint8_t macAddress[6], Uint16 add) 639int Switch_update_addr (uint32_t portNum, uint8_t macAddress[6], Uint16 add)
627{ 640{
628 uint32_t i; 641 uint32_t i;
629#if (defined(DEVICE_K2K)) 642#if (defined(DEVICE_K2K) || defined(DEVICE_K2H))
630 CSL_CPSW_5GF_ALE_PORTCONTROL alePortControlCfg; 643 CSL_CPSW_5GF_ALE_PORTCONTROL alePortControlCfg;
631 CSL_CPSW_5GF_ALE_UNICASTADDR_ENTRY ucastAddrCfg; 644 CSL_CPSW_5GF_ALE_UNICASTADDR_ENTRY ucastAddrCfg;
632#else 645#else
@@ -642,7 +655,7 @@ int Switch_update_addr (uint32_t portNum, uint8_t macAddress[6], Uint16 add)
642 alePortControlCfg.mcastLimit = 0; 655 alePortControlCfg.mcastLimit = 0;
643 alePortControlCfg.bcastLimit = 0; 656 alePortControlCfg.bcastLimit = 0;
644 657
645#if (defined(DEVICE_K2K)) 658#if (defined(DEVICE_K2K) || defined(DEVICE_K2H))
646 CSL_CPSW_nGF_setAlePortControlReg (portNum, &alePortControlCfg); 659 CSL_CPSW_nGF_setAlePortControlReg (portNum, &alePortControlCfg);
647#else 660#else
648 CSL_CPSW_3GF_setAlePortControlReg (portNum, &alePortControlCfg); 661 CSL_CPSW_3GF_setAlePortControlReg (portNum, &alePortControlCfg);
@@ -656,13 +669,13 @@ int Switch_update_addr (uint32_t portNum, uint8_t macAddress[6], Uint16 add)
656 * matching received packet must be forwarded to. 669 * matching received packet must be forwarded to.
657 */ 670 */
658 /* Get the next free ALE entry to program */ 671 /* Get the next free ALE entry to program */
659#if (defined(DEVICE_K2K)) 672#if (defined(DEVICE_K2K) || defined(DEVICE_K2H))
660 for (i = 0; i < CSL_CPSW_5GF_NUMALE_ENTRIES; i++) 673 for (i = 0; i < CSL_CPSW_5GF_NUMALE_ENTRIES; i++)
661#else 674#else
662 for (i = 0; i < CSL_CPSW_3GF_NUMALE_ENTRIES; i++) 675 for (i = 0; i < CSL_CPSW_3GF_NUMALE_ENTRIES; i++)
663#endif 676#endif
664 { 677 {
665#if (defined(DEVICE_K2K)) 678#if (defined(DEVICE_K2K) || defined(DEVICE_K2H))
666 if (CSL_CPSW_nGF_getALEEntryType (i) == ALE_ENTRYTYPE_FREE) 679 if (CSL_CPSW_nGF_getALEEntryType (i) == ALE_ENTRYTYPE_FREE)
667#else 680#else
668 if (CSL_CPSW_3GF_getALEEntryType (i) == ALE_ENTRYTYPE_FREE) 681 if (CSL_CPSW_3GF_getALEEntryType (i) == ALE_ENTRYTYPE_FREE)
@@ -672,7 +685,7 @@ int Switch_update_addr (uint32_t portNum, uint8_t macAddress[6], Uint16 add)
672 break; 685 break;
673 } 686 }
674 } 687 }
675#if (defined(DEVICE_K2K)) 688#if (defined(DEVICE_K2K) || defined(DEVICE_K2H))
676 if (i == CSL_CPSW_5GF_NUMALE_ENTRIES) 689 if (i == CSL_CPSW_5GF_NUMALE_ENTRIES)
677#else 690#else
678 if (i == CSL_CPSW_3GF_NUMALE_ENTRIES) 691 if (i == CSL_CPSW_3GF_NUMALE_ENTRIES)
@@ -691,7 +704,7 @@ int Switch_update_addr (uint32_t portNum, uint8_t macAddress[6], Uint16 add)
691 ucastAddrCfg.portNumber = portNum; // Add the ALE entry for this port 704 ucastAddrCfg.portNumber = portNum; // Add the ALE entry for this port
692 705
693 /* Setup the ALE entry for this port's MAC address */ 706 /* Setup the ALE entry for this port's MAC address */
694#if (defined(DEVICE_K2K)) 707#if (defined(DEVICE_K2K) || defined(DEVICE_K2H))
695 CSL_CPSW_nGF_setAleUnicastAddrEntry (i, &ucastAddrCfg); 708 CSL_CPSW_nGF_setAleUnicastAddrEntry (i, &ucastAddrCfg);
696#else 709#else
697 CSL_CPSW_3GF_setAleUnicastAddrEntry (i, &ucastAddrCfg); 710 CSL_CPSW_3GF_setAleUnicastAddrEntry (i, &ucastAddrCfg);
@@ -707,7 +720,7 @@ int32_t Init_SGMII_SERDES(void)
707{ 720{
708 if (cpswSimTest) 721 if (cpswSimTest)
709 { 722 {
710#if (!defined(DEVICE_K2K)) 723#if (!defined(DEVICE_K2K) && !defined(DEVICE_K2H))
711 724
712 /* Unlock the chip configuration registers to allow SGMII SERDES registers to 725 /* Unlock the chip configuration registers to allow SGMII SERDES registers to
713 * be written */ 726 * be written */
@@ -844,9 +857,9 @@ post_test_emac_loopback
844 { 857 {
845 return POST_TEST_RESULT_FAILED; 858 return POST_TEST_RESULT_FAILED;
846 } 859 }
847 860
848 platform_delay(100); 861 platform_delay(100);
849 862
850 /* Receive the loopback packet */ 863 /* Receive the loopback packet */
851 if (ret = cpmac_drv_receive (&nDevice, test_buf) <= 0) 864 if (ret = cpmac_drv_receive (&nDevice, test_buf) <= 0)
852 { 865 {
@@ -1036,7 +1049,7 @@ post_dump_register_val
1036 post_hex_to_string(reg_val, 8, msg); 1049 post_hex_to_string(reg_val, 8, msg);
1037 msg[8] = ' '; 1050 msg[8] = ' ';
1038 msg[9] = 0; 1051 msg[9] = 0;
1039 post_write_uart(msg); 1052 post_write_uart(msg);
1040} 1053}
1041 1054
1042/****************************************************************************** 1055/******************************************************************************
@@ -1067,7 +1080,6 @@ main
1067 memset(&init_config, 0, sizeof(platform_init_config)); 1080 memset(&init_config, 0, sizeof(platform_init_config));
1068 memset(&init_flags, 0x01, sizeof(platform_init_flags)); 1081 memset(&init_flags, 0x01, sizeof(platform_init_flags));
1069 1082
1070 init_flags.phy = 1;
1071 acc_fail = 0; 1083 acc_fail = 0;
1072 1084
1073 /* Initialize the platform */ 1085 /* Initialize the platform */
@@ -1115,7 +1127,7 @@ main
1115 post_write_uart("\r\n\r------------------------------------------"); 1127 post_write_uart("\r\n\r------------------------------------------");
1116 post_write_uart("\r\n\rSOC Information"); 1128 post_write_uart("\r\n\rSOC Information");
1117 post_hex_to_string(info.board_rev, 4, msg); 1129 post_hex_to_string(info.board_rev, 4, msg);
1118 post_write_uart("\r\n\r\nFPGA Version: "); 1130 post_write_uart("\r\n\r\nBMC Version: ");
1119 post_write_uart(msg); 1131 post_write_uart(msg);
1120 1132
1121 if (info.serial_nbr[0] != 0) 1133 if (info.serial_nbr[0] != 0)
@@ -1155,6 +1167,7 @@ main
1155 1167
1156 /* Dump Additional Information */ 1168 /* Dump Additional Information */
1157 post_dump_register_val ((uint32_t)&platform_init_return_code, "\r\n\rPlatform init return code: 0x"); 1169 post_dump_register_val ((uint32_t)&platform_init_return_code, "\r\n\rPlatform init return code: 0x");
1170#if (!defined(DEVICE_K2K) && !defined(DEVICE_K2H))
1158 post_write_uart("\r\n\rAdditional Information: "); 1171 post_write_uart("\r\n\rAdditional Information: ");
1159 post_dump_register_val (0x02350014, "\r\n\r (0x02350014) :"); 1172 post_dump_register_val (0x02350014, "\r\n\r (0x02350014) :");
1160 post_dump_register_val (0x02350624, "\r\n\r (0x02350624) :"); 1173 post_dump_register_val (0x02350624, "\r\n\r (0x02350624) :");
@@ -1180,6 +1193,7 @@ main
1180 post_dump_register_val (0x02620180, "\r\n\r (0x02620180) :"); 1193 post_dump_register_val (0x02620180, "\r\n\r (0x02620180) :");
1181 1194
1182 post_write_uart("\r\n\r------------------------------------------"); 1195 post_write_uart("\r\n\r------------------------------------------");
1196#endif
1183 } 1197 }
1184 1198
1185 post_write_uart("\r\n\r\nPower On Self Test\n"); 1199 post_write_uart("\r\n\r\nPower On Self Test\n");
@@ -1238,6 +1252,8 @@ main
1238 post_write_uart("\r\n\r\nPOST result: FAIL"); 1252 post_write_uart("\r\n\r\nPOST result: FAIL");
1239 } 1253 }
1240 1254
1255#if (!defined(DEVICE_K2K) && !defined(DEVICE_K2H))
1241 post_write_serial_no(); 1256 post_write_serial_no();
1257#endif
1242} 1258}
1243 1259